@loaders.gl/splats 5.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/LICENSE +41 -0
  2. package/README.md +3 -0
  3. package/dist/bundled.d.ts +2 -0
  4. package/dist/bundled.d.ts.map +1 -0
  5. package/dist/bundled.js +5 -0
  6. package/dist/bundled.js.map +1 -0
  7. package/dist/dist.dev.js +20876 -0
  8. package/dist/dist.min.js +18 -0
  9. package/dist/index.cjs +2046 -0
  10. package/dist/index.cjs.map +7 -0
  11. package/dist/index.d.ts +10 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +10 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/ksplat-loader-types.d.ts +42 -0
  16. package/dist/ksplat-loader-types.d.ts.map +1 -0
  17. package/dist/ksplat-loader-types.js +26 -0
  18. package/dist/ksplat-loader-types.js.map +1 -0
  19. package/dist/ksplat-loader.d.ts +22 -0
  20. package/dist/ksplat-loader.d.ts.map +1 -0
  21. package/dist/ksplat-loader.js +13 -0
  22. package/dist/ksplat-loader.js.map +1 -0
  23. package/dist/lib/parse-ksplat.d.ts +7 -0
  24. package/dist/lib/parse-ksplat.d.ts.map +1 -0
  25. package/dist/lib/parse-ksplat.js +312 -0
  26. package/dist/lib/parse-ksplat.js.map +1 -0
  27. package/dist/lib/parse-rad-chunk.d.ts +19 -0
  28. package/dist/lib/parse-rad-chunk.d.ts.map +1 -0
  29. package/dist/lib/parse-rad-chunk.js +514 -0
  30. package/dist/lib/parse-rad-chunk.js.map +1 -0
  31. package/dist/lib/parse-rad.d.ts +120 -0
  32. package/dist/lib/parse-rad.d.ts.map +1 -0
  33. package/dist/lib/parse-rad.js +235 -0
  34. package/dist/lib/parse-rad.js.map +1 -0
  35. package/dist/lib/parse-splat.d.ts +7 -0
  36. package/dist/lib/parse-splat.d.ts.map +1 -0
  37. package/dist/lib/parse-splat.js +58 -0
  38. package/dist/lib/parse-splat.js.map +1 -0
  39. package/dist/lib/parse-spz.d.ts +7 -0
  40. package/dist/lib/parse-spz.d.ts.map +1 -0
  41. package/dist/lib/parse-spz.js +268 -0
  42. package/dist/lib/parse-spz.js.map +1 -0
  43. package/dist/lib/splat-utils.d.ts +12 -0
  44. package/dist/lib/splat-utils.d.ts.map +1 -0
  45. package/dist/lib/splat-utils.js +38 -0
  46. package/dist/lib/splat-utils.js.map +1 -0
  47. package/dist/lib/splats-arrow-table.d.ts +5 -0
  48. package/dist/lib/splats-arrow-table.d.ts.map +1 -0
  49. package/dist/lib/splats-arrow-table.js +132 -0
  50. package/dist/lib/splats-arrow-table.js.map +1 -0
  51. package/dist/rad-loader-types.d.ts +36 -0
  52. package/dist/rad-loader-types.d.ts.map +1 -0
  53. package/dist/rad-loader-types.js +22 -0
  54. package/dist/rad-loader-types.js.map +1 -0
  55. package/dist/rad-loader.d.ts +21 -0
  56. package/dist/rad-loader.d.ts.map +1 -0
  57. package/dist/rad-loader.js +15 -0
  58. package/dist/rad-loader.js.map +1 -0
  59. package/dist/rad-source-loader.d.ts +115 -0
  60. package/dist/rad-source-loader.d.ts.map +1 -0
  61. package/dist/rad-source-loader.js +338 -0
  62. package/dist/rad-source-loader.js.map +1 -0
  63. package/dist/splat-loader-types.d.ts +42 -0
  64. package/dist/splat-loader-types.d.ts.map +1 -0
  65. package/dist/splat-loader-types.js +26 -0
  66. package/dist/splat-loader-types.js.map +1 -0
  67. package/dist/splat-loader.d.ts +22 -0
  68. package/dist/splat-loader.d.ts.map +1 -0
  69. package/dist/splat-loader.js +13 -0
  70. package/dist/splat-loader.js.map +1 -0
  71. package/dist/splats-format.d.ts +43 -0
  72. package/dist/splats-format.d.ts.map +1 -0
  73. package/dist/splats-format.js +46 -0
  74. package/dist/splats-format.js.map +1 -0
  75. package/dist/spz-loader-types.d.ts +44 -0
  76. package/dist/spz-loader-types.d.ts.map +1 -0
  77. package/dist/spz-loader-types.js +26 -0
  78. package/dist/spz-loader-types.js.map +1 -0
  79. package/dist/spz-loader.d.ts +23 -0
  80. package/dist/spz-loader.d.ts.map +1 -0
  81. package/dist/spz-loader.js +12 -0
  82. package/dist/spz-loader.js.map +1 -0
  83. package/dist/types.d.ts +34 -0
  84. package/dist/types.d.ts.map +1 -0
  85. package/dist/types.js +5 -0
  86. package/dist/types.js.map +1 -0
  87. package/dist/unbundled.d.ts +2 -0
  88. package/dist/unbundled.d.ts.map +1 -0
  89. package/dist/unbundled.js +5 -0
  90. package/dist/unbundled.js.map +1 -0
  91. package/package.json +85 -0
  92. package/src/bundled.ts +5 -0
  93. package/src/index.ts +26 -0
  94. package/src/ksplat-loader-types.ts +32 -0
  95. package/src/ksplat-loader.ts +18 -0
  96. package/src/lib/parse-ksplat.ts +538 -0
  97. package/src/lib/parse-rad-chunk.ts +721 -0
  98. package/src/lib/parse-rad.ts +439 -0
  99. package/src/lib/parse-splat.ts +77 -0
  100. package/src/lib/parse-spz.ts +368 -0
  101. package/src/lib/splat-utils.ts +49 -0
  102. package/src/lib/splats-arrow-table.ts +188 -0
  103. package/src/rad-loader-types.ts +27 -0
  104. package/src/rad-loader.ts +24 -0
  105. package/src/rad-source-loader.ts +504 -0
  106. package/src/splat-loader-types.ts +32 -0
  107. package/src/splat-loader.ts +18 -0
  108. package/src/splats-format.ts +51 -0
  109. package/src/spz-loader-types.ts +32 -0
  110. package/src/spz-loader.ts +18 -0
  111. package/src/types.ts +39 -0
  112. package/src/unbundled.ts +5 -0
@@ -0,0 +1,18 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if (typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory();
4
+ else if (typeof define === 'function' && define.amd) define([], factory);
5
+ else if (typeof exports === 'object') exports['loaders'] = factory();
6
+ else root['loaders'] = factory();})(globalThis, function () {
7
+ "use strict";var __exports__=(()=>{var Ig=Object.create;var Bs=Object.defineProperty;var Ag=Object.getOwnPropertyDescriptor;var Bg=Object.getOwnPropertyNames;var Dg=Object.getPrototypeOf,Tg=Object.prototype.hasOwnProperty;var Eg=(r,t,e)=>t in r?Bs(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var d=(r,t)=>()=>(r&&(t=r(r=0)),t);var Rt=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),ye=(r,t)=>{for(var e in t)Bs(r,e,{get:t[e],enumerable:!0})},Qo=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Bg(t))!Tg.call(r,i)&&i!==e&&Bs(r,i,{get:()=>t[i],enumerable:!(n=Ag(t,i))||n.enumerable});return r},ta=(r,t,e)=>(Qo(r,t,"default"),e&&Qo(e,t,"default")),Sl=(r,t,e)=>(e=r!=null?Ig(Dg(r)):{},Qo(t||!r||!r.__esModule?Bs(e,"default",{value:r,enumerable:!0}):e,r)),Og=r=>Qo(Bs({},"__esModule",{value:!0}),r);var Od=(r,t,e)=>(Eg(r,typeof t!="symbol"?t+"":t,e),e);var Fd=Rt((I1,Ld)=>{Ld.exports=globalThis.loaders});var ea,ra,na,wi,xn=d(()=>{"use strict";ea={name:"SPLAT",id:"splat",module:"splats",format:"splat",extensions:["splat"],mimeTypes:["application/octet-stream"],binary:!0},ra={name:"KSPLAT",id:"ksplat",module:"splats",format:"ksplat",extensions:["ksplat"],mimeTypes:["application/octet-stream"],binary:!0},na={name:"SPZ",id:"spz",module:"splats",format:"spz",extensions:["spz"],mimeTypes:["application/octet-stream"],binary:!0,tests:[new Uint8Array([78,71,83,80]).buffer]},wi={name:"RAD",id:"rad",module:"splats",format:"rad",extensions:["rad"],mimeTypes:["application/octet-stream"],binary:!0,tests:[new Uint8Array([82,65,68,48]).buffer]}});function Md(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e}function b(r,t,e,n){function i(s){return s instanceof e?s:new e(function(o){o(s)})}return new(e||(e=Promise))(function(s,o){function a(u){try{c(n.next(u))}catch(h){o(h)}}function l(u){try{c(n.throw(u))}catch(h){o(h)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((n=n.apply(r,t||[])).next())})}function Nd(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function P(r){return this instanceof P?(this.v=r,this):new P(r)}function _e(r,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e.apply(r,t||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(p){return function(y){return Promise.resolve(y).then(p,h)}}function a(p,y){n[p]&&(i[p]=function(g){return new Promise(function(N,S){s.push([p,g,N,S])>1||l(p,g)})},y&&(i[p]=y(i[p])))}function l(p,y){try{c(n[p](y))}catch(g){m(s[0][3],g)}}function c(p){p.value instanceof P?Promise.resolve(p.value.v).then(u,h):m(s[0][2],p)}function u(p){l("next",p)}function h(p){l("throw",p)}function m(p,y){p(y),s.shift(),s.length&&l(s[0][0],s[0][1])}}function vi(r){var t,e;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,s){t[i]=r[i]?function(o){return(e=!e)?{value:P(r[i](o)),done:!1}:s?s(o):o}:s}}function Ve(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=r[Symbol.asyncIterator],e;return t?t.call(r):(r=typeof Nd=="function"?Nd(r):r[Symbol.iterator](),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(s){e[s]=r[s]&&function(o){return new Promise(function(a,l){o=r[s](o),i(a,l,o.done,o.value)})}}function i(s,o,a,l){Promise.resolve(l).then(function(c){s({value:c,done:a})},o)}}var ge=d(()=>{});var Rd,Ds,Lg,rr,an=d(()=>{Rd=new TextDecoder("utf-8"),Ds=Rd.decode.bind(Rd),Lg=new TextEncoder,rr=r=>Lg.encode(r)});var Fg,kd,Lt,Xt,ze,je,Te,ia,sa,oa,aa,ca,Cd,Ts,Ud,la,Pd,In=d(()=>{Fg=r=>typeof r=="number",kd=r=>typeof r=="boolean",Lt=r=>typeof r=="function",Xt=r=>r!=null&&Object(r)===r,ze=r=>Xt(r)&&Lt(r.then),je=r=>Xt(r)&&Lt(r[Symbol.iterator]),Te=r=>Xt(r)&&Lt(r[Symbol.asyncIterator]),ia=r=>Xt(r)&&Xt(r.schema),sa=r=>Xt(r)&&"done"in r&&"value"in r,oa=r=>Xt(r)&&Lt(r.stat)&&Fg(r.fd),aa=r=>Xt(r)&&Ts(r.body),ca=r=>"_getDOMStream"in r&&"_getNodeStream"in r,Cd=r=>Xt(r)&&Lt(r.abort)&&Lt(r.getWriter)&&!ca(r),Ts=r=>Xt(r)&&Lt(r.cancel)&&Lt(r.getReader)&&!ca(r),Ud=r=>Xt(r)&&Lt(r.end)&&Lt(r.write)&&kd(r.writable)&&!ca(r),la=r=>Xt(r)&&Lt(r.read)&&Lt(r.pipe)&&kd(r.readable)&&!ca(r),Pd=r=>Xt(r)&&Lt(r.clear)&&Lt(r.bytes)&&Lt(r.position)&&Lt(r.setPosition)&&Lt(r.capacity)&&Lt(r.getBufferIdentifier)&&Lt(r.createLong)});var Tl={};ye(Tl,{compareArrayLike:()=>Dl,joinUint8Arrays:()=>be,memcpy:()=>Es,rebaseValueOffsets:()=>fa,toArrayBufferView:()=>H,toArrayBufferViewAsyncIterator:()=>He,toArrayBufferViewIterator:()=>nr,toBigInt64Array:()=>ua,toBigUint64Array:()=>Ug,toFloat32Array:()=>Pg,toFloat32ArrayAsyncIterator:()=>e0,toFloat32ArrayIterator:()=>Gg,toFloat64Array:()=>Vg,toFloat64ArrayAsyncIterator:()=>r0,toFloat64ArrayIterator:()=>Yg,toInt16Array:()=>Rg,toInt16ArrayAsyncIterator:()=>Xg,toInt16ArrayIterator:()=>Hg,toInt32Array:()=>An,toInt32ArrayAsyncIterator:()=>qg,toInt32ArrayIterator:()=>$g,toInt8Array:()=>Mg,toInt8ArrayAsyncIterator:()=>Jg,toInt8ArrayIterator:()=>jg,toUint16Array:()=>kg,toUint16ArrayAsyncIterator:()=>Qg,toUint16ArrayIterator:()=>Zg,toUint32Array:()=>Cg,toUint32ArrayAsyncIterator:()=>t0,toUint32ArrayIterator:()=>Wg,toUint8Array:()=>F,toUint8ArrayAsyncIterator:()=>Bl,toUint8ArrayIterator:()=>Al,toUint8ClampedArray:()=>zg,toUint8ClampedArrayAsyncIterator:()=>n0,toUint8ClampedArrayIterator:()=>Kg});function Ng(r){let t=r[0]?[r[0]]:[],e,n,i,s;for(let o,a,l=0,c=0,u=r.length;++l<u;){if(o=t[c],a=r[l],!o||!a||o.buffer!==a.buffer||a.byteOffset<o.byteOffset){a&&(t[++c]=a);continue}if({byteOffset:e,byteLength:i}=o,{byteOffset:n,byteLength:s}=a,e+i<n||n+s<e){a&&(t[++c]=a);continue}t[c]=new Uint8Array(o.buffer,e,n-e+s)}return t}function Es(r,t,e=0,n=t.byteLength){let i=r.byteLength,s=new Uint8Array(r.buffer,r.byteOffset,i),o=new Uint8Array(t.buffer,t.byteOffset,Math.min(n,i));return s.set(o,e),r}function be(r,t){let e=Ng(r),n=e.reduce((u,h)=>u+h.byteLength,0),i,s,o,a=0,l=-1,c=Math.min(t||Number.POSITIVE_INFINITY,n);for(let u=e.length;++l<u;){if(i=e[l],s=i.subarray(0,Math.min(i.length,c-a)),c<=a+s.length){s.length<i.length?e[l]=i.subarray(s.length):s.length===i.length&&l++,o?Es(o,s,a):o=s;break}Es(o||(o=new Uint8Array(c)),s,a),a+=s.length}return[o||new Uint8Array(0),e.slice(l),n-(o?o.byteLength:0)]}function H(r,t){let e=sa(t)?t.value:t;return e instanceof r?r===Uint8Array?new r(e.buffer,e.byteOffset,e.byteLength):e:e?(typeof e=="string"&&(e=rr(e)),e instanceof ArrayBuffer?new r(e):e instanceof Il?new r(e):Pd(e)?H(r,e.bytes()):ArrayBuffer.isView(e)?e.byteLength<=0?new r(0):new r(e.buffer,e.byteOffset,e.byteLength/r.BYTES_PER_ELEMENT):r.from(e)):new r(0)}function*nr(r,t){let e=function*(i){yield i},n=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Il?e(t):je(t)?t:e(t);return yield*xl(function*(i){let s=null;do s=i.next(yield H(r,s));while(!s.done)}(n[Symbol.iterator]())),new r}function He(r,t){return _e(this,arguments,function*(){if(ze(t))return yield P(yield P(yield*vi(Ve(He(r,yield P(t))))));let n=function(o){return _e(this,arguments,function*(){yield yield P(yield P(o))})},i=function(o){return _e(this,arguments,function*(){yield P(yield*vi(Ve(xl(function*(a){let l=null;do l=a.next(yield l?.value);while(!l.done)}(o[Symbol.iterator]())))))})},s=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Il?n(t):je(t)?i(t):Te(t)?t:n(t);return yield P(yield*vi(Ve(xl(function(o){return _e(this,arguments,function*(){let a=null;do a=yield P(o.next(yield yield P(H(r,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield P(new r)})}function fa(r,t,e){if(r!==0){e=e.slice(0,t);for(let n=-1,i=e.length;++n<i;)e[n]+=r}return e.subarray(0,t)}function Dl(r,t){let e=0,n=r.length;if(n!==t.length)return!1;if(n>0)do if(r[e]!==t[e])return!1;while(++e<n);return!0}var Il,Mg,Rg,An,ua,F,kg,Cg,Ug,Pg,Vg,zg,xl,jg,Hg,$g,Al,Zg,Wg,Gg,Yg,Kg,Jg,Xg,qg,Bl,Qg,t0,e0,r0,n0,kt=d(()=>{ge();an();In();Il=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;Mg=r=>H(Int8Array,r),Rg=r=>H(Int16Array,r),An=r=>H(Int32Array,r),ua=r=>H(BigInt64Array,r),F=r=>H(Uint8Array,r),kg=r=>H(Uint16Array,r),Cg=r=>H(Uint32Array,r),Ug=r=>H(BigUint64Array,r),Pg=r=>H(Float32Array,r),Vg=r=>H(Float64Array,r),zg=r=>H(Uint8ClampedArray,r),xl=r=>(r.next(),r);jg=r=>nr(Int8Array,r),Hg=r=>nr(Int16Array,r),$g=r=>nr(Int32Array,r),Al=r=>nr(Uint8Array,r),Zg=r=>nr(Uint16Array,r),Wg=r=>nr(Uint32Array,r),Gg=r=>nr(Float32Array,r),Yg=r=>nr(Float64Array,r),Kg=r=>nr(Uint8ClampedArray,r);Jg=r=>He(Int8Array,r),Xg=r=>He(Int16Array,r),qg=r=>He(Int32Array,r),Bl=r=>He(Uint8Array,r),Qg=r=>He(Uint16Array,r),t0=r=>He(Uint32Array,r),e0=r=>He(Float32Array,r),r0=r=>He(Float64Array,r),n0=r=>He(Uint8ClampedArray,r)});function*i0(r){let t,e=!1,n=[],i,s,o,a=0;function l(){return s==="peek"?be(n,o)[0]:([i,n,a]=be(n,o),i)}({cmd:s,size:o}=(yield(()=>null)())||{cmd:"read",size:0});let c=Al(r)[Symbol.iterator]();try{do if({done:t,value:i}=Number.isNaN(o-a)?c.next():c.next(o-a),!t&&i.byteLength>0&&(n.push(i),a+=i.byteLength),t||o<=a)do({cmd:s,size:o}=yield l());while(o<a);while(!t)}catch(u){e=!0,typeof c.throw=="function"&&c.throw(u)}finally{e===!1&&typeof c.return=="function"&&c.return(null)}return null}function s0(r){return _e(this,arguments,function*(){let e,n=!1,i=[],s,o,a,l=0;function c(){return o==="peek"?be(i,a)[0]:([s,i,l]=be(i,a),s)}({cmd:o,size:a}=(yield yield P((()=>null)()))||{cmd:"read",size:0});let u=Bl(r)[Symbol.asyncIterator]();try{do if({done:e,value:s}=Number.isNaN(a-l)?yield P(u.next()):yield P(u.next(a-l)),!e&&s.byteLength>0&&(i.push(s),l+=s.byteLength),e||a<=l)do({cmd:o,size:a}=yield yield P(c()));while(a<l);while(!e)}catch(h){n=!0,typeof u.throw=="function"&&(yield P(u.throw(h)))}finally{n===!1&&typeof u.return=="function"&&(yield P(u.return(new Uint8Array(0))))}return yield P(null)})}function o0(r){return _e(this,arguments,function*(){let e=!1,n=!1,i=[],s,o,a,l=0;function c(){return o==="peek"?be(i,a)[0]:([s,i,l]=be(i,a),s)}({cmd:o,size:a}=(yield yield P((()=>null)()))||{cmd:"read",size:0});let u=new Ol(r);try{do if({done:e,value:s}=Number.isNaN(a-l)?yield P(u.read()):yield P(u.read(a-l)),!e&&s.byteLength>0&&(i.push(F(s)),l+=s.byteLength),e||a<=l)do({cmd:o,size:a}=yield yield P(c()));while(a<l);while(!e)}catch(h){n=!0,yield P(u.cancel(h))}finally{n===!1?yield P(u.cancel()):r.locked&&u.releaseLock()}return yield P(null)})}function a0(r){return _e(this,arguments,function*(){let e=[],n="error",i=!1,s=null,o,a,l=0,c=[],u;function h(){return o==="peek"?be(c,a)[0]:([u,c,l]=be(c,a),u)}if({cmd:o,size:a}=(yield yield P((()=>null)()))||{cmd:"read",size:0},r.isTTY)return yield yield P(new Uint8Array(0)),yield P(null);try{e[0]=El(r,"end"),e[1]=El(r,"error");do{if(e[2]=El(r,"readable"),[n,s]=yield P(Promise.race(e.map(p=>p[2]))),n==="error")break;if((i=n==="end")||(Number.isFinite(a-l)?(u=F(r.read(a-l)),u.byteLength<a-l&&(u=F(r.read()))):u=F(r.read()),u.byteLength>0&&(c.push(u),l+=u.byteLength)),i||a<=l)do({cmd:o,size:a}=yield yield P(h()));while(a<l)}while(!i)}finally{yield P(m(e,n==="error"?s:null))}return yield P(null);function m(p,y){return u=c=null,new Promise((g,N)=>{for(let[S,G]of p)r.off(S,G);try{let S=r.destroy;S&&S.call(r,y),y=void 0}catch(S){y=S||y}finally{y!=null?N(y):g()}})}})}var zt,da,Ol,El,Os=d(()=>{ge();kt();zt={fromIterable(r){return da(i0(r))},fromAsyncIterable(r){return da(s0(r))},fromDOMStream(r){return da(o0(r))},fromNodeStream(r){return da(a0(r))},toDOMStream(r,t){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(r,t){throw new Error('"toNodeStream" not available in this environment')}},da=r=>(r.next(),r);Ol=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 b(this,void 0,void 0,function*(){let{reader:e,source:n}=this;e&&(yield e.cancel(t).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(t){return b(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=F(e)),e})}},El=(r,t)=>{let e=i=>n([t,i]),n;return[t,e,new Promise(i=>(n=i)&&r.once(t,e))]}});var it,ha=d(()=>{(function(r){r[r.V1=0]="V1",r[r.V2=1]="V2",r[r.V3=2]="V3",r[r.V4=3]="V4",r[r.V5=4]="V5"})(it||(it={}))});var at,Ll=d(()=>{(function(r){r[r.Sparse=0]="Sparse",r[r.Dense=1]="Dense"})(at||(at={}))});var st,Fl=d(()=>{(function(r){r[r.HALF=0]="HALF",r[r.SINGLE=1]="SINGLE",r[r.DOUBLE=2]="DOUBLE"})(st||(st={}))});var wt,Nl=d(()=>{(function(r){r[r.DAY=0]="DAY",r[r.MILLISECOND=1]="MILLISECOND"})(wt||(wt={}))});var x,Ls=d(()=>{(function(r){r[r.SECOND=0]="SECOND",r[r.MILLISECOND=1]="MILLISECOND",r[r.MICROSECOND=2]="MICROSECOND",r[r.NANOSECOND=3]="NANOSECOND"})(x||(x={}))});var ut,Ml=d(()=>{(function(r){r[r.YEAR_MONTH=0]="YEAR_MONTH",r[r.DAY_TIME=1]="DAY_TIME",r[r.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(ut||(ut={}))});var pa=d(()=>{});var ir,ma,ya,Si,Rl=d(()=>{ir=new Int32Array(2),ma=new Float32Array(ir.buffer),ya=new Float64Array(ir.buffer),Si=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1});var Fs,kl=d(()=>{(function(r){r[r.UTF8_BYTES=1]="UTF8_BYTES",r[r.UTF16_STRING=2]="UTF16_STRING"})(Fs||(Fs={}))});var Ft,Cl=d(()=>{pa();kl();Rl();Ft=class{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new Ft(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readUint64(t){return BigInt.asUintN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<<BigInt(32)))}readFloat32(t){return ir[0]=this.readInt32(t),ma[0]}readFloat64(t){return ir[Si?0:1]=this.readInt32(t),ir[Si?1:0]=this.readInt32(t+4),ya[0]}writeInt8(t,e){this.bytes_[t]=e}writeUint8(t,e){this.bytes_[t]=e}writeInt16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeUint16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeInt32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeUint32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeInt64(t,e){this.writeInt32(t,Number(BigInt.asIntN(32,e))),this.writeInt32(t+4,Number(BigInt.asIntN(32,e>>BigInt(32))))}writeUint64(t,e){this.writeUint32(t,Number(BigInt.asUintN(32,e))),this.writeUint32(t+4,Number(BigInt.asUintN(32,e>>BigInt(32))))}writeFloat32(t,e){ma[0]=e,this.writeInt32(t,ir[0])}writeFloat64(t,e){ya[0]=e,this.writeInt32(t,ir[Si?0:1]),this.writeInt32(t+4,ir[Si?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 n=t-this.readInt32(t);return e<this.readInt16(n)?this.readInt16(n+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 n=this.readInt32(t);t+=4;let i=this.bytes_.subarray(t,t+n);return e===Fs.UTF8_BYTES?i:this.text_decoder_.decode(i)}__union_with_string(t,e){return typeof t=="string"?this.__string(e):this.__union(t,e)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+4}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=4)throw new Error("FlatBuffers: file identifier must be length "+4);for(let e=0;e<4;e++)if(t.charCodeAt(e)!=this.readInt8(this.position()+4+e))return!1;return!0}createScalarList(t,e){let n=[];for(let i=0;i<e;++i){let s=t(i);s!==null&&n.push(s)}return n}createObjList(t,e){let n=[];for(let i=0;i<e;++i){let s=t(i);s!==null&&n.push(s.unpack())}return n}}});var Cr,Vd=d(()=>{Cl();pa();Cr=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,this.text_encoder=new TextEncoder;let e;t?e=t:e=1024,this.bb=Ft.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 n=~(this.bb.capacity()-this.space+e)+1&t-1;for(;this.space<n+t+e;){let i=this.bb.capacity();this.bb=Cr.growByteBuffer(this.bb),this.space+=this.bb.capacity()-i}this.pad(n)}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,n){(this.force_defaults||e!=n)&&(this.addInt8(e),this.slot(t))}addFieldInt16(t,e,n){(this.force_defaults||e!=n)&&(this.addInt16(e),this.slot(t))}addFieldInt32(t,e,n){(this.force_defaults||e!=n)&&(this.addInt32(e),this.slot(t))}addFieldInt64(t,e,n){(this.force_defaults||e!==n)&&(this.addInt64(e),this.slot(t))}addFieldFloat32(t,e,n){(this.force_defaults||e!=n)&&(this.addFloat32(e),this.slot(t))}addFieldFloat64(t,e,n){(this.force_defaults||e!=n)&&(this.addFloat64(e),this.slot(t))}addFieldOffset(t,e,n){(this.force_defaults||e!=n)&&(this.addOffset(e),this.slot(t))}addFieldStruct(t,e,n){e!=n&&(this.nested(e),this.slot(t))}nested(t){if(t!=this.offset())throw new TypeError("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new TypeError("FlatBuffers: object serialization must not be nested.")}slot(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){let e=t.capacity();if(e&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");let n=e<<1,i=Ft.allocate(n);return i.setPosition(n-e),i.bytes().set(t.bytes(),n-e),i}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 n=e+1;for(;e>=0;e--)this.addInt16(this.vtable[e]!=0?t-this.vtable[e]:0);let i=2;this.addInt16(t-this.object_start);let s=(n+i)*2;this.addInt16(s);let o=0,a=this.space;t:for(e=0;e<this.vtables.length;e++){let l=this.bb.capacity()-this.vtables[e];if(s==this.bb.readInt16(l)){for(let c=2;c<s;c+=2)if(this.bb.readInt16(a+c)!=this.bb.readInt16(l+c))continue t;o=this.vtables[e];break}}return o?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,o-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,e,n){let i=n?4:0;if(e){let s=e;if(this.prep(this.minalign,4+4+i),s.length!=4)throw new TypeError("FlatBuffers: file identifier must be length "+4);for(let o=4-1;o>=0;o--)this.writeInt8(s.charCodeAt(o))}this.prep(this.minalign,4+i),this.addOffset(t),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,e){this.finish(t,e,!0)}requiredField(t,e){let n=this.bb.capacity()-t,i=n-this.bb.readInt32(n);if(!(e<this.bb.readInt16(i)&&this.bb.readInt16(i+e)!=0))throw new TypeError("FlatBuffers: field "+e+" must be set")}startVector(t,e,n){this.notNested(),this.vector_num_elems=e,this.prep(4,t*e),this.prep(n,t*e)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);let e=this.createString(t);return this.string_maps.set(t,e),e}createString(t){if(t==null)return 0;let e;return t instanceof Uint8Array?e=t:e=this.text_encoder.encode(t),this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),this.bb.bytes().set(e,this.space),this.endVector()}createByteVector(t){return t==null?0:(this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector())}createObjectOffset(t){return t===null?0:typeof t=="string"?this.createString(t):t.pack(this)}createObjectOffsetList(t){let e=[];for(let n=0;n<t.length;++n){let i=t[n];if(i!==null)e.push(this.createObjectOffset(i));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return e}createStructOffsetList(t,e){return e(this,t.length),this.createObjectOffsetList(t.slice().reverse()),this.endVector()}}});var K=d(()=>{pa();Rl();Vd();Cl();kl()});var Bn,Ul=d(()=>{(function(r){r[r.BUFFER=0]="BUFFER"})(Bn||(Bn={}))});var qt,Ns=d(()=>{(function(r){r[r.LZ4_FRAME=0]="LZ4_FRAME",r[r.ZSTD=1]="ZSTD"})(qt||(qt={}))});var Zt,Pl=d(()=>{K();Ul();Ns();Zt=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 Zt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,e){return t.setPosition(t.position()+4),(e||new Zt).__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):qt.LZ4_FRAME}method(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):Bn.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,e){t.addFieldInt8(0,e,qt.LZ4_FRAME)}static addMethod(t,e){t.addFieldInt8(1,e,Bn.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,e,n){return Zt.startBodyCompression(t),Zt.addCodec(t,e),Zt.addMethod(t,n),Zt.endBodyCompression(t)}}});var xi,Vl=d(()=>{xi=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,n){return t.prep(8,16),t.writeInt64(BigInt(n??0)),t.writeInt64(BigInt(e??0)),t.offset()}}});var Ii,zl=d(()=>{Ii=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,n){return t.prep(8,16),t.writeInt64(BigInt(n??0)),t.writeInt64(BigInt(e??0)),t.offset()}}});var jt,jl=d(()=>{K();Pl();Vl();zl();jt=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 jt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,e){return t.setPosition(t.position()+4),(e||new jt).__init(t.readInt32(t.position())+t.position(),t)}length(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}nodes(t,e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new Ii).__init(this.bb.__vector(this.bb_pos+n)+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 n=this.bb.__offset(this.bb_pos,8);return n?(e||new xi).__init(this.bb.__vector(this.bb_pos+n)+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 Zt).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startRecordBatch(t){t.startObject(4)}static addLength(t,e){t.addFieldInt64(0,e,BigInt("0"))}static addNodes(t,e){t.addFieldOffset(1,e,0)}static startNodesVector(t,e){t.startVector(16,e,8)}static addBuffers(t,e){t.addFieldOffset(2,e,0)}static startBuffersVector(t,e){t.startVector(16,e,8)}static addCompression(t,e){t.addFieldOffset(3,e,0)}static endRecordBatch(t){return t.endObject()}}});var Oe,zd=d(()=>{K();jl();Oe=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 Oe).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,e){return t.setPosition(t.position()+4),(e||new Oe).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}data(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new jt).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}isDelta(){let t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startDictionaryBatch(t){t.startObject(3)}static addId(t,e){t.addFieldInt64(0,e,BigInt("0"))}static addData(t,e){t.addFieldOffset(1,e,0)}static addIsDelta(t,e){t.addFieldInt8(2,+e,0)}static endDictionaryBatch(t){return t.endObject()}}});var cn,Hl=d(()=>{(function(r){r[r.Little=0]="Little",r[r.Big=1]="Big"})(cn||(cn={}))});var Ms,jd=d(()=>{(function(r){r[r.DenseArray=0]="DenseArray"})(Ms||(Ms={}))});var Ct,ga=d(()=>{K();Ct=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 Ct).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInt(t,e){return t.setPosition(t.position()+4),(e||new Ct).__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,n){return Ct.startInt(t),Ct.addBitWidth(t,e),Ct.addIsSigned(t,n),Ct.endInt(t)}}});var we,$l=d(()=>{K();jd();ga();we=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 we).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryEncoding(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):BigInt("0")}indexType(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new Ct).__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):Ms.DenseArray}static startDictionaryEncoding(t){t.startObject(4)}static addId(t,e){t.addFieldInt64(0,e,BigInt("0"))}static addIndexType(t,e){t.addFieldOffset(1,e,0)}static addIsOrdered(t,e){t.addFieldInt8(2,+e,0)}static addDictionaryKind(t,e){t.addFieldInt16(3,e,Ms.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}}});var ft,Ai=d(()=>{K();ft=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 ft).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKeyValue(t,e){return t.setPosition(t.position()+4),(e||new ft).__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,n){return ft.startKeyValue(t),ft.addKey(t,e),ft.addValue(t,n),ft.endKeyValue(t)}}});var sr,Hd=d(()=>{K();sr=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 sr).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinary(t,e){return t.setPosition(t.position()+4),(e||new sr).__init(t.readInt32(t.position())+t.position(),t)}static startBinary(t){t.startObject(0)}static endBinary(t){return t.endObject()}static createBinary(t){return sr.startBinary(t),sr.endBinary(t)}}});var or,$d=d(()=>{K();or=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 or).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,e){return t.setPosition(t.position()+4),(e||new or).__init(t.readInt32(t.position())+t.position(),t)}static startBool(t){t.startObject(0)}static endBool(t){return t.endObject()}static createBool(t){return or.startBool(t),or.endBool(t)}}});var ne,Zl=d(()=>{K();Nl();ne=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 ne).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDate(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):wt.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,wt.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,e){return ne.startDate(t),ne.addUnit(t,e),ne.endDate(t)}}});var Ut,Wl=d(()=>{K();Ut=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 Ut).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDecimal(t,e){return t.setPosition(t.position()+4),(e||new Ut).__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,n,i){return Ut.startDecimal(t),Ut.addPrecision(t,e),Ut.addScale(t,n),Ut.addBitWidth(t,i),Ut.endDecimal(t)}}});var ie,Gl=d(()=>{K();Ls();ie=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDuration(t,e){return(e||new ie).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDuration(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):x.MILLISECOND}static startDuration(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,x.MILLISECOND)}static endDuration(t){return t.endObject()}static createDuration(t,e){return ie.startDuration(t),ie.addUnit(t,e),ie.endDuration(t)}}});var se,Yl=d(()=>{K();se=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 se).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeBinary(t,e){return t.setPosition(t.position()+4),(e||new se).__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 se.startFixedSizeBinary(t),se.addByteWidth(t,e),se.endFixedSizeBinary(t)}}});var oe,Kl=d(()=>{K();oe=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 oe).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeList(t,e){return t.setPosition(t.position()+4),(e||new oe).__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 oe.startFixedSizeList(t),oe.addListSize(t,e),oe.endFixedSizeList(t)}}});var ae,Jl=d(()=>{K();Fl();ae=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 ae).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFloatingPoint(t,e){return t.setPosition(t.position()+4),(e||new ae).__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):st.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,e){t.addFieldInt16(0,e,st.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,e){return ae.startFloatingPoint(t),ae.addPrecision(t,e),ae.endFloatingPoint(t)}}});var ce,Xl=d(()=>{K();Ml();ce=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 ce).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInterval(t,e){return t.setPosition(t.position()+4),(e||new ce).__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):ut.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,ut.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,e){return ce.startInterval(t),ce.addUnit(t,e),ce.endInterval(t)}}});var ar,Zd=d(()=>{K();ar=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsLargeBinary(t,e){return(e||new ar).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeBinary(t,e){return t.setPosition(t.position()+4),(e||new ar).__init(t.readInt32(t.position())+t.position(),t)}static startLargeBinary(t){t.startObject(0)}static endLargeBinary(t){return t.endObject()}static createLargeBinary(t){return ar.startLargeBinary(t),ar.endLargeBinary(t)}}});var cr,Wd=d(()=>{K();cr=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsLargeUtf8(t,e){return(e||new cr).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsLargeUtf8(t,e){return t.setPosition(t.position()+4),(e||new cr).__init(t.readInt32(t.position())+t.position(),t)}static startLargeUtf8(t){t.startObject(0)}static endLargeUtf8(t){return t.endObject()}static createLargeUtf8(t){return cr.startLargeUtf8(t),cr.endLargeUtf8(t)}}});var lr,Gd=d(()=>{K();lr=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 lr).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsList(t,e){return t.setPosition(t.position()+4),(e||new lr).__init(t.readInt32(t.position())+t.position(),t)}static startList(t){t.startObject(0)}static endList(t){return t.endObject()}static createList(t){return lr.startList(t),lr.endList(t)}}});var le,ql=d(()=>{K();le=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 le).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,e){return t.setPosition(t.position()+4),(e||new le).__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 le.startMap(t),le.addKeysSorted(t,e),le.endMap(t)}}});var ur,Yd=d(()=>{K();ur=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 ur).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNull(t,e){return t.setPosition(t.position()+4),(e||new ur).__init(t.readInt32(t.position())+t.position(),t)}static startNull(t){t.startObject(0)}static endNull(t){return t.endObject()}static createNull(t){return ur.startNull(t),ur.endNull(t)}}});var fr,Kd=d(()=>{K();fr=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 fr).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,e){return t.setPosition(t.position()+4),(e||new fr).__init(t.readInt32(t.position())+t.position(),t)}static startStruct_(t){t.startObject(0)}static endStruct_(t){return t.endObject()}static createStruct_(t){return fr.startStruct_(t),fr.endStruct_(t)}}});var Wt,Ql=d(()=>{K();Ls();Wt=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 Wt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTime(t,e){return t.setPosition(t.position()+4),(e||new Wt).__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):x.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,x.MILLISECOND)}static addBitWidth(t,e){t.addFieldInt32(1,e,32)}static endTime(t){return t.endObject()}static createTime(t,e,n){return Wt.startTime(t),Wt.addUnit(t,e),Wt.addBitWidth(t,n),Wt.endTime(t)}}});var Gt,tu=d(()=>{K();Ls();Gt=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 Gt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTimestamp(t,e){return t.setPosition(t.position()+4),(e||new Gt).__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):x.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,x.SECOND)}static addTimezone(t,e){t.addFieldOffset(1,e,0)}static endTimestamp(t){return t.endObject()}static createTimestamp(t,e,n){return Gt.startTimestamp(t),Gt.addUnit(t,e),Gt.addTimezone(t,n),Gt.endTimestamp(t)}}});var Pt,eu=d(()=>{K();Ll();Pt=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 Pt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUnion(t,e){return t.setPosition(t.position()+4),(e||new Pt).__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):at.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,at.Sparse)}static addTypeIds(t,e){t.addFieldOffset(1,e,0)}static createTypeIdsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addInt32(e[n]);return t.endVector()}static startTypeIdsVector(t,e){t.startVector(4,e,4)}static endUnion(t){return t.endObject()}static createUnion(t,e,n){return Pt.startUnion(t),Pt.addMode(t,e),Pt.addTypeIds(t,n),Pt.endUnion(t)}}});var dr,Jd=d(()=>{K();dr=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 dr).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,e){return t.setPosition(t.position()+4),(e||new dr).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return dr.startUtf8(t),dr.endUtf8(t)}}});var ot,ru=d(()=>{(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.FloatingPoint=3]="FloatingPoint",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct_=13]="Struct_",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Duration=18]="Duration",r[r.LargeBinary=19]="LargeBinary",r[r.LargeUtf8=20]="LargeUtf8",r[r.LargeList=21]="LargeList",r[r.RunEndEncoded=22]="RunEndEncoded"})(ot||(ot={}))});var It,nu=d(()=>{K();$l();Ai();ru();It=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 It).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,e){return t.setPosition(t.position()+4),(e||new It).__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):ot.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 we).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}children(t,e){let n=this.bb.__offset(this.bb_pos,14);return n?(e||new It).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+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 n=this.bb.__offset(this.bb_pos,16);return n?(e||new ft).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+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,ot.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 n=e.length-1;n>=0;n--)t.addOffset(e[n]);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 n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endField(t){return t.endObject()}}});var yt,iu=d(()=>{K();Hl();nu();Ai();yt=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 yt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,e){return t.setPosition(t.position()+4),(e||new yt).__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):cn.Little}fields(t,e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new It).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+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 n=this.bb.__offset(this.bb_pos,8);return n?(e||new ft).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}features(t){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+t*8):BigInt(0)}featuresLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSchema(t){t.startObject(4)}static addEndianness(t,e){t.addFieldInt16(0,e,cn.Little)}static addFields(t,e){t.addFieldOffset(1,e,0)}static createFieldsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);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 n=e.length-1;n>=0;n--)t.addOffset(e[n]);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 n=e.length-1;n>=0;n--)t.addInt64(e[n]);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,n,i,s){return yt.startSchema(t),yt.addEndianness(t,e),yt.addFields(t,n),yt.addCustomMetadata(t,i),yt.addFeatures(t,s),yt.endSchema(t)}}});var W,su=d(()=>{(function(r){r[r.NONE=0]="NONE",r[r.Schema=1]="Schema",r[r.DictionaryBatch=2]="DictionaryBatch",r[r.RecordBatch=3]="RecordBatch",r[r.Tensor=4]="Tensor",r[r.SparseTensor=5]="SparseTensor"})(W||(W={}))});var f,Ze,Nt=d(()=>{ha();Ll();Fl();Nl();Ls();Ml();su();(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.Float=3]="Float",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct=13]="Struct",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Duration=18]="Duration",r[r.LargeBinary=19]="LargeBinary",r[r.LargeUtf8=20]="LargeUtf8",r[r.Dictionary=-1]="Dictionary",r[r.Int8=-2]="Int8",r[r.Int16=-3]="Int16",r[r.Int32=-4]="Int32",r[r.Int64=-5]="Int64",r[r.Uint8=-6]="Uint8",r[r.Uint16=-7]="Uint16",r[r.Uint32=-8]="Uint32",r[r.Uint64=-9]="Uint64",r[r.Float16=-10]="Float16",r[r.Float32=-11]="Float32",r[r.Float64=-12]="Float64",r[r.DateDay=-13]="DateDay",r[r.DateMillisecond=-14]="DateMillisecond",r[r.TimestampSecond=-15]="TimestampSecond",r[r.TimestampMillisecond=-16]="TimestampMillisecond",r[r.TimestampMicrosecond=-17]="TimestampMicrosecond",r[r.TimestampNanosecond=-18]="TimestampNanosecond",r[r.TimeSecond=-19]="TimeSecond",r[r.TimeMillisecond=-20]="TimeMillisecond",r[r.TimeMicrosecond=-21]="TimeMicrosecond",r[r.TimeNanosecond=-22]="TimeNanosecond",r[r.DenseUnion=-23]="DenseUnion",r[r.SparseUnion=-24]="SparseUnion",r[r.IntervalDayTime=-25]="IntervalDayTime",r[r.IntervalYearMonth=-26]="IntervalYearMonth",r[r.DurationSecond=-27]="DurationSecond",r[r.DurationMillisecond=-28]="DurationMillisecond",r[r.DurationMicrosecond=-29]="DurationMicrosecond",r[r.DurationNanosecond=-30]="DurationNanosecond",r[r.IntervalMonthDayNano=-31]="IntervalMonthDayNano"})(f||(f={}));(function(r){r[r.OFFSET=0]="OFFSET",r[r.DATA=1]="DATA",r[r.VALIDITY=2]="VALIDITY",r[r.TYPE=3]="TYPE"})(Ze||(Ze={}))});var ou={};ye(ou,{valueToString:()=>We});function We(r){if(r===null)return"null";if(r===void 0)return"undefined";switch(typeof r){case"number":return`${r}`;case"bigint":return`${r}`;case"string":return`"${r}"`}return typeof r[Symbol.toPrimitive]=="function"?r[Symbol.toPrimitive]("string"):ArrayBuffer.isView(r)?r instanceof BigInt64Array||r instanceof BigUint64Array?`[${[...r].map(t=>We(t))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(t,e)=>typeof e=="bigint"?`${e}`:e)}var Rs=d(()=>{});function q(r){if(typeof r=="bigint"&&(r<Number.MIN_SAFE_INTEGER||r>Number.MAX_SAFE_INTEGER))throw new TypeError(`${r} is not safe to convert to a number.`);return Number(r)}function au(r,t){return q(r/t)+q(r%t)/q(t)}var Ur=d(()=>{});var uu={};ye(uu,{BN:()=>Dn,bigNumToBigInt:()=>qd,bigNumToNumber:()=>lu,bigNumToString:()=>Ti,isArrowBigNumSymbol:()=>Xd});function Ge(r,...t){return t.length===0?Object.setPrototypeOf(H(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...t),this.constructor.prototype)}function Bi(...r){return Ge.apply(this,r)}function Di(...r){return Ge.apply(this,r)}function ks(...r){return Ge.apply(this,r)}function lu(r,t){let{buffer:e,byteOffset:n,byteLength:i,signed:s}=r,o=new BigUint64Array(e,n,i/8),a=s&&o.at(-1)&BigInt(1)<<BigInt(63),l=BigInt(0),c=0;if(a){for(let u of o)l|=(u^l0)*(BigInt(1)<<BigInt(64*c++));l*=BigInt(-1),l-=BigInt(1)}else for(let u of o)l|=u*(BigInt(1)<<BigInt(64*c++));if(typeof t=="number"&&t>0){let u=BigInt("1".padEnd(t+1,"0")),h=l/u,m=a?-(l%u):l%u,p=q(h),y=`${m}`.padStart(t,"0");return+`${a&&p===0?"-":""}${p}.${y}`}return q(l)}function Ti(r){if(r.byteLength===8)return`${new r.BigIntArray(r.buffer,r.byteOffset,1)[0]}`;if(!r.signed)return cu(r);let t=new Uint16Array(r.buffer,r.byteOffset,r.byteLength/2);if(new Int16Array([t.at(-1)])[0]>=0)return cu(r);t=t.slice();let n=1;for(let s=0;s<t.length;s++){let o=t[s],a=~o+n;t[s]=a,n&=o===0?1:0}return`-${cu(t)}`}function qd(r){return r.byteLength===8?new r.BigIntArray(r.buffer,r.byteOffset,1)[0]:Ti(r)}function cu(r){let t="",e=new Uint32Array(2),n=new Uint16Array(r.buffer,r.byteOffset,r.byteLength/2),i=new Uint32Array((n=new Uint16Array(n).reverse()).buffer),s=-1,o=n.length-1;do{for(e[0]=n[s=0];s<o;)n[s++]=e[1]=e[0]/10,e[0]=(e[0]-e[1]*10<<16)+n[s];n[s]=e[1]=e[0]/10,e[0]=e[0]-e[1]*10,t=`${e[0]}${t}`}while(i[0]||i[1]||i[2]||i[3]);return t??"0"}var Xd,c0,l0,Dn,fu=d(()=>{kt();Ur();Xd=Symbol.for("isArrowBigNum");Ge.prototype[Xd]=!0;Ge.prototype.toJSON=function(){return`"${Ti(this)}"`};Ge.prototype.valueOf=function(r){return lu(this,r)};Ge.prototype.toString=function(){return Ti(this)};Ge.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return lu(this);case"string":return Ti(this);case"default":return qd(this)}return Ti(this)};Object.setPrototypeOf(Bi.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Di.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(ks.prototype,Object.create(Uint32Array.prototype));Object.assign(Bi.prototype,Ge.prototype,{constructor:Bi,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Di.prototype,Ge.prototype,{constructor:Di,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(ks.prototype,Ge.prototype,{constructor:ks,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});c0=BigInt(4294967296)*BigInt(4294967296),l0=c0-BigInt(1);Dn=class{static new(t,e){switch(e){case!0:return new Bi(t);case!1:return new Di(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new Bi(t)}return t.byteLength===16?new ks(t):new Di(t)}static signed(t){return new Bi(t)}static unsigned(t){return new Di(t)}static decimal(t){return new ks(t)}constructor(t,e){return Dn.new(t,e)}}});function xe(r){let t=r;switch(r.typeId){case f.Decimal:return r.bitWidth/32;case f.Interval:return t.unit===ut.MONTH_DAY_NANO?4:1+t.unit;case f.FixedSizeList:return t.listSize;case f.FixedSizeBinary:return t.byteWidth;default:return 1}}var Qd,th,eh,rh,nh,ih,sh,oh,ah,ch,lh,uh,fh,dh,hh,ph,mh,yh,_h,gh,bh,wh,_,Yt,At,Tn,En,ve,On,Ln,Fn,Nn,Mn,Se,Cs,Rn,kn,hr,pr,mr,yr,_r,gr,br,wr,vr,Sr,xr,Le,ct,Fe,Ir,ue,Ne,u0,fe,_t=d(()=>{Ur();Nt();_=class{static isNull(t){return t?.typeId===f.Null}static isInt(t){return t?.typeId===f.Int}static isFloat(t){return t?.typeId===f.Float}static isBinary(t){return t?.typeId===f.Binary}static isLargeBinary(t){return t?.typeId===f.LargeBinary}static isUtf8(t){return t?.typeId===f.Utf8}static isLargeUtf8(t){return t?.typeId===f.LargeUtf8}static isBool(t){return t?.typeId===f.Bool}static isDecimal(t){return t?.typeId===f.Decimal}static isDate(t){return t?.typeId===f.Date}static isTime(t){return t?.typeId===f.Time}static isTimestamp(t){return t?.typeId===f.Timestamp}static isInterval(t){return t?.typeId===f.Interval}static isDuration(t){return t?.typeId===f.Duration}static isList(t){return t?.typeId===f.List}static isStruct(t){return t?.typeId===f.Struct}static isUnion(t){return t?.typeId===f.Union}static isFixedSizeBinary(t){return t?.typeId===f.FixedSizeBinary}static isFixedSizeList(t){return t?.typeId===f.FixedSizeList}static isMap(t){return t?.typeId===f.Map}static isDictionary(t){return t?.typeId===f.Dictionary}static isDenseUnion(t){return _.isUnion(t)&&t.mode===at.Dense}static isSparseUnion(t){return _.isUnion(t)&&t.mode===at.Sparse}constructor(t){this.typeId=t}};Qd=Symbol.toStringTag;_[Qd]=(r=>(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[Symbol.toStringTag]="DataType"))(_.prototype);Yt=class extends _{constructor(){super(f.Null)}toString(){return"Null"}};th=Symbol.toStringTag;Yt[th]=(r=>r[Symbol.toStringTag]="Null")(Yt.prototype);At=class extends _{constructor(t,e){super(f.Int),this.isSigned=t,this.bitWidth=e}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};eh=Symbol.toStringTag;At[eh]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(At.prototype);Tn=class extends At{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},En=class extends At{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},ve=class extends At{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},On=class extends At{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},Ln=class extends At{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},Fn=class extends At{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},Nn=class extends At{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Mn=class extends At{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Tn.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(En.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(ve.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(On.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(Ln.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(Fn.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Nn.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Mn.prototype,"ArrayType",{value:BigUint64Array});Se=class extends _{constructor(t){super(f.Float),this.precision=t}get ArrayType(){switch(this.precision){case st.HALF:return Uint16Array;case st.SINGLE:return Float32Array;case st.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};rh=Symbol.toStringTag;Se[rh]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(Se.prototype);Cs=class extends Se{constructor(){super(st.HALF)}},Rn=class extends Se{constructor(){super(st.SINGLE)}},kn=class extends Se{constructor(){super(st.DOUBLE)}};Object.defineProperty(Cs.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(Rn.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(kn.prototype,"ArrayType",{value:Float64Array});hr=class extends _{constructor(){super(f.Binary)}toString(){return"Binary"}};nh=Symbol.toStringTag;hr[nh]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(hr.prototype);pr=class extends _{constructor(){super(f.LargeBinary)}toString(){return"LargeBinary"}};ih=Symbol.toStringTag;pr[ih]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(pr.prototype);mr=class extends _{constructor(){super(f.Utf8)}toString(){return"Utf8"}};sh=Symbol.toStringTag;mr[sh]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(mr.prototype);yr=class extends _{constructor(){super(f.LargeUtf8)}toString(){return"LargeUtf8"}};oh=Symbol.toStringTag;yr[oh]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(yr.prototype);_r=class extends _{constructor(){super(f.Bool)}toString(){return"Bool"}};ah=Symbol.toStringTag;_r[ah]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(_r.prototype);gr=class extends _{constructor(t,e,n=128){super(f.Decimal),this.scale=t,this.precision=e,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};ch=Symbol.toStringTag;gr[ch]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(gr.prototype);br=class extends _{constructor(t){super(f.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${wt[this.unit]}>`}get ArrayType(){return this.unit===wt.DAY?Int32Array:BigInt64Array}};lh=Symbol.toStringTag;br[lh]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(br.prototype);wr=class extends _{constructor(t,e){super(f.Time),this.unit=t,this.bitWidth=e}toString(){return`Time${this.bitWidth}<${x[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};uh=Symbol.toStringTag;wr[uh]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(wr.prototype);vr=class extends _{constructor(t,e){super(f.Timestamp),this.unit=t,this.timezone=e}toString(){return`Timestamp<${x[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};fh=Symbol.toStringTag;vr[fh]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(vr.prototype);Sr=class extends _{constructor(t){super(f.Interval),this.unit=t}toString(){return`Interval<${ut[this.unit]}>`}};dh=Symbol.toStringTag;Sr[dh]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(Sr.prototype);xr=class extends _{constructor(t){super(f.Duration),this.unit=t}toString(){return`Duration<${x[this.unit]}>`}};hh=Symbol.toStringTag;xr[hh]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(xr.prototype);Le=class extends _{constructor(t){super(f.List),this.children=[t]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};ph=Symbol.toStringTag;Le[ph]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(Le.prototype);ct=class extends _{constructor(t){super(f.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};mh=Symbol.toStringTag;ct[mh]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(ct.prototype);Fe=class extends _{constructor(t,e,n){super(f.Union),this.mode=t,this.children=n,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((i,s,o)=>(i[s]=o)&&i||i,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}};yh=Symbol.toStringTag;Fe[yh]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(Fe.prototype);Ir=class extends _{constructor(t){super(f.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};_h=Symbol.toStringTag;Ir[_h]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(Ir.prototype);ue=class extends _{constructor(t,e){super(f.FixedSizeList),this.listSize=t,this.children=[e]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};gh=Symbol.toStringTag;ue[gh]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(ue.prototype);Ne=class extends _{constructor(t,e=!1){var n,i,s;if(super(f.Map),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((n=t?.type)===null||n===void 0)&&n.children)){let o=(i=t?.type)===null||i===void 0?void 0:i.children[0];o&&(o.name="key");let a=(s=t?.type)===null||s===void 0?void 0:s.children[1];a&&(a.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};bh=Symbol.toStringTag;Ne[bh]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(Ne.prototype);u0=(r=>()=>++r)(-1),fe=class extends _{constructor(t,e,n,i){super(f.Dictionary),this.indices=e,this.dictionary=t,this.isOrdered=i||!1,this.id=n==null?u0():q(n)}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;fe[wh]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(fe.prototype)});function d0(r,t,e=!0){return typeof t=="number"?Ei(r,t,e):typeof t=="string"&&t in f?Ei(r,f[t],e):t&&t instanceof _?Ei(r,vh(t),e):t?.type&&t.type instanceof _?Ei(r,vh(t.type),e):Ei(r,f.NONE,e)}function Ei(r,t,e=!0){let n=null;switch(t){case f.Null:n=r.visitNull;break;case f.Bool:n=r.visitBool;break;case f.Int:n=r.visitInt;break;case f.Int8:n=r.visitInt8||r.visitInt;break;case f.Int16:n=r.visitInt16||r.visitInt;break;case f.Int32:n=r.visitInt32||r.visitInt;break;case f.Int64:n=r.visitInt64||r.visitInt;break;case f.Uint8:n=r.visitUint8||r.visitInt;break;case f.Uint16:n=r.visitUint16||r.visitInt;break;case f.Uint32:n=r.visitUint32||r.visitInt;break;case f.Uint64:n=r.visitUint64||r.visitInt;break;case f.Float:n=r.visitFloat;break;case f.Float16:n=r.visitFloat16||r.visitFloat;break;case f.Float32:n=r.visitFloat32||r.visitFloat;break;case f.Float64:n=r.visitFloat64||r.visitFloat;break;case f.Utf8:n=r.visitUtf8;break;case f.LargeUtf8:n=r.visitLargeUtf8;break;case f.Binary:n=r.visitBinary;break;case f.LargeBinary:n=r.visitLargeBinary;break;case f.FixedSizeBinary:n=r.visitFixedSizeBinary;break;case f.Date:n=r.visitDate;break;case f.DateDay:n=r.visitDateDay||r.visitDate;break;case f.DateMillisecond:n=r.visitDateMillisecond||r.visitDate;break;case f.Timestamp:n=r.visitTimestamp;break;case f.TimestampSecond:n=r.visitTimestampSecond||r.visitTimestamp;break;case f.TimestampMillisecond:n=r.visitTimestampMillisecond||r.visitTimestamp;break;case f.TimestampMicrosecond:n=r.visitTimestampMicrosecond||r.visitTimestamp;break;case f.TimestampNanosecond:n=r.visitTimestampNanosecond||r.visitTimestamp;break;case f.Time:n=r.visitTime;break;case f.TimeSecond:n=r.visitTimeSecond||r.visitTime;break;case f.TimeMillisecond:n=r.visitTimeMillisecond||r.visitTime;break;case f.TimeMicrosecond:n=r.visitTimeMicrosecond||r.visitTime;break;case f.TimeNanosecond:n=r.visitTimeNanosecond||r.visitTime;break;case f.Decimal:n=r.visitDecimal;break;case f.List:n=r.visitList;break;case f.Struct:n=r.visitStruct;break;case f.Union:n=r.visitUnion;break;case f.DenseUnion:n=r.visitDenseUnion||r.visitUnion;break;case f.SparseUnion:n=r.visitSparseUnion||r.visitUnion;break;case f.Dictionary:n=r.visitDictionary;break;case f.Interval:n=r.visitInterval;break;case f.IntervalDayTime:n=r.visitIntervalDayTime||r.visitInterval;break;case f.IntervalYearMonth:n=r.visitIntervalYearMonth||r.visitInterval;break;case f.IntervalMonthDayNano:n=r.visitIntervalMonthDayNano||r.visitInterval;break;case f.Duration:n=r.visitDuration;break;case f.DurationSecond:n=r.visitDurationSecond||r.visitDuration;break;case f.DurationMillisecond:n=r.visitDurationMillisecond||r.visitDuration;break;case f.DurationMicrosecond:n=r.visitDurationMicrosecond||r.visitDuration;break;case f.DurationNanosecond:n=r.visitDurationNanosecond||r.visitDuration;break;case f.FixedSizeList:n=r.visitFixedSizeList;break;case f.Map:n=r.visitMap;break}if(typeof n=="function")return n;if(!e)return()=>null;throw new Error(`Unrecognized type '${f[t]}'`)}function vh(r){switch(r.typeId){case f.Null:return f.Null;case f.Int:{let{bitWidth:t,isSigned:e}=r;switch(t){case 8:return e?f.Int8:f.Uint8;case 16:return e?f.Int16:f.Uint16;case 32:return e?f.Int32:f.Uint32;case 64:return e?f.Int64:f.Uint64}return f.Int}case f.Float:switch(r.precision){case st.HALF:return f.Float16;case st.SINGLE:return f.Float32;case st.DOUBLE:return f.Float64}return f.Float;case f.Binary:return f.Binary;case f.LargeBinary:return f.LargeBinary;case f.Utf8:return f.Utf8;case f.LargeUtf8:return f.LargeUtf8;case f.Bool:return f.Bool;case f.Decimal:return f.Decimal;case f.Time:switch(r.unit){case x.SECOND:return f.TimeSecond;case x.MILLISECOND:return f.TimeMillisecond;case x.MICROSECOND:return f.TimeMicrosecond;case x.NANOSECOND:return f.TimeNanosecond}return f.Time;case f.Timestamp:switch(r.unit){case x.SECOND:return f.TimestampSecond;case x.MILLISECOND:return f.TimestampMillisecond;case x.MICROSECOND:return f.TimestampMicrosecond;case x.NANOSECOND:return f.TimestampNanosecond}return f.Timestamp;case f.Date:switch(r.unit){case wt.DAY:return f.DateDay;case wt.MILLISECOND:return f.DateMillisecond}return f.Date;case f.Interval:switch(r.unit){case ut.DAY_TIME:return f.IntervalDayTime;case ut.YEAR_MONTH:return f.IntervalYearMonth;case ut.MONTH_DAY_NANO:return f.IntervalMonthDayNano}return f.Interval;case f.Duration:switch(r.unit){case x.SECOND:return f.DurationSecond;case x.MILLISECOND:return f.DurationMillisecond;case x.MICROSECOND:return f.DurationMicrosecond;case x.NANOSECOND:return f.DurationNanosecond}return f.Duration;case f.Map:return f.Map;case f.List:return f.List;case f.Struct:return f.Struct;case f.Union:switch(r.mode){case at.Dense:return f.DenseUnion;case at.Sparse:return f.SparseUnion}return f.Union;case f.FixedSizeBinary:return f.FixedSizeBinary;case f.FixedSizeList:return f.FixedSizeList;case f.Dictionary:return f.Dictionary}throw new Error(`Unrecognized type '${f[r.typeId]}'`)}var B,Ye=d(()=>{Nt();_t();B=class{visitMany(t,...e){return t.map((n,i)=>this.visit(n,...e.map(s=>s[i])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return d0(this,t,e)}getVisitFnByTypeId(t,e=!0){return Ei(this,t,e)}visitNull(t,...e){return null}visitBool(t,...e){return null}visitInt(t,...e){return null}visitFloat(t,...e){return null}visitUtf8(t,...e){return null}visitLargeUtf8(t,...e){return null}visitBinary(t,...e){return null}visitLargeBinary(t,...e){return null}visitFixedSizeBinary(t,...e){return null}visitDate(t,...e){return null}visitTimestamp(t,...e){return null}visitTime(t,...e){return null}visitDecimal(t,...e){return null}visitList(t,...e){return null}visitStruct(t,...e){return null}visitUnion(t,...e){return null}visitDictionary(t,...e){return null}visitInterval(t,...e){return null}visitDuration(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}};B.prototype.visitInt8=null;B.prototype.visitInt16=null;B.prototype.visitInt32=null;B.prototype.visitInt64=null;B.prototype.visitUint8=null;B.prototype.visitUint16=null;B.prototype.visitUint32=null;B.prototype.visitUint64=null;B.prototype.visitFloat16=null;B.prototype.visitFloat32=null;B.prototype.visitFloat64=null;B.prototype.visitDateDay=null;B.prototype.visitDateMillisecond=null;B.prototype.visitTimestampSecond=null;B.prototype.visitTimestampMillisecond=null;B.prototype.visitTimestampMicrosecond=null;B.prototype.visitTimestampNanosecond=null;B.prototype.visitTimeSecond=null;B.prototype.visitTimeMillisecond=null;B.prototype.visitTimeMicrosecond=null;B.prototype.visitTimeNanosecond=null;B.prototype.visitDenseUnion=null;B.prototype.visitSparseUnion=null;B.prototype.visitIntervalDayTime=null;B.prototype.visitIntervalYearMonth=null;B.prototype.visitIntervalMonthDayNano=null;B.prototype.visitDuration=null;B.prototype.visitDurationSecond=null;B.prototype.visitDurationMillisecond=null;B.prototype.visitDurationMicrosecond=null;B.prototype.visitDurationNanosecond=null});var du={};ye(du,{float64ToUint16:()=>Us,uint16ToFloat64:()=>ba});function ba(r){let t=(r&31744)>>10,e=(r&1023)/1024,n=Math.pow(-1,(r&32768)>>15);switch(t){case 31:return n*(e?Number.NaN:1/0);case 0:return n*(e?6103515625e-14*e:0)}return n*Math.pow(2,t-15)*(1+e)}function Us(r){if(r!==r)return 32256;Sh[0]=r;let t=(Oi[1]&2147483648)>>16&65535,e=Oi[1]&2146435072,n=0;return e>=1089470464?Oi[0]>0?e=31744:(e=(e&2080374784)>>16,n=(Oi[1]&1048575)>>10):e<=1056964608?(n=1048576+(Oi[1]&1048575),n=1048576+(n<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,n=(Oi[1]&1048575)+512>>10),t|e|n&65535}var Sh,Oi,Ps=d(()=>{Sh=new Float64Array(1),Oi=new Uint32Array(Sh.buffer)});function k(r){return(t,e,n)=>{if(t.setValid(e,n!=null))return r(t,e,n)}}var L,h0,xh,p0,Pr,hu,Ih,m0,wa,va,pu,Ah,Bh,mu,Sa,xa,Ia,Aa,yu,Ba,Da,Ta,Ea,_u,gu,y0,_0,g0,b0,w0,v0,S0,x0,Dh,Th,I0,bu,Oa,La,Fa,Na,Ma,Ra,ka,wu,A0,Ht,Ie=d(()=>{Ae();Ye();Ur();an();Ps();Nt();L=class extends B{};h0=(r,t,e)=>{r[t]=Math.floor(e/864e5)},xh=(r,t,e,n)=>{if(e+1<t.length){let i=q(t[e]),s=q(t[e+1]);r.set(n.subarray(0,s-i),i)}},p0=({offset:r,values:t},e,n)=>{let i=r+e;n?t[i>>3]|=1<<i%8:t[i>>3]&=~(1<<i%8)},Pr=({values:r},t,e)=>{r[t]=e},hu=({values:r},t,e)=>{r[t]=e},Ih=({values:r},t,e)=>{r[t]=Us(e)},m0=(r,t,e)=>{switch(r.type.precision){case st.HALF:return Ih(r,t,e);case st.SINGLE:case st.DOUBLE:return hu(r,t,e)}},wa=({values:r},t,e)=>{h0(r,t,e.valueOf())},va=({values:r},t,e)=>{r[t]=BigInt(e)},pu=({stride:r,values:t},e,n)=>{t.set(n.subarray(0,r),r*e)},Ah=({values:r,valueOffsets:t},e,n)=>xh(r,t,e,n),Bh=({values:r,valueOffsets:t},e,n)=>xh(r,t,e,rr(n)),mu=(r,t,e)=>{r.type.unit===wt.DAY?wa(r,t,e):va(r,t,e)},Sa=({values:r},t,e)=>{r[t]=BigInt(e/1e3)},xa=({values:r},t,e)=>{r[t]=BigInt(e)},Ia=({values:r},t,e)=>{r[t]=BigInt(e*1e3)},Aa=({values:r},t,e)=>{r[t]=BigInt(e*1e6)},yu=(r,t,e)=>{switch(r.type.unit){case x.SECOND:return Sa(r,t,e);case x.MILLISECOND:return xa(r,t,e);case x.MICROSECOND:return Ia(r,t,e);case x.NANOSECOND:return Aa(r,t,e)}},Ba=({values:r},t,e)=>{r[t]=e},Da=({values:r},t,e)=>{r[t]=e},Ta=({values:r},t,e)=>{r[t]=e},Ea=({values:r},t,e)=>{r[t]=e},_u=(r,t,e)=>{switch(r.type.unit){case x.SECOND:return Ba(r,t,e);case x.MILLISECOND:return Da(r,t,e);case x.MICROSECOND:return Ta(r,t,e);case x.NANOSECOND:return Ea(r,t,e)}},gu=({values:r,stride:t},e,n)=>{r.set(n.subarray(0,t),t*e)},y0=(r,t,e)=>{let n=r.children[0],i=r.valueOffsets,s=Ht.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=i[t],l=i[t+1];a<l;)s(n,a++,e[++o]);else for(let o=-1,a=i[t],l=i[t+1];a<l;)s(n,a++,e.get(++o))},_0=(r,t,e)=>{let n=r.children[0],{valueOffsets:i}=r,s=Ht.getVisitFn(n),{[t]:o,[t+1]:a}=i,l=e instanceof Map?e.entries():Object.entries(e);for(let c of l)if(s(n,o,c),++o>=a)break},g0=(r,t)=>(e,n,i,s)=>n&&e(n,r,t[s]),b0=(r,t)=>(e,n,i,s)=>n&&e(n,r,t.get(s)),w0=(r,t)=>(e,n,i,s)=>n&&e(n,r,t.get(i.name)),v0=(r,t)=>(e,n,i,s)=>n&&e(n,r,t[i.name]),S0=(r,t,e)=>{let n=r.type.children.map(s=>Ht.getVisitFn(s.type)),i=e instanceof Map?w0(t,e):e instanceof v?b0(t,e):Array.isArray(e)?g0(t,e):v0(t,e);r.type.children.forEach((s,o)=>i(n[o],r.children[o],s,o))},x0=(r,t,e)=>{r.type.mode===at.Dense?Dh(r,t,e):Th(r,t,e)},Dh=(r,t,e)=>{let n=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[n];Ht.visit(i,r.valueOffsets[t],e)},Th=(r,t,e)=>{let n=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[n];Ht.visit(i,t,e)},I0=(r,t,e)=>{var n;(n=r.dictionary)===null||n===void 0||n.set(r.values[t],e)},bu=(r,t,e)=>{switch(r.type.unit){case ut.YEAR_MONTH:return La(r,t,e);case ut.DAY_TIME:return Oa(r,t,e);case ut.MONTH_DAY_NANO:return Fa(r,t,e)}},Oa=({values:r},t,e)=>{r.set(e.subarray(0,2),2*t)},La=({values:r},t,e)=>{r[t]=e[0]*12+e[1]%12},Fa=({values:r,stride:t},e,n)=>{r.set(n.subarray(0,t),t*e)},Na=({values:r},t,e)=>{r[t]=e},Ma=({values:r},t,e)=>{r[t]=e},Ra=({values:r},t,e)=>{r[t]=e},ka=({values:r},t,e)=>{r[t]=e},wu=(r,t,e)=>{switch(r.type.unit){case x.SECOND:return Na(r,t,e);case x.MILLISECOND:return Ma(r,t,e);case x.MICROSECOND:return Ra(r,t,e);case x.NANOSECOND:return ka(r,t,e)}},A0=(r,t,e)=>{let{stride:n}=r,i=r.children[0],s=Ht.getVisitFn(i);if(Array.isArray(e))for(let o=-1,a=t*n;++o<n;)s(i,a+o,e[o]);else for(let o=-1,a=t*n;++o<n;)s(i,a+o,e.get(o))};L.prototype.visitBool=k(p0);L.prototype.visitInt=k(Pr);L.prototype.visitInt8=k(Pr);L.prototype.visitInt16=k(Pr);L.prototype.visitInt32=k(Pr);L.prototype.visitInt64=k(Pr);L.prototype.visitUint8=k(Pr);L.prototype.visitUint16=k(Pr);L.prototype.visitUint32=k(Pr);L.prototype.visitUint64=k(Pr);L.prototype.visitFloat=k(m0);L.prototype.visitFloat16=k(Ih);L.prototype.visitFloat32=k(hu);L.prototype.visitFloat64=k(hu);L.prototype.visitUtf8=k(Bh);L.prototype.visitLargeUtf8=k(Bh);L.prototype.visitBinary=k(Ah);L.prototype.visitLargeBinary=k(Ah);L.prototype.visitFixedSizeBinary=k(pu);L.prototype.visitDate=k(mu);L.prototype.visitDateDay=k(wa);L.prototype.visitDateMillisecond=k(va);L.prototype.visitTimestamp=k(yu);L.prototype.visitTimestampSecond=k(Sa);L.prototype.visitTimestampMillisecond=k(xa);L.prototype.visitTimestampMicrosecond=k(Ia);L.prototype.visitTimestampNanosecond=k(Aa);L.prototype.visitTime=k(_u);L.prototype.visitTimeSecond=k(Ba);L.prototype.visitTimeMillisecond=k(Da);L.prototype.visitTimeMicrosecond=k(Ta);L.prototype.visitTimeNanosecond=k(Ea);L.prototype.visitDecimal=k(gu);L.prototype.visitList=k(y0);L.prototype.visitStruct=k(S0);L.prototype.visitUnion=k(x0);L.prototype.visitDenseUnion=k(Dh);L.prototype.visitSparseUnion=k(Th);L.prototype.visitDictionary=k(I0);L.prototype.visitInterval=k(bu);L.prototype.visitIntervalDayTime=k(Oa);L.prototype.visitIntervalYearMonth=k(La);L.prototype.visitIntervalMonthDayNano=k(Fa);L.prototype.visitDuration=k(wu);L.prototype.visitDurationSecond=k(Na);L.prototype.visitDurationMillisecond=k(Ma);L.prototype.visitDurationMicrosecond=k(Ra);L.prototype.visitDurationNanosecond=k(ka);L.prototype.visitFixedSizeList=k(A0);L.prototype.visitMap=k(_0);Ht=new L});var Ke,Li,ln,vu,Su,B0,xu=d(()=>{Rs();Cn();Ie();Ke=Symbol.for("parent"),Li=Symbol.for("rowIndex"),ln=class{constructor(t,e){return this[Ke]=t,this[Li]=e,new Proxy(this,B0)}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[Li],e=this[Ke],n=e.type.children,i={};for(let s=-1,o=n.length;++s<o;)i[n[s].name]=Bt.visit(e.children[s],t);return i}toString(){return`{${[...this].map(([t,e])=>`${We(t)}: ${We(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new vu(this[Ke],this[Li])}},vu=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,Bt.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(ln.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Ke]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Li]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});Su=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Ke].type.children.map(e=>e.name)}has(t,e){return t[Ke].type.children.some(n=>n.name===e)}getOwnPropertyDescriptor(t,e){if(t[Ke].type.children.some(n=>n.name===e))return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];let n=t[Ke].type.children.findIndex(i=>i.name===e);if(n!==-1){let i=Bt.visit(t[Ke].children[n],t[Li]);return Reflect.set(t,e,i),i}}set(t,e,n){let i=t[Ke].type.children.findIndex(s=>s.name===e);return i!==-1?(Ht.visit(t[Ke].children[i],t[Li],n),Reflect.set(t,e,n)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,n):!1}},B0=new Su});function M(r){return(t,e)=>t.getValid(e)?r(t,e):null}var D,D0,T0,Eh,E0,Oh,Lh,un,O0,Fh,L0,Nh,Mh,F0,N0,M0,Rh,kh,Ch,Uh,R0,Ph,Vh,zh,jh,k0,C0,U0,P0,V0,z0,Hh,$h,j0,H0,Zh,Wh,Gh,Yh,Kh,Jh,Xh,$0,Z0,Bt,Cn=d(()=>{fu();Ae();Ye();Ca();xu();Ur();an();Ps();Nt();D=class extends B{};D0=(r,t)=>864e5*r[t],T0=(r,t)=>null,Eh=(r,t,e)=>{if(e+1>=t.length)return null;let n=q(t[e]),i=q(t[e+1]);return r.subarray(n,i)},E0=({offset:r,values:t},e)=>{let n=r+e;return(t[n>>3]&1<<n%8)!==0},Oh=({values:r},t)=>D0(r,t),Lh=({values:r},t)=>q(r[t]),un=({stride:r,values:t},e)=>t[r*e],O0=({stride:r,values:t},e)=>ba(t[r*e]),Fh=({values:r},t)=>r[t],L0=({stride:r,values:t},e)=>t.subarray(r*e,r*(e+1)),Nh=({values:r,valueOffsets:t},e)=>Eh(r,t,e),Mh=({values:r,valueOffsets:t},e)=>{let n=Eh(r,t,e);return n!==null?Ds(n):null},F0=({values:r},t)=>r[t],N0=({type:r,values:t},e)=>r.precision!==st.HALF?t[e]:ba(t[e]),M0=(r,t)=>r.type.unit===wt.DAY?Oh(r,t):Lh(r,t),Rh=({values:r},t)=>1e3*q(r[t]),kh=({values:r},t)=>q(r[t]),Ch=({values:r},t)=>au(r[t],BigInt(1e3)),Uh=({values:r},t)=>au(r[t],BigInt(1e6)),R0=(r,t)=>{switch(r.type.unit){case x.SECOND:return Rh(r,t);case x.MILLISECOND:return kh(r,t);case x.MICROSECOND:return Ch(r,t);case x.NANOSECOND:return Uh(r,t)}},Ph=({values:r},t)=>r[t],Vh=({values:r},t)=>r[t],zh=({values:r},t)=>r[t],jh=({values:r},t)=>r[t],k0=(r,t)=>{switch(r.type.unit){case x.SECOND:return Ph(r,t);case x.MILLISECOND:return Vh(r,t);case x.MICROSECOND:return zh(r,t);case x.NANOSECOND:return jh(r,t)}},C0=({values:r,stride:t},e)=>Dn.decimal(r.subarray(t*e,t*(e+1))),U0=(r,t)=>{let{valueOffsets:e,stride:n,children:i}=r,{[t*n]:s,[t*n+1]:o}=e,l=i[0].slice(s,o-s);return new v([l])},P0=(r,t)=>{let{valueOffsets:e,children:n}=r,{[t]:i,[t+1]:s}=e,o=n[0];return new Ar(o.slice(i,s-i))},V0=(r,t)=>new ln(r,t),z0=(r,t)=>r.type.mode===at.Dense?Hh(r,t):$h(r,t),Hh=(r,t)=>{let e=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[e];return Bt.visit(n,r.valueOffsets[t])},$h=(r,t)=>{let e=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[e];return Bt.visit(n,t)},j0=(r,t)=>{var e;return(e=r.dictionary)===null||e===void 0?void 0:e.get(r.values[t])},H0=(r,t)=>r.type.unit===ut.MONTH_DAY_NANO?Gh(r,t):r.type.unit===ut.DAY_TIME?Zh(r,t):Wh(r,t),Zh=({values:r},t)=>r.subarray(2*t,2*(t+1)),Wh=({values:r},t)=>{let e=r[t],n=new Int32Array(2);return n[0]=Math.trunc(e/12),n[1]=Math.trunc(e%12),n},Gh=({values:r},t)=>r.subarray(4*t,4*(t+1)),Yh=({values:r},t)=>r[t],Kh=({values:r},t)=>r[t],Jh=({values:r},t)=>r[t],Xh=({values:r},t)=>r[t],$0=(r,t)=>{switch(r.type.unit){case x.SECOND:return Yh(r,t);case x.MILLISECOND:return Kh(r,t);case x.MICROSECOND:return Jh(r,t);case x.NANOSECOND:return Xh(r,t)}},Z0=(r,t)=>{let{stride:e,children:n}=r,s=n[0].slice(t*e,e);return new v([s])};D.prototype.visitNull=M(T0);D.prototype.visitBool=M(E0);D.prototype.visitInt=M(F0);D.prototype.visitInt8=M(un);D.prototype.visitInt16=M(un);D.prototype.visitInt32=M(un);D.prototype.visitInt64=M(Fh);D.prototype.visitUint8=M(un);D.prototype.visitUint16=M(un);D.prototype.visitUint32=M(un);D.prototype.visitUint64=M(Fh);D.prototype.visitFloat=M(N0);D.prototype.visitFloat16=M(O0);D.prototype.visitFloat32=M(un);D.prototype.visitFloat64=M(un);D.prototype.visitUtf8=M(Mh);D.prototype.visitLargeUtf8=M(Mh);D.prototype.visitBinary=M(Nh);D.prototype.visitLargeBinary=M(Nh);D.prototype.visitFixedSizeBinary=M(L0);D.prototype.visitDate=M(M0);D.prototype.visitDateDay=M(Oh);D.prototype.visitDateMillisecond=M(Lh);D.prototype.visitTimestamp=M(R0);D.prototype.visitTimestampSecond=M(Rh);D.prototype.visitTimestampMillisecond=M(kh);D.prototype.visitTimestampMicrosecond=M(Ch);D.prototype.visitTimestampNanosecond=M(Uh);D.prototype.visitTime=M(k0);D.prototype.visitTimeSecond=M(Ph);D.prototype.visitTimeMillisecond=M(Vh);D.prototype.visitTimeMicrosecond=M(zh);D.prototype.visitTimeNanosecond=M(jh);D.prototype.visitDecimal=M(C0);D.prototype.visitList=M(U0);D.prototype.visitStruct=M(V0);D.prototype.visitUnion=M(z0);D.prototype.visitDenseUnion=M(Hh);D.prototype.visitSparseUnion=M($h);D.prototype.visitDictionary=M(j0);D.prototype.visitInterval=M(H0);D.prototype.visitIntervalDayTime=M(Zh);D.prototype.visitIntervalYearMonth=M(Wh);D.prototype.visitIntervalMonthDayNano=M(Gh);D.prototype.visitDuration=M($0);D.prototype.visitDurationSecond=M(Yh);D.prototype.visitDurationMillisecond=M(Kh);D.prototype.visitDurationMicrosecond=M(Jh);D.prototype.visitDurationNanosecond=M(Xh);D.prototype.visitFixedSizeList=M(Z0);D.prototype.visitMap=M(P0);Bt=new D});var fn,Ni,Fi,Iu,Ar,Au,Bu,Ca=d(()=>{Ae();Rs();Cn();Ie();fn=Symbol.for("keys"),Ni=Symbol.for("vals"),Fi=Symbol.for("kKeysAsStrings"),Iu=Symbol.for("_kKeysAsStrings"),Ar=class{constructor(t){return this[fn]=new v([t.children[0]]).memoize(),this[Ni]=t.children[1],new Proxy(this,new Bu)}get[Fi](){return this[Iu]||(this[Iu]=Array.from(this[fn].toArray(),String))}[Symbol.iterator](){return new Au(this[fn],this[Ni])}get size(){return this[fn].length}toArray(){return Object.values(this.toJSON())}toJSON(){let t=this[fn],e=this[Ni],n={};for(let i=-1,s=t.length;++i<s;)n[t.get(i)]=Bt.visit(e,i);return n}toString(){return`{${[...this].map(([t,e])=>`${We(t)}: ${We(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},Au=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),Bt.visit(this.vals,t)]})}},Bu=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Fi]}has(t,e){return t[Fi].includes(e)}getOwnPropertyDescriptor(t,e){if(t[Fi].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];let n=t[Fi].indexOf(e);if(n!==-1){let i=Bt.visit(Reflect.get(t,Ni),n);return Reflect.set(t,e,i),i}}set(t,e,n){let i=t[Fi].indexOf(e);return i!==-1?(Ht.visit(Reflect.get(t,Ni),i,n),Reflect.set(t,e,n)):Reflect.has(t,e)?Reflect.set(t,e,n):!1}};Object.defineProperties(Ar.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[fn]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Ni]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Iu]:{writable:!0,enumerable:!1,configurable:!1,value:null}})});var Du={};ye(Du,{clampRange:()=>Vs,createElementComparator:()=>dn,wrapIndex:()=>Un});function Vs(r,t,e,n){let{length:i=0}=r,s=typeof t!="number"?0:t,o=typeof e!="number"?i:e;return s<0&&(s=(s%i+i)%i),o<0&&(o=(o%i+i)%i),o<s&&(qh=s,s=o,o=qh),o>i&&(o=i),n?n(r,s,o):[s,o]}function dn(r){if(typeof r!=="object"||r===null)return Qh(r)?Qh:e=>e===r;if(r instanceof Date){let e=r.valueOf();return n=>n instanceof Date?n.valueOf()===e:!1}return ArrayBuffer.isView(r)?e=>e?Dl(r,e):!1:r instanceof Map?G0(r):Array.isArray(r)?W0(r):r instanceof v?Y0(r):K0(r,!0)}function W0(r){let t=[];for(let e=-1,n=r.length;++e<n;)t[e]=dn(r[e]);return Ua(t)}function G0(r){let t=-1,e=[];for(let n of r.values())e[++t]=dn(n);return Ua(e)}function Y0(r){let t=[];for(let e=-1,n=r.length;++e<n;)t[e]=dn(r.get(e));return Ua(t)}function K0(r,t=!1){let e=Object.keys(r);if(!t&&e.length===0)return()=>!1;let n=[];for(let i=-1,s=e.length;++i<s;)n[i]=dn(r[e[i]]);return Ua(n,e)}function Ua(r,t){return e=>{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return J0(r,e);case Map:return tp(r,e,e.keys());case Ar:case ln:case Object:case void 0:return tp(r,e,t||Object.keys(e))}return e instanceof v?X0(r,e):!1}}function J0(r,t){let e=r.length;if(t.length!==e)return!1;for(let n=-1;++n<e;)if(!r[n](t[n]))return!1;return!0}function X0(r,t){let e=r.length;if(t.length!==e)return!1;for(let n=-1;++n<e;)if(!r[n](t.get(n)))return!1;return!0}function tp(r,t,e){let n=e[Symbol.iterator](),i=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),s=t instanceof Map?t.values():Object.values(t)[Symbol.iterator](),o=0,a=r.length,l=s.next(),c=n.next(),u=i.next();for(;o<a&&!c.done&&!u.done&&!l.done&&!(c.value!==u.value||!r[o](l.value));++o,c=n.next(),u=i.next(),l=s.next());return o===a&&c.done&&u.done&&l.done?!0:(n.return&&n.return(),i.return&&i.return(),s.return&&s.return(),!1)}var qh,Un,Qh,Mi=d(()=>{Ae();Ca();xu();kt();Un=(r,t)=>r<0?t+r:r,Qh=r=>r!==r});var Tu={};ye(Tu,{BitIterator:()=>Pn,getBit:()=>ep,getBool:()=>Va,packBools:()=>zn,popcnt_array:()=>rp,popcnt_bit_range:()=>zs,popcnt_uint32:()=>Pa,setBool:()=>q0,truncateBitmap:()=>Vn});function Va(r,t,e,n){return(e&1<<n)!==0}function ep(r,t,e,n){return(e&1<<n)>>n}function q0(r,t,e){return e?!!(r[t>>3]|=1<<t%8)||!0:!(r[t>>3]&=~(1<<t%8))&&!1}function Vn(r,t,e){let n=e.byteLength+7&-8;if(r>0||e.byteLength<n){let i=new Uint8Array(n);return i.set(r%8===0?e.subarray(r>>3):zn(new Pn(e,r,t,null,Va)).subarray(0,n)),i}return e}function zn(r){let t=[],e=0,n=0,i=0;for(let o of r)o&&(i|=1<<n),++n===8&&(t[e++]=i,i=n=0);(e===0||n>0)&&(t[e++]=i);let s=new Uint8Array(t.length+7&-8);return s.set(t),s}function zs(r,t,e){if(e-t<=0)return 0;if(e-t<8){let s=0;for(let o of new Pn(r,t,e-t,r,ep))s+=o;return s}let n=e>>3<<3,i=t+(t%8===0?0:8-t%8);return zs(r,t,i)+zs(r,n,e)+rp(r,i>>3,n-i>>3)}function rp(r,t,e){let n=0,i=Math.trunc(t),s=new DataView(r.buffer,r.byteOffset,r.byteLength),o=e===void 0?r.byteLength:i+e;for(;o-i>=4;)n+=Pa(s.getUint32(i)),i+=4;for(;o-i>=2;)n+=Pa(s.getUint16(i)),i+=2;for(;o-i>=1;)n+=Pa(s.getUint8(i)),i+=1;return n}function Pa(r){let t=Math.trunc(r);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}var Pn,Ri=d(()=>{Pn=class{constructor(t,e,n,i,s){this.bytes=t,this.length=n,this.context=i,this.get=s,this.bit=e%8,this.byteIndex=e>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}}});function A(r){return tb.visit(r)}var Q0,Z,jn,tb,Vr=d(()=>{Ae();Nt();_t();Ri();Ye();kt();Q0=-1,Z=class{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:t}=this;return _.isSparseUnion(t)?this.children.some(e=>e.nullable):_.isDenseUnion(t)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0,{valueOffsets:e,values:n,nullBitmap:i,typeIds:s}=this;return e&&(t+=e.byteLength),n&&(t+=n.byteLength),i&&(t+=i.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){if(_.isUnion(this.type))return this.children.reduce((n,i)=>n+i.nullCount,0);let t=this._nullCount,e;return t<=Q0&&(e=this.nullBitmap)&&(this._nullCount=t=e.length===0?0:this.length-zs(e,this.offset,this.offset+this.length)),t}constructor(t,e,n,i,s,o=[],a){this.type=t,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let l;s instanceof Z?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=xe(t),s&&((l=s[0])&&(this.valueOffsets=l),(l=s[1])&&(this.values=l),(l=s[2])&&(this.nullBitmap=l),(l=s[3])&&(this.typeIds=l)))}getValid(t){let{type:e}=this;if(_.isUnion(e)){let n=e,i=this.children[n.typeIdToChildIndex[this.typeIds[t]]],s=n.mode===at.Dense?this.valueOffsets[t]:t;return i.getValid(s)}if(this.nullable&&this.nullCount>0){let n=this.offset+t;return(this.nullBitmap[n>>3]&1<<n%8)!==0}return!0}setValid(t,e){let n,{type:i}=this;if(_.isUnion(i)){let s=i,o=this.children[s.typeIdToChildIndex[this.typeIds[t]]],a=s.mode===at.Dense?this.valueOffsets[t]:t;n=o.getValid(a),o.setValid(a,e)}else{let{nullBitmap:s}=this,{offset:o,length:a}=this,l=o+t,c=1<<l%8,u=l>>3;(!s||s.byteLength<=u)&&(s=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(s.set(Vn(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:s})):Object.assign(this,{nullBitmap:s,_nullCount:0}));let h=s[u];n=(h&c)!==0,s[u]=e?h|c:h&~c}return n!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,n=this.length,i=this._nullCount,s=this,o=this.children){return new Z(t,e,n,i,s,o,this.dictionary)}slice(t,e){let{stride:n,typeId:i,children:s}=this,o=+(this._nullCount===0)-1,a=i===16?n:1,l=this._sliceBuffers(t,e,n,i);return this.clone(this.type,this.offset+t,e,o,l,s.length===0||this.valueOffsets?s:this._sliceChildren(s,a*t,a*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===f.Null)return this.clone(this.type,0,t,0);let{length:e,nullCount:n}=this,i=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);i[e>>3]=(1<<e-(e&-8))-1,n>0&&i.set(Vn(this.offset,e,this.nullBitmap),0);let s=this.buffers;return s[Ze.VALIDITY]=i,this.clone(this.type,0,t,n+(t-e),s)}_sliceBuffers(t,e,n,i){let s,{buffers:o}=this;return(s=o[Ze.TYPE])&&(o[Ze.TYPE]=s.subarray(t,t+e)),(s=o[Ze.OFFSET])&&(o[Ze.OFFSET]=s.subarray(t,t+e+1))||(s=o[Ze.DATA])&&(o[Ze.DATA]=i===6?s:s.subarray(n*t,n*(t+e))),o}_sliceChildren(t,e,n){return t.map(i=>i.slice(e,n))}};Z.prototype.children=Object.freeze([]);jn=class extends B{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){let{["type"]:e,["offset"]:n=0,["length"]:i=0}=t;return new Z(e,n,i,i)}visitBool(t){let{["type"]:e,["offset"]:n=0}=t,i=F(t.nullBitmap),s=H(e.ArrayType,t.data),{["length"]:o=s.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Z(e,n,o,a,[void 0,s,i])}visitInt(t){let{["type"]:e,["offset"]:n=0}=t,i=F(t.nullBitmap),s=H(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Z(e,n,o,a,[void 0,s,i])}visitFloat(t){let{["type"]:e,["offset"]:n=0}=t,i=F(t.nullBitmap),s=H(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Z(e,n,o,a,[void 0,s,i])}visitUtf8(t){let{["type"]:e,["offset"]:n=0}=t,i=F(t.data),s=F(t.nullBitmap),o=An(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Z(e,n,a,l,[o,i,s])}visitLargeUtf8(t){let{["type"]:e,["offset"]:n=0}=t,i=F(t.data),s=F(t.nullBitmap),o=ua(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Z(e,n,a,l,[o,i,s])}visitBinary(t){let{["type"]:e,["offset"]:n=0}=t,i=F(t.data),s=F(t.nullBitmap),o=An(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Z(e,n,a,l,[o,i,s])}visitLargeBinary(t){let{["type"]:e,["offset"]:n=0}=t,i=F(t.data),s=F(t.nullBitmap),o=ua(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Z(e,n,a,l,[o,i,s])}visitFixedSizeBinary(t){let{["type"]:e,["offset"]:n=0}=t,i=F(t.nullBitmap),s=H(e.ArrayType,t.data),{["length"]:o=s.length/xe(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Z(e,n,o,a,[void 0,s,i])}visitDate(t){let{["type"]:e,["offset"]:n=0}=t,i=F(t.nullBitmap),s=H(e.ArrayType,t.data),{["length"]:o=s.length/xe(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Z(e,n,o,a,[void 0,s,i])}visitTimestamp(t){let{["type"]:e,["offset"]:n=0}=t,i=F(t.nullBitmap),s=H(e.ArrayType,t.data),{["length"]:o=s.length/xe(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Z(e,n,o,a,[void 0,s,i])}visitTime(t){let{["type"]:e,["offset"]:n=0}=t,i=F(t.nullBitmap),s=H(e.ArrayType,t.data),{["length"]:o=s.length/xe(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Z(e,n,o,a,[void 0,s,i])}visitDecimal(t){let{["type"]:e,["offset"]:n=0}=t,i=F(t.nullBitmap),s=H(e.ArrayType,t.data),{["length"]:o=s.length/xe(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Z(e,n,o,a,[void 0,s,i])}visitList(t){let{["type"]:e,["offset"]:n=0,["child"]:i}=t,s=F(t.nullBitmap),o=An(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Z(e,n,a,l,[o,void 0,s],[i])}visitStruct(t){let{["type"]:e,["offset"]:n=0,["children"]:i=[]}=t,s=F(t.nullBitmap),{length:o=i.reduce((l,{length:c})=>Math.max(l,c),0),nullCount:a=t.nullBitmap?-1:0}=t;return new Z(e,n,o,a,[void 0,void 0,s],i)}visitUnion(t){let{["type"]:e,["offset"]:n=0,["children"]:i=[]}=t,s=H(e.ArrayType,t.typeIds),{["length"]:o=s.length,["nullCount"]:a=-1}=t;if(_.isSparseUnion(e))return new Z(e,n,o,a,[void 0,void 0,void 0,s],i);let l=An(t.valueOffsets);return new Z(e,n,o,a,[l,void 0,void 0,s],i)}visitDictionary(t){let{["type"]:e,["offset"]:n=0}=t,i=F(t.nullBitmap),s=H(e.indices.ArrayType,t.data),{["dictionary"]:o=new v([new jn().visit({type:e.dictionary})])}=t,{["length"]:a=s.length,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Z(e,n,a,l,[void 0,s,i],[],o)}visitInterval(t){let{["type"]:e,["offset"]:n=0}=t,i=F(t.nullBitmap),s=H(e.ArrayType,t.data),{["length"]:o=s.length/xe(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Z(e,n,o,a,[void 0,s,i])}visitDuration(t){let{["type"]:e,["offset"]:n=0}=t,i=F(t.nullBitmap),s=H(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Z(e,n,o,a,[void 0,s,i])}visitFixedSizeList(t){let{["type"]:e,["offset"]:n=0,["child"]:i=new jn().visit({type:e.valueType})}=t,s=F(t.nullBitmap),{["length"]:o=i.length/xe(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Z(e,n,o,a,[void 0,void 0,s],[i])}visitMap(t){let{["type"]:e,["offset"]:n=0,["child"]:i=new jn().visit({type:e.childType})}=t,s=F(t.nullBitmap),o=An(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Z(e,n,a,l,[o,void 0,s],[i])}},tb=new jn});function np(r){return r.some(t=>t.nullable)}function za(r){return r.reduce((t,e)=>t+e.nullCount,0)}function ja(r){return r.reduce((t,e,n)=>(t[n+1]=t[n]+e.length,t),new Uint32Array(r.length+1))}function Ha(r,t,e,n){let i=[];for(let s=-1,o=r.length;++s<o;){let a=r[s],l=t[s],{length:c}=a;if(l>=n)break;if(e>=l+c)continue;if(l>=e&&l+c<=n){i.push(a);continue}let u=Math.max(0,e-l),h=Math.min(n-l,c);i.push(a.slice(u,h-u))}return i.length===0&&i.push(r[0].slice(0,0)),i}function Eu(r,t,e,n){let i=0,s=0,o=t.length-1;do{if(i>=o-1)return e<t[o]?n(r,i,e-t[i]):null;s=i+Math.trunc((o-i)*.5),e<t[s]?o=s:i=s}while(i<o)}function Hs(r,t){return r.getValid(t)}function ki(r){function t(e,n,i){return r(e[n],i)}return function(e){let n=this.data;return Eu(n,this._offsets,e,t)}}function $a(r){let t;function e(n,i,s){return r(n[i],s,t)}return function(n,i){let s=this.data;t=i;let o=Eu(s,this._offsets,n,e);return t=void 0,o}}function Za(r){let t;function e(n,i,s){let o=s,a=0,l=0;for(let c=i-1,u=n.length;++c<u;){let h=n[c];if(~(a=r(h,t,o)))return l+a;o=0,l+=h.length}return-1}return function(n,i){t=n;let s=this.data,o=typeof i!="number"?e(s,0,0):Eu(s,this._offsets,i,e);return t=void 0,o}}var js,Wa=d(()=>{js=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 eb(r,t){return t===null&&r.length>0?0:-1}function rb(r,t){let{nullBitmap:e}=r;if(!e||r.nullCount<=0)return-1;let n=0;for(let i of new Pn(e,r.offset+(t||0),r.length,e,Va)){if(!i)return n;++n}return-1}function C(r,t,e){if(t===void 0)return-1;if(t===null)switch(r.typeId){case f.Union:break;case f.Dictionary:break;default:return rb(r,e)}let n=Bt.getVisitFn(r),i=dn(t);for(let s=(e||0)-1,o=r.length;++s<o;)if(i(n(r,s)))return s;return-1}function ip(r,t,e){let n=Bt.getVisitFn(r),i=dn(t);for(let s=(e||0)-1,o=r.length;++s<o;)if(i(n(r,s)))return s;return-1}var T,Hn,Ga=d(()=>{Nt();Ye();Cn();Ri();Mi();T=class extends B{};T.prototype.visitNull=eb;T.prototype.visitBool=C;T.prototype.visitInt=C;T.prototype.visitInt8=C;T.prototype.visitInt16=C;T.prototype.visitInt32=C;T.prototype.visitInt64=C;T.prototype.visitUint8=C;T.prototype.visitUint16=C;T.prototype.visitUint32=C;T.prototype.visitUint64=C;T.prototype.visitFloat=C;T.prototype.visitFloat16=C;T.prototype.visitFloat32=C;T.prototype.visitFloat64=C;T.prototype.visitUtf8=C;T.prototype.visitLargeUtf8=C;T.prototype.visitBinary=C;T.prototype.visitLargeBinary=C;T.prototype.visitFixedSizeBinary=C;T.prototype.visitDate=C;T.prototype.visitDateDay=C;T.prototype.visitDateMillisecond=C;T.prototype.visitTimestamp=C;T.prototype.visitTimestampSecond=C;T.prototype.visitTimestampMillisecond=C;T.prototype.visitTimestampMicrosecond=C;T.prototype.visitTimestampNanosecond=C;T.prototype.visitTime=C;T.prototype.visitTimeSecond=C;T.prototype.visitTimeMillisecond=C;T.prototype.visitTimeMicrosecond=C;T.prototype.visitTimeNanosecond=C;T.prototype.visitDecimal=C;T.prototype.visitList=C;T.prototype.visitStruct=C;T.prototype.visitUnion=C;T.prototype.visitDenseUnion=ip;T.prototype.visitSparseUnion=ip;T.prototype.visitDictionary=C;T.prototype.visitInterval=C;T.prototype.visitIntervalDayTime=C;T.prototype.visitIntervalYearMonth=C;T.prototype.visitIntervalMonthDayNano=C;T.prototype.visitDuration=C;T.prototype.visitDurationSecond=C;T.prototype.visitDurationMillisecond=C;T.prototype.visitDurationMicrosecond=C;T.prototype.visitDurationNanosecond=C;T.prototype.visitFixedSizeList=C;T.prototype.visitMap=C;Hn=new T});function R(r){let{type:t}=r;if(r.nullCount===0&&r.stride===1&&(_.isInt(t)&&t.bitWidth!==64||_.isTime(t)&&t.bitWidth!==64||_.isFloat(t)&&t.precision!==st.HALF))return new js(r.data.length,n=>{let i=r.data[n];return i.values.subarray(0,i.length)[Symbol.iterator]()});let e=0;return new js(r.data.length,n=>{let s=r.data[n].length,o=r.slice(e,e+s);return e+=s,new Ou(o)})}var E,Ou,Ci,Ya=d(()=>{Ye();Nt();_t();Wa();E=class extends B{};Ou=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}};E.prototype.visitNull=R;E.prototype.visitBool=R;E.prototype.visitInt=R;E.prototype.visitInt8=R;E.prototype.visitInt16=R;E.prototype.visitInt32=R;E.prototype.visitInt64=R;E.prototype.visitUint8=R;E.prototype.visitUint16=R;E.prototype.visitUint32=R;E.prototype.visitUint64=R;E.prototype.visitFloat=R;E.prototype.visitFloat16=R;E.prototype.visitFloat32=R;E.prototype.visitFloat64=R;E.prototype.visitUtf8=R;E.prototype.visitLargeUtf8=R;E.prototype.visitBinary=R;E.prototype.visitLargeBinary=R;E.prototype.visitFixedSizeBinary=R;E.prototype.visitDate=R;E.prototype.visitDateDay=R;E.prototype.visitDateMillisecond=R;E.prototype.visitTimestamp=R;E.prototype.visitTimestampSecond=R;E.prototype.visitTimestampMillisecond=R;E.prototype.visitTimestampMicrosecond=R;E.prototype.visitTimestampNanosecond=R;E.prototype.visitTime=R;E.prototype.visitTimeSecond=R;E.prototype.visitTimeMillisecond=R;E.prototype.visitTimeMicrosecond=R;E.prototype.visitTimeNanosecond=R;E.prototype.visitDecimal=R;E.prototype.visitList=R;E.prototype.visitStruct=R;E.prototype.visitUnion=R;E.prototype.visitDenseUnion=R;E.prototype.visitSparseUnion=R;E.prototype.visitDictionary=R;E.prototype.visitInterval=R;E.prototype.visitIntervalDayTime=R;E.prototype.visitIntervalYearMonth=R;E.prototype.visitIntervalMonthDayNano=R;E.prototype.visitDuration=R;E.prototype.visitDurationSecond=R;E.prototype.visitDurationMillisecond=R;E.prototype.visitDurationMicrosecond=R;E.prototype.visitDurationNanosecond=R;E.prototype.visitFixedSizeList=R;E.prototype.visitMap=R;Ci=new E});function $n(r){if(r){if(r instanceof Z)return new v([r]);if(r instanceof v)return new v(r.data);if(r.type instanceof _)return new v([A(r)]);if(Array.isArray(r))return new v(r.flatMap(t=>nb(t)));if(ArrayBuffer.isView(r)){r instanceof DataView&&(r=new Uint8Array(r.buffer));let t={offset:0,length:r.length,nullCount:-1,data:r};if(r instanceof Int8Array)return new v([A(Object.assign(Object.assign({},t),{type:new Tn}))]);if(r instanceof Int16Array)return new v([A(Object.assign(Object.assign({},t),{type:new En}))]);if(r instanceof Int32Array)return new v([A(Object.assign(Object.assign({},t),{type:new ve}))]);if(r instanceof BigInt64Array)return new v([A(Object.assign(Object.assign({},t),{type:new On}))]);if(r instanceof Uint8Array||r instanceof Uint8ClampedArray)return new v([A(Object.assign(Object.assign({},t),{type:new Ln}))]);if(r instanceof Uint16Array)return new v([A(Object.assign(Object.assign({},t),{type:new Fn}))]);if(r instanceof Uint32Array)return new v([A(Object.assign(Object.assign({},t),{type:new Nn}))]);if(r instanceof BigUint64Array)return new v([A(Object.assign(Object.assign({},t),{type:new Mn}))]);if(r instanceof Float32Array)return new v([A(Object.assign(Object.assign({},t),{type:new Rn}))]);if(r instanceof Float64Array)return new v([A(Object.assign(Object.assign({},t),{type:new kn}))]);throw new Error("Unrecognized input")}}throw new Error("Unrecognized input")}function nb(r){return r instanceof Z?[r]:r instanceof v?r.data:$n(r).data}var sp,op,ap,v,Ui,Ae=d(()=>{Nt();Mi();_t();Vr();Wa();Cn();Ie();Ga();Ya();_t();op={},ap={},v=class{constructor(t){var e,n,i;let s=t[0]instanceof v?t.flatMap(a=>a.data):t;if(s.length===0||s.some(a=>!(a instanceof Z)))throw new TypeError("Vector constructor expects an Array of Data instances.");let o=(e=s[0])===null||e===void 0?void 0:e.type;switch(s.length){case 0:this._offsets=[0];break;case 1:{let{get:a,set:l,indexOf:c}=op[o.typeId],u=s[0];this.isValid=h=>Hs(u,h),this.get=h=>a(u,h),this.set=(h,m)=>l(u,h,m),this.indexOf=h=>c(u,h),this._offsets=[0,u.length];break}default:Object.setPrototypeOf(this,ap[o.typeId]),this._offsets=ja(s);break}this.data=s,this.type=o,this.stride=xe(o),this.numChildren=(i=(n=o.children)===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullable(){return np(this.data)}get nullCount(){return za(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${f[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(Un(t,this.length))}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}[Symbol.iterator](){return Ci.visit(this)}concat(...t){return new v(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new v(Vs(this,t,e,({data:n,_offsets:i},s,o)=>Ha(n,i,s,o)))}toJSON(){return[...this]}toArray(){let{type:t,data:e,length:n,stride:i,ArrayType:s}=this;switch(t.typeId){case f.Int:case f.Float:case f.Decimal:case f.Time:case f.Timestamp:switch(e.length){case 0:return new s;case 1:return e[0].values.subarray(0,n*i);default:return e.reduce((o,{values:a,length:l})=>(o.array.set(a.subarray(0,l*i),o.offset),o.offset+=l*i,o),{array:new s(n*i),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(n=>n.name===t))}getChildAt(t){return t>-1&&t<this.numChildren?new v(this.data.map(({children:e})=>e[t])):null}get isMemoized(){return _.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(_.isDictionary(this.type)){let t=new Ui(this.data[0].dictionary),e=this.data.map(n=>{let i=n.clone();return i.dictionary=t,i});return new v(e)}return new Ui(this)}unmemoize(){if(_.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),e=this.data.map(n=>{let i=n.clone();return i.dictionary=t,i});return new v(e)}return this}};sp=Symbol.toStringTag;v[sp]=(r=>{r.type=_.prototype,r.data=[],r.length=0,r.stride=1,r.numChildren=0,r._offsets=new Uint32Array([0]),r[Symbol.isConcatSpreadable]=!0;let t=Object.keys(f).map(e=>f[e]).filter(e=>typeof e=="number"&&e!==f.NONE);for(let e of t){let n=Bt.getVisitFnByTypeId(e),i=Ht.getVisitFnByTypeId(e),s=Hn.getVisitFnByTypeId(e);op[e]={get:n,set:i,indexOf:s},ap[e]=Object.create(r,{isValid:{value:ki(Hs)},get:{value:ki(Bt.getVisitFnByTypeId(e))},set:{value:$a(Ht.getVisitFnByTypeId(e))},indexOf:{value:Za(Hn.getVisitFnByTypeId(e))}})}return"Vector"})(v.prototype);Ui=class extends v{constructor(t){super(t.data);let e=this.get,n=this.set,i=this.slice,s=new Array(this.length);Object.defineProperty(this,"get",{value(o){let a=s[o];if(a!==void 0)return a;let l=e.call(this,o);return s[o]=l,l}}),Object.defineProperty(this,"set",{value(o,a){n.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new Ui(i.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new v(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}});function cp(r){if(!r||r.length<=0)return function(i){return!0};let t="",e=r.filter(n=>n===n);return e.length>0&&(t=`
8
+ switch (x) {${e.map(n=>`
9
+ case ${ib(n)}:`).join("")}
10
+ return false;
11
+ }`),r.length!==e.length&&(t=`if (x !== x) return false;
12
+ ${t}`),new Function("x",`${t}
13
+ return true;`)}function ib(r){return typeof r!="bigint"?We(r):`${We(r)}n`}var lp=d(()=>{Rs()});function Lu(r,t){let e=Math.ceil(r)*t-1;return(e-e%64+64||64)/t}function up(r,t=0){return r.length>=t?r.subarray(0,t):Es(new r.constructor(t),r,0)}var Je,zr,Pi,Vi,jr=d(()=>{kt();Je=class{constructor(t,e=0,n=1){this.length=Math.ceil(e/n),this.buffer=new t(this.length),this.stride=n,this.BYTES_PER_ELEMENT=t.BYTES_PER_ELEMENT,this.ArrayType=t}get byteLength(){return Math.ceil(this.length*this.stride)*this.BYTES_PER_ELEMENT}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(t,e){return this}append(t){return this.set(this.length,t)}reserve(t){if(t>0){this.length+=t;let e=this.stride,n=this.length*e,i=this.buffer.length;n>=i&&this._resize(i===0?Lu(n*1,this.BYTES_PER_ELEMENT):Lu(n*2,this.BYTES_PER_ELEMENT))}return this}flush(t=this.length){t=Lu(t*this.stride,this.BYTES_PER_ELEMENT);let e=up(this.buffer,t);return this.clear(),e}clear(){return this.length=0,this.buffer=new this.ArrayType,this}_resize(t){return this.buffer=up(this.buffer,t)}},zr=class extends Je{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}},Pi=class extends zr{constructor(){super(Uint8Array,0,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(t){return this.buffer[t>>3]>>t%8&1}set(t,e){let{buffer:n}=this.reserve(t-this.length+1),i=t>>3,s=t%8,o=n[i]>>s&1;return e?o===0&&(n[i]|=1<<s,++this.numValid):o===1&&(n[i]&=~(1<<s),--this.numValid),this}clear(){return this.numValid=0,super.clear()}},Vi=class extends zr{constructor(t){super(t.OffsetArrayType,1,1)}append(t){return this.set(this.length-1,t)}set(t,e){let n=this.length-1,i=this.reserve(t-n+1).buffer;return n<t++&&n>=0&&i.fill(i[n],n,t),i[t]=i[t-1]+e,this}flush(t=this.length-1){return t>this.length&&this.set(t-1,this.BYTES_PER_ELEMENT>4?BigInt(0):0),super.flush(t+1)}}});var ht,Dt,de,gt=d(()=>{Ae();Vr();Ca();_t();lp();jr();ht=class{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t){throw new Error('"throughDOM" not available in this environment')}constructor({type:t,nullValues:e}){this.length=0,this.finished=!1,this.type=t,this.children=[],this.nullValues=e,this.stride=xe(t),this._nulls=new Pi,e&&e.length>0&&(this._isValid=cp(e))}toVector(){return new v([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:n,_nulls:i,_typeIds:s,children:o}=this;return e&&(t+=e.byteLength),n&&(t+=n.byteLength),i&&(t+=i.byteLength),s&&(t+=s.byteLength),o.reduce((a,l)=>a+l.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,n)=>e+n.reservedByteLength,t)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(t){return this.set(this.length,t)}isValid(t){return this._isValid(t)}set(t,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,n,i,{type:s,length:o,nullCount:a,_typeIds:l,_offsets:c,_values:u,_nulls:h}=this;(e=l?.flush(o))?i=c?.flush(o):(i=c?.flush(o))?t=u?.flush(c.last()):t=u?.flush(o),a>0&&(n=h?.flush(o));let m=this.children.map(p=>p.flush());return this.clear(),A({type:s,length:o,nullCount:a,children:m,child:m[0],data:t,typeIds:e,nullBitmap:n,valueOffsets:i})}finish(){this.finished=!0;for(let t of this.children)t.finish();return this}clear(){var t,e,n,i;this.length=0,(t=this._nulls)===null||t===void 0||t.clear(),(e=this._values)===null||e===void 0||e.clear(),(n=this._offsets)===null||n===void 0||n.clear(),(i=this._typeIds)===null||i===void 0||i.clear();for(let s of this.children)s.clear();return this}};ht.prototype.length=1;ht.prototype.stride=1;ht.prototype.children=null;ht.prototype.finished=!1;ht.prototype.nullValues=null;ht.prototype._isValid=()=>!0;Dt=class extends ht{constructor(t){super(t),this._values=new zr(this.ArrayType,0,this.stride)}setValue(t,e){let n=this._values;return n.reserve(t-n.length+1),super.setValue(t,e)}},de=class extends ht{constructor(t){super(t),this._pendingLength=0,this._offsets=new Vi(t.type)}setValue(t,e){let n=this._pending||(this._pending=new Map),i=n.get(t);i&&(this._pendingLength-=i.length),this._pendingLength+=e instanceof Ar?e[fn].length:e.length,n.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 Zn,Fu=d(()=>{Zn=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,n,i){return t.prep(8,24),t.writeInt64(BigInt(i??0)),t.pad(4),t.writeInt32(n),t.writeInt64(BigInt(e??0)),t.offset()}}});var Kt,fp=d(()=>{K();Fu();Ai();ha();iu();Kt=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 Kt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,e){return t.setPosition(t.position()+4),(e||new Kt).__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):it.V1}schema(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}dictionaries(t,e){let n=this.bb.__offset(this.bb_pos,8);return n?(e||new Zn).__init(this.bb.__vector(this.bb_pos+n)+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 n=this.bb.__offset(this.bb_pos,10);return n?(e||new Zn).__init(this.bb.__vector(this.bb_pos+n)+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 n=this.bb.__offset(this.bb_pos,12);return n?(e||new ft).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+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,it.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 n=e.length-1;n>=0;n--)t.addOffset(e[n]);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)}}});function Ka(r,t){return new Map([...r||new Map,...t||new Map])}function Nu(r,t=new Map){for(let e=-1,n=r.length;++e<n;){let s=r[e].type;if(_.isDictionary(s)){if(!t.has(s.id))t.set(s.id,s.dictionary);else if(t.get(s.id)!==s.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}s.children&&s.children.length>0&&Nu(s.children,t)}return t}var $,U,Be=d(()=>{Nt();_t();$=class{constructor(t=[],e,n,i=it.V5){this.fields=t||[],this.metadata=e||new Map,n||(n=Nu(this.fields)),this.dictionaries=n,this.metadataVersion=i}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),n=this.fields.filter(i=>e.has(i.name));return new $(n,this.metadata)}selectAt(t){let e=t.map(n=>this.fields[n]).filter(Boolean);return new $(e,this.metadata)}assign(...t){let e=t[0]instanceof $?t[0]:Array.isArray(t[0])?new $(t[0]):new $(t),n=[...this.fields],i=Ka(Ka(new Map,this.metadata),e.metadata),s=e.fields.filter(a=>{let l=n.findIndex(c=>c.name===a.name);return~l?(n[l]=a.clone({metadata:Ka(Ka(new Map,n[l].metadata),a.metadata)}))&&!1:!0}),o=Nu(s,new Map);return new $([...n,...s],i,new Map([...this.dictionaries,...o]))}};$.prototype.fields=null;$.prototype.metadata=null;$.prototype.dictionaries=null;U=class{static new(...t){let[e,n,i,s]=t;return t[0]&&typeof t[0]=="object"&&({name:e}=t[0],n===void 0&&(n=t[0].type),i===void 0&&(i=t[0].nullable),s===void 0&&(s=t[0].metadata)),new U(`${e}`,n,i,s)}constructor(t,e,n=!1,i){this.name=t,this.type=e,this.nullable=n,this.metadata=i||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[e,n,i,s]=t;return!t[0]||typeof t[0]!="object"?[e=this.name,n=this.type,i=this.nullable,s=this.metadata]=t:{name:e=this.name,type:n=this.type,nullable:i=this.nullable,metadata:s=this.metadata}=t[0],U.new(e,n,i,s)}};U.prototype.type=null;U.prototype.name=null;U.prototype.nullable=null;U.prototype.metadata=null});var sb,ob,Hr,Mu,Xe,Ru=d(()=>{Fu();fp();K();Be();Nt();kt();Ur();sb=Cr,ob=Ft,Hr=class{static decode(t){t=new ob(F(t));let e=Kt.getRootAsFooter(t),n=$.decode(e.schema(),new Map,e.version());return new Mu(n,e)}static encode(t){let e=new sb,n=$.encode(e,t.schema);Kt.startRecordBatchesVector(e,t.numRecordBatches);for(let o of[...t.recordBatches()].slice().reverse())Xe.encode(e,o);let i=e.endVector();Kt.startDictionariesVector(e,t.numDictionaries);for(let o of[...t.dictionaryBatches()].slice().reverse())Xe.encode(e,o);let s=e.endVector();return Kt.startFooter(e),Kt.addSchema(e,n),Kt.addVersion(e,it.V5),Kt.addRecordBatches(e,i),Kt.addDictionaries(e,s),Kt.finishFooterBuffer(e,Kt.endFooter(e)),e.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,e=it.V5,n,i){this.schema=t,this.version=e,n&&(this._recordBatches=n),i&&(this._dictionaryBatches=i)}*recordBatches(){for(let t,e=-1,n=this.numRecordBatches;++e<n;)(t=this.getRecordBatch(e))&&(yield t)}*dictionaryBatches(){for(let t,e=-1,n=this.numDictionaries;++e<n;)(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}},Mu=class extends Hr{get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}constructor(t,e){super(t,e.version()),this._footer=e}getRecordBatch(t){if(t>=0&&t<this.numRecordBatches){let e=this._footer.recordBatches(t);if(e)return Xe.decode(e)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){let e=this._footer.dictionaries(t);if(e)return Xe.decode(e)}return null}},Xe=class{static decode(t){return new Xe(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,e){let{metaDataLength:n}=e,i=BigInt(e.offset),s=BigInt(e.bodyLength);return Zn.createBlock(t,i,n,s)}constructor(t,e,n){this.metaDataLength=t,this.offset=q(n),this.bodyLength=q(e)}}});var vt,dp=d(()=>{K();Ai();su();ha();vt=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 vt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+4),(e||new vt).__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):it.V1}headerType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):W.NONE}header(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}bodyLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}customMetadata(t,e){let n=this.bb.__offset(this.bb_pos,12);return n?(e||new ft).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+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,it.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,W.NONE)}static addHeader(t,e){t.addFieldOffset(2,e,0)}static addBodyLength(t,e){t.addFieldInt64(3,e,BigInt("0"))}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);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,n,i,s,o){return vt.startMessage(t),vt.addVersion(t,e),vt.addHeaderType(t,n),vt.addHeader(t,i),vt.addBodyLength(t,s),vt.addCustomMetadata(t,o),vt.endMessage(t)}}});var ku,Ja,hp=d(()=>{Ye();Yd();ga();Jl();Hd();Zd();$d();Jd();Wd();Wl();Zl();Ql();tu();Xl();Gl();Gd();Kd();eu();$l();Yl();Kl();ql();ku=class extends B{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return ur.startNull(e),ur.endNull(e)}visitInt(t,e){return Ct.startInt(e),Ct.addBitWidth(e,t.bitWidth),Ct.addIsSigned(e,t.isSigned),Ct.endInt(e)}visitFloat(t,e){return ae.startFloatingPoint(e),ae.addPrecision(e,t.precision),ae.endFloatingPoint(e)}visitBinary(t,e){return sr.startBinary(e),sr.endBinary(e)}visitLargeBinary(t,e){return ar.startLargeBinary(e),ar.endLargeBinary(e)}visitBool(t,e){return or.startBool(e),or.endBool(e)}visitUtf8(t,e){return dr.startUtf8(e),dr.endUtf8(e)}visitLargeUtf8(t,e){return cr.startLargeUtf8(e),cr.endLargeUtf8(e)}visitDecimal(t,e){return Ut.startDecimal(e),Ut.addScale(e,t.scale),Ut.addPrecision(e,t.precision),Ut.addBitWidth(e,t.bitWidth),Ut.endDecimal(e)}visitDate(t,e){return ne.startDate(e),ne.addUnit(e,t.unit),ne.endDate(e)}visitTime(t,e){return Wt.startTime(e),Wt.addUnit(e,t.unit),Wt.addBitWidth(e,t.bitWidth),Wt.endTime(e)}visitTimestamp(t,e){let n=t.timezone&&e.createString(t.timezone)||void 0;return Gt.startTimestamp(e),Gt.addUnit(e,t.unit),n!==void 0&&Gt.addTimezone(e,n),Gt.endTimestamp(e)}visitInterval(t,e){return ce.startInterval(e),ce.addUnit(e,t.unit),ce.endInterval(e)}visitDuration(t,e){return ie.startDuration(e),ie.addUnit(e,t.unit),ie.endDuration(e)}visitList(t,e){return lr.startList(e),lr.endList(e)}visitStruct(t,e){return fr.startStruct_(e),fr.endStruct_(e)}visitUnion(t,e){Pt.startTypeIdsVector(e,t.typeIds.length);let n=Pt.createTypeIdsVector(e,t.typeIds);return Pt.startUnion(e),Pt.addMode(e,t.mode),Pt.addTypeIds(e,n),Pt.endUnion(e)}visitDictionary(t,e){let n=this.visit(t.indices,e);return we.startDictionaryEncoding(e),we.addId(e,BigInt(t.id)),we.addIsOrdered(e,t.isOrdered),n!==void 0&&we.addIndexType(e,n),we.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return se.startFixedSizeBinary(e),se.addByteWidth(e,t.byteWidth),se.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return oe.startFixedSizeList(e),oe.addListSize(e,t.listSize),oe.endFixedSizeList(e)}visitMap(t,e){return le.startMap(e),le.addKeysSorted(e,t.keysSorted),le.endMap(e)}},Ja=new ku});function _p(r,t=new Map){return new $(ab(r,t),Xa(r.metadata),t)}function Cu(r){return new Et(r.count,bp(r.columns),wp(r.columns),null)}function gp(r){return new Jt(Cu(r.data),r.id,r.isDelta)}function ab(r,t){return(r.fields||[]).filter(Boolean).map(e=>U.fromJSON(e,t))}function pp(r,t){return(r.children||[]).filter(Boolean).map(e=>U.fromJSON(e,t))}function bp(r){return(r||[]).reduce((t,e)=>[...t,new Me(e.count,cb(e.VALIDITY)),...bp(e.children)],[])}function wp(r,t=[]){for(let e=-1,n=(r||[]).length;++e<n;){let i=r[e];i.VALIDITY&&t.push(new Tt(t.length,i.VALIDITY.length)),i.TYPE_ID&&t.push(new Tt(t.length,i.TYPE_ID.length)),i.OFFSET&&t.push(new Tt(t.length,i.OFFSET.length)),i.DATA&&t.push(new Tt(t.length,i.DATA.length)),t=wp(i.children,t)}return t}function cb(r){return(r||[]).reduce((t,e)=>t+ +(e===0),0)}function vp(r,t){let e,n,i,s,o,a;return!t||!(s=r.dictionary)?(o=yp(r,pp(r,t)),i=new U(r.name,o,r.nullable,Xa(r.metadata))):t.has(e=s.id)?(n=(n=s.indexType)?mp(n):new ve,a=new fe(t.get(e),n,e,s.isOrdered),i=new U(r.name,a,r.nullable,Xa(r.metadata))):(n=(n=s.indexType)?mp(n):new ve,t.set(e,o=yp(r,pp(r,t))),a=new fe(o,n,e,s.isOrdered),i=new U(r.name,a,r.nullable,Xa(r.metadata))),i||null}function Xa(r=[]){return new Map(r.map(({key:t,value:e})=>[t,e]))}function mp(r){return new At(r.isSigned,r.bitWidth)}function yp(r,t){let e=r.type.name;switch(e){case"NONE":return new Yt;case"null":return new Yt;case"binary":return new hr;case"largebinary":return new pr;case"utf8":return new mr;case"largeutf8":return new yr;case"bool":return new _r;case"list":return new Le((t||[])[0]);case"struct":return new ct(t||[]);case"struct_":return new ct(t||[])}switch(e){case"int":{let n=r.type;return new At(n.isSigned,n.bitWidth)}case"floatingpoint":{let n=r.type;return new Se(st[n.precision])}case"decimal":{let n=r.type;return new gr(n.scale,n.precision,n.bitWidth)}case"date":{let n=r.type;return new br(wt[n.unit])}case"time":{let n=r.type;return new wr(x[n.unit],n.bitWidth)}case"timestamp":{let n=r.type;return new vr(x[n.unit],n.timezone)}case"interval":{let n=r.type;return new Sr(ut[n.unit])}case"duration":{let n=r.type;return new xr(x[n.unit])}case"union":{let n=r.type,[i,...s]=(n.mode+"").toLowerCase(),o=i.toUpperCase()+s.join("");return new Fe(at[o],n.typeIds||[],t||[])}case"fixedsizebinary":{let n=r.type;return new Ir(n.byteWidth)}case"fixedsizelist":{let n=r.type;return new ue(n.listSize,(t||[])[0])}case"map":{let n=r.type;return new Ne((t||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${e}"`)}var Sp=d(()=>{Be();_t();Wn();Nt()});function fb(r,t){return()=>{switch(t){case W.Schema:return $.fromJSON(r);case W.RecordBatch:return Et.fromJSON(r);case W.DictionaryBatch:return Jt.fromJSON(r)}throw new Error(`Unrecognized Message type: { name: ${W[t]}, type: ${t} }`)}}function db(r,t){return()=>{switch(t){case W.Schema:return $.decode(r.header(new yt),new Map,r.version());case W.RecordBatch:return Et.decode(r.header(new jt),r.version());case W.DictionaryBatch:return Jt.decode(r.header(new Oe),r.version())}throw new Error(`Unrecognized Message type: { name: ${W[t]}, type: ${t} }`)}}function hb(r,t=new Map,e=it.V5){let n=wb(r,t);return new $(n,qa(r),t,e)}function pb(r,t=it.V5){return new Et(r.length(),gb(r),bb(r,t),Bp(r.compression()))}function mb(r,t=it.V5){return new Jt(Et.decode(r.data(),t),r.id(),r.isDelta())}function yb(r){return new Tt(r.offset(),r.length())}function _b(r){return new Me(r.length(),r.nullCount())}function gb(r){let t=[];for(let e,n=-1,i=-1,s=r.nodesLength();++n<s;)(e=r.nodes(n))&&(t[++i]=Me.decode(e));return t}function bb(r,t){let e=[];for(let n,i=-1,s=-1,o=r.buffersLength();++i<o;)(n=r.buffers(i))&&(t<it.V4&&(n.bb_pos+=8*(i+1)),e[++s]=Tt.decode(n));return e}function wb(r,t){let e=[];for(let n,i=-1,s=-1,o=r.fieldsLength();++i<o;)(n=r.fields(i))&&(e[++s]=U.decode(n,t));return e}function xp(r,t){let e=[];for(let n,i=-1,s=-1,o=r.childrenLength();++i<o;)(n=r.children(i))&&(e[++s]=U.decode(n,t));return e}function vb(r,t){let e,n,i,s,o,a;return!t||!(a=r.dictionary())?(i=Ap(r,xp(r,t)),n=new U(r.name(),i,r.nullable(),qa(r))):t.has(e=q(a.id()))?(s=(s=a.indexType())?Ip(s):new ve,o=new fe(t.get(e),s,e,a.isOrdered()),n=new U(r.name(),o,r.nullable(),qa(r))):(s=(s=a.indexType())?Ip(s):new ve,t.set(e,i=Ap(r,xp(r,t))),o=new fe(i,s,e,a.isOrdered()),n=new U(r.name(),o,r.nullable(),qa(r))),n||null}function qa(r){let t=new Map;if(r)for(let e,n,i=-1,s=Math.trunc(r.customMetadataLength());++i<s;)(e=r.customMetadata(i))&&(n=e.key())!=null&&t.set(n,e.value());return t}function Ip(r){return new At(r.isSigned(),r.bitWidth())}function Ap(r,t){let e=r.typeType();switch(e){case ot.NONE:return new Yt;case ot.Null:return new Yt;case ot.Binary:return new hr;case ot.LargeBinary:return new pr;case ot.Utf8:return new mr;case ot.LargeUtf8:return new yr;case ot.Bool:return new _r;case ot.List:return new Le((t||[])[0]);case ot.Struct_:return new ct(t||[])}switch(e){case ot.Int:{let n=r.type(new Ct);return new At(n.isSigned(),n.bitWidth())}case ot.FloatingPoint:{let n=r.type(new ae);return new Se(n.precision())}case ot.Decimal:{let n=r.type(new Ut);return new gr(n.scale(),n.precision(),n.bitWidth())}case ot.Date:{let n=r.type(new ne);return new br(n.unit())}case ot.Time:{let n=r.type(new Wt);return new wr(n.unit(),n.bitWidth())}case ot.Timestamp:{let n=r.type(new Gt);return new vr(n.unit(),n.timezone())}case ot.Interval:{let n=r.type(new ce);return new Sr(n.unit())}case ot.Duration:{let n=r.type(new ie);return new xr(n.unit())}case ot.Union:{let n=r.type(new Pt);return new Fe(n.mode(),n.typeIdsArray()||[],t||[])}case ot.FixedSizeBinary:{let n=r.type(new se);return new Ir(n.byteWidth())}case ot.FixedSizeList:{let n=r.type(new oe);return new ue(n.listSize(),(t||[])[0])}case ot.Map:{let n=r.type(new le);return new Ne((t||[])[0],n.keysSorted())}}throw new Error(`Unrecognized type: "${ot[e]}" (${e})`)}function Bp(r){return r?new Gn(r.codec(),r.method()):null}function Sb(r,t){let e=t.fields.map(s=>U.encode(r,s));yt.startFieldsVector(r,e.length);let n=yt.createFieldsVector(r,e),i=t.metadata&&t.metadata.size>0?yt.createCustomMetadataVector(r,[...t.metadata].map(([s,o])=>{let a=r.createString(`${s}`),l=r.createString(`${o}`);return ft.startKeyValue(r),ft.addKey(r,a),ft.addValue(r,l),ft.endKeyValue(r)})):-1;return yt.startSchema(r),yt.addFields(r,n),yt.addEndianness(r,Tb?cn.Little:cn.Big),i!==-1&&yt.addCustomMetadata(r,i),yt.endSchema(r)}function xb(r,t){let e=-1,n=-1,i=-1,s=t.type,o=t.typeId;_.isDictionary(s)?(o=s.dictionary.typeId,i=Ja.visit(s,r),n=Ja.visit(s.dictionary,r)):n=Ja.visit(s,r);let a=(s.children||[]).map(u=>U.encode(r,u)),l=It.createChildrenVector(r,a),c=t.metadata&&t.metadata.size>0?It.createCustomMetadataVector(r,[...t.metadata].map(([u,h])=>{let m=r.createString(`${u}`),p=r.createString(`${h}`);return ft.startKeyValue(r),ft.addKey(r,m),ft.addValue(r,p),ft.endKeyValue(r)})):-1;return t.name&&(e=r.createString(t.name)),It.startField(r),It.addType(r,n),It.addTypeType(r,o),It.addChildren(r,l),It.addNullable(r,!!t.nullable),e!==-1&&It.addName(r,e),i!==-1&&It.addDictionary(r,i),c!==-1&&It.addCustomMetadata(r,c),It.endField(r)}function Ib(r,t){let e=t.nodes||[],n=t.buffers||[];jt.startNodesVector(r,e.length);for(let a of e.slice().reverse())Me.encode(r,a);let i=r.endVector();jt.startBuffersVector(r,n.length);for(let a of n.slice().reverse())Tt.encode(r,a);let s=r.endVector(),o=null;return t.compression!==null&&(o=Dp(r,t.compression)),jt.startRecordBatch(r),jt.addLength(r,BigInt(t.length)),jt.addNodes(r,i),jt.addBuffers(r,s),t.compression!==null&&o&&jt.addCompression(r,o),jt.endRecordBatch(r)}function Dp(r,t){return Zt.startBodyCompression(r),Zt.addCodec(r,t.type),Zt.addMethod(r,t.method),Zt.endBodyCompression(r)}function Ab(r,t){let e=Et.encode(r,t.data);return Oe.startDictionaryBatch(r),Oe.addId(r,BigInt(t.id)),Oe.addIsDelta(r,t.isDelta),Oe.addData(r,e),Oe.endDictionaryBatch(r)}function Bb(r,t){return Ii.createFieldNode(r,BigInt(t.length),BigInt(t.nullCount))}function Db(r,t){return xi.createBuffer(r,BigInt(t.offset),BigInt(t.length))}var lb,ub,Ot,Et,Jt,Tt,Me,Gn,Tb,Wn=d(()=>{K();iu();ga();jl();zd();Vl();nu();zl();ru();Ai();Hl();Jl();Wl();Zl();Ql();tu();Xl();Gl();eu();Yl();Kl();ql();dp();Pl();Ul();Be();kt();Ur();Nt();hp();Sp();_t();lb=Cr,ub=Ft,Ot=class{static fromJSON(t,e){let n=new Ot(0,it.V5,e);return n._createHeader=fb(t,e),n}static decode(t){t=new ub(F(t));let e=vt.getRootAsMessage(t),n=e.bodyLength(),i=e.version(),s=e.headerType(),o=new Ot(n,i,s);return o._createHeader=db(e,s),o}static encode(t){let e=new lb,n=-1;return t.isSchema()?n=$.encode(e,t.header()):t.isRecordBatch()?n=Et.encode(e,t.header()):t.isDictionaryBatch()&&(n=Jt.encode(e,t.header())),vt.startMessage(e),vt.addVersion(e,it.V5),vt.addHeader(e,n),vt.addHeaderType(e,t.headerType),vt.addBodyLength(e,BigInt(t.bodyLength)),vt.finishMessageBuffer(e,vt.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof $)return new Ot(0,it.V5,W.Schema,t);if(t instanceof Et)return new Ot(e,it.V5,W.RecordBatch,t);if(t instanceof Jt)return new Ot(e,it.V5,W.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 compression(){return this._compression}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===W.Schema}isRecordBatch(){return this.headerType===W.RecordBatch}isDictionaryBatch(){return this.headerType===W.DictionaryBatch}constructor(t,e,n,i){this._version=e,this._headerType=n,this.body=new Uint8Array(0),this._compression=i?.compression,i&&(this._createHeader=()=>i),this._bodyLength=q(t)}},Et=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}get compression(){return this._compression}constructor(t,e,n,i){this._nodes=e,this._buffers=n,this._length=q(t),this._compression=i}},Jt=class{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(t,e,n=!1){this._data=t,this._isDelta=n,this._id=q(e)}},Tt=class{constructor(t,e){this.offset=q(t),this.length=q(e)}},Me=class{constructor(t,e){this.length=q(t),this.nullCount=q(e)}},Gn=class{constructor(t,e=Bn.BUFFER){this.type=t,this.method=e}};U.encode=xb;U.decode=vb;U.fromJSON=vp;$.encode=Sb;$.decode=hb;$.fromJSON=_p;Et.encode=Ib;Et.decode=pb;Et.fromJSON=Cu;Jt.encode=Ab;Jt.decode=mb;Jt.fromJSON=gp;Me.encode=Bb;Me.decode=_b;Tt.encode=Db;Tt.decode=yb;Gn.encode=Dp;Gn.decode=Bp;Tb=(()=>{let r=new ArrayBuffer(2);return new DataView(r).setInt16(0,256,!0),new Int16Array(r)[0]===256})()});var dt,$s,Yn,Qa,Zs=d(()=>{ge();Os();dt=Object.freeze({done:!0,value:void 0}),$s=class{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},Yn=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())}},Qa=class extends Yn{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return b(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(dt);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return zt.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return zt.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return b(this,void 0,void 0,function*(){return yield this.abort(t),dt})}return(t){return b(this,void 0,void 0,function*(){return yield this.close(),dt})}read(t){return b(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return b(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,n)=>{this.resolvers.push({resolve:e,reject:n})}):Promise.resolve(dt)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}});var Br,Dr,he,Uu,$r,Kn=d(()=>{ge();Os();an();Zs();kt();In();Br=class extends Qa{write(t){if((t=F(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?Ds(this.toUint8Array(!0)):this.toUint8Array(!1).then(Ds)}toUint8Array(t=!1){return t?be(this._values)[0]:(()=>b(this,void 0,void 0,function*(){var e,n,i,s;let o=[],a=0;try{for(var l=!0,c=Ve(this),u;u=yield c.next(),e=u.done,!e;l=!0){s=u.value,l=!1;let h=s;o.push(h),a+=h.byteLength}}catch(h){n={error:h}}finally{try{!l&&!e&&(i=c.return)&&(yield i.call(c))}finally{if(n)throw n.error}}return be(o,a)[0]}))()}},Dr=class{constructor(t){t&&(this.source=new Uu(zt.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)}},he=class{constructor(t){t instanceof he?this.source=t.source:t instanceof Br?this.source=new $r(zt.fromAsyncIterable(t)):la(t)?this.source=new $r(zt.fromNodeStream(t)):Ts(t)?this.source=new $r(zt.fromDOMStream(t)):aa(t)?this.source=new $r(zt.fromDOMStream(t.body)):je(t)?this.source=new $r(zt.fromIterable(t)):ze(t)?this.source=new $r(zt.fromAsyncIterable(t)):Te(t)&&(this.source=new $r(zt.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)}},Uu=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)||dt)}return(t){return Object.create(this.source.return&&this.source.return(t)||dt)}},$r=class{constructor(t){this.source=t,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(t){return b(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return b(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return b(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t){return b(this,arguments,void 0,function*(e,n="read"){return yield this.source.next({cmd:n,size:e})})}throw(t){return b(this,void 0,void 0,function*(){let e=this.source.throw&&(yield this.source.throw(t))||dt;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}return(t){return b(this,void 0,void 0,function*(){let e=this.source.return&&(yield this.source.return(t))||dt;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}}});var Ws,hn,Pu=d(()=>{ge();Kn();kt();Ws=class extends Dr{constructor(t,e){super(),this.position=0,this.buffer=F(t),this.size=e===void 0?this.buffer.byteLength:e}readInt32(t){let{buffer:e,byteOffset:n}=this.readAt(t,4);return new DataView(e,n).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t<this.size}read(t){let{buffer:e,size:n,position:i}=this;return e&&i<n?(typeof t!="number"&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(n,i+Math.min(n-i,t)),e.subarray(i,this.position)):null}readAt(t,e){let n=this.buffer,i=Math.min(this.size,t+e);return n?n.subarray(t,i):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}}},hn=class extends he{constructor(t,e){super(),this.position=0,this._handle=t,typeof e=="number"?this.size=e:this._pending=(()=>b(this,void 0,void 0,function*(){this.size=(yield t.stat()).size,delete this._pending}))()}readInt32(t){return b(this,void 0,void 0,function*(){let{buffer:e,byteOffset:n}=yield this.readAt(t,4);return new DataView(e,n).getInt32(0,!0)})}seek(t){return b(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 b(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:e,size:n,position:i}=this;if(e&&i<n){typeof t!="number"&&(t=Number.POSITIVE_INFINITY);let s=i,o=0,a=0,l=Math.min(n,s+Math.min(n-s,t)),c=new Uint8Array(Math.max(0,(this.position=l)-s));for(;(s+=a)<l&&(o+=a)<c.byteLength;)({bytesRead:a}=yield e.read(c,o,c.byteLength-o,s));return c}return null})}readAt(t,e){return b(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:n,size:i}=this;if(n&&t+e<i){let s=Math.min(i,t+e),o=new Uint8Array(s-t);return(yield n.read(o,0,e,t)).buffer}return new Uint8Array(e)})}close(){return b(this,void 0,void 0,function*(){let t=this._handle;this._handle=null,t&&(yield t.close())})}throw(t){return b(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}return(t){return b(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}}});var zu={};ye(zu,{BaseInt64:()=>Gs,Int128:()=>pe,Int64:()=>Vt,Uint64:()=>rt});function zi(r){return r<0&&(r=4294967295+r+1),`0x${r.toString(16)}`}var ji,Vu,Gs,rt,Vt,pe,ju=d(()=>{ji=8,Vu=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Gs=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]),n=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]),i=e[3]*n[3];this.buffer[0]=i&65535;let s=i>>>16;return i=e[2]*n[3],s+=i,i=e[3]*n[2]>>>0,s+=i,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0<i?65536:0,this.buffer[1]+=s>>>16,this.buffer[1]+=e[1]*n[3]+e[2]*n[2]+e[3]*n[1],this.buffer[1]+=e[0]*n[3]+e[1]*n[2]+e[2]*n[1]+e[3]*n[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`${zi(this.buffer[1])} ${zi(this.buffer[0])}`}},rt=class extends Gs{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,e=new Uint32Array(2)){return rt.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return rt.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){let n=t.length,i=new rt(e);for(let s=0;s<n;){let o=ji<n-s?ji:n-s,a=new rt(new Uint32Array([Number.parseInt(t.slice(s,s+o),10),0])),l=new rt(new Uint32Array([Vu[o],0]));i.times(l),i.plus(a),s+=o}return i}static convertArray(t){let e=new Uint32Array(t.length*2);for(let n=-1,i=t.length;++n<i;)rt.from(t[n],new Uint32Array(e.buffer,e.byteOffset+2*n*4,2));return e}static multiply(t,e){return new rt(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new rt(new Uint32Array(t.buffer)).plus(e)}},Vt=class extends Gs{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,n=t.buffer[1]<<0;return e<n||e===n&&this.buffer[0]<t.buffer[0]}static from(t,e=new Uint32Array(2)){return Vt.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return Vt.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){let n=t.startsWith("-"),i=t.length,s=new Vt(e);for(let o=n?1:0;o<i;){let a=ji<i-o?ji:i-o,l=new Vt(new Uint32Array([Number.parseInt(t.slice(o,o+a),10),0])),c=new Vt(new Uint32Array([Vu[a],0]));s.times(c),s.plus(l),o+=a}return n?s.negate():s}static convertArray(t){let e=new Uint32Array(t.length*2);for(let n=-1,i=t.length;++n<i;)Vt.from(t[n],new Uint32Array(e.buffer,e.byteOffset+2*n*4,2));return e}static multiply(t,e){return new Vt(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new Vt(new Uint32Array(t.buffer)).plus(e)}},pe=class{constructor(t){this.buffer=t}high(){return new Vt(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new Vt(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 rt(new Uint32Array([this.buffer[3],0])),n=new rt(new Uint32Array([this.buffer[2],0])),i=new rt(new Uint32Array([this.buffer[1],0])),s=new rt(new Uint32Array([this.buffer[0],0])),o=new rt(new Uint32Array([t.buffer[3],0])),a=new rt(new Uint32Array([t.buffer[2],0])),l=new rt(new Uint32Array([t.buffer[1],0])),c=new rt(new Uint32Array([t.buffer[0],0])),u=rt.multiply(s,c);this.buffer[0]=u.low();let h=new rt(new Uint32Array([u.high(),0]));return u=rt.multiply(i,c),h.plus(u),u=rt.multiply(s,l),h.plus(u),this.buffer[1]=h.low(),this.buffer[3]=h.lessThan(u)?1:0,this.buffer[2]=h.high(),new rt(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(rt.multiply(n,c)).plus(rt.multiply(i,l)).plus(rt.multiply(s,a)),this.buffer[3]+=rt.multiply(e,c).plus(rt.multiply(n,l)).plus(rt.multiply(i,a)).plus(rt.multiply(s,o)).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`${zi(this.buffer[3])} ${zi(this.buffer[2])} ${zi(this.buffer[1])} ${zi(this.buffer[0])}`}static multiply(t,e){return new pe(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new pe(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return pe.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return pe.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){let n=t.startsWith("-"),i=t.length,s=new pe(e);for(let o=n?1:0;o<i;){let a=ji<i-o?ji:i-o,l=new pe(new Uint32Array([Number.parseInt(t.slice(o,o+a),10),0,0,0])),c=new pe(new Uint32Array([Vu[a],0,0,0]));s.times(c),s.plus(l),o+=a}return n?s.negate():s}static convertArray(t){let e=new Uint32Array(t.length*4);for(let n=-1,i=t.length;++n<i;)pe.from(t[n],new Uint32Array(e.buffer,e.byteOffset+4*4*n,4));return e}}});var Zu={};ye(Zu,{toIntervalDayTimeInt32Array:()=>Hu,toIntervalDayTimeObjects:()=>Eb,toIntervalMonthDayNanoInt32Array:()=>$u,toIntervalMonthDayNanoObjects:()=>Ob});function Hu(r){var t,e;let n=r.length,i=new Int32Array(n*2);for(let s=0,o=0;s<n;s++){let a=r[s];i[o++]=(t=a.days)!==null&&t!==void 0?t:0,i[o++]=(e=a.milliseconds)!==null&&e!==void 0?e:0}return i}function $u(r){var t,e;let n=r.length,i=new Int32Array(n*4);for(let s=0,o=0;s<n;s++){let a=r[s];i[o++]=(t=a.months)!==null&&t!==void 0?t:0,i[o++]=(e=a.days)!==null&&e!==void 0?e:0;let l=a.nanoseconds;l?(i[o++]=Number(BigInt(l)&BigInt(4294967295)),i[o++]=Number(BigInt(l)>>BigInt(32))):o+=2}return i}function Eb(r){let t=r.length,e=new Array(t/2);for(let n=0,i=0;n<t;n+=2)e[i++]={days:r[n],milliseconds:r[n+1]};return e}function Ob(r,t){let e=r.length,n=new Array(e/4);for(let i=0,s=0;i<e;i+=4){let o=BigInt(r[i+3])<<BigInt(32)|BigInt(r[i+2]>>>0);n[s++]={months:r[i],days:r[i+1],nanoseconds:t?`${o}`:o}}return n}var Wu=d(()=>{});function Lb(r){let t=r.join(""),e=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)e[n>>1]=Number.parseInt(t.slice(n,n+2),16);return e}var Hi,tc,ec,Ep=d(()=>{Vr();Be();_t();Ye();Ri();an();ju();Nt();kt();Wu();Hi=class extends B{constructor(t,e,n,i,s=it.V5){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=t,this.nodes=e,this.buffers=n,this.dictionaries=i,this.metadataVersion=s}visit(t){return super.visit(t instanceof U?t.type:t)}visitNull(t,{length:e}=this.nextFieldNode()){return A({type:t,length:e})}visitBool(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitInt(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitFloat(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitUtf8(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeUtf8(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitBinary(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitLargeBinary(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitFixedSizeBinary(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDate(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitTimestamp(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitTime(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDecimal(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitList(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}visitStruct(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),children:this.visitMany(t.children)})}visitUnion(t,{length:e,nullCount:n}=this.nextFieldNode()){return this.metadataVersion<it.V5&&this.readNullBitmap(t,n),t.mode===at.Sparse?this.visitSparseUnion(t,{length:e,nullCount:n}):this.visitDenseUnion(t,{length:e,nullCount:n})}visitDenseUnion(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,typeIds:this.readTypeIds(t),valueOffsets:this.readOffsets(t),children:this.visitMany(t.children)})}visitSparseUnion(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t.indices),dictionary:this.readDictionary(t)})}visitInterval(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitDuration(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),data:this.readData(t)})}visitFixedSizeList(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),child:this.visit(t.children[0])})}visitMap(t,{length:e,nullCount:n}=this.nextFieldNode()){return A({type:t,length:e,nullCount:n,nullBitmap:this.readNullBitmap(t,n),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,n=this.nextBufferRange()){return e>0&&this.readData(t,n)||new Uint8Array(0)}readOffsets(t,e){return this.readData(t,e)}readTypeIds(t,e){return this.readData(t,e)}readData(t,{length:e,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+e)}readDictionary(t){return this.dictionaries.get(t.id)}},tc=class extends Hi{constructor(t,e,n,i,s){super(new Uint8Array(0),e,n,i,s),this.sources=t}readNullBitmap(t,e,{offset:n}=this.nextBufferRange()){return e<=0?new Uint8Array(0):zn(this.sources[n])}readOffsets(t,{offset:e}=this.nextBufferRange()){return H(Uint8Array,H(t.OffsetArrayType,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return H(Uint8Array,H(t.ArrayType,this.sources[e]))}readData(t,{offset:e}=this.nextBufferRange()){let{sources:n}=this;if(_.isTimestamp(t))return H(Uint8Array,Vt.convertArray(n[e]));if((_.isInt(t)||_.isTime(t))&&t.bitWidth===64||_.isDuration(t))return H(Uint8Array,Vt.convertArray(n[e]));if(_.isDate(t)&&t.unit===wt.MILLISECOND)return H(Uint8Array,Vt.convertArray(n[e]));if(_.isDecimal(t))return H(Uint8Array,pe.convertArray(n[e]));if(_.isBinary(t)||_.isLargeBinary(t)||_.isFixedSizeBinary(t))return Lb(n[e]);if(_.isBool(t))return zn(n[e]);if(_.isUtf8(t)||_.isLargeUtf8(t))return rr(n[e].join(""));if(_.isInterval(t))switch(t.unit){case ut.DAY_TIME:return Hu(n[e]);case ut.MONTH_DAY_NANO:return $u(n[e]);default:break}return H(Uint8Array,H(t.ArrayType,n[e].map(i=>+i)))}};ec=class extends Hi{constructor(t,e,n,i,s){super(new Uint8Array(0),e,n,i,s),this.bodyChunks=t}readData(t,e=this.nextBufferRange()){return this.bodyChunks[this.buffersIndex]}}});var $i,Gu=d(()=>{jr();gt();kt();$i=class extends de{constructor(t){super(t),this._values=new Je(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,e){return super.setValue(t,F(e))}_flushPending(t,e){let n=this._offsets,i=this._values.reserve(e).buffer,s=0;for(let[o,a]of t)if(a===void 0)n.set(o,0);else{let l=a.length;i.set(a,s),n.set(o,l),s+=l}}}});var Zi,Yu=d(()=>{kt();jr();gt();Zi=class extends de{constructor(t){super(t),this._values=new Je(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,e){return super.setValue(t,F(e))}_flushPending(t,e){let n=this._offsets,i=this._values.reserve(e).buffer,s=0;for(let[o,a]of t)if(a===void 0)n.set(o,BigInt(0));else{let l=a.length;i.set(a,s),n.set(o,BigInt(l)),s+=l}}}});var rc,Op=d(()=>{jr();gt();rc=class extends ht{constructor(t){super(t),this._values=new Pi}setValue(t,e){this._values.set(t,+e)}}});var Jn,Ys,Ks,Lp=d(()=>{gt();Ie();Jn=class extends Dt{};Jn.prototype._setValue=mu;Ys=class extends Jn{};Ys.prototype._setValue=wa;Ks=class extends Jn{};Ks.prototype._setValue=va});var Js,Fp=d(()=>{gt();Ie();Js=class extends Dt{};Js.prototype._setValue=gu});var nc,Np=d(()=>{_t();gt();Ku();nc=class extends ht{constructor({type:t,nullValues:e,dictionaryHashFunction:n}){super({type:new fe(t.dictionary,t.indices,t.id,t.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=Xn({type:this.type.indices,nullValues:e}),this.dictionary=Xn({type:this.type.dictionary,nullValues:null}),typeof n=="function"&&(this.valueToKey=n)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(t){return this.indices.isValid(t)}setValid(t,e){let n=this.indices;return e=n.setValid(t,e),this.length=n.length,e}setValue(t,e){let n=this._keysToIndices,i=this.valueToKey(e),s=n[i];return s===void 0&&(n[i]=s=this._dictionaryOffset+this.dictionary.append(e).length-1),this.indices.setValue(t,s)}flush(){let t=this.type,e=this._dictionary,n=this.dictionary.toVector(),i=this.indices.flush().clone(t);return i.dictionary=e?e.concat(n):n,this.finished||(this._dictionaryOffset+=n.length),this._dictionary=i.dictionary,this.clear(),i}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(t){return typeof t=="string"?t:`${t}`}}});var Xs,Mp=d(()=>{gt();Ie();Xs=class extends Dt{};Xs.prototype._setValue=pu});var ic,Rp=d(()=>{Be();gt();_t();ic=class extends ht{setValue(t,e){let[n]=this.children,i=t*this.stride;for(let s=-1,o=this.stride;++s<o;)n.set(i+s,e[s])}setValid(t,e){return super.setValid(t,e)||this.children[0].setValid((t+1)*this.stride-1,!1),e}addChild(t,e="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");let n=this.children.push(t);return this.type=new ue(this.type.listSize,new U(e,t.type,!0)),n}}});var qn,sc,oc,ac,kp=d(()=>{Ps();gt();qn=class extends Dt{setValue(t,e){this._values.set(t,e)}},sc=class extends qn{setValue(t,e){super.setValue(t,Us(e))}},oc=class extends qn{},ac=class extends qn{}});var pn,qs,Qs,to,Cp=d(()=>{gt();Ie();pn=class extends Dt{};pn.prototype._setValue=bu;qs=class extends pn{};qs.prototype._setValue=Oa;Qs=class extends pn{};Qs.prototype._setValue=La;to=class extends pn{};to.prototype._setValue=Fa});var Zr,eo,ro,no,io,Up=d(()=>{gt();Ie();Zr=class extends Dt{};Zr.prototype._setValue=wu;eo=class extends Zr{};eo.prototype._setValue=Na;ro=class extends Zr{};ro.prototype._setValue=Ma;no=class extends Zr{};no.prototype._setValue=Ra;io=class extends Zr{};io.prototype._setValue=ka});var Re,cc,lc,uc,fc,dc,hc,pc,mc,Pp=d(()=>{gt();Re=class extends Dt{setValue(t,e){this._values.set(t,e)}},cc=class extends Re{},lc=class extends Re{},uc=class extends Re{},fc=class extends Re{},dc=class extends Re{},hc=class extends Re{},pc=class extends Re{},mc=class extends Re{}});var yc,Vp=d(()=>{Be();_t();jr();gt();yc=class extends de{constructor(t){super(t),this._offsets=new Vi(t.type)}addChild(t,e="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new Le(new U(e,t.type,!0)),this.numChildren-1}_flushPending(t){let e=this._offsets,[n]=this.children;for(let[i,s]of t)if(typeof s>"u")e.set(i,0);else{let o=s,a=o.length,l=e.set(i,a).buffer[i];for(let c=-1;++c<a;)n.set(l+c,o[c])}}}});var _c,zp=d(()=>{Be();_t();gt();_c=class extends de{set(t,e){return super.set(t,e)}setValue(t,e){let n=e instanceof Map?e:new Map(Object.entries(e)),i=this._pending||(this._pending=new Map),s=i.get(t);s&&(this._pendingLength-=s.size),this._pendingLength+=n.size,i.set(t,n)}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 Ne(new U(e,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){let e=this._offsets,[n]=this.children;for(let[i,s]of t)if(s===void 0)e.set(i,0);else{let{[i]:o,[i+1]:a}=e.set(i,s.size).buffer;for(let l of s.entries())if(n.set(o,l),++o>=a)break}}}});var gc,jp=d(()=>{gt();gc=class extends ht{setValue(t,e){}setValid(t,e){return this.length=Math.max(t+1,this.length),e}}});var bc,Hp=d(()=>{Be();gt();_t();bc=class extends ht{setValue(t,e){let{children:n,type:i}=this;switch(Array.isArray(e)||e.constructor){case!0:return i.children.forEach((s,o)=>n[o].set(t,e[o]));case Map:return i.children.forEach((s,o)=>n[o].set(t,e.get(s.name)));default:return i.children.forEach((s,o)=>n[o].set(t,e[s.name]))}}setValid(t,e){return super.setValid(t,e)||this.children.forEach(n=>n.setValid(t,e)),e}addChild(t,e=`${this.numChildren}`){let n=this.children.push(t);return this.type=new ct([...this.type.children,new U(e,t.type,!0)]),n}}});var Wr,so,oo,ao,co,$p=d(()=>{gt();Ie();Wr=class extends Dt{};Wr.prototype._setValue=yu;so=class extends Wr{};so.prototype._setValue=Sa;oo=class extends Wr{};oo.prototype._setValue=xa;ao=class extends Wr{};ao.prototype._setValue=Ia;co=class extends Wr{};co.prototype._setValue=Aa});var Gr,lo,uo,fo,ho,Zp=d(()=>{gt();Ie();Gr=class extends Dt{};Gr.prototype._setValue=_u;lo=class extends Gr{};lo.prototype._setValue=Ba;uo=class extends Gr{};uo.prototype._setValue=Da;fo=class extends Gr{};fo.prototype._setValue=Ta;ho=class extends Gr{};ho.prototype._setValue=Ea});var Wi,wc,vc,Wp=d(()=>{Be();jr();gt();_t();Wi=class extends ht{constructor(t){super(t),this._typeIds=new zr(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,n){return n===void 0&&(n=this._valueToChildTypeId(this,e,t)),this.setValue(t,e,n),this}setValue(t,e,n){this._typeIds.set(t,n);let i=this.type.typeIdToChildIndex[n],s=this.children[i];s?.set(t,e),this.length=Math.max(t+1,this.length)}addChild(t,e=`${this.children.length}`){let n=this.children.push(t),{type:{children:i,mode:s,typeIds:o}}=this,a=[...i,new U(e,t.type)];return this.type=new Fe(s,[...o,n],a),n}_valueToChildTypeId(t,e,n){throw new Error("Cannot map UnionBuilder value to child typeId. Pass the `childTypeId` as the second argument to unionBuilder.append(), or supply a `valueToChildTypeId` function as part of the UnionBuilder constructor options.")}},wc=class extends Wi{},vc=class extends Wi{constructor(t){super(t),this._offsets=new zr(Int32Array)}setValue(t,e,n){let i=this._typeIds.set(t,n).buffer[t],s=this.getChildAt(this.type.typeIdToChildIndex[i]),o=this._offsets.set(t,s.length).buffer[t];s?.set(o,e),this.length=Math.max(t+1,this.length)}}});var po,Gp=d(()=>{an();Gu();jr();gt();po=class extends de{constructor(t){super(t),this._values=new Je(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,e){return super.setValue(t,rr(e))}_flushPending(t,e){}};po.prototype._flushPending=$i.prototype._flushPending});var mo,Yp=d(()=>{an();jr();gt();Yu();mo=class extends de{constructor(t){super(t),this._values=new Je(Uint8Array)}get byteLength(){let t=this._pendingLength+this.length*4;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,e){return super.setValue(t,rr(e))}_flushPending(t,e){}};mo.prototype._flushPending=Zi.prototype._flushPending});var Ju,Kp,Jp=d(()=>{Ye();Gu();Yu();Op();Lp();Fp();Np();Mp();Rp();kp();Cp();Up();Pp();Vp();zp();jp();Hp();$p();Zp();Wp();Gp();Yp();Ju=class extends B{visitNull(){return gc}visitBool(){return rc}visitInt(){return Re}visitInt8(){return cc}visitInt16(){return lc}visitInt32(){return uc}visitInt64(){return fc}visitUint8(){return dc}visitUint16(){return hc}visitUint32(){return pc}visitUint64(){return mc}visitFloat(){return qn}visitFloat16(){return sc}visitFloat32(){return oc}visitFloat64(){return ac}visitUtf8(){return po}visitLargeUtf8(){return mo}visitBinary(){return $i}visitLargeBinary(){return Zi}visitFixedSizeBinary(){return Xs}visitDate(){return Jn}visitDateDay(){return Ys}visitDateMillisecond(){return Ks}visitTimestamp(){return Wr}visitTimestampSecond(){return so}visitTimestampMillisecond(){return oo}visitTimestampMicrosecond(){return ao}visitTimestampNanosecond(){return co}visitTime(){return Gr}visitTimeSecond(){return lo}visitTimeMillisecond(){return uo}visitTimeMicrosecond(){return fo}visitTimeNanosecond(){return ho}visitDecimal(){return Js}visitList(){return yc}visitStruct(){return bc}visitUnion(){return Wi}visitDenseUnion(){return vc}visitSparseUnion(){return wc}visitDictionary(){return nc}visitInterval(){return pn}visitIntervalDayTime(){return qs}visitIntervalYearMonth(){return Qs}visitIntervalMonthDayNano(){return to}visitDuration(){return Zr}visitDurationSecond(){return eo}visitDurationMillisecond(){return ro}visitDurationMicrosecond(){return no}visitDurationNanosecond(){return io}visitFixedSizeList(){return ic}visitMap(){return _c}},Kp=new Ju});function Qt(r,t){return t instanceof r.constructor}function Qn(r,t){return r===t||Qt(r,t)}function Yr(r,t){return r===t||Qt(r,t)&&r.bitWidth===t.bitWidth&&r.isSigned===t.isSigned}function Sc(r,t){return r===t||Qt(r,t)&&r.precision===t.precision}function Fb(r,t){return r===t||Qt(r,t)&&r.byteWidth===t.byteWidth}function Xu(r,t){return r===t||Qt(r,t)&&r.unit===t.unit}function yo(r,t){return r===t||Qt(r,t)&&r.unit===t.unit&&r.timezone===t.timezone}function _o(r,t){return r===t||Qt(r,t)&&r.unit===t.unit&&r.bitWidth===t.bitWidth}function Nb(r,t){return r===t||Qt(r,t)&&r.children.length===t.children.length&&Tr.compareManyFields(r.children,t.children)}function Mb(r,t){return r===t||Qt(r,t)&&r.children.length===t.children.length&&Tr.compareManyFields(r.children,t.children)}function qu(r,t){return r===t||Qt(r,t)&&r.mode===t.mode&&r.typeIds.every((e,n)=>e===t.typeIds[n])&&Tr.compareManyFields(r.children,t.children)}function Rb(r,t){return r===t||Qt(r,t)&&r.id===t.id&&r.isOrdered===t.isOrdered&&Tr.visit(r.indices,t.indices)&&Tr.visit(r.dictionary,t.dictionary)}function xc(r,t){return r===t||Qt(r,t)&&r.unit===t.unit}function go(r,t){return r===t||Qt(r,t)&&r.unit===t.unit}function kb(r,t){return r===t||Qt(r,t)&&r.listSize===t.listSize&&r.children.length===t.children.length&&Tr.compareManyFields(r.children,t.children)}function Cb(r,t){return r===t||Qt(r,t)&&r.keysSorted===t.keysSorted&&r.children.length===t.children.length&&Tr.compareManyFields(r.children,t.children)}function ti(r,t){return Tr.compareSchemas(r,t)}function Xp(r,t){return Tr.compareFields(r,t)}function qp(r,t){return Tr.visit(r,t)}var O,Tr,Ic=d(()=>{Ye();O=class extends B{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((n,i)=>this.compareFields(n,e[i]))}compareFields(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&this.visit(t.type,e.type)}};O.prototype.visitNull=Qn;O.prototype.visitBool=Qn;O.prototype.visitInt=Yr;O.prototype.visitInt8=Yr;O.prototype.visitInt16=Yr;O.prototype.visitInt32=Yr;O.prototype.visitInt64=Yr;O.prototype.visitUint8=Yr;O.prototype.visitUint16=Yr;O.prototype.visitUint32=Yr;O.prototype.visitUint64=Yr;O.prototype.visitFloat=Sc;O.prototype.visitFloat16=Sc;O.prototype.visitFloat32=Sc;O.prototype.visitFloat64=Sc;O.prototype.visitUtf8=Qn;O.prototype.visitLargeUtf8=Qn;O.prototype.visitBinary=Qn;O.prototype.visitLargeBinary=Qn;O.prototype.visitFixedSizeBinary=Fb;O.prototype.visitDate=Xu;O.prototype.visitDateDay=Xu;O.prototype.visitDateMillisecond=Xu;O.prototype.visitTimestamp=yo;O.prototype.visitTimestampSecond=yo;O.prototype.visitTimestampMillisecond=yo;O.prototype.visitTimestampMicrosecond=yo;O.prototype.visitTimestampNanosecond=yo;O.prototype.visitTime=_o;O.prototype.visitTimeSecond=_o;O.prototype.visitTimeMillisecond=_o;O.prototype.visitTimeMicrosecond=_o;O.prototype.visitTimeNanosecond=_o;O.prototype.visitDecimal=Qn;O.prototype.visitList=Nb;O.prototype.visitStruct=Mb;O.prototype.visitUnion=qu;O.prototype.visitDenseUnion=qu;O.prototype.visitSparseUnion=qu;O.prototype.visitDictionary=Rb;O.prototype.visitInterval=xc;O.prototype.visitIntervalDayTime=xc;O.prototype.visitIntervalYearMonth=xc;O.prototype.visitIntervalMonthDayNano=xc;O.prototype.visitDuration=go;O.prototype.visitDurationSecond=go;O.prototype.visitDurationMillisecond=go;O.prototype.visitDurationMicrosecond=go;O.prototype.visitDurationNanosecond=go;O.prototype.visitFixedSizeList=kb;O.prototype.visitMap=Cb;Tr=new O});function Xn(r){let t=r.type,e=new(Kp.getVisitFn(t)())(r);if(t.children&&t.children.length>0){let n=r.children||[],i={nullValues:r.nullValues},s=Array.isArray(n)?(o,a)=>n[a]||i:({name:o})=>n[o]||i;for(let[o,a]of t.children.entries()){let{type:l}=a,c=s(a,o);e.children.push(Xn(Object.assign(Object.assign({},c),{type:l})))}}return e}var Ku=d(()=>{Jp()});function Ac(r,t){return Ub(r,t.map(e=>e.data.concat()))}function Ub(r,t){let e=[...r.fields],n=[],i={numBatches:t.reduce((h,m)=>Math.max(h,m.length),0)},s=0,o=0,a=-1,l=t.length,c,u=[];for(;i.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,a=-1;++a<l;)u[a]=c=t[a].shift(),o=Math.min(o,c?c.length:o);Number.isFinite(o)&&(u=Pb(e,o,u,t,i),o>0&&(n[s++]=A({type:new ct(e),length:o,nullCount:0,children:u.slice()})))}return[r=r.assign(e),n.map(h=>new lt(r,h))]}function Pb(r,t,e,n,i){var s;let o=(t+63&-64)>>3;for(let a=-1,l=n.length;++a<l;){let c=e[a],u=c?.length;if(u>=t)u===t?e[a]=c:(e[a]=c.slice(0,t),i.numBatches=Math.max(i.numBatches,n[a].unshift(c.slice(t,u-t))));else{let h=r[a];r[a]=h.clone({nullable:!0}),e[a]=(s=c?._changeLengthAndBackfillNullBitmap(t))!==null&&s!==void 0?s:A({type:h.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)})}}return e}var Qp=d(()=>{Vr();_t();Gi()});var tm,St,Bc=d(()=>{Nt();Vr();Ae();Be();_t();Ic();Qp();Wa();Cn();Ie();Ga();Ya();Mi();Gi();St=class{constructor(...t){var e,n;if(t.length===0)return this.batches=[],this.schema=new $([]),this._offsets=[0],this;let i,s;t[0]instanceof $&&(i=t.shift()),t.at(-1)instanceof Uint32Array&&(s=t.pop());let o=l=>{if(l){if(l instanceof lt)return[l];if(l instanceof St)return l.batches;if(l instanceof Z){if(l.type instanceof ct)return[new lt(new $(l.type.children),l)]}else{if(Array.isArray(l))return l.flatMap(c=>o(c));if(typeof l[Symbol.iterator]=="function")return[...l].flatMap(c=>o(c));if(typeof l=="object"){let c=Object.keys(l),u=c.map(p=>new v([l[p]])),h=i??new $(c.map((p,y)=>new U(String(p),u[y].type,u[y].nullable))),[,m]=Ac(h,u);return m.length===0?[new lt(l)]:m}}}return[]},a=t.flatMap(l=>o(l));if(i=(n=i??((e=a[0])===null||e===void 0?void 0:e.schema))!==null&&n!==void 0?n:new $([]),!(i instanceof $))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let l of a){if(!(l instanceof lt))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!ti(i,l.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=i,this.batches=a,this._offsets=s??ja(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=za(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}at(t){return this.get(Un(t,this.numRows))}set(t,e){}indexOf(t,e){return-1}[Symbol.iterator](){return this.batches.length>0?Ci.visit(new v(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
14
+ ${this.toArray().join(`,
15
+ `)}
16
+ ]`}concat(...t){let e=this.schema,n=this.data.concat(t.flatMap(({data:i})=>i));return new St(e,n.map(i=>new lt(e,i)))}slice(t,e){let n=this.schema;[t,e]=Vs({length:this.numRows},t,e);let i=Ha(this.data,this._offsets,t,e);return new St(n,i.map(s=>new lt(n,s)))}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(n=>n.children[t]);if(e.length===0){let{type:n}=this.schema.fields[t],i=A({type:n,length:0,nullCount:0});e.push(i._changeLengthAndBackfillNullBitmap(this.numRows))}return new v(e)}return null}setChild(t,e){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(i=>i.name===t),e)}setChildAt(t,e){let n=this.schema,i=[...this.batches];if(t>-1&&t<this.numCols){e||(e=new v([A({type:new Yt,length:this.numRows})]));let s=n.fields.slice(),o=s[t].clone({type:e.type}),a=this.schema.fields.map((l,c)=>this.getChildAt(c));[s[t],a[t]]=[o,e],[n,i]=Ac(n,a)}return new St(n,i)}select(t){let e=this.schema.fields.reduce((n,i,s)=>n.set(i.name,s),new Map);return this.selectAt(t.map(n=>e.get(n)).filter(n=>n>-1))}selectAt(t){let e=this.schema.selectAt(t),n=this.batches.map(i=>i.selectAt(t));return new St(e,n)}assign(t){let e=this.schema.fields,[n,i]=t.schema.fields.reduce((a,l,c)=>{let[u,h]=a,m=e.findIndex(p=>p.name===l.name);return~m?h[m]=c:u.push(c),a},[[],[]]),s=this.schema.assign(t.schema),o=[...e.map((a,l)=>[l,i[l]]).map(([a,l])=>l===void 0?this.getChildAt(a):t.getChildAt(l)),...n.map(a=>t.getChildAt(a))].filter(Boolean);return new St(...Ac(s,o))}};tm=Symbol.toStringTag;St[tm]=(r=>(r.schema=null,r.batches=[],r._offsets=new Uint32Array([0]),r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,r.isValid=ki(Hs),r.get=ki(Bt.getVisitFn(f.Struct)),r.set=$a(Ht.getVisitFn(f.Struct)),r.indexOf=Za(Hn.getVisitFn(f.Struct)),"Table"))(St.prototype)});function em(r,t,e=t.reduce((n,i)=>Math.max(n,i.length),0)){var n;let i=[...r.fields],s=[...t],o=(e+63&-64)>>3;for(let[a,l]of r.fields.entries()){let c=t[a];(!c||c.length!==e)&&(i[a]=l.clone({nullable:!0}),s[a]=(n=c?._changeLengthAndBackfillNullBitmap(e))!==null&&n!==void 0?n:A({type:l.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)}))}return[r.assign(i),A({type:new ct(i),length:e,children:s})]}function nm(r,t,e=new Map){var n,i;if(((n=r?.length)!==null&&n!==void 0?n:0)>0&&r?.length===t?.length)for(let s=-1,o=r.length;++s<o;){let{type:a}=r[s],l=t[s];for(let c of[l,...((i=l?.dictionary)===null||i===void 0?void 0:i.data)||[]])nm(a.children,c?.children,e);if(_.isDictionary(a)){let{id:c}=a;if(!e.has(c))l?.dictionary&&e.set(c,l.dictionary);else if(e.get(c)!==l.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}}return e}var rm,lt,ei,Gi=d(()=>{Vr();Bc();Ae();Be();_t();Mi();Cn();Ie();Ga();Ya();lt=class{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof $))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=A({nullCount:0,type:new ct(this.schema.fields),children:this.schema.fields.map(e=>A({type:e.type,nullCount:0}))})]=t,!(this.data instanceof Z))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=em(this.schema,this.data.children);break}case 1:{let[e]=t,{fields:n,children:i,length:s}=Object.keys(e).reduce((l,c,u)=>(l.children[u]=e[c],l.length=Math.max(l.length,e[c].length),l.fields[u]=U.new({name:c,type:e[c].type,nullable:!0}),l),{length:0,fields:new Array,children:new Array}),o=new $(n),a=A({type:new ct(n),length:s,children:i,nullCount:0});[this.schema,this.data]=em(o,a.children,s);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=nm(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 Bt.visit(this.data,t)}at(t){return this.get(Un(t,this.numRows))}set(t,e){return Ht.visit(this.data,t,e)}indexOf(t,e){return Hn.visit(this.data,t,e)}[Symbol.iterator](){return Ci.visit(new v([this.data]))}toArray(){return[...this]}concat(...t){return new St(this.schema,[this,...t])}slice(t,e){let[n]=new v([this.data]).slice(t,e).data;return new lt(this.schema,n)}getChild(t){var e;return this.getChildAt((e=this.schema.fields)===null||e===void 0?void 0:e.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&t<this.schema.fields.length?new v([this.data.children[t]]):null}setChild(t,e){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(i=>i.name===t),e)}setChildAt(t,e){let n=this.schema,i=this.data;if(t>-1&&t<this.numCols){e||(e=new v([A({type:new Yt,length:this.numRows})]));let s=n.fields.slice(),o=i.children.slice(),a=s[t].clone({type:e.type});[s[t],o[t]]=[a,e.data[0]],n=new $(s,new Map(this.schema.metadata)),i=A({type:new ct(s),children:o})}return new lt(n,i)}select(t){let e=this.schema.select(t),n=new ct(e.fields),i=[];for(let s of t){let o=this.schema.fields.findIndex(a=>a.name===s);~o&&(i[o]=this.data.children[o])}return new lt(e,A({type:n,length:this.numRows,children:i}))}selectAt(t){let e=this.schema.selectAt(t),n=t.map(s=>this.data.children[s]).filter(Boolean),i=A({type:new ct(e.fields),length:this.numRows,children:n});return new lt(e,i)}};rm=Symbol.toStringTag;lt[rm]=(r=>(r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(lt.prototype);ei=class extends lt{constructor(t){let e=t.fields.map(i=>A({type:i.type})),n=A({type:new ct(t.fields),nullCount:0,children:e});super(t,n)}}});function Tc(r,t=0){for(let e=-1,n=Ki.length;++e<n;)if(Ki[e]!==r[t+e])return!1;return!0}var tf,ef,im,sm,Yi,bo,wo,Dc,Qu,Ki,Ji,rf,om,nf=d(()=>{ge();Nt();K();Wn();In();Pu();kt();Kn();Zs();tf=r=>`Expected ${W[r]} Message in stream, but was null or length 0.`,ef=r=>`Header pointer of flatbuffer-encoded ${W[r]} Message is null or length 0.`,im=(r,t)=>`Expected to read ${r} metadata bytes, but only read ${t}.`,sm=(r,t)=>`Expected to read ${r} bytes for message body, but only read ${t}.`,Yi=class{constructor(t){this.source=t instanceof Dr?t:new Dr(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done?dt:t.value===-1&&(t=this.readMetadataLength()).done?dt:(t=this.readMetadata(t.value)).done?dt: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(tf(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);let e=F(this.source.read(t));if(e.byteLength<t)throw new Error(sm(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()}readSchema(t=!1){let e=W.Schema,n=this.readMessage(e),i=n?.header();if(t&&!i)throw new Error(ef(e));return i}readMetadataLength(){let t=this.source.read(Dc),e=t&&new Ft(t),n=e?.readInt32(0)||0;return{done:n===0,value:n}}readMetadata(t){let e=this.source.read(t);if(!e)return dt;if(e.byteLength<t)throw new Error(im(t,e.byteLength));return{done:!1,value:Ot.decode(e)}}},bo=class{constructor(t,e){this.source=t instanceof he?t:oa(t)?new hn(t,e):new he(t)}[Symbol.asyncIterator](){return this}next(){return b(this,void 0,void 0,function*(){let t;return(t=yield this.readMetadataLength()).done?dt:t.value===-1&&(t=yield this.readMetadataLength()).done?dt:(t=yield this.readMetadata(t.value)).done?dt:t})}throw(t){return b(this,void 0,void 0,function*(){return yield this.source.throw(t)})}return(t){return b(this,void 0,void 0,function*(){return yield this.source.return(t)})}readMessage(t){return b(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(tf(t));return e.value})}readMessageBody(t){return b(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);let e=F(yield this.source.read(t));if(e.byteLength<t)throw new Error(sm(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()})}readSchema(){return b(this,arguments,void 0,function*(t=!1){let e=W.Schema,n=yield this.readMessage(e),i=n?.header();if(t&&!i)throw new Error(ef(e));return i})}readMetadataLength(){return b(this,void 0,void 0,function*(){let t=yield this.source.read(Dc),e=t&&new Ft(t),n=e?.readInt32(0)||0;return{done:n===0,value:n}})}readMetadata(t){return b(this,void 0,void 0,function*(){let e=yield this.source.read(t);if(!e)return dt;if(e.byteLength<t)throw new Error(im(t,e.byteLength));return{done:!1,value:Ot.decode(e)}})}},wo=class extends Yi{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof $s?t:new $s(t)}next(){let{_json:t}=this;if(!this._schema)return this._schema=!0,{done:!1,value:Ot.fromJSON(t.schema,W.Schema)};if(this._dictionaryIndex<t.dictionaries.length){let e=t.dictionaries[this._dictionaryIndex++];return this._body=e.data.columns,{done:!1,value:Ot.fromJSON(e,W.DictionaryBatch)}}if(this._batchIndex<t.batches.length){let e=t.batches[this._batchIndex++];return this._body=e.columns,{done:!1,value:Ot.fromJSON(e,W.RecordBatch)}}return this._body=[],dt}readMessageBody(t){return e(this._body);function e(n){return(n||[]).reduce((i,s)=>[...i,...s.VALIDITY&&[s.VALIDITY]||[],...s.TYPE_ID&&[s.TYPE_ID]||[],...s.OFFSET&&[s.OFFSET]||[],...s.DATA&&[s.DATA]||[],...e(s.children)],[])}}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(tf(t));return e.value}readSchema(){let t=W.Schema,e=this.readMessage(t),n=e?.header();if(!e||!n)throw new Error(ef(t));return n}},Dc=4,Qu="ARROW1",Ki=new Uint8Array(Qu.length);for(let r=0;r<Qu.length;r+=1)Ki[r]=Qu.codePointAt(r);Ji=Ki.length,rf=Ji+Dc,om=Ji*2+Dc});var sf,of,am,cm=d(()=>{Ns();sf=class{constructor(){this.LZ4_FRAME_MAGIC=new Uint8Array([4,34,77,24]),this.MIN_HEADER_LENGTH=7}isValidCodecEncode(t){let e=new Uint8Array([1,2,3,4,5,6,7,8]),n=t.encode(e);return this._isValidCompressed(n)}_isValidCompressed(t){return this._hasMinimumLength(t)&&this._hasValidMagicNumber(t)&&this._hasValidVersion(t)}_hasMinimumLength(t){return t.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(t){return this.LZ4_FRAME_MAGIC.every((e,n)=>t[n]===e)}_hasValidVersion(t){return(t[4]&192)>>6===1}},of=class{constructor(){this.ZSTD_MAGIC=new Uint8Array([40,181,47,253]),this.MIN_HEADER_LENGTH=6}isValidCodecEncode(t){let e=new Uint8Array([1,2,3,4,5,6,7,8]),n=t.encode(e);return this._isValidCompressed(n)}_isValidCompressed(t){return this._hasMinimumLength(t)&&this._hasValidMagicNumber(t)}_hasMinimumLength(t){return t.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(t){return this.ZSTD_MAGIC.every((e,n)=>t[n]===e)}},am={[qt.LZ4_FRAME]:new sf,[qt.ZSTD]:new of}});var af,Xi,cf=d(()=>{Ns();cm();af=class{constructor(){this.registry={}}set(t,e){if(e?.encode&&typeof e.encode=="function"&&!am[t].isValidCodecEncode(e))throw new Error(`Encoder for ${qt[t]} is not valid.`);this.registry[t]=e}get(t){var e;return((e=this.registry)===null||e===void 0?void 0:e[t])||null}},Xi=new af});function dm(r,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:r.autoDestroy}function*lm(r){let t=te.from(r);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function um(r){return _e(this,arguments,function*(){let e=yield P(te.from(r));try{if(!(yield P(e.open({autoDestroy:!1}))).closed)do yield yield P(e);while(!(yield P(e.reset().open())).closed)}finally{yield P(e.cancel())}})}function zb(r){return new Kr(new uf(r))}function jb(r){let t=r.peek(Ji+7&-8);return t&&t.byteLength>=4?Tc(t)?new ni(new Lc(r.read())):new Kr(new qi(r)):new Kr(new qi(function*(){}()))}function Hb(r){return b(this,void 0,void 0,function*(){let t=yield r.peek(Ji+7&-8);return t&&t.byteLength>=4?Tc(t)?new ni(new Lc(yield r.read())):new ri(new Qi(r)):new ri(new Qi(function(){return _e(this,arguments,function*(){})}()))})}function $b(r){return b(this,void 0,void 0,function*(){let{size:t}=yield r.stat(),e=new hn(r,t);return t>=om&&Tc(yield e.readAt(0,Ji+7&-8))?new Ec(new lf(e)):new ri(new Qi(e))})}var te,Kr,ri,ni,Ec,Oc,qi,Qi,Lc,lf,uf,ff=d(()=>{ge();Vr();Ae();_t();Nt();Ru();Os();Wn();Kn();Pu();Ep();Gi();Zs();nf();In();cf();Ur();K();te=class extends Yn{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 ze(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 zt.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return zt.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 te?t:ia(t)?zb(t):oa(t)?$b(t):ze(t)?(()=>b(this,void 0,void 0,function*(){return yield te.from(yield t)}))():aa(t)||Ts(t)||la(t)||Te(t)?Hb(new he(t)):jb(new Dr(t))}static readAll(t){return t instanceof te?t.isSync()?lm(t):um(t):ia(t)||ArrayBuffer.isView(t)||je(t)||sa(t)?lm(t):um(t)}},Kr=class extends te{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 P(yield*vi(Ve(this[Symbol.iterator]())))})}},ri=class extends te{constructor(t){super(t),this._impl=t}readAll(){return b(this,void 0,void 0,function*(){var t,e,n,i;let s=new Array;try{for(var o=!0,a=Ve(this),l;l=yield a.next(),t=l.done,!t;o=!0){i=l.value,o=!1;let c=i;s.push(c)}}catch(c){e={error:c}}finally{try{!o&&!t&&(n=a.return)&&(yield n.call(a))}finally{if(e)throw e.error}}return s})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},ni=class extends Kr{constructor(t){super(t),this._impl=t}},Ec=class extends ri{constructor(t){super(t),this._impl=t}},Oc=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,e){let n;if(t.compression!=null){let s=Xi.get(t.compression.type);if(s?.decode&&typeof s.decode=="function"){let{decommpressedBody:o,buffers:a}=this._decompressBuffers(t,e,s);n=this._loadCompressedVectors(t,o,this.schema.fields),t=new Et(t.length,t.nodes,a,null)}else throw new Error("Record batch is compressed but codec not found")}else n=this._loadVectors(t,e,this.schema.fields);let i=A({type:new ct(this.schema.fields),length:t.length,children:n});return new lt(this.schema,i)}_loadDictionaryBatch(t,e){let{id:n,isDelta:i}=t,{dictionaries:s,schema:o}=this,a=s.get(n),l=o.dictionaries.get(n),c;if(t.data.compression!=null){let u=Xi.get(t.data.compression.type);if(u?.decode&&typeof u.decode=="function"){let{decommpressedBody:h,buffers:m}=this._decompressBuffers(t.data,e,u);c=this._loadCompressedVectors(t.data,h,[l]),t=new Jt(new Et(t.data.length,t.data.nodes,m,null),n,i)}else throw new Error("Dictionary batch is compressed but codec not found")}else c=this._loadVectors(t.data,e,[l]);return(a&&i?a.concat(new v(c)):new v(c)).memoize()}_loadVectors(t,e,n){return new Hi(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}_loadCompressedVectors(t,e,n){return new ec(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}_decompressBuffers(t,e,n){let i=[],s=[],o=0;for(let{offset:a,length:l}of t.buffers){if(l===0){i.push(new Uint8Array(0)),s.push(new Tt(o,0));continue}let c=new Ft(e.subarray(a,a+l)),u=q(c.readInt64(0)),h=c.bytes().subarray(8),m=u===-1?h:n.decode(h);i.push(m);let p=(o+7&-8)-o;o+=p,s.push(new Tt(o,m.length)),o+=m.length}return{decommpressedBody:i,buffers:s}}},qi=class extends Oc{constructor(t,e){super(e),this._reader=ia(t)?new wo(this._handle=t):new Yi(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=dm(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):dt}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):dt}next(){if(this.closed)return dt;let t,{_reader:e}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;let n=t.header(),i=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let n=t.header(),i=e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new ei(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}},Qi=class extends Oc{constructor(t,e){super(e),this._reader=new bo(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return b(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 b(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=dm(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return b(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):dt})}return(t){return b(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):dt})}next(){return b(this,void 0,void 0,function*(){if(this.closed)return dt;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 n=t.header(),i=yield e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;let n=t.header(),i=yield e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new ei(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return b(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}},Lc=class extends qi{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,e){super(t instanceof Ws?t:new Ws(t),e)}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let e of this._footer.dictionaryBatches())e&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var e;if(this.closed)return null;this._footer||this.open();let n=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(n&&this._handle.seek(n.offset)){let i=this._reader.readMessage(W.RecordBatch);if(i?.isRecordBatch()){let s=i.header(),o=this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(s,o)}}return null}_readDictionaryBatch(t){var e;let n=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(n&&this._handle.seek(n.offset)){let i=this._reader.readMessage(W.DictionaryBatch);if(i?.isDictionaryBatch()){let s=i.header(),o=this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}}_readFooter(){let{_handle:t}=this,e=t.size-rf,n=t.readInt32(e),i=t.readAt(e-n,n);return Hr.decode(i)}_readNextMessageAndValidate(t){var e;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let n=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(this._recordBatchIndex);if(n&&this._handle.seek(n.offset))return this._reader.readMessage(t)}return null}},lf=class extends Qi{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,...e){let n=typeof e[0]!="number"?e.shift():void 0,i=e[0]instanceof Map?e.shift():void 0;super(t instanceof hn?t:new hn(t,n),i)}isFile(){return!0}isAsync(){return!0}open(t){let e=Object.create(null,{open:{get:()=>super.open}});return b(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let n of this._footer.dictionaryBatches())n&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield e.open.call(this,t)})}readRecordBatch(t){return b(this,void 0,void 0,function*(){var e;if(this.closed)return null;this._footer||(yield this.open());let n=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(n&&(yield this._handle.seek(n.offset))){let i=yield this._reader.readMessage(W.RecordBatch);if(i?.isRecordBatch()){let s=i.header(),o=yield this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(s,o)}}return null})}_readDictionaryBatch(t){return b(this,void 0,void 0,function*(){var e;let n=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(n&&(yield this._handle.seek(n.offset))){let i=yield this._reader.readMessage(W.DictionaryBatch);if(i?.isDictionaryBatch()){let s=i.header(),o=yield this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}})}_readFooter(){return b(this,void 0,void 0,function*(){let{_handle:t}=this;t._pending&&(yield t._pending);let e=t.size-rf,n=yield t.readInt32(e),i=yield t.readAt(e-n,n);return Hr.decode(i)})}_readNextMessageAndValidate(t){return b(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})}},uf=class extends qi{constructor(t,e){super(t,e)}_loadVectors(t,e,n){return new tc(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}}});function qe(r){let t=r.byteLength+7&-8;return this.buffers.push(r),this.bufferRegions.push(new Tt(this._byteLength,t)),this._byteLength+=t,this}function Zb(r){var t;let{type:e,length:n,typeIds:i,valueOffsets:s}=r;if(qe.call(this,i),e.mode===at.Sparse)return df.call(this,r);if(e.mode===at.Dense){if(r.offset<=0)return qe.call(this,s),df.call(this,r);{let o=new Int32Array(n),a=Object.create(null),l=Object.create(null);for(let c,u,h=-1;++h<n;)(c=i[h])!==void 0&&((u=a[c])===void 0&&(u=a[c]=s[h]),o[h]=s[h]-u,l[c]=((t=l[c])!==null&&t!==void 0?t:0)+1);qe.call(this,o),this.visitMany(r.children.map((c,u)=>{let h=e.typeIds[u],m=a[h],p=l[h];return c.slice(m,Math.min(n,p))}))}}return this}function Wb(r){let t;return r.nullCount>=r.length?qe.call(this,new Uint8Array(0)):(t=r.values)instanceof Uint8Array?qe.call(this,Vn(r.offset,r.length,t)):qe.call(this,zn(r.values))}function Jr(r){return qe.call(this,r.values.subarray(0,r.length*r.stride))}function Fc(r){let{length:t,values:e,valueOffsets:n}=r,i=q(n[0]),s=q(n[t]),o=Math.min(s-i,e.byteLength-i);return qe.call(this,fa(-i,t+1,n)),qe.call(this,e.subarray(i,i+o)),this}function hf(r){let{length:t,valueOffsets:e}=r;if(e){let{[0]:n,[t]:i}=e;return qe.call(this,fa(-n,t+1,e)),this.visit(r.children[0].slice(n,i-n))}return this.visit(r.children[0])}function df(r){return this.visitMany(r.type.children.map((t,e)=>r.children[e]).filter(Boolean))[0]}var pt,hm=d(()=>{Ae();Ye();Nt();Gi();kt();Ri();Wn();_t();Ur();pt=class extends B{static assemble(...t){let e=i=>i.flatMap(s=>Array.isArray(s)?e(s):s instanceof lt?s.data.children:s.data),n=new pt;return n.visitMany(e(t)),n}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof v)return this.visitMany(t.data),this;let{type:e}=t;if(!_.isDictionary(e)){let{length:n}=t;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(_.isUnion(e))this.nodes.push(new Me(n,0));else{let{nullCount:i}=t;_.isNull(e)||qe.call(this,i<=0?new Uint8Array(0):Vn(t.offset,n,t.nullBitmap)),this.nodes.push(new Me(n,i))}}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}};pt.prototype.visitBool=Wb;pt.prototype.visitInt=Jr;pt.prototype.visitFloat=Jr;pt.prototype.visitUtf8=Fc;pt.prototype.visitLargeUtf8=Fc;pt.prototype.visitBinary=Fc;pt.prototype.visitLargeBinary=Fc;pt.prototype.visitFixedSizeBinary=Jr;pt.prototype.visitDate=Jr;pt.prototype.visitTimestamp=Jr;pt.prototype.visitTime=Jr;pt.prototype.visitDecimal=Jr;pt.prototype.visitList=hf;pt.prototype.visitStruct=df;pt.prototype.visitUnion=Zb;pt.prototype.visitInterval=Jr;pt.prototype.visitDuration=Jr;pt.prototype.visitFixedSizeList=hf;pt.prototype.visitMap=hf});function pf(r,t){let e=t;t instanceof St&&(e=t.batches,r.reset(void 0,t.schema));for(let n of e)r.write(n);return r.finish()}function mf(r,t){return b(this,void 0,void 0,function*(){var e,n,i,s,o,a,l;try{for(e=!0,n=Ve(t);i=yield n.next(),s=i.done,!s;e=!0){l=i.value,e=!1;let c=l;r.write(c)}}catch(c){o={error:c}}finally{try{!e&&!s&&(a=n.return)&&(yield a.call(n))}finally{if(o)throw o.error}}return r.finish()})}var ii,si,oi,pm=d(()=>{ge();Bc();nf();Ae();Wn();Wn();Ru();Nt();Ic();Kn();hm();kt();Gi();Zs();In();Ns();cf();K();ii=class extends Yn{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}constructor(t){if(super(),this._position=0,this._started=!1,this._compression=null,this._sink=new Br,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,Xt(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1,compressionType:null}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1,t.compressionType!=null){if(this._writeLegacyIpcFormat)throw new Error("Legacy IPC format does not support columnar compression. Use modern IPC format (writeLegacyIpcFormat=false).");if(Object.values(qt).includes(t.compressionType))this._compression=new Gn(t.compressionType);else{let e=Object.values(qt).filter(n=>typeof n=="string");throw new Error(`Unsupported compressionType: ${t.compressionType} Available types: ${e.join(", ")}`)}}else this._compression=null}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return ze(t)?t.then(e=>this.writeAll(e)):Te(t)?mf(this,t):pf(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 Br?this._sink=t:(this._sink=new Br,t&&Cd(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&Ud(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!e||!ti(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 St&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof lt&&!(e=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(e&&!ti(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof lt?t instanceof ei||this._writeRecordBatch(t):t instanceof St?this.writeAll(t.batches):je(t)&&this.writeAll(t)}_writeMessage(t,e=8){let n=e-1,i=Ot.encode(t),s=i.byteLength,o=this._writeLegacyIpcFormat?4:8,a=s+o+n&~n,l=a-s-o;return t.headerType===W.RecordBatch?this._recordBatchBlocks.push(new Xe(a,t.bodyLength,this._position)):t.headerType===W.DictionaryBatch&&this._dictionaryBlocks.push(new Xe(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),s>0&&this._write(i),this._writePadding(l)}_write(t){if(this._started){let e=F(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(Ot.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Ki)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){let{byteLength:e,nodes:n,bufferRegions:i,buffers:s}=this._assembleRecordBatch(t),o=new Et(t.numRows,n,i,this._compression),a=Ot.from(o,e);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(s)}_assembleRecordBatch(t){let{byteLength:e,nodes:n,bufferRegions:i,buffers:s}=pt.assemble(t);return this._compression!=null&&({byteLength:e,bufferRegions:i,buffers:s}=this._compressBodyBuffers(s)),{byteLength:e,nodes:n,bufferRegions:i,buffers:s}}_compressBodyBuffers(t){let e=Xi.get(this._compression.type);if(!e?.encode||typeof e.encode!="function")throw new Error(`Codec for compression type "${qt[this._compression.type]}" has invalid encode method`);let n=0,i=[],s=[];for(let a of t){let l=F(a);if(l.length===0){i.push(new Uint8Array(0),new Uint8Array(0)),s.push(new Tt(n,0));continue}let c=e.encode(l),u=c.length<l.length,h=u?c:l,m=u?h.length:-1,p=new Ft(new Uint8Array(8));p.writeInt64(0,BigInt(m)),i.push(p.bytes(),new Uint8Array(h));let y=(n+7&-8)-n;n+=y;let g=8+h.length;s.push(new Tt(n,g)),n+=g}let o=(n+7&-8)-n;return n+=o,{byteLength:n,bufferRegions:s,buffers:i}}_writeDictionaryBatch(t,e,n=!1){let{byteLength:i,nodes:s,bufferRegions:o,buffers:a}=this._assembleRecordBatch(new v([t])),l=new Et(t.length,s,o,this._compression),c=new Jt(l,e,n),u=Ot.from(c,i);return this._writeMessage(u)._writeBodyBuffers(a)}_writeBodyBuffers(t){let e=this._compression!=null?2:1,n=new Array(e);for(let i=0;i<t.length;i+=e){let s=0;for(let a=-1;++a<e;)n[a]=t[i+a],s+=n[a].byteLength;if(s===0)continue;for(let a of n)this._write(a);let o=(s+7&-8)-s;o>0&&this._writePadding(o)}return this}_writeDictionaries(t){var e,n;for(let[i,s]of t.dictionaries){let o=(e=s?.data)!==null&&e!==void 0?e:[],a=this._seenDictionaries.get(i),l=(n=this._dictionaryDeltaOffsets.get(i))!==null&&n!==void 0?n:0;if(!a||a.data[0]!==o[0])for(let[c,u]of o.entries())this._writeDictionaryBatch(u,i,c>0);else if(l<o.length)for(let c of o.slice(l))this._writeDictionaryBatch(c,i,!0);this._seenDictionaries.set(i,s),this._dictionaryDeltaOffsets.set(i,o.length)}return this}},si=class extends ii{static writeAll(t,e){let n=new si(e);return ze(t)?t.then(i=>n.writeAll(i)):Te(t)?mf(n,t):pf(n,t)}},oi=class extends ii{static writeAll(t,e){let n=new oi(e);return ze(t)?t.then(i=>n.writeAll(i)):Te(t)?mf(n,t):pf(n,t)}constructor(t){super(t),this._autoDestroy=!0,this._writeLegacyIpcFormat=!1}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(t,e,n=!1){if(!n&&this._seenDictionaries.has(e))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(t,e,n)}_writeFooter(t){let e=Hr.encode(new Hr(t,it.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}}});function mm(r,t){if(Te(r))return Yb(r,t);if(je(r))return Gb(r,t);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function Gb(r,t){let e=null,n=t?.type==="bytes"||!1,i=t?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(o){s(o,e||(e=r[Symbol.iterator]()))},pull(o){e?s(o,e):o.close()},cancel(){e?.return&&e.return(),e=null}}),Object.assign({highWaterMark:n?i:void 0},t));function s(o,a){let l,c=null,u=o.desiredSize||null;for(;!(c=a.next(n?u:null)).done;)if(ArrayBuffer.isView(c.value)&&(l=F(c.value))&&(u!=null&&n&&(u=u-l.byteLength+1),c.value=l),o.enqueue(c.value),u!=null&&--u<=0)return;o.close()}}function Yb(r,t){let e=null,n=t?.type==="bytes"||!1,i=t?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},t),{start(o){return b(this,void 0,void 0,function*(){yield s(o,e||(e=r[Symbol.asyncIterator]()))})},pull(o){return b(this,void 0,void 0,function*(){e?yield s(o,e):o.close()})},cancel(){return b(this,void 0,void 0,function*(){e?.return&&(yield e.return()),e=null})}}),Object.assign({highWaterMark:n?i:void 0},t));function s(o,a){return b(this,void 0,void 0,function*(){let l,c=null,u=o.desiredSize||null;for(;!(c=yield a.next(n?u:null)).done;)if(ArrayBuffer.isView(c.value)&&(l=F(c.value))&&(u!=null&&n&&(u=u-l.byteLength+1),c.value=l),o.enqueue(c.value),u!=null&&--u<=0)return;o.close()})}}var ym=d(()=>{ge();kt();In()});function bm(r){return new yf(r)}var yf,_m,gm,wm=d(()=>{ge();Ku();yf=class{constructor(t){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:e,["writableStrategy"]:n,["queueingStrategy"]:i="count"}=t,s=Md(t,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=Xn(s),this._getSize=i!=="bytes"?_m:gm;let{["highWaterMark"]:o=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},e),{["highWaterMark"]:a=i==="bytes"?Math.pow(2,14):1e3}=Object.assign({},n);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:l=>{this._maybeFlush(this._builder,this._controller=l)},start:l=>{this._maybeFlush(this._builder,this._controller=l)}},{highWaterMark:o,size:i!=="bytes"?_m:gm}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:a,size:l=>this._writeValueAndReturnChunkSize(l)})}_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)}},_m=r=>{var t;return(t=r?.length)!==null&&t!==void 0?t:0},gm=r=>{var t;return(t=r?.byteLength)!==null&&t!==void 0?t:0}});function Nc(r,t){let e=new Br,n=null,i=new ReadableStream({cancel(){return b(this,void 0,void 0,function*(){yield e.close()})},start(a){return b(this,void 0,void 0,function*(){yield o(a,n||(n=yield s()))})},pull(a){return b(this,void 0,void 0,function*(){n?yield o(a,n):a.close()})}});return{writable:new WritableStream(e,Object.assign({highWaterMark:Math.pow(2,14)},r)),readable:i};function s(){return b(this,void 0,void 0,function*(){return yield(yield te.from(e)).open(t)})}function o(a,l){return b(this,void 0,void 0,function*(){let c=a.desiredSize,u=null;for(;!(u=yield l.next()).done;)if(a.enqueue(u.value),c!=null&&--c<=0)return;a.close()})}}var vm=d(()=>{ge();Kn();ff()});function Mc(r,t){let e=new this(r),n=new he(e),i=new ReadableStream({cancel(){return b(this,void 0,void 0,function*(){yield n.cancel()})},pull(o){return b(this,void 0,void 0,function*(){yield s(o)})},start(o){return b(this,void 0,void 0,function*(){yield s(o)})}},Object.assign({highWaterMark:Math.pow(2,14)},t));return{writable:new WritableStream(e,r),readable:i};function s(o){return b(this,void 0,void 0,function*(){let a=null,l=o.desiredSize;for(;a=yield n.read(l||null);)if(o.enqueue(a),l!=null&&(l-=a.byteLength)<=0)return;o.close()})}}var Sm=d(()=>{ge();Kn()});var yw,xm=d(()=>{Vr();_t();Bc();Ae();Be();fu();ju();Ri();Ps();kt();Mi();Rs();Wu();Ic();yw=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},uu),zu),Tu),du),Tl),Du),ou),Zu),{compareSchemas:ti,compareFields:Xp,compareTypes:qp})});var Im=d(()=>{Os();gt();ff();pm();ym();wm();vm();Sm();xm();zt.toDOMStream=mm;ht.throughDOM=bm;te.throughDOM=Nc;ni.throughDOM=Nc;Kr.throughDOM=Nc;ii.throughDOM=Mc;oi.throughDOM=Mc;si.throughDOM=Mc});function Rc(r){return(r/255-.5)/_f}function kc(r){return Math.min(Math.max(r/255,0),1)}function Xr(r,t,e,n){let i=Math.hypot(r,t,e,n);return!Number.isFinite(i)||i<=Number.EPSILON?[1,0,0,0]:[r/i,t/i,e/i,n/i]}function vo(r){return(r-128)/128}function So(r){let t=r&32768?-1:1,e=r>>10&31,n=r&1023;return e===0?t*Math.pow(2,-14)*(n/1024):e===31?n?Number.NaN:t*Number.POSITIVE_INFINITY:t*Math.pow(2,e-15)*(1+n/1024)}var _f,ts=d(()=>{"use strict";_f=.28209479177387814});function Er(r){let t={},e=[],n=[];Bm(t,e,n,"POSITION",bw(r.positions,3),{type:"fixed-size-list",listSize:3,children:[{name:"value",type:"float32"}]});let i=ww(r);es(t,e,n,"f_dc_0",i[0],{"loaders_gl.gaussian_splats.semantic":"spherical_harmonic_dc","loaders_gl.gaussian_splats.component":"0","loaders_gl.gaussian_splats.encoding":"coefficient"}),es(t,e,n,"f_dc_1",i[1],{"loaders_gl.gaussian_splats.semantic":"spherical_harmonic_dc","loaders_gl.gaussian_splats.component":"1","loaders_gl.gaussian_splats.encoding":"coefficient"}),es(t,e,n,"f_dc_2",i[2],{"loaders_gl.gaussian_splats.semantic":"spherical_harmonic_dc","loaders_gl.gaussian_splats.component":"2","loaders_gl.gaussian_splats.encoding":"coefficient"}),es(t,e,n,"opacity",r.opacities,{"loaders_gl.gaussian_splats.semantic":"opacity","loaders_gl.gaussian_splats.encoding":"linear"}),Am(t,e,n,"scale",r.scales,3,{"loaders_gl.gaussian_splats.semantic":"scale","loaders_gl.gaussian_splats.encoding":"linear"}),Am(t,e,n,"rot",r.rotations,4,{"loaders_gl.gaussian_splats.semantic":"rotation","loaders_gl.gaussian_splats.encoding":"quaternion"}),r.sphericalHarmonics&&r.sphericalHarmonicsComponentCount&&gw(t,e,n,r.sphericalHarmonics,r.sphericalHarmonicsComponentCount);let s=new Map([["loaders_gl.semantic_type","gaussian-splats"],["loaders_gl.gaussian_splats.version","1"],["loaders_gl.gaussian_splats.source_format",r.format],["topology","point-list"],["mode","0"]]),o=new $(e,s);return{shape:"arrow-table",schema:{fields:n,metadata:Object.fromEntries(s)},data:new St(o,t),topology:"point-list",loaderData:r.loaderData}}function Am(r,t,e,n,i,s,o){for(let a=0;a<s;a++){let l=new Float32Array(i.length/s);for(let c=0;c<l.length;c++)l[c]=i[c*s+a];es(r,t,e,`${n}_${a}`,l,{...o,"loaders_gl.gaussian_splats.component":String(a)})}}function gw(r,t,e,n,i){for(let s=0;s<i;s++){let o=new Float32Array(n.length/i);for(let a=0;a<o.length;a++)o[a]=n[a*i+s];es(r,t,e,`f_rest_${s}`,o,{"loaders_gl.gaussian_splats.semantic":"spherical_harmonic_rest","loaders_gl.gaussian_splats.component":String(s),"loaders_gl.gaussian_splats.encoding":"coefficient"})}}function es(r,t,e,n,i,s){Bm(r,t,e,n,$n(i),"float32",s)}function Bm(r,t,e,n,i,s,o={}){r[n]=i,t.push(new U(n,i.type,!1,new Map(Object.entries(o)))),e.push({name:n,type:s,nullable:!1,metadata:o})}function bw(r,t){let n=$n(r).data[0],i=new ue(t,new U("value",n.type,!1)),s=new Z(i,0,r.length/t,0,{},[n]);return new v([s])}function ww(r){let t=r.splatCount,e=new Float32Array(t),n=new Float32Array(t),i=new Float32Array(t);for(let s=0;s<t;s++)r.sphericalHarmonicDcs?(e[s]=r.sphericalHarmonicDcs[s*3+0],n[s]=r.sphericalHarmonicDcs[s*3+1],i[s]=r.sphericalHarmonicDcs[s*3+2]):(e[s]=Rc(r.colors[s*3+0]),n[s]=Rc(r.colors[s*3+1]),i[s]=Rc(r.colors[s*3+2]));return[e,n,i]}var rs=d(()=>{"use strict";Im();ts()});function gf(r){return Er(vw(r))}function vw(r){if(r.byteLength%xo!==0)throw new Error(`SPLATLoader: byte length must be a multiple of ${xo}.`);let t=r.byteLength/xo,e=new DataView(r),n=new Float32Array(t*3),i=new Float32Array(t*3),s=new Float32Array(t*4),o=new Uint8Array(t*3),a=new Float32Array(t);for(let l=0;l<t;l++){let c=l*xo,u=l*3,h=l*4;n[u+0]=e.getFloat32(c+0,!0),n[u+1]=e.getFloat32(c+4,!0),n[u+2]=e.getFloat32(c+8,!0),i[u+0]=e.getFloat32(c+12,!0),i[u+1]=e.getFloat32(c+16,!0),i[u+2]=e.getFloat32(c+20,!0),o[u+0]=e.getUint8(c+24),o[u+1]=e.getUint8(c+25),o[u+2]=e.getUint8(c+26),a[l]=kc(e.getUint8(c+27));let[m,p,y,g]=Xr(vo(e.getUint8(c+28)),vo(e.getUint8(c+29)),vo(e.getUint8(c+30)),vo(e.getUint8(c+31)));s[h+0]=m,s[h+1]=p,s[h+2]=y,s[h+3]=g}return{format:"splat",splatCount:t,positions:n,scales:i,rotations:s,colors:o,opacities:a,loaderData:{format:"splat",splatCount:t,rowByteLength:xo}}}var xo,Dm=d(()=>{"use strict";rs();ts();xo=32});var Tm={};ye(Tm,{SPLATLoaderWithParser:()=>xw});var qL,Sw,xw,Em=d(()=>{"use strict";Dm();bf();({preload:qL,...Sw}=Cc),xw={...Sw,parse:async r=>gf(r),parseSync:r=>gf(r)}});async function Aw(){let{SPLATLoaderWithParser:r}=await Promise.resolve().then(()=>(Em(),Tm));return r}var Iw,Cc,bf=d(()=>{"use strict";xn();Iw="5.0.0-alpha.1";Cc={dataType:null,batchType:null,...ea,version:Iw,options:{splats:{shape:"arrow-table"}},preload:Aw}});function Sf(r){return Er(Tw(r))}function Tw(r){if(r.byteLength<ns)throw new Error(`KSPLATLoader: file must contain a ${ns}-byte header.`);let t=Ow(r);Lw(t);let e=Fw(r,t),n=Uw(t,e),i=Math.max(0,...e.slice(0,Pc(t)).map(m=>xf(m.sphericalHarmonicsDegree))),s=new Float32Array(n*3),o=new Float32Array(n*3),a=new Float32Array(n*4),l=new Uint8Array(n*3),c=new Float32Array(n),u=i?new Float32Array(n*i):void 0,h=0;for(let m of e.slice(0,Pc(t))){Pw(r,m);for(let p=0;p<m.splatCount&&h<n;p++)Ew(r,t,m,p,h,s,o,a,l,c,u,i),h++}return{format:"ksplat",splatCount:n,positions:s,scales:o,rotations:a,colors:l,opacities:c,sphericalHarmonics:u,sphericalHarmonicsComponentCount:i,loaderData:{format:"ksplat",...t,sections:e.slice(0,Pc(t)).map(m=>({splatCount:m.splatCount,maxSplatCount:m.maxSplatCount,sphericalHarmonicsDegree:m.sphericalHarmonicsDegree}))}}}function Ew(r,t,e,n,i,s,o,a,l,c,u,h){let m=vf[t.compressionLevel],p=e.dataBase+e.bytesPerSplat*n,y=i*3,g=i*4,N=Mw(r,e,n);s[y+0]=wf(r,p,0,t,e,N[0]),s[y+1]=wf(r,p,1,t,e,N[1]),s[y+2]=wf(r,p,2,t,e,N[2]),o[y+0]=mn(r,p+m.scaleOffsetBytes,0,t.compressionLevel),o[y+1]=mn(r,p+m.scaleOffsetBytes,1,t.compressionLevel),o[y+2]=mn(r,p+m.scaleOffsetBytes,2,t.compressionLevel);let[S,G,tt,V]=Xr(mn(r,p+m.scaleOffsetBytes,3,t.compressionLevel),mn(r,p+m.scaleOffsetBytes,4,t.compressionLevel),mn(r,p+m.scaleOffsetBytes,5,t.compressionLevel),mn(r,p+m.scaleOffsetBytes,6,t.compressionLevel));a[g+0]=S,a[g+1]=G,a[g+2]=tt,a[g+3]=V;let w=p+m.colorOffsetBytes,Y=new Uint8Array(r,w,4);l[y+0]=Y[0],l[y+1]=Y[1],l[y+2]=Y[2],c[i]=kc(Y[3]),u&&h&&kw(r,p+m.sphericalHarmonicsOffsetBytes,t,e,i,u,h)}function Ow(r){let t=new DataView(r,0,ns),e=t.getUint16(20,!0);if(e!==0&&e!==1&&e!==2)throw new Error(`KSPLATLoader: unsupported compression level ${e}.`);return{versionMajor:t.getUint8(0),versionMinor:t.getUint8(1),maxSectionCount:t.getUint32(4,!0),sectionCount:t.getUint32(8,!0),maxSplatCount:t.getUint32(12,!0),splatCount:t.getUint32(16,!0),compressionLevel:e,minSphericalHarmonicsCoeff:t.getFloat32(36,!0)||-Lm,maxSphericalHarmonicsCoeff:t.getFloat32(40,!0)||Lm}}function Lw(r){if(!(r.versionMajor===Om?r.versionMinor>=Bw:r.versionMajor>Om))throw new Error(`KSPLATLoader: version ${r.versionMajor}.${r.versionMinor} is not supported.`)}function Fw(r,t){if(r.byteLength<ns+t.maxSectionCount*Uc)throw new Error("KSPLATLoader: file does not contain all section headers.");let e=[],n=ns+t.maxSectionCount*Uc,i=0;for(let s=0;s<t.maxSectionCount;s++){let o=ns+s*Uc,a=new DataView(r,o,Uc),l=a.getUint32(0,!0),c=a.getUint32(4,!0),u=a.getUint32(8,!0),h=a.getUint32(12,!0),m=a.getFloat32(16,!0),p=a.getUint16(20,!0),y=a.getUint32(24,!0)||vf[t.compressionLevel].scaleRange,g=a.getUint32(32,!0),N=a.getUint32(36,!0),S=a.getUint16(40,!0),G=Cw(t.compressionLevel,S),tt=N*4,V=p*h+tt,w=G*c+V;e.push({bytesPerSplat:G,splatCountOffset:i,splatCount:l||c,maxSplatCount:c,bucketSize:u,bucketCount:h,bucketStorageSizeBytes:p,bucketsStorageSizeBytes:V,compressionScaleRange:y,compressionScaleFactor:m/2/y,base:n,bucketsBase:n+tt,dataBase:n+V,fullBucketCount:g,partiallyFilledBucketCount:N,sphericalHarmonicsDegree:S}),n+=w,i+=c}return e}function wf(r,t,e,n,i,s){let o=Nw(r,t,e,n.compressionLevel);return n.compressionLevel>=1?(o-i.compressionScaleRange)*i.compressionScaleFactor+s:o}function Nw(r,t,e,n){let i=new DataView(r);return n===0?i.getFloat32(t+e*4,!0):i.getUint16(t+e*2,!0)}function Mw(r,t,e){if(!t.bucketCount)return[0,0,0];let n=Rw(r,t,e),i=t.bucketsBase+n*t.bucketStorageSizeBytes,s=new DataView(r,i,12);return[s.getFloat32(0,!0),s.getFloat32(4,!0),s.getFloat32(8,!0)]}function Rw(r,t,e){let n=t.fullBucketCount*t.bucketSize;if(e<n)return Math.floor(e/t.bucketSize);let i=n,s=t.fullBucketCount;for(let o=0;o<t.partiallyFilledBucketCount;o++){let a=new DataView(r,t.base+o*4,4).getUint32(0,!0);if(e<i+a)return s;i+=a,s++}return Math.max(s-1,0)}function kw(r,t,e,n,i,s,o){let a=xf(n.sphericalHarmonicsDegree),l=i*o;for(let c=0;c<a;c++)s[l+c]=mn(r,t,c,e.compressionLevel,!0,e.minSphericalHarmonicsCoeff,e.maxSphericalHarmonicsCoeff)}function mn(r,t,e,n,i=!1,s=0,o=0){let a=new DataView(r);return n===0?a.getFloat32(t+e*4,!0):n===1||!i?So(a.getUint16(t+e*2,!0)):a.getUint8(t+e)/255*(o-s)+s}function Cw(r,t){let e=vf[r];return e.bytesPerCenter+e.bytesPerScale+e.bytesPerRotation+e.bytesPerColor+e.bytesPerSphericalHarmonicsComponent*xf(t)}function xf(r){switch(r){case 0:return 0;case 1:return 9;case 2:return 24;case 3:return 45;default:throw new Error(`KSPLATLoader: unsupported spherical harmonics degree ${r}.`)}}function Pc(r){return r.sectionCount||r.maxSectionCount}function Uw(r,t){let e=t.slice(0,Pc(r)).reduce((n,i)=>n+i.splatCount,0);return r.splatCount?Math.min(r.splatCount,e||r.splatCount):e}function Pw(r,t){if(t.dataBase+t.bytesPerSplat*t.splatCount>r.byteLength)throw new Error("KSPLATLoader: section data extends beyond the file length.")}var Om,Bw,ns,Uc,Dw,Lm,vf,Fm=d(()=>{"use strict";rs();ts();Om=0,Bw=1,ns=4096,Uc=1024,Dw=3,Lm=Dw/2,vf={0:{bytesPerCenter:12,bytesPerScale:12,bytesPerRotation:16,bytesPerColor:4,scaleOffsetBytes:12,colorOffsetBytes:40,sphericalHarmonicsOffsetBytes:44,scaleRange:1,bytesPerSphericalHarmonicsComponent:4},1:{bytesPerCenter:6,bytesPerScale:6,bytesPerRotation:8,bytesPerColor:4,scaleOffsetBytes:6,colorOffsetBytes:20,sphericalHarmonicsOffsetBytes:24,scaleRange:32767,bytesPerSphericalHarmonicsComponent:2},2:{bytesPerCenter:6,bytesPerScale:6,bytesPerRotation:8,bytesPerColor:4,scaleOffsetBytes:6,colorOffsetBytes:20,sphericalHarmonicsOffsetBytes:24,scaleRange:32767,bytesPerSphericalHarmonicsComponent:1}}});var Nm={};ye(Nm,{KSPLATLoaderWithParser:()=>zw});var oF,Vw,zw,Mm=d(()=>{"use strict";Fm();If();({preload:oF,...Vw}=Vc),zw={...Vw,parse:async r=>Sf(r),parseSync:r=>Sf(r)}});async function Hw(){let{KSPLATLoaderWithParser:r}=await Promise.resolve().then(()=>(Mm(),Nm));return r}var jw,Vc,If=d(()=>{"use strict";xn();jw="5.0.0-alpha.1";Vc={dataType:null,batchType:null,...ra,version:jw,options:{splats:{shape:"arrow-table"}},preload:Hw}});var Or,$w,Zw,Ww,Gw,is,Rm,Yw,km=d(()=>{"use strict";Or={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},$w=Or.self||Or.window||Or.global||{},Zw=Or.window||Or.self||Or.global||{},Ww=Or.global||Or.self||Or.window||{},Gw=Or.document||{},is=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser),Rm=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Yw=Rm&&parseFloat(Rm[1])||0});var zc,Kw,jc,Jw,uF,Cm=d(()=>{zc=globalThis,Kw=globalThis.document||{},jc=globalThis.process||{},Jw=globalThis.console,uF=globalThis.navigator||{}});function Um(r){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&Boolean(process.versions?.electron))return!0;let t=typeof navigator<"u"&&navigator.userAgent,e=r||t;return Boolean(e&&e.indexOf("Electron")>=0)}var Pm=d(()=>{});function ai(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||Um()}var Vm=d(()=>{Pm()});var Af,Hc=d(()=>{Cm();Vm();Af="4.1.1"});function ss(r,t){if(!r)throw new Error(t||"Assertion failed")}var Bf=d(()=>{});function Df(r){if(!r)return 0;let t;switch(typeof r){case"number":t=r;break;case"object":t=r.logLevel||r.priority||0;break;default:return 0}return ss(Number.isFinite(t)&&t>=0),t}function zm(r){let{logLevel:t,message:e}=r;r.logLevel=Df(t);let n=r.args?Array.from(r.args):[];for(;n.length&&n.shift()!==e;);switch(typeof t){case"string":case"function":e!==void 0&&n.unshift(e),r.message=t;break;case"object":Object.assign(r,t);break;default:}typeof r.message=="function"&&(r.message=r.message());let i=typeof r.message;return ss(i==="string"||i==="object"),Object.assign(r,{args:n},r.opts)}var jm=d(()=>{Bf()});var ci,$c,Hm=d(()=>{jm();ci=()=>{},$c=class{constructor({level:t=0}={}){this.userData={},this._onceCache=new Set,this._level=t}set level(t){this.setLevel(t)}get level(){return this.getLevel()}setLevel(t){return this._level=t,this}getLevel(){return this._level}warn(t,...e){return this._log("warn",0,t,e,{once:!0})}error(t,...e){return this._log("error",0,t,e)}log(t,e,...n){return this._log("log",t,e,n)}info(t,e,...n){return this._log("info",t,e,n)}once(t,e,...n){return this._log("once",t,e,n,{once:!0})}_log(t,e,n,i,s={}){let o=zm({logLevel:e,message:n,args:this._buildArgs(e,n,i),opts:s});return this._createLogFunction(t,o,s)}_buildArgs(t,e,n){return[t,e,...n]}_createLogFunction(t,e,n){if(!this._shouldLog(e.logLevel))return ci;let i=this._getOnceTag(n.tag??e.tag??e.message);if((n.once||e.once)&&i!==void 0){if(this._onceCache.has(i))return ci;this._onceCache.add(i)}return this._emit(t,e)}_shouldLog(t){return this.getLevel()>=Df(t)}_getOnceTag(t){if(t!==void 0)try{return typeof t=="string"?t:String(t)}catch{return}}}});function qw(r){try{let t=window[r],e="__storage_test__";return t.setItem(e,e),t.removeItem(e),t}catch{return null}}var Zc,$m=d(()=>{Zc=class{constructor(t,e,n="sessionStorage"){this.storage=qw(n),this.id=t,this.config=e,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}}_loadConfiguration(){let t={};if(this.storage){let e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}});function Zm(r){let t;return r<10?t=`${r.toFixed(2)}ms`:r<100?t=`${r.toFixed(1)}ms`:r<1e3?t=`${r.toFixed(0)}ms`:t=`${(r/1e3).toFixed(2)}s`,t}function Wm(r,t=8){let e=Math.max(t-r.length,0);return`${" ".repeat(e)}${r}`}var Gm=d(()=>{});function Ym(r){return typeof r!="string"?r:(r=r.toUpperCase(),Wc[r]||Wc.WHITE)}function Km(r,t,e){return!ai&&typeof r=="string"&&(t&&(r=`\x1B[${Ym(t)}m${r}\x1B[39m`),e&&(r=`\x1B[${Ym(e)+Qw}m${r}\x1B[49m`)),r}var Wc,Qw,Jm=d(()=>{Hc();(function(r){r[r.BLACK=30]="BLACK",r[r.RED=31]="RED",r[r.GREEN=32]="GREEN",r[r.YELLOW=33]="YELLOW",r[r.BLUE=34]="BLUE",r[r.MAGENTA=35]="MAGENTA",r[r.CYAN=36]="CYAN",r[r.WHITE=37]="WHITE",r[r.BRIGHT_BLACK=90]="BRIGHT_BLACK",r[r.BRIGHT_RED=91]="BRIGHT_RED",r[r.BRIGHT_GREEN=92]="BRIGHT_GREEN",r[r.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",r[r.BRIGHT_BLUE=94]="BRIGHT_BLUE",r[r.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",r[r.BRIGHT_CYAN=96]="BRIGHT_CYAN",r[r.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Wc||(Wc={}));Qw=10});function Xm(r,t=["constructor"]){let e=Object.getPrototypeOf(r),n=Object.getOwnPropertyNames(e),i=r;for(let s of n){let o=i[s];typeof o=="function"&&(t.find(a=>s===a)||(i[s]=o.bind(r)))}}var qm=d(()=>{});function os(){let r;if(ai()&&zc.performance)r=zc?.performance?.now?.();else if("hrtime"in jc){let t=jc?.hrtime?.();r=t[0]*1e3+t[1]/1e6}else r=Date.now();return r}var Qm=d(()=>{Hc()});function tv(r,t,e){if(typeof t=="string"){let n=e.time?Wm(Zm(e.total)):"";t=e.time?`${r}: ${n} ${t}`:`${r}: ${t}`,t=Km(t,e.color,e.background)}return t}function ev(r){for(let t in r)for(let e in r[t])return e||"untitled";return"empty"}var as,Tf,qr,Ef=d(()=>{Hc();Hm();$m();Gm();Jm();qm();Bf();Qm();as={debug:ai()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Tf={enabled:!0,level:0},qr=class extends $c{constructor({id:t}={id:""}){super({level:0}),this.VERSION=Af,this._startTs=os(),this._deltaTs=os(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new Zc(`__probe-${this.id}__`,{[this.id]:Tf}),this.timeStamp(`${this.id} started`),Xm(this),Object.seal(this)}isEnabled(){return this._getConfiguration().enabled}getLevel(){return this._getConfiguration().level}getTotal(){return Number((os()-this._startTs).toPrecision(10))}getDelta(){return Number((os()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._updateConfiguration({enabled:t}),this}setLevel(t){return this._updateConfiguration({level:t}),this}get(t){return this._getConfiguration()[t]}set(t,e){this._updateConfiguration({[t]:e})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,e){if(!t)throw new Error(e||"Assertion failed")}warn(t,...e){return this._log("warn",0,t,e,{method:as.warn,once:!0})}error(t,...e){return this._log("error",0,t,e,{method:as.error})}deprecated(t,e){return this.warn(`\`${t}\` is deprecated and will be removed in a later version. Use \`${e}\` instead`)}removed(t,e){return this.error(`\`${t}\` has been removed. Use \`${e}\` instead`)}probe(t,e,...n){return this._log("log",t,e,n,{method:as.log,time:!0,once:!0})}log(t,e,...n){return this._log("log",t,e,n,{method:as.debug})}info(t,e,...n){return this._log("info",t,e,n,{method:console.info})}once(t,e,...n){return this._log("once",t,e,n,{method:as.debug||as.info,once:!0})}table(t,e,n){return e?this._log("table",t,e,n&&[n]||[],{method:console.table||ci,tag:ev(e)}):ci}time(t,e){return this._log("time",t,e,[],{method:console.time?console.time:console.info})}timeEnd(t,e){return this._log("time",t,e,[],{method:console.timeEnd?console.timeEnd:console.info})}timeStamp(t,e){return this._log("time",t,e,[],{method:console.timeStamp||ci})}group(t,e,n={collapsed:!1}){let i=(n.collapsed?console.groupCollapsed:console.group)||console.info;return this._log("group",t,e,[],{method:i})}groupCollapsed(t,e,n={}){return this.group(t,e,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._log("groupEnd",t,"",[],{method:console.groupEnd||ci})}withGroup(t,e,n){this.group(t,e)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&super._shouldLog(t)}_emit(t,e){let n=e.method;ss(n),e.total=this.getTotal(),e.delta=this.getDelta(),this._deltaTs=os();let i=tv(this.id,e.message,e);return n.bind(console,i,...e.args)}_getConfiguration(){return this._storage.config[this.id]||this._updateConfiguration(Tf),this._storage.config[this.id]}_updateConfiguration(t){let e=this._storage.config[this.id]||{...Tf};this._storage.setConfiguration({[this.id]:{...e,...t}})}};qr.VERSION=Af});var ty=d(()=>{globalThis.probe={}});var VF,ey=d(()=>{Ef();Ef();ty();VF=new qr({id:"@probe.gl/log"})});function nv(){let r=new qr({id:"loaders.gl"});return globalThis.loaders||={},globalThis.loaders.log=r,globalThis.loaders.version=rv,globalThis.probe||={},globalThis.probe.loaders=r,r}var Of,rv,Gc,Lf=d(()=>{"use strict";ey();Of="5.0.0-alpha.1",rv=Of[0]>="0"&&Of[0]<="9"?`v${Of}`:"";Gc=nv()});var Ff,ry=d(()=>{"use strict";Ff=r=>typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer});function ny(r,t){return iy(r||{},t)}function iy(r,t,e=0){if(e>3)return t;let n={...r};for(let[i,s]of Object.entries(t))s&&typeof s=="object"&&!Array.isArray(s)?n[i]=iy(n[i]||{},t[i],e+1):n[i]=t[i];return n}var sy=d(()=>{"use strict"});function cs(r){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,r)}function Nf(r,t){globalThis.loaders?.modules?.[r]||Gc.warn(`${t}: ${r} library not installed`)()}function Yc(r,t){let e=globalThis.loaders?.modules?.[r];if(!e)throw new Error(`${t}: ${r} library not installed`);return e}function Mf(r){return globalThis.loaders?.modules?.[r]||null}var Rf=d(()=>{"use strict";Lf()});function oy(...r){return iv(r)}function iv(r){let t=r.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),e=t.reduce((s,o)=>s+o.byteLength,0),n=new Uint8Array(e),i=0;for(let s of t)n.set(s,i),i+=s.byteLength;return n.buffer}var ay=d(()=>{"use strict"});async function kf(r){let t=[];for await(let e of r)t.push(sv(e));return oy(...t)}function sv(r){if(r instanceof ArrayBuffer)return r;if(ArrayBuffer.isView(r)){let{buffer:t,byteOffset:e,byteLength:n}=r;return cy(t,e,n)}return cy(r)}function cy(r,t=0,e=r.byteLength-t){let n=new Uint8Array(r,t,e),i=new Uint8Array(n.length);return i.set(n),i.buffer}var ly=d(()=>{"use strict";ay()});function fy(r){for(let t in uy)if(r.startsWith(t)){let e=uy[t];r=r.replace(t,e)}return!r.startsWith("http://")&&!r.startsWith("https://")&&(r=`${ov}${r}`),r}var ov,uy,dy=d(()=>{"use strict";ov="",uy={}});function hy(r){return r&&typeof r=="object"&&r.isBuffer}function yn(r){if(hy(r))return r;if(r instanceof ArrayBuffer)return r;if(Ff(r))return Kc(r);if(ArrayBuffer.isView(r)){let t=r.buffer;return r.byteOffset===0&&r.byteLength===r.buffer.byteLength?t:t.slice(r.byteOffset,r.byteOffset+r.byteLength)}if(typeof r=="string"){let t=r;return new TextEncoder().encode(t).buffer}if(r&&typeof r=="object"&&r._toArrayBuffer)return r._toArrayBuffer();throw new Error("toArrayBuffer")}function Cf(r){if(r instanceof ArrayBuffer)return r;if(Ff(r))return Kc(r);let{buffer:t,byteOffset:e,byteLength:n}=r;return t instanceof ArrayBuffer&&e===0&&n===t.byteLength?t:Kc(t,e,n)}function Kc(r,t=0,e=r.byteLength-t){let n=new Uint8Array(r,t,e),i=new Uint8Array(n.length);return i.set(n),i.buffer}var py=d(()=>{"use strict";ry()});function ls(r){return t=>new Promise((e,n)=>r(t,(i,s)=>i?n(i):e(s)))}var my=d(()=>{"use strict"});function cv(r){let t=r?.core?.fetch;if(t&&typeof t=="function")return(n,i)=>t(n,i);let e=r?.fetch;return e&&typeof e!="function"?(n,i)=>fetch(n,lv(e,i)):(n,i)=>fetch(n,i)}function lv(r,t){let e={...r,...t};return(r.headers||t?.headers)&&(e.headers=uv(r.headers,t?.headers)),e}function uv(r,t){let e=new Headers(r);return t&&new Headers(t).forEach((n,i)=>e.set(i,n)),e}function fv(r){let t={...r};r?.core&&(t.core={...r.core});let e=typeof t.baseUri=="string"?t.baseUri:void 0,n=typeof t.baseUrl=="string"?t.baseUrl:void 0;return(e!==void 0||n!==void 0)&&(t.core||={},t.core.baseUrl===void 0&&(t.core.baseUrl=n??e),delete t.baseUri,delete t.baseUrl),t}function dv(r,t){return r instanceof Error?r:typeof r=="string"?new Error(r):new Error(t)}function li(r){return()=>{throw new Error(`CoreAPI.${r} is unavailable. Use @loaders.gl/core.createDataSource().`)}}var av,Uf,us,yy=d(()=>{"use strict";sy();dy();Lf();av={fetchFile:li("fetchFile"),parse:li("parse"),parseFile:li("parseFile"),parseSync:li("parseSync"),parseInBatches:li("parseInBatches"),load:li("load"),loadInBatches:li("loadInBatches")},Uf=class{optionsType;options;data;url;loadOptions;fetch;coreApi;hasCoreApi;_needsRefresh=!0;constructor(t,e,n,i){n?this.options=ny({...n,core:Uf.defaultOptions},e):this.options={...e},this.data=t,this.url=typeof t=="string"?fy(t):"";let s=fv(this.options.core?.loadOptions);this.loadOptions=s;let o=cv(s);this.coreApi=i||av,this.hasCoreApi=Boolean(i),this.fetch=o}setProps(t){this.options=Object.assign(this.options,t),this.setNeedsRefresh()}setNeedsRefresh(){this._needsRefresh=!0}getNeedsRefresh(t=!0){let e=this._needsRefresh;return t&&(this._needsRefresh=!1),e}reportError(t,e){let n=dv(t,e),i=this.options.core?.onError;return i?i(n,this):Gc.warn(`${this.constructor.name}: ${n.message}`)(),n}},us=Uf;Od(us,"defaultOptions",{core:{type:"auto",attributions:[],loadOptions:{},loaders:[],onError:void 0}})});var Io=d(()=>{"use strict";km();Rf();Rf();ly();py();my();yy()});var fs,Pf=d(()=>{"use strict";Io();fs=class{constructor(t){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(t={}){cs(t)}async compress(t){return await this.preload(),this.compressSync(t)}async decompress(t,e){return await this.preload(),this.decompressSync(t,e)}compressSync(t){throw new Error(`${this.name}: sync compression not supported`)}decompressSync(t,e){throw new Error(`${this.name}: sync decompression not supported`)}async*compressBatches(t){let e=await this.concatenate(t);yield this.compress(e)}async*decompressBatches(t){let e=await this.concatenate(t);yield this.decompress(e)}concatenate(t){return kf(t)}improveError(t){return t.message.includes(this.name)||(t.message=`${this.name} ${t.message}`),t}}});var Qr=Rt(ee=>{"use strict";var hv=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function pv(r,t){return Object.prototype.hasOwnProperty.call(r,t)}ee.assign=function(r){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var e=t.shift();if(e){if(typeof e!="object")throw new TypeError(e+"must be non-object");for(var n in e)pv(e,n)&&(r[n]=e[n])}}return r};ee.shrinkBuf=function(r,t){return r.length===t?r:r.subarray?r.subarray(0,t):(r.length=t,r)};var mv={arraySet:function(r,t,e,n,i){if(t.subarray&&r.subarray){r.set(t.subarray(e,e+n),i);return}for(var s=0;s<n;s++)r[i+s]=t[e+s]},flattenChunks:function(r){var t,e,n,i,s,o;for(n=0,t=0,e=r.length;t<e;t++)n+=r[t].length;for(o=new Uint8Array(n),i=0,t=0,e=r.length;t<e;t++)s=r[t],o.set(s,i),i+=s.length;return o}},yv={arraySet:function(r,t,e,n,i){for(var s=0;s<n;s++)r[i+s]=t[e+s]},flattenChunks:function(r){return[].concat.apply([],r)}};ee.setTyped=function(r){r?(ee.Buf8=Uint8Array,ee.Buf16=Uint16Array,ee.Buf32=Int32Array,ee.assign(ee,mv)):(ee.Buf8=Array,ee.Buf16=Array,ee.Buf32=Array,ee.assign(ee,yv))};ee.setTyped(hv)});var Py=Rt(ps=>{"use strict";var _v=Qr(),gv=4,_y=0,gy=1,bv=2;function hs(r){for(var t=r.length;--t>=0;)r[t]=0}var wv=0,Iy=1,vv=2,Sv=3,xv=258,Wf=29,Oo=256,Bo=Oo+1+Wf,ds=30,Gf=19,Ay=2*Bo+1,ui=15,Vf=16,Iv=7,Yf=256,By=16,Dy=17,Ty=18,$f=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Jc=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Av=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Ey=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Bv=512,tn=new Array((Bo+2)*2);hs(tn);var Ao=new Array(ds*2);hs(Ao);var Do=new Array(Bv);hs(Do);var To=new Array(xv-Sv+1);hs(To);var Kf=new Array(Wf);hs(Kf);var Xc=new Array(ds);hs(Xc);function zf(r,t,e,n,i){this.static_tree=r,this.extra_bits=t,this.extra_base=e,this.elems=n,this.max_length=i,this.has_stree=r&&r.length}var Oy,Ly,Fy;function jf(r,t){this.dyn_tree=r,this.max_code=0,this.stat_desc=t}function Ny(r){return r<256?Do[r]:Do[256+(r>>>7)]}function Eo(r,t){r.pending_buf[r.pending++]=t&255,r.pending_buf[r.pending++]=t>>>8&255}function me(r,t,e){r.bi_valid>Vf-e?(r.bi_buf|=t<<r.bi_valid&65535,Eo(r,r.bi_buf),r.bi_buf=t>>Vf-r.bi_valid,r.bi_valid+=e-Vf):(r.bi_buf|=t<<r.bi_valid&65535,r.bi_valid+=e)}function Lr(r,t,e){me(r,e[t*2],e[t*2+1])}function My(r,t){var e=0;do e|=r&1,r>>>=1,e<<=1;while(--t>0);return e>>>1}function Dv(r){r.bi_valid===16?(Eo(r,r.bi_buf),r.bi_buf=0,r.bi_valid=0):r.bi_valid>=8&&(r.pending_buf[r.pending++]=r.bi_buf&255,r.bi_buf>>=8,r.bi_valid-=8)}function Tv(r,t){var e=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,s=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,a=t.stat_desc.extra_base,l=t.stat_desc.max_length,c,u,h,m,p,y,g=0;for(m=0;m<=ui;m++)r.bl_count[m]=0;for(e[r.heap[r.heap_max]*2+1]=0,c=r.heap_max+1;c<Ay;c++)u=r.heap[c],m=e[e[u*2+1]*2+1]+1,m>l&&(m=l,g++),e[u*2+1]=m,!(u>n)&&(r.bl_count[m]++,p=0,u>=a&&(p=o[u-a]),y=e[u*2],r.opt_len+=y*(m+p),s&&(r.static_len+=y*(i[u*2+1]+p)));if(g!==0){do{for(m=l-1;r.bl_count[m]===0;)m--;r.bl_count[m]--,r.bl_count[m+1]+=2,r.bl_count[l]--,g-=2}while(g>0);for(m=l;m!==0;m--)for(u=r.bl_count[m];u!==0;)h=r.heap[--c],!(h>n)&&(e[h*2+1]!==m&&(r.opt_len+=(m-e[h*2+1])*e[h*2],e[h*2+1]=m),u--)}}function Ry(r,t,e){var n=new Array(ui+1),i=0,s,o;for(s=1;s<=ui;s++)n[s]=i=i+e[s-1]<<1;for(o=0;o<=t;o++){var a=r[o*2+1];a!==0&&(r[o*2]=My(n[a]++,a))}}function Ev(){var r,t,e,n,i,s=new Array(ui+1);for(e=0,n=0;n<Wf-1;n++)for(Kf[n]=e,r=0;r<1<<$f[n];r++)To[e++]=n;for(To[e-1]=n,i=0,n=0;n<16;n++)for(Xc[n]=i,r=0;r<1<<Jc[n];r++)Do[i++]=n;for(i>>=7;n<ds;n++)for(Xc[n]=i<<7,r=0;r<1<<Jc[n]-7;r++)Do[256+i++]=n;for(t=0;t<=ui;t++)s[t]=0;for(r=0;r<=143;)tn[r*2+1]=8,r++,s[8]++;for(;r<=255;)tn[r*2+1]=9,r++,s[9]++;for(;r<=279;)tn[r*2+1]=7,r++,s[7]++;for(;r<=287;)tn[r*2+1]=8,r++,s[8]++;for(Ry(tn,Bo+1,s),r=0;r<ds;r++)Ao[r*2+1]=5,Ao[r*2]=My(r,5);Oy=new zf(tn,$f,Oo+1,Bo,ui),Ly=new zf(Ao,Jc,0,ds,ui),Fy=new zf(new Array(0),Av,0,Gf,Iv)}function ky(r){var t;for(t=0;t<Bo;t++)r.dyn_ltree[t*2]=0;for(t=0;t<ds;t++)r.dyn_dtree[t*2]=0;for(t=0;t<Gf;t++)r.bl_tree[t*2]=0;r.dyn_ltree[Yf*2]=1,r.opt_len=r.static_len=0,r.last_lit=r.matches=0}function Cy(r){r.bi_valid>8?Eo(r,r.bi_buf):r.bi_valid>0&&(r.pending_buf[r.pending++]=r.bi_buf),r.bi_buf=0,r.bi_valid=0}function Ov(r,t,e,n){Cy(r),n&&(Eo(r,e),Eo(r,~e)),_v.arraySet(r.pending_buf,r.window,t,e,r.pending),r.pending+=e}function by(r,t,e,n){var i=t*2,s=e*2;return r[i]<r[s]||r[i]===r[s]&&n[t]<=n[e]}function Hf(r,t,e){for(var n=r.heap[e],i=e<<1;i<=r.heap_len&&(i<r.heap_len&&by(t,r.heap[i+1],r.heap[i],r.depth)&&i++,!by(t,n,r.heap[i],r.depth));)r.heap[e]=r.heap[i],e=i,i<<=1;r.heap[e]=n}function wy(r,t,e){var n,i,s=0,o,a;if(r.last_lit!==0)do n=r.pending_buf[r.d_buf+s*2]<<8|r.pending_buf[r.d_buf+s*2+1],i=r.pending_buf[r.l_buf+s],s++,n===0?Lr(r,i,t):(o=To[i],Lr(r,o+Oo+1,t),a=$f[o],a!==0&&(i-=Kf[o],me(r,i,a)),n--,o=Ny(n),Lr(r,o,e),a=Jc[o],a!==0&&(n-=Xc[o],me(r,n,a)));while(s<r.last_lit);Lr(r,Yf,t)}function Zf(r,t){var e=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,s=t.stat_desc.elems,o,a,l=-1,c;for(r.heap_len=0,r.heap_max=Ay,o=0;o<s;o++)e[o*2]!==0?(r.heap[++r.heap_len]=l=o,r.depth[o]=0):e[o*2+1]=0;for(;r.heap_len<2;)c=r.heap[++r.heap_len]=l<2?++l:0,e[c*2]=1,r.depth[c]=0,r.opt_len--,i&&(r.static_len-=n[c*2+1]);for(t.max_code=l,o=r.heap_len>>1;o>=1;o--)Hf(r,e,o);c=s;do o=r.heap[1],r.heap[1]=r.heap[r.heap_len--],Hf(r,e,1),a=r.heap[1],r.heap[--r.heap_max]=o,r.heap[--r.heap_max]=a,e[c*2]=e[o*2]+e[a*2],r.depth[c]=(r.depth[o]>=r.depth[a]?r.depth[o]:r.depth[a])+1,e[o*2+1]=e[a*2+1]=c,r.heap[1]=c++,Hf(r,e,1);while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],Tv(r,t),Ry(e,l,r.bl_count)}function vy(r,t,e){var n,i=-1,s,o=t[0*2+1],a=0,l=7,c=4;for(o===0&&(l=138,c=3),t[(e+1)*2+1]=65535,n=0;n<=e;n++)s=o,o=t[(n+1)*2+1],!(++a<l&&s===o)&&(a<c?r.bl_tree[s*2]+=a:s!==0?(s!==i&&r.bl_tree[s*2]++,r.bl_tree[By*2]++):a<=10?r.bl_tree[Dy*2]++:r.bl_tree[Ty*2]++,a=0,i=s,o===0?(l=138,c=3):s===o?(l=6,c=3):(l=7,c=4))}function Sy(r,t,e){var n,i=-1,s,o=t[0*2+1],a=0,l=7,c=4;for(o===0&&(l=138,c=3),n=0;n<=e;n++)if(s=o,o=t[(n+1)*2+1],!(++a<l&&s===o)){if(a<c)do Lr(r,s,r.bl_tree);while(--a!==0);else s!==0?(s!==i&&(Lr(r,s,r.bl_tree),a--),Lr(r,By,r.bl_tree),me(r,a-3,2)):a<=10?(Lr(r,Dy,r.bl_tree),me(r,a-3,3)):(Lr(r,Ty,r.bl_tree),me(r,a-11,7));a=0,i=s,o===0?(l=138,c=3):s===o?(l=6,c=3):(l=7,c=4)}}function Lv(r){var t;for(vy(r,r.dyn_ltree,r.l_desc.max_code),vy(r,r.dyn_dtree,r.d_desc.max_code),Zf(r,r.bl_desc),t=Gf-1;t>=3&&r.bl_tree[Ey[t]*2+1]===0;t--);return r.opt_len+=3*(t+1)+5+5+4,t}function Fv(r,t,e,n){var i;for(me(r,t-257,5),me(r,e-1,5),me(r,n-4,4),i=0;i<n;i++)me(r,r.bl_tree[Ey[i]*2+1],3);Sy(r,r.dyn_ltree,t-1),Sy(r,r.dyn_dtree,e-1)}function Nv(r){var t=4093624447,e;for(e=0;e<=31;e++,t>>>=1)if(t&1&&r.dyn_ltree[e*2]!==0)return _y;if(r.dyn_ltree[9*2]!==0||r.dyn_ltree[10*2]!==0||r.dyn_ltree[13*2]!==0)return gy;for(e=32;e<Oo;e++)if(r.dyn_ltree[e*2]!==0)return gy;return _y}var xy=!1;function Mv(r){xy||(Ev(),xy=!0),r.l_desc=new jf(r.dyn_ltree,Oy),r.d_desc=new jf(r.dyn_dtree,Ly),r.bl_desc=new jf(r.bl_tree,Fy),r.bi_buf=0,r.bi_valid=0,ky(r)}function Uy(r,t,e,n){me(r,(wv<<1)+(n?1:0),3),Ov(r,t,e,!0)}function Rv(r){me(r,Iy<<1,3),Lr(r,Yf,tn),Dv(r)}function kv(r,t,e,n){var i,s,o=0;r.level>0?(r.strm.data_type===bv&&(r.strm.data_type=Nv(r)),Zf(r,r.l_desc),Zf(r,r.d_desc),o=Lv(r),i=r.opt_len+3+7>>>3,s=r.static_len+3+7>>>3,s<=i&&(i=s)):i=s=e+5,e+4<=i&&t!==-1?Uy(r,t,e,n):r.strategy===gv||s===i?(me(r,(Iy<<1)+(n?1:0),3),wy(r,tn,Ao)):(me(r,(vv<<1)+(n?1:0),3),Fv(r,r.l_desc.max_code+1,r.d_desc.max_code+1,o+1),wy(r,r.dyn_ltree,r.dyn_dtree)),ky(r),n&&Cy(r)}function Cv(r,t,e){return r.pending_buf[r.d_buf+r.last_lit*2]=t>>>8&255,r.pending_buf[r.d_buf+r.last_lit*2+1]=t&255,r.pending_buf[r.l_buf+r.last_lit]=e&255,r.last_lit++,t===0?r.dyn_ltree[e*2]++:(r.matches++,t--,r.dyn_ltree[(To[e]+Oo+1)*2]++,r.dyn_dtree[Ny(t)*2]++),r.last_lit===r.lit_bufsize-1}ps._tr_init=Mv;ps._tr_stored_block=Uy;ps._tr_flush_block=kv;ps._tr_tally=Cv;ps._tr_align=Rv});var Jf=Rt((BN,Vy)=>{"use strict";function Uv(r,t,e,n){for(var i=r&65535|0,s=r>>>16&65535|0,o=0;e!==0;){o=e>2e3?2e3:e,e-=o;do i=i+t[n++]|0,s=s+i|0;while(--o);i%=65521,s%=65521}return i|s<<16|0}Vy.exports=Uv});var Xf=Rt((DN,zy)=>{"use strict";function Pv(){for(var r,t=[],e=0;e<256;e++){r=e;for(var n=0;n<8;n++)r=r&1?3988292384^r>>>1:r>>>1;t[e]=r}return t}var Vv=Pv();function zv(r,t,e,n){var i=Vv,s=n+e;r^=-1;for(var o=n;o<s;o++)r=r>>>8^i[(r^t[o])&255];return r^-1}zy.exports=zv});var qc=Rt((TN,jy)=>{"use strict";jy.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var Xy=Rt(Mr=>{"use strict";var re=Qr(),ke=Py(),Wy=Jf(),_n=Xf(),jv=qc(),pi=0,Hv=1,$v=3,Sn=4,Hy=5,Nr=0,$y=1,Ce=-2,Zv=-3,qf=-5,Wv=-1,Gv=1,Qc=2,Yv=3,Kv=4,Jv=0,Xv=2,nl=8,qv=9,Qv=15,tS=8,eS=29,rS=256,td=rS+1+eS,nS=30,iS=19,sS=2*td+1,oS=15,J=3,wn=258,Qe=wn+J+1,aS=32,il=42,ed=69,tl=73,el=91,rl=103,fi=113,Fo=666,Mt=1,No=2,di=3,_s=4,cS=3;function vn(r,t){return r.msg=jv[t],t}function Zy(r){return(r<<1)-(r>4?9:0)}function bn(r){for(var t=r.length;--t>=0;)r[t]=0}function gn(r){var t=r.state,e=t.pending;e>r.avail_out&&(e=r.avail_out),e!==0&&(re.arraySet(r.output,t.pending_buf,t.pending_out,e,r.next_out),r.next_out+=e,t.pending_out+=e,r.total_out+=e,r.avail_out-=e,t.pending-=e,t.pending===0&&(t.pending_out=0))}function $t(r,t){ke._tr_flush_block(r,r.block_start>=0?r.block_start:-1,r.strstart-r.block_start,t),r.block_start=r.strstart,gn(r.strm)}function nt(r,t){r.pending_buf[r.pending++]=t}function Lo(r,t){r.pending_buf[r.pending++]=t>>>8&255,r.pending_buf[r.pending++]=t&255}function lS(r,t,e,n){var i=r.avail_in;return i>n&&(i=n),i===0?0:(r.avail_in-=i,re.arraySet(t,r.input,r.next_in,i,e),r.state.wrap===1?r.adler=Wy(r.adler,t,i,e):r.state.wrap===2&&(r.adler=_n(r.adler,t,i,e)),r.next_in+=i,r.total_in+=i,i)}function Gy(r,t){var e=r.max_chain_length,n=r.strstart,i,s,o=r.prev_length,a=r.nice_match,l=r.strstart>r.w_size-Qe?r.strstart-(r.w_size-Qe):0,c=r.window,u=r.w_mask,h=r.prev,m=r.strstart+wn,p=c[n+o-1],y=c[n+o];r.prev_length>=r.good_match&&(e>>=2),a>r.lookahead&&(a=r.lookahead);do if(i=t,!(c[i+o]!==y||c[i+o-1]!==p||c[i]!==c[n]||c[++i]!==c[n+1])){n+=2,i++;do;while(c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&c[++n]===c[++i]&&n<m);if(s=wn-(m-n),n=m-wn,s>o){if(r.match_start=t,o=s,s>=a)break;p=c[n+o-1],y=c[n+o]}}while((t=h[t&u])>l&&--e!==0);return o<=r.lookahead?o:r.lookahead}function hi(r){var t=r.w_size,e,n,i,s,o;do{if(s=r.window_size-r.lookahead-r.strstart,r.strstart>=t+(t-Qe)){re.arraySet(r.window,r.window,t,t,0),r.match_start-=t,r.strstart-=t,r.block_start-=t,n=r.hash_size,e=n;do i=r.head[--e],r.head[e]=i>=t?i-t:0;while(--n);n=t,e=n;do i=r.prev[--e],r.prev[e]=i>=t?i-t:0;while(--n);s+=t}if(r.strm.avail_in===0)break;if(n=lS(r.strm,r.window,r.strstart+r.lookahead,s),r.lookahead+=n,r.lookahead+r.insert>=J)for(o=r.strstart-r.insert,r.ins_h=r.window[o],r.ins_h=(r.ins_h<<r.hash_shift^r.window[o+1])&r.hash_mask;r.insert&&(r.ins_h=(r.ins_h<<r.hash_shift^r.window[o+J-1])&r.hash_mask,r.prev[o&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=o,o++,r.insert--,!(r.lookahead+r.insert<J)););}while(r.lookahead<Qe&&r.strm.avail_in!==0)}function uS(r,t){var e=65535;for(e>r.pending_buf_size-5&&(e=r.pending_buf_size-5);;){if(r.lookahead<=1){if(hi(r),r.lookahead===0&&t===pi)return Mt;if(r.lookahead===0)break}r.strstart+=r.lookahead,r.lookahead=0;var n=r.block_start+e;if((r.strstart===0||r.strstart>=n)&&(r.lookahead=r.strstart-n,r.strstart=n,$t(r,!1),r.strm.avail_out===0)||r.strstart-r.block_start>=r.w_size-Qe&&($t(r,!1),r.strm.avail_out===0))return Mt}return r.insert=0,t===Sn?($t(r,!0),r.strm.avail_out===0?di:_s):(r.strstart>r.block_start&&($t(r,!1),r.strm.avail_out===0),Mt)}function Qf(r,t){for(var e,n;;){if(r.lookahead<Qe){if(hi(r),r.lookahead<Qe&&t===pi)return Mt;if(r.lookahead===0)break}if(e=0,r.lookahead>=J&&(r.ins_h=(r.ins_h<<r.hash_shift^r.window[r.strstart+J-1])&r.hash_mask,e=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart),e!==0&&r.strstart-e<=r.w_size-Qe&&(r.match_length=Gy(r,e)),r.match_length>=J)if(n=ke._tr_tally(r,r.strstart-r.match_start,r.match_length-J),r.lookahead-=r.match_length,r.match_length<=r.max_lazy_match&&r.lookahead>=J){r.match_length--;do r.strstart++,r.ins_h=(r.ins_h<<r.hash_shift^r.window[r.strstart+J-1])&r.hash_mask,e=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart;while(--r.match_length!==0);r.strstart++}else r.strstart+=r.match_length,r.match_length=0,r.ins_h=r.window[r.strstart],r.ins_h=(r.ins_h<<r.hash_shift^r.window[r.strstart+1])&r.hash_mask;else n=ke._tr_tally(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++;if(n&&($t(r,!1),r.strm.avail_out===0))return Mt}return r.insert=r.strstart<J-1?r.strstart:J-1,t===Sn?($t(r,!0),r.strm.avail_out===0?di:_s):r.last_lit&&($t(r,!1),r.strm.avail_out===0)?Mt:No}function ms(r,t){for(var e,n,i;;){if(r.lookahead<Qe){if(hi(r),r.lookahead<Qe&&t===pi)return Mt;if(r.lookahead===0)break}if(e=0,r.lookahead>=J&&(r.ins_h=(r.ins_h<<r.hash_shift^r.window[r.strstart+J-1])&r.hash_mask,e=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart),r.prev_length=r.match_length,r.prev_match=r.match_start,r.match_length=J-1,e!==0&&r.prev_length<r.max_lazy_match&&r.strstart-e<=r.w_size-Qe&&(r.match_length=Gy(r,e),r.match_length<=5&&(r.strategy===Gv||r.match_length===J&&r.strstart-r.match_start>4096)&&(r.match_length=J-1)),r.prev_length>=J&&r.match_length<=r.prev_length){i=r.strstart+r.lookahead-J,n=ke._tr_tally(r,r.strstart-1-r.prev_match,r.prev_length-J),r.lookahead-=r.prev_length-1,r.prev_length-=2;do++r.strstart<=i&&(r.ins_h=(r.ins_h<<r.hash_shift^r.window[r.strstart+J-1])&r.hash_mask,e=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart);while(--r.prev_length!==0);if(r.match_available=0,r.match_length=J-1,r.strstart++,n&&($t(r,!1),r.strm.avail_out===0))return Mt}else if(r.match_available){if(n=ke._tr_tally(r,0,r.window[r.strstart-1]),n&&$t(r,!1),r.strstart++,r.lookahead--,r.strm.avail_out===0)return Mt}else r.match_available=1,r.strstart++,r.lookahead--}return r.match_available&&(n=ke._tr_tally(r,0,r.window[r.strstart-1]),r.match_available=0),r.insert=r.strstart<J-1?r.strstart:J-1,t===Sn?($t(r,!0),r.strm.avail_out===0?di:_s):r.last_lit&&($t(r,!1),r.strm.avail_out===0)?Mt:No}function fS(r,t){for(var e,n,i,s,o=r.window;;){if(r.lookahead<=wn){if(hi(r),r.lookahead<=wn&&t===pi)return Mt;if(r.lookahead===0)break}if(r.match_length=0,r.lookahead>=J&&r.strstart>0&&(i=r.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){s=r.strstart+wn;do;while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<s);r.match_length=wn-(s-i),r.match_length>r.lookahead&&(r.match_length=r.lookahead)}if(r.match_length>=J?(e=ke._tr_tally(r,1,r.match_length-J),r.lookahead-=r.match_length,r.strstart+=r.match_length,r.match_length=0):(e=ke._tr_tally(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++),e&&($t(r,!1),r.strm.avail_out===0))return Mt}return r.insert=0,t===Sn?($t(r,!0),r.strm.avail_out===0?di:_s):r.last_lit&&($t(r,!1),r.strm.avail_out===0)?Mt:No}function dS(r,t){for(var e;;){if(r.lookahead===0&&(hi(r),r.lookahead===0)){if(t===pi)return Mt;break}if(r.match_length=0,e=ke._tr_tally(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++,e&&($t(r,!1),r.strm.avail_out===0))return Mt}return r.insert=0,t===Sn?($t(r,!0),r.strm.avail_out===0?di:_s):r.last_lit&&($t(r,!1),r.strm.avail_out===0)?Mt:No}function Fr(r,t,e,n,i){this.good_length=r,this.max_lazy=t,this.nice_length=e,this.max_chain=n,this.func=i}var ys;ys=[new Fr(0,0,0,0,uS),new Fr(4,4,8,4,Qf),new Fr(4,5,16,8,Qf),new Fr(4,6,32,32,Qf),new Fr(4,4,16,16,ms),new Fr(8,16,32,32,ms),new Fr(8,16,128,128,ms),new Fr(8,32,128,256,ms),new Fr(32,128,258,1024,ms),new Fr(32,258,258,4096,ms)];function hS(r){r.window_size=2*r.w_size,bn(r.head),r.max_lazy_match=ys[r.level].max_lazy,r.good_match=ys[r.level].good_length,r.nice_match=ys[r.level].nice_length,r.max_chain_length=ys[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=J-1,r.match_available=0,r.ins_h=0}function pS(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=nl,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new re.Buf16(sS*2),this.dyn_dtree=new re.Buf16((2*nS+1)*2),this.bl_tree=new re.Buf16((2*iS+1)*2),bn(this.dyn_ltree),bn(this.dyn_dtree),bn(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new re.Buf16(oS+1),this.heap=new re.Buf16(2*td+1),bn(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new re.Buf16(2*td+1),bn(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Yy(r){var t;return!r||!r.state?vn(r,Ce):(r.total_in=r.total_out=0,r.data_type=Xv,t=r.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?il:fi,r.adler=t.wrap===2?0:1,t.last_flush=pi,ke._tr_init(t),Nr)}function Ky(r){var t=Yy(r);return t===Nr&&hS(r.state),t}function mS(r,t){return!r||!r.state||r.state.wrap!==2?Ce:(r.state.gzhead=t,Nr)}function Jy(r,t,e,n,i,s){if(!r)return Ce;var o=1;if(t===Wv&&(t=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>qv||e!==nl||n<8||n>15||t<0||t>9||s<0||s>Kv)return vn(r,Ce);n===8&&(n=9);var a=new pS;return r.state=a,a.strm=r,a.wrap=o,a.gzhead=null,a.w_bits=n,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=i+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+J-1)/J),a.window=new re.Buf8(a.w_size*2),a.head=new re.Buf16(a.hash_size),a.prev=new re.Buf16(a.w_size),a.lit_bufsize=1<<i+6,a.pending_buf_size=a.lit_bufsize*4,a.pending_buf=new re.Buf8(a.pending_buf_size),a.d_buf=1*a.lit_bufsize,a.l_buf=(1+2)*a.lit_bufsize,a.level=t,a.strategy=s,a.method=e,Ky(r)}function yS(r,t){return Jy(r,t,nl,Qv,tS,Jv)}function _S(r,t){var e,n,i,s;if(!r||!r.state||t>Hy||t<0)return r?vn(r,Ce):Ce;if(n=r.state,!r.output||!r.input&&r.avail_in!==0||n.status===Fo&&t!==Sn)return vn(r,r.avail_out===0?qf:Ce);if(n.strm=r,e=n.last_flush,n.last_flush=t,n.status===il)if(n.wrap===2)r.adler=0,nt(n,31),nt(n,139),nt(n,8),n.gzhead?(nt(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),nt(n,n.gzhead.time&255),nt(n,n.gzhead.time>>8&255),nt(n,n.gzhead.time>>16&255),nt(n,n.gzhead.time>>24&255),nt(n,n.level===9?2:n.strategy>=Qc||n.level<2?4:0),nt(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(nt(n,n.gzhead.extra.length&255),nt(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(r.adler=_n(r.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=ed):(nt(n,0),nt(n,0),nt(n,0),nt(n,0),nt(n,0),nt(n,n.level===9?2:n.strategy>=Qc||n.level<2?4:0),nt(n,cS),n.status=fi);else{var o=nl+(n.w_bits-8<<4)<<8,a=-1;n.strategy>=Qc||n.level<2?a=0:n.level<6?a=1:n.level===6?a=2:a=3,o|=a<<6,n.strstart!==0&&(o|=aS),o+=31-o%31,n.status=fi,Lo(n,o),n.strstart!==0&&(Lo(n,r.adler>>>16),Lo(n,r.adler&65535)),r.adler=1}if(n.status===ed)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(r.adler=_n(r.adler,n.pending_buf,n.pending-i,i)),gn(r),i=n.pending,n.pending===n.pending_buf_size));)nt(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(r.adler=_n(r.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=tl)}else n.status=tl;if(n.status===tl)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(r.adler=_n(r.adler,n.pending_buf,n.pending-i,i)),gn(r),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}n.gzindex<n.gzhead.name.length?s=n.gzhead.name.charCodeAt(n.gzindex++)&255:s=0,nt(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>i&&(r.adler=_n(r.adler,n.pending_buf,n.pending-i,i)),s===0&&(n.gzindex=0,n.status=el)}else n.status=el;if(n.status===el)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(r.adler=_n(r.adler,n.pending_buf,n.pending-i,i)),gn(r),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}n.gzindex<n.gzhead.comment.length?s=n.gzhead.comment.charCodeAt(n.gzindex++)&255:s=0,nt(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>i&&(r.adler=_n(r.adler,n.pending_buf,n.pending-i,i)),s===0&&(n.status=rl)}else n.status=rl;if(n.status===rl&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&gn(r),n.pending+2<=n.pending_buf_size&&(nt(n,r.adler&255),nt(n,r.adler>>8&255),r.adler=0,n.status=fi)):n.status=fi),n.pending!==0){if(gn(r),r.avail_out===0)return n.last_flush=-1,Nr}else if(r.avail_in===0&&Zy(t)<=Zy(e)&&t!==Sn)return vn(r,qf);if(n.status===Fo&&r.avail_in!==0)return vn(r,qf);if(r.avail_in!==0||n.lookahead!==0||t!==pi&&n.status!==Fo){var l=n.strategy===Qc?dS(n,t):n.strategy===Yv?fS(n,t):ys[n.level].func(n,t);if((l===di||l===_s)&&(n.status=Fo),l===Mt||l===di)return r.avail_out===0&&(n.last_flush=-1),Nr;if(l===No&&(t===Hv?ke._tr_align(n):t!==Hy&&(ke._tr_stored_block(n,0,0,!1),t===$v&&(bn(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),gn(r),r.avail_out===0))return n.last_flush=-1,Nr}return t!==Sn?Nr:n.wrap<=0?$y:(n.wrap===2?(nt(n,r.adler&255),nt(n,r.adler>>8&255),nt(n,r.adler>>16&255),nt(n,r.adler>>24&255),nt(n,r.total_in&255),nt(n,r.total_in>>8&255),nt(n,r.total_in>>16&255),nt(n,r.total_in>>24&255)):(Lo(n,r.adler>>>16),Lo(n,r.adler&65535)),gn(r),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Nr:$y)}function gS(r){var t;return!r||!r.state?Ce:(t=r.state.status,t!==il&&t!==ed&&t!==tl&&t!==el&&t!==rl&&t!==fi&&t!==Fo?vn(r,Ce):(r.state=null,t===fi?vn(r,Zv):Nr))}function bS(r,t){var e=t.length,n,i,s,o,a,l,c,u;if(!r||!r.state||(n=r.state,o=n.wrap,o===2||o===1&&n.status!==il||n.lookahead))return Ce;for(o===1&&(r.adler=Wy(r.adler,t,e,0)),n.wrap=0,e>=n.w_size&&(o===0&&(bn(n.head),n.strstart=0,n.block_start=0,n.insert=0),u=new re.Buf8(n.w_size),re.arraySet(u,t,e-n.w_size,n.w_size,0),t=u,e=n.w_size),a=r.avail_in,l=r.next_in,c=r.input,r.avail_in=e,r.next_in=0,r.input=t,hi(n);n.lookahead>=J;){i=n.strstart,s=n.lookahead-(J-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[i+J-1])&n.hash_mask,n.prev[i&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=i,i++;while(--s);n.strstart=i,n.lookahead=J-1,hi(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=J-1,n.match_available=0,r.next_in=l,r.input=c,r.avail_in=a,n.wrap=o,Nr}Mr.deflateInit=yS;Mr.deflateInit2=Jy;Mr.deflateReset=Ky;Mr.deflateResetKeep=Yy;Mr.deflateSetHeader=mS;Mr.deflate=_S;Mr.deflateEnd=gS;Mr.deflateSetDictionary=bS;Mr.deflateInfo="pako deflate (from Nodeca project)"});var rd=Rt(gs=>{"use strict";var sl=Qr(),qy=!0,Qy=!0;try{String.fromCharCode.apply(null,[0])}catch{qy=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Qy=!1}var Mo=new sl.Buf8(256);for(en=0;en<256;en++)Mo[en]=en>=252?6:en>=248?5:en>=240?4:en>=224?3:en>=192?2:1;var en;Mo[254]=Mo[254]=1;gs.string2buf=function(r){var t,e,n,i,s,o=r.length,a=0;for(i=0;i<o;i++)e=r.charCodeAt(i),(e&64512)===55296&&i+1<o&&(n=r.charCodeAt(i+1),(n&64512)===56320&&(e=65536+(e-55296<<10)+(n-56320),i++)),a+=e<128?1:e<2048?2:e<65536?3:4;for(t=new sl.Buf8(a),s=0,i=0;s<a;i++)e=r.charCodeAt(i),(e&64512)===55296&&i+1<o&&(n=r.charCodeAt(i+1),(n&64512)===56320&&(e=65536+(e-55296<<10)+(n-56320),i++)),e<128?t[s++]=e:e<2048?(t[s++]=192|e>>>6,t[s++]=128|e&63):e<65536?(t[s++]=224|e>>>12,t[s++]=128|e>>>6&63,t[s++]=128|e&63):(t[s++]=240|e>>>18,t[s++]=128|e>>>12&63,t[s++]=128|e>>>6&63,t[s++]=128|e&63);return t};function t_(r,t){if(t<65534&&(r.subarray&&Qy||!r.subarray&&qy))return String.fromCharCode.apply(null,sl.shrinkBuf(r,t));for(var e="",n=0;n<t;n++)e+=String.fromCharCode(r[n]);return e}gs.buf2binstring=function(r){return t_(r,r.length)};gs.binstring2buf=function(r){for(var t=new sl.Buf8(r.length),e=0,n=t.length;e<n;e++)t[e]=r.charCodeAt(e);return t};gs.buf2string=function(r,t){var e,n,i,s,o=t||r.length,a=new Array(o*2);for(n=0,e=0;e<o;){if(i=r[e++],i<128){a[n++]=i;continue}if(s=Mo[i],s>4){a[n++]=65533,e+=s-1;continue}for(i&=s===2?31:s===3?15:7;s>1&&e<o;)i=i<<6|r[e++]&63,s--;if(s>1){a[n++]=65533;continue}i<65536?a[n++]=i:(i-=65536,a[n++]=55296|i>>10&1023,a[n++]=56320|i&1023)}return t_(a,n)};gs.utf8border=function(r,t){var e;for(t=t||r.length,t>r.length&&(t=r.length),e=t-1;e>=0&&(r[e]&192)===128;)e--;return e<0||e===0?t:e+Mo[r[e]]>t?e:t}});var nd=Rt((LN,e_)=>{"use strict";function wS(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}e_.exports=wS});var s_=Rt(Co=>{"use strict";var Ro=Xy(),ko=Qr(),sd=rd(),od=qc(),vS=nd(),i_=Object.prototype.toString,SS=0,id=4,bs=0,r_=1,n_=2,xS=-1,IS=0,AS=8;function mi(r){if(!(this instanceof mi))return new mi(r);this.options=ko.assign({level:xS,method:AS,chunkSize:16384,windowBits:15,memLevel:8,strategy:IS,to:""},r||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new vS,this.strm.avail_out=0;var e=Ro.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==bs)throw new Error(od[e]);if(t.header&&Ro.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(typeof t.dictionary=="string"?n=sd.string2buf(t.dictionary):i_.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,e=Ro.deflateSetDictionary(this.strm,n),e!==bs)throw new Error(od[e]);this._dict_set=!0}}mi.prototype.push=function(r,t){var e=this.strm,n=this.options.chunkSize,i,s;if(this.ended)return!1;s=t===~~t?t:t===!0?id:SS,typeof r=="string"?e.input=sd.string2buf(r):i_.call(r)==="[object ArrayBuffer]"?e.input=new Uint8Array(r):e.input=r,e.next_in=0,e.avail_in=e.input.length;do{if(e.avail_out===0&&(e.output=new ko.Buf8(n),e.next_out=0,e.avail_out=n),i=Ro.deflate(e,s),i!==r_&&i!==bs)return this.onEnd(i),this.ended=!0,!1;(e.avail_out===0||e.avail_in===0&&(s===id||s===n_))&&(this.options.to==="string"?this.onData(sd.buf2binstring(ko.shrinkBuf(e.output,e.next_out))):this.onData(ko.shrinkBuf(e.output,e.next_out)))}while((e.avail_in>0||e.avail_out===0)&&i!==r_);return s===id?(i=Ro.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===bs):(s===n_&&(this.onEnd(bs),e.avail_out=0),!0)};mi.prototype.onData=function(r){this.chunks.push(r)};mi.prototype.onEnd=function(r){r===bs&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=ko.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function ad(r,t){var e=new mi(t);if(e.push(r,!0),e.err)throw e.msg||od[e.err];return e.result}function BS(r,t){return t=t||{},t.raw=!0,ad(r,t)}function DS(r,t){return t=t||{},t.gzip=!0,ad(r,t)}Co.Deflate=mi;Co.deflate=ad;Co.deflateRaw=BS;Co.gzip=DS});var a_=Rt((NN,o_)=>{"use strict";var ol=30,TS=12;o_.exports=function(t,e){var n,i,s,o,a,l,c,u,h,m,p,y,g,N,S,G,tt,V,w,Y,X,z,et,bt,j;n=t.state,i=t.next_in,bt=t.input,s=i+(t.avail_in-5),o=t.next_out,j=t.output,a=o-(e-t.avail_out),l=o+(t.avail_out-257),c=n.dmax,u=n.wsize,h=n.whave,m=n.wnext,p=n.window,y=n.hold,g=n.bits,N=n.lencode,S=n.distcode,G=(1<<n.lenbits)-1,tt=(1<<n.distbits)-1;t:do{g<15&&(y+=bt[i++]<<g,g+=8,y+=bt[i++]<<g,g+=8),V=N[y&G];e:for(;;){if(w=V>>>24,y>>>=w,g-=w,w=V>>>16&255,w===0)j[o++]=V&65535;else if(w&16){Y=V&65535,w&=15,w&&(g<w&&(y+=bt[i++]<<g,g+=8),Y+=y&(1<<w)-1,y>>>=w,g-=w),g<15&&(y+=bt[i++]<<g,g+=8,y+=bt[i++]<<g,g+=8),V=S[y&tt];r:for(;;){if(w=V>>>24,y>>>=w,g-=w,w=V>>>16&255,w&16){if(X=V&65535,w&=15,g<w&&(y+=bt[i++]<<g,g+=8,g<w&&(y+=bt[i++]<<g,g+=8)),X+=y&(1<<w)-1,X>c){t.msg="invalid distance too far back",n.mode=ol;break t}if(y>>>=w,g-=w,w=o-a,X>w){if(w=X-w,w>h&&n.sane){t.msg="invalid distance too far back",n.mode=ol;break t}if(z=0,et=p,m===0){if(z+=u-w,w<Y){Y-=w;do j[o++]=p[z++];while(--w);z=o-X,et=j}}else if(m<w){if(z+=u+m-w,w-=m,w<Y){Y-=w;do j[o++]=p[z++];while(--w);if(z=0,m<Y){w=m,Y-=w;do j[o++]=p[z++];while(--w);z=o-X,et=j}}}else if(z+=m-w,w<Y){Y-=w;do j[o++]=p[z++];while(--w);z=o-X,et=j}for(;Y>2;)j[o++]=et[z++],j[o++]=et[z++],j[o++]=et[z++],Y-=3;Y&&(j[o++]=et[z++],Y>1&&(j[o++]=et[z++]))}else{z=o-X;do j[o++]=j[z++],j[o++]=j[z++],j[o++]=j[z++],Y-=3;while(Y>2);Y&&(j[o++]=j[z++],Y>1&&(j[o++]=j[z++]))}}else if(w&64){t.msg="invalid distance code",n.mode=ol;break t}else{V=S[(V&65535)+(y&(1<<w)-1)];continue r}break}}else if(w&64)if(w&32){n.mode=TS;break t}else{t.msg="invalid literal/length code",n.mode=ol;break t}else{V=N[(V&65535)+(y&(1<<w)-1)];continue e}break}}while(i<s&&o<l);Y=g>>3,i-=Y,g-=Y<<3,y&=(1<<g)-1,t.next_in=i,t.next_out=o,t.avail_in=i<s?5+(s-i):5-(i-s),t.avail_out=o<l?257+(l-o):257-(o-l),n.hold=y,n.bits=g}});var p_=Rt((MN,h_)=>{"use strict";var c_=Qr(),ws=15,l_=852,u_=592,f_=0,cd=1,d_=2,ES=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],OS=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],LS=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],FS=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];h_.exports=function(t,e,n,i,s,o,a,l){var c=l.bits,u=0,h=0,m=0,p=0,y=0,g=0,N=0,S=0,G=0,tt=0,V,w,Y,X,z,et=null,bt=0,j,Pe=new c_.Buf16(ws+1),Ko=new c_.Buf16(ws+1),Jo=null,Td=0,Ed,Xo,qo;for(u=0;u<=ws;u++)Pe[u]=0;for(h=0;h<i;h++)Pe[e[n+h]]++;for(y=c,p=ws;p>=1&&Pe[p]===0;p--);if(y>p&&(y=p),p===0)return s[o++]=1<<24|64<<16|0,s[o++]=1<<24|64<<16|0,l.bits=1,0;for(m=1;m<p&&Pe[m]===0;m++);for(y<m&&(y=m),S=1,u=1;u<=ws;u++)if(S<<=1,S-=Pe[u],S<0)return-1;if(S>0&&(t===f_||p!==1))return-1;for(Ko[1]=0,u=1;u<ws;u++)Ko[u+1]=Ko[u]+Pe[u];for(h=0;h<i;h++)e[n+h]!==0&&(a[Ko[e[n+h]]++]=h);if(t===f_?(et=Jo=a,j=19):t===cd?(et=ES,bt-=257,Jo=OS,Td-=257,j=256):(et=LS,Jo=FS,j=-1),tt=0,h=0,u=m,z=o,g=y,N=0,Y=-1,G=1<<y,X=G-1,t===cd&&G>l_||t===d_&&G>u_)return 1;for(;;){Ed=u-N,a[h]<j?(Xo=0,qo=a[h]):a[h]>j?(Xo=Jo[Td+a[h]],qo=et[bt+a[h]]):(Xo=32+64,qo=0),V=1<<u-N,w=1<<g,m=w;do w-=V,s[z+(tt>>N)+w]=Ed<<24|Xo<<16|qo|0;while(w!==0);for(V=1<<u-1;tt&V;)V>>=1;if(V!==0?(tt&=V-1,tt+=V):tt=0,h++,--Pe[u]===0){if(u===p)break;u=e[n+a[h]]}if(u>y&&(tt&X)!==Y){for(N===0&&(N=y),z+=m,g=u-N,S=1<<g;g+N<p&&(S-=Pe[g+N],!(S<=0));)g++,S<<=1;if(G+=1<<g,t===cd&&G>l_||t===d_&&G>u_)return 1;Y=tt&X,s[Y]=y<<24|g<<16|z-o|0}}return tt!==0&&(s[z+tt]=u-N<<24|64<<16|0),l.bits=y,0}});var K_=Rt(tr=>{"use strict";var De=Qr(),pd=Jf(),Rr=Xf(),NS=a_(),Uo=p_(),MS=0,V_=1,z_=2,m_=4,RS=5,al=6,yi=0,kS=1,CS=2,Ue=-2,j_=-3,md=-4,US=-5,y_=8,H_=1,__=2,g_=3,b_=4,w_=5,v_=6,S_=7,x_=8,I_=9,A_=10,ul=11,rn=12,ld=13,B_=14,ud=15,D_=16,T_=17,E_=18,O_=19,cl=20,ll=21,L_=22,F_=23,N_=24,M_=25,R_=26,fd=27,k_=28,C_=29,mt=30,yd=31,PS=32,VS=852,zS=592,jS=15,HS=jS;function U_(r){return(r>>>24&255)+(r>>>8&65280)+((r&65280)<<8)+((r&255)<<24)}function $S(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new De.Buf16(320),this.work=new De.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function $_(r){var t;return!r||!r.state?Ue:(t=r.state,r.total_in=r.total_out=t.total=0,r.msg="",t.wrap&&(r.adler=t.wrap&1),t.mode=H_,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new De.Buf32(VS),t.distcode=t.distdyn=new De.Buf32(zS),t.sane=1,t.back=-1,yi)}function Z_(r){var t;return!r||!r.state?Ue:(t=r.state,t.wsize=0,t.whave=0,t.wnext=0,$_(r))}function W_(r,t){var e,n;return!r||!r.state||(n=r.state,t<0?(e=0,t=-t):(e=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?Ue:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=e,n.wbits=t,Z_(r))}function G_(r,t){var e,n;return r?(n=new $S,r.state=n,n.window=null,e=W_(r,t),e!==yi&&(r.state=null),e):Ue}function ZS(r){return G_(r,HS)}var P_=!0,dd,hd;function WS(r){if(P_){var t;for(dd=new De.Buf32(512),hd=new De.Buf32(32),t=0;t<144;)r.lens[t++]=8;for(;t<256;)r.lens[t++]=9;for(;t<280;)r.lens[t++]=7;for(;t<288;)r.lens[t++]=8;for(Uo(V_,r.lens,0,288,dd,0,r.work,{bits:9}),t=0;t<32;)r.lens[t++]=5;Uo(z_,r.lens,0,32,hd,0,r.work,{bits:5}),P_=!1}r.lencode=dd,r.lenbits=9,r.distcode=hd,r.distbits=5}function Y_(r,t,e,n){var i,s=r.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new De.Buf8(s.wsize)),n>=s.wsize?(De.arraySet(s.window,t,e-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>n&&(i=n),De.arraySet(s.window,t,e-n,i,s.wnext),n-=i,n?(De.arraySet(s.window,t,e-n,n,0),s.wnext=n,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=i))),0}function GS(r,t){var e,n,i,s,o,a,l,c,u,h,m,p,y,g,N=0,S,G,tt,V,w,Y,X,z,et=new De.Buf8(4),bt,j,Pe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!r||!r.state||!r.output||!r.input&&r.avail_in!==0)return Ue;e=r.state,e.mode===rn&&(e.mode=ld),o=r.next_out,i=r.output,l=r.avail_out,s=r.next_in,n=r.input,a=r.avail_in,c=e.hold,u=e.bits,h=a,m=l,z=yi;t:for(;;)switch(e.mode){case H_:if(e.wrap===0){e.mode=ld;break}for(;u<16;){if(a===0)break t;a--,c+=n[s++]<<u,u+=8}if(e.wrap&2&&c===35615){e.check=0,et[0]=c&255,et[1]=c>>>8&255,e.check=Rr(e.check,et,2,0),c=0,u=0,e.mode=__;break}if(e.flags=0,e.head&&(e.head.done=!1),!(e.wrap&1)||(((c&255)<<8)+(c>>8))%31){r.msg="incorrect header check",e.mode=mt;break}if((c&15)!==y_){r.msg="unknown compression method",e.mode=mt;break}if(c>>>=4,u-=4,X=(c&15)+8,e.wbits===0)e.wbits=X;else if(X>e.wbits){r.msg="invalid window size",e.mode=mt;break}e.dmax=1<<X,r.adler=e.check=1,e.mode=c&512?A_:rn,c=0,u=0;break;case __:for(;u<16;){if(a===0)break t;a--,c+=n[s++]<<u,u+=8}if(e.flags=c,(e.flags&255)!==y_){r.msg="unknown compression method",e.mode=mt;break}if(e.flags&57344){r.msg="unknown header flags set",e.mode=mt;break}e.head&&(e.head.text=c>>8&1),e.flags&512&&(et[0]=c&255,et[1]=c>>>8&255,e.check=Rr(e.check,et,2,0)),c=0,u=0,e.mode=g_;case g_:for(;u<32;){if(a===0)break t;a--,c+=n[s++]<<u,u+=8}e.head&&(e.head.time=c),e.flags&512&&(et[0]=c&255,et[1]=c>>>8&255,et[2]=c>>>16&255,et[3]=c>>>24&255,e.check=Rr(e.check,et,4,0)),c=0,u=0,e.mode=b_;case b_:for(;u<16;){if(a===0)break t;a--,c+=n[s++]<<u,u+=8}e.head&&(e.head.xflags=c&255,e.head.os=c>>8),e.flags&512&&(et[0]=c&255,et[1]=c>>>8&255,e.check=Rr(e.check,et,2,0)),c=0,u=0,e.mode=w_;case w_:if(e.flags&1024){for(;u<16;){if(a===0)break t;a--,c+=n[s++]<<u,u+=8}e.length=c,e.head&&(e.head.extra_len=c),e.flags&512&&(et[0]=c&255,et[1]=c>>>8&255,e.check=Rr(e.check,et,2,0)),c=0,u=0}else e.head&&(e.head.extra=null);e.mode=v_;case v_:if(e.flags&1024&&(p=e.length,p>a&&(p=a),p&&(e.head&&(X=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Array(e.head.extra_len)),De.arraySet(e.head.extra,n,s,p,X)),e.flags&512&&(e.check=Rr(e.check,n,p,s)),a-=p,s+=p,e.length-=p),e.length))break t;e.length=0,e.mode=S_;case S_:if(e.flags&2048){if(a===0)break t;p=0;do X=n[s+p++],e.head&&X&&e.length<65536&&(e.head.name+=String.fromCharCode(X));while(X&&p<a);if(e.flags&512&&(e.check=Rr(e.check,n,p,s)),a-=p,s+=p,X)break t}else e.head&&(e.head.name=null);e.length=0,e.mode=x_;case x_:if(e.flags&4096){if(a===0)break t;p=0;do X=n[s+p++],e.head&&X&&e.length<65536&&(e.head.comment+=String.fromCharCode(X));while(X&&p<a);if(e.flags&512&&(e.check=Rr(e.check,n,p,s)),a-=p,s+=p,X)break t}else e.head&&(e.head.comment=null);e.mode=I_;case I_:if(e.flags&512){for(;u<16;){if(a===0)break t;a--,c+=n[s++]<<u,u+=8}if(c!==(e.check&65535)){r.msg="header crc mismatch",e.mode=mt;break}c=0,u=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),r.adler=e.check=0,e.mode=rn;break;case A_:for(;u<32;){if(a===0)break t;a--,c+=n[s++]<<u,u+=8}r.adler=e.check=U_(c),c=0,u=0,e.mode=ul;case ul:if(e.havedict===0)return r.next_out=o,r.avail_out=l,r.next_in=s,r.avail_in=a,e.hold=c,e.bits=u,CS;r.adler=e.check=1,e.mode=rn;case rn:if(t===RS||t===al)break t;case ld:if(e.last){c>>>=u&7,u-=u&7,e.mode=fd;break}for(;u<3;){if(a===0)break t;a--,c+=n[s++]<<u,u+=8}switch(e.last=c&1,c>>>=1,u-=1,c&3){case 0:e.mode=B_;break;case 1:if(WS(e),e.mode=cl,t===al){c>>>=2,u-=2;break t}break;case 2:e.mode=T_;break;case 3:r.msg="invalid block type",e.mode=mt}c>>>=2,u-=2;break;case B_:for(c>>>=u&7,u-=u&7;u<32;){if(a===0)break t;a--,c+=n[s++]<<u,u+=8}if((c&65535)!==(c>>>16^65535)){r.msg="invalid stored block lengths",e.mode=mt;break}if(e.length=c&65535,c=0,u=0,e.mode=ud,t===al)break t;case ud:e.mode=D_;case D_:if(p=e.length,p){if(p>a&&(p=a),p>l&&(p=l),p===0)break t;De.arraySet(i,n,s,p,o),a-=p,s+=p,l-=p,o+=p,e.length-=p;break}e.mode=rn;break;case T_:for(;u<14;){if(a===0)break t;a--,c+=n[s++]<<u,u+=8}if(e.nlen=(c&31)+257,c>>>=5,u-=5,e.ndist=(c&31)+1,c>>>=5,u-=5,e.ncode=(c&15)+4,c>>>=4,u-=4,e.nlen>286||e.ndist>30){r.msg="too many length or distance symbols",e.mode=mt;break}e.have=0,e.mode=E_;case E_:for(;e.have<e.ncode;){for(;u<3;){if(a===0)break t;a--,c+=n[s++]<<u,u+=8}e.lens[Pe[e.have++]]=c&7,c>>>=3,u-=3}for(;e.have<19;)e.lens[Pe[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,bt={bits:e.lenbits},z=Uo(MS,e.lens,0,19,e.lencode,0,e.work,bt),e.lenbits=bt.bits,z){r.msg="invalid code lengths set",e.mode=mt;break}e.have=0,e.mode=O_;case O_:for(;e.have<e.nlen+e.ndist;){for(;N=e.lencode[c&(1<<e.lenbits)-1],S=N>>>24,G=N>>>16&255,tt=N&65535,!(S<=u);){if(a===0)break t;a--,c+=n[s++]<<u,u+=8}if(tt<16)c>>>=S,u-=S,e.lens[e.have++]=tt;else{if(tt===16){for(j=S+2;u<j;){if(a===0)break t;a--,c+=n[s++]<<u,u+=8}if(c>>>=S,u-=S,e.have===0){r.msg="invalid bit length repeat",e.mode=mt;break}X=e.lens[e.have-1],p=3+(c&3),c>>>=2,u-=2}else if(tt===17){for(j=S+3;u<j;){if(a===0)break t;a--,c+=n[s++]<<u,u+=8}c>>>=S,u-=S,X=0,p=3+(c&7),c>>>=3,u-=3}else{for(j=S+7;u<j;){if(a===0)break t;a--,c+=n[s++]<<u,u+=8}c>>>=S,u-=S,X=0,p=11+(c&127),c>>>=7,u-=7}if(e.have+p>e.nlen+e.ndist){r.msg="invalid bit length repeat",e.mode=mt;break}for(;p--;)e.lens[e.have++]=X}}if(e.mode===mt)break;if(e.lens[256]===0){r.msg="invalid code -- missing end-of-block",e.mode=mt;break}if(e.lenbits=9,bt={bits:e.lenbits},z=Uo(V_,e.lens,0,e.nlen,e.lencode,0,e.work,bt),e.lenbits=bt.bits,z){r.msg="invalid literal/lengths set",e.mode=mt;break}if(e.distbits=6,e.distcode=e.distdyn,bt={bits:e.distbits},z=Uo(z_,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,bt),e.distbits=bt.bits,z){r.msg="invalid distances set",e.mode=mt;break}if(e.mode=cl,t===al)break t;case cl:e.mode=ll;case ll:if(a>=6&&l>=258){r.next_out=o,r.avail_out=l,r.next_in=s,r.avail_in=a,e.hold=c,e.bits=u,NS(r,m),o=r.next_out,i=r.output,l=r.avail_out,s=r.next_in,n=r.input,a=r.avail_in,c=e.hold,u=e.bits,e.mode===rn&&(e.back=-1);break}for(e.back=0;N=e.lencode[c&(1<<e.lenbits)-1],S=N>>>24,G=N>>>16&255,tt=N&65535,!(S<=u);){if(a===0)break t;a--,c+=n[s++]<<u,u+=8}if(G&&!(G&240)){for(V=S,w=G,Y=tt;N=e.lencode[Y+((c&(1<<V+w)-1)>>V)],S=N>>>24,G=N>>>16&255,tt=N&65535,!(V+S<=u);){if(a===0)break t;a--,c+=n[s++]<<u,u+=8}c>>>=V,u-=V,e.back+=V}if(c>>>=S,u-=S,e.back+=S,e.length=tt,G===0){e.mode=R_;break}if(G&32){e.back=-1,e.mode=rn;break}if(G&64){r.msg="invalid literal/length code",e.mode=mt;break}e.extra=G&15,e.mode=L_;case L_:if(e.extra){for(j=e.extra;u<j;){if(a===0)break t;a--,c+=n[s++]<<u,u+=8}e.length+=c&(1<<e.extra)-1,c>>>=e.extra,u-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=F_;case F_:for(;N=e.distcode[c&(1<<e.distbits)-1],S=N>>>24,G=N>>>16&255,tt=N&65535,!(S<=u);){if(a===0)break t;a--,c+=n[s++]<<u,u+=8}if(!(G&240)){for(V=S,w=G,Y=tt;N=e.distcode[Y+((c&(1<<V+w)-1)>>V)],S=N>>>24,G=N>>>16&255,tt=N&65535,!(V+S<=u);){if(a===0)break t;a--,c+=n[s++]<<u,u+=8}c>>>=V,u-=V,e.back+=V}if(c>>>=S,u-=S,e.back+=S,G&64){r.msg="invalid distance code",e.mode=mt;break}e.offset=tt,e.extra=G&15,e.mode=N_;case N_:if(e.extra){for(j=e.extra;u<j;){if(a===0)break t;a--,c+=n[s++]<<u,u+=8}e.offset+=c&(1<<e.extra)-1,c>>>=e.extra,u-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){r.msg="invalid distance too far back",e.mode=mt;break}e.mode=M_;case M_:if(l===0)break t;if(p=m-l,e.offset>p){if(p=e.offset-p,p>e.whave&&e.sane){r.msg="invalid distance too far back",e.mode=mt;break}p>e.wnext?(p-=e.wnext,y=e.wsize-p):y=e.wnext-p,p>e.length&&(p=e.length),g=e.window}else g=i,y=o-e.offset,p=e.length;p>l&&(p=l),l-=p,e.length-=p;do i[o++]=g[y++];while(--p);e.length===0&&(e.mode=ll);break;case R_:if(l===0)break t;i[o++]=e.length,l--,e.mode=ll;break;case fd:if(e.wrap){for(;u<32;){if(a===0)break t;a--,c|=n[s++]<<u,u+=8}if(m-=l,r.total_out+=m,e.total+=m,m&&(r.adler=e.check=e.flags?Rr(e.check,i,m,o-m):pd(e.check,i,m,o-m)),m=l,(e.flags?c:U_(c))!==e.check){r.msg="incorrect data check",e.mode=mt;break}c=0,u=0}e.mode=k_;case k_:if(e.wrap&&e.flags){for(;u<32;){if(a===0)break t;a--,c+=n[s++]<<u,u+=8}if(c!==(e.total&4294967295)){r.msg="incorrect length check",e.mode=mt;break}c=0,u=0}e.mode=C_;case C_:z=kS;break t;case mt:z=j_;break t;case yd:return md;case PS:default:return Ue}return r.next_out=o,r.avail_out=l,r.next_in=s,r.avail_in=a,e.hold=c,e.bits=u,(e.wsize||m!==r.avail_out&&e.mode<mt&&(e.mode<fd||t!==m_))&&Y_(r,r.output,r.next_out,m-r.avail_out)?(e.mode=yd,md):(h-=r.avail_in,m-=r.avail_out,r.total_in+=h,r.total_out+=m,e.total+=m,e.wrap&&m&&(r.adler=e.check=e.flags?Rr(e.check,i,m,r.next_out-m):pd(e.check,i,m,r.next_out-m)),r.data_type=e.bits+(e.last?64:0)+(e.mode===rn?128:0)+(e.mode===cl||e.mode===ud?256:0),(h===0&&m===0||t===m_)&&z===yi&&(z=US),z)}function YS(r){if(!r||!r.state)return Ue;var t=r.state;return t.window&&(t.window=null),r.state=null,yi}function KS(r,t){var e;return!r||!r.state||(e=r.state,!(e.wrap&2))?Ue:(e.head=t,t.done=!1,yi)}function JS(r,t){var e=t.length,n,i,s;return!r||!r.state||(n=r.state,n.wrap!==0&&n.mode!==ul)?Ue:n.mode===ul&&(i=1,i=pd(i,t,e,0),i!==n.check)?j_:(s=Y_(r,t,e,e),s?(n.mode=yd,md):(n.havedict=1,yi))}tr.inflateReset=Z_;tr.inflateReset2=W_;tr.inflateResetKeep=$_;tr.inflateInit=ZS;tr.inflateInit2=G_;tr.inflate=GS;tr.inflateEnd=YS;tr.inflateGetHeader=KS;tr.inflateSetDictionary=JS;tr.inflateInfo="pako inflate (from Nodeca project)"});var _d=Rt((kN,J_)=>{"use strict";J_.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var q_=Rt((CN,X_)=>{"use strict";function XS(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}X_.exports=XS});var tg=Rt(Vo=>{"use strict";var vs=K_(),Po=Qr(),fl=rd(),xt=_d(),gd=qc(),qS=nd(),QS=q_(),Q_=Object.prototype.toString;function _i(r){if(!(this instanceof _i))return new _i(r);this.options=Po.assign({chunkSize:16384,windowBits:0,to:""},r||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(r&&r.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new qS,this.strm.avail_out=0;var e=vs.inflateInit2(this.strm,t.windowBits);if(e!==xt.Z_OK)throw new Error(gd[e]);if(this.header=new QS,vs.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=fl.string2buf(t.dictionary):Q_.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(e=vs.inflateSetDictionary(this.strm,t.dictionary),e!==xt.Z_OK)))throw new Error(gd[e])}_i.prototype.push=function(r,t){var e=this.strm,n=this.options.chunkSize,i=this.options.dictionary,s,o,a,l,c,u=!1;if(this.ended)return!1;o=t===~~t?t:t===!0?xt.Z_FINISH:xt.Z_NO_FLUSH,typeof r=="string"?e.input=fl.binstring2buf(r):Q_.call(r)==="[object ArrayBuffer]"?e.input=new Uint8Array(r):e.input=r,e.next_in=0,e.avail_in=e.input.length;do{if(e.avail_out===0&&(e.output=new Po.Buf8(n),e.next_out=0,e.avail_out=n),s=vs.inflate(e,xt.Z_NO_FLUSH),s===xt.Z_NEED_DICT&&i&&(s=vs.inflateSetDictionary(this.strm,i)),s===xt.Z_BUF_ERROR&&u===!0&&(s=xt.Z_OK,u=!1),s!==xt.Z_STREAM_END&&s!==xt.Z_OK)return this.onEnd(s),this.ended=!0,!1;e.next_out&&(e.avail_out===0||s===xt.Z_STREAM_END||e.avail_in===0&&(o===xt.Z_FINISH||o===xt.Z_SYNC_FLUSH))&&(this.options.to==="string"?(a=fl.utf8border(e.output,e.next_out),l=e.next_out-a,c=fl.buf2string(e.output,a),e.next_out=l,e.avail_out=n-l,l&&Po.arraySet(e.output,e.output,a,l,0),this.onData(c)):this.onData(Po.shrinkBuf(e.output,e.next_out))),e.avail_in===0&&e.avail_out===0&&(u=!0)}while((e.avail_in>0||e.avail_out===0)&&s!==xt.Z_STREAM_END);return s===xt.Z_STREAM_END&&(o=xt.Z_FINISH),o===xt.Z_FINISH?(s=vs.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===xt.Z_OK):(o===xt.Z_SYNC_FLUSH&&(this.onEnd(xt.Z_OK),e.avail_out=0),!0)};_i.prototype.onData=function(r){this.chunks.push(r)};_i.prototype.onEnd=function(r){r===xt.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Po.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function bd(r,t){var e=new _i(t);if(e.push(r,!0),e.err)throw e.msg||gd[e.err];return e.result}function tx(r,t){return t=t||{},t.raw=!0,bd(r,t)}Vo.Inflate=_i;Vo.inflate=bd;Vo.inflateRaw=tx;Vo.ungzip=bd});var ng=Rt((PN,rg)=>{"use strict";var ex=Qr().assign,rx=s_(),nx=tg(),ix=_d(),eg={};ex(eg,rx,nx,ix);rg.exports=eg});var ig=Rt(()=>{});var gi,nn,Ss,sg=d(()=>{"use strict";Pf();Io();gi=Sl(ng(),1),nn=Sl(ig(),1),Ss=class extends fs{name="deflate";extensions=[];contentEncodings=["deflate"];isSupported=!0;options;_chunks=[];constructor(t={}){super(t),this.options=t}async compress(t){if(!is&&this.options.deflate?.useZlib){let e=this.options.deflate?.gzip?await ls(nn.default.gzip)(t):await ls(nn.default.deflate)(t);return yn(e)}return this.compressSync(t)}async decompress(t){if(!is&&this.options.deflate?.useZlib){let e=this.options.deflate?.gzip?await ls(nn.default.gunzip)(t):await ls(nn.default.inflate)(t);return yn(e)}return this.decompressSync(t)}compressSync(t){if(!is&&this.options.deflate?.useZlib){let s=this.options.deflate?.gzip?nn.default.gzipSync(t):nn.default.deflateSync(t);return yn(s)}let e=this.options?.deflate||{},n=new Uint8Array(t),i=this.options?.raw?gi.default.deflateRaw:gi.default.deflate;return yn(i(n,e).buffer)}decompressSync(t){if(!is&&this.options.deflate?.useZlib){let s=this.options.deflate?.gzip?nn.default.gunzipSync(t):nn.default.inflateSync(t);return yn(s)}let e=this.options?.deflate||{},n=new Uint8Array(t),i=this.options?.raw?gi.default.inflateRaw:gi.default.inflate;return yn(i(n,e).buffer)}async*compressBatches(t){let e=this.options?.deflate||{},n=new gi.default.Deflate(e);yield*this.transformBatches(n,t)}async*decompressBatches(t){let e=this.options?.deflate||{},n=new gi.default.Inflate(e);yield*this.transformBatches(n,t)}async*transformBatches(t,e){t.onData=this._onData.bind(this),t.onEnd=this._onEnd.bind(this);for await(let o of e){let a=new Uint8Array(o);if(!t.push(a,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}let n=new Uint8Array(0),i=t.push(n,!0);yield*this._getChunks()}_onData(t){this._chunks.push(t)}_onEnd(t){if(t!==0)throw new Error(this._getError(t)+this._chunks.length)}_getChunks(){let t=this._chunks;return this._chunks=[],t}_getError(t=0){let e={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};return`${this.name}: ${e[t]}`}}});var og,dl,hl,zo,ag=d(()=>{"use strict";Pf();Io();og=1e6,zo=class extends fs{name="zstd";extensions=[];contentEncodings=[];isSupported=!0;options;constructor(t){super(t),this.options=t,cs(t?.modules)}async preload(t={}){cs(t),Nf("zstd-codec",this.name);let e=Mf("zstd-codec");!dl&&e&&(dl=new Promise(n=>e.run(i=>n(i)))),dl&&(hl=await dl)}compressSync(t){Yc("zstd-codec",this.name);let e=new hl.Simple,n=new Uint8Array(t);return e.compress(n).buffer}decompressSync(t){Yc("zstd-codec",this.name);let e=new hl.Simple,n=new Uint8Array(t);return e.decompress(n).buffer}async decompress(t,e){await this.preload();let n=new hl.Streaming,i=new Uint8Array(t),s=[];for(let a=0;a<=i.length;a+=og){let l=i.subarray(a,a+og),c=Cf(l);s.push(new Uint8Array(c))}return(await n.decompressChunks(s)).buffer}}});var wd=d(()=>{"use strict";sg();ag()});async function fg(r,t){return Er(await lx(r,t))}async function lx(r,t){let e=ux(r),n=fx(r,e,dx(e)),i=n.map(a=>r.slice(a.compressedOffset,a.compressedOffset+a.compressedSize)),s=new zo({modules:t?.modules}),o=await Promise.all(i.map((a,l)=>s.decompress(a,n[l].uncompressedSize)));return hx(o,n),px(e,o,r)}function ux(r){if(r.byteLength<jo)throw new Error(`SPZLoader: file must contain a ${jo}-byte header.`);let t=new DataView(r),e={magic:t.getUint32(0,!0),version:t.getUint32(4,!0),numPoints:t.getUint32(8,!0),shDegree:t.getUint8(12),fractionalBits:t.getUint8(13),flags:t.getUint8(14),numStreams:t.getUint8(15),tocByteOffset:t.getUint32(16,!0)};if(e.magic!==sx)throw new Error("SPZLoader: NGSP magic header not found.");if(e.version!==ox)throw new Error(`SPZLoader: version ${e.version} is not supported.`);if(e.shDegree>4)throw new Error(`SPZLoader: spherical harmonics degree ${e.shDegree} is not supported.`);if(e.tocByteOffset<jo||e.tocByteOffset>r.byteLength)throw new Error("SPZLoader: invalid table of contents byte offset.");return e}function fx(r,t,e){if(t.numStreams!==e.length)throw new Error(`SPZLoader: expected ${e.length} streams, found ${t.numStreams}.`);let n=t.numStreams*16,i=t.tocByteOffset+n;if(i>r.byteLength)throw new Error("SPZLoader: table of contents exceeds file byte length.");let s=new DataView(r),o=i,a=[];for(let l=0;l<t.numStreams;l++){let c=t.tocByteOffset+l*16,u=lg(s,c),h=lg(s,c+8),m=e[l];if(h!==m)throw new Error(`SPZLoader: stream ${l} has ${h} uncompressed bytes, expected ${m}.`);if(o+u>r.byteLength)throw new Error(`SPZLoader: stream ${l} exceeds file byte length.`);a.push({compressedSize:u,uncompressedSize:h,compressedOffset:o}),o+=u}if(o!==r.byteLength)throw new Error("SPZLoader: compressed stream byte lengths do not match file byte length.");return a}function lg(r,t){let e=r.getBigUint64(t,!0);if(e>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("SPZLoader: stream byte length exceeds Number.MAX_SAFE_INTEGER.");return Number(e)}function dx(r){return[r.numPoints*9,r.numPoints,r.numPoints*3,r.numPoints*3,r.numPoints*4,r.numPoints*dg(r.shDegree)].filter(t=>t>0)}function hx(r,t){for(let e=0;e<r.length;e++)if(r[e].byteLength!==t[e].uncompressedSize)throw new Error(`SPZLoader: decompressed stream ${e} has unexpected byte length.`)}function px(r,t,e){let n=r.numPoints,i=new Float32Array(n*3),s=new Float32Array(n*3),o=new Float32Array(n*4),a=new Uint8Array(n*3),l=new Float32Array(n*3),c=new Float32Array(n),u=dg(r.shDegree),h=u?new Float32Array(n*u):void 0,[m,p,y,g,N,S]=t.map(G=>new Uint8Array(G));return mx(m,i,r.fractionalBits),yx(g,s),_x(N,o),bx(y,a,l),wx(p,c),h&&S&&vx(S,h),{format:"spz",splatCount:n,positions:i,scales:s,rotations:o,colors:a,sphericalHarmonicDcs:l,opacities:c,sphericalHarmonics:h,sphericalHarmonicsComponentCount:u,loaderData:{format:"spz",...r,antialiased:Boolean(r.flags&1),extensionByteLength:hg(r),extensionBytes:xx(e,r)}}}function mx(r,t,e){let n=1/2**e;for(let i=0;i<t.length;i++){let s=i*3,o=r[s]|r[s+1]<<8|r[s+2]<<16;o|=o&8388608?4278190080:0,t[i]=o*n}}function yx(r,t){for(let e=0;e<t.length;e++)t[e]=Math.exp(r[e]/16-10)}function _x(r,t){for(let e=0;e<t.length/4;e++){let n=e*4,i=r[n]|r[n+1]<<8|r[n+2]<<16|r[n+3]<<24,s=gx(i>>>0),[o,a,l,c]=Xr(s[3],s[0],s[1],s[2]),u=e*4;t[u+0]=o,t[u+1]=a,t[u+2]=l,t[u+3]=c}}function gx(r){let t=[0,0,0,0],e=r>>>30,n=r,i=0;for(let s=3;s>=0;s--)if(s!==e){let o=n&cg,a=n>>>9&1;n>>>=10;let l=cx*o/cg;a&&(l=-l),t[s]=l,i+=l*l}return t[e]=Math.sqrt(Math.max(0,1-i)),t}function bx(r,t,e){for(let n=0;n<t.length;n++)e[n]=(r[n]/255-.5)/ug,t[n]=Sx(e[n])}function wx(r,t){for(let e=0;e<t.length;e++)t[e]=r[e]/255}function vx(r,t){for(let e=0;e<t.length;e++)t[e]=(r[e]-128)/128}function Sx(r){return Math.min(Math.max(Math.round((r*ug+.5)*255),0),255)}function dg(r){switch(r){case 0:return 0;case 1:return 9;case 2:return 24;case 3:return 45;case 4:return 72;default:throw new Error(`SPZLoader: spherical harmonics degree ${r} is not supported.`)}}function hg(r){return r.flags&ax?r.tocByteOffset-jo:0}function xx(r,t){return hg(t)?new Uint8Array(r.slice(jo,t.tocByteOffset)):void 0}var jo,sx,ox,ax,ug,cx,cg,pg=d(()=>{"use strict";wd();rs();ts();jo=32,sx=1347635022,ox=4,ax=2,ug=.15,cx=Math.SQRT1_2,cg=(1<<9)-1});var mg={};ye(mg,{SPZLoaderWithParser:()=>Ax});var nM,Ix,Ax,yg=d(()=>{"use strict";pg();vd();({preload:nM,...Ix}=pl),Ax={...Ix,parse:async(r,t)=>fg(r,t)}});async function Dx(){let{SPZLoaderWithParser:r}=await Promise.resolve().then(()=>(yg(),mg));return r}var Bx,pl,vd=d(()=>{"use strict";xn();Bx="5.0.0-alpha.1";pl={dataType:null,batchType:null,...na,version:Bx,options:{splats:{shape:"arrow-table"}},preload:Dx}});function Ho(r){let t=xs(r);if(!t)throw new Error("RADLoader: file must contain a complete RAD metadata header.");return t}function xs(r){let t=wg(r);if(t.byteLength<8)return null;let e=new DataView(t.buffer,t.byteOffset,t.byteLength),n=e.getUint32(0,!0);if(n!==809779538)throw new Error(`RADLoader: RAD0 magic header not found, received 0x${n.toString(16)}.`);let i=e.getUint32(4,!0),s=8+i;if(t.byteLength<s)return null;let o=gg(t.subarray(8,s),"RADLoader: failed to parse RAD metadata JSON.");return Ex(o,i)}function Is(r){let t=wg(r);if(t.byteLength<8)throw new Error("RADLoader: RADC chunk must contain an 8-byte metadata header.");let e=new DataView(t.buffer,t.byteOffset,t.byteLength),n=e.getUint32(0,!0);if(n!==1128546642)throw new Error(`RADLoader: RADC magic header not found, received 0x${n.toString(16)}.`);let i=e.getUint32(4,!0),s=8+i,o=8+yl(i),a=o+8;if(t.byteLength<a)throw new Error("RADLoader: RADC chunk must contain a complete metadata header.");let l=gg(t.subarray(8,s),"RADLoader: failed to parse RADC metadata JSON."),c=Nx(e,o,"RADC payload byte length");return Lx(l,i,a,c)}function yl(r){return r+7&-8}function Ex(r,t){let e=er(r.version,"RAD version");if(e!==1)throw new Error(`RADLoader: version ${e} is not supported.`);let n=ml(r.type,"RAD type");if(n!=="gsplat")throw new Error(`RADLoader: RAD type ${n} is not supported.`);let i=bg(r.chunks,"RAD chunks").map((o,a)=>Ox(o,a));return{version:e,type:n,count:er(r.count,"RAD count"),maxSh:bi(r.maxSh,"RAD maxSh"),lodTree:xd(r.lodTree,"RAD lodTree"),chunkSize:bi(r.chunkSize,"RAD chunkSize"),allChunkBytes:bi(r.allChunkBytes,"RAD allChunkBytes"),chunks:i,splatEncoding:_g(r.splatEncoding,"RAD splatEncoding"),shCodeCount:bi(r.shCodeCount,"RAD shCodeCount"),comment:Sd(r.comment,"RAD comment"),headerJsonByteLength:t,chunksByteOffset:8+yl(t)}}function Ox(r,t){let e=_l(r,`RAD chunk ${t}`);return{offset:er(e.offset,`RAD chunk ${t} offset`),bytes:er(e.bytes,`RAD chunk ${t} bytes`),base:bi(e.base,`RAD chunk ${t} base`),count:bi(e.count,`RAD chunk ${t} count`),filename:Sd(e.filename,`RAD chunk ${t} filename`)}}function Lx(r,t,e,n){let i=er(r.version,"RADC version");if(i!==1)throw new Error(`RADLoader: RADC version ${i} is not supported.`);if(er(r.payloadBytes,"RADC payloadBytes")!==n)throw new Error("RADLoader: RADC metadata payload byte length does not match binary header.");return{version:i,base:er(r.base,"RADC base"),count:er(r.count,"RADC count"),payloadBytes:n,maxSh:bi(r.maxSh,"RADC maxSh"),lodTree:xd(r.lodTree,"RADC lodTree"),splatEncoding:_g(r.splatEncoding,"RADC splatEncoding"),properties:bg(r.properties,"RADC properties").map((o,a)=>Fx(o,a)),headerJsonByteLength:t,payloadByteOffset:e,chunkByteLength:e+n}}function Fx(r,t){let e=_l(r,`RADC property ${t}`);return{offset:er(e.offset,`RADC property ${t} offset`),bytes:er(e.bytes,`RADC property ${t} bytes`),property:ml(e.property,`RADC property ${t} name`),encoding:ml(e.encoding,`RADC property ${t} encoding`),compression:Sd(e.compression,`RADC property ${t} compression`),min:sn(e.min,`RADC property ${t} min`),max:sn(e.max,`RADC property ${t} max`)}}function _g(r,t){if(r===void 0)return;let e=_l(r,t);return{rgbMin:sn(e.rgbMin,`${t}.rgbMin`),rgbMax:sn(e.rgbMax,`${t}.rgbMax`),lnScaleMin:sn(e.lnScaleMin,`${t}.lnScaleMin`),lnScaleMax:sn(e.lnScaleMax,`${t}.lnScaleMax`),sh1Max:sn(e.sh1Max,`${t}.sh1Max`),sh2Max:sn(e.sh2Max,`${t}.sh2Max`),sh3Max:sn(e.sh3Max,`${t}.sh3Max`),lodOpacity:xd(e.lodOpacity,`${t}.lodOpacity`)}}function gg(r,t){try{return _l(JSON.parse(Tx.decode(r)),t)}catch(e){throw e instanceof Error&&e.message.startsWith("RADLoader:")?e:new Error(t)}}function _l(r,t){if(!r||typeof r!="object"||Array.isArray(r))throw new Error(`RADLoader: ${t} must be an object.`);return r}function bg(r,t){if(!Array.isArray(r))throw new Error(`RADLoader: ${t} must be an array.`);return r}function ml(r,t){if(typeof r!="string")throw new Error(`RADLoader: ${t} must be a string.`);return r}function Sd(r,t){if(r!==void 0)return ml(r,t)}function xd(r,t){if(r!==void 0){if(typeof r!="boolean")throw new Error(`RADLoader: ${t} must be a boolean.`);return r}}function er(r,t){if(!Number.isSafeInteger(r)||Number(r)<0)throw new Error(`RADLoader: ${t} must be a non-negative safe integer.`);return Number(r)}function bi(r,t){if(r!==void 0)return er(r,t)}function sn(r,t){if(r!==void 0){if(typeof r!="number"||!Number.isFinite(r))throw new Error(`RADLoader: ${t} must be a finite number.`);return r}}function Nx(r,t,e){let n=r.getBigUint64(t,!0);if(n>BigInt(Number.MAX_SAFE_INTEGER))throw new Error(`RADLoader: ${e} exceeds Number.MAX_SAFE_INTEGER.`);return Number(n)}function wg(r){return r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}var Tx,$o=d(()=>{"use strict";Tx=new TextDecoder});function gl(r,t){return Er(Wo(r,t))}function Wo(r,t){let e=f1(r),n=o1(Is(e),t);if(e.byteLength<n.chunkByteLength)throw new Error("RADLoader: RADC chunk payload is incomplete.");let i=n.count,s=As(e,n,s1(n,"center"),3),o=kx(e,n,i),a=Ux(e,n,i),l=Px(e,n,i),c=Vx(e,n,i),{colors:u,sphericalHarmonicDcs:h}=e1(a),m=t?.radChunk?.includeLoDTree??!0,p=m?jx(e,n,"child_count"):null,y=m?Hx(e,n,"child_start"):null,N=t?.radChunk?.includeSphericalHarmonics??!1?zx(e,n):null;return{format:"rad",splatCount:i,positions:s,scales:l,rotations:c,colors:u,sphericalHarmonicDcs:h,opacities:o,sphericalHarmonics:N?.values,sphericalHarmonicsComponentCount:N?.componentCount,loaderData:{format:"rad",base:n.base,count:n.count,maxSh:n.maxSh??0,lodTree:n.lodTree??!1,splatEncoding:n.splatEncoding,childCounts:p??void 0,childStarts:y??void 0}}}function kx(r,t,e){let n=kr(t,"alpha");if(!n)return new Float32Array(e).fill(1);let i=As(r,t,n,1);for(let s=0;s<i.length;s++)i[s]=Cx(i[s],t,n);return i}function Cx(r,t,e){let n=Math.max(r,0);return!t.splatEncoding?.lodOpacity||e.encoding!=="r8"&&e.encoding!=="r8_delta"?n:n*2}function Ux(r,t,e){let n=kr(t,"rgb");return n?As(r,t,n,3):new Float32Array(e*3).fill(1)}function Px(r,t,e){let n=kr(t,"scales");return n?As(r,t,n,3):new Float32Array(e*3).fill(1)}function Vx(r,t,e){let n=kr(t,"orientation");if(!n)return r1(e);let i=bl(r,t,n);switch(n.encoding){case"oct88r8":return t1(i,e);case"f32":case"f16":{let s=As(r,t,n,3),o=new Float32Array(e*4);for(let a=0;a<e;a++){let l=a*3,c=a*4,u=s[l+0],h=s[l+1],m=s[l+2],p=Math.sqrt(Math.max(0,1-u*u-h*h-m*m)),y=Xr(p,u,h,m);o.set(y,c)}return o}default:throw new Error(`RADLoader: unsupported orientation encoding ${n.encoding}.`)}}function zx(r,t){let e=[{property:kr(t,"sh1"),dimensions:9},{property:kr(t,"sh2"),dimensions:15},{property:kr(t,"sh3"),dimensions:21}].filter(o=>o.property!==void 0);if(e.length===0)return null;let n=e.map(o=>({values:As(r,t,o.property,o.dimensions),dimensions:o.dimensions})),i=n.reduce((o,a)=>o+a.dimensions,0),s=new Float32Array(t.count*i);for(let o=0;o<t.count;o++){let a=o*i;for(let l of n){let c=o*l.dimensions;s.set(l.values.subarray(c,c+l.dimensions),a),a+=l.dimensions}}return{values:s,componentCount:i}}function As(r,t,e,n){let i=bl(r,t,e);switch(e.encoding){case"f32":return Zx(i,n,t.count);case"f16":return vg(i,n,t.count);case"f32_lebytes":return Wx(i,n,t.count);case"f16_lebytes":return Gx(i,n,t.count);case"r8":return Yx(i,n,t.count,Id(t,e),Zo(t,e));case"r8_delta":return Kx(i,n,t.count,Id(t,e),Zo(t,e));case"s8":return Jx(i,n,t.count,Zo(t,e));case"s8_delta":return Xx(i,n,t.count,Zo(t,e));case"ln_0r8":return qx(i,n,t.count,Id(t,e),Zo(t,e));case"ln_f16":return Qx(i,n,t.count);default:throw new Error(`RADLoader: unsupported ${e.property} encoding ${e.encoding}.`)}}function jx(r,t,e){let n=kr(t,e);if(!n)return null;if(n.encoding!=="u16")throw new Error(`RADLoader: unsupported ${e} encoding ${n.encoding}.`);let i=bl(r,t,n),s=new Uint16Array(t.count);for(let o=0;o<t.count;o++)s[o]=i[o*2]|i[o*2+1]<<8;return s}function Hx(r,t,e){let n=kr(t,e);if(!n)return null;if(n.encoding!=="u32")throw new Error(`RADLoader: unsupported ${e} encoding ${n.encoding}.`);let i=bl(r,t,n),s=new DataView(i.buffer,i.byteOffset,i.byteLength),o=new Uint32Array(t.count);for(let a=0;a<t.count;a++)o[a]=s.getUint32(a*4,!0);return o}function bl(r,t,e){let n=yl(e.bytes),i=t.payloadByteOffset+e.offset;if(i+n>r.byteLength||e.offset+n>t.payloadBytes)throw new Error(`RADLoader: property ${e.property} exceeds RADC payload byte length.`);let o=r.subarray(i,i+e.bytes);if(!e.compression)return o;if(e.compression!=="gz")throw new Error(`RADLoader: unsupported property compression ${e.compression}.`);return $x(o,e.property)}function $x(r,t){let e=u1(r);try{return new Uint8Array(Mx.decompressSync(e))}catch{try{return new Uint8Array(Rx.decompressSync(e))}catch{throw new Error(`RADLoader: failed to decompress RADC property ${t}.`)}}}function Zx(r,t,e){let n=new DataView(r.buffer,r.byteOffset,r.byteLength),i=new Float32Array(e*t);for(let s=0;s<e;s++)for(let o=0;o<t;o++)i[s*t+o]=n.getFloat32((o*e+s)*4,!0);return i}function vg(r,t,e){let n=new Float32Array(e*t);for(let i=0;i<e;i++)for(let s=0;s<t;s++){let o=(s*e+i)*2;n[i*t+s]=So(r[o]|r[o+1]<<8)}return n}function Wx(r,t,e){let n=new Float32Array(e*t),i=e*t,s=new Uint8Array(4),o=new DataView(s.buffer);for(let a=0;a<e;a++)for(let l=0;l<t;l++){let c=l*e+a;for(let u=0;u<4;u++)s[u]=r[c+i*u];n[a*t+l]=o.getFloat32(0,!0)}return n}function Gx(r,t,e){let n=new Float32Array(e*t),i=e*t;for(let s=0;s<e;s++)for(let o=0;o<t;o++){let a=o*e+s;n[s*t+o]=So(r[a]|r[a+i]<<8)}return n}function Yx(r,t,e,n,i){let s=new Float32Array(e*t),o=i-n;for(let a=0;a<e;a++)for(let l=0;l<t;l++)s[a*t+l]=r[l*e+a]/255*o+n;return s}function Kx(r,t,e,n,i){let s=new Float32Array(e*t),o=i-n,a=new Uint8Array(t);for(let l=0;l<e;l++)for(let c=0;c<t;c++){let u=c*e+l,h=a[c]+r[u]&255;a[c]=h,s[l*t+c]=h/255*o+n}return s}function Jx(r,t,e,n){let i=new Float32Array(e*t);for(let s=0;s<e;s++)for(let o=0;o<t;o++){let a=r[o*e+s];i[s*t+o]=(a<<24>>24)/127*n}return i}function Xx(r,t,e,n){let i=new Float32Array(e*t),s=new Uint8Array(t);for(let o=0;o<e;o++)for(let a=0;a<t;a++){let l=a*e+o,c=s[a]+r[l]&255;s[a]=c,i[o*t+a]=(c<<24>>24)/127*n}return i}function qx(r,t,e,n,i){let s=new Float32Array(e*t);for(let o=0;o<e;o++)for(let a=0;a<t;a++)s[o*t+a]=n1(r[a*e+o],n,i);return s}function Qx(r,t,e){let n=vg(r,t,e);for(let i=0;i<n.length;i++)n[i]=Math.exp(n[i]);return n}function t1(r,t){let e=new Float32Array(t*4);for(let n=0;n<t;n++){let i=n*3,[s,o,a,l]=i1(r[i],r[i+1],r[i+2]);e.set(Xr(l,s,o,a),n*4)}return e}function e1(r){let t=new Uint8Array(r.length),e=new Float32Array(r.length);for(let n=0;n<r.length;n++){let i=r[n];t[n]=l1(i),e[n]=(i-.5)/_f}return{colors:t,sphericalHarmonicDcs:e}}function r1(r){let t=new Float32Array(r*4);for(let e=0;e<r;e++)t[e*4]=1;return t}function n1(r,t,e){if(r===0)return 0;let n=(e-t)/254;return Math.exp(t+(r-1)*n)}function i1(r,t,e){let n=r/255*2-1,i=t/255*2-1,s=1-Math.abs(n)-Math.abs(i),o=Math.max(-s,0);n=n>=0?n-o:n+o,i=i>=0?i-o:i+o;let a=Math.hypot(n,i,s),l=a>Number.EPSILON?n/a:1,c=a>Number.EPSILON?i/a:0,u=a>Number.EPSILON?s/a:0,h=e/255*.5*Math.PI,m=Math.sin(h);return[l*m,c*m,u*m,Math.cos(h)]}function s1(r,t){let e=kr(r,t);if(!e)throw new Error(`RADLoader: RADC chunk is missing ${t} property.`);return e}function kr(r,t){return r.properties.find(e=>e.property===t)}function o1(r,t){let e=t?.radChunk?.splatEncoding;return e?{...r,splatEncoding:{...e,...r.splatEncoding}}:r}function Id(r,t){if(t.min===void 0){let e=a1(r.splatEncoding,t.property);if(e!==void 0)return e;throw new Error(`RADLoader: RADC property ${t.property} is missing min.`)}return t.min}function Zo(r,t){if(t.max===void 0){let e=c1(r.splatEncoding,t.property);if(e!==void 0)return e;throw new Error(`RADLoader: RADC property ${t.property} is missing max.`)}return t.max}function a1(r,t){switch(t){case"rgb":return r?.rgbMin;case"scales":return r?.lnScaleMin;default:return}}function c1(r,t){switch(t){case"rgb":return r?.rgbMax;case"scales":return r?.lnScaleMax;case"sh1":return r?.sh1Max;case"sh2":return r?.sh2Max;case"sh3":return r?.sh3Max;default:return}}function l1(r){return Math.round(Math.min(Math.max(r,0),1)*255)}function u1(r){let t=new Uint8Array(r.byteLength);return t.set(r),t.buffer}function f1(r){return r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}var Mx,Rx,Ad=d(()=>{"use strict";wd();$o();rs();ts();Mx=new Ss,Rx=new Ss({raw:!0})});var Sg={};ye(Sg,{RADLoaderWithParser:()=>h1,parseRADChunk:()=>gl,parseRADChunkHeader:()=>Is,parseRADChunkToGaussianSplats:()=>Wo,parseRADHeader:()=>Ho,tryParseRADHeader:()=>xs});var pM,d1,h1,xg=d(()=>{"use strict";$o();Bd();$o();Ad();({preload:pM,...d1}=wl),h1={...d1,parse:async r=>Ho(r),parseSync:r=>Ho(r)}});async function m1(){let{RADLoaderWithParser:r}=await Promise.resolve().then(()=>(xg(),Sg));return r}var p1,wl,Bd=d(()=>{"use strict";xn();p1="5.0.0-alpha.1";wl={dataType:null,batchType:null,...wi,version:p1,options:{},preload:m1}});var Yo={};ye(Yo,{KSPLATFormat:()=>ra,KSPLATLoader:()=>Vc,RADFormat:()=>wi,RADLoader:()=>wl,RADSource:()=>Go,RADSourceLoader:()=>Dd,SPLATFormat:()=>ea,SPLATLoader:()=>Cc,SPZFormat:()=>na,SPZLoader:()=>pl,resolveRADChunkUrl:()=>vl});ta(Yo,Sl(Fd(),1));xn();bf();If();vd();Bd();Io();xn();$o();Ad();rs();var y1=[64*1024,256*1024,1024*1024],_1=4,g1="5.0.0-alpha.1",Dd={dataType:null,batchType:null,...wi,name:"RADSourceLoader",version:g1,type:"rad",fromUrl:!0,fromBlob:!0,options:{rad:{headers:void 0,withCredentials:!1,headerByteLengths:void 0}},defaultOptions:{rad:{headers:void 0,withCredentials:!1,headerByteLengths:void 0}},testURL:r=>/\.rad(?:$|[?#])/i.test(r),createDataSource:(r,t,e)=>new Go(r,t,e)},Go=class extends us{metadata;_metadataPromise=null;_chunkMetadataPromises=new Map;constructor(t,e,n){super(t,e,Dd.defaultOptions,n),this.metadata=this.getMetadata()}async initialize(){await this.getMetadata()}async getMetadata(){return this._metadataPromise||(this._metadataPromise=this._loadMetadata()),await this._metadataPromise}async getChunkCount(){return(await this.getMetadata()).chunks.length}async getChunkUrl(t){let e=await this.getMetadata(),n=this._getChunkRange(e,t);return n.filename?vl(this.url,n.filename):typeof this.data=="string"?this.url:null}async getChunk(t,e={}){let n=await this.getMetadata(),i=this._getChunkRange(n,t);if(i.filename){if(typeof this.data!="string")throw new Error("RADSource: sidecar RADC chunks require a URL-backed RAD source.");return await this._fetchArrayBuffer(vl(this.url,i.filename),void 0,{signal:e.signal})}if(i.bytes===0)return new ArrayBuffer(0);let s=n.chunksByteOffset+i.offset;return typeof this.data!="string"?await this.data.slice(s,s+i.bytes).arrayBuffer():await this._fetchArrayBuffer(this.url,{offset:s,bytes:i.bytes},{signal:e.signal})}async getChunkMetadata(t,e={}){let n=this._chunkMetadataPromises.get(t);return n||(n=this.getChunk(t,e).then(i=>Is(i)),this._chunkMetadataPromises.set(t,n)),await n}async getChunkSplats(t,e={}){let n=await this.getMetadata();return Wo(await this.getChunk(t,e),this._getChunkDecodeOptions(n,e))}async getChunkTable(t,e={}){let n=await this.getMetadata();return gl(await this.getChunk(t,e),this._getChunkDecodeOptions(n,e))}async*getChunkTables(t={}){let e=await this.getMetadata(),n=t.startChunkIndex??0,i=t.maxChunks??Number.POSITIVE_INFINITY,s=t.maxSplats??Number.POSITIVE_INFINITY,o=0,a=0;if(t.pruneLoadedLoDParents){let l=b1(e,n,i,s),c=await this._getChunkSplatsConcurrently(l,t),u=0;for(let h of c){o++,a+=h.splatCount;let m=v1(h);u=Math.max(u,m+h.splatCount)}for(let h of c)yield Er(S1(h,u));return}for(let l=n;l<e.chunks.length&&o<i&&a<s;l++){let c=await this.getChunkTable(l,t);o++,a+=c.data.numRows,yield c}}async _getChunkSplatsConcurrently(t,e){let n=new Array(t.length),i=w1(e.maxConcurrentChunkRequests),s=0;async function o(l){for(;s<t.length;){let c=s++,u=t[c];n[c]=await l.getChunkSplats(u,e)}}let a=Math.min(i,t.length);return await Promise.all(Array.from({length:a},()=>o(this))),n}_getChunkDecodeOptions(t,e){return{...e,radChunk:{splatEncoding:t.splatEncoding,...e.radChunk}}}async _loadMetadata(){let t=this.options.rad?.headerByteLengths?.length?this.options.rad.headerByteLengths:y1;if(typeof this.data!="string"){let e=Math.min(this.data.size,Math.max(...t)),n=xs(await this.data.slice(0,e).arrayBuffer());if(n)return n;throw new Error("RADSource: Blob does not contain a complete RAD metadata header.")}for(let e of t){let n=xs(await this._fetchArrayBuffer(this.url,{offset:0,bytes:e}));if(n)return n}throw new Error("RADSource: failed to load a complete RAD metadata header.")}_getChunkRange(t,e){if(!Number.isInteger(e)||e<0||e>=t.chunks.length)throw new Error(`RADSource: chunk index ${e} is outside 0-${t.chunks.length-1}.`);return t.chunks[e]}async _fetchArrayBuffer(t,e,n={}){let i=await this._fetchResponse(t,this._getRequestInit(e,n));if(!i.ok)throw new Error(`RADSource: failed to fetch ${t}: ${i.status} ${i.statusText}`);let s=await i.arrayBuffer();return e&&i.status!==206&&s.byteLength>=e.offset+e.bytes?s.slice(e.offset,e.offset+e.bytes):e&&s.byteLength>e.bytes?s.slice(0,e.bytes):s}async _fetchResponse(t,e){return this._hasCustomFetch()?await this.fetch(t,e):this.hasCoreApi?await this.coreApi.fetchFile(t,e):await this.fetch(t,e)}_hasCustomFetch(){return Boolean(this.loadOptions?.core?.fetch||this.loadOptions?.fetch)}_getRequestInit(t,e={}){let n=new Headers(this.options.rad?.headers);return t&&t.bytes>0&&n.set("Range",`bytes=${t.offset}-${t.offset+t.bytes-1}`),{headers:n,credentials:this.options.rad?.withCredentials?"include":"same-origin",signal:e.signal}}};function b1(r,t,e,n){let i=[],s=0;for(let o=t;o<r.chunks.length&&i.length<e&&s<n;o++){let a=r.chunks[o];i.push(o),s+=a?.count??r.chunkSize??0}return i}function w1(r){return Number.isFinite(r)&&r>0?Math.floor(r):_1}function v1(r){return typeof r.loaderData?.base=="number"?r.loaderData.base:0}function S1(r,t){let e=r.loaderData?.childCounts,n=r.loaderData?.childStarts;if(!(e instanceof Uint16Array)||!(n instanceof Uint32Array))return r;let i=new Uint32Array(r.splatCount),s=0;for(let l=0;l<r.splatCount;l++){let c=e[l],u=n[l];c>0&&u<t||(i[s++]=l)}if(s===r.splatCount)return r;let o=i.subarray(0,s),a=r.sphericalHarmonicsComponentCount??0;return{...r,splatCount:s,positions:on(r.positions,3,o),scales:on(r.scales,3,o),rotations:on(r.rotations,4,o),colors:on(r.colors,3,o),sphericalHarmonicDcs:r.sphericalHarmonicDcs?on(r.sphericalHarmonicDcs,3,o):void 0,opacities:on(r.opacities,1,o),sphericalHarmonics:r.sphericalHarmonics&&a?on(r.sphericalHarmonics,a,o):void 0,loaderData:{...r.loaderData,count:s,childCounts:on(e,1,o),childStarts:on(n,1,o)}}}function on(r,t,e){let n=new r.constructor(e.length*t);for(let i=0;i<e.length;i++){let s=e[i]*t,o=i*t;n.set(r.subarray(s,s+t),o)}return n}function vl(r,t){if(/^[a-z][a-z0-9+.-]*:/i.test(t)||t.startsWith("/"))return t;if(!r)throw new Error("RADSource: cannot resolve a sidecar RADC chunk without a RAD URL.");try{return new URL(t,r).toString()}catch{let[e,n=""]=r.split(/([?#].*)/,2),i=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return`${i>=0?e.slice(0,i+1):""}${t}${n}`}}return Og(Yo);})();
17
+ return __exports__;
18
+ });