var Go=Object.defineProperty;var Ko=(n,t,e)=>t in n?Go(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var Sr=(n,t,e)=>Ko(n,typeof t!="symbol"?t+"":t,e);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function e(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=e(r);fetch(r.href,s)}})();function Zo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var gi={exports:{}},E={};/** @license React v16.13.1
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Ir;function Qo(){if(Ir)return E;Ir=1;var n=typeof Symbol=="function"&&Symbol.for,t=n?Symbol.for("react.element"):60103,e=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,r=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,o=n?Symbol.for("react.provider"):60109,a=n?Symbol.for("react.context"):60110,c=n?Symbol.for("react.async_mode"):60111,u=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,b=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,N=n?Symbol.for("react.lazy"):60116,it=n?Symbol.for("react.block"):60121,St=n?Symbol.for("react.fundamental"):60117,Z=n?Symbol.for("react.responder"):60118,Tt=n?Symbol.for("react.scope"):60119;function Q(y){if(typeof y=="object"&&y!==null){var mt=y.$$typeof;switch(mt){case t:switch(y=y.type,y){case c:case u:case i:case s:case r:case p:return y;default:switch(y=y&&y.$$typeof,y){case a:case d:case N:case m:case o:return y;default:return mt}}case e:return mt}}}function qt(y){return Q(y)===u}return E.AsyncMode=c,E.ConcurrentMode=u,E.ContextConsumer=a,E.ContextProvider=o,E.Element=t,E.ForwardRef=d,E.Fragment=i,E.Lazy=N,E.Memo=m,E.Portal=e,E.Profiler=s,E.StrictMode=r,E.Suspense=p,E.isAsyncMode=function(y){return qt(y)||Q(y)===c},E.isConcurrentMode=qt,E.isContextConsumer=function(y){return Q(y)===a},E.isContextProvider=function(y){return Q(y)===o},E.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===t},E.isForwardRef=function(y){return Q(y)===d},E.isFragment=function(y){return Q(y)===i},E.isLazy=function(y){return Q(y)===N},E.isMemo=function(y){return Q(y)===m},E.isPortal=function(y){return Q(y)===e},E.isProfiler=function(y){return Q(y)===s},E.isStrictMode=function(y){return Q(y)===r},E.isSuspense=function(y){return Q(y)===p},E.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===i||y===u||y===s||y===r||y===p||y===b||typeof y=="object"&&y!==null&&(y.$$typeof===N||y.$$typeof===m||y.$$typeof===o||y.$$typeof===a||y.$$typeof===d||y.$$typeof===St||y.$$typeof===Z||y.$$typeof===Tt||y.$$typeof===it)},E.typeOf=Q,E}var Br;function Xo(){return Br||(Br=1,gi.exports=Qo()),gi.exports}var _i,Ar;function ta(){if(Ar)return _i;Ar=1;var n=Xo(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},e={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},r={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};s[n.ForwardRef]=i,s[n.Memo]=r;function o(N){return n.isMemo(N)?r:s[N.$$typeof]||t}var a=Object.defineProperty,c=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,b=Object.prototype;function m(N,it,St){if(typeof it!="string"){if(b){var Z=p(it);Z&&Z!==b&&m(N,Z,St)}var Tt=c(it);u&&(Tt=Tt.concat(u(it)));for(var Q=o(N),qt=o(it),y=0;y<Tt.length;++y){var mt=Tt[y];if(!e[mt]&&!(St&&St[mt])&&!(qt&&qt[mt])&&!(Q&&Q[mt])){var wn=d(it,mt);try{a(N,mt,wn)}catch{}}}}return N}return _i=m,_i}ta();var vi={exports:{}},j={};/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var wi,Or;function ea(){if(Or)return wi;Or=1;var n=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,e=Object.prototype.propertyIsEnumerable;function i(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function r(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var o={},a=0;a<10;a++)o["_"+String.fromCharCode(a)]=a;var c=Object.getOwnPropertyNames(o).map(function(d){return o[d]});if(c.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(d){u[d]=d}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return wi=r()?Object.assign:function(s,o){for(var a,c=i(s),u,d=1;d<arguments.length;d++){a=Object(arguments[d]);for(var p in a)t.call(a,p)&&(c[p]=a[p]);if(n){u=n(a);for(var b=0;b<u.length;b++)e.call(a,u[b])&&(c[u[b]]=a[u[b]])}}return c},wi}/** @license React v16.14.0
 * react.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Fr;function na(){if(Fr)return j;Fr=1;var n=ea(),t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,i=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,s=t?Symbol.for("react.strict_mode"):60108,o=t?Symbol.for("react.profiler"):60114,a=t?Symbol.for("react.provider"):60109,c=t?Symbol.for("react.context"):60110,u=t?Symbol.for("react.forward_ref"):60112,d=t?Symbol.for("react.suspense"):60113,p=t?Symbol.for("react.memo"):60115,b=t?Symbol.for("react.lazy"):60116,m=typeof Symbol=="function"&&Symbol.iterator;function N(h){for(var f="https://reactjs.org/docs/error-decoder.html?invariant="+h,D=1;D<arguments.length;D++)f+="&args[]="+encodeURIComponent(arguments[D]);return"Minified React error #"+h+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var it={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},St={};function Z(h,f,D){this.props=h,this.context=f,this.refs=St,this.updater=D||it}Z.prototype.isReactComponent={},Z.prototype.setState=function(h,f){if(typeof h!="object"&&typeof h!="function"&&h!=null)throw Error(N(85));this.updater.enqueueSetState(this,h,f,"setState")},Z.prototype.forceUpdate=function(h){this.updater.enqueueForceUpdate(this,h,"forceUpdate")};function Tt(){}Tt.prototype=Z.prototype;function Q(h,f,D){this.props=h,this.context=f,this.refs=St,this.updater=D||it}var qt=Q.prototype=new Tt;qt.constructor=Q,n(qt,Z.prototype),qt.isPureReactComponent=!0;var y={current:null},mt=Object.prototype.hasOwnProperty,wn={key:!0,ref:!0,__self:!0,__source:!0};function di(h,f,D){var V,R={},tt=null,It=null;if(f!=null)for(V in f.ref!==void 0&&(It=f.ref),f.key!==void 0&&(tt=""+f.key),f)mt.call(f,V)&&!wn.hasOwnProperty(V)&&(R[V]=f[V]);var J=arguments.length-2;if(J===1)R.children=D;else if(1<J){for(var at=Array(J),Gt=0;Gt<J;Gt++)at[Gt]=arguments[Gt+2];R.children=at}if(h&&h.defaultProps)for(V in J=h.defaultProps,J)R[V]===void 0&&(R[V]=J[V]);return{$$typeof:e,type:h,key:tt,ref:It,props:R,_owner:y.current}}function Wo(h,f){return{$$typeof:e,type:h.type,key:f,ref:h.ref,props:h.props,_owner:h._owner}}function fi(h){return typeof h=="object"&&h!==null&&h.$$typeof===e}function Yo(h){var f={"=":"=0",":":"=2"};return"$"+(""+h).replace(/[=:]/g,function(D){return f[D]})}var gr=/\/+/g,Sn=[];function _r(h,f,D,V){if(Sn.length){var R=Sn.pop();return R.result=h,R.keyPrefix=f,R.func=D,R.context=V,R.count=0,R}return{result:h,keyPrefix:f,func:D,context:V,count:0}}function vr(h){h.result=null,h.keyPrefix=null,h.func=null,h.context=null,h.count=0,10>Sn.length&&Sn.push(h)}function pi(h,f,D,V){var R=typeof h;(R==="undefined"||R==="boolean")&&(h=null);var tt=!1;if(h===null)tt=!0;else switch(R){case"string":case"number":tt=!0;break;case"object":switch(h.$$typeof){case e:case i:tt=!0}}if(tt)return D(V,h,f===""?"."+mi(h,0):f),1;if(tt=0,f=f===""?".":f+":",Array.isArray(h))for(var It=0;It<h.length;It++){R=h[It];var J=f+mi(R,It);tt+=pi(R,J,D,V)}else if(h===null||typeof h!="object"?J=null:(J=m&&h[m]||h["@@iterator"],J=typeof J=="function"?J:null),typeof J=="function")for(h=J.call(h),It=0;!(R=h.next()).done;)R=R.value,J=f+mi(R,It++),tt+=pi(R,J,D,V);else if(R==="object")throw D=""+h,Error(N(31,D==="[object Object]"?"object with keys {"+Object.keys(h).join(", ")+"}":D,""));return tt}function yi(h,f,D){return h==null?0:pi(h,"",f,D)}function mi(h,f){return typeof h=="object"&&h!==null&&h.key!=null?Yo(h.key):f.toString(36)}function Ho(h,f){h.func.call(h.context,f,h.count++)}function qo(h,f,D){var V=h.result,R=h.keyPrefix;h=h.func.call(h.context,f,h.count++),Array.isArray(h)?bi(h,V,D,function(tt){return tt}):h!=null&&(fi(h)&&(h=Wo(h,R+(!h.key||f&&f.key===h.key?"":(""+h.key).replace(gr,"$&/")+"/")+D)),V.push(h))}function bi(h,f,D,V,R){var tt="";D!=null&&(tt=(""+D).replace(gr,"$&/")+"/"),f=_r(f,tt,V,R),yi(h,qo,f),vr(f)}var wr={current:null};function Jt(){var h=wr.current;if(h===null)throw Error(N(321));return h}var Jo={ReactCurrentDispatcher:wr,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:y,IsSomeRendererActing:{current:!1},assign:n};return j.Children={map:function(h,f,D){if(h==null)return h;var V=[];return bi(h,V,null,f,D),V},forEach:function(h,f,D){if(h==null)return h;f=_r(null,null,f,D),yi(h,Ho,f),vr(f)},count:function(h){return yi(h,function(){return null},null)},toArray:function(h){var f=[];return bi(h,f,null,function(D){return D}),f},only:function(h){if(!fi(h))throw Error(N(143));return h}},j.Component=Z,j.Fragment=r,j.Profiler=o,j.PureComponent=Q,j.StrictMode=s,j.Suspense=d,j.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Jo,j.cloneElement=function(h,f,D){if(h==null)throw Error(N(267,h));var V=n({},h.props),R=h.key,tt=h.ref,It=h._owner;if(f!=null){if(f.ref!==void 0&&(tt=f.ref,It=y.current),f.key!==void 0&&(R=""+f.key),h.type&&h.type.defaultProps)var J=h.type.defaultProps;for(at in f)mt.call(f,at)&&!wn.hasOwnProperty(at)&&(V[at]=f[at]===void 0&&J!==void 0?J[at]:f[at])}var at=arguments.length-2;if(at===1)V.children=D;else if(1<at){J=Array(at);for(var Gt=0;Gt<at;Gt++)J[Gt]=arguments[Gt+2];V.children=J}return{$$typeof:e,type:h.type,key:R,ref:tt,props:V,_owner:It}},j.createContext=function(h,f){return f===void 0&&(f=null),h={$$typeof:c,_calculateChangedBits:f,_currentValue:h,_currentValue2:h,_threadCount:0,Provider:null,Consumer:null},h.Provider={$$typeof:a,_context:h},h.Consumer=h},j.createElement=di,j.createFactory=function(h){var f=di.bind(null,h);return f.type=h,f},j.createRef=function(){return{current:null}},j.forwardRef=function(h){return{$$typeof:u,render:h}},j.isValidElement=fi,j.lazy=function(h){return{$$typeof:b,_ctor:h,_status:-1,_result:null}},j.memo=function(h,f){return{$$typeof:p,type:h,compare:f===void 0?null:f}},j.useCallback=function(h,f){return Jt().useCallback(h,f)},j.useContext=function(h,f){return Jt().useContext(h,f)},j.useDebugValue=function(){},j.useEffect=function(h,f){return Jt().useEffect(h,f)},j.useImperativeHandle=function(h,f,D){return Jt().useImperativeHandle(h,f,D)},j.useLayoutEffect=function(h,f){return Jt().useLayoutEffect(h,f)},j.useMemo=function(h,f){return Jt().useMemo(h,f)},j.useReducer=function(h,f,D){return Jt().useReducer(h,f,D)},j.useRef=function(h){return Jt().useRef(h)},j.useState=function(h){return Jt().useState(h)},j.version="16.14.0",j}var Dr;function ia(){return Dr||(Dr=1,vi.exports=na()),vi.exports}var ra=ia();const sa=Zo(ra);function g(n,t,e,i){function r(s){return s instanceof e?s:new e(function(o){o(s)})}return new(e||(e=Promise))(function(s,o){function a(d){try{u(i.next(d))}catch(p){o(p)}}function c(d){try{u(i.throw(d))}catch(p){o(p)}}function u(d){d.done?s(d.value):r(d.value).then(a,c)}u((i=i.apply(n,t||[])).next())})}function Tr(n){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&n[t],i=0;if(e)return e.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&i>=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function T(n){return this instanceof T?(this.v=n,this):new T(n)}function Vt(n,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=e.apply(n,t||[]),r,s=[];return r=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),r[Symbol.asyncIterator]=function(){return this},r;function o(m){return function(N){return Promise.resolve(N).then(m,p)}}function a(m,N){i[m]&&(r[m]=function(it){return new Promise(function(St,Z){s.push([m,it,St,Z])>1||c(m,it)})},N&&(r[m]=N(r[m])))}function c(m,N){try{u(i[m](N))}catch(it){b(s[0][3],it)}}function u(m){m.value instanceof T?Promise.resolve(m.value.v).then(d,p):b(s[0][2],m)}function d(m){c("next",m)}function p(m){c("throw",m)}function b(m,N){m(N),s.shift(),s.length&&c(s[0][0],s[0][1])}}function On(n){var t,e;return t={},i("next"),i("throw",function(r){throw r}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(r,s){t[r]=n[r]?function(o){return(e=!e)?{value:T(n[r](o)),done:!1}:s?s(o):o}:s}}function Oe(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n[Symbol.asyncIterator],e;return t?t.call(n):(n=typeof Tr=="function"?Tr(n):n[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(s){e[s]=n[s]&&function(o){return new Promise(function(a,c){o=n[s](o),r(a,c,o.done,o.value)})}}function r(s,o,a,c){Promise.resolve(c).then(function(u){s({value:u,done:a})},o)}}const oa=new TextDecoder("utf-8"),Ti=n=>oa.decode(n),aa=new TextEncoder,$i=n=>aa.encode(n),[_u,ca]=(()=>{const n=()=>{throw new Error("BigInt is not available in this environment")};function t(){throw n()}return t.asIntN=()=>{throw n()},t.asUintN=()=>{throw n()},typeof BigInt<"u"?[BigInt,!0]:[t,!1]})(),[pn]=(()=>{const n=()=>{throw new Error("BigInt64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw n()}static from(){throw n()}constructor(){throw n()}}return typeof BigInt64Array<"u"?[BigInt64Array,!0]:[t,!1]})(),[yn]=(()=>{const n=()=>{throw new Error("BigUint64Array is not available in this environment")};class t{static get BYTES_PER_ELEMENT(){return 8}static of(){throw n()}static from(){throw n()}constructor(){throw n()}}return typeof BigUint64Array<"u"?[BigUint64Array,!0]:[t,!1]})(),la=n=>typeof n=="number",ts=n=>typeof n=="boolean",et=n=>typeof n=="function",ft=n=>n!=null&&Object(n)===n,ue=n=>ft(n)&&et(n.then),mn=n=>ft(n)&&et(n[Symbol.iterator]),Ke=n=>ft(n)&&et(n[Symbol.asyncIterator]),Ni=n=>ft(n)&&ft(n.schema),es=n=>ft(n)&&"done"in n&&"value"in n,ns=n=>ft(n)&&et(n.stat)&&la(n.fd),is=n=>ft(n)&&Wi(n.body),ci=n=>"_getDOMStream"in n&&"_getNodeStream"in n,ua=n=>ft(n)&&et(n.abort)&&et(n.getWriter)&&!ci(n),Wi=n=>ft(n)&&et(n.cancel)&&et(n.getReader)&&!ci(n),ha=n=>ft(n)&&et(n.end)&&et(n.write)&&ts(n.writable)&&!ci(n),rs=n=>ft(n)&&et(n.read)&&et(n.pipe)&&ts(n.readable)&&!ci(n),da=n=>ft(n)&&et(n.clear)&&et(n.bytes)&&et(n.position)&&et(n.setPosition)&&et(n.capacity)&&et(n.getBufferIdentifier)&&et(n.createLong),Yi=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function fa(n){const t=n[0]?[n[0]]:[];let e,i,r,s;for(let o,a,c=0,u=0,d=n.length;++c<d;){if(o=t[u],a=n[c],!o||!a||o.buffer!==a.buffer||a.byteOffset<o.byteOffset){a&&(t[++u]=a);continue}if({byteOffset:e,byteLength:r}=o,{byteOffset:i,byteLength:s}=a,e+r<i||i+s<e){a&&(t[++u]=a);continue}t[u]=new Uint8Array(o.buffer,e,i-e+s)}return t}function Nr(n,t,e=0,i=t.byteLength){const r=n.byteLength,s=new Uint8Array(n.buffer,n.byteOffset,r),o=new Uint8Array(t.buffer,t.byteOffset,Math.min(i,r));return s.set(o,e),n}function Wt(n,t){const e=fa(n),i=e.reduce((d,p)=>d+p.byteLength,0);let r,s,o,a=0,c=-1;const u=Math.min(t||Number.POSITIVE_INFINITY,i);for(const d=e.length;++c<d;){if(r=e[c],s=r.subarray(0,Math.min(r.length,u-a)),u<=a+s.length){s.length<r.length?e[c]=r.subarray(s.length):s.length===r.length&&c++,o?Nr(o,s,a):o=s;break}Nr(o||(o=new Uint8Array(u)),s,a),a+=s.length}return[o||new Uint8Array(0),e.slice(c),i-(o?o.byteLength:0)]}function W(n,t){let e=es(t)?t.value:t;return e instanceof n?n===Uint8Array?new n(e.buffer,e.byteOffset,e.byteLength):e:e?(typeof e=="string"&&(e=$i(e)),e instanceof ArrayBuffer?new n(e):e instanceof Yi?new n(e):da(e)?W(n,e.bytes()):ArrayBuffer.isView(e)?e.byteLength<=0?new n(0):new n(e.buffer,e.byteOffset,e.byteLength/n.BYTES_PER_ELEMENT):n.from(e)):new n(0)}const Qe=n=>W(Int32Array,n),U=n=>W(Uint8Array,n),Mi=n=>(n.next(),n);function*pa(n,t){const e=function*(r){yield r},i=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Yi?e(t):mn(t)?t:e(t);return yield*Mi(function*(r){let s=null;do s=r.next(yield W(n,s));while(!s.done)}(i[Symbol.iterator]())),new n}const ya=n=>pa(Uint8Array,n);function ss(n,t){return Vt(this,arguments,function*(){if(ue(t))return yield T(yield T(yield*On(Oe(ss(n,yield T(t))))));const i=function(o){return Vt(this,arguments,function*(){yield yield T(yield T(o))})},r=function(o){return Vt(this,arguments,function*(){yield T(yield*On(Oe(Mi(function*(a){let c=null;do c=a.next(yield c==null?void 0:c.value);while(!c.done)}(o[Symbol.iterator]())))))})},s=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Yi?i(t):mn(t)?r(t):Ke(t)?t:i(t);return yield T(yield*On(Oe(Mi(function(o){return Vt(this,arguments,function*(){let a=null;do a=yield T(o.next(yield yield T(W(n,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield T(new n)})}const ma=n=>ss(Uint8Array,n);function Hi(n,t,e){if(n!==0){e=e.slice(0,t+1);for(let i=-1;++i<=t;)e[i]+=n}return e}function ba(n,t){let e=0;const i=n.length;if(i!==t.length)return!1;if(i>0)do if(n[e]!==t[e])return!1;while(++e<i);return!0}const At={fromIterable(n){return In(ga(n))},fromAsyncIterable(n){return In(_a(n))},fromDOMStream(n){return In(va(n))},fromNodeStream(n){return In(Sa(n))},toDOMStream(n,t){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(n,t){throw new Error('"toNodeStream" not available in this environment')}},In=n=>(n.next(),n);function*ga(n){let t,e=!1,i=[],r,s,o,a=0;function c(){return s==="peek"?Wt(i,o)[0]:([r,i,a]=Wt(i,o),r)}({cmd:s,size:o}=yield null);const u=ya(n)[Symbol.iterator]();try{do if({done:t,value:r}=Number.isNaN(o-a)?u.next():u.next(o-a),!t&&r.byteLength>0&&(i.push(r),a+=r.byteLength),t||o<=a)do({cmd:s,size:o}=yield c());while(o<a);while(!t)}catch(d){(e=!0)&&typeof u.throw=="function"&&u.throw(d)}finally{e===!1&&typeof u.return=="function"&&u.return(null)}return null}function _a(n){return Vt(this,arguments,function*(){let e,i=!1,r=[],s,o,a,c=0;function u(){return o==="peek"?Wt(r,a)[0]:([s,r,c]=Wt(r,a),s)}({cmd:o,size:a}=yield yield T(null));const d=ma(n)[Symbol.asyncIterator]();try{do if({done:e,value:s}=Number.isNaN(a-c)?yield T(d.next()):yield T(d.next(a-c)),!e&&s.byteLength>0&&(r.push(s),c+=s.byteLength),e||a<=c)do({cmd:o,size:a}=yield yield T(u()));while(a<c);while(!e)}catch(p){(i=!0)&&typeof d.throw=="function"&&(yield T(d.throw(p)))}finally{i===!1&&typeof d.return=="function"&&(yield T(d.return(new Uint8Array(0))))}return yield T(null)})}function va(n){return Vt(this,arguments,function*(){let e=!1,i=!1,r=[],s,o,a,c=0;function u(){return o==="peek"?Wt(r,a)[0]:([s,r,c]=Wt(r,a),s)}({cmd:o,size:a}=yield yield T(null));const d=new wa(n);try{do if({done:e,value:s}=Number.isNaN(a-c)?yield T(d.read()):yield T(d.read(a-c)),!e&&s.byteLength>0&&(r.push(U(s)),c+=s.byteLength),e||a<=c)do({cmd:o,size:a}=yield yield T(u()));while(a<c);while(!e)}catch(p){(i=!0)&&(yield T(d.cancel(p)))}finally{i===!1?yield T(d.cancel()):n.locked&&d.releaseLock()}return yield T(null)})}class wa{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 g(this,void 0,void 0,function*(){const{reader:e,source:i}=this;e&&(yield e.cancel(t).catch(()=>{})),i&&i.locked&&this.releaseLock()})}read(t){return g(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};const e=yield this.reader.read();return!e.done&&(e.value=U(e)),e})}}const Si=(n,t)=>{const e=r=>i([t,r]);let i;return[t,e,new Promise(r=>(i=r)&&n.once(t,e))]};function Sa(n){return Vt(this,arguments,function*(){const e=[];let i="error",r=!1,s=null,o,a,c=0,u=[],d;function p(){return o==="peek"?Wt(u,a)[0]:([d,u,c]=Wt(u,a),d)}if({cmd:o,size:a}=yield yield T(null),n.isTTY)return yield yield T(new Uint8Array(0)),yield T(null);try{e[0]=Si(n,"end"),e[1]=Si(n,"error");do{if(e[2]=Si(n,"readable"),[i,s]=yield T(Promise.race(e.map(m=>m[2]))),i==="error")break;if((r=i==="end")||(Number.isFinite(a-c)?(d=U(n.read(a-c)),d.byteLength<a-c&&(d=U(n.read()))):d=U(n.read()),d.byteLength>0&&(u.push(d),c+=d.byteLength)),r||a<=c)do({cmd:o,size:a}=yield yield T(p()));while(a<c)}while(!r)}finally{yield T(b(e,i==="error"?s:null))}return yield T(null);function b(m,N){return d=u=null,new Promise((it,St)=>{for(const[Z,Tt]of m)n.off(Z,Tt);try{const Z=n.destroy;Z&&Z.call(n,N),N=void 0}catch(Z){N=Z||N}finally{N!=null?St(N):it()}})}})}var _t;(function(n){n[n.V1=0]="V1",n[n.V2=1]="V2",n[n.V3=2]="V3",n[n.V4=3]="V4",n[n.V5=4]="V5"})(_t||(_t={}));var vt;(function(n){n[n.Sparse=0]="Sparse",n[n.Dense=1]="Dense"})(vt||(vt={}));var dt;(function(n){n[n.HALF=0]="HALF",n[n.SINGLE=1]="SINGLE",n[n.DOUBLE=2]="DOUBLE"})(dt||(dt={}));var re;(function(n){n[n.DAY=0]="DAY",n[n.MILLISECOND=1]="MILLISECOND"})(re||(re={}));var C;(function(n){n[n.SECOND=0]="SECOND",n[n.MILLISECOND=1]="MILLISECOND",n[n.MICROSECOND=2]="MICROSECOND",n[n.NANOSECOND=3]="NANOSECOND"})(C||(C={}));var he;(function(n){n[n.YEAR_MONTH=0]="YEAR_MONTH",n[n.DAY_TIME=1]="DAY_TIME",n[n.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(he||(he={}));var z;(function(n){n[n.NONE=0]="NONE",n[n.Schema=1]="Schema",n[n.DictionaryBatch=2]="DictionaryBatch",n[n.RecordBatch=3]="RecordBatch",n[n.Tensor=4]="Tensor",n[n.SparseTensor=5]="SparseTensor"})(z||(z={}));var l;(function(n){n[n.NONE=0]="NONE",n[n.Null=1]="Null",n[n.Int=2]="Int",n[n.Float=3]="Float",n[n.Binary=4]="Binary",n[n.Utf8=5]="Utf8",n[n.Bool=6]="Bool",n[n.Decimal=7]="Decimal",n[n.Date=8]="Date",n[n.Time=9]="Time",n[n.Timestamp=10]="Timestamp",n[n.Interval=11]="Interval",n[n.List=12]="List",n[n.Struct=13]="Struct",n[n.Union=14]="Union",n[n.FixedSizeBinary=15]="FixedSizeBinary",n[n.FixedSizeList=16]="FixedSizeList",n[n.Map=17]="Map",n[n.Dictionary=-1]="Dictionary",n[n.Int8=-2]="Int8",n[n.Int16=-3]="Int16",n[n.Int32=-4]="Int32",n[n.Int64=-5]="Int64",n[n.Uint8=-6]="Uint8",n[n.Uint16=-7]="Uint16",n[n.Uint32=-8]="Uint32",n[n.Uint64=-9]="Uint64",n[n.Float16=-10]="Float16",n[n.Float32=-11]="Float32",n[n.Float64=-12]="Float64",n[n.DateDay=-13]="DateDay",n[n.DateMillisecond=-14]="DateMillisecond",n[n.TimestampSecond=-15]="TimestampSecond",n[n.TimestampMillisecond=-16]="TimestampMillisecond",n[n.TimestampMicrosecond=-17]="TimestampMicrosecond",n[n.TimestampNanosecond=-18]="TimestampNanosecond",n[n.TimeSecond=-19]="TimeSecond",n[n.TimeMillisecond=-20]="TimeMillisecond",n[n.TimeMicrosecond=-21]="TimeMicrosecond",n[n.TimeNanosecond=-22]="TimeNanosecond",n[n.DenseUnion=-23]="DenseUnion",n[n.SparseUnion=-24]="SparseUnion",n[n.IntervalDayTime=-25]="IntervalDayTime",n[n.IntervalYearMonth=-26]="IntervalYearMonth"})(l||(l={}));var Zt;(function(n){n[n.OFFSET=0]="OFFSET",n[n.DATA=1]="DATA",n[n.VALIDITY=2]="VALIDITY",n[n.TYPE=3]="TYPE"})(Zt||(Zt={}));const Ia=void 0;function on(n){if(n===null)return"null";if(n===Ia)return"undefined";switch(typeof n){case"number":return`${n}`;case"bigint":return`${n}`;case"string":return`"${n}"`}return typeof n[Symbol.toPrimitive]=="function"?n[Symbol.toPrimitive]("string"):ArrayBuffer.isView(n)?n instanceof pn||n instanceof yn?`[${[...n].map(t=>on(t))}]`:`[${n}]`:ArrayBuffer.isView(n)?`[${n}]`:JSON.stringify(n,(t,e)=>typeof e=="bigint"?`${e}`:e)}const Ba=Symbol.for("isArrowBigNum");function xt(n,...t){return t.length===0?Object.setPrototypeOf(W(this.TypedArray,n),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(n,...t),this.constructor.prototype)}xt.prototype[Ba]=!0;xt.prototype.toJSON=function(){return`"${Fe(this)}"`};xt.prototype.valueOf=function(){return os(this)};xt.prototype.toString=function(){return Fe(this)};xt.prototype[Symbol.toPrimitive]=function(n="default"){switch(n){case"number":return os(this);case"string":return Fe(this);case"default":return xi(this)}return Fe(this)};function je(...n){return xt.apply(this,n)}function ze(...n){return xt.apply(this,n)}function an(...n){return xt.apply(this,n)}Object.setPrototypeOf(je.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(ze.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(an.prototype,Object.create(Uint32Array.prototype));Object.assign(je.prototype,xt.prototype,{constructor:je,signed:!0,TypedArray:Int32Array,BigIntArray:pn});Object.assign(ze.prototype,xt.prototype,{constructor:ze,signed:!1,TypedArray:Uint32Array,BigIntArray:yn});Object.assign(an.prototype,xt.prototype,{constructor:an,signed:!0,TypedArray:Uint32Array,BigIntArray:yn});function os(n){const{buffer:t,byteOffset:e,length:i,signed:r}=n,s=new yn(t,e,i),o=r&&s[s.length-1]&BigInt(1)<<BigInt(63);let a=BigInt(o?1:0),c=BigInt(0);if(o){for(const u of s)a+=~u*(BigInt(1)<<BigInt(32)*c++);a*=BigInt(-1)}else for(const u of s)a+=u*(BigInt(1)<<BigInt(32)*c++);return a}let Fe,xi;ca?(xi=n=>n.byteLength===8?new n.BigIntArray(n.buffer,n.byteOffset,1)[0]:Ii(n),Fe=n=>n.byteLength===8?`${new n.BigIntArray(n.buffer,n.byteOffset,1)[0]}`:Ii(n)):(Fe=Ii,xi=Fe);function Ii(n){let t="";const e=new Uint32Array(2);let i=new Uint16Array(n.buffer,n.byteOffset,n.byteLength/2);const r=new Uint32Array((i=new Uint16Array(i).reverse()).buffer);let s=-1;const o=i.length-1;do{for(e[0]=i[s=0];s<o;)i[s++]=e[1]=e[0]/10,e[0]=(e[0]-e[1]*10<<16)+i[s];i[s]=e[1]=e[0]/10,e[0]=e[0]-e[1]*10,t=`${e[0]}${t}`}while(r[0]||r[1]||r[2]||r[3]);return t??"0"}class qi{static new(t,e){switch(e){case!0:return new je(t);case!1:return new ze(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case pn:return new je(t)}return t.byteLength===16?new an(t):new ze(t)}static signed(t){return new je(t)}static unsigned(t){return new ze(t)}static decimal(t){return new an(t)}constructor(t,e){return qi.new(t,e)}}var as,cs,ls,us,hs,ds,fs,ps,ys,ms,bs,gs,_s,vs,ws,Ss,Is,Bs,As;class _{static isNull(t){return(t==null?void 0:t.typeId)===l.Null}static isInt(t){return(t==null?void 0:t.typeId)===l.Int}static isFloat(t){return(t==null?void 0:t.typeId)===l.Float}static isBinary(t){return(t==null?void 0:t.typeId)===l.Binary}static isUtf8(t){return(t==null?void 0:t.typeId)===l.Utf8}static isBool(t){return(t==null?void 0:t.typeId)===l.Bool}static isDecimal(t){return(t==null?void 0:t.typeId)===l.Decimal}static isDate(t){return(t==null?void 0:t.typeId)===l.Date}static isTime(t){return(t==null?void 0:t.typeId)===l.Time}static isTimestamp(t){return(t==null?void 0:t.typeId)===l.Timestamp}static isInterval(t){return(t==null?void 0:t.typeId)===l.Interval}static isList(t){return(t==null?void 0:t.typeId)===l.List}static isStruct(t){return(t==null?void 0:t.typeId)===l.Struct}static isUnion(t){return(t==null?void 0:t.typeId)===l.Union}static isFixedSizeBinary(t){return(t==null?void 0:t.typeId)===l.FixedSizeBinary}static isFixedSizeList(t){return(t==null?void 0:t.typeId)===l.FixedSizeList}static isMap(t){return(t==null?void 0:t.typeId)===l.Map}static isDictionary(t){return(t==null?void 0:t.typeId)===l.Dictionary}static isDenseUnion(t){return _.isUnion(t)&&t.mode===vt.Dense}static isSparseUnion(t){return _.isUnion(t)&&t.mode===vt.Sparse}get typeId(){return l.NONE}}as=Symbol.toStringTag;_[as]=(n=>(n.children=null,n.ArrayType=Array,n[Symbol.toStringTag]="DataType"))(_.prototype);let de=class extends _{toString(){return"Null"}get typeId(){return l.Null}};cs=Symbol.toStringTag;de[cs]=(n=>n[Symbol.toStringTag]="Null")(de.prototype);class fe extends _{constructor(t,e){super(),this.isSigned=t,this.bitWidth=e}get typeId(){return l.Int}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?pn:yn}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}ls=Symbol.toStringTag;fe[ls]=(n=>(n.isSigned=null,n.bitWidth=null,n[Symbol.toStringTag]="Int"))(fe.prototype);class cn extends fe{constructor(){super(!0,32)}get ArrayType(){return Int32Array}}Object.defineProperty(cn.prototype,"ArrayType",{value:Int32Array});class ln extends _{constructor(t){super(),this.precision=t}get typeId(){return l.Float}get ArrayType(){switch(this.precision){case dt.HALF:return Uint16Array;case dt.SINGLE:return Float32Array;case dt.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}us=Symbol.toStringTag;ln[us]=(n=>(n.precision=null,n[Symbol.toStringTag]="Float"))(ln.prototype);let Ln=class extends _{constructor(){super()}get typeId(){return l.Binary}toString(){return"Binary"}};hs=Symbol.toStringTag;Ln[hs]=(n=>(n.ArrayType=Uint8Array,n[Symbol.toStringTag]="Binary"))(Ln.prototype);let Rn=class extends _{constructor(){super()}get typeId(){return l.Utf8}toString(){return"Utf8"}};ds=Symbol.toStringTag;Rn[ds]=(n=>(n.ArrayType=Uint8Array,n[Symbol.toStringTag]="Utf8"))(Rn.prototype);let Un=class extends _{constructor(){super()}get typeId(){return l.Bool}toString(){return"Bool"}};fs=Symbol.toStringTag;Un[fs]=(n=>(n.ArrayType=Uint8Array,n[Symbol.toStringTag]="Bool"))(Un.prototype);let Cn=class extends _{constructor(t,e,i=128){super(),this.scale=t,this.precision=e,this.bitWidth=i}get typeId(){return l.Decimal}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};ps=Symbol.toStringTag;Cn[ps]=(n=>(n.scale=null,n.precision=null,n.ArrayType=Uint32Array,n[Symbol.toStringTag]="Decimal"))(Cn.prototype);class En extends _{constructor(t){super(),this.unit=t}get typeId(){return l.Date}toString(){return`Date${(this.unit+1)*32}<${re[this.unit]}>`}}ys=Symbol.toStringTag;En[ys]=(n=>(n.unit=null,n.ArrayType=Int32Array,n[Symbol.toStringTag]="Date"))(En.prototype);class un extends _{constructor(t,e){super(),this.unit=t,this.bitWidth=e}get typeId(){return l.Time}toString(){return`Time${this.bitWidth}<${C[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return pn}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}ms=Symbol.toStringTag;un[ms]=(n=>(n.unit=null,n.bitWidth=null,n[Symbol.toStringTag]="Time"))(un.prototype);class jn extends _{constructor(t,e){super(),this.unit=t,this.timezone=e}get typeId(){return l.Timestamp}toString(){return`Timestamp<${C[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}bs=Symbol.toStringTag;jn[bs]=(n=>(n.unit=null,n.timezone=null,n.ArrayType=Int32Array,n[Symbol.toStringTag]="Timestamp"))(jn.prototype);class zn extends _{constructor(t){super(),this.unit=t}get typeId(){return l.Interval}toString(){return`Interval<${he[this.unit]}>`}}gs=Symbol.toStringTag;zn[gs]=(n=>(n.unit=null,n.ArrayType=Int32Array,n[Symbol.toStringTag]="Interval"))(zn.prototype);let kn=class extends _{constructor(t){super(),this.children=[t]}get typeId(){return l.List}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};_s=Symbol.toStringTag;kn[_s]=(n=>(n.children=null,n[Symbol.toStringTag]="List"))(kn.prototype);class st extends _{constructor(t){super(),this.children=t}get typeId(){return l.Struct}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}vs=Symbol.toStringTag;st[vs]=(n=>(n.children=null,n[Symbol.toStringTag]="Struct"))(st.prototype);class Pn extends _{constructor(t,e,i){super(),this.mode=t,this.children=i,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((r,s,o)=>(r[s]=o)&&r||r,Object.create(null))}get typeId(){return l.Union}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}ws=Symbol.toStringTag;Pn[ws]=(n=>(n.mode=null,n.typeIds=null,n.children=null,n.typeIdToChildIndex=null,n.ArrayType=Int8Array,n[Symbol.toStringTag]="Union"))(Pn.prototype);let Vn=class extends _{constructor(t){super(),this.byteWidth=t}get typeId(){return l.FixedSizeBinary}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};Ss=Symbol.toStringTag;Vn[Ss]=(n=>(n.byteWidth=null,n.ArrayType=Uint8Array,n[Symbol.toStringTag]="FixedSizeBinary"))(Vn.prototype);let $n=class extends _{constructor(t,e){super(),this.listSize=t,this.children=[e]}get typeId(){return l.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};Is=Symbol.toStringTag;$n[Is]=(n=>(n.children=null,n.listSize=null,n[Symbol.toStringTag]="FixedSizeList"))($n.prototype);class Wn extends _{constructor(t,e=!1){super(),this.children=[t],this.keysSorted=e}get typeId(){return l.Map}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}Bs=Symbol.toStringTag;Wn[Bs]=(n=>(n.children=null,n.keysSorted=null,n[Symbol.toStringTag]="Map_"))(Wn.prototype);const Aa=(n=>()=>++n)(-1);class $e extends _{constructor(t,e,i,r){super(),this.indices=e,this.dictionary=t,this.isOrdered=r||!1,this.id=i==null?Aa():typeof i=="number"?i:i.low}get typeId(){return l.Dictionary}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}}As=Symbol.toStringTag;$e[As]=(n=>(n.id=null,n.indices=null,n.isOrdered=null,n.dictionary=null,n[Symbol.toStringTag]="Dictionary"))($e.prototype);function Qt(n){const t=n;switch(n.typeId){case l.Decimal:return n.bitWidth/32;case l.Timestamp:return 2;case l.Date:return 1+t.unit;case l.Interval:return 1+t.unit;case l.FixedSizeList:return t.listSize;case l.FixedSizeBinary:return t.byteWidth;default:return 1}}class L{visitMany(t,...e){return t.map((i,r)=>this.visit(i,...e.map(s=>s[r])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return Oa(this,t,e)}getVisitFnByTypeId(t,e=!0){return xe(this,t,e)}visitNull(t,...e){return null}visitBool(t,...e){return null}visitInt(t,...e){return null}visitFloat(t,...e){return null}visitUtf8(t,...e){return null}visitBinary(t,...e){return null}visitFixedSizeBinary(t,...e){return null}visitDate(t,...e){return null}visitTimestamp(t,...e){return null}visitTime(t,...e){return null}visitDecimal(t,...e){return null}visitList(t,...e){return null}visitStruct(t,...e){return null}visitUnion(t,...e){return null}visitDictionary(t,...e){return null}visitInterval(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}}function Oa(n,t,e=!0){return typeof t=="number"?xe(n,t,e):typeof t=="string"&&t in l?xe(n,l[t],e):t&&t instanceof _?xe(n,Mr(t),e):t!=null&&t.type&&t.type instanceof _?xe(n,Mr(t.type),e):xe(n,l.NONE,e)}function xe(n,t,e=!0){let i=null;switch(t){case l.Null:i=n.visitNull;break;case l.Bool:i=n.visitBool;break;case l.Int:i=n.visitInt;break;case l.Int8:i=n.visitInt8||n.visitInt;break;case l.Int16:i=n.visitInt16||n.visitInt;break;case l.Int32:i=n.visitInt32||n.visitInt;break;case l.Int64:i=n.visitInt64||n.visitInt;break;case l.Uint8:i=n.visitUint8||n.visitInt;break;case l.Uint16:i=n.visitUint16||n.visitInt;break;case l.Uint32:i=n.visitUint32||n.visitInt;break;case l.Uint64:i=n.visitUint64||n.visitInt;break;case l.Float:i=n.visitFloat;break;case l.Float16:i=n.visitFloat16||n.visitFloat;break;case l.Float32:i=n.visitFloat32||n.visitFloat;break;case l.Float64:i=n.visitFloat64||n.visitFloat;break;case l.Utf8:i=n.visitUtf8;break;case l.Binary:i=n.visitBinary;break;case l.FixedSizeBinary:i=n.visitFixedSizeBinary;break;case l.Date:i=n.visitDate;break;case l.DateDay:i=n.visitDateDay||n.visitDate;break;case l.DateMillisecond:i=n.visitDateMillisecond||n.visitDate;break;case l.Timestamp:i=n.visitTimestamp;break;case l.TimestampSecond:i=n.visitTimestampSecond||n.visitTimestamp;break;case l.TimestampMillisecond:i=n.visitTimestampMillisecond||n.visitTimestamp;break;case l.TimestampMicrosecond:i=n.visitTimestampMicrosecond||n.visitTimestamp;break;case l.TimestampNanosecond:i=n.visitTimestampNanosecond||n.visitTimestamp;break;case l.Time:i=n.visitTime;break;case l.TimeSecond:i=n.visitTimeSecond||n.visitTime;break;case l.TimeMillisecond:i=n.visitTimeMillisecond||n.visitTime;break;case l.TimeMicrosecond:i=n.visitTimeMicrosecond||n.visitTime;break;case l.TimeNanosecond:i=n.visitTimeNanosecond||n.visitTime;break;case l.Decimal:i=n.visitDecimal;break;case l.List:i=n.visitList;break;case l.Struct:i=n.visitStruct;break;case l.Union:i=n.visitUnion;break;case l.DenseUnion:i=n.visitDenseUnion||n.visitUnion;break;case l.SparseUnion:i=n.visitSparseUnion||n.visitUnion;break;case l.Dictionary:i=n.visitDictionary;break;case l.Interval:i=n.visitInterval;break;case l.IntervalDayTime:i=n.visitIntervalDayTime||n.visitInterval;break;case l.IntervalYearMonth:i=n.visitIntervalYearMonth||n.visitInterval;break;case l.FixedSizeList:i=n.visitFixedSizeList;break;case l.Map:i=n.visitMap;break}if(typeof i=="function")return i;if(!e)return()=>null;throw new Error(`Unrecognized type '${l[t]}'`)}function Mr(n){switch(n.typeId){case l.Null:return l.Null;case l.Int:{const{bitWidth:t,isSigned:e}=n;switch(t){case 8:return e?l.Int8:l.Uint8;case 16:return e?l.Int16:l.Uint16;case 32:return e?l.Int32:l.Uint32;case 64:return e?l.Int64:l.Uint64}return l.Int}case l.Float:switch(n.precision){case dt.HALF:return l.Float16;case dt.SINGLE:return l.Float32;case dt.DOUBLE:return l.Float64}return l.Float;case l.Binary:return l.Binary;case l.Utf8:return l.Utf8;case l.Bool:return l.Bool;case l.Decimal:return l.Decimal;case l.Time:switch(n.unit){case C.SECOND:return l.TimeSecond;case C.MILLISECOND:return l.TimeMillisecond;case C.MICROSECOND:return l.TimeMicrosecond;case C.NANOSECOND:return l.TimeNanosecond}return l.Time;case l.Timestamp:switch(n.unit){case C.SECOND:return l.TimestampSecond;case C.MILLISECOND:return l.TimestampMillisecond;case C.MICROSECOND:return l.TimestampMicrosecond;case C.NANOSECOND:return l.TimestampNanosecond}return l.Timestamp;case l.Date:switch(n.unit){case re.DAY:return l.DateDay;case re.MILLISECOND:return l.DateMillisecond}return l.Date;case l.Interval:switch(n.unit){case he.DAY_TIME:return l.IntervalDayTime;case he.YEAR_MONTH:return l.IntervalYearMonth}return l.Interval;case l.Map:return l.Map;case l.List:return l.List;case l.Struct:return l.Struct;case l.Union:switch(n.mode){case vt.Dense:return l.DenseUnion;case vt.Sparse:return l.SparseUnion}return l.Union;case l.FixedSizeBinary:return l.FixedSizeBinary;case l.FixedSizeList:return l.FixedSizeList;case l.Dictionary:return l.Dictionary}throw new Error(`Unrecognized type '${l[n.typeId]}'`)}L.prototype.visitInt8=null;L.prototype.visitInt16=null;L.prototype.visitInt32=null;L.prototype.visitInt64=null;L.prototype.visitUint8=null;L.prototype.visitUint16=null;L.prototype.visitUint32=null;L.prototype.visitUint64=null;L.prototype.visitFloat16=null;L.prototype.visitFloat32=null;L.prototype.visitFloat64=null;L.prototype.visitDateDay=null;L.prototype.visitDateMillisecond=null;L.prototype.visitTimestampSecond=null;L.prototype.visitTimestampMillisecond=null;L.prototype.visitTimestampMicrosecond=null;L.prototype.visitTimestampNanosecond=null;L.prototype.visitTimeSecond=null;L.prototype.visitTimeMillisecond=null;L.prototype.visitTimeMicrosecond=null;L.prototype.visitTimeNanosecond=null;L.prototype.visitDenseUnion=null;L.prototype.visitSparseUnion=null;L.prototype.visitIntervalDayTime=null;L.prototype.visitIntervalYearMonth=null;const Os=new Float64Array(1),Me=new Uint32Array(Os.buffer);function Fs(n){const t=(n&31744)>>10,e=(n&1023)/1024,i=Math.pow(-1,(n&32768)>>15);switch(t){case 31:return i*(e?Number.NaN:1/0);case 0:return i*(e?6103515625e-14*e:0)}return i*Math.pow(2,t-15)*(1+e)}function Fa(n){if(n!==n)return 32256;Os[0]=n;const t=(Me[1]&2147483648)>>16&65535;let e=Me[1]&2146435072,i=0;return e>=1089470464?Me[0]>0?e=31744:(e=(e&2080374784)>>16,i=(Me[1]&1048575)>>10):e<=1056964608?(i=1048576+(Me[1]&1048575),i=1048576+(i<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,i=(Me[1]&1048575)+512>>10),t|e|i&65535}class B extends L{}function F(n){return(t,e,i)=>{if(t.setValid(e,i!=null))return n(t,e,i)}}const Da=(n,t,e)=>{n[t]=Math.trunc(e/864e5)},Ji=(n,t,e)=>{n[t]=Math.trunc(e%4294967296),n[t+1]=Math.trunc(e/4294967296)},Ta=(n,t,e)=>{n[t]=Math.trunc(e*1e3%4294967296),n[t+1]=Math.trunc(e*1e3/4294967296)},Na=(n,t,e)=>{n[t]=Math.trunc(e*1e6%4294967296),n[t+1]=Math.trunc(e*1e6/4294967296)},Ds=(n,t,e,i)=>{if(e+1<t.length){const{[e]:r,[e+1]:s}=t;n.set(i.subarray(0,s-r),r)}},Ma=({offset:n,values:t},e,i)=>{const r=n+e;i?t[r>>3]|=1<<r%8:t[r>>3]&=~(1<<r%8)},se=({values:n},t,e)=>{n[t]=e},Gi=({values:n},t,e)=>{n[t]=e},Ts=({values:n},t,e)=>{n[t]=Fa(e)},xa=(n,t,e)=>{switch(n.type.precision){case dt.HALF:return Ts(n,t,e);case dt.SINGLE:case dt.DOUBLE:return Gi(n,t,e)}},Ns=({values:n},t,e)=>{Da(n,t,e.valueOf())},Ms=({values:n},t,e)=>{Ji(n,t*2,e.valueOf())},La=({stride:n,values:t},e,i)=>{t.set(i.subarray(0,n),n*e)},Ra=({values:n,valueOffsets:t},e,i)=>Ds(n,t,e,i),Ua=({values:n,valueOffsets:t},e,i)=>{Ds(n,t,e,$i(i))},Ca=(n,t,e)=>{n.type.unit===re.DAY?Ns(n,t,e):Ms(n,t,e)},xs=({values:n},t,e)=>Ji(n,t*2,e/1e3),Ls=({values:n},t,e)=>Ji(n,t*2,e),Rs=({values:n},t,e)=>Ta(n,t*2,e),Us=({values:n},t,e)=>Na(n,t*2,e),Ea=(n,t,e)=>{switch(n.type.unit){case C.SECOND:return xs(n,t,e);case C.MILLISECOND:return Ls(n,t,e);case C.MICROSECOND:return Rs(n,t,e);case C.NANOSECOND:return Us(n,t,e)}},Cs=({values:n},t,e)=>{n[t]=e},Es=({values:n},t,e)=>{n[t]=e},js=({values:n},t,e)=>{n[t]=e},zs=({values:n},t,e)=>{n[t]=e},ja=(n,t,e)=>{switch(n.type.unit){case C.SECOND:return Cs(n,t,e);case C.MILLISECOND:return Es(n,t,e);case C.MICROSECOND:return js(n,t,e);case C.NANOSECOND:return zs(n,t,e)}},za=({values:n,stride:t},e,i)=>{n.set(i.subarray(0,t),t*e)},ka=(n,t,e)=>{const i=n.children[0],r=n.valueOffsets,s=Dt.getVisitFn(i);if(Array.isArray(e))for(let o=-1,a=r[t],c=r[t+1];a<c;)s(i,a++,e[++o]);else for(let o=-1,a=r[t],c=r[t+1];a<c;)s(i,a++,e.get(++o))},Pa=(n,t,e)=>{const i=n.children[0],{valueOffsets:r}=n,s=Dt.getVisitFn(i);let{[t]:o,[t+1]:a}=r;const c=e instanceof Map?e.entries():Object.entries(e);for(const u of c)if(s(i,o,u),++o>=a)break},Va=(n,t)=>(e,i,r,s)=>i&&e(i,n,t[s]),$a=(n,t)=>(e,i,r,s)=>i&&e(i,n,t.get(s)),Wa=(n,t)=>(e,i,r,s)=>i&&e(i,n,t.get(r.name)),Ya=(n,t)=>(e,i,r,s)=>i&&e(i,n,t[r.name]),Ha=(n,t,e)=>{const i=n.type.children.map(s=>Dt.getVisitFn(s.type)),r=e instanceof Map?Wa(t,e):e instanceof k?$a(t,e):Array.isArray(e)?Va(t,e):Ya(t,e);n.type.children.forEach((s,o)=>r(i[o],n.children[o],s,o))},qa=(n,t,e)=>{n.type.mode===vt.Dense?ks(n,t,e):Ps(n,t,e)},ks=(n,t,e)=>{const i=n.type.typeIdToChildIndex[n.typeIds[t]],r=n.children[i];Dt.visit(r,n.valueOffsets[t],e)},Ps=(n,t,e)=>{const i=n.type.typeIdToChildIndex[n.typeIds[t]],r=n.children[i];Dt.visit(r,t,e)},Ja=(n,t,e)=>{var i;(i=n.dictionary)===null||i===void 0||i.set(n.values[t],e)},Ga=(n,t,e)=>{n.type.unit===he.DAY_TIME?Vs(n,t,e):$s(n,t,e)},Vs=({values:n},t,e)=>{n.set(e.subarray(0,2),2*t)},$s=({values:n},t,e)=>{n[t]=e[0]*12+e[1]%12},Ka=(n,t,e)=>{const{stride:i}=n,r=n.children[0],s=Dt.getVisitFn(r);if(Array.isArray(e))for(let o=-1,a=t*i;++o<i;)s(r,a+o,e[o]);else for(let o=-1,a=t*i;++o<i;)s(r,a+o,e.get(o))};B.prototype.visitBool=F(Ma);B.prototype.visitInt=F(se);B.prototype.visitInt8=F(se);B.prototype.visitInt16=F(se);B.prototype.visitInt32=F(se);B.prototype.visitInt64=F(se);B.prototype.visitUint8=F(se);B.prototype.visitUint16=F(se);B.prototype.visitUint32=F(se);B.prototype.visitUint64=F(se);B.prototype.visitFloat=F(xa);B.prototype.visitFloat16=F(Ts);B.prototype.visitFloat32=F(Gi);B.prototype.visitFloat64=F(Gi);B.prototype.visitUtf8=F(Ua);B.prototype.visitBinary=F(Ra);B.prototype.visitFixedSizeBinary=F(La);B.prototype.visitDate=F(Ca);B.prototype.visitDateDay=F(Ns);B.prototype.visitDateMillisecond=F(Ms);B.prototype.visitTimestamp=F(Ea);B.prototype.visitTimestampSecond=F(xs);B.prototype.visitTimestampMillisecond=F(Ls);B.prototype.visitTimestampMicrosecond=F(Rs);B.prototype.visitTimestampNanosecond=F(Us);B.prototype.visitTime=F(ja);B.prototype.visitTimeSecond=F(Cs);B.prototype.visitTimeMillisecond=F(Es);B.prototype.visitTimeMicrosecond=F(js);B.prototype.visitTimeNanosecond=F(zs);B.prototype.visitDecimal=F(za);B.prototype.visitList=F(ka);B.prototype.visitStruct=F(Ha);B.prototype.visitUnion=F(qa);B.prototype.visitDenseUnion=F(ks);B.prototype.visitSparseUnion=F(Ps);B.prototype.visitDictionary=F(Ja);B.prototype.visitInterval=F(Ga);B.prototype.visitIntervalDayTime=F(Vs);B.prototype.visitIntervalYearMonth=F($s);B.prototype.visitFixedSizeList=F(Ka);B.prototype.visitMap=F(Pa);const Dt=new B,Nt=Symbol.for("parent"),ke=Symbol.for("rowIndex");class Ki{constructor(t,e){return this[Nt]=t,this[ke]=e,new Proxy(this,new Qa)}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[ke],e=this[Nt],i=e.type.children,r={};for(let s=-1,o=i.length;++s<o;)r[i[s].name]=pt.visit(e.children[s],t);return r}toString(){return`{${[...this].map(([t,e])=>`${on(t)}: ${on(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Za(this[Nt],this[ke])}}class Za{constructor(t,e){this.childIndex=0,this.children=t.children,this.rowIndex=e,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){const t=this.childIndex;return t<this.numChildren?(this.childIndex=t+1,{done:!1,value:[this.childFields[t].name,pt.visit(this.children[t],this.rowIndex)]}):{done:!0,value:null}}}Object.defineProperties(Ki.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Nt]:{writable:!0,enumerable:!1,configurable:!1,value:null},[ke]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});class Qa{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Nt].type.children.map(e=>e.name)}has(t,e){return t[Nt].type.children.findIndex(i=>i.name===e)!==-1}getOwnPropertyDescriptor(t,e){if(t[Nt].type.children.findIndex(i=>i.name===e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[Nt].type.children.findIndex(r=>r.name===e);if(i!==-1){const r=pt.visit(t[Nt].children[i],t[ke]);return Reflect.set(t,e,r),r}}set(t,e,i){const r=t[Nt].type.children.findIndex(s=>s.name===e);return r!==-1?(Dt.visit(t[Nt].children[r],t[ke],i),Reflect.set(t,e,i)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,i):!1}}class v extends L{}function A(n){return(t,e)=>t.getValid(e)?n(t,e):null}const Xa=(n,t)=>864e5*n[t],Zi=(n,t)=>4294967296*n[t+1]+(n[t]>>>0),tc=(n,t)=>4294967296*(n[t+1]/1e3)+(n[t]>>>0)/1e3,ec=(n,t)=>4294967296*(n[t+1]/1e6)+(n[t]>>>0)/1e6,Ws=n=>new Date(n),nc=(n,t)=>Ws(Xa(n,t)),ic=(n,t)=>Ws(Zi(n,t)),rc=(n,t)=>null,Ys=(n,t,e)=>{if(e+1>=t.length)return null;const i=t[e],r=t[e+1];return n.subarray(i,r)},sc=({offset:n,values:t},e)=>{const i=n+e;return(t[i>>3]&1<<i%8)!==0},Hs=({values:n},t)=>nc(n,t),qs=({values:n},t)=>ic(n,t*2),me=({stride:n,values:t},e)=>t[n*e],oc=({stride:n,values:t},e)=>Fs(t[n*e]),Js=({values:n},t)=>n[t],ac=({stride:n,values:t},e)=>t.subarray(n*e,n*(e+1)),cc=({values:n,valueOffsets:t},e)=>Ys(n,t,e),lc=({values:n,valueOffsets:t},e)=>{const i=Ys(n,t,e);return i!==null?Ti(i):null},uc=({values:n},t)=>n[t],hc=({type:n,values:t},e)=>n.precision!==dt.HALF?t[e]:Fs(t[e]),dc=(n,t)=>n.type.unit===re.DAY?Hs(n,t):qs(n,t),Gs=({values:n},t)=>1e3*Zi(n,t*2),Ks=({values:n},t)=>Zi(n,t*2),Zs=({values:n},t)=>tc(n,t*2),Qs=({values:n},t)=>ec(n,t*2),fc=(n,t)=>{switch(n.type.unit){case C.SECOND:return Gs(n,t);case C.MILLISECOND:return Ks(n,t);case C.MICROSECOND:return Zs(n,t);case C.NANOSECOND:return Qs(n,t)}},Xs=({values:n},t)=>n[t],to=({values:n},t)=>n[t],eo=({values:n},t)=>n[t],no=({values:n},t)=>n[t],pc=(n,t)=>{switch(n.type.unit){case C.SECOND:return Xs(n,t);case C.MILLISECOND:return to(n,t);case C.MICROSECOND:return eo(n,t);case C.NANOSECOND:return no(n,t)}},yc=({values:n,stride:t},e)=>qi.decimal(n.subarray(t*e,t*(e+1))),mc=(n,t)=>{const{valueOffsets:e,stride:i,children:r}=n,{[t*i]:s,[t*i+1]:o}=e,c=r[0].slice(s,o-s);return new k([c])},bc=(n,t)=>{const{valueOffsets:e,children:i}=n,{[t]:r,[t+1]:s}=e,o=i[0];return new Qi(o.slice(r,s-r))},gc=(n,t)=>new Ki(n,t),_c=(n,t)=>n.type.mode===vt.Dense?io(n,t):ro(n,t),io=(n,t)=>{const e=n.type.typeIdToChildIndex[n.typeIds[t]],i=n.children[e];return pt.visit(i,n.valueOffsets[t])},ro=(n,t)=>{const e=n.type.typeIdToChildIndex[n.typeIds[t]],i=n.children[e];return pt.visit(i,t)},vc=(n,t)=>{var e;return(e=n.dictionary)===null||e===void 0?void 0:e.get(n.values[t])},wc=(n,t)=>n.type.unit===he.DAY_TIME?so(n,t):oo(n,t),so=({values:n},t)=>n.subarray(2*t,2*(t+1)),oo=({values:n},t)=>{const e=n[t],i=new Int32Array(2);return i[0]=Math.trunc(e/12),i[1]=Math.trunc(e%12),i},Sc=(n,t)=>{const{stride:e,children:i}=n,s=i[0].slice(t*e,e);return new k([s])};v.prototype.visitNull=A(rc);v.prototype.visitBool=A(sc);v.prototype.visitInt=A(uc);v.prototype.visitInt8=A(me);v.prototype.visitInt16=A(me);v.prototype.visitInt32=A(me);v.prototype.visitInt64=A(Js);v.prototype.visitUint8=A(me);v.prototype.visitUint16=A(me);v.prototype.visitUint32=A(me);v.prototype.visitUint64=A(Js);v.prototype.visitFloat=A(hc);v.prototype.visitFloat16=A(oc);v.prototype.visitFloat32=A(me);v.prototype.visitFloat64=A(me);v.prototype.visitUtf8=A(lc);v.prototype.visitBinary=A(cc);v.prototype.visitFixedSizeBinary=A(ac);v.prototype.visitDate=A(dc);v.prototype.visitDateDay=A(Hs);v.prototype.visitDateMillisecond=A(qs);v.prototype.visitTimestamp=A(fc);v.prototype.visitTimestampSecond=A(Gs);v.prototype.visitTimestampMillisecond=A(Ks);v.prototype.visitTimestampMicrosecond=A(Zs);v.prototype.visitTimestampNanosecond=A(Qs);v.prototype.visitTime=A(pc);v.prototype.visitTimeSecond=A(Xs);v.prototype.visitTimeMillisecond=A(to);v.prototype.visitTimeMicrosecond=A(eo);v.prototype.visitTimeNanosecond=A(no);v.prototype.visitDecimal=A(yc);v.prototype.visitList=A(mc);v.prototype.visitStruct=A(gc);v.prototype.visitUnion=A(_c);v.prototype.visitDenseUnion=A(io);v.prototype.visitSparseUnion=A(ro);v.prototype.visitDictionary=A(vc);v.prototype.visitInterval=A(wc);v.prototype.visitIntervalDayTime=A(so);v.prototype.visitIntervalYearMonth=A(oo);v.prototype.visitFixedSizeList=A(Sc);v.prototype.visitMap=A(bc);const pt=new v,Ct=Symbol.for("keys"),Pe=Symbol.for("vals");class Qi{constructor(t){return this[Ct]=new k([t.children[0]]).memoize(),this[Pe]=t.children[1],new Proxy(this,new Bc)}[Symbol.iterator](){return new Ic(this[Ct],this[Pe])}get size(){return this[Ct].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[Ct],e=this[Pe],i={};for(let r=-1,s=t.length;++r<s;)i[t.get(r)]=pt.visit(e,r);return i}toString(){return`{${[...this].map(([t,e])=>`${on(t)}: ${on(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class Ic{constructor(t,e){this.keys=t,this.vals=e,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){const t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),pt.visit(this.vals,t)]})}}class Bc{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Ct].toArray().map(String)}has(t,e){return t[Ct].includes(e)}getOwnPropertyDescriptor(t,e){if(t[Ct].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[Ct].indexOf(e);if(i!==-1){const r=pt.visit(Reflect.get(t,Pe),i);return Reflect.set(t,e,r),r}}set(t,e,i){const r=t[Ct].indexOf(e);return r!==-1?(Dt.visit(Reflect.get(t,Pe),r,i),Reflect.set(t,e,i)):Reflect.has(t,e)?Reflect.set(t,e,i):!1}}Object.defineProperties(Qi.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Ct]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Pe]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let xr;function ao(n,t,e,i){const{length:r=0}=n;let s=typeof t!="number"?0:t,o=typeof e!="number"?r:e;return s<0&&(s=(s%r+r)%r),o<0&&(o=(o%r+r)%r),o<s&&(xr=s,s=o,o=xr),o>r&&(o=r),i?i(n,s,o):[s,o]}const Lr=n=>n!==n;function Ze(n){if(typeof n!=="object"||n===null)return Lr(n)?Lr:e=>e===n;if(n instanceof Date){const e=n.valueOf();return i=>i instanceof Date?i.valueOf()===e:!1}return ArrayBuffer.isView(n)?e=>e?ba(n,e):!1:n instanceof Map?Oc(n):Array.isArray(n)?Ac(n):n instanceof k?Fc(n):Dc(n,!0)}function Ac(n){const t=[];for(let e=-1,i=n.length;++e<i;)t[e]=Ze(n[e]);return li(t)}function Oc(n){let t=-1;const e=[];for(const i of n.values())e[++t]=Ze(i);return li(e)}function Fc(n){const t=[];for(let e=-1,i=n.length;++e<i;)t[e]=Ze(n.get(e));return li(t)}function Dc(n,t=!1){const e=Object.keys(n);if(!t&&e.length===0)return()=>!1;const i=[];for(let r=-1,s=e.length;++r<s;)i[r]=Ze(n[e[r]]);return li(i,e)}function li(n,t){return e=>{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return Tc(n,e);case Map:return Rr(n,e,e.keys());case Qi:case Ki:case Object:case void 0:return Rr(n,e,t||Object.keys(e))}return e instanceof k?Nc(n,e):!1}}function Tc(n,t){const e=n.length;if(t.length!==e)return!1;for(let i=-1;++i<e;)if(!n[i](t[i]))return!1;return!0}function Nc(n,t){const e=n.length;if(t.length!==e)return!1;for(let i=-1;++i<e;)if(!n[i](t.get(i)))return!1;return!0}function Rr(n,t,e){const i=e[Symbol.iterator](),r=t instanceof Map?t.keys():Object.keys(t)[Symbol.iterator](),s=t instanceof Map?t.values():Object.values(t)[Symbol.iterator]();let o=0;const a=n.length;let c=s.next(),u=i.next(),d=r.next();for(;o<a&&!u.done&&!d.done&&!c.done&&!(u.value!==d.value||!n[o](c.value));++o,u=i.next(),d=r.next(),c=s.next());return o===a&&u.done&&d.done&&c.done?!0:(i.return&&i.return(),r.return&&r.return(),s.return&&s.return(),!1)}function co(n,t,e,i){return(e&1<<i)!==0}function Mc(n,t,e,i){return(e&1<<i)>>i}function Xi(n,t,e){const i=e.byteLength+7&-8;if(n>0||e.byteLength<i){const r=new Uint8Array(i);return r.set(n%8===0?e.subarray(n>>3):Yn(new tr(e,n,t,null,co)).subarray(0,i)),r}return e}function Yn(n){const t=[];let e=0,i=0,r=0;for(const o of n)o&&(r|=1<<i),++i===8&&(t[e++]=r,r=i=0);(e===0||i>0)&&(t[e++]=r);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}class tr{constructor(t,e,i,r,s){this.bytes=t,this.length=i,this.context=r,this.get=s,this.bit=e%8,this.byteIndex=e>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}}function Li(n,t,e){if(e-t<=0)return 0;if(e-t<8){let s=0;for(const o of new tr(n,t,e-t,n,Mc))s+=o;return s}const i=e>>3<<3,r=t+(t%8===0?0:8-t%8);return Li(n,t,r)+Li(n,i,e)+xc(n,r>>3,i-r>>3)}function xc(n,t,e){let i=0,r=Math.trunc(t);const s=new DataView(n.buffer,n.byteOffset,n.byteLength),o=e===void 0?n.byteLength:r+e;for(;o-r>=4;)i+=Bi(s.getUint32(r)),r+=4;for(;o-r>=2;)i+=Bi(s.getUint16(r)),r+=2;for(;o-r>=1;)i+=Bi(s.getUint8(r)),r+=1;return i}function Bi(n){let t=Math.trunc(n);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const Lc=-1;class H{constructor(t,e,i,r,s,o=[],a){this.type=t,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(i||0,0)),this._nullCount=Math.floor(Math.max(r||0,-1));let c;s instanceof H?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=Qt(t),s&&((c=s[0])&&(this.valueOffsets=c),(c=s[1])&&(this.values=c),(c=s[2])&&(this.nullBitmap=c),(c=s[3])&&(this.typeIds=c))),this.nullable=this._nullCount!==0&&this.nullBitmap&&this.nullBitmap.byteLength>0}get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get byteLength(){let t=0;const{valueOffsets:e,values:i,nullBitmap:r,typeIds:s}=this;return e&&(t+=e.byteLength),i&&(t+=i.byteLength),r&&(t+=r.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){let t=this._nullCount,e;return t<=Lc&&(e=this.nullBitmap)&&(this._nullCount=t=this.length-Li(e,this.offset,this.offset+this.length)),t}getValid(t){if(this.nullable&&this.nullCount>0){const e=this.offset+t;return(this.nullBitmap[e>>3]&1<<e%8)!==0}return!0}setValid(t,e){if(!this.nullable)return e;if(!this.nullBitmap||this.nullBitmap.byteLength<=t>>3){const{nullBitmap:c}=this._changeLengthAndBackfillNullBitmap(this.length);Object.assign(this,{nullBitmap:c,_nullCount:0})}const{nullBitmap:i,offset:r}=this,s=r+t>>3,o=(r+t)%8,a=i[s]>>o&1;return e?a===0&&(i[s]|=1<<o,this._nullCount=this.nullCount+1):a===1&&(i[s]&=~(1<<o),this._nullCount=this.nullCount-1),e}clone(t=this.type,e=this.offset,i=this.length,r=this._nullCount,s=this,o=this.children){return new H(t,e,i,r,s,o,this.dictionary)}slice(t,e){const{stride:i,typeId:r,children:s}=this,o=+(this._nullCount===0)-1,a=r===16?i:1,c=this._sliceBuffers(t,e,i,r);return this.clone(this.type,this.offset+t,e,o,c,s.length===0||this.valueOffsets?s:this._sliceChildren(s,a*t,a*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===l.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:i}=this,r=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);r[e>>3]=(1<<e-(e&-8))-1,i>0&&r.set(Xi(this.offset,e,this.nullBitmap),0);const s=this.buffers;return s[Zt.VALIDITY]=r,this.clone(this.type,0,t,i+(t-e),s)}_sliceBuffers(t,e,i,r){let s;const{buffers:o}=this;return(s=o[Zt.TYPE])&&(o[Zt.TYPE]=s.subarray(t,t+e)),(s=o[Zt.OFFSET])&&(o[Zt.OFFSET]=s.subarray(t,t+e+1))||(s=o[Zt.DATA])&&(o[Zt.DATA]=r===6?s:s.subarray(i*t,i*(t+e))),o}_sliceChildren(t,e,i){return t.map(r=>r.slice(e,i))}}H.prototype.children=Object.freeze([]);class nn extends L{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){const{["type"]:e,["offset"]:i=0,["length"]:r=0}=t;return new H(e,i,r,0)}visitBool(t){const{["type"]:e,["offset"]:i=0}=t,r=U(t.nullBitmap),s=W(e.ArrayType,t.data),{["length"]:o=s.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new H(e,i,o,a,[void 0,s,r])}visitInt(t){const{["type"]:e,["offset"]:i=0}=t,r=U(t.nullBitmap),s=W(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new H(e,i,o,a,[void 0,s,r])}visitFloat(t){const{["type"]:e,["offset"]:i=0}=t,r=U(t.nullBitmap),s=W(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new H(e,i,o,a,[void 0,s,r])}visitUtf8(t){const{["type"]:e,["offset"]:i=0}=t,r=U(t.data),s=U(t.nullBitmap),o=Qe(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new H(e,i,a,c,[o,r,s])}visitBinary(t){const{["type"]:e,["offset"]:i=0}=t,r=U(t.data),s=U(t.nullBitmap),o=Qe(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new H(e,i,a,c,[o,r,s])}visitFixedSizeBinary(t){const{["type"]:e,["offset"]:i=0}=t,r=U(t.nullBitmap),s=W(e.ArrayType,t.data),{["length"]:o=s.length/Qt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new H(e,i,o,a,[void 0,s,r])}visitDate(t){const{["type"]:e,["offset"]:i=0}=t,r=U(t.nullBitmap),s=W(e.ArrayType,t.data),{["length"]:o=s.length/Qt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new H(e,i,o,a,[void 0,s,r])}visitTimestamp(t){const{["type"]:e,["offset"]:i=0}=t,r=U(t.nullBitmap),s=W(e.ArrayType,t.data),{["length"]:o=s.length/Qt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new H(e,i,o,a,[void 0,s,r])}visitTime(t){const{["type"]:e,["offset"]:i=0}=t,r=U(t.nullBitmap),s=W(e.ArrayType,t.data),{["length"]:o=s.length/Qt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new H(e,i,o,a,[void 0,s,r])}visitDecimal(t){const{["type"]:e,["offset"]:i=0}=t,r=U(t.nullBitmap),s=W(e.ArrayType,t.data),{["length"]:o=s.length/Qt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new H(e,i,o,a,[void 0,s,r])}visitList(t){const{["type"]:e,["offset"]:i=0,["child"]:r}=t,s=U(t.nullBitmap),o=Qe(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new H(e,i,a,c,[o,void 0,s],[r])}visitStruct(t){const{["type"]:e,["offset"]:i=0,["children"]:r=[]}=t,s=U(t.nullBitmap),{length:o=r.reduce((c,{length:u})=>Math.max(c,u),0),nullCount:a=t.nullBitmap?-1:0}=t;return new H(e,i,o,a,[void 0,void 0,s],r)}visitUnion(t){const{["type"]:e,["offset"]:i=0,["children"]:r=[]}=t,s=U(t.nullBitmap),o=W(e.ArrayType,t.typeIds),{["length"]:a=o.length,["nullCount"]:c=t.nullBitmap?-1:0}=t;if(_.isSparseUnion(e))return new H(e,i,a,c,[void 0,void 0,s,o],r);const u=Qe(t.valueOffsets);return new H(e,i,a,c,[u,void 0,s,o],r)}visitDictionary(t){const{["type"]:e,["offset"]:i=0}=t,r=U(t.nullBitmap),s=W(e.indices.ArrayType,t.data),{["dictionary"]:o=new k([new nn().visit({type:e.dictionary})])}=t,{["length"]:a=s.length,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new H(e,i,a,c,[void 0,s,r],[],o)}visitInterval(t){const{["type"]:e,["offset"]:i=0}=t,r=U(t.nullBitmap),s=W(e.ArrayType,t.data),{["length"]:o=s.length/Qt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new H(e,i,o,a,[void 0,s,r])}visitFixedSizeList(t){const{["type"]:e,["offset"]:i=0,["child"]:r=new nn().visit({type:e.valueType})}=t,s=U(t.nullBitmap),{["length"]:o=r.length/Qt(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new H(e,i,o,a,[void 0,void 0,s],[r])}visitMap(t){const{["type"]:e,["offset"]:i=0,["child"]:r=new nn().visit({type:e.childType})}=t,s=U(t.nullBitmap),o=Qe(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=t.nullBitmap?-1:0}=t;return new H(e,i,a,c,[o,void 0,s],[r])}}function x(n){return new nn().visit(n)}class Ur{constructor(t=0,e){this.numChunks=t,this.getChunkIterator=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){const 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 lo(n){return n.reduce((t,e)=>t+e.nullCount,0)}function uo(n){return n.reduce((t,e,i)=>(t[i+1]=t[i]+e.length,t),new Uint32Array(n.length+1))}function ho(n,t,e,i){const r=[];for(let s=-1,o=n.length;++s<o;){const a=n[s],c=t[s],{length:u}=a;if(c>=i)break;if(e>=c+u)continue;if(c>=e&&c+u<=i){r.push(a);continue}const d=Math.max(0,e-c),p=Math.min(i-c,u);r.push(a.slice(d,p-d))}return r.length===0&&r.push(n[0].slice(0,0)),r}function er(n,t,e,i){let r=0,s=0,o=t.length-1;do{if(r>=o-1)return e<t[o]?i(n,r,e-t[r]):null;s=r+Math.trunc((o-r)*.5),e<t[s]?o=s:r=s}while(r<o)}function nr(n,t){return n.getValid(t)}function Ve(n){function t(e,i,r){return n(e[i],r)}return function(e){const i=this.data;return er(i,this._offsets,e,t)}}function fo(n){let t;function e(i,r,s){return n(i[r],s,t)}return function(i,r){const s=this.data;t=r;const o=er(s,this._offsets,i,e);return t=void 0,o}}function po(n){let t;function e(i,r,s){let o=s,a=0,c=0;for(let u=r-1,d=i.length;++u<d;){const p=i[u];if(~(a=n(p,t,o)))return c+a;o=0,c+=p.length}return-1}return function(i,r){t=i;const s=this.data,o=typeof r!="number"?e(s,0,0):er(s,this._offsets,r,e);return t=void 0,o}}class w extends L{}function Rc(n,t){return t===null&&n.length>0?0:-1}function Uc(n,t){const{nullBitmap:e}=n;if(!e||n.nullCount<=0)return-1;let i=0;for(const r of new tr(e,n.offset+(t||0),n.length,e,co)){if(!r)return i;++i}return-1}function M(n,t,e){if(t===void 0)return-1;if(t===null)return Uc(n,e);const i=pt.getVisitFn(n),r=Ze(t);for(let s=(e||0)-1,o=n.length;++s<o;)if(r(i(n,s)))return s;return-1}function yo(n,t,e){const i=pt.getVisitFn(n),r=Ze(t);for(let s=(e||0)-1,o=n.length;++s<o;)if(r(i(n,s)))return s;return-1}w.prototype.visitNull=Rc;w.prototype.visitBool=M;w.prototype.visitInt=M;w.prototype.visitInt8=M;w.prototype.visitInt16=M;w.prototype.visitInt32=M;w.prototype.visitInt64=M;w.prototype.visitUint8=M;w.prototype.visitUint16=M;w.prototype.visitUint32=M;w.prototype.visitUint64=M;w.prototype.visitFloat=M;w.prototype.visitFloat16=M;w.prototype.visitFloat32=M;w.prototype.visitFloat64=M;w.prototype.visitUtf8=M;w.prototype.visitBinary=M;w.prototype.visitFixedSizeBinary=M;w.prototype.visitDate=M;w.prototype.visitDateDay=M;w.prototype.visitDateMillisecond=M;w.prototype.visitTimestamp=M;w.prototype.visitTimestampSecond=M;w.prototype.visitTimestampMillisecond=M;w.prototype.visitTimestampMicrosecond=M;w.prototype.visitTimestampNanosecond=M;w.prototype.visitTime=M;w.prototype.visitTimeSecond=M;w.prototype.visitTimeMillisecond=M;w.prototype.visitTimeMicrosecond=M;w.prototype.visitTimeNanosecond=M;w.prototype.visitDecimal=M;w.prototype.visitList=M;w.prototype.visitStruct=M;w.prototype.visitUnion=M;w.prototype.visitDenseUnion=yo;w.prototype.visitSparseUnion=yo;w.prototype.visitDictionary=M;w.prototype.visitInterval=M;w.prototype.visitIntervalDayTime=M;w.prototype.visitIntervalYearMonth=M;w.prototype.visitFixedSizeList=M;w.prototype.visitMap=M;const Hn=new w;class S extends L{}function O(n){const{type:t}=n;if(n.nullCount===0&&n.stride===1&&(t.typeId===l.Timestamp||t instanceof fe&&t.bitWidth!==64||t instanceof un&&t.bitWidth!==64||t instanceof ln&&t.precision!==dt.HALF))return new Ur(n.data.length,i=>{const r=n.data[i];return r.values.subarray(0,r.length)[Symbol.iterator]()});let e=0;return new Ur(n.data.length,i=>{const s=n.data[i].length,o=n.slice(e,e+s);return e+=s,new Cc(o)})}class Cc{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}}S.prototype.visitNull=O;S.prototype.visitBool=O;S.prototype.visitInt=O;S.prototype.visitInt8=O;S.prototype.visitInt16=O;S.prototype.visitInt32=O;S.prototype.visitInt64=O;S.prototype.visitUint8=O;S.prototype.visitUint16=O;S.prototype.visitUint32=O;S.prototype.visitUint64=O;S.prototype.visitFloat=O;S.prototype.visitFloat16=O;S.prototype.visitFloat32=O;S.prototype.visitFloat64=O;S.prototype.visitUtf8=O;S.prototype.visitBinary=O;S.prototype.visitFixedSizeBinary=O;S.prototype.visitDate=O;S.prototype.visitDateDay=O;S.prototype.visitDateMillisecond=O;S.prototype.visitTimestamp=O;S.prototype.visitTimestampSecond=O;S.prototype.visitTimestampMillisecond=O;S.prototype.visitTimestampMicrosecond=O;S.prototype.visitTimestampNanosecond=O;S.prototype.visitTime=O;S.prototype.visitTimeSecond=O;S.prototype.visitTimeMillisecond=O;S.prototype.visitTimeMicrosecond=O;S.prototype.visitTimeNanosecond=O;S.prototype.visitDecimal=O;S.prototype.visitList=O;S.prototype.visitStruct=O;S.prototype.visitUnion=O;S.prototype.visitDenseUnion=O;S.prototype.visitSparseUnion=O;S.prototype.visitDictionary=O;S.prototype.visitInterval=O;S.prototype.visitIntervalDayTime=O;S.prototype.visitIntervalYearMonth=O;S.prototype.visitFixedSizeList=O;S.prototype.visitMap=O;const ir=new S,Ec=(n,t)=>n+t;class be extends L{visitNull(t,e){return 0}visitInt(t,e){return t.type.bitWidth/8}visitFloat(t,e){return t.type.ArrayType.BYTES_PER_ELEMENT}visitBool(t,e){return 1/8}visitDecimal(t,e){return t.type.bitWidth/8}visitDate(t,e){return(t.type.unit+1)*4}visitTime(t,e){return t.type.bitWidth/8}visitTimestamp(t,e){return t.type.unit===C.SECOND?4:8}visitInterval(t,e){return(t.type.unit+1)*4}visitStruct(t,e){return t.children.reduce((i,r)=>i+Yt.visit(r,e),0)}visitFixedSizeBinary(t,e){return t.type.byteWidth}visitMap(t,e){return 8+t.children.reduce((i,r)=>i+Yt.visit(r,e),0)}visitDictionary(t,e){var i;return t.type.indices.bitWidth/8+(((i=t.dictionary)===null||i===void 0?void 0:i.getByteLength(t.values[e]))||0)}}const jc=({valueOffsets:n},t)=>8+(n[t+1]-n[t]),zc=({valueOffsets:n},t)=>8+(n[t+1]-n[t]),kc=({valueOffsets:n,stride:t,children:e},i)=>{const r=e[0],{[i*t]:s}=n,{[i*t+1]:o}=n,a=Yt.getVisitFn(r.type),c=r.slice(s,o-s);let u=8;for(let d=-1,p=o-s;++d<p;)u+=a(c,d);return u},Pc=({stride:n,children:t},e)=>{const i=t[0],r=i.slice(e*n,n),s=Yt.getVisitFn(i.type);let o=0;for(let a=-1,c=r.length;++a<c;)o+=s(r,a);return o},Vc=(n,t)=>n.type.mode===vt.Dense?mo(n,t):bo(n,t),mo=({type:n,children:t,typeIds:e,valueOffsets:i},r)=>{const s=n.typeIdToChildIndex[e[r]];return 8+Yt.visit(t[s],i[r])},bo=({children:n},t)=>4+Yt.visitMany(n,n.map(()=>t)).reduce(Ec,0);be.prototype.visitUtf8=jc;be.prototype.visitBinary=zc;be.prototype.visitList=kc;be.prototype.visitFixedSizeList=Pc;be.prototype.visitUnion=Vc;be.prototype.visitDenseUnion=mo;be.prototype.visitSparseUnion=bo;const Yt=new be;var go;const _o={},vo={};class k{constructor(t){var e,i,r;const s=t[0]instanceof k?t.flatMap(a=>a.data):t;if(s.length===0||s.some(a=>!(a instanceof H)))throw new TypeError("Vector constructor expects an Array of Data instances.");const o=(e=s[0])===null||e===void 0?void 0:e.type;switch(s.length){case 0:this._offsets=[0];break;case 1:{const{get:a,set:c,indexOf:u,byteLength:d}=_o[o.typeId],p=s[0];this.isValid=b=>nr(p,b),this.get=b=>a(p,b),this.set=(b,m)=>c(p,b,m),this.indexOf=b=>u(p,b),this.getByteLength=b=>d(p,b),this._offsets=[0,p.length];break}default:Object.setPrototypeOf(this,vo[o.typeId]),this._offsets=uo(s);break}this.data=s,this.type=o,this.stride=Qt(o),this.numChildren=(r=(i=o.children)===null||i===void 0?void 0:i.length)!==null&&r!==void 0?r:0,this.length=this._offsets[this._offsets.length-1]}get byteLength(){return this._byteLength===-1&&(this._byteLength=this.data.reduce((t,e)=>t+e.byteLength,0)),this._byteLength}get nullCount(){return this._nullCount===-1&&(this._nullCount=lo(this.data)),this._nullCount}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${l[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>0}getByteLength(t){return 0}[Symbol.iterator](){return ir.visit(this)}concat(...t){return new k(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new k(ao(this,t,e,({data:i,_offsets:r},s,o)=>ho(i,r,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:i,stride:r,ArrayType:s}=this;switch(t.typeId){case l.Int:case l.Float:case l.Decimal:case l.Time:case l.Timestamp:switch(e.length){case 0:return new s;case 1:return e[0].values.subarray(0,i*r);default:return e.reduce((o,{values:a,length:c})=>(o.array.set(a.subarray(0,c*r),o.offset),o.offset+=c*r,o),{array:new s(i*r),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(i=>i.name===t))}getChildAt(t){return t>-1&&t<this.numChildren?new k(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)){const t=new qn(this.data[0].dictionary),e=this.data.map(i=>{const r=i.clone();return r.dictionary=t,r});return new k(e)}return new qn(this)}unmemoize(){if(_.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(i=>{const r=i.clone();return r.dictionary=t,r});return new k(e)}return this}}go=Symbol.toStringTag;k[go]=(n=>{n.type=_.prototype,n.data=[],n.length=0,n.stride=1,n.numChildren=0,n._nullCount=-1,n._byteLength=-1,n._offsets=new Uint32Array([0]),n[Symbol.isConcatSpreadable]=!0;const t=Object.keys(l).map(e=>l[e]).filter(e=>typeof e=="number"&&e!==l.NONE);for(const e of t){const i=pt.getVisitFnByTypeId(e),r=Dt.getVisitFnByTypeId(e),s=Hn.getVisitFnByTypeId(e),o=Yt.getVisitFnByTypeId(e);_o[e]={get:i,set:r,indexOf:s,byteLength:o},vo[e]=Object.create(n,{isValid:{value:Ve(nr)},get:{value:Ve(pt.getVisitFnByTypeId(e))},set:{value:fo(Dt.getVisitFnByTypeId(e))},indexOf:{value:po(Hn.getVisitFnByTypeId(e))},getByteLength:{value:Ve(Yt.getVisitFnByTypeId(e))}})}return"Vector"})(k.prototype);class qn extends k{constructor(t){super(t.data);const e=this.get,i=this.set,r=this.slice,s=new Array(this.length);Object.defineProperty(this,"get",{value(o){const a=s[o];if(a!==void 0)return a;const c=e.call(this,o);return s[o]=c,c}}),Object.defineProperty(this,"set",{value(o,a){i.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new qn(r.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new k(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}class Ri{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,i,r){return t.prep(8,24),t.writeInt64(r),t.pad(4),t.writeInt32(i),t.writeInt64(e),t.offset()}}const Ai=2,Et=4,te=4,Y=4,ce=new Int32Array(2),Cr=new Float32Array(ce.buffer),Er=new Float64Array(ce.buffer),Bn=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;let ne=class Ui{constructor(t,e){this.low=t|0,this.high=e|0}static create(t,e){return t==0&&e==0?Ui.ZERO:new Ui(t,e)}toFloat64(){return(this.low>>>0)+this.high*4294967296}equals(t){return this.low==t.low&&this.high==t.high}};ne.ZERO=new ne(0,0);var Ci;(function(n){n[n.UTF8_BYTES=1]="UTF8_BYTES",n[n.UTF16_STRING=2]="UTF16_STRING"})(Ci||(Ci={}));let We=class wo{constructor(t){this.bytes_=t,this.position_=0}static allocate(t){return new wo(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return new ne(this.readInt32(t),this.readInt32(t+4))}readUint64(t){return new ne(this.readUint32(t),this.readUint32(t+4))}readFloat32(t){return ce[0]=this.readInt32(t),Cr[0]}readFloat64(t){return ce[Bn?0:1]=this.readInt32(t),ce[Bn?1:0]=this.readInt32(t+4),Er[0]}writeInt8(t,e){this.bytes_[t]=e}writeUint8(t,e){this.bytes_[t]=e}writeInt16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeUint16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeInt32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeUint32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeInt64(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)}writeUint64(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)}writeFloat32(t,e){Cr[0]=e,this.writeInt32(t,ce[0])}writeFloat64(t,e){Er[0]=e,this.writeInt32(t,ce[Bn?0:1]),this.writeInt32(t+4,ce[Bn?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+Et+te)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let t="";for(let e=0;e<te;e++)t+=String.fromCharCode(this.readInt8(this.position_+Et+e));return t}__offset(t,e){const i=t-this.readInt32(t);return e<this.readInt16(i)?this.readInt16(i+e):0}__union(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t}__string(t,e){t+=this.readInt32(t);const i=this.readInt32(t);let r="",s=0;if(t+=Et,e===Ci.UTF8_BYTES)return this.bytes_.subarray(t,t+i);for(;s<i;){let o;const a=this.readUint8(t+s++);if(a<192)o=a;else{const c=this.readUint8(t+s++);if(a<224)o=(a&31)<<6|c&63;else{const u=this.readUint8(t+s++);if(a<240)o=(a&15)<<12|(c&63)<<6|u&63;else{const d=this.readUint8(t+s++);o=(a&7)<<18|(c&63)<<12|(u&63)<<6|d&63}}}o<65536?r+=String.fromCharCode(o):(o-=65536,r+=String.fromCharCode((o>>10)+55296,(o&1023)+56320))}return r}__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)+Et}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=te)throw new Error("FlatBuffers: file identifier must be length "+te);for(let e=0;e<te;e++)if(t.charCodeAt(e)!=this.readInt8(this.position()+Et+e))return!1;return!0}createLong(t,e){return ne.create(t,e)}createScalarList(t,e){const i=[];for(let r=0;r<e;++r)t(r)!==null&&i.push(t(r));return i}createObjList(t,e){const i=[];for(let r=0;r<e;++r){const s=t(r);s!==null&&i.push(s.unpack())}return i}},So=class Io{constructor(t){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null;let e;t?e=t:e=1024,this.bb=We.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);const i=~(this.bb.capacity()-this.space+e)+1&t-1;for(;this.space<i+t+e;){const r=this.bb.capacity();this.bb=Io.growByteBuffer(this.bb),this.space+=this.bb.capacity()-r}this.pad(i)}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,i){(this.force_defaults||e!=i)&&(this.addInt8(e),this.slot(t))}addFieldInt16(t,e,i){(this.force_defaults||e!=i)&&(this.addInt16(e),this.slot(t))}addFieldInt32(t,e,i){(this.force_defaults||e!=i)&&(this.addInt32(e),this.slot(t))}addFieldInt64(t,e,i){(this.force_defaults||!e.equals(i))&&(this.addInt64(e),this.slot(t))}addFieldFloat32(t,e,i){(this.force_defaults||e!=i)&&(this.addFloat32(e),this.slot(t))}addFieldFloat64(t,e,i){(this.force_defaults||e!=i)&&(this.addFloat64(e),this.slot(t))}addFieldOffset(t,e,i){(this.force_defaults||e!=i)&&(this.addOffset(e),this.slot(t))}addFieldStruct(t,e,i){e!=i&&(this.nested(e),this.slot(t))}nested(t){if(t!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")}slot(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){const e=t.capacity();if(e&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");const i=e<<1,r=We.allocate(i);return r.setPosition(i-e),r.bytes().set(t.bytes(),i-e),r}addOffset(t){this.prep(Et,0),this.writeInt32(this.offset()-t+Et)}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);const t=this.offset();let e=this.vtable_in_use-1;for(;e>=0&&this.vtable[e]==0;e--);const i=e+1;for(;e>=0;e--)this.addInt16(this.vtable[e]!=0?t-this.vtable[e]:0);const r=2;this.addInt16(t-this.object_start);const s=(i+r)*Ai;this.addInt16(s);let o=0;const a=this.space;t:for(e=0;e<this.vtables.length;e++){const c=this.bb.capacity()-this.vtables[e];if(s==this.bb.readInt16(c)){for(let u=Ai;u<s;u+=Ai)if(this.bb.readInt16(a+u)!=this.bb.readInt16(c+u))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,i){const r=i?Y:0;if(e){const s=e;if(this.prep(this.minalign,Et+te+r),s.length!=te)throw new Error("FlatBuffers: file identifier must be length "+te);for(let o=te-1;o>=0;o--)this.writeInt8(s.charCodeAt(o))}this.prep(this.minalign,Et+r),this.addOffset(t),r&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,e){this.finish(t,e,!0)}requiredField(t,e){const i=this.bb.capacity()-t,r=i-this.bb.readInt32(i);if(!(this.bb.readInt16(r+e)!=0))throw new Error("FlatBuffers: field "+e+" must be set")}startVector(t,e,i){this.notNested(),this.vector_num_elems=e,this.prep(Et,t*e),this.prep(i,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);const e=this.createString(t);return this.string_maps.set(t,e),e}createString(t){if(!t)return 0;let e;if(t instanceof Uint8Array)e=t;else{e=[];let i=0;for(;i<t.length;){let r;const s=t.charCodeAt(i++);if(s<55296||s>=56320)r=s;else{const o=t.charCodeAt(i++);r=(s<<10)+o+-56613888}r<128?e.push(r):(r<2048?e.push(r>>6&31|192):(r<65536?e.push(r>>12&15|224):e.push(r>>18&7|240,r>>12&63|128),e.push(r>>6&63|128)),e.push(r&63|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length);for(let i=0,r=this.space,s=this.bb.bytes();i<e.length;i++)s[r++]=e[i];return this.endVector()}createLong(t,e){return ne.create(t,e)}createObjectOffset(t){return t===null?0:typeof t=="string"?this.createString(t):t.pack(this)}createObjectOffsetList(t){const e=[];for(let i=0;i<t.length;++i){const r=t[i];if(r!==null)e.push(this.createObjectOffset(r));else throw new Error("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return e}createStructOffsetList(t,e){return e(this,t.length),this.createObjectOffsetList(t),this.endVector()}};class nt{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 nt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKeyValue(t,e){return t.setPosition(t.position()+Y),(e||new nt).__init(t.readInt32(t.position())+t.position(),t)}key(t){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}value(t){const 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,i){return nt.startKeyValue(t),nt.addKey(t,e),nt.addValue(t,i),nt.endKeyValue(t)}}var Ye;(function(n){n[n.V1=0]="V1",n[n.V2=1]="V2",n[n.V3=2]="V3",n[n.V4=3]="V4",n[n.V5=4]="V5"})(Ye||(Ye={}));var He;(function(n){n[n.Little=0]="Little",n[n.Big=1]="Big"})(He||(He={}));var Jn;(function(n){n[n.DenseArray=0]="DenseArray"})(Jn||(Jn={}));class gt{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsInt(t,e){return(e||new gt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInt(t,e){return t.setPosition(t.position()+Y),(e||new gt).__init(t.readInt32(t.position())+t.position(),t)}bitWidth(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}isSigned(){const 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,i){return gt.startInt(t),gt.addBitWidth(t,e),gt.addIsSigned(t,i),gt.endInt(t)}}class ee{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 ee).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryEncoding(t,e){return t.setPosition(t.position()+Y),(e||new ee).__init(t.readInt32(t.position())+t.position(),t)}id(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}indexType(t){const e=this.bb.__offset(this.bb_pos,6);return e?(t||new gt).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}isOrdered(){const t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}dictionaryKind(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt16(this.bb_pos+t):Jn.DenseArray}static startDictionaryEncoding(t){t.startObject(4)}static addId(t,e){t.addFieldInt64(0,e,t.createLong(0,0))}static addIndexType(t,e){t.addFieldOffset(1,e,0)}static addIsOrdered(t,e){t.addFieldInt8(2,+e,0)}static addDictionaryKind(t,e){t.addFieldInt16(3,e,Jn.DenseArray)}static endDictionaryEncoding(t){return t.endObject()}}class ve{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 ve).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBinary(t,e){return t.setPosition(t.position()+Y),(e||new ve).__init(t.readInt32(t.position())+t.position(),t)}static startBinary(t){t.startObject(0)}static endBinary(t){return t.endObject()}static createBinary(t){return ve.startBinary(t),ve.endBinary(t)}}class we{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 we).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBool(t,e){return t.setPosition(t.position()+Y),(e||new we).__init(t.readInt32(t.position())+t.position(),t)}static startBool(t){t.startObject(0)}static endBool(t){return t.endObject()}static createBool(t){return we.startBool(t),we.endBool(t)}}var Gn;(function(n){n[n.DAY=0]="DAY",n[n.MILLISECOND=1]="MILLISECOND"})(Gn||(Gn={}));let Fn=class Le{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 Le).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDate(t,e){return t.setPosition(t.position()+Y),(e||new Le).__init(t.readInt32(t.position())+t.position(),t)}unit(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Gn.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,Gn.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,e){return Le.startDate(t),Le.addUnit(t,e),Le.endDate(t)}};class lt{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 lt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDecimal(t,e){return t.setPosition(t.position()+Y),(e||new lt).__init(t.readInt32(t.position())+t.position(),t)}precision(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}scale(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}bitWidth(){const 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,i,r){return lt.startDecimal(t),lt.addPrecision(t,e),lt.addScale(t,i),lt.addBitWidth(t,r),lt.endDecimal(t)}}var qe;(function(n){n[n.SECOND=0]="SECOND",n[n.MILLISECOND=1]="MILLISECOND",n[n.MICROSECOND=2]="MICROSECOND",n[n.NANOSECOND=3]="NANOSECOND"})(qe||(qe={}));class jt{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 jt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeBinary(t,e){return t.setPosition(t.position()+Y),(e||new jt).__init(t.readInt32(t.position())+t.position(),t)}byteWidth(){const 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 jt.startFixedSizeBinary(t),jt.addByteWidth(t,e),jt.endFixedSizeBinary(t)}}class zt{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 zt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFixedSizeList(t,e){return t.setPosition(t.position()+Y),(e||new zt).__init(t.readInt32(t.position())+t.position(),t)}listSize(){const 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 zt.startFixedSizeList(t),zt.addListSize(t,e),zt.endFixedSizeList(t)}}var Kn;(function(n){n[n.HALF=0]="HALF",n[n.SINGLE=1]="SINGLE",n[n.DOUBLE=2]="DOUBLE"})(Kn||(Kn={}));class kt{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 kt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFloatingPoint(t,e){return t.setPosition(t.position()+Y),(e||new kt).__init(t.readInt32(t.position())+t.position(),t)}precision(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Kn.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(t,e){t.addFieldInt16(0,e,Kn.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,e){return kt.startFloatingPoint(t),kt.addPrecision(t,e),kt.endFloatingPoint(t)}}var Zn;(function(n){n[n.YEAR_MONTH=0]="YEAR_MONTH",n[n.DAY_TIME=1]="DAY_TIME",n[n.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(Zn||(Zn={}));class Pt{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 Pt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInterval(t,e){return t.setPosition(t.position()+Y),(e||new Pt).__init(t.readInt32(t.position())+t.position(),t)}unit(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Zn.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(t,e){t.addFieldInt16(0,e,Zn.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,e){return Pt.startInterval(t),Pt.addUnit(t,e),Pt.endInterval(t)}}class Se{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 Se).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsList(t,e){return t.setPosition(t.position()+Y),(e||new Se).__init(t.readInt32(t.position())+t.position(),t)}static startList(t){t.startObject(0)}static endList(t){return t.endObject()}static createList(t){return Se.startList(t),Se.endList(t)}}let Dn=class Re{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 Re).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMap(t,e){return t.setPosition(t.position()+Y),(e||new Re).__init(t.readInt32(t.position())+t.position(),t)}keysSorted(){const 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 Re.startMap(t),Re.addKeysSorted(t,e),Re.endMap(t)}};class Ie{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 Ie).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNull(t,e){return t.setPosition(t.position()+Y),(e||new Ie).__init(t.readInt32(t.position())+t.position(),t)}static startNull(t){t.startObject(0)}static endNull(t){return t.endObject()}static createNull(t){return Ie.startNull(t),Ie.endNull(t)}}class Be{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 Be).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsStruct_(t,e){return t.setPosition(t.position()+Y),(e||new Be).__init(t.readInt32(t.position())+t.position(),t)}static startStruct_(t){t.startObject(0)}static endStruct_(t){return t.endObject()}static createStruct_(t){return Be.startStruct_(t),Be.endStruct_(t)}}class Ot{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 Ot).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTime(t,e){return t.setPosition(t.position()+Y),(e||new Ot).__init(t.readInt32(t.position())+t.position(),t)}unit(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):qe.MILLISECOND}bitWidth(){const 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,qe.MILLISECOND)}static addBitWidth(t,e){t.addFieldInt32(1,e,32)}static endTime(t){return t.endObject()}static createTime(t,e,i){return Ot.startTime(t),Ot.addUnit(t,e),Ot.addBitWidth(t,i),Ot.endTime(t)}}class Ft{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 Ft).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTimestamp(t,e){return t.setPosition(t.position()+Y),(e||new Ft).__init(t.readInt32(t.position())+t.position(),t)}unit(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):qe.SECOND}timezone(t){const 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,qe.SECOND)}static addTimezone(t,e){t.addFieldOffset(1,e,0)}static endTimestamp(t){return t.endObject()}static createTimestamp(t,e,i){return Ft.startTimestamp(t),Ft.addUnit(t,e),Ft.addTimezone(t,i),Ft.endTimestamp(t)}}var Qn;(function(n){n[n.Sparse=0]="Sparse",n[n.Dense=1]="Dense"})(Qn||(Qn={}));class ut{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 ut).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUnion(t,e){return t.setPosition(t.position()+Y),(e||new ut).__init(t.readInt32(t.position())+t.position(),t)}mode(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Qn.Sparse}typeIds(t){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb.__vector(this.bb_pos+e)+t*4):0}typeIdsLength(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}typeIdsArray(){const 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,Qn.Sparse)}static addTypeIds(t,e){t.addFieldOffset(1,e,0)}static createTypeIdsVector(t,e){t.startVector(4,e.length,4);for(let i=e.length-1;i>=0;i--)t.addInt32(e[i]);return t.endVector()}static startTypeIdsVector(t,e){t.startVector(4,e,4)}static endUnion(t){return t.endObject()}static createUnion(t,e,i){return ut.startUnion(t),ut.addMode(t,e),ut.addTypeIds(t,i),ut.endUnion(t)}}class Ae{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 Ae).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,e){return t.setPosition(t.position()+Y),(e||new Ae).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return Ae.startUtf8(t),Ae.endUtf8(t)}}var G;(function(n){n[n.NONE=0]="NONE",n[n.Null=1]="Null",n[n.Int=2]="Int",n[n.FloatingPoint=3]="FloatingPoint",n[n.Binary=4]="Binary",n[n.Utf8=5]="Utf8",n[n.Bool=6]="Bool",n[n.Decimal=7]="Decimal",n[n.Date=8]="Date",n[n.Time=9]="Time",n[n.Timestamp=10]="Timestamp",n[n.Interval=11]="Interval",n[n.List=12]="List",n[n.Struct_=13]="Struct_",n[n.Union=14]="Union",n[n.FixedSizeBinary=15]="FixedSizeBinary",n[n.FixedSizeList=16]="FixedSizeList",n[n.Map=17]="Map",n[n.Duration=18]="Duration",n[n.LargeBinary=19]="LargeBinary",n[n.LargeUtf8=20]="LargeUtf8",n[n.LargeList=21]="LargeList"})(G||(G={}));let Bt=class Tn{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 Tn).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,e){return t.setPosition(t.position()+Y),(e||new Tn).__init(t.readInt32(t.position())+t.position(),t)}name(t){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}nullable(){const t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}typeType(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):G.NONE}type(t){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__union(t,this.bb_pos+e):null}dictionary(t){const e=this.bb.__offset(this.bb_pos,12);return e?(t||new ee).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}children(t,e){const i=this.bb.__offset(this.bb_pos,14);return i?(e||new Tn).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}childrenLength(){const t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){const i=this.bb.__offset(this.bb_pos,16);return i?(e||new nt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}customMetadataLength(){const 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,G.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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endField(t){return t.endObject()}},Rt=class Kt{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 Kt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,e){return t.setPosition(t.position()+Y),(e||new Kt).__init(t.readInt32(t.position())+t.position(),t)}endianness(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):He.Little}fields(t,e){const i=this.bb.__offset(this.bb_pos,6);return i?(e||new Bt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}fieldsLength(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){const i=this.bb.__offset(this.bb_pos,8);return i?(e||new nt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}features(t){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+t*8):this.bb.createLong(0,0)}featuresLength(){const 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,He.Little)}static addFields(t,e){t.addFieldOffset(1,e,0)}static createFieldsVector(t,e){t.startVector(4,e.length,4);for(let i=e.length-1;i>=0;i--)t.addOffset(e[i]);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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);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 i=e.length-1;i>=0;i--)t.addInt64(e[i]);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,i,r,s){return Kt.startSchema(t),Kt.addEndianness(t,e),Kt.addFields(t,i),Kt.addCustomMetadata(t,r),Kt.addFeatures(t,s),Kt.endSchema(t)}};class bt{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 bt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,e){return t.setPosition(t.position()+Y),(e||new bt).__init(t.readInt32(t.position())+t.position(),t)}version(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Ye.V1}schema(t){const e=this.bb.__offset(this.bb_pos,6);return e?(t||new Rt).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}dictionaries(t,e){const i=this.bb.__offset(this.bb_pos,8);return i?(e||new Ri).__init(this.bb.__vector(this.bb_pos+i)+t*24,this.bb):null}dictionariesLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(t,e){const i=this.bb.__offset(this.bb_pos,10);return i?(e||new Ri).__init(this.bb.__vector(this.bb_pos+i)+t*24,this.bb):null}recordBatchesLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){const i=this.bb.__offset(this.bb_pos,12);return i?(e||new nt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}customMetadataLength(){const 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,Ye.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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);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)}}class P{constructor(t=[],e,i){this.fields=t||[],this.metadata=e||new Map,i||(i=Ei(t)),this.dictionaries=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){const e=new Set(t),i=this.fields.filter(r=>e.has(r.name));return new P(i,this.metadata)}selectAt(t){const e=t.map(i=>this.fields[i]).filter(Boolean);return new P(e,this.metadata)}assign(...t){const e=t[0]instanceof P?t[0]:Array.isArray(t[0])?new P(t[0]):new P(t),i=[...this.fields],r=An(An(new Map,this.metadata),e.metadata),s=e.fields.filter(a=>{const c=i.findIndex(u=>u.name===a.name);return~c?(i[c]=a.clone({metadata:An(An(new Map,i[c].metadata),a.metadata)}))&&!1:!0}),o=Ei(s,new Map);return new P([...i,...s],r,new Map([...this.dictionaries,...o]))}}P.prototype.fields=null;P.prototype.metadata=null;P.prototype.dictionaries=null;class q{constructor(t,e,i=!1,r){this.name=t,this.type=e,this.nullable=i,this.metadata=r||new Map}static new(...t){let[e,i,r,s]=t;return t[0]&&typeof t[0]=="object"&&({name:e}=t[0],i===void 0&&(i=t[0].type),r===void 0&&(r=t[0].nullable),s===void 0&&(s=t[0].metadata)),new q(`${e}`,i,r,s)}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[e,i,r,s]=t;return!t[0]||typeof t[0]!="object"?[e=this.name,i=this.type,r=this.nullable,s=this.metadata]=t:{name:e=this.name,type:i=this.type,nullable:r=this.nullable,metadata:s=this.metadata}=t[0],q.new(e,i,r,s)}}q.prototype.type=null;q.prototype.name=null;q.prototype.nullable=null;q.prototype.metadata=null;function An(n,t){return new Map([...n||new Map,...t||new Map])}function Ei(n,t=new Map){for(let e=-1,i=n.length;++e<i;){const s=n[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&&Ei(s.children,t)}return t}var jr=ne,$c=So,Wc=We;class hn{constructor(t,e=_t.V4,i,r){this.schema=t,this.version=e,i&&(this._recordBatches=i),r&&(this._dictionaryBatches=r)}static decode(t){t=new Wc(U(t));const e=bt.getRootAsFooter(t),i=P.decode(e.schema());return new Yc(i,e)}static encode(t){const e=new $c,i=P.encode(e,t.schema);bt.startRecordBatchesVector(e,t.numRecordBatches);for(const o of[...t.recordBatches()].slice().reverse())pe.encode(e,o);const r=e.endVector();bt.startDictionariesVector(e,t.numDictionaries);for(const o of[...t.dictionaryBatches()].slice().reverse())pe.encode(e,o);const s=e.endVector();return bt.startFooter(e),bt.addSchema(e,i),bt.addVersion(e,_t.V4),bt.addRecordBatches(e,r),bt.addDictionaries(e,s),bt.finishFooterBuffer(e,bt.endFooter(e)),e.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}*recordBatches(){for(let t,e=-1,i=this.numRecordBatches;++e<i;)(t=this.getRecordBatch(e))&&(yield t)}*dictionaryBatches(){for(let t,e=-1,i=this.numDictionaries;++e<i;)(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}}class Yc extends hn{constructor(t,e){super(t,e.version()),this._footer=e}get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}getRecordBatch(t){if(t>=0&&t<this.numRecordBatches){const e=this._footer.recordBatches(t);if(e)return pe.decode(e)}return null}getDictionaryBatch(t){if(t>=0&&t<this.numDictionaries){const e=this._footer.dictionaries(t);if(e)return pe.decode(e)}return null}}class pe{constructor(t,e,i){this.metaDataLength=t,this.offset=typeof i=="number"?i:i.low,this.bodyLength=typeof e=="number"?e:e.low}static decode(t){return new pe(t.metaDataLength(),t.bodyLength(),t.offset())}static encode(t,e){const{metaDataLength:i}=e,r=new jr(e.offset,0),s=new jr(e.bodyLength,0);return Ri.createBlock(t,r,i,s)}}const K=Object.freeze({done:!0,value:void 0});class zr{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}}class rr{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())}}class Hc extends rr{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return g(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){const{resolvers:t}=this;for(;t.length>0;)t.shift().resolve(K);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return At.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return At.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return g(this,void 0,void 0,function*(){return yield this.abort(t),K})}return(t){return g(this,void 0,void 0,function*(){return yield this.close(),K})}read(t){return g(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return g(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,i)=>{this.resolvers.push({resolve:e,reject:i})}):Promise.resolve(K)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}class Nn extends Hc{write(t){if((t=U(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?Ti(this.toUint8Array(!0)):this.toUint8Array(!1).then(Ti)}toUint8Array(t=!1){return t?Wt(this._values)[0]:g(this,void 0,void 0,function*(){var e,i;const r=[];let s=0;try{for(var o=Oe(this),a;a=yield o.next(),!a.done;){const c=a.value;r.push(c),s+=c.byteLength}}catch(c){e={error:c}}finally{try{a&&!a.done&&(i=o.return)&&(yield i.call(o))}finally{if(e)throw e.error}}return Wt(r,s)[0]})}}class Xn{constructor(t){t&&(this.source=new qc(At.fromIterable(t)))}[Symbol.iterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}}class Je{constructor(t){t instanceof Je?this.source=t.source:t instanceof Nn?this.source=new _e(At.fromAsyncIterable(t)):rs(t)?this.source=new _e(At.fromNodeStream(t)):Wi(t)?this.source=new _e(At.fromDOMStream(t)):is(t)?this.source=new _e(At.fromDOMStream(t.body)):mn(t)?this.source=new _e(At.fromIterable(t)):ue(t)?this.source=new _e(At.fromAsyncIterable(t)):Ke(t)&&(this.source=new _e(At.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}get closed(){return this.source.closed}cancel(t){return this.source.cancel(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}}class qc{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)||K)}return(t){return Object.create(this.source.return&&this.source.return(t)||K)}}class _e{constructor(t){this.source=t,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(t){return g(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return g(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return g(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t,e="read"){return g(this,void 0,void 0,function*(){return yield this.source.next({cmd:e,size:t})})}throw(t){return g(this,void 0,void 0,function*(){const e=this.source.throw&&(yield this.source.throw(t))||K;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}return(t){return g(this,void 0,void 0,function*(){const e=this.source.return&&(yield this.source.return(t))||K;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}}class kr extends Xn{constructor(t,e){super(),this.position=0,this.buffer=U(t),this.size=typeof e>"u"?this.buffer.byteLength:e}readInt32(t){const{buffer:e,byteOffset:i}=this.readAt(t,4);return new DataView(e,i).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t<this.size}read(t){const{buffer:e,size:i,position:r}=this;return e&&r<i?(typeof t!="number"&&(t=Number.POSITIVE_INFINITY),this.position=Math.min(i,r+Math.min(i-r,t)),e.subarray(r,this.position)):null}readAt(t,e){const i=this.buffer,r=Math.min(this.size,t+e);return i?i.subarray(t,r):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}}}class ti extends Je{constructor(t,e){super(),this.position=0,this._handle=t,typeof e=="number"?this.size=e:this._pending=g(this,void 0,void 0,function*(){this.size=(yield t.stat()).size,delete this._pending})}readInt32(t){return g(this,void 0,void 0,function*(){const{buffer:e,byteOffset:i}=yield this.readAt(t,4);return new DataView(e,i).getInt32(0,!0)})}seek(t){return g(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 g(this,void 0,void 0,function*(){this._pending&&(yield this._pending);const{_handle:e,size:i,position:r}=this;if(e&&r<i){typeof t!="number"&&(t=Number.POSITIVE_INFINITY);let s=r,o=0,a=0;const c=Math.min(i,s+Math.min(i-s,t)),u=new Uint8Array(Math.max(0,(this.position=c)-s));for(;(s+=a)<c&&(o+=a)<u.byteLength;)({bytesRead:a}=yield e.read(u,o,u.byteLength-o,s));return u}return null})}readAt(t,e){return g(this,void 0,void 0,function*(){this._pending&&(yield this._pending);const{_handle:i,size:r}=this;if(i&&t+e<r){const s=Math.min(r,t+e),o=new Uint8Array(s-t);return(yield i.read(o,0,e,t)).buffer}return new Uint8Array(e)})}close(){return g(this,void 0,void 0,function*(){const t=this._handle;this._handle=null,t&&(yield t.close())})}throw(t){return g(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}return(t){return g(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:t}})}}const Jc=65536;function Ce(n){return n<0&&(n=4294967295+n+1),`0x${n.toString(16)}`}const Ge=8,sr=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];class Bo{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){const e=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),i=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let r=e[3]*i[3];this.buffer[0]=r&65535;let s=r>>>16;return r=e[2]*i[3],s+=r,r=e[3]*i[2]>>>0,s+=r,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0<r?Jc:0,this.buffer[1]+=s>>>16,this.buffer[1]+=e[1]*i[3]+e[2]*i[2]+e[3]*i[1],this.buffer[1]+=e[0]*i[3]+e[1]*i[2]+e[2]*i[1]+e[3]*i[0]<<16,this}_plus(t){const 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`${Ce(this.buffer[1])} ${Ce(this.buffer[0])}`}}class $ extends Bo{times(t){return this._times(t),this}plus(t){return this._plus(t),this}static from(t,e=new Uint32Array(2)){return $.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return $.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){const i=t.length,r=new $(e);for(let s=0;s<i;){const o=Ge<i-s?Ge:i-s,a=new $(new Uint32Array([Number.parseInt(t.slice(s,s+o),10),0])),c=new $(new Uint32Array([sr[o],0]));r.times(c),r.plus(a),s+=o}return r}static convertArray(t){const e=new Uint32Array(t.length*2);for(let i=-1,r=t.length;++i<r;)$.from(t[i],new Uint32Array(e.buffer,e.byteOffset+2*i*4,2));return e}static multiply(t,e){return new $(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new $(new Uint32Array(t.buffer)).plus(e)}}class ct extends Bo{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){const e=this.buffer[1]<<0,i=t.buffer[1]<<0;return e<i||e===i&&this.buffer[0]<t.buffer[0]}static from(t,e=new Uint32Array(2)){return ct.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(2)){return ct.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(2)){const i=t.startsWith("-"),r=t.length,s=new ct(e);for(let o=i?1:0;o<r;){const a=Ge<r-o?Ge:r-o,c=new ct(new Uint32Array([Number.parseInt(t.slice(o,o+a),10),0])),u=new ct(new Uint32Array([sr[a],0]));s.times(u),s.plus(c),o+=a}return i?s.negate():s}static convertArray(t){const e=new Uint32Array(t.length*2);for(let i=-1,r=t.length;++i<r;)ct.from(t[i],new Uint32Array(e.buffer,e.byteOffset+2*i*4,2));return e}static multiply(t,e){return new ct(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new ct(new Uint32Array(t.buffer)).plus(e)}}class Ut{constructor(t){this.buffer=t}high(){return new ct(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new ct(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){const e=new $(new Uint32Array([this.buffer[3],0])),i=new $(new Uint32Array([this.buffer[2],0])),r=new $(new Uint32Array([this.buffer[1],0])),s=new $(new Uint32Array([this.buffer[0],0])),o=new $(new Uint32Array([t.buffer[3],0])),a=new $(new Uint32Array([t.buffer[2],0])),c=new $(new Uint32Array([t.buffer[1],0])),u=new $(new Uint32Array([t.buffer[0],0]));let d=$.multiply(s,u);this.buffer[0]=d.low();const p=new $(new Uint32Array([d.high(),0]));return d=$.multiply(r,u),p.plus(d),d=$.multiply(s,c),p.plus(d),this.buffer[1]=p.low(),this.buffer[3]=p.lessThan(d)?1:0,this.buffer[2]=p.high(),new $(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus($.multiply(i,u)).plus($.multiply(r,c)).plus($.multiply(s,a)),this.buffer[3]+=$.multiply(e,u).plus($.multiply(i,c)).plus($.multiply(r,a)).plus($.multiply(s,o)).low(),this}plus(t){const 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`${Ce(this.buffer[3])} ${Ce(this.buffer[2])} ${Ce(this.buffer[1])} ${Ce(this.buffer[0])}`}static multiply(t,e){return new Ut(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new Ut(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return Ut.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return Ut.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const i=t.startsWith("-"),r=t.length,s=new Ut(e);for(let o=i?1:0;o<r;){const a=Ge<r-o?Ge:r-o,c=new Ut(new Uint32Array([Number.parseInt(t.slice(o,o+a),10),0,0,0])),u=new Ut(new Uint32Array([sr[a],0,0,0]));s.times(u),s.plus(c),o+=a}return i?s.negate():s}static convertArray(t){const e=new Uint32Array(t.length*4);for(let i=-1,r=t.length;++i<r;)Ut.from(t[i],new Uint32Array(e.buffer,e.byteOffset+4*4*i,4));return e}}class Ao extends L{constructor(t,e,i,r){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.bytes=t,this.nodes=e,this.buffers=i,this.dictionaries=r}visit(t){return super.visit(t instanceof q?t.type:t)}visitNull(t,{length:e}=this.nextFieldNode()){return x({type:t,length:e})}visitBool(t,{length:e,nullCount:i}=this.nextFieldNode()){return x({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitInt(t,{length:e,nullCount:i}=this.nextFieldNode()){return x({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitFloat(t,{length:e,nullCount:i}=this.nextFieldNode()){return x({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitUtf8(t,{length:e,nullCount:i}=this.nextFieldNode()){return x({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitBinary(t,{length:e,nullCount:i}=this.nextFieldNode()){return x({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),valueOffsets:this.readOffsets(t),data:this.readData(t)})}visitFixedSizeBinary(t,{length:e,nullCount:i}=this.nextFieldNode()){return x({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitDate(t,{length:e,nullCount:i}=this.nextFieldNode()){return x({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitTimestamp(t,{length:e,nullCount:i}=this.nextFieldNode()){return x({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitTime(t,{length:e,nullCount:i}=this.nextFieldNode()){return x({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitDecimal(t,{length:e,nullCount:i}=this.nextFieldNode()){return x({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitList(t,{length:e,nullCount:i}=this.nextFieldNode()){return x({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),valueOffsets:this.readOffsets(t),child:this.visit(t.children[0])})}visitStruct(t,{length:e,nullCount:i}=this.nextFieldNode()){return x({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),children:this.visitMany(t.children)})}visitUnion(t){return t.mode===vt.Sparse?this.visitSparseUnion(t):this.visitDenseUnion(t)}visitDenseUnion(t,{length:e,nullCount:i}=this.nextFieldNode()){return x({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),typeIds:this.readTypeIds(t),valueOffsets:this.readOffsets(t),children:this.visitMany(t.children)})}visitSparseUnion(t,{length:e,nullCount:i}=this.nextFieldNode()){return x({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),typeIds:this.readTypeIds(t),children:this.visitMany(t.children)})}visitDictionary(t,{length:e,nullCount:i}=this.nextFieldNode()){return x({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t.indices),dictionary:this.readDictionary(t)})}visitInterval(t,{length:e,nullCount:i}=this.nextFieldNode()){return x({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),data:this.readData(t)})}visitFixedSizeList(t,{length:e,nullCount:i}=this.nextFieldNode()){return x({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),child:this.visit(t.children[0])})}visitMap(t,{length:e,nullCount:i}=this.nextFieldNode()){return x({type:t,length:e,nullCount:i,nullBitmap:this.readNullBitmap(t,i),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,i=this.nextBufferRange()){return e>0&&this.readData(t,i)||new Uint8Array(0)}readOffsets(t,e){return this.readData(t,e)}readTypeIds(t,e){return this.readData(t,e)}readData(t,{length:e,offset:i}=this.nextBufferRange()){return this.bytes.subarray(i,i+e)}readDictionary(t){return this.dictionaries.get(t.id)}}class Gc extends Ao{constructor(t,e,i,r){super(new Uint8Array(0),e,i,r),this.sources=t}readNullBitmap(t,e,{offset:i}=this.nextBufferRange()){return e<=0?new Uint8Array(0):Yn(this.sources[i])}readOffsets(t,{offset:e}=this.nextBufferRange()){return W(Uint8Array,W(Int32Array,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return W(Uint8Array,W(t.ArrayType,this.sources[e]))}readData(t,{offset:e}=this.nextBufferRange()){const{sources:i}=this;return _.isTimestamp(t)||(_.isInt(t)||_.isTime(t))&&t.bitWidth===64||_.isDate(t)&&t.unit===re.MILLISECOND?W(Uint8Array,ct.convertArray(i[e])):_.isDecimal(t)?W(Uint8Array,Ut.convertArray(i[e])):_.isBinary(t)||_.isFixedSizeBinary(t)?Kc(i[e]):_.isBool(t)?Yn(i[e]):_.isUtf8(t)?$i(i[e].join("")):W(Uint8Array,W(t.ArrayType,i[e].map(r=>+r)))}}function Kc(n){const t=n.join(""),e=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)e[i>>1]=Number.parseInt(t.slice(i,i+2),16);return e}class I extends L{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((i,r)=>this.compareFields(i,e[r]))}compareFields(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&this.visit(t.type,e.type)}}function yt(n,t){return t instanceof n.constructor}function bn(n,t){return n===t||yt(n,t)}function oe(n,t){return n===t||yt(n,t)&&n.bitWidth===t.bitWidth&&n.isSigned===t.isSigned}function ui(n,t){return n===t||yt(n,t)&&n.precision===t.precision}function Zc(n,t){return n===t||yt(n,t)&&n.byteWidth===t.byteWidth}function or(n,t){return n===t||yt(n,t)&&n.unit===t.unit}function gn(n,t){return n===t||yt(n,t)&&n.unit===t.unit&&n.timezone===t.timezone}function _n(n,t){return n===t||yt(n,t)&&n.unit===t.unit&&n.bitWidth===t.bitWidth}function Qc(n,t){return n===t||yt(n,t)&&n.children.length===t.children.length&&ye.compareManyFields(n.children,t.children)}function Xc(n,t){return n===t||yt(n,t)&&n.children.length===t.children.length&&ye.compareManyFields(n.children,t.children)}function ar(n,t){return n===t||yt(n,t)&&n.mode===t.mode&&n.typeIds.every((e,i)=>e===t.typeIds[i])&&ye.compareManyFields(n.children,t.children)}function tl(n,t){return n===t||yt(n,t)&&n.id===t.id&&n.isOrdered===t.isOrdered&&ye.visit(n.indices,t.indices)&&ye.visit(n.dictionary,t.dictionary)}function cr(n,t){return n===t||yt(n,t)&&n.unit===t.unit}function el(n,t){return n===t||yt(n,t)&&n.listSize===t.listSize&&n.children.length===t.children.length&&ye.compareManyFields(n.children,t.children)}function nl(n,t){return n===t||yt(n,t)&&n.keysSorted===t.keysSorted&&n.children.length===t.children.length&&ye.compareManyFields(n.children,t.children)}I.prototype.visitNull=bn;I.prototype.visitBool=bn;I.prototype.visitInt=oe;I.prototype.visitInt8=oe;I.prototype.visitInt16=oe;I.prototype.visitInt32=oe;I.prototype.visitInt64=oe;I.prototype.visitUint8=oe;I.prototype.visitUint16=oe;I.prototype.visitUint32=oe;I.prototype.visitUint64=oe;I.prototype.visitFloat=ui;I.prototype.visitFloat16=ui;I.prototype.visitFloat32=ui;I.prototype.visitFloat64=ui;I.prototype.visitUtf8=bn;I.prototype.visitBinary=bn;I.prototype.visitFixedSizeBinary=Zc;I.prototype.visitDate=or;I.prototype.visitDateDay=or;I.prototype.visitDateMillisecond=or;I.prototype.visitTimestamp=gn;I.prototype.visitTimestampSecond=gn;I.prototype.visitTimestampMillisecond=gn;I.prototype.visitTimestampMicrosecond=gn;I.prototype.visitTimestampNanosecond=gn;I.prototype.visitTime=_n;I.prototype.visitTimeSecond=_n;I.prototype.visitTimeMillisecond=_n;I.prototype.visitTimeMicrosecond=_n;I.prototype.visitTimeNanosecond=_n;I.prototype.visitDecimal=bn;I.prototype.visitList=Qc;I.prototype.visitStruct=Xc;I.prototype.visitUnion=ar;I.prototype.visitDenseUnion=ar;I.prototype.visitSparseUnion=ar;I.prototype.visitDictionary=tl;I.prototype.visitInterval=cr;I.prototype.visitIntervalDayTime=cr;I.prototype.visitIntervalYearMonth=cr;I.prototype.visitFixedSizeList=el;I.prototype.visitMap=nl;const ye=new I;function ji(n,t){return ye.compareSchemas(n,t)}function Oi(n,t){return il(n,t.map(e=>e.data.concat()))}function il(n,t){const e=[...n.fields],i=[],r={numBatches:t.reduce((p,b)=>Math.max(p,b.length),0)};let s=0,o=0,a=-1;const c=t.length;let u,d=[];for(;r.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,a=-1;++a<c;)d[a]=u=t[a].shift(),o=Math.min(o,u?u.length:o);Number.isFinite(o)&&(d=rl(e,o,d,t,r),o>0&&(i[s++]=x({type:new st(e),length:o,nullCount:0,children:d.slice()})))}return[n=n.assign(e),i.map(p=>new ht(n,p))]}function rl(n,t,e,i,r){var s;const o=(t+63&-64)>>3;for(let a=-1,c=i.length;++a<c;){const u=e[a],d=u==null?void 0:u.length;if(d>=t)d===t?e[a]=u:(e[a]=u.slice(0,t),r.numBatches=Math.max(r.numBatches,i[a].unshift(u.slice(t,d-t))));else{const p=n[a];n[a]=p.clone({nullable:!0}),e[a]=(s=u==null?void 0:u._changeLengthAndBackfillNullBitmap(t))!==null&&s!==void 0?s:x({type:p.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)})}}return e}var Oo;class rt{constructor(...t){var e,i;if(t.length===0)return this.batches=[],this.schema=new P([]),this._offsets=[0],this;let r,s;t[0]instanceof P&&(r=t.shift()),t[t.length-1]instanceof Uint32Array&&(s=t.pop());const o=c=>{if(c){if(c instanceof ht)return[c];if(c instanceof rt)return c.batches;if(c instanceof H){if(c.type instanceof st)return[new ht(new P(c.type.children),c)]}else{if(Array.isArray(c))return c.flatMap(u=>o(u));if(typeof c[Symbol.iterator]=="function")return[...c].flatMap(u=>o(u));if(typeof c=="object"){const u=Object.keys(c),d=u.map(m=>new k([c[m]])),p=new P(u.map((m,N)=>new q(String(m),d[N].type))),[,b]=Oi(p,d);return b.length===0?[new ht(c)]:b}}}return[]},a=t.flatMap(c=>o(c));if(r=(i=r??((e=a[0])===null||e===void 0?void 0:e.schema))!==null&&i!==void 0?i:new P([]),!(r instanceof P))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(const c of a){if(!(c instanceof ht))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!ji(r,c.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=r,this.batches=a,this._offsets=s??uo(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=lo(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}set(t,e){}indexOf(t,e){return-1}getByteLength(t){return 0}[Symbol.iterator](){return this.batches.length>0?ir.visit(new k(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
  ${this.toArray().join(`,
  `)}
]`}concat(...t){const e=this.schema,i=this.data.concat(t.flatMap(({data:r})=>r));return new rt(e,i.map(r=>new ht(e,r)))}slice(t,e){const i=this.schema;[t,e]=ao({length:this.numRows},t,e);const r=ho(this.data,this._offsets,t,e);return new rt(i,r.map(s=>new ht(i,s)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(e=>e.name===t))}getChildAt(t){if(t>-1&&t<this.schema.fields.length){const e=this.data.map(i=>i.children[t]);if(e.length===0){const{type:i}=this.schema.fields[t],r=x({type:i,length:0,nullCount:0});e.push(r._changeLengthAndBackfillNullBitmap(this.numRows))}return new k(e)}return null}setChild(t,e){var i;return this.setChildAt((i=this.schema.fields)===null||i===void 0?void 0:i.findIndex(r=>r.name===t),e)}setChildAt(t,e){let i=this.schema,r=[...this.batches];if(t>-1&&t<this.numCols){e||(e=new k([x({type:new de,length:this.numRows})]));const s=i.fields.slice(),o=s[t].clone({type:e.type}),a=this.schema.fields.map((c,u)=>this.getChildAt(u));[s[t],a[t]]=[o,e],[i,r]=Oi(i,a)}return new rt(i,r)}select(t){const e=this.schema.fields.reduce((i,r,s)=>i.set(r.name,s),new Map);return this.selectAt(t.map(i=>e.get(i)).filter(i=>i>-1))}selectAt(t){const e=this.schema.selectAt(t),i=this.batches.map(r=>r.selectAt(t));return new rt(e,i)}assign(t){const e=this.schema.fields,[i,r]=t.schema.fields.reduce((a,c,u)=>{const[d,p]=a,b=e.findIndex(m=>m.name===c.name);return~b?p[b]=u:d.push(u),a},[[],[]]),s=this.schema.assign(t.schema),o=[...e.map((a,c)=>[c,r[c]]).map(([a,c])=>c===void 0?this.getChildAt(a):t.getChildAt(c)),...i.map(a=>t.getChildAt(a))].filter(Boolean);return new rt(...Oi(s,o))}}Oo=Symbol.toStringTag;rt[Oo]=(n=>(n.schema=null,n.batches=[],n._offsets=new Uint32Array([0]),n._nullCount=-1,n[Symbol.isConcatSpreadable]=!0,n.isValid=Ve(nr),n.get=Ve(pt.getVisitFn(l.Struct)),n.set=fo(Dt.getVisitFn(l.Struct)),n.indexOf=po(Hn.getVisitFn(l.Struct)),n.getByteLength=Ve(Yt.getVisitFn(l.Struct)),"Table"))(rt.prototype);var Fo;let ht=class Xe{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof P))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=x({nullCount:0,type:new st(this.schema.fields),children:this.schema.fields.map(e=>x({type:e.type,nullCount:0}))})]=t,!(this.data instanceof H))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=Pr(this.schema,this.data.children);break}case 1:{const[e]=t,{fields:i,children:r,length:s}=Object.keys(e).reduce((c,u,d)=>(c.children[d]=e[u],c.length=Math.max(c.length,e[u].length),c.fields[d]=q.new({name:u,type:e[u].type,nullable:!0}),c),{length:0,fields:new Array,children:new Array}),o=new P(i),a=x({type:new st(i),length:s,children:r,nullCount:0});[this.schema,this.data]=Pr(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=Do(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 pt.visit(this.data,t)}set(t,e){return Dt.visit(this.data,t,e)}indexOf(t,e){return Hn.visit(this.data,t,e)}getByteLength(t){return Yt.visit(this.data,t)}[Symbol.iterator](){return ir.visit(new k([this.data]))}toArray(){return[...this]}concat(...t){return new rt(this.schema,[this,...t])}slice(t,e){const[i]=new k([this.data]).slice(t,e).data;return new Xe(this.schema,i)}getChild(t){var e;return this.getChildAt((e=this.schema.fields)===null||e===void 0?void 0:e.findIndex(i=>i.name===t))}getChildAt(t){return t>-1&&t<this.schema.fields.length?new k([this.data.children[t]]):null}setChild(t,e){var i;return this.setChildAt((i=this.schema.fields)===null||i===void 0?void 0:i.findIndex(r=>r.name===t),e)}setChildAt(t,e){let i=this.schema,r=this.data;if(t>-1&&t<this.numCols){e||(e=new k([x({type:new de,length:this.numRows})]));const s=i.fields.slice(),o=r.children.slice(),a=s[t].clone({type:e.type});[s[t],o[t]]=[a,e.data[0]],i=new P(s,new Map(this.schema.metadata)),r=x({type:new st(s),children:o})}return new Xe(i,r)}select(t){const e=this.schema.select(t),i=new st(e.fields),r=[];for(const s of t){const o=this.schema.fields.findIndex(a=>a.name===s);~o&&(r[o]=this.data.children[o])}return new Xe(e,x({type:i,length:this.numRows,children:r}))}selectAt(t){const e=this.schema.selectAt(t),i=t.map(s=>this.data.children[s]).filter(Boolean),r=x({type:new st(e.fields),length:this.numRows,children:i});return new Xe(e,r)}};Fo=Symbol.toStringTag;ht[Fo]=(n=>(n._nullCount=-1,n[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(ht.prototype);function Pr(n,t,e=t.reduce((i,r)=>Math.max(i,r.length),0)){var i;const r=[...n.fields],s=[...t],o=(e+63&-64)>>3;for(const[a,c]of n.fields.entries()){const u=t[a];(!u||u.length!==e)&&(r[a]=c.clone({nullable:!0}),s[a]=(i=u==null?void 0:u._changeLengthAndBackfillNullBitmap(e))!==null&&i!==void 0?i:x({type:c.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)}))}return[n.assign(r),x({type:new st(r),length:e,children:s})]}function Do(n,t,e=new Map){for(let i=-1,r=n.length;++i<r;){const o=n[i].type,a=t[i];if(_.isDictionary(o)){if(!e.has(o.id))a.dictionary&&e.set(o.id,a.dictionary);else if(e.get(o.id)!==a.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}o.children&&o.children.length>0&&Do(o.children,a.children,e)}return e}class lr extends ht{constructor(t){const e=t.fields.map(r=>x({type:r.type})),i=x({type:new st(t.fields),nullCount:0,children:e});super(t,i)}}var ei;(function(n){n[n.BUFFER=0]="BUFFER"})(ei||(ei={}));var ni;(function(n){n[n.LZ4_FRAME=0]="LZ4_FRAME",n[n.ZSTD=1]="ZSTD"})(ni||(ni={}));class le{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 le).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsBodyCompression(t,e){return t.setPosition(t.position()+Y),(e||new le).__init(t.readInt32(t.position())+t.position(),t)}codec(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):ni.LZ4_FRAME}method(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):ei.BUFFER}static startBodyCompression(t){t.startObject(2)}static addCodec(t,e){t.addFieldInt8(0,e,ni.LZ4_FRAME)}static addMethod(t,e){t.addFieldInt8(1,e,ei.BUFFER)}static endBodyCompression(t){return t.endObject()}static createBodyCompression(t,e,i){return le.startBodyCompression(t),le.addCodec(t,e),le.addMethod(t,i),le.endBodyCompression(t)}}class To{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,i){return t.prep(8,16),t.writeInt64(i),t.writeInt64(e),t.offset()}}let No=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,i){return t.prep(8,16),t.writeInt64(i),t.writeInt64(e),t.offset()}},Xt=class zi{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 zi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsRecordBatch(t,e){return t.setPosition(t.position()+Y),(e||new zi).__init(t.readInt32(t.position())+t.position(),t)}length(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}nodes(t,e){const i=this.bb.__offset(this.bb_pos,6);return i?(e||new No).__init(this.bb.__vector(this.bb_pos+i)+t*16,this.bb):null}nodesLength(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}buffers(t,e){const i=this.bb.__offset(this.bb_pos,8);return i?(e||new To).__init(this.bb.__vector(this.bb_pos+i)+t*16,this.bb):null}buffersLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}compression(t){const e=this.bb.__offset(this.bb_pos,10);return e?(t||new le).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startRecordBatch(t){t.startObject(4)}static addLength(t,e){t.addFieldInt64(0,e,t.createLong(0,0))}static addNodes(t,e){t.addFieldOffset(1,e,0)}static startNodesVector(t,e){t.startVector(16,e,8)}static addBuffers(t,e){t.addFieldOffset(2,e,0)}static startBuffersVector(t,e){t.startVector(16,e,8)}static addCompression(t,e){t.addFieldOffset(3,e,0)}static endRecordBatch(t){return t.endObject()}},Ue=class ki{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 ki).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDictionaryBatch(t,e){return t.setPosition(t.position()+Y),(e||new ki).__init(t.readInt32(t.position())+t.position(),t)}id(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}data(t){const e=this.bb.__offset(this.bb_pos,6);return e?(t||new Xt).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}isDelta(){const t=this.bb.__offset(this.bb_pos,8);return t?!!this.bb.readInt8(this.bb_pos+t):!1}static startDictionaryBatch(t){t.startObject(3)}static addId(t,e){t.addFieldInt64(0,e,t.createLong(0,0))}static addData(t,e){t.addFieldOffset(1,e,0)}static addIsDelta(t,e){t.addFieldInt8(2,+e,0)}static endDictionaryBatch(t){return t.endObject()}};var ii;(function(n){n[n.NONE=0]="NONE",n[n.Schema=1]="Schema",n[n.DictionaryBatch=2]="DictionaryBatch",n[n.RecordBatch=3]="RecordBatch",n[n.Tensor=4]="Tensor",n[n.SparseTensor=5]="SparseTensor"})(ii||(ii={}));let ae=class Lt{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 Lt).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+Y),(e||new Lt).__init(t.readInt32(t.position())+t.position(),t)}version(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Ye.V1}headerType(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):ii.NONE}header(t){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}bodyLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}customMetadata(t,e){const i=this.bb.__offset(this.bb_pos,12);return i?(e||new nt).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}customMetadataLength(){const 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,Ye.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,ii.NONE)}static addHeader(t,e){t.addFieldOffset(2,e,0)}static addBodyLength(t,e){t.addFieldInt64(3,e,t.createLong(0,0))}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let i=e.length-1;i>=0;i--)t.addOffset(e[i]);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,i,r,s,o){return Lt.startMessage(t),Lt.addVersion(t,e),Lt.addHeaderType(t,i),Lt.addHeader(t,r),Lt.addBodyLength(t,s),Lt.addCustomMetadata(t,o),Lt.endMessage(t)}};var sl=ne;class ol extends L{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return Ie.startNull(e),Ie.endNull(e)}visitInt(t,e){return gt.startInt(e),gt.addBitWidth(e,t.bitWidth),gt.addIsSigned(e,t.isSigned),gt.endInt(e)}visitFloat(t,e){return kt.startFloatingPoint(e),kt.addPrecision(e,t.precision),kt.endFloatingPoint(e)}visitBinary(t,e){return ve.startBinary(e),ve.endBinary(e)}visitBool(t,e){return we.startBool(e),we.endBool(e)}visitUtf8(t,e){return Ae.startUtf8(e),Ae.endUtf8(e)}visitDecimal(t,e){return lt.startDecimal(e),lt.addScale(e,t.scale),lt.addPrecision(e,t.precision),lt.addBitWidth(e,t.bitWidth),lt.endDecimal(e)}visitDate(t,e){return Fn.startDate(e),Fn.addUnit(e,t.unit),Fn.endDate(e)}visitTime(t,e){return Ot.startTime(e),Ot.addUnit(e,t.unit),Ot.addBitWidth(e,t.bitWidth),Ot.endTime(e)}visitTimestamp(t,e){const i=t.timezone&&e.createString(t.timezone)||void 0;return Ft.startTimestamp(e),Ft.addUnit(e,t.unit),i!==void 0&&Ft.addTimezone(e,i),Ft.endTimestamp(e)}visitInterval(t,e){return Pt.startInterval(e),Pt.addUnit(e,t.unit),Pt.endInterval(e)}visitList(t,e){return Se.startList(e),Se.endList(e)}visitStruct(t,e){return Be.startStruct_(e),Be.endStruct_(e)}visitUnion(t,e){ut.startTypeIdsVector(e,t.typeIds.length);const i=ut.createTypeIdsVector(e,t.typeIds);return ut.startUnion(e),ut.addMode(e,t.mode),ut.addTypeIds(e,i),ut.endUnion(e)}visitDictionary(t,e){const i=this.visit(t.indices,e);return ee.startDictionaryEncoding(e),ee.addId(e,new sl(t.id,0)),ee.addIsOrdered(e,t.isOrdered),i!==void 0&&ee.addIndexType(e,i),ee.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return jt.startFixedSizeBinary(e),jt.addByteWidth(e,t.byteWidth),jt.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return zt.startFixedSizeList(e),zt.addListSize(e,t.listSize),zt.endFixedSizeList(e)}visitMap(t,e){return Dn.startMap(e),Dn.addKeysSorted(e,t.keysSorted),Dn.endMap(e)}}const Fi=new ol;function al(n,t=new Map){return new P(ll(n,t),Mn(n.customMetadata),t)}function Mo(n){return new wt(n.count,xo(n.columns),Lo(n.columns))}function cl(n){return new Ht(Mo(n.data),n.id,n.isDelta)}function ll(n,t){return(n.fields||[]).filter(Boolean).map(e=>q.fromJSON(e,t))}function Vr(n,t){return(n.children||[]).filter(Boolean).map(e=>q.fromJSON(e,t))}function xo(n){return(n||[]).reduce((t,e)=>[...t,new Ne(e.count,ul(e.VALIDITY)),...xo(e.children)],[])}function Lo(n,t=[]){for(let e=-1,i=(n||[]).length;++e<i;){const r=n[e];r.VALIDITY&&t.push(new $t(t.length,r.VALIDITY.length)),r.TYPE&&t.push(new $t(t.length,r.TYPE.length)),r.OFFSET&&t.push(new $t(t.length,r.OFFSET.length)),r.DATA&&t.push(new $t(t.length,r.DATA.length)),t=Lo(r.children,t)}return t}function ul(n){return(n||[]).reduce((t,e)=>t+ +(e===0),0)}function hl(n,t){let e,i,r,s,o,a;return!t||!(s=n.dictionary)?(o=Wr(n,Vr(n,t)),r=new q(n.name,o,n.nullable,Mn(n.customMetadata))):t.has(e=s.id)?(i=(i=s.indexType)?$r(i):new cn,a=new $e(t.get(e),i,e,s.isOrdered),r=new q(n.name,a,n.nullable,Mn(n.customMetadata))):(i=(i=s.indexType)?$r(i):new cn,t.set(e,o=Wr(n,Vr(n,t))),a=new $e(o,i,e,s.isOrdered),r=new q(n.name,a,n.nullable,Mn(n.customMetadata))),r||null}function Mn(n){return new Map(Object.entries(n||{}))}function $r(n){return new fe(n.isSigned,n.bitWidth)}function Wr(n,t){const e=n.type.name;switch(e){case"NONE":return new de;case"null":return new de;case"binary":return new Ln;case"utf8":return new Rn;case"bool":return new Un;case"list":return new kn((t||[])[0]);case"struct":return new st(t||[]);case"struct_":return new st(t||[])}switch(e){case"int":{const i=n.type;return new fe(i.isSigned,i.bitWidth)}case"floatingpoint":{const i=n.type;return new ln(dt[i.precision])}case"decimal":{const i=n.type;return new Cn(i.scale,i.precision,i.bitWidth)}case"date":{const i=n.type;return new En(re[i.unit])}case"time":{const i=n.type;return new un(C[i.unit],i.bitWidth)}case"timestamp":{const i=n.type;return new jn(C[i.unit],i.timezone)}case"interval":{const i=n.type;return new zn(he[i.unit])}case"union":{const i=n.type;return new Pn(vt[i.mode],i.typeIds||[],t||[])}case"fixedsizebinary":{const i=n.type;return new Vn(i.byteWidth)}case"fixedsizelist":{const i=n.type;return new $n(i.listSize,(t||[])[0])}case"map":{const i=n.type;return new Wn((t||[])[0],i.keysSorted)}}throw new Error(`Unrecognized type: "${e}"`)}var De=ne,dl=So,fl=We;class ot{constructor(t,e,i,r){this._version=e,this._headerType=i,this.body=new Uint8Array(0),r&&(this._createHeader=()=>r),this._bodyLength=typeof t=="number"?t:t.low}static fromJSON(t,e){const i=new ot(0,_t.V4,e);return i._createHeader=pl(t,e),i}static decode(t){t=new fl(U(t));const e=ae.getRootAsMessage(t),i=e.bodyLength(),r=e.version(),s=e.headerType(),o=new ot(i,r,s);return o._createHeader=yl(e,s),o}static encode(t){const e=new dl;let i=-1;return t.isSchema()?i=P.encode(e,t.header()):t.isRecordBatch()?i=wt.encode(e,t.header()):t.isDictionaryBatch()&&(i=Ht.encode(e,t.header())),ae.startMessage(e),ae.addVersion(e,_t.V4),ae.addHeader(e,i),ae.addHeaderType(e,t.headerType),ae.addBodyLength(e,new De(t.bodyLength,0)),ae.finishMessageBuffer(e,ae.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof P)return new ot(0,_t.V4,z.Schema,t);if(t instanceof wt)return new ot(e,_t.V4,z.RecordBatch,t);if(t instanceof Ht)return new ot(e,_t.V4,z.DictionaryBatch,t);throw new Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===z.Schema}isRecordBatch(){return this.headerType===z.RecordBatch}isDictionaryBatch(){return this.headerType===z.DictionaryBatch}}class wt{constructor(t,e,i){this._nodes=e,this._buffers=i,this._length=typeof t=="number"?t:t.low}get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}}class Ht{constructor(t,e,i=!1){this._data=t,this._isDelta=i,this._id=typeof e=="number"?e:e.low}get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}}class $t{constructor(t,e){this.offset=typeof t=="number"?t:t.low,this.length=typeof e=="number"?e:e.low}}class Ne{constructor(t,e){this.length=typeof t=="number"?t:t.low,this.nullCount=typeof e=="number"?e:e.low}}function pl(n,t){return()=>{switch(t){case z.Schema:return P.fromJSON(n);case z.RecordBatch:return wt.fromJSON(n);case z.DictionaryBatch:return Ht.fromJSON(n)}throw new Error(`Unrecognized Message type: { name: ${z[t]}, type: ${t} }`)}}function yl(n,t){return()=>{switch(t){case z.Schema:return P.decode(n.header(new Rt));case z.RecordBatch:return wt.decode(n.header(new Xt),n.version());case z.DictionaryBatch:return Ht.decode(n.header(new Ue),n.version())}throw new Error(`Unrecognized Message type: { name: ${z[t]}, type: ${t} }`)}}q.encode=Ol;q.decode=Bl;q.fromJSON=hl;P.encode=Al;P.decode=ml;P.fromJSON=al;wt.encode=Fl;wt.decode=bl;wt.fromJSON=Mo;Ht.encode=Dl;Ht.decode=gl;Ht.fromJSON=cl;Ne.encode=Tl;Ne.decode=vl;$t.encode=Nl;$t.decode=_l;function ml(n,t=new Map){const e=Il(n,t);return new P(e,xn(n),t)}function bl(n,t=_t.V4){if(n.compression()!==null)throw new Error("Record batch compression not implemented");return new wt(n.length(),wl(n),Sl(n,t))}function gl(n,t=_t.V4){return new Ht(wt.decode(n.data(),t),n.id(),n.isDelta())}function _l(n){return new $t(n.offset(),n.length())}function vl(n){return new Ne(n.length(),n.nullCount())}function wl(n){const t=[];for(let e,i=-1,r=-1,s=n.nodesLength();++i<s;)(e=n.nodes(i))&&(t[++r]=Ne.decode(e));return t}function Sl(n,t){const e=[];for(let i,r=-1,s=-1,o=n.buffersLength();++r<o;)(i=n.buffers(r))&&(t<_t.V4&&(i.bb_pos+=8*(r+1)),e[++s]=$t.decode(i));return e}function Il(n,t){const e=[];for(let i,r=-1,s=-1,o=n.fieldsLength();++r<o;)(i=n.fields(r))&&(e[++s]=q.decode(i,t));return e}function Yr(n,t){const e=[];for(let i,r=-1,s=-1,o=n.childrenLength();++r<o;)(i=n.children(r))&&(e[++s]=q.decode(i,t));return e}function Bl(n,t){let e,i,r,s,o,a;return!t||!(a=n.dictionary())?(r=qr(n,Yr(n,t)),i=new q(n.name(),r,n.nullable(),xn(n))):t.has(e=a.id().low)?(s=(s=a.indexType())?Hr(s):new cn,o=new $e(t.get(e),s,e,a.isOrdered()),i=new q(n.name(),o,n.nullable(),xn(n))):(s=(s=a.indexType())?Hr(s):new cn,t.set(e,r=qr(n,Yr(n,t))),o=new $e(r,s,e,a.isOrdered()),i=new q(n.name(),o,n.nullable(),xn(n))),i||null}function xn(n){const t=new Map;if(n)for(let e,i,r=-1,s=Math.trunc(n.customMetadataLength());++r<s;)(e=n.customMetadata(r))&&(i=e.key())!=null&&t.set(i,e.value());return t}function Hr(n){return new fe(n.isSigned(),n.bitWidth())}function qr(n,t){const e=n.typeType();switch(e){case G.NONE:return new de;case G.Null:return new de;case G.Binary:return new Ln;case G.Utf8:return new Rn;case G.Bool:return new Un;case G.List:return new kn((t||[])[0]);case G.Struct_:return new st(t||[])}switch(e){case G.Int:{const i=n.type(new gt);return new fe(i.isSigned(),i.bitWidth())}case G.FloatingPoint:{const i=n.type(new kt);return new ln(i.precision())}case G.Decimal:{const i=n.type(new lt);return new Cn(i.scale(),i.precision(),i.bitWidth())}case G.Date:{const i=n.type(new Fn);return new En(i.unit())}case G.Time:{const i=n.type(new Ot);return new un(i.unit(),i.bitWidth())}case G.Timestamp:{const i=n.type(new Ft);return new jn(i.unit(),i.timezone())}case G.Interval:{const i=n.type(new Pt);return new zn(i.unit())}case G.Union:{const i=n.type(new ut);return new Pn(i.mode(),i.typeIdsArray()||[],t||[])}case G.FixedSizeBinary:{const i=n.type(new jt);return new Vn(i.byteWidth())}case G.FixedSizeList:{const i=n.type(new zt);return new $n(i.listSize(),(t||[])[0])}case G.Map:{const i=n.type(new Dn);return new Wn((t||[])[0],i.keysSorted())}}throw new Error(`Unrecognized type: "${G[e]}" (${e})`)}function Al(n,t){const e=t.fields.map(s=>q.encode(n,s));Rt.startFieldsVector(n,e.length);const i=Rt.createFieldsVector(n,e),r=t.metadata&&t.metadata.size>0?Rt.createCustomMetadataVector(n,[...t.metadata].map(([s,o])=>{const a=n.createString(`${s}`),c=n.createString(`${o}`);return nt.startKeyValue(n),nt.addKey(n,a),nt.addValue(n,c),nt.endKeyValue(n)})):-1;return Rt.startSchema(n),Rt.addFields(n,i),Rt.addEndianness(n,Ml?He.Little:He.Big),r!==-1&&Rt.addCustomMetadata(n,r),Rt.endSchema(n)}function Ol(n,t){let e=-1,i=-1,r=-1;const s=t.type;let o=t.typeId;_.isDictionary(s)?(o=s.dictionary.typeId,r=Fi.visit(s,n),i=Fi.visit(s.dictionary,n)):i=Fi.visit(s,n);const a=(s.children||[]).map(d=>q.encode(n,d)),c=Bt.createChildrenVector(n,a),u=t.metadata&&t.metadata.size>0?Bt.createCustomMetadataVector(n,[...t.metadata].map(([d,p])=>{const b=n.createString(`${d}`),m=n.createString(`${p}`);return nt.startKeyValue(n),nt.addKey(n,b),nt.addValue(n,m),nt.endKeyValue(n)})):-1;return t.name&&(e=n.createString(t.name)),Bt.startField(n),Bt.addType(n,i),Bt.addTypeType(n,o),Bt.addChildren(n,c),Bt.addNullable(n,!!t.nullable),e!==-1&&Bt.addName(n,e),r!==-1&&Bt.addDictionary(n,r),u!==-1&&Bt.addCustomMetadata(n,u),Bt.endField(n)}function Fl(n,t){const e=t.nodes||[],i=t.buffers||[];Xt.startNodesVector(n,e.length);for(const o of e.slice().reverse())Ne.encode(n,o);const r=n.endVector();Xt.startBuffersVector(n,i.length);for(const o of i.slice().reverse())$t.encode(n,o);const s=n.endVector();return Xt.startRecordBatch(n),Xt.addLength(n,new De(t.length,0)),Xt.addNodes(n,r),Xt.addBuffers(n,s),Xt.endRecordBatch(n)}function Dl(n,t){const e=wt.encode(n,t.data);return Ue.startDictionaryBatch(n),Ue.addId(n,new De(t.id,0)),Ue.addIsDelta(n,t.isDelta),Ue.addData(n,e),Ue.endDictionaryBatch(n)}function Tl(n,t){return No.createFieldNode(n,new De(t.length,0),new De(t.nullCount,0))}function Nl(n,t){return To.createBuffer(n,new De(t.offset,0),new De(t.length,0))}const Ml=(()=>{const n=new ArrayBuffer(2);return new DataView(n).setInt16(0,256,!0),new Int16Array(n)[0]===256})(),ur=n=>`Expected ${z[n]} Message in stream, but was null or length 0.`,hr=n=>`Header pointer of flatbuffer-encoded ${z[n]} Message is null or length 0.`,Ro=(n,t)=>`Expected to read ${n} metadata bytes, but only read ${t}.`,Uo=(n,t)=>`Expected to read ${n} bytes for message body, but only read ${t}.`;class Co{constructor(t){this.source=t instanceof Xn?t:new Xn(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done||t.value===-1&&(t=this.readMetadataLength()).done||(t=this.readMetadata(t.value)).done?K: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(ur(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const e=U(this.source.read(t));if(e.byteLength<t)throw new Error(Uo(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()}readSchema(t=!1){const e=z.Schema,i=this.readMessage(e),r=i==null?void 0:i.header();if(t&&!r)throw new Error(hr(e));return r}readMetadataLength(){const t=this.source.read(hi),e=t&&new We(t),i=(e==null?void 0:e.readInt32(0))||0;return{done:i===0,value:i}}readMetadata(t){const e=this.source.read(t);if(!e)return K;if(e.byteLength<t)throw new Error(Ro(t,e.byteLength));return{done:!1,value:ot.decode(e)}}}class xl{constructor(t,e){this.source=t instanceof Je?t:ns(t)?new ti(t,e):new Je(t)}[Symbol.asyncIterator](){return this}next(){return g(this,void 0,void 0,function*(){let t;return(t=yield this.readMetadataLength()).done||t.value===-1&&(t=yield this.readMetadataLength()).done||(t=yield this.readMetadata(t.value)).done?K:t})}throw(t){return g(this,void 0,void 0,function*(){return yield this.source.throw(t)})}return(t){return g(this,void 0,void 0,function*(){return yield this.source.return(t)})}readMessage(t){return g(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(ur(t));return e.value})}readMessageBody(t){return g(this,void 0,void 0,function*(){if(t<=0)return new Uint8Array(0);const e=U(yield this.source.read(t));if(e.byteLength<t)throw new Error(Uo(t,e.byteLength));return e.byteOffset%8===0&&e.byteOffset+e.byteLength<=e.buffer.byteLength?e:e.slice()})}readSchema(t=!1){return g(this,void 0,void 0,function*(){const e=z.Schema,i=yield this.readMessage(e),r=i==null?void 0:i.header();if(t&&!r)throw new Error(hr(e));return r})}readMetadataLength(){return g(this,void 0,void 0,function*(){const t=yield this.source.read(hi),e=t&&new We(t),i=(e==null?void 0:e.readInt32(0))||0;return{done:i===0,value:i}})}readMetadata(t){return g(this,void 0,void 0,function*(){const e=yield this.source.read(t);if(!e)return K;if(e.byteLength<t)throw new Error(Ro(t,e.byteLength));return{done:!1,value:ot.decode(e)}})}}class Ll extends Co{constructor(t){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=t instanceof zr?t:new zr(t)}next(){const{_json:t}=this;if(!this._schema)return this._schema=!0,{done:!1,value:ot.fromJSON(t.schema,z.Schema)};if(this._dictionaryIndex<t.dictionaries.length){const e=t.dictionaries[this._dictionaryIndex++];return this._body=e.data.columns,{done:!1,value:ot.fromJSON(e,z.DictionaryBatch)}}if(this._batchIndex<t.batches.length){const e=t.batches[this._batchIndex++];return this._body=e.columns,{done:!1,value:ot.fromJSON(e,z.RecordBatch)}}return this._body=[],K}readMessageBody(t){return e(this._body);function e(i){return(i||[]).reduce((r,s)=>[...r,...s.VALIDITY&&[s.VALIDITY]||[],...s.TYPE&&[s.TYPE]||[],...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(ur(t));return e.value}readSchema(){const t=z.Schema,e=this.readMessage(t),i=e==null?void 0:e.header();if(!e||!i)throw new Error(hr(t));return i}}const hi=4,Pi="ARROW1",dn=new Uint8Array(Pi.length);for(let n=0;n<Pi.length;n+=1)dn[n]=Pi.codePointAt(n);function dr(n,t=0){for(let e=-1,i=dn.length;++e<i;)if(dn[e]!==n[t+e])return!1;return!0}const vn=dn.length,Eo=vn+hi,Rl=vn*2+hi;class ie extends rr{constructor(t){super(),this._impl=t}get closed(){return this._impl.closed}get schema(){return this._impl.schema}get autoDestroy(){return this._impl.autoDestroy}get dictionaries(){return this._impl.dictionaries}get numDictionaries(){return this._impl.numDictionaries}get numRecordBatches(){return this._impl.numRecordBatches}get footer(){return this._impl.isFile()?this._impl.footer:null}isSync(){return this._impl.isSync()}isAsync(){return this._impl.isAsync()}isFile(){return this._impl.isFile()}isStream(){return this._impl.isStream()}next(){return this._impl.next()}throw(t){return this._impl.throw(t)}return(t){return this._impl.return(t)}cancel(){return this._impl.cancel()}reset(t){return this._impl.reset(t),this._DOMStream=void 0,this._nodeStream=void 0,this}open(t){const e=this._impl.open(t);return ue(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 At.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return At.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 ie?t:Ni(t)?jl(t):ns(t)?Pl(t):ue(t)?g(this,void 0,void 0,function*(){return yield ie.from(yield t)}):is(t)||Wi(t)||rs(t)||Ke(t)?kl(new Je(t)):zl(new Xn(t))}static readAll(t){return t instanceof ie?t.isSync()?Jr(t):Gr(t):Ni(t)||ArrayBuffer.isView(t)||mn(t)||es(t)?Jr(t):Gr(t)}}class ri extends ie{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return Vt(this,arguments,function*(){yield T(yield*On(Oe(this[Symbol.iterator]())))})}}class si extends ie{constructor(t){super(t),this._impl=t}readAll(){var t,e;return g(this,void 0,void 0,function*(){const i=new Array;try{for(var r=Oe(this),s;s=yield r.next(),!s.done;){const o=s.value;i.push(o)}}catch(o){t={error:o}}finally{try{s&&!s.done&&(e=r.return)&&(yield e.call(r))}finally{if(t)throw t.error}}return i})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class jo extends ri{constructor(t){super(t),this._impl=t}}class Ul extends si{constructor(t){super(t),this._impl=t}}class zo{constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,e){const i=this._loadVectors(t,e,this.schema.fields),r=x({type:new st(this.schema.fields),length:t.length,children:i});return new ht(this.schema,r)}_loadDictionaryBatch(t,e){const{id:i,isDelta:r}=t,{dictionaries:s,schema:o}=this,a=s.get(i);if(r||!a){const c=o.dictionaries.get(i),u=this._loadVectors(t.data,e,[c]);return(a&&r?a.concat(new k(u)):new k(u)).memoize()}return a.memoize()}_loadVectors(t,e,i){return new Ao(e,t.nodes,t.buffers,this.dictionaries).visitMany(i)}}class oi extends zo{constructor(t,e){super(e),this._reader=Ni(t)?new Ll(this._handle=t):new Co(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=Po(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):K}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):K}next(){if(this.closed)return K;let t;const{_reader:e}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const i=t.header(),r=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(i,r)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const i=t.header(),r=e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(i,r);this.dictionaries.set(i.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new lr(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class ai extends zo{constructor(t,e){super(e),this._reader=new xl(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return g(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 g(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=Po(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return g(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):K})}return(t){return g(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):K})}next(){return g(this,void 0,void 0,function*(){if(this.closed)return K;let t;const{_reader:e}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const i=t.header(),r=yield e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(i,r)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const i=t.header(),r=yield e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(i,r);this.dictionaries.set(i.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new lr(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return g(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}}class ko extends oi{constructor(t,e){super(t instanceof kr?t:new kr(t),e)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(const 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();const i=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(i&&this._handle.seek(i.offset)){const r=this._reader.readMessage(z.RecordBatch);if(r!=null&&r.isRecordBatch()){const s=r.header(),o=this._reader.readMessageBody(r.bodyLength);return this._loadRecordBatch(s,o)}}return null}_readDictionaryBatch(t){var e;const i=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(i&&this._handle.seek(i.offset)){const r=this._reader.readMessage(z.DictionaryBatch);if(r!=null&&r.isDictionaryBatch()){const s=r.header(),o=this._reader.readMessageBody(r.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}}_readFooter(){const{_handle:t}=this,e=t.size-Eo,i=t.readInt32(e),r=t.readAt(e-i,i);return hn.decode(r)}_readNextMessageAndValidate(t){var e;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){const i=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(this._recordBatchIndex);if(i&&this._handle.seek(i.offset))return this._reader.readMessage(t)}return null}}class Cl extends ai{constructor(t,...e){const i=typeof e[0]!="number"?e.shift():void 0,r=e[0]instanceof Map?e.shift():void 0;super(t instanceof ti?t:new ti(t,i),r)}get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}isFile(){return!0}isAsync(){return!0}open(t){const e=Object.create(null,{open:{get:()=>super.open}});return g(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(const i of this._footer.dictionaryBatches())i&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield e.open.call(this,t)})}readRecordBatch(t){var e;return g(this,void 0,void 0,function*(){if(this.closed)return null;this._footer||(yield this.open());const i=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(i&&(yield this._handle.seek(i.offset))){const r=yield this._reader.readMessage(z.RecordBatch);if(r!=null&&r.isRecordBatch()){const s=r.header(),o=yield this._reader.readMessageBody(r.bodyLength);return this._loadRecordBatch(s,o)}}return null})}_readDictionaryBatch(t){var e;return g(this,void 0,void 0,function*(){const i=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(i&&(yield this._handle.seek(i.offset))){const r=yield this._reader.readMessage(z.DictionaryBatch);if(r!=null&&r.isDictionaryBatch()){const s=r.header(),o=yield this._reader.readMessageBody(r.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}})}_readFooter(){return g(this,void 0,void 0,function*(){const{_handle:t}=this;t._pending&&(yield t._pending);const e=t.size-Eo,i=yield t.readInt32(e),r=yield t.readAt(e-i,i);return hn.decode(r)})}_readNextMessageAndValidate(t){return g(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){const e=this._footer.getRecordBatch(this._recordBatchIndex);if(e&&(yield this._handle.seek(e.offset)))return yield this._reader.readMessage(t)}return null})}}class El extends oi{constructor(t,e){super(t,e)}_loadVectors(t,e,i){return new Gc(e,t.nodes,t.buffers,this.dictionaries).visitMany(i)}}function Po(n,t){return t&&typeof t.autoDestroy=="boolean"?t.autoDestroy:n.autoDestroy}function*Jr(n){const t=ie.from(n);try{if(!t.open({autoDestroy:!1}).closed)do yield t;while(!t.reset().open().closed)}finally{t.cancel()}}function Gr(n){return Vt(this,arguments,function*(){const e=yield T(ie.from(n));try{if(!(yield T(e.open({autoDestroy:!1}))).closed)do yield yield T(e);while(!(yield T(e.reset().open())).closed)}finally{yield T(e.cancel())}})}function jl(n){return new ri(new El(n))}function zl(n){const t=n.peek(vn+7&-8);return t&&t.byteLength>=4?dr(t)?new jo(new ko(n.read())):new ri(new oi(n)):new ri(new oi(function*(){}()))}function kl(n){return g(this,void 0,void 0,function*(){const t=yield n.peek(vn+7&-8);return t&&t.byteLength>=4?dr(t)?new jo(new ko(yield n.read())):new si(new ai(n)):new si(new ai(function(){return Vt(this,arguments,function*(){})}()))})}function Pl(n){return g(this,void 0,void 0,function*(){const{size:t}=yield n.stat(),e=new ti(n,t);return t>=Rl&&dr(yield e.readAt(0,vn+7&-8))?new Ul(new Cl(e)):new si(new ai(e))})}class X extends L{constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}static assemble(...t){const e=r=>r.flatMap(s=>Array.isArray(s)?e(s):s instanceof ht?s.data.children:s.data),i=new X;return i.visitMany(e(t)),i}visit(t){if(t instanceof k)return this.visitMany(t.data),this;const{type:e}=t;if(!_.isDictionary(e)){const{length:i,nullCount:r}=t;if(i>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");_.isNull(e)||Mt.call(this,r<=0?new Uint8Array(0):Xi(t.offset,i,t.nullBitmap)),this.nodes.push(new Ne(i,r))}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}}function Mt(n){const t=n.byteLength+7&-8;return this.buffers.push(n),this.bufferRegions.push(new $t(this._byteLength,t)),this._byteLength+=t,this}function Vl(n){const{type:t,length:e,typeIds:i,valueOffsets:r}=n;if(Mt.call(this,i),t.mode===vt.Sparse)return Vi.call(this,n);if(t.mode===vt.Dense){if(n.offset<=0)return Mt.call(this,r),Vi.call(this,n);{const s=i.reduce((d,p)=>Math.max(d,p),i[0]),o=new Int32Array(s+1),a=new Int32Array(s+1).fill(-1),c=new Int32Array(e),u=Hi(-r[0],e,r);for(let d,p,b=-1;++b<e;)(p=a[d=i[b]])===-1&&(p=a[d]=u[d]),c[b]=u[b]-p,++o[d];Mt.call(this,c);for(let d,p=-1,b=t.children.length;++p<b;)if(d=n.children[p]){const m=t.typeIds[p],N=Math.min(e,o[m]);this.visit(d.slice(a[m],N))}}}return this}function $l(n){let t;return n.nullCount>=n.length?Mt.call(this,new Uint8Array(0)):(t=n.values)instanceof Uint8Array?Mt.call(this,Xi(n.offset,n.length,t)):Mt.call(this,Yn(n.values))}function ge(n){return Mt.call(this,n.values.subarray(0,n.length*n.stride))}function Vo(n){const{length:t,values:e,valueOffsets:i}=n,r=i[0],s=i[t],o=Math.min(s-r,e.byteLength-r);return Mt.call(this,Hi(-i[0],t,i)),Mt.call(this,e.subarray(r,r+o)),this}function fr(n){const{length:t,valueOffsets:e}=n;return e&&Mt.call(this,Hi(e[0],t,e)),this.visit(n.children[0])}function Vi(n){return this.visitMany(n.type.children.map((t,e)=>n.children[e]).filter(Boolean))[0]}X.prototype.visitBool=$l;X.prototype.visitInt=ge;X.prototype.visitFloat=ge;X.prototype.visitUtf8=Vo;X.prototype.visitBinary=Vo;X.prototype.visitFixedSizeBinary=ge;X.prototype.visitDate=ge;X.prototype.visitTimestamp=ge;X.prototype.visitTime=ge;X.prototype.visitDecimal=ge;X.prototype.visitList=fr;X.prototype.visitStruct=Vi;X.prototype.visitUnion=Vl;X.prototype.visitInterval=ge;X.prototype.visitFixedSizeList=fr;X.prototype.visitMap=fr;class $o extends rr{constructor(t){super(),this._position=0,this._started=!1,this._sink=new Nn,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,ft(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return ue(t)?t.then(e=>this.writeAll(e)):Ke(t)?br(this,t):mr(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 Nn?this._sink=t:(this._sink=new Nn,t&&ua(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&ha(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._dictionaryDeltaOffsets=new Map,(!e||!ji(e,this._schema))&&(e==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=e,this._writeSchema(e))),this}write(t){let e=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof rt&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof ht&&!(e=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(e&&!ji(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof ht?t instanceof lr||this._writeRecordBatch(t):t instanceof rt?this.writeAll(t.batches):mn(t)&&this.writeAll(t)}_writeMessage(t,e=8){const i=e-1,r=ot.encode(t),s=r.byteLength,o=this._writeLegacyIpcFormat?4:8,a=s+o+i&~i,c=a-s-o;return t.headerType===z.RecordBatch?this._recordBatchBlocks.push(new pe(a,t.bodyLength,this._position)):t.headerType===z.DictionaryBatch&&this._dictionaryBlocks.push(new pe(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),s>0&&this._write(r),this._writePadding(c)}_write(t){if(this._started){const e=U(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(dn)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:e,nodes:i,bufferRegions:r,buffers:s}=X.assemble(t),o=new wt(t.numRows,i,r),a=ot.from(o,e);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(s)}_writeDictionaryBatch(t,e,i=!1){this._dictionaryDeltaOffsets.set(e,t.length+(this._dictionaryDeltaOffsets.get(e)||0));const{byteLength:r,nodes:s,bufferRegions:o,buffers:a}=X.assemble(new k([t])),c=new wt(t.length,s,o),u=new Ht(c,e,i),d=ot.from(u,r);return this._writeMessage(d)._writeBodyBuffers(a)}_writeBodyBuffers(t){let e,i,r;for(let s=-1,o=t.length;++s<o;)(e=t[s])&&(i=e.byteLength)>0&&(this._write(e),(r=(i+7&-8)-i)>0&&this._writePadding(r));return this}_writeDictionaries(t){for(let[e,i]of t.dictionaries){let r=this._dictionaryDeltaOffsets.get(e)||0;if(r===0||(i=i==null?void 0:i.slice(r)).length>0)for(const s of i.data)this._writeDictionaryBatch(s,e,r>0),r+=s.length}return this}}class pr extends $o{static writeAll(t,e){const i=new pr(e);return ue(t)?t.then(r=>i.writeAll(r)):Ke(t)?br(i,t):mr(i,t)}}class yr extends $o{static writeAll(t){const e=new yr;return ue(t)?t.then(i=>e.writeAll(i)):Ke(t)?br(e,t):mr(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){const e=hn.encode(new hn(t,_t.V4,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}}function mr(n,t){let e=t;t instanceof rt&&(e=t.batches,n.reset(void 0,t.schema));for(const i of e)n.write(i);return n.finish()}function br(n,t){var e,i,r,s;return g(this,void 0,void 0,function*(){try{for(e=Oe(t);i=yield e.next(),!i.done;){const o=i.value;n.write(o)}}catch(o){r={error:o}}finally{try{i&&!i.done&&(s=e.return)&&(yield s.call(e))}finally{if(r)throw r.error}}return n.finish()})}function tn(n){const t=ie.from(n);return ue(t)?t.then(e=>tn(e)):t.isAsync()?t.readAll().then(e=>new rt(e)):new rt(t.readAll())}function Di(n,t="stream"){return(t==="stream"?pr:yr).writeAll(n).toUint8Array(!0)}var Kr=function(){function n(t,e,i,r){var s=this;this.getCell=function(o,a){var c=o<s.headerRows&&a<s.headerColumns,u=o>=s.headerRows&&a<s.headerColumns,d=o<s.headerRows&&a>=s.headerColumns;if(c){var p=["blank"];return a>0&&p.push("level"+o),{type:"blank",classNames:p.join(" "),content:""}}else if(d){var b=a-s.headerColumns,p=["col_heading","level"+o,"col"+b];return{type:"columns",classNames:p.join(" "),content:s.getContent(s.columnsTable,b,o)}}else if(u){var m=o-s.headerRows,p=["row_heading","level"+a,"row"+m];return{type:"index",id:"T_".concat(s.uuid,"level").concat(a,"_row").concat(m),classNames:p.join(" "),content:s.getContent(s.indexTable,m,a)}}else{var m=o-s.headerRows,b=a-s.headerColumns,p=["data","row"+m,"col"+b],N=s.styler?s.getContent(s.styler.displayValuesTable,m,b):s.getContent(s.dataTable,m,b);return{type:"data",id:"T_".concat(s.uuid,"row").concat(m,"_col").concat(b),classNames:p.join(" "),content:N}}},this.getContent=function(o,a,c){var u=o.getChildAt(c);if(u===null)return"";var d=s.getColumnTypeId(o,c);switch(d){case l.Timestamp:return s.nanosToDate(u.get(a));default:return u.get(a)}},this.dataTable=tn(t),this.indexTable=tn(e),this.columnsTable=tn(i),this.styler=r?{caption:r.caption,displayValuesTable:tn(r.displayValues),styles:r.styles,uuid:r.uuid}:void 0}return Object.defineProperty(n.prototype,"rows",{get:function(){return this.indexTable.numRows+this.columnsTable.numCols},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columns",{get:function(){return this.indexTable.numCols+this.columnsTable.numRows},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"headerRows",{get:function(){return this.rows-this.dataRows},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"headerColumns",{get:function(){return this.columns-this.dataColumns},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dataRows",{get:function(){return this.dataTable.numRows},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dataColumns",{get:function(){return this.dataTable.numCols},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"uuid",{get:function(){return this.styler&&this.styler.uuid},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"caption",{get:function(){return this.styler&&this.styler.caption},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"styles",{get:function(){return this.styler&&this.styler.styles},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"table",{get:function(){return this.dataTable},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.indexTable},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnTable",{get:function(){return this.columnsTable},enumerable:!1,configurable:!0}),n.prototype.serialize=function(){return{data:Di(this.dataTable),index:Di(this.indexTable),columns:Di(this.columnsTable)}},n.prototype.getColumnTypeId=function(t,e){return t.schema.fields[e].type.typeId},n.prototype.nanosToDate=function(t){return new Date(t/1e6)},n}(),rn=function(){return rn=Object.assign||function(n){for(var t,e=1,i=arguments.length;e<i;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},rn.apply(this,arguments)},sn;(function(n){n.COMPONENT_READY="streamlit:componentReady",n.SET_COMPONENT_VALUE="streamlit:setComponentValue",n.SET_FRAME_HEIGHT="streamlit:setFrameHeight"})(sn||(sn={}));var Te=function(){function n(){}return n.API_VERSION=1,n.RENDER_EVENT="streamlit:render",n.events=new EventTarget,n.registeredMessageListener=!1,n.setComponentReady=function(){n.registeredMessageListener||(window.addEventListener("message",n.onMessageEvent),n.registeredMessageListener=!0),n.sendBackMsg(sn.COMPONENT_READY,{apiVersion:n.API_VERSION})},n.setFrameHeight=function(t){t===void 0&&(t=document.body.scrollHeight),t!==n.lastFrameHeight&&(n.lastFrameHeight=t,n.sendBackMsg(sn.SET_FRAME_HEIGHT,{height:t}))},n.setComponentValue=function(t){var e;t instanceof Kr?(e="dataframe",t=t.serialize()):Yl(t)?(e="bytes",t=new Uint8Array(t.buffer)):t instanceof ArrayBuffer?(e="bytes",t=new Uint8Array(t)):e="json",n.sendBackMsg(sn.SET_COMPONENT_VALUE,{value:t,dataType:e})},n.onMessageEvent=function(t){var e=t.data.type;switch(e){case n.RENDER_EVENT:n.onRenderMessage(t.data);break}},n.onRenderMessage=function(t){var e=t.args;e==null&&(console.error("Got null args in onRenderMessage. This should never happen"),e={});var i=t.dfs&&t.dfs.length>0?n.argsDataframeToObject(t.dfs):{};e=rn(rn({},e),i);var r=!!t.disabled,s=t.theme;s&&Wl(s);var o={disabled:r,args:e,theme:s},a=new CustomEvent(n.RENDER_EVENT,{detail:o});n.events.dispatchEvent(a)},n.argsDataframeToObject=function(t){var e=t.map(function(i){var r=i.key,s=i.value;return[r,n.toArrowTable(s)]});return Object.fromEntries(e)},n.toArrowTable=function(t){var e,i=(e=t.data,e.data),r=e.index,s=e.columns,o=e.styler;return new Kr(i,r,s,o)},n.sendBackMsg=function(t,e){window.parent.postMessage(rn({isStreamlitMessage:!0,type:t},e),"*")},n}(),Wl=function(n){var t=document.createElement("style");document.head.appendChild(t),t.innerHTML=`
    :root {
      --primary-color: `.concat(n.primaryColor,`;
      --background-color: `).concat(n.backgroundColor,`;
      --secondary-background-color: `).concat(n.secondaryBackgroundColor,`;
      --text-color: `).concat(n.textColor,`;
      --font: `).concat(n.font,`;
    }

    body {
      background-color: var(--background-color);
      color: var(--text-color);
    }
  `)};function Yl(n){var t=!1;try{t=n instanceof BigInt64Array||n instanceof BigUint64Array}catch{}return n instanceof Int8Array||n instanceof Uint8Array||n instanceof Uint8ClampedArray||n instanceof Int16Array||n instanceof Uint16Array||n instanceof Int32Array||n instanceof Uint32Array||n instanceof Float32Array||n instanceof Float64Array||t}var Hl=function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=r[s])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function i(){this.constructor=t}t.prototype=e===null?Object.create(e):(i.prototype=e.prototype,new i)}}();(function(n){Hl(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.componentDidMount=function(){Te.setFrameHeight()},t.prototype.componentDidUpdate=function(){Te.setFrameHeight()},t})(sa.PureComponent);function Ee(n,t,e){return Math.min(Math.max(n,e),t)}class ql extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var en=ql;function Jl(n){if(typeof n!="string")throw new en(n);if(n.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=n.trim();t=nu.test(n)?Zl(n):n;const e=Ql.exec(t);if(e){const o=Array.from(e).slice(1);return[...o.slice(0,3).map(a=>parseInt(fn(a,2),16)),parseInt(fn(o[3]||"f",2),16)/255]}const i=Xl.exec(t);if(i){const o=Array.from(i).slice(1);return[...o.slice(0,3).map(a=>parseInt(a,16)),parseInt(o[3]||"ff",16)/255]}const r=tu.exec(t);if(r){const o=Array.from(r).slice(1);return[...o.slice(0,3).map(a=>parseInt(a,10)),parseFloat(o[3]||"1")]}const s=eu.exec(t);if(s){const[o,a,c,u]=Array.from(s).slice(1).map(parseFloat);if(Ee(0,100,a)!==a)throw new en(n);if(Ee(0,100,c)!==c)throw new en(n);return[...iu(o,a,c),Number.isNaN(u)?1:u]}throw new en(n)}function Gl(n){let t=5381,e=n.length;for(;e;)t=t*33^n.charCodeAt(--e);return(t>>>0)%2341}const Zr=n=>parseInt(n.replace(/_/g,""),36),Kl="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((n,t)=>{const e=Zr(t.substring(0,3)),i=Zr(t.substring(3)).toString(16);let r="";for(let s=0;s<6-i.length;s++)r+="0";return n[e]=`${r}${i}`,n},{});function Zl(n){const t=n.toLowerCase().trim(),e=Kl[Gl(t)];if(!e)throw new en(n);return`#${e}`}const fn=(n,t)=>Array.from(Array(t)).map(()=>n).join(""),Ql=new RegExp(`^#${fn("([a-f0-9])",3)}([a-f0-9])?$`,"i"),Xl=new RegExp(`^#${fn("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),tu=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${fn(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),eu=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,nu=/^[a-z]+$/i,Qr=n=>Math.round(n*255),iu=(n,t,e)=>{let i=e/100;if(t===0)return[i,i,i].map(Qr);const r=(n%360+360)%360/60,s=(1-Math.abs(2*i-1))*(t/100),o=s*(1-Math.abs(r%2-1));let a=0,c=0,u=0;r>=0&&r<1?(a=s,c=o):r>=1&&r<2?(a=o,c=s):r>=2&&r<3?(c=s,u=o):r>=3&&r<4?(c=o,u=s):r>=4&&r<5?(a=o,u=s):r>=5&&r<6&&(a=s,u=o);const d=i-s/2,p=a+d,b=c+d,m=u+d;return[p,b,m].map(Qr)};function ru(n,t,e,i){return`rgba(${Ee(0,255,n).toFixed()}, ${Ee(0,255,t).toFixed()}, ${Ee(0,255,e).toFixed()}, ${parseFloat(Ee(0,1,i).toFixed(3))})`}function su(n,t){const[e,i,r,s]=Jl(n);return ru(e,i,r,s-t)}class ou{constructor(t){Sr(this,"attrs");this.attrs=t}get(t,e){let i=null;return Object.keys(this.attrs).forEach(s=>{t instanceof window.Bokeh[s]&&(i=s)}),i===null?void 0:(this.attrs[i]??{})[e]??void 0}}function au(n){const{backgroundColor:t,secondaryBackgroundColor:e,textColor:i}=n,r=su(i,.8);return new ou({Plot:{background_fill_color:t,border_fill_color:t,outline_line_color:"transparent",outline_line_alpha:.25},Grid:{grid_line_color:r,grid_line_alpha:.5},Axis:{major_tick_line_alpha:0,major_tick_line_color:i,minor_tick_line_alpha:0,minor_tick_line_color:i,axis_line_alpha:0,axis_line_color:i,major_label_text_color:i,major_label_text_font:'"Source Sans Pro", sans-serif',major_label_text_font_size:"1em",axis_label_standoff:10,axis_label_text_color:i,axis_label_text_font:'"Source Sans Pro", sans-serif',axis_label_text_font_size:"1em",axis_label_text_font_style:"normal"},Legend:{spacing:8,glyph_width:15,label_standoff:8,label_text_color:i,label_text_font:'"Source Sans Pro", sans-serif',label_text_font_size:"1.025em",border_line_alpha:0,background_fill_alpha:.25,background_fill_color:r},BaseColorBar:{title_text_color:i,title_text_font:'"Source Sans Pro", sans-serif',title_text_font_size:"1.025em",title_text_font_style:"normal",major_label_text_color:i,major_label_text_font:'"Source Sans Pro", sans-serif',major_label_text_font_size:"1.025em",background_fill_color:e,major_tick_line_alpha:0,bar_line_alpha:0},Title:{text_color:i,text_font:'"Source Sans Pro", sans-serif',text_font_size:"1.15em"}})}const Xr=document.getElementById("stBokehChart"),cu=400,lu=350,uu=()=>{let n=null,t=null;return e=>e!==n?(n=e,t=JSON.parse(e),{data:t,hasChanged:!0}):{data:t,hasChanged:!1}},hu=uu(),du=()=>{let n=null,t=null;return(e,i)=>{let r=!1;const s=JSON.stringify(i);if(e!==n||n==="streamlit"&&t!==s){n=e,t=s;const{use_theme:o}=window.Bokeh.require("core/properties");n==="streamlit"||!(n in window.Bokeh.Themes)?(o(au(i)),r=!0):o(window.Bokeh.Themes[n])}return r}},fu=du();function pu(n,t){const e=n.attributes.width??cu,i=n.attributes.height??lu;let r=e,s=i;return t&&(r=document.documentElement.clientWidth,s=r/e*i),{width:r,height:s}}function yu(n){for(;n.lastChild;)n.lastChild.remove()}async function mu(n,t=!1){var i,r;const e=(r=(i=n==null?void 0:n.doc)==null?void 0:i.roots)==null?void 0:r[0];if(e){const{width:s,height:o}=pu(e,t);s>0&&(e.attributes.width=s),o>0&&(e.attributes.height=o)}Xr!==null&&(yu(Xr),await window.Bokeh.embed.embed_item(n,"stBokehChart"))}async function bu(n){const t=n.detail,{figure:e,bokeh_theme:i,use_container_width:r}=t.args,{data:s,hasChanged:o}=hu(e),a=fu(i,t.theme);(o||a)&&await mu(s,r),Te.setFrameHeight()}Te.events.addEventListener(Te.RENDER_EVENT,bu);Te.setComponentReady();Te.setFrameHeight();
