diff --git a/.gitignore b/.gitignore index 2e021b04..324bc0ff 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ airflow_home env node_modules/* Honey.txt +node_modules diff --git a/chess_piece/app_hive.py b/chess_piece/app_hive.py index 47d0289b..6e815046 100644 --- a/chess_piece/app_hive.py +++ b/chess_piece/app_hive.py @@ -146,13 +146,13 @@ def return_runningbee_gif__save(title="Saved", width=33, gif=runaway_bee_gif): local_gif(gif_path=gif) st.success(title) -def cust_graph(username, api, x_axis, y_axis, theme_options, refresh_button=False, refresh_sec=8, return_type=None, prod=False, symbols=["SPY"], graph_height=300, key='graph'): +def cust_graph(username, api, x_axis, y_axis, theme_options, refresh_button=False, refresh_sec=8, return_type=None, prod=False, symbols=["SPY"], graph_height=300, key='graph', toggles=['a', 'b', 'c']): st_custom_graph( api=api, x_axis={ 'field': x_axis }, - + toggles=toggles, y_axis=y_axis, theme_options=theme_options, refresh_button=refresh_button, diff --git a/chess_piece/fastapi_queen.py b/chess_piece/fastapi_queen.py index fb88db93..4d2e0ae5 100644 --- a/chess_piece/fastapi_queen.py +++ b/chess_piece/fastapi_queen.py @@ -639,84 +639,86 @@ def update_queenking_chessboard(username, prod, selected_row): return grid_row_button_resp(description=status) def get_queen_orders_json(client_user, username, prod, toggle_view_selection): - - try: - if toggle_view_selection.lower() == 'queen': - ORDERS = init_queenbee(client_user, prod, queen=True).get('QUEEN') - else: - ORDERS = init_queenbee(client_user, prod, orders=True).get('ORDERS') + def update_order_rules(d): + try: + d['sell_date'] = d['sell_date'].strftime('%m/%d/%Y %H:%M') + return d + except Exception as e: + return d + try: + if toggle_view_selection.lower() == 'queen': + ORDERS = init_queenbee(client_user, prod, queen=True).get('QUEEN') + else: + ORDERS = init_queenbee(client_user, prod, orders=True).get('ORDERS') - if type(ORDERS) != dict: - print("NO ORDERS") - return pd.DataFrame().to_json() + if type(ORDERS) != dict: + print("NO ORDERS") + return pd.DataFrame().to_json() - df = ORDERS['queen_orders'] + df = ORDERS['queen_orders'] - if type(df) != pd.core.frame.DataFrame: - return pd.DataFrame().to_json() + if type(df) != pd.core.frame.DataFrame: + return pd.DataFrame().to_json() - if len(df) == 1: - print("init queen") - return pd.DataFrame().to_json() + if len(df) == 1: + print("init queen") + return pd.DataFrame().to_json() - # Colors - k_colors = streamlit_config_colors() - default_text_color = k_colors['default_text_color'] # = '#59490A' - default_font = k_colors['default_font'] # = "sans serif" - default_yellow_color = k_colors['default_yellow_color'] # = '#C5B743' + # Colors + k_colors = streamlit_config_colors() + default_text_color = k_colors['default_text_color'] + default_font = k_colors['default_font'] + default_yellow_color = k_colors['default_yellow_color'] - sell_options = sell_button_dict_items() - df['sell_option'] = [sell_options for _ in range(df.shape[0])] + sell_options = sell_button_dict_items() + df['sell_option'] = [sell_options for _ in range(df.shape[0])] - df = df[df['client_order_id']!='init'] - df = df.fillna('000') - df = df[df['ticker_time_frame']!='000'] ## who are you?? WORKERBEE - # print(df_) - df['ttf_symbol'] = df['ticker_time_frame'].apply(lambda x: return_symbol_from_ttf(x)) - - df["money"] = pd.to_numeric(df["money"], errors='coerce') - df["honey"] = pd.to_numeric(df["honey"], errors='coerce') - df["honey"] = round(df["honey"] * 100,2) - df["money"] = round(df["money"],0) - # df['color_row'] = np.where(df['honey'] > 0, default_yellow_color, "#ACE5FB") - df['color_row_text'] = np.where(df['honey'] > 0, default_text_color, default_text_color) - df['color_row'] = df['honey'].apply(lambda x: generate_shade(x, wave=False)) - df['sell_reason'] = df['sell_reason'].astype(str) - df['time_frame'] = df['ticker_time_frame'].apply(lambda x: ttf_grid_names(x, symbol=True)) - - df = filter_gridby_timeFrame_view(df, toggle_view_selection) - - if toggle_view_selection == 'today': - df = split_today_vs_prior(df, timestamp='datetime').get('df_today') - # else: - # qos_view=['running', 'running_close', 'running_open'] - # df = df[df['queen_order_state'].isin(qos_view)] - - for ttf in df.index: - symbol = df.at[ttf, 'symbol'] - sell_qty = df.at[ttf, 'qty_available'] - sell_option = sell_button_dict_items(symbol, sell_qty) - df.at[ttf, 'sell_option'] = sell_option + df = df[df['client_order_id'] != 'init'] + df = df.fillna('000') + df = df[df['ticker_time_frame'] != '000'] + df['ttf_symbol'] = df['ticker_time_frame'].apply(return_symbol_from_ttf) - # sort - sort_colname = 'cost_basis_current' - df = df.sort_values(sort_colname, ascending=False) - - # # Totals Index - df.loc['Total', 'money'] = df['money'].sum() - df.loc['Total', 'honey'] = df['honey'].sum() - # df.loc['Total', 'datetime'] = '' - df.loc['Total', 'cost_basis'] = df['cost_basis'].sum() - df.loc['Total', 'cost_basis_current'] = df['cost_basis_current'].sum() - newIndex=['Total']+[ind for ind in df.index if ind!='Total'] - df=df.reindex(index=newIndex) + df["money"] = pd.to_numeric(df["money"], errors='coerce') + df["honey"] = pd.to_numeric(df["honey"], errors='coerce') + df["honey"] = round(df["honey"] * 100, 2) + df["money"] = round(df["money"], 0) + df['color_row_text'] = default_text_color + df['color_row'] = df['honey'].apply(lambda x: generate_shade(x, wave=False)) + df['sell_reason'] = df['sell_reason'].astype(str) + df['time_frame'] = df['ticker_time_frame'].apply(lambda x: ttf_grid_names(x, symbol=True)) - json_data = df.to_json(orient='records') - return json_data - except Exception as e: - print('hey now') - print_line_of_error() + df = filter_gridby_timeFrame_view(df, toggle_view_selection) + + if toggle_view_selection == 'today': + df = split_today_vs_prior(df, timestamp='datetime').get('df_today') + + for ttf in df.index: + symbol = df.at[ttf, 'symbol'] + sell_qty = df.at[ttf, 'qty_available'] + sell_option = sell_button_dict_items(symbol, sell_qty) + df.at[ttf, 'sell_option'] = sell_option + + # Apply update_order_rules to order_rules column + df['order_rules'] = df['order_rules'].apply(lambda cell: update_order_rules(cell) if isinstance(cell, dict) else cell) + + # Sort + sort_colname = 'cost_basis_current' + df = df.sort_values(sort_colname, ascending=False) + + # Totals Index + df.loc['Total', 'money'] = df['money'].sum() + df.loc['Total', 'honey'] = df['honey'].sum() + df.loc['Total', 'cost_basis'] = df['cost_basis'].sum() + df.loc['Total', 'cost_basis_current'] = df['cost_basis_current'].sum() + newIndex = ['Total'] + [ind for ind in df.index if ind != 'Total'] + df = df.reindex(index=newIndex) + + json_data = df.to_json(orient='records') + return json_data + except Exception as e: + print('hey now') + print_line_of_error() def queen_wavestories__get_macdwave(client_user, prod, symbols, toggle_view_selection, return_type='waves', revrec=None): @@ -978,8 +980,11 @@ def return_waveview_fillers(waveview): df = pd.concat([df_total, df]) df.at['Total', 'symbol'] = 'Total' for star in star_names().keys(): - df[f'{star}_value'] = df[f'{star}_value'].fillna(0) - df.at['Total', f'{star}_state'] = '${:,.0f}'.format(round(sum(df[f'{star}_value']))) + try: + df[f'{star}_value'] = df[f'{star}_value'].fillna(0) + df.at['Total', f'{star}_state'] = '${:,.0f}'.format(round(sum(df[f'{star}_value']))) + except Exception as e: + print(e) json_data = df.to_json(orient='records') diff --git a/chess_piece/king.py b/chess_piece/king.py index 2bb361d3..b35950ed 100644 --- a/chess_piece/king.py +++ b/chess_piece/king.py @@ -304,6 +304,8 @@ def kingdom__grace_to_find_a_Queen(prod=True): users_allowed_queen_email.append("stefanstapinski@yahoo.com") users_allowed_queen_email.append("sven0227@gmail.com") users_allowed_queen_email.append("nitinrohan17@gmail.com") + users_allowed_queen_email.append("m.kobzar19@gmail.com") + users_allowed_queen_email.append("nimbus2219@gmail.com") users_allowed_queen_emailname__db = {clientusername: return_db_root(client_username=clientusername) for clientusername in users_allowed_queen_email} KING['users_allowed_queen_emailname__db'] = users_allowed_queen_emailname__db diff --git a/custom_graph_v1/frontend/build/asset-manifest.json b/custom_graph_v1/frontend/build/asset-manifest.json index e9b45301..4ca0c502 100644 --- a/custom_graph_v1/frontend/build/asset-manifest.json +++ b/custom_graph_v1/frontend/build/asset-manifest.json @@ -1,22 +1,23 @@ { "files": { - "main.js": "./static/js/main.09c0b9bc.chunk.js", - "main.js.map": "./static/js/main.09c0b9bc.chunk.js.map", + "main.js": "./static/js/main.6a0d078a.chunk.js", + "main.js.map": "./static/js/main.6a0d078a.chunk.js.map", "runtime-main.js": "./static/js/runtime-main.c62f2575.js", "runtime-main.js.map": "./static/js/runtime-main.c62f2575.js.map", "static/css/2.00129a64.chunk.css": "./static/css/2.00129a64.chunk.css", - "static/js/2.83943ae3.chunk.js": "./static/js/2.83943ae3.chunk.js", - "static/js/2.83943ae3.chunk.js.map": "./static/js/2.83943ae3.chunk.js.map", + "static/js/2.b8a17ab8.chunk.js": "./static/js/2.b8a17ab8.chunk.js", + "static/js/2.b8a17ab8.chunk.js.map": "./static/js/2.b8a17ab8.chunk.js.map", "index.html": "./index.html", - "precache-manifest.60777872b27e059be0944c45b943c20e.js": "./precache-manifest.60777872b27e059be0944c45b943c20e.js", + "precache-manifest.a6f63cd72f009410b683a163389710e1.js": "./precache-manifest.a6f63cd72f009410b683a163389710e1.js", "service-worker.js": "./service-worker.js", "static/css/2.00129a64.chunk.css.map": "./static/css/2.00129a64.chunk.css.map", - "static/js/2.83943ae3.chunk.js.LICENSE.txt": "./static/js/2.83943ae3.chunk.js.LICENSE.txt" + "static/js/2.b8a17ab8.chunk.js.LICENSE.txt": "./static/js/2.b8a17ab8.chunk.js.LICENSE.txt", + "static/js/main.6a0d078a.chunk.js.LICENSE.txt": "./static/js/main.6a0d078a.chunk.js.LICENSE.txt" }, "entrypoints": [ "static/js/runtime-main.c62f2575.js", "static/css/2.00129a64.chunk.css", - "static/js/2.83943ae3.chunk.js", - "static/js/main.09c0b9bc.chunk.js" + "static/js/2.b8a17ab8.chunk.js", + "static/js/main.6a0d078a.chunk.js" ] } \ No newline at end of file diff --git a/custom_graph_v1/frontend/build/index.html b/custom_graph_v1/frontend/build/index.html index c9987ccc..d7884b2b 100644 --- a/custom_graph_v1/frontend/build/index.html +++ b/custom_graph_v1/frontend/build/index.html @@ -1 +1 @@ -Streamlit Component
\ No newline at end of file +Streamlit Component
\ No newline at end of file diff --git a/custom_graph_v1/frontend/build/precache-manifest.60777872b27e059be0944c45b943c20e.js b/custom_graph_v1/frontend/build/precache-manifest.60777872b27e059be0944c45b943c20e.js deleted file mode 100644 index 67a5d787..00000000 --- a/custom_graph_v1/frontend/build/precache-manifest.60777872b27e059be0944c45b943c20e.js +++ /dev/null @@ -1,26 +0,0 @@ -self.__precacheManifest = (self.__precacheManifest || []).concat([ - { - "revision": "f31b3d97a06a7ff244a2b0b912c8b09b", - "url": "./index.html" - }, - { - "revision": "c3915d62b5f37ab06704", - "url": "./static/css/2.00129a64.chunk.css" - }, - { - "revision": "c3915d62b5f37ab06704", - "url": "./static/js/2.83943ae3.chunk.js" - }, - { - "revision": "fd842f24ec694c818badda9d975fa2e2", - "url": "./static/js/2.83943ae3.chunk.js.LICENSE.txt" - }, - { - "revision": "97394d162d66c20cac08", - "url": "./static/js/main.09c0b9bc.chunk.js" - }, - { - "revision": "79f28757b163e4b3af61", - "url": "./static/js/runtime-main.c62f2575.js" - } -]); \ No newline at end of file diff --git a/custom_graph_v1/frontend/build/precache-manifest.a6f63cd72f009410b683a163389710e1.js b/custom_graph_v1/frontend/build/precache-manifest.a6f63cd72f009410b683a163389710e1.js new file mode 100644 index 00000000..a5116827 --- /dev/null +++ b/custom_graph_v1/frontend/build/precache-manifest.a6f63cd72f009410b683a163389710e1.js @@ -0,0 +1,30 @@ +self.__precacheManifest = (self.__precacheManifest || []).concat([ + { + "revision": "e19d22b65777a9231d81518166d6cb19", + "url": "./index.html" + }, + { + "revision": "5a9d39d2da1799945ff8", + "url": "./static/css/2.00129a64.chunk.css" + }, + { + "revision": "5a9d39d2da1799945ff8", + "url": "./static/js/2.b8a17ab8.chunk.js" + }, + { + "revision": "3bf6e040acd9083f3c50aceae8695be3", + "url": "./static/js/2.b8a17ab8.chunk.js.LICENSE.txt" + }, + { + "revision": "25ab43908e1a86104183", + "url": "./static/js/main.6a0d078a.chunk.js" + }, + { + "revision": "4e0e34f265fae8f33b01b27ae29d9d6f", + "url": "./static/js/main.6a0d078a.chunk.js.LICENSE.txt" + }, + { + "revision": "79f28757b163e4b3af61", + "url": "./static/js/runtime-main.c62f2575.js" + } +]); \ No newline at end of file diff --git a/custom_graph_v1/frontend/build/service-worker.js b/custom_graph_v1/frontend/build/service-worker.js index bdfa2ba8..2e9f880e 100644 --- a/custom_graph_v1/frontend/build/service-worker.js +++ b/custom_graph_v1/frontend/build/service-worker.js @@ -14,7 +14,7 @@ importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js"); importScripts( - "./precache-manifest.60777872b27e059be0944c45b943c20e.js" + "./precache-manifest.a6f63cd72f009410b683a163389710e1.js" ); self.addEventListener('message', (event) => { @@ -35,5 +35,5 @@ workbox.precaching.precacheAndRoute(self.__precacheManifest, {}); workbox.routing.registerNavigationRoute(workbox.precaching.getCacheKeyForURL("./index.html"), { - blacklist: [/^\/_/,/\/[^\/?]+\.[^\/]+$/], + blacklist: [/^\/_/,/\/[^/?]+\.[^/]+$/], }); diff --git a/custom_graph_v1/frontend/build/static/js/2.83943ae3.chunk.js b/custom_graph_v1/frontend/build/static/js/2.83943ae3.chunk.js deleted file mode 100644 index 3e685d56..00000000 --- a/custom_graph_v1/frontend/build/static/js/2.83943ae3.chunk.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! For license information please see 2.83943ae3.chunk.js.LICENSE.txt */ -(this.webpackJsonpstreamlit_custom_graph=this.webpackJsonpstreamlit_custom_graph||[]).push([[2],[function(t,e,i){"use strict";(function(t){var n=i(4);const{toString:a}=Object.prototype,{getPrototypeOf:r}=Object,s=(o=Object.create(null),t=>{const e=a.call(t);return o[e]||(o[e]=e.slice(8,-1).toLowerCase())});var o;const l=t=>(t=t.toLowerCase(),e=>s(e)===t),h=t=>e=>typeof e===t,{isArray:c}=Array,u=h("undefined");const d=l("ArrayBuffer");const p=h("string"),f=h("function"),m=h("number"),g=t=>null!==t&&"object"===typeof t,y=t=>{if("object"!==s(t))return!1;const e=r(t);return(null===e||e===Object.prototype||null===Object.getPrototypeOf(e))&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},x=l("Date"),b=l("File"),v=l("Blob"),w=l("FileList"),_=l("URLSearchParams");function k(t,e){let i,n,{allOwnKeys:a=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null!==t&&"undefined"!==typeof t)if("object"!==typeof t&&(t=[t]),c(t))for(i=0,n=t.length;i0;)if(n=i[a],e===n.toLowerCase())return n;return null}const M="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:"undefined"!==typeof window?window:t,S=t=>!u(t)&&t!==M;const C=(P="undefined"!==typeof Uint8Array&&r(Uint8Array),t=>P&&t instanceof P);var P;const A=l("HTMLFormElement"),B=(t=>{let{hasOwnProperty:e}=t;return(t,i)=>e.call(t,i)})(Object.prototype),I=l("RegExp"),F=(t,e)=>{const i=Object.getOwnPropertyDescriptors(t),n={};k(i,(i,a)=>{let r;!1!==(r=e(i,a,t))&&(n[a]=r||i)}),Object.defineProperties(t,n)},D="abcdefghijklmnopqrstuvwxyz",L={DIGIT:"0123456789",ALPHA:D,ALPHA_DIGIT:D+D.toUpperCase()+"0123456789"};const E=l("AsyncFunction");e.a={isArray:c,isArrayBuffer:d,isBuffer:function(t){return null!==t&&!u(t)&&null!==t.constructor&&!u(t.constructor)&&f(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{let e;return t&&("function"===typeof FormData&&t instanceof FormData||f(t.append)&&("formdata"===(e=s(t))||"object"===e&&f(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&d(t.buffer),e},isString:p,isNumber:m,isBoolean:t=>!0===t||!1===t,isObject:g,isPlainObject:y,isUndefined:u,isDate:x,isFile:b,isBlob:v,isRegExp:I,isFunction:f,isStream:t=>g(t)&&f(t.pipe),isURLSearchParams:_,isTypedArray:C,isFileList:w,forEach:k,merge:function t(){const{caseless:e}=S(this)&&this||{},i={},n=(n,a)=>{const r=e&&T(i,a)||a;y(i[r])&&y(n)?i[r]=t(i[r],n):y(n)?i[r]=t({},n):c(n)?i[r]=n.slice():i[r]=n};for(let a=0,r=arguments.length;a3&&void 0!==arguments[3]?arguments[3]:{};return k(e,(e,a)=>{i&&f(e)?t[a]=Object(n.a)(e,i):t[a]=e},{allOwnKeys:a}),t},trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,i,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),i&&Object.assign(t.prototype,i)},toFlatObject:(t,e,i,n)=>{let a,s,o;const l={};if(e=e||{},null==t)return e;do{for(a=Object.getOwnPropertyNames(t),s=a.length;s-- >0;)o=a[s],n&&!n(o,t,e)||l[o]||(e[o]=t[o],l[o]=!0);t=!1!==i&&r(t)}while(t&&(!i||i(t,e))&&t!==Object.prototype);return e},kindOf:s,kindOfTest:l,endsWith:(t,e,i)=>{t=String(t),(void 0===i||i>t.length)&&(i=t.length),i-=e.length;const n=t.indexOf(e,i);return-1!==n&&n===i},toArray:t=>{if(!t)return null;if(c(t))return t;let e=t.length;if(!m(e))return null;const i=new Array(e);for(;e-- >0;)i[e]=t[e];return i},forEachEntry:(t,e)=>{const i=(t&&t[Symbol.iterator]).call(t);let n;for(;(n=i.next())&&!n.done;){const i=n.value;e.call(t,i[0],i[1])}},matchAll:(t,e)=>{let i;const n=[];for(;null!==(i=t.exec(e));)n.push(i);return n},isHTMLForm:A,hasOwnProperty:B,hasOwnProp:B,reduceDescriptors:F,freezeMethods:t=>{F(t,(e,i)=>{if(f(t)&&-1!==["arguments","caller","callee"].indexOf(i))return!1;const n=t[i];f(n)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")}))})},toObjectSet:(t,e)=>{const i={},n=t=>{t.forEach(t=>{i[t]=!0})};return c(t)?n(t):n(String(t).split(e)),i},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,i){return e.toUpperCase()+i})),noop:()=>{},toFiniteNumber:(t,e)=>(t=+t,Number.isFinite(t)?t:e),findKey:T,global:M,isContextDefined:S,ALPHABET:L,generateString:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L.ALPHA_DIGIT,i="";const{length:n}=e;for(;t--;)i+=e[Math.random()*n|0];return i},isSpecCompliantForm:function(t){return!!(t&&f(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),i=(t,n)=>{if(g(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[n]=t;const a=c(t)?[]:{};return k(t,(t,e)=>{const r=i(t,n+1);!u(r)&&(a[e]=r)}),e[n]=void 0,a}}return t};return i(t,0)},isAsyncFn:E,isThenable:t=>t&&(g(t)||f(t))&&f(t.then)&&f(t.catch)}}).call(this,i(11))},function(t,e,i){"use strict";var n=i(0);function a(t,e,i,n,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),i&&(this.config=i),n&&(this.request=n),a&&(this.response=a)}n.a.inherits(a,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n.a.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const r=a.prototype,s={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{s[t]={value:t}}),Object.defineProperties(a,s),Object.defineProperty(r,"isAxiosError",{value:!0}),a.from=(t,e,i,s,o,l)=>{const h=Object.create(r);return n.a.toFlatObject(t,h,(function(t){return t!==Error.prototype}),t=>"isAxiosError"!==t),a.call(h,t.message,e,i,s,o),h.cause=t,h.name=t.name,l&&Object.assign(h,l),h},e.a=a},function(t,e,i){"use strict";t.exports=i(15)},function(t,e,i){"use strict";(function(t){var n=i(0),a=i(1),r=i(5);function s(t){return n.a.isPlainObject(t)||n.a.isArray(t)}function o(t){return n.a.endsWith(t,"[]")?t.slice(0,-2):t}function l(t,e,i){return t?t.concat(e).map((function(t,e){return t=o(t),!i&&e?"["+t+"]":t})).join(i?".":""):e}const h=n.a.toFlatObject(n.a,{},null,(function(t){return/^is[A-Z]/.test(t)}));e.a=function(e,i,c){if(!n.a.isObject(e))throw new TypeError("target must be an object");i=i||new(r.a||FormData);const u=(c=n.a.toFlatObject(c,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!n.a.isUndefined(e[t])}))).metaTokens,d=c.visitor||y,p=c.dots,f=c.indexes,m=(c.Blob||"undefined"!==typeof Blob&&Blob)&&n.a.isSpecCompliantForm(i);if(!n.a.isFunction(d))throw new TypeError("visitor must be a function");function g(e){if(null===e)return"";if(n.a.isDate(e))return e.toISOString();if(!m&&n.a.isBlob(e))throw new a.a("Blob is not supported. Use a Buffer instead.");return n.a.isArrayBuffer(e)||n.a.isTypedArray(e)?m&&"function"===typeof Blob?new Blob([e]):t.from(e):e}function y(t,e,a){let r=t;if(t&&!a&&"object"===typeof t)if(n.a.endsWith(e,"{}"))e=u?e:e.slice(0,-2),t=JSON.stringify(t);else if(n.a.isArray(t)&&function(t){return n.a.isArray(t)&&!t.some(s)}(t)||(n.a.isFileList(t)||n.a.endsWith(e,"[]"))&&(r=n.a.toArray(t)))return e=o(e),r.forEach((function(t,a){!n.a.isUndefined(t)&&null!==t&&i.append(!0===f?l([e],a,p):null===f?e:e+"[]",g(t))})),!1;return!!s(t)||(i.append(l(a,e,p),g(t)),!1)}const x=[],b=Object.assign(h,{defaultVisitor:y,convertValue:g,isVisitable:s});if(!n.a.isObject(e))throw new TypeError("data must be an object");return function t(e,a){if(!n.a.isUndefined(e)){if(-1!==x.indexOf(e))throw Error("Circular reference detected in "+a.join("."));x.push(e),n.a.forEach(e,(function(e,r){!0===(!(n.a.isUndefined(e)||null===e)&&d.call(i,e,n.a.isString(r)?r.trim():r,a,b))&&t(e,a?a.concat(r):[r])})),x.pop()}}(e),i}}).call(this,i(26).Buffer)},function(t,e,i){"use strict";function n(t,e){return function(){return t.apply(e,arguments)}}i.d(e,"a",(function(){return n}))},function(t,e,i){"use strict";e.a=null},function(t,e,i){(function(t){t.exports=function(){"use strict";var e,i;function n(){return e.apply(null,arguments)}function a(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function r(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function s(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function o(t){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(t).length;var e;for(e in t)if(s(t,e))return!1;return!0}function l(t){return void 0===t}function h(t){return"number"===typeof t||"[object Number]"===Object.prototype.toString.call(t)}function c(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function u(t,e){var i,n=[],a=t.length;for(i=0;i>>0;for(e=0;e0)for(i=0;i=0?i?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+n}n.suppressDeprecationWarnings=!1,n.deprecationHandler=null,T=Object.keys?Object.keys:function(t){var e,i=[];for(e in t)s(t,e)&&i.push(e);return i};var I=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,F=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,D={},L={};function E(t,e,i,n){var a=n;"string"===typeof n&&(a=function(){return this[n]()}),t&&(L[t]=a),e&&(L[e[0]]=function(){return B(a.apply(this,arguments),e[1],e[2])}),i&&(L[i]=function(){return this.localeData().ordinal(a.apply(this,arguments),t)})}function O(t,e){return t.isValid()?(e=V(e,t.localeData()),D[e]=D[e]||function(t){var e,i,n,a=t.match(I);for(e=0,i=a.length;e=0&&F.test(t);)t=t.replace(F,n),F.lastIndex=0,i-=1;return t}var z={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function N(t){return"string"===typeof t?z[t]||z[t.toLowerCase()]:void 0}function W(t){var e,i,n={};for(i in t)s(t,i)&&(e=N(i))&&(n[e]=t[i]);return n}var Y,R={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1},U=/\d/,X=/\d\d/,j=/\d{3}/,H=/\d{4}/,q=/[+-]?\d{6}/,G=/\d\d?/,K=/\d\d\d\d?/,J=/\d\d\d\d\d\d?/,$=/\d{1,3}/,Q=/\d{1,4}/,Z=/[+-]?\d{1,6}/,tt=/\d+/,et=/[+-]?\d+/,it=/Z|[+-]\d\d:?\d\d/gi,nt=/Z|[+-]\d\d(?::?\d\d)?/gi,at=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,rt=/^[1-9]\d?/,st=/^([1-9]\d|\d)/;function ot(t,e,i){Y[t]=C(e)?e:function(t,n){return t&&i?i:e}}function lt(t,e){return s(Y,t)?Y[t](e._strict,e._locale):new RegExp(ht(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(t,e,i,n,a){return e||i||n||a}))))}function ht(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function ct(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function ut(t){var e=+t,i=0;return 0!==e&&isFinite(e)&&(i=ct(e)),i}Y={};var dt={};function pt(t,e){var i,n,a=e;for("string"===typeof t&&(t=[t]),h(e)&&(a=function(t,i){i[e]=ut(t)}),n=t.length,i=0;i68?1900:2e3)};var xt,bt=vt("FullYear",!0);function vt(t,e){return function(i){return null!=i?(_t(this,t,i),n.updateOffset(this,e),this):wt(this,t)}}function wt(t,e){if(!t.isValid())return NaN;var i=t._d,n=t._isUTC;switch(e){case"Milliseconds":return n?i.getUTCMilliseconds():i.getMilliseconds();case"Seconds":return n?i.getUTCSeconds():i.getSeconds();case"Minutes":return n?i.getUTCMinutes():i.getMinutes();case"Hours":return n?i.getUTCHours():i.getHours();case"Date":return n?i.getUTCDate():i.getDate();case"Day":return n?i.getUTCDay():i.getDay();case"Month":return n?i.getUTCMonth():i.getMonth();case"FullYear":return n?i.getUTCFullYear():i.getFullYear();default:return NaN}}function _t(t,e,i){var n,a,r,s,o;if(t.isValid()&&!isNaN(i)){switch(n=t._d,a=t._isUTC,e){case"Milliseconds":return void(a?n.setUTCMilliseconds(i):n.setMilliseconds(i));case"Seconds":return void(a?n.setUTCSeconds(i):n.setSeconds(i));case"Minutes":return void(a?n.setUTCMinutes(i):n.setMinutes(i));case"Hours":return void(a?n.setUTCHours(i):n.setHours(i));case"Date":return void(a?n.setUTCDate(i):n.setDate(i));case"FullYear":break;default:return}r=i,s=t.month(),o=29!==(o=t.date())||1!==s||gt(r)?o:28,a?n.setUTCFullYear(r,s,o):n.setFullYear(r,s,o)}}function kt(t,e){if(isNaN(t)||isNaN(e))return NaN;var i,n=(e%(i=12)+i)%i;return t+=(e-n)/12,1===n?gt(t)?29:28:31-n%7%2}xt=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e=0?(o=new Date(t+400,e,i,n,a,r,s),isFinite(o.getFullYear())&&o.setFullYear(t)):o=new Date(t,e,i,n,a,r,s),o}function Lt(t){var e,i;return t<100&&t>=0?((i=Array.prototype.slice.call(arguments))[0]=t+400,e=new Date(Date.UTC.apply(null,i)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function Et(t,e,i){var n=7+e-i;return-(7+Lt(t,0,n).getUTCDay()-e)%7+n-1}function Ot(t,e,i,n,a){var r,s,o=1+7*(e-1)+(7+i-n)%7+Et(t,n,a);return o<=0?s=yt(r=t-1)+o:o>yt(t)?(r=t+1,s=o-yt(t)):(r=t,s=o),{year:r,dayOfYear:s}}function Vt(t,e,i){var n,a,r=Et(t.year(),e,i),s=Math.floor((t.dayOfYear()-r-1)/7)+1;return s<1?n=s+zt(a=t.year()-1,e,i):s>zt(t.year(),e,i)?(n=s-zt(t.year(),e,i),a=t.year()+1):(a=t.year(),n=s),{week:n,year:a}}function zt(t,e,i){var n=Et(t,e,i),a=Et(t+1,e,i);return(yt(t)-n+a)/7}function Nt(t,e){return t.slice(e,7).concat(t.slice(0,e))}E("w",["ww",2],"wo","week"),E("W",["WW",2],"Wo","isoWeek"),ot("w",G,rt),ot("ww",G,X),ot("W",G,rt),ot("WW",G,X),ft(["w","ww","W","WW"],(function(t,e,i,n){e[n.substr(0,1)]=ut(t)})),E("d",0,"do","day"),E("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),E("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),E("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),E("e",0,0,"weekday"),E("E",0,0,"isoWeekday"),ot("d",G),ot("e",G),ot("E",G),ot("dd",(function(t,e){return e.weekdaysMinRegex(t)})),ot("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),ot("dddd",(function(t,e){return e.weekdaysRegex(t)})),ft(["dd","ddd","dddd"],(function(t,e,i,n){var a=i._locale.weekdaysParse(t,n,i._strict);null!=a?e.d=a:f(i).invalidWeekday=t})),ft(["d","e","E"],(function(t,e,i,n){e[n]=ut(t)}));var Wt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Yt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Rt="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ut=at,Xt=at,jt=at;function Ht(t,e,i){var n,a,r,s=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)r=p([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(r,"").toLocaleLowerCase();return i?"dddd"===e?-1!==(a=xt.call(this._weekdaysParse,s))?a:null:"ddd"===e?-1!==(a=xt.call(this._shortWeekdaysParse,s))?a:null:-1!==(a=xt.call(this._minWeekdaysParse,s))?a:null:"dddd"===e?-1!==(a=xt.call(this._weekdaysParse,s))||-1!==(a=xt.call(this._shortWeekdaysParse,s))||-1!==(a=xt.call(this._minWeekdaysParse,s))?a:null:"ddd"===e?-1!==(a=xt.call(this._shortWeekdaysParse,s))||-1!==(a=xt.call(this._weekdaysParse,s))||-1!==(a=xt.call(this._minWeekdaysParse,s))?a:null:-1!==(a=xt.call(this._minWeekdaysParse,s))||-1!==(a=xt.call(this._weekdaysParse,s))||-1!==(a=xt.call(this._shortWeekdaysParse,s))?a:null}function qt(){function t(t,e){return e.length-t.length}var e,i,n,a,r,s=[],o=[],l=[],h=[];for(e=0;e<7;e++)i=p([2e3,1]).day(e),n=ht(this.weekdaysMin(i,"")),a=ht(this.weekdaysShort(i,"")),r=ht(this.weekdays(i,"")),s.push(n),o.push(a),l.push(r),h.push(n),h.push(a),h.push(r);s.sort(t),o.sort(t),l.sort(t),h.sort(t),this._weekdaysRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Gt(){return this.hours()%12||12}function Kt(t,e){E(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function Jt(t,e){return e._meridiemParse}E("H",["HH",2],0,"hour"),E("h",["hh",2],0,Gt),E("k",["kk",2],0,(function(){return this.hours()||24})),E("hmm",0,0,(function(){return""+Gt.apply(this)+B(this.minutes(),2)})),E("hmmss",0,0,(function(){return""+Gt.apply(this)+B(this.minutes(),2)+B(this.seconds(),2)})),E("Hmm",0,0,(function(){return""+this.hours()+B(this.minutes(),2)})),E("Hmmss",0,0,(function(){return""+this.hours()+B(this.minutes(),2)+B(this.seconds(),2)})),Kt("a",!0),Kt("A",!1),ot("a",Jt),ot("A",Jt),ot("H",G,st),ot("h",G,rt),ot("k",G,rt),ot("HH",G,X),ot("hh",G,X),ot("kk",G,X),ot("hmm",K),ot("hmmss",J),ot("Hmm",K),ot("Hmmss",J),pt(["H","HH"],3),pt(["k","kk"],(function(t,e,i){var n=ut(t);e[3]=24===n?0:n})),pt(["a","A"],(function(t,e,i){i._isPm=i._locale.isPM(t),i._meridiem=t})),pt(["h","hh"],(function(t,e,i){e[3]=ut(t),f(i).bigHour=!0})),pt("hmm",(function(t,e,i){var n=t.length-2;e[3]=ut(t.substr(0,n)),e[4]=ut(t.substr(n)),f(i).bigHour=!0})),pt("hmmss",(function(t,e,i){var n=t.length-4,a=t.length-2;e[3]=ut(t.substr(0,n)),e[4]=ut(t.substr(n,2)),e[5]=ut(t.substr(a)),f(i).bigHour=!0})),pt("Hmm",(function(t,e,i){var n=t.length-2;e[3]=ut(t.substr(0,n)),e[4]=ut(t.substr(n))})),pt("Hmmss",(function(t,e,i){var n=t.length-4,a=t.length-2;e[3]=ut(t.substr(0,n)),e[4]=ut(t.substr(n,2)),e[5]=ut(t.substr(a))}));var $t,Qt=vt("Hours",!0),Zt={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Tt,monthsShort:Mt,week:{dow:0,doy:6},weekdays:Wt,weekdaysMin:Rt,weekdaysShort:Yt,meridiemParse:/[ap]\.?m?\.?/i},te={},ee={};function ie(t,e){var i,n=Math.min(t.length,e.length);for(i=0;i0;){if(n=ae(a.slice(0,e).join("-")))return n;if(i&&i.length>=e&&ie(a,i)>=e-1)break;e--}r++}return $t}(t)}function le(t){var e,i=t._a;return i&&-2===f(t).overflow&&(e=i[1]<0||i[1]>11?1:i[2]<1||i[2]>kt(i[0],i[1])?2:i[3]<0||i[3]>24||24===i[3]&&(0!==i[4]||0!==i[5]||0!==i[6])?3:i[4]<0||i[4]>59?4:i[5]<0||i[5]>59?5:i[6]<0||i[6]>999?6:-1,f(t)._overflowDayOfYear&&(e<0||e>2)&&(e=2),f(t)._overflowWeeks&&-1===e&&(e=7),f(t)._overflowWeekday&&-1===e&&(e=8),f(t).overflow=e),t}var he=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ce=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ue=/Z|[+-]\d\d(?::?\d\d)?/,de=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],pe=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],fe=/^\/?Date\((-?\d+)/i,me=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,ge={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function ye(t){var e,i,n,a,r,s,o=t._i,l=he.exec(o)||ce.exec(o),h=de.length,c=pe.length;if(l){for(f(t).iso=!0,e=0,i=h;e7)&&(l=!0)):(r=t._locale._week.dow,s=t._locale._week.doy,h=Vt(Me(),r,s),i=ve(e.gg,t._a[0],h.year),n=ve(e.w,h.week),null!=e.d?((a=e.d)<0||a>6)&&(l=!0):null!=e.e?(a=e.e+r,(e.e<0||e.e>6)&&(l=!0)):a=r),n<1||n>zt(i,r,s)?f(t)._overflowWeeks=!0:null!=l?f(t)._overflowWeekday=!0:(o=Ot(i,n,a,r,s),t._a[0]=o.year,t._dayOfYear=o.dayOfYear)}(t),null!=t._dayOfYear&&(s=ve(t._a[0],a[0]),(t._dayOfYear>yt(s)||0===t._dayOfYear)&&(f(t)._overflowDayOfYear=!0),i=Lt(s,0,t._dayOfYear),t._a[1]=i.getUTCMonth(),t._a[2]=i.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=o[e]=a[e];for(;e<7;e++)t._a[e]=o[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[3]&&0===t._a[4]&&0===t._a[5]&&0===t._a[6]&&(t._nextDay=!0,t._a[3]=0),t._d=(t._useUTC?Lt:Dt).apply(null,o),r=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[3]=24),t._w&&"undefined"!==typeof t._w.d&&t._w.d!==r&&(f(t).weekdayMismatch=!0)}}function _e(t){if(t._f!==n.ISO_8601)if(t._f!==n.RFC_2822){t._a=[],f(t).empty=!0;var e,i,a,r,s,o,l,h=""+t._i,c=h.length,u=0;for(l=(a=V(t._f,t._locale).match(I)||[]).length,e=0;e0&&f(t).unusedInput.push(s),h=h.slice(h.indexOf(i)+i.length),u+=i.length),L[r]?(i?f(t).empty=!1:f(t).unusedTokens.push(r),mt(r,i,t)):t._strict&&!i&&f(t).unusedTokens.push(r);f(t).charsLeftOver=c-u,h.length>0&&f(t).unusedInput.push(h),t._a[3]<=12&&!0===f(t).bigHour&&t._a[3]>0&&(f(t).bigHour=void 0),f(t).parsedDateParts=t._a.slice(0),f(t).meridiem=t._meridiem,t._a[3]=function(t,e,i){var n;return null==i?e:null!=t.meridiemHour?t.meridiemHour(e,i):null!=t.isPM?((n=t.isPM(i))&&e<12&&(e+=12),n||12!==e||(e=0),e):e}(t._locale,t._a[3],t._meridiem),null!==(o=f(t).era)&&(t._a[0]=t._locale.erasConvertYear(o,t._a[0])),we(t),le(t)}else be(t);else ye(t)}function ke(t){var e=t._i,i=t._f;return t._locale=t._locale||oe(t._l),null===e||void 0===i&&""===e?g({nullInput:!0}):("string"===typeof e&&(t._i=e=t._locale.preparse(e)),w(e)?new v(le(e)):(c(e)?t._d=e:a(i)?function(t){var e,i,n,a,r,s,o=!1,l=t._f.length;if(0===l)return f(t).invalidFormat=!0,void(t._d=new Date(NaN));for(a=0;athis?this:t:g()}));function Pe(t,e){var i,n;if(1===e.length&&a(e[0])&&(e=e[0]),!e.length)return Me();for(i=e[0],n=1;n=0?new Date(t+400,e,i)-126227808e5:new Date(t,e,i).valueOf()}function ni(t,e,i){return t<100&&t>=0?Date.UTC(t+400,e,i)-126227808e5:Date.UTC(t,e,i)}function ai(t,e){return e.erasAbbrRegex(t)}function ri(){var t,e,i,n,a,r=[],s=[],o=[],l=[],h=this.eras();for(t=0,e=h.length;t(r=zt(t,n,a))&&(e=r),li.call(this,t,e,i,n,a))}function li(t,e,i,n,a){var r=Ot(t,e,i,n,a),s=Lt(r.year,0,r.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}E("N",0,0,"eraAbbr"),E("NN",0,0,"eraAbbr"),E("NNN",0,0,"eraAbbr"),E("NNNN",0,0,"eraName"),E("NNNNN",0,0,"eraNarrow"),E("y",["y",1],"yo","eraYear"),E("y",["yy",2],0,"eraYear"),E("y",["yyy",3],0,"eraYear"),E("y",["yyyy",4],0,"eraYear"),ot("N",ai),ot("NN",ai),ot("NNN",ai),ot("NNNN",(function(t,e){return e.erasNameRegex(t)})),ot("NNNNN",(function(t,e){return e.erasNarrowRegex(t)})),pt(["N","NN","NNN","NNNN","NNNNN"],(function(t,e,i,n){var a=i._locale.erasParse(t,n,i._strict);a?f(i).era=a:f(i).invalidEra=t})),ot("y",tt),ot("yy",tt),ot("yyy",tt),ot("yyyy",tt),ot("yo",(function(t,e){return e._eraYearOrdinalRegex||tt})),pt(["y","yy","yyy","yyyy"],0),pt(["yo"],(function(t,e,i,n){var a;i._locale._eraYearOrdinalRegex&&(a=t.match(i._locale._eraYearOrdinalRegex)),i._locale.eraYearOrdinalParse?e[0]=i._locale.eraYearOrdinalParse(t,a):e[0]=parseInt(t,10)})),E(0,["gg",2],0,(function(){return this.weekYear()%100})),E(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),si("gggg","weekYear"),si("ggggg","weekYear"),si("GGGG","isoWeekYear"),si("GGGGG","isoWeekYear"),ot("G",et),ot("g",et),ot("GG",G,X),ot("gg",G,X),ot("GGGG",Q,H),ot("gggg",Q,H),ot("GGGGG",Z,q),ot("ggggg",Z,q),ft(["gggg","ggggg","GGGG","GGGGG"],(function(t,e,i,n){e[n.substr(0,2)]=ut(t)})),ft(["gg","GG"],(function(t,e,i,a){e[a]=n.parseTwoDigitYear(t)})),E("Q",0,"Qo","quarter"),ot("Q",U),pt("Q",(function(t,e){e[1]=3*(ut(t)-1)})),E("D",["DD",2],"Do","date"),ot("D",G,rt),ot("DD",G,X),ot("Do",(function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient})),pt(["D","DD"],2),pt("Do",(function(t,e){e[2]=ut(t.match(G)[0])}));var hi=vt("Date",!0);E("DDD",["DDDD",3],"DDDo","dayOfYear"),ot("DDD",$),ot("DDDD",j),pt(["DDD","DDDD"],(function(t,e,i){i._dayOfYear=ut(t)})),E("m",["mm",2],0,"minute"),ot("m",G,st),ot("mm",G,X),pt(["m","mm"],4);var ci=vt("Minutes",!1);E("s",["ss",2],0,"second"),ot("s",G,st),ot("ss",G,X),pt(["s","ss"],5);var ui,di,pi=vt("Seconds",!1);for(E("S",0,0,(function(){return~~(this.millisecond()/100)})),E(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),E(0,["SSS",3],0,"millisecond"),E(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),E(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),E(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),E(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),E(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),E(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),ot("S",$,U),ot("SS",$,X),ot("SSS",$,j),ui="SSSS";ui.length<=9;ui+="S")ot(ui,tt);function fi(t,e){e[6]=ut(1e3*("0."+t))}for(ui="S";ui.length<=9;ui+="S")pt(ui,fi);di=vt("Milliseconds",!1),E("z",0,0,"zoneAbbr"),E("zz",0,0,"zoneName");var mi=v.prototype;function gi(t){return t}mi.add=He,mi.calendar=function(t,e){1===arguments.length&&(arguments[0]?Ke(arguments[0])?(t=arguments[0],e=void 0):Je(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var i=t||Me(),a=Oe(i,this).startOf("day"),r=n.calendarFormat(this,a)||"sameElse",s=e&&(C(e[r])?e[r].call(this,i):e[r]);return this.format(s||this.localeData().calendar(r,this,Me(i)))},mi.clone=function(){return new v(this)},mi.diff=function(t,e,i){var n,a,r;if(!this.isValid())return NaN;if(!(n=Oe(t,this)).isValid())return NaN;switch(a=6e4*(n.utcOffset()-this.utcOffset()),e=N(e)){case"year":r=$e(this,n)/12;break;case"month":r=$e(this,n);break;case"quarter":r=$e(this,n)/3;break;case"second":r=(this-n)/1e3;break;case"minute":r=(this-n)/6e4;break;case"hour":r=(this-n)/36e5;break;case"day":r=(this-n-a)/864e5;break;case"week":r=(this-n-a)/6048e5;break;default:r=this-n}return i?r:ct(r)},mi.endOf=function(t){var e,i;if(void 0===(t=N(t))||"millisecond"===t||!this.isValid())return this;switch(i=this._isUTC?ni:ii,t){case"year":e=i(this.year()+1,0,1)-1;break;case"quarter":e=i(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=i(this.year(),this.month()+1,1)-1;break;case"week":e=i(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=i(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=36e5-ei(e+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":e=this._d.valueOf(),e+=6e4-ei(e,6e4)-1;break;case"second":e=this._d.valueOf(),e+=1e3-ei(e,1e3)-1}return this._d.setTime(e),n.updateOffset(this,!0),this},mi.format=function(t){t||(t=this.isUtc()?n.defaultFormatUtc:n.defaultFormat);var e=O(this,t);return this.localeData().postformat(e)},mi.from=function(t,e){return this.isValid()&&(w(t)&&t.isValid()||Me(t).isValid())?Ye({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},mi.fromNow=function(t){return this.from(Me(),t)},mi.to=function(t,e){return this.isValid()&&(w(t)&&t.isValid()||Me(t).isValid())?Ye({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},mi.toNow=function(t){return this.to(Me(),t)},mi.get=function(t){return C(this[t=N(t)])?this[t]():this},mi.invalidAt=function(){return f(this).overflow},mi.isAfter=function(t,e){var i=w(t)?t:Me(t);return!(!this.isValid()||!i.isValid())&&("millisecond"===(e=N(e)||"millisecond")?this.valueOf()>i.valueOf():i.valueOf()9999?O(i,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):C(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",O(i,"Z")):O(i,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},mi.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t,e,i,n="moment",a="";return this.isLocal()||(n=0===this.utcOffset()?"moment.utc":"moment.parseZone",a="Z"),t="["+n+'("]',e=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i=a+'[")]',this.format(t+e+"-MM-DD[T]HH:mm:ss.SSS"+i)},"undefined"!==typeof Symbol&&null!=Symbol.for&&(mi[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),mi.toJSON=function(){return this.isValid()?this.toISOString():null},mi.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},mi.unix=function(){return Math.floor(this.valueOf()/1e3)},mi.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},mi.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},mi.eraName=function(){var t,e,i,n=this.localeData().eras();for(t=0,e=n.length;tthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},mi.isLocal=function(){return!!this.isValid()&&!this._isUTC},mi.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},mi.isUtc=ze,mi.isUTC=ze,mi.zoneAbbr=function(){return this._isUTC?"UTC":""},mi.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},mi.dates=k("dates accessor is deprecated. Use date instead.",hi),mi.months=k("months accessor is deprecated. Use month instead",It),mi.years=k("years accessor is deprecated. Use year instead",bt),mi.zone=k("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(t,e){return null!=t?("string"!==typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()})),mi.isDSTShifted=k("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!l(this._isDSTShifted))return this._isDSTShifted;var t,e={};return b(e,this),(e=ke(e))._a?(t=e._isUTC?p(e._a):Me(e._a),this._isDSTShifted=this.isValid()&&function(t,e,i){var n,a=Math.min(t.length,e.length),r=Math.abs(t.length-e.length),s=0;for(n=0;n0):this._isDSTShifted=!1,this._isDSTShifted}));var yi=A.prototype;function xi(t,e,i,n){var a=oe(),r=p().set(n,e);return a[i](r,t)}function bi(t,e,i){if(h(t)&&(e=t,t=void 0),t=t||"",null!=e)return xi(t,e,i,"month");var n,a=[];for(n=0;n<12;n++)a[n]=xi(t,n,i,"month");return a}function vi(t,e,i,n){"boolean"===typeof t?(h(e)&&(i=e,e=void 0),e=e||""):(i=e=t,t=!1,h(e)&&(i=e,e=void 0),e=e||"");var a,r=oe(),s=t?r._week.dow:0,o=[];if(null!=i)return xi(e,(i+s)%7,n,"day");for(a=0;a<7;a++)o[a]=xi(e,(a+s)%7,n,"day");return o}yi.calendar=function(t,e,i){var n=this._calendar[t]||this._calendar.sameElse;return C(n)?n.call(e,i):n},yi.longDateFormat=function(t){var e=this._longDateFormat[t],i=this._longDateFormat[t.toUpperCase()];return e||!i?e:(this._longDateFormat[t]=i.match(I).map((function(t){return"MMMM"===t||"MM"===t||"DD"===t||"dddd"===t?t.slice(1):t})).join(""),this._longDateFormat[t])},yi.invalidDate=function(){return this._invalidDate},yi.ordinal=function(t){return this._ordinal.replace("%d",t)},yi.preparse=gi,yi.postformat=gi,yi.relativeTime=function(t,e,i,n){var a=this._relativeTime[i];return C(a)?a(t,e,i,n):a.replace(/%d/i,t)},yi.pastFuture=function(t,e){var i=this._relativeTime[t>0?"future":"past"];return C(i)?i(e):i.replace(/%s/i,e)},yi.set=function(t){var e,i;for(i in t)s(t,i)&&(C(e=t[i])?this[i]=e:this["_"+i]=e);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},yi.eras=function(t,e){var i,a,r,s=this._eras||oe("en")._eras;for(i=0,a=s.length;i=0)return l[n]},yi.erasConvertYear=function(t,e){var i=t.since<=t.until?1:-1;return void 0===e?n(t.since).year():n(t.since).year()+(e-t.offset)*i},yi.erasAbbrRegex=function(t){return s(this,"_erasAbbrRegex")||ri.call(this),t?this._erasAbbrRegex:this._erasRegex},yi.erasNameRegex=function(t){return s(this,"_erasNameRegex")||ri.call(this),t?this._erasNameRegex:this._erasRegex},yi.erasNarrowRegex=function(t){return s(this,"_erasNarrowRegex")||ri.call(this),t?this._erasNarrowRegex:this._erasRegex},yi.months=function(t,e){return t?a(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||St).test(e)?"format":"standalone"][t.month()]:a(this._months)?this._months:this._months.standalone},yi.monthsShort=function(t,e){return t?a(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[St.test(e)?"format":"standalone"][t.month()]:a(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},yi.monthsParse=function(t,e,i){var n,a,r;if(this._monthsParseExact)return At.call(this,t,e,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(a=p([2e3,n]),i&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),i||this._monthsParse[n]||(r="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[n]=new RegExp(r.replace(".",""),"i")),i&&"MMMM"===e&&this._longMonthsParse[n].test(t))return n;if(i&&"MMM"===e&&this._shortMonthsParse[n].test(t))return n;if(!i&&this._monthsParse[n].test(t))return n}},yi.monthsRegex=function(t){return this._monthsParseExact?(s(this,"_monthsRegex")||Ft.call(this),t?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=Pt),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)},yi.monthsShortRegex=function(t){return this._monthsParseExact?(s(this,"_monthsRegex")||Ft.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=Ct),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)},yi.week=function(t){return Vt(t,this._week.dow,this._week.doy).week},yi.firstDayOfYear=function(){return this._week.doy},yi.firstDayOfWeek=function(){return this._week.dow},yi.weekdays=function(t,e){var i=a(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?Nt(i,this._week.dow):t?i[t.day()]:i},yi.weekdaysMin=function(t){return!0===t?Nt(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin},yi.weekdaysShort=function(t){return!0===t?Nt(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort},yi.weekdaysParse=function(t,e,i){var n,a,r;if(this._weekdaysParseExact)return Ht.call(this,t,e,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(a=p([2e3,1]).day(n),i&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(r="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[n]=new RegExp(r.replace(".",""),"i")),i&&"dddd"===e&&this._fullWeekdaysParse[n].test(t))return n;if(i&&"ddd"===e&&this._shortWeekdaysParse[n].test(t))return n;if(i&&"dd"===e&&this._minWeekdaysParse[n].test(t))return n;if(!i&&this._weekdaysParse[n].test(t))return n}},yi.weekdaysRegex=function(t){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||qt.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=Ut),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)},yi.weekdaysShortRegex=function(t){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||qt.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Xt),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},yi.weekdaysMinRegex=function(t){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||qt.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=jt),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},yi.isPM=function(t){return"p"===(t+"").toLowerCase().charAt(0)},yi.meridiem=function(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"},re("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===ut(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),n.lang=k("moment.lang is deprecated. Use moment.locale instead.",re),n.langData=k("moment.langData is deprecated. Use moment.localeData instead.",oe);var wi=Math.abs;function _i(t,e,i,n){var a=Ye(e,i);return t._milliseconds+=n*a._milliseconds,t._days+=n*a._days,t._months+=n*a._months,t._bubble()}function ki(t){return t<0?Math.floor(t):Math.ceil(t)}function Ti(t){return 4800*t/146097}function Mi(t){return 146097*t/4800}function Si(t){return function(){return this.as(t)}}var Ci=Si("ms"),Pi=Si("s"),Ai=Si("m"),Bi=Si("h"),Ii=Si("d"),Fi=Si("w"),Di=Si("M"),Li=Si("Q"),Ei=Si("y"),Oi=Ci;function Vi(t){return function(){return this.isValid()?this._data[t]:NaN}}var zi=Vi("milliseconds"),Ni=Vi("seconds"),Wi=Vi("minutes"),Yi=Vi("hours"),Ri=Vi("days"),Ui=Vi("months"),Xi=Vi("years"),ji=Math.round,Hi={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function qi(t,e,i,n,a){return a.relativeTime(e||1,!!i,t,n)}var Gi=Math.abs;function Ki(t){return(t>0)-(t<0)||+t}function Ji(){if(!this.isValid())return this.localeData().invalidDate();var t,e,i,n,a,r,s,o,l=Gi(this._milliseconds)/1e3,h=Gi(this._days),c=Gi(this._months),u=this.asSeconds();return u?(t=ct(l/60),e=ct(t/60),l%=60,t%=60,i=ct(c/12),c%=12,n=l?l.toFixed(3).replace(/\.?0+$/,""):"",a=u<0?"-":"",r=Ki(this._months)!==Ki(u)?"-":"",s=Ki(this._days)!==Ki(u)?"-":"",o=Ki(this._milliseconds)!==Ki(u)?"-":"",a+"P"+(i?r+i+"Y":"")+(c?r+c+"M":"")+(h?s+h+"D":"")+(e||t||l?"T":"")+(e?o+e+"H":"")+(t?o+t+"M":"")+(l?o+n+"S":"")):"P0D"}var $i=Be.prototype;return $i.isValid=function(){return this._isValid},$i.abs=function(){var t=this._data;return this._milliseconds=wi(this._milliseconds),this._days=wi(this._days),this._months=wi(this._months),t.milliseconds=wi(t.milliseconds),t.seconds=wi(t.seconds),t.minutes=wi(t.minutes),t.hours=wi(t.hours),t.months=wi(t.months),t.years=wi(t.years),this},$i.add=function(t,e){return _i(this,t,e,1)},$i.subtract=function(t,e){return _i(this,t,e,-1)},$i.as=function(t){if(!this.isValid())return NaN;var e,i,n=this._milliseconds;if("month"===(t=N(t))||"quarter"===t||"year"===t)switch(e=this._days+n/864e5,i=this._months+Ti(e),t){case"month":return i;case"quarter":return i/3;case"year":return i/12}else switch(e=this._days+Math.round(Mi(this._months)),t){case"week":return e/7+n/6048e5;case"day":return e+n/864e5;case"hour":return 24*e+n/36e5;case"minute":return 1440*e+n/6e4;case"second":return 86400*e+n/1e3;case"millisecond":return Math.floor(864e5*e)+n;default:throw new Error("Unknown unit "+t)}},$i.asMilliseconds=Ci,$i.asSeconds=Pi,$i.asMinutes=Ai,$i.asHours=Bi,$i.asDays=Ii,$i.asWeeks=Fi,$i.asMonths=Di,$i.asQuarters=Li,$i.asYears=Ei,$i.valueOf=Oi,$i._bubble=function(){var t,e,i,n,a,r=this._milliseconds,s=this._days,o=this._months,l=this._data;return r>=0&&s>=0&&o>=0||r<=0&&s<=0&&o<=0||(r+=864e5*ki(Mi(o)+s),s=0,o=0),l.milliseconds=r%1e3,t=ct(r/1e3),l.seconds=t%60,e=ct(t/60),l.minutes=e%60,i=ct(e/60),l.hours=i%24,s+=ct(i/24),a=ct(Ti(s)),o+=a,s-=ki(Mi(a)),n=ct(o/12),o%=12,l.days=s,l.months=o,l.years=n,this},$i.clone=function(){return Ye(this)},$i.get=function(t){return t=N(t),this.isValid()?this[t+"s"]():NaN},$i.milliseconds=zi,$i.seconds=Ni,$i.minutes=Wi,$i.hours=Yi,$i.days=Ri,$i.weeks=function(){return ct(this.days()/7)},$i.months=Ui,$i.years=Xi,$i.humanize=function(t,e){if(!this.isValid())return this.localeData().invalidDate();var i,n,a=!1,r=Hi;return"object"===typeof t&&(e=t,t=!1),"boolean"===typeof t&&(a=t),"object"===typeof e&&(r=Object.assign({},Hi,e),null!=e.s&&null==e.ss&&(r.ss=e.s-1)),i=this.localeData(),n=function(t,e,i,n){var a=Ye(t).abs(),r=ji(a.as("s")),s=ji(a.as("m")),o=ji(a.as("h")),l=ji(a.as("d")),h=ji(a.as("M")),c=ji(a.as("w")),u=ji(a.as("y")),d=r<=i.ss&&["s",r]||r0,d[4]=n,qi.apply(null,d)}(this,!a,r,i),a&&(n=i.pastFuture(+this,n)),i.postformat(n)},$i.toISOString=Ji,$i.toString=Ji,$i.toJSON=Ji,$i.locale=Qe,$i.localeData=ti,$i.toIsoString=k("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ji),$i.lang=Ze,E("X",0,0,"unix"),E("x",0,0,"valueOf"),ot("x",et),ot("X",/[+-]?\d+(\.\d{1,3})?/),pt("X",(function(t,e,i){i._d=new Date(1e3*parseFloat(t))})),pt("x",(function(t,e,i){i._d=new Date(ut(t))})),n.version="2.30.1",e=Me,n.fn=mi,n.min=function(){var t=[].slice.call(arguments,0);return Pe("isBefore",t)},n.max=function(){var t=[].slice.call(arguments,0);return Pe("isAfter",t)},n.now=function(){return Date.now?Date.now():+new Date},n.utc=p,n.unix=function(t){return Me(1e3*t)},n.months=function(t,e){return bi(t,e,"months")},n.isDate=c,n.locale=re,n.invalid=g,n.duration=Ye,n.isMoment=w,n.weekdays=function(t,e,i){return vi(t,e,i,"weekdays")},n.parseZone=function(){return Me.apply(null,arguments).parseZone()},n.localeData=oe,n.isDuration=Ie,n.monthsShort=function(t,e){return bi(t,e,"monthsShort")},n.weekdaysMin=function(t,e,i){return vi(t,e,i,"weekdaysMin")},n.defineLocale=se,n.updateLocale=function(t,e){if(null!=e){var i,n,a=Zt;null!=te[t]&&null!=te[t].parentLocale?te[t].set(P(te[t]._config,e)):(null!=(n=ae(t))&&(a=n._config),e=P(a,e),null==n&&(e.abbr=t),(i=new A(e)).parentLocale=te[t],te[t]=i),re(t)}else null!=te[t]&&(null!=te[t].parentLocale?(te[t]=te[t].parentLocale,t===re()&&re(t)):null!=te[t]&&delete te[t]);return te[t]},n.locales=function(){return T(te)},n.weekdaysShort=function(t,e,i){return vi(t,e,i,"weekdaysShort")},n.normalizeUnits=N,n.relativeTimeRounding=function(t){return void 0===t?ji:"function"===typeof t&&(ji=t,!0)},n.relativeTimeThreshold=function(t,e){return void 0!==Hi[t]&&(void 0===e?Hi[t]:(Hi[t]=e,"s"===t&&(Hi.ss=e-1),!0))},n.calendarFormat=function(t,e){var i=t.diff(e,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"},n.prototype=mi,n.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},n}()}).call(this,i(20)(t))},function(t,e,i){var n,a;i(22),n=[i(21)],void 0===(a=function(t){return function(){var e,i,n,a=0,r="error",s="info",o="success",l="warning",h={clear:function(i,n){var a=f();e||c(a),u(i,a,n)||function(i){for(var n=e.children(),a=n.length-1;a>=0;a--)u(t(n[a]),i)}(a)},remove:function(i){var n=f();e||c(n),i&&0===t(":focus",i).length?m(i):e.children().length&&e.remove()},error:function(t,e,i){return p({type:r,iconClass:f().iconClasses.error,message:t,optionsOverride:i,title:e})},getContainer:c,info:function(t,e,i){return p({type:s,iconClass:f().iconClasses.info,message:t,optionsOverride:i,title:e})},options:{},subscribe:function(t){i=t},success:function(t,e,i){return p({type:o,iconClass:f().iconClasses.success,message:t,optionsOverride:i,title:e})},version:"2.1.4",warning:function(t,e,i){return p({type:l,iconClass:f().iconClasses.warning,message:t,optionsOverride:i,title:e})}};return h;function c(i,n){return i||(i=f()),(e=t("#"+i.containerId)).length||n&&(e=function(i){return(e=t("
").attr("id",i.containerId).addClass(i.positionClass)).appendTo(t(i.target)),e}(i)),e}function u(e,i,n){var a=!(!n||!n.force)&&n.force;return!(!e||!a&&0!==t(":focus",e).length)&&(e[i.hideMethod]({duration:i.hideDuration,easing:i.hideEasing,complete:function(){m(e)}}),!0)}function d(t){i&&i(t)}function p(i){var r=f(),s=i.iconClass||r.iconClass;if("undefined"!==typeof i.optionsOverride&&(r=t.extend(r,i.optionsOverride),s=i.optionsOverride.iconClass||s),!function(t,e){if(t.preventDuplicates){if(e.message===n)return!0;n=e.message}return!1}(r,i)){a++,e=c(r,!0);var o=null,l=t("
"),h=t("
"),u=t("
"),p=t("
"),g=t(r.closeHtml),y={intervalId:null,hideEta:null,maxHideTime:null},x={toastId:a,state:"visible",startTime:new Date,options:r,map:i};return i.iconClass&&l.addClass(r.toastClass).addClass(s),function(){if(i.title){var t=i.title;r.escapeHtml&&(t=b(i.title)),h.append(t).addClass(r.titleClass),l.append(h)}}(),function(){if(i.message){var t=i.message;r.escapeHtml&&(t=b(i.message)),u.append(t).addClass(r.messageClass),l.append(u)}}(),r.closeButton&&(g.addClass(r.closeClass).attr("role","button"),l.prepend(g)),r.progressBar&&(p.addClass(r.progressClass),l.prepend(p)),r.rtl&&l.addClass("rtl"),r.newestOnTop?e.prepend(l):e.append(l),function(){var t="";switch(i.iconClass){case"toast-success":case"toast-info":t="polite";break;default:t="assertive"}l.attr("aria-live",t)}(),l.hide(),l[r.showMethod]({duration:r.showDuration,easing:r.showEasing,complete:r.onShown}),r.timeOut>0&&(o=setTimeout(v,r.timeOut),y.maxHideTime=parseFloat(r.timeOut),y.hideEta=(new Date).getTime()+y.maxHideTime,r.progressBar&&(y.intervalId=setInterval(k,10))),r.closeOnHover&&l.hover(_,w),!r.onclick&&r.tapToDismiss&&l.click(v),r.closeButton&&g&&g.click((function(t){t.stopPropagation?t.stopPropagation():void 0!==t.cancelBubble&&!0!==t.cancelBubble&&(t.cancelBubble=!0),r.onCloseClick&&r.onCloseClick(t),v(!0)})),r.onclick&&l.click((function(t){r.onclick(t),v()})),d(x),r.debug&&console&&console.log(x),l}function b(t){return null==t&&(t=""),t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function v(e){var i=e&&!1!==r.closeMethod?r.closeMethod:r.hideMethod,n=e&&!1!==r.closeDuration?r.closeDuration:r.hideDuration,a=e&&!1!==r.closeEasing?r.closeEasing:r.hideEasing;if(!t(":focus",l).length||e)return clearTimeout(y.intervalId),l[i]({duration:n,easing:a,complete:function(){m(l),clearTimeout(o),r.onHidden&&"hidden"!==x.state&&r.onHidden(),x.state="hidden",x.endTime=new Date,d(x)}})}function w(){(r.timeOut>0||r.extendedTimeOut>0)&&(o=setTimeout(v,r.extendedTimeOut),y.maxHideTime=parseFloat(r.extendedTimeOut),y.hideEta=(new Date).getTime()+y.maxHideTime)}function _(){clearTimeout(o),y.hideEta=0,l.stop(!0,!0)[r.showMethod]({duration:r.showDuration,easing:r.showEasing})}function k(){var t=(y.hideEta-(new Date).getTime())/y.maxHideTime*100;p.width(t+"%")}}function f(){return t.extend({},{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,closeMethod:!1,closeDuration:!1,closeEasing:!1,closeOnHover:!0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",escapeHtml:!1,target:"body",closeHtml:'',closeClass:"toast-close-button",newestOnTop:!0,preventDuplicates:!1,progressBar:!1,progressClass:"toast-progress",rtl:!1},h.options)}function m(t){e||(e=c()),t.is(":visible")||(t.remove(),t=null,0===e.children().length&&(e.remove(),n=void 0))}}()}.apply(e,n))||(t.exports=a)},function(t,e,i){"use strict";var n=i(2),a=i(19);a=a.Chart?a:window.CanvasJS;class r extends n.Component{constructor(t){super(t),this.options=t.options?t.options:{},this.containerProps=t.containerProps?{...t.containerProps}:{width:"100%",position:"relative"},this.containerProps.height=t.containerProps&&t.containerProps.height?t.containerProps.height:this.options.height?this.options.height+"px":"400px",this.containerRef=n.createRef()}componentDidMount(){this.chart=new a.Chart(this.containerRef.current,this.options),this.chart.render(),this.props.onRef&&this.props.onRef(this.chart)}shouldComponentUpdate(t,e){return!(t.options===this.options)}componentDidUpdate(){this.chart.options=this.props.options,this.chart.render()}componentWillUnmount(){this.chart&&this.chart.destroy(),this.props.onRef&&this.props.onRef(void 0)}render(){return n.createElement("div",{id:this.props.id,ref:this.containerRef,style:this.containerProps})}}var s={CanvasJSChart:r,CanvasJS:a};e.a=s},function(t,e,i){"use strict";i.d(e,"b",(function(){return hh})),i.d(e,"a",(function(){return sh}));var n={};i.r(n),i.d(n,"memcpy",(function(){return pt})),i.d(n,"joinUint8Arrays",(function(){return ft})),i.d(n,"toArrayBufferView",(function(){return mt})),i.d(n,"toInt8Array",(function(){return gt})),i.d(n,"toInt16Array",(function(){return yt})),i.d(n,"toInt32Array",(function(){return xt})),i.d(n,"toBigInt64Array",(function(){return bt})),i.d(n,"toUint8Array",(function(){return vt})),i.d(n,"toUint16Array",(function(){return wt})),i.d(n,"toUint32Array",(function(){return _t})),i.d(n,"toBigUint64Array",(function(){return kt})),i.d(n,"toFloat32Array",(function(){return Tt})),i.d(n,"toFloat64Array",(function(){return Mt})),i.d(n,"toUint8ClampedArray",(function(){return St})),i.d(n,"toArrayBufferViewIterator",(function(){return Pt})),i.d(n,"toInt8ArrayIterator",(function(){return At})),i.d(n,"toInt16ArrayIterator",(function(){return Bt})),i.d(n,"toInt32ArrayIterator",(function(){return It})),i.d(n,"toUint8ArrayIterator",(function(){return Ft})),i.d(n,"toUint16ArrayIterator",(function(){return Dt})),i.d(n,"toUint32ArrayIterator",(function(){return Lt})),i.d(n,"toFloat32ArrayIterator",(function(){return Et})),i.d(n,"toFloat64ArrayIterator",(function(){return Ot})),i.d(n,"toUint8ClampedArrayIterator",(function(){return Vt})),i.d(n,"toArrayBufferViewAsyncIterator",(function(){return zt})),i.d(n,"toInt8ArrayAsyncIterator",(function(){return Nt})),i.d(n,"toInt16ArrayAsyncIterator",(function(){return Wt})),i.d(n,"toInt32ArrayAsyncIterator",(function(){return Yt})),i.d(n,"toUint8ArrayAsyncIterator",(function(){return Rt})),i.d(n,"toUint16ArrayAsyncIterator",(function(){return Ut})),i.d(n,"toUint32ArrayAsyncIterator",(function(){return Xt})),i.d(n,"toFloat32ArrayAsyncIterator",(function(){return jt})),i.d(n,"toFloat64ArrayAsyncIterator",(function(){return Ht})),i.d(n,"toUint8ClampedArrayAsyncIterator",(function(){return qt})),i.d(n,"rebaseValueOffsets",(function(){return Gt})),i.d(n,"compareArrayLike",(function(){return Kt}));var a={};i.r(a),i.d(a,"getBool",(function(){return me})),i.d(a,"getBit",(function(){return ge})),i.d(a,"setBool",(function(){return ye})),i.d(a,"truncateBitmap",(function(){return xe})),i.d(a,"packBools",(function(){return be})),i.d(a,"iterateBits",(function(){return ve})),i.d(a,"popcnt_bit_range",(function(){return we})),i.d(a,"popcnt_array",(function(){return _e})),i.d(a,"popcnt_uint32",(function(){return ke}));var r={};i.r(r),i.d(r,"uint16ToFloat64",(function(){return Yi})),i.d(r,"float64ToUint16",(function(){return Ri}));var s={};i.r(s),i.d(s,"isArrowBigNumSymbol",(function(){return qi})),i.d(s,"bignumToString",(function(){return Zi})),i.d(s,"bignumToBigInt",(function(){return tn})),i.d(s,"BN",(function(){return nn}));var o={};i.r(o),i.d(o,"clampIndex",(function(){return Yn})),i.d(o,"clampRange",(function(){return Un})),i.d(o,"createElementComparator",(function(){return Hn}));var l={};i.r(l),i.d(l,"BaseInt64",(function(){return rr})),i.d(l,"Uint64",(function(){return sr})),i.d(l,"Int64",(function(){return or})),i.d(l,"Int128",(function(){return lr}));var h=i(13),c=i.n(h),u=i(2),d=i.n(u);const p=new WeakMap,f=new WeakMap;function m(t){const e=p.get(t);return console.assert(null!=e,"'this' is expected an Event object, but got",t),e}function g(t){null==t.passiveListener?t.event.cancelable&&(t.canceled=!0,"function"===typeof t.event.preventDefault&&t.event.preventDefault()):"undefined"!==typeof console&&"function"===typeof console.error&&console.error("Unable to preventDefault inside passive event listener invocation.",t.passiveListener)}function y(t,e){p.set(this,{eventTarget:t,event:e,eventPhase:2,currentTarget:t,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:e.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});const i=Object.keys(e);for(let n=0;n0){const t=new Array(arguments.length);for(let e=0;e>>0)+4294967296*this.high},A.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high},A.Long.ZERO=new A.Long(0,0),A.Builder=function(t){if(t)e=t;else var e=1024;this.bb=A.ByteBuffer.allocate(e),this.space=e,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},A.Builder.prototype.clear=function(){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},A.Builder.prototype.forceDefaults=function(t){this.force_defaults=t},A.Builder.prototype.dataBuffer=function(){return this.bb},A.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},A.Builder.prototype.prep=function(t,e){t>this.minalign&&(this.minalign=t);for(var i=1+~(this.bb.capacity()-this.space+e)&t-1;this.space=0&&0==this.vtable[e];e--);for(var i=e+1;e>=0;e--)this.addInt16(0!=this.vtable[e]?t-this.vtable[e]:0);this.addInt16(t-this.object_start);var n=(i+2)*A.SIZEOF_SHORT;this.addInt16(n);var a=0,r=this.space;t:for(e=0;e=0;n--)this.writeInt8(i.charCodeAt(n))}this.prep(this.minalign,A.SIZEOF_INT),this.addOffset(t),this.bb.setPosition(this.space)},A.Builder.prototype.requiredField=function(t,e){var i=this.bb.capacity()-t,n=i-this.bb.readInt32(i);if(!(0!=this.bb.readInt16(n+e)))throw new Error("FlatBuffers: field "+e+" must be set")},A.Builder.prototype.startVector=function(t,e,i){this.notNested(),this.vector_num_elems=e,this.prep(A.SIZEOF_INT,t*e),this.prep(i,t*e)},A.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},A.Builder.prototype.createString=function(t){if(t instanceof Uint8Array)var e=t;else{e=[];for(var i=0;i=56320)n=a;else n=(a<<10)+t.charCodeAt(i++)+-56613888;n<128?e.push(n):(n<2048?e.push(n>>6&31|192):(n<65536?e.push(n>>12&15|224):e.push(n>>18&7|240,n>>12&63|128),e.push(n>>6&63|128)),e.push(63&n|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length);i=0;for(var r=this.space,s=this.bb.bytes();i>24},A.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]},A.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16},A.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},A.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},A.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0},A.ByteBuffer.prototype.readInt64=function(t){return new A.Long(this.readInt32(t),this.readInt32(t+4))},A.ByteBuffer.prototype.readUint64=function(t){return new A.Long(this.readUint32(t),this.readUint32(t+4))},A.ByteBuffer.prototype.readFloat32=function(t){return A.int32[0]=this.readInt32(t),A.float32[0]},A.ByteBuffer.prototype.readFloat64=function(t){return A.int32[A.isLittleEndian?0:1]=this.readInt32(t),A.int32[A.isLittleEndian?1:0]=this.readInt32(t+4),A.float64[0]},A.ByteBuffer.prototype.writeInt8=function(t,e){this.bytes_[t]=e},A.ByteBuffer.prototype.writeUint8=function(t,e){this.bytes_[t]=e},A.ByteBuffer.prototype.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},A.ByteBuffer.prototype.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},A.ByteBuffer.prototype.writeInt32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},A.ByteBuffer.prototype.writeUint32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},A.ByteBuffer.prototype.writeInt64=function(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)},A.ByteBuffer.prototype.writeUint64=function(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)},A.ByteBuffer.prototype.writeFloat32=function(t,e){A.float32[0]=e,this.writeInt32(t,A.int32[0])},A.ByteBuffer.prototype.writeFloat64=function(t,e){A.float64[0]=e,this.writeInt32(t,A.int32[A.isLittleEndian?0:1]),this.writeInt32(t+4,A.int32[A.isLittleEndian?1:0])},A.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length>10),56320+(1023&r)))}return n},A.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)},A.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+A.SIZEOF_INT},A.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},A.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=A.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+A.FILE_IDENTIFIER_LENGTH);for(var e=0;e>6*i)+n];i>0;){var r=e>>6*(i-1);a.push(128|63&r),i-=1}return a}}L.prototype={decode:function(t,e){var i;i="object"===typeof t&&t instanceof ArrayBuffer?new Uint8Array(t):"object"===typeof t&&"buffer"in t&&t.buffer instanceof ArrayBuffer?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e=I(e),this._streaming||(this._decoder=new O({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(e.stream);for(var n,a=new F(i),r=[];!a.endOfStream()&&-1!==(n=this._decoder.handler(a,a.read()));)null!==n&&(Array.isArray(n)?r.push.apply(r,n):r.push(n));if(!this._streaming){do{if(-1===(n=this._decoder.handler(a,a.read())))break;null!==n&&(Array.isArray(n)?r.push.apply(r,n):r.push(n))}while(!a.endOfStream());this._decoder=null}return r.length&&(-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===r[0]?(this._BOMseen=!0,r.shift()):this._BOMseen=!0)),function(t){for(var e="",i=0;i>10),56320+(1023&n)))}return e}(r)}},E.prototype={encode:function(t,e){t=t?String(t):"",e=I(e),this._streaming||(this._encoder=new V(this._options)),this._streaming=Boolean(e.stream);for(var i,n=[],a=new F(function(t){for(var e=String(t),i=e.length,n=0,a=[];n57343)a.push(r);else if(56320<=r&&r<=57343)a.push(65533);else if(55296<=r&&r<=56319)if(n===i-1)a.push(65533);else{var s=t.charCodeAt(n+1);if(56320<=s&&s<=57343){var o=1023&r,l=1023&s;a.push(65536+(o<<10)+l),n+=1}else a.push(65533)}n+=1}return a}(t));!a.endOfStream()&&-1!==(i=this._encoder.handler(a,a.read()));)Array.isArray(i)?n.push.apply(n,i):n.push(i);if(!this._streaming){for(;-1!==(i=this._encoder.handler(a,a.read()));)Array.isArray(i)?n.push.apply(n,i):n.push(i);this._encoder=null}return new Uint8Array(n)}};const z="function"===typeof Buffer?Buffer:null,N="function"===typeof TextDecoder&&"function"===typeof TextEncoder,W=(t=>{if(N||!z){const e=new t("utf-8");return t=>e.decode(t)}return t=>{const{buffer:e,byteOffset:i,length:n}=vt(t);return z.from(e,i,n).toString()}})("undefined"!==typeof TextDecoder?TextDecoder:L),Y=(t=>{if(N||!z){const e=new t;return t=>e.encode(t)}return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return vt(z.from(t,"utf8"))}})("undefined"!==typeof TextEncoder?TextEncoder:E),R=Object.freeze({done:!0,value:void 0});class U{constructor(t){this._json=t}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}}class X{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 j extends X{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}get closed(){return this._closedPromise}async cancel(t){await 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(R);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return Jt.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return Jt.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}async throw(t){return await this.abort(t),R}async return(t){return await this.close(),R}async read(t){return(await this.next(t,"read")).value}async peek(t){return(await this.next(t,"peek")).value}next(){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((t,e)=>{this.resolvers.push({resolve:t,reject:e})}):Promise.resolve(R)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("".concat(this," is closed"))}}const[H,q]=(()=>{const t=()=>{throw new Error("BigInt is not available in this environment")};function e(){throw t()}return e.asIntN=()=>{throw t()},e.asUintN=()=>{throw t()},"undefined"!==typeof BigInt?[BigInt,!0]:[e,!1]})(),[G,K]=(()=>{const t=()=>{throw new Error("BigInt64Array is not available in this environment")};return"undefined"!==typeof BigInt64Array?[BigInt64Array,!0]:[class{static get BYTES_PER_ELEMENT(){return 8}static of(){throw t()}static from(){throw t()}constructor(){throw t()}},!1]})(),[J,$]=(()=>{const t=()=>{throw new Error("BigUint64Array is not available in this environment")};return"undefined"!==typeof BigUint64Array?[BigUint64Array,!0]:[class{static get BYTES_PER_ELEMENT(){return 8}static of(){throw t()}static from(){throw t()}constructor(){throw t()}},!1]})(),Q=t=>"number"===typeof t,Z=t=>"boolean"===typeof t,tt=t=>"function"===typeof t,et=t=>null!=t&&Object(t)===t,it=t=>et(t)&&tt(t.then),nt=t=>et(t)&&tt(t[Symbol.iterator]),at=t=>et(t)&&tt(t[Symbol.asyncIterator]),rt=t=>et(t)&&et(t.schema),st=t=>et(t)&&"done"in t&&"value"in t,ot=t=>et(t)&&tt(t.stat)&&Q(t.fd),lt=t=>et(t)&&ht(t.body),ht=t=>et(t)&&tt(t.cancel)&&tt(t.getReader)&&!(t instanceof X),ct=t=>et(t)&&tt(t.read)&&tt(t.pipe)&&Z(t.readable)&&!(t instanceof X);var ut=A.ByteBuffer;const dt="undefined"!==typeof SharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;function pt(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.byteLength;const a=t.byteLength,r=new Uint8Array(t.buffer,t.byteOffset,a),s=new Uint8Array(e.buffer,e.byteOffset,Math.min(n,a));return r.set(s,i),t}function ft(t,e){let i,n,a,r=function(t){let e,i,n,a,r=t[0]?[t[0]]:[];for(let s,o,l=0,h=0,c=t.length;++lt+e.byteLength,0),o=0,l=-1,h=Math.min(e||1/0,s);for(let c=r.length;++lmt(Int8Array,t),yt=t=>mt(Int16Array,t),xt=t=>mt(Int32Array,t),bt=t=>mt(G,t),vt=t=>mt(Uint8Array,t),wt=t=>mt(Uint16Array,t),_t=t=>mt(Uint32Array,t),kt=t=>mt(J,t),Tt=t=>mt(Float32Array,t),Mt=t=>mt(Float64Array,t),St=t=>mt(Uint8ClampedArray,t),Ct=t=>(t.next(),t);function*Pt(t,e){const i=function*(t){yield t},n="string"===typeof e||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof dt?i(e):nt(e)?e:i(e);yield*Ct(function*(e){let i=null;do{i=e.next(yield mt(t,i))}while(!i.done)}(n[Symbol.iterator]()))}const At=t=>Pt(Int8Array,t),Bt=t=>Pt(Int16Array,t),It=t=>Pt(Int32Array,t),Ft=t=>Pt(Uint8Array,t),Dt=t=>Pt(Uint16Array,t),Lt=t=>Pt(Uint32Array,t),Et=t=>Pt(Float32Array,t),Ot=t=>Pt(Float64Array,t),Vt=t=>Pt(Uint8ClampedArray,t);async function*zt(t,e){if(it(e))return yield*zt(t,await e);const i=async function*(t){yield await t},n="string"===typeof e||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof dt?i(e):nt(e)?async function*(t){yield*Ct(function*(t){let e=null;do{e=t.next(yield e&&e.value)}while(!e.done)}(t[Symbol.iterator]()))}(e):at(e)?e:i(e);yield*Ct(async function*(e){let i=null;do{i=await e.next(yield mt(t,i))}while(!i.done)}(n[Symbol.asyncIterator]()))}const Nt=t=>zt(Int8Array,t),Wt=t=>zt(Int16Array,t),Yt=t=>zt(Int32Array,t),Rt=t=>zt(Uint8Array,t),Ut=t=>zt(Uint16Array,t),Xt=t=>zt(Uint32Array,t),jt=t=>zt(Float32Array,t),Ht=t=>zt(Float64Array,t),qt=t=>zt(Uint8ClampedArray,t);function Gt(t,e,i){if(0!==t){i=i.slice(0,e+1);for(let n=-1;++n<=e;)i[n]+=t}return i}function Kt(t,e){let i=0,n=t.length;if(n!==e.length)return!1;if(n>0)do{if(t[i]!==e[i])return!1}while(++i$t(function*(t){let e,i,n,a,r=!1,s=[],o=0;({cmd:n,size:a}=yield null);let l=Ft(t)[Symbol.iterator]();try{do{if(({done:e,value:i}=isNaN(a-o)?l.next(void 0):l.next(a-o)),!e&&i.byteLength>0&&(s.push(i),o+=i.byteLength),e||a<=o)do{({cmd:n,size:a}=yield"peek"===n?ft(s,a)[0]:([i,s,o]=ft(s,a),i))}while(a$t(async function*(t){let e,i,n,a,r=!1,s=[],o=0;({cmd:n,size:a}=yield null);let l=Rt(t)[Symbol.asyncIterator]();try{do{if(({done:e,value:i}=isNaN(a-o)?await l.next(void 0):await l.next(a-o)),!e&&i.byteLength>0&&(s.push(i),o+=i.byteLength),e||a<=o)do{({cmd:n,size:a}=yield"peek"===n?ft(s,a)[0]:([i,s,o]=ft(s,a),i))}while(a$t(async function*(t){let e,i,n,a=!1,r=!1,s=[],o=0;({cmd:i,size:n}=yield null);let l=new Qt(t);try{do{if(({done:a,value:e}=isNaN(n-o)?await l.read(void 0):await l.read(n-o)),!a&&e.byteLength>0&&(s.push(vt(e)),o+=e.byteLength),a||n<=o)do{({cmd:i,size:n}=yield"peek"===i?ft(s,n)[0]:([e,s,o]=ft(s,n),e))}while(n$t(async function*(t){let e,i,n,a=[],r="error",s=!1,o=null,l=0,h=[];if(({cmd:e,size:i}=yield null),t.isTTY)return yield new Uint8Array(0);try{a[0]=Zt(t,"end"),a[1]=Zt(t,"error");do{if(a[2]=Zt(t,"readable"),[r,o]=await Promise.race(a.map(t=>t[2])),"error"===r)break;if((s="end"===r)||(isFinite(i-l)?(n=vt(t.read(i-l)),n.byteLength0&&(h.push(n),l+=n.byteLength)),s||i<=l)do{({cmd:e,size:i}=yield"peek"===e?ft(h,i)[0]:([n,h,l]=ft(h,i),n))}while(i{for(const[i,s]of e)t.off(i,s);try{const e=t.destroy;e&&e.call(t,i),i=void 0}catch(r){i=r||i}finally{null!=i?a(i):n()}})}(a,"error"===r?o:null)}}(t)),toDOMStream(t,e){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(t,e){throw new Error('"toNodeStream" not available in this environment')}};const $t=t=>(t.next(),t);class Qt{constructor(t){this.source=t,this.byobReader=null,this.defaultReader=null;try{this.supportsBYOB=!!(this.reader=this.getBYOBReader())}catch(e){this.supportsBYOB=!(this.reader=this.getDefaultReader())}}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=this.byobReader=this.defaultReader=null}async cancel(t){const{reader:e,source:i}=this;e&&await e.cancel(t).catch(()=>{}),i&&i.locked&&this.releaseLock()}async read(t){if(0===t)return{done:null==this.reader,value:new Uint8Array(0)};const e=this.supportsBYOB&&"number"===typeof t?await this.readFromBYOBReader(t):await this.getDefaultReader().read();return!e.done&&(e.value=vt(e)),e}getDefaultReader(){return this.byobReader&&this.releaseLock(),this.defaultReader||(this.defaultReader=this.source.getReader(),this.defaultReader.closed.catch(()=>{})),this.reader=this.defaultReader}getBYOBReader(){return this.defaultReader&&this.releaseLock(),this.byobReader||(this.byobReader=this.source.getReader({mode:"byob"}),this.byobReader.closed.catch(()=>{})),this.reader=this.byobReader}async readFromBYOBReader(t){return await async function t(e,i,n,a){if(n>=a)return{done:!1,value:new Uint8Array(i,0,a)};const{done:r,value:s}=await e.read(new Uint8Array(i,n,a-n));if((n+=s.byteLength){let i,n=t=>i([e,t]);return[e,n,new Promise(a=>(i=a)&&t.once(e,n))]};class te{}var ee,ie,ne,ae,re;ae=ee||(ee={}),ne=ae.apache||(ae.apache={}),function(t){let e;!function(t){t[t.V1=0]="V1",t[t.V2=1]="V2",t[t.V3=2]="V3",t[t.V4=3]="V4"}(e=t.MetadataVersion||(t.MetadataVersion={}))}((ie=ne.arrow||(ne.arrow={})).flatbuf||(ie.flatbuf={})),function(t){!function(t){!function(t){!function(t){let e;!function(t){t[t.Sparse=0]="Sparse",t[t.Dense=1]="Dense"}(e=t.UnionMode||(t.UnionMode={}))}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){let e;!function(t){t[t.HALF=0]="HALF",t[t.SINGLE=1]="SINGLE",t[t.DOUBLE=2]="DOUBLE"}(e=t.Precision||(t.Precision={}))}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){let e;!function(t){t[t.DAY=0]="DAY",t[t.MILLISECOND=1]="MILLISECOND"}(e=t.DateUnit||(t.DateUnit={}))}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){let e;!function(t){t[t.SECOND=0]="SECOND",t[t.MILLISECOND=1]="MILLISECOND",t[t.MICROSECOND=2]="MICROSECOND",t[t.NANOSECOND=3]="NANOSECOND"}(e=t.TimeUnit||(t.TimeUnit={}))}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){let e;!function(t){t[t.YEAR_MONTH=0]="YEAR_MONTH",t[t.DAY_TIME=1]="DAY_TIME"}(e=t.IntervalUnit||(t.IntervalUnit={}))}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){let e;!function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.FloatingPoint=3]="FloatingPoint",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct_=13]="Struct_",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Duration=18]="Duration",t[t.LargeBinary=19]="LargeBinary",t[t.LargeUtf8=20]="LargeUtf8",t[t.LargeList=21]="LargeList"}(e=t.Type||(t.Type={}))}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){let e;!function(t){t[t.Little=0]="Little",t[t.Big=1]="Big"}(e=t.Endianness||(t.Endianness={}))}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsNull(t,i){return(i||new e).__init(t.readInt32(t.position())+t.position(),t)}static startNull(t){t.startObject(0)}static endNull(t){return t.endObject()}static createNull(t){return e.startNull(t),e.endNull(t)}}t.Null=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsStruct_(t,i){return(i||new e).__init(t.readInt32(t.position())+t.position(),t)}static startStruct_(t){t.startObject(0)}static endStruct_(t){return t.endObject()}static createStruct_(t){return e.startStruct_(t),e.endStruct_(t)}}t.Struct_=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsList(t,i){return(i||new e).__init(t.readInt32(t.position())+t.position(),t)}static startList(t){t.startObject(0)}static endList(t){return t.endObject()}static createList(t){return e.startList(t),e.endList(t)}}t.List=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsLargeList(t,i){return(i||new e).__init(t.readInt32(t.position())+t.position(),t)}static startLargeList(t){t.startObject(0)}static endLargeList(t){return t.endObject()}static createLargeList(t){return e.startLargeList(t),e.endLargeList(t)}}t.LargeList=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFixedSizeList(t,i){return(i||new e).__init(t.readInt32(t.position())+t.position(),t)}listSize(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeList(t){t.startObject(1)}static addListSize(t,e){t.addFieldInt32(0,e,0)}static endFixedSizeList(t){return t.endObject()}static createFixedSizeList(t,i){return e.startFixedSizeList(t),e.addListSize(t,i),e.endFixedSizeList(t)}}t.FixedSizeList=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMap(t,i){return(i||new e).__init(t.readInt32(t.position())+t.position(),t)}keysSorted(){let t=this.bb.__offset(this.bb_pos,4);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}static startMap(t){t.startObject(1)}static addKeysSorted(t,e){t.addFieldInt8(0,+e,0)}static endMap(t){return t.endObject()}static createMap(t,i){return e.startMap(t),e.addKeysSorted(t,i),e.endMap(t)}}t.Map=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(e){!function(e){!function(e){class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsUnion(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}mode(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):t.apache.arrow.flatbuf.UnionMode.Sparse}typeIds(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb.__vector(this.bb_pos+e)+4*t):0}typeIdsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}typeIdsArray(){let t=this.bb.__offset(this.bb_pos,6);return t?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}static startUnion(t){t.startObject(2)}static addMode(e,i){e.addFieldInt16(0,i,t.apache.arrow.flatbuf.UnionMode.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,n){return i.startUnion(t),i.addMode(t,e),i.addTypeIds(t,n),i.endUnion(t)}}e.Union=i}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsInt(t,i){return(i||new e).__init(t.readInt32(t.position())+t.position(),t)}bitWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}isSigned(){let t=this.bb.__offset(this.bb_pos,6);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}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,i,n){return e.startInt(t),e.addBitWidth(t,i),e.addIsSigned(t,n),e.endInt(t)}}t.Int=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(e){!function(e){!function(e){class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFloatingPoint(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):t.apache.arrow.flatbuf.Precision.HALF}static startFloatingPoint(t){t.startObject(1)}static addPrecision(e,i){e.addFieldInt16(0,i,t.apache.arrow.flatbuf.Precision.HALF)}static endFloatingPoint(t){return t.endObject()}static createFloatingPoint(t,e){return i.startFloatingPoint(t),i.addPrecision(t,e),i.endFloatingPoint(t)}}e.FloatingPoint=i}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsUtf8(t,i){return(i||new e).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return e.startUtf8(t),e.endUtf8(t)}}t.Utf8=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsBinary(t,i){return(i||new e).__init(t.readInt32(t.position())+t.position(),t)}static startBinary(t){t.startObject(0)}static endBinary(t){return t.endObject()}static createBinary(t){return e.startBinary(t),e.endBinary(t)}}t.Binary=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsLargeUtf8(t,i){return(i||new e).__init(t.readInt32(t.position())+t.position(),t)}static startLargeUtf8(t){t.startObject(0)}static endLargeUtf8(t){return t.endObject()}static createLargeUtf8(t){return e.startLargeUtf8(t),e.endLargeUtf8(t)}}t.LargeUtf8=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsLargeBinary(t,i){return(i||new e).__init(t.readInt32(t.position())+t.position(),t)}static startLargeBinary(t){t.startObject(0)}static endLargeBinary(t){return t.endObject()}static createLargeBinary(t){return e.startLargeBinary(t),e.endLargeBinary(t)}}t.LargeBinary=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFixedSizeBinary(t,i){return(i||new e).__init(t.readInt32(t.position())+t.position(),t)}byteWidth(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}static startFixedSizeBinary(t){t.startObject(1)}static addByteWidth(t,e){t.addFieldInt32(0,e,0)}static endFixedSizeBinary(t){return t.endObject()}static createFixedSizeBinary(t,i){return e.startFixedSizeBinary(t),e.addByteWidth(t,i),e.endFixedSizeBinary(t)}}t.FixedSizeBinary=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsBool(t,i){return(i||new e).__init(t.readInt32(t.position())+t.position(),t)}static startBool(t){t.startObject(0)}static endBool(t){return t.endObject()}static createBool(t){return e.startBool(t),e.endBool(t)}}t.Bool=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDecimal(t,i){return(i||new e).__init(t.readInt32(t.position())+t.position(),t)}precision(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):0}scale(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}static startDecimal(t){t.startObject(2)}static addPrecision(t,e){t.addFieldInt32(0,e,0)}static addScale(t,e){t.addFieldInt32(1,e,0)}static endDecimal(t){return t.endObject()}static createDecimal(t,i,n){return e.startDecimal(t),e.addPrecision(t,i),e.addScale(t,n),e.endDecimal(t)}}t.Decimal=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(e){!function(e){!function(e){class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDate(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):t.apache.arrow.flatbuf.DateUnit.MILLISECOND}static startDate(t){t.startObject(1)}static addUnit(e,i){e.addFieldInt16(0,i,t.apache.arrow.flatbuf.DateUnit.MILLISECOND)}static endDate(t){return t.endObject()}static createDate(t,e){return i.startDate(t),i.addUnit(t,e),i.endDate(t)}}e.Date=i}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(e){!function(e){!function(e){class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTime(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):t.apache.arrow.flatbuf.TimeUnit.MILLISECOND}bitWidth(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):32}static startTime(t){t.startObject(2)}static addUnit(e,i){e.addFieldInt16(0,i,t.apache.arrow.flatbuf.TimeUnit.MILLISECOND)}static addBitWidth(t,e){t.addFieldInt32(1,e,32)}static endTime(t){return t.endObject()}static createTime(t,e,n){return i.startTime(t),i.addUnit(t,e),i.addBitWidth(t,n),i.endTime(t)}}e.Time=i}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(e){!function(e){!function(e){class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTimestamp(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):t.apache.arrow.flatbuf.TimeUnit.SECOND}timezone(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}static startTimestamp(t){t.startObject(2)}static addUnit(e,i){e.addFieldInt16(0,i,t.apache.arrow.flatbuf.TimeUnit.SECOND)}static addTimezone(t,e){t.addFieldOffset(1,e,0)}static endTimestamp(t){return t.endObject()}static createTimestamp(t,e,n){return i.startTimestamp(t),i.addUnit(t,e),i.addTimezone(t,n),i.endTimestamp(t)}}e.Timestamp=i}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(e){!function(e){!function(e){class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsInterval(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):t.apache.arrow.flatbuf.IntervalUnit.YEAR_MONTH}static startInterval(t){t.startObject(1)}static addUnit(e,i){e.addFieldInt16(0,i,t.apache.arrow.flatbuf.IntervalUnit.YEAR_MONTH)}static endInterval(t){return t.endObject()}static createInterval(t,e){return i.startInterval(t),i.addUnit(t,e),i.endInterval(t)}}e.Interval=i}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(e){!function(e){!function(e){class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDuration(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):t.apache.arrow.flatbuf.TimeUnit.MILLISECOND}static startDuration(t){t.startObject(1)}static addUnit(e,i){e.addFieldInt16(0,i,t.apache.arrow.flatbuf.TimeUnit.MILLISECOND)}static endDuration(t){return t.endObject()}static createDuration(t,e){return i.startDuration(t),i.addUnit(t,e),i.endDuration(t)}}e.Duration=i}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){class e{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsKeyValue(t,i){return(i||new e).__init(t.readInt32(t.position())+t.position(),t)}key(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}value(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}static startKeyValue(t){t.startObject(2)}static addKey(t,e){t.addFieldOffset(0,e,0)}static addValue(t,e){t.addFieldOffset(1,e,0)}static endKeyValue(t){return t.endObject()}static createKeyValue(t,i,n){return e.startKeyValue(t),e.addKey(t,i),e.addValue(t,n),e.endKeyValue(t)}}t.KeyValue=e}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(e){!function(e){!function(e){class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDictionaryEncoding(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}indexType(e){let i=this.bb.__offset(this.bb_pos,6);return i?(e||new t.apache.arrow.flatbuf.Int).__init(this.bb.__indirect(this.bb_pos+i),this.bb):null}isOrdered(){let t=this.bb.__offset(this.bb_pos,8);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}static startDictionaryEncoding(t){t.startObject(3)}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 endDictionaryEncoding(t){return t.endObject()}static createDictionaryEncoding(t,e,n,a){return i.startDictionaryEncoding(t),i.addId(t,e),i.addIndexType(t,n),i.addIsOrdered(t,a),i.endDictionaryEncoding(t)}}e.DictionaryEncoding=i}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(e){!function(e){!function(e){class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsField(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}nullable(){let t=this.bb.__offset(this.bb_pos,6);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}typeType(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):t.apache.arrow.flatbuf.Type.NONE}type(t){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__union(t,this.bb_pos+e):null}dictionary(e){let i=this.bb.__offset(this.bb_pos,12);return i?(e||new t.apache.arrow.flatbuf.DictionaryEncoding).__init(this.bb.__indirect(this.bb_pos+i),this.bb):null}children(e,i){let n=this.bb.__offset(this.bb_pos,14);return n?(i||new t.apache.arrow.flatbuf.Field).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*e),this.bb):null}childrenLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(e,i){let n=this.bb.__offset(this.bb_pos,16);return n?(i||new t.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*e),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}static startField(t){t.startObject(7)}static addName(t,e){t.addFieldOffset(0,e,0)}static addNullable(t,e){t.addFieldInt8(1,+e,0)}static addTypeType(e,i){e.addFieldInt8(2,i,t.apache.arrow.flatbuf.Type.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()}static createField(t,e,n,a,r,s,o,l){return i.startField(t),i.addName(t,e),i.addNullable(t,n),i.addTypeType(t,a),i.addType(t,r),i.addDictionary(t,s),i.addChildren(t,o),i.addCustomMetadata(t,l),i.endField(t)}}e.Field=i}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){t.Buffer=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static createBuffer(t,e,i){return t.prep(8,16),t.writeInt64(i),t.writeInt64(e),t.offset()}}}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(e){!function(e){!function(e){class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSchema(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}endianness(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):t.apache.arrow.flatbuf.Endianness.Little}fields(e,i){let n=this.bb.__offset(this.bb_pos,6);return n?(i||new t.apache.arrow.flatbuf.Field).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*e),this.bb):null}fieldsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(e,i){let n=this.bb.__offset(this.bb_pos,8);return n?(i||new t.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*e),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSchema(t){t.startObject(3)}static addEndianness(e,i){e.addFieldInt16(0,i,t.apache.arrow.flatbuf.Endianness.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 endSchema(t){return t.endObject()}static finishSchemaBuffer(t,e){t.finish(e)}static createSchema(t,e,n,a){return i.startSchema(t),i.addEndianness(t,e),i.addFields(t,n),i.addCustomMetadata(t,a),i.endSchema(t)}}e.Schema=i}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(ee||(ee={})),function(t){!function(t){!function(t){!function(t){t.Schema=ee.apache.arrow.flatbuf.Schema}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(re||(re={})),function(t){!function(t){!function(t){!function(t){let e;!function(t){t[t.NONE=0]="NONE",t[t.Schema=1]="Schema",t[t.DictionaryBatch=2]="DictionaryBatch",t[t.RecordBatch=3]="RecordBatch",t[t.Tensor=4]="Tensor",t[t.SparseTensor=5]="SparseTensor"}(e=t.MessageHeader||(t.MessageHeader={}))}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(re||(re={})),function(t){!function(t){!function(t){!function(t){t.FieldNode=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 createFieldNode(t,e,i){return t.prep(8,16),t.writeInt64(i),t.writeInt64(e),t.offset()}}}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(re||(re={})),function(t){!function(e){!function(e){!function(e){class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsRecordBatch(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}length(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}nodes(e,i){let n=this.bb.__offset(this.bb_pos,6);return n?(i||new t.apache.arrow.flatbuf.FieldNode).__init(this.bb.__vector(this.bb_pos+n)+16*e,this.bb):null}nodesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}buffers(t,e){let i=this.bb.__offset(this.bb_pos,8);return i?(e||new ee.apache.arrow.flatbuf.Buffer).__init(this.bb.__vector(this.bb_pos+i)+16*t,this.bb):null}buffersLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}static startRecordBatch(t){t.startObject(3)}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 endRecordBatch(t){return t.endObject()}static createRecordBatch(t,e,n,a){return i.startRecordBatch(t),i.addLength(t,e),i.addNodes(t,n),i.addBuffers(t,a),i.endRecordBatch(t)}}e.RecordBatch=i}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(re||(re={})),function(t){!function(e){!function(e){!function(e){class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDictionaryBatch(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}id(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}data(e){let i=this.bb.__offset(this.bb_pos,6);return i?(e||new t.apache.arrow.flatbuf.RecordBatch).__init(this.bb.__indirect(this.bb_pos+i),this.bb):null}isDelta(){let t=this.bb.__offset(this.bb_pos,8);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}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()}static createDictionaryBatch(t,e,n,a){return i.startDictionaryBatch(t),i.addId(t,e),i.addData(t,n),i.addIsDelta(t,a),i.endDictionaryBatch(t)}}e.DictionaryBatch=i}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(re||(re={})),function(t){!function(e){!function(e){!function(e){class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMessage(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ee.apache.arrow.flatbuf.MetadataVersion.V1}headerType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):t.apache.arrow.flatbuf.MessageHeader.NONE}header(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}bodyLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}customMetadata(t,e){let i=this.bb.__offset(this.bb_pos,12);return i?(e||new ee.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+4*t),this.bb):null}customMetadataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,ee.apache.arrow.flatbuf.MetadataVersion.V1)}static addHeaderType(e,i){e.addFieldInt8(1,i,t.apache.arrow.flatbuf.MessageHeader.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 createMessage(t,e,n,a,r,s){return i.startMessage(t),i.addVersion(t,e),i.addHeaderType(t,n),i.addHeader(t,a),i.addBodyLength(t,r),i.addCustomMetadata(t,s),i.endMessage(t)}}e.Message=i}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(re||(re={}));ee.apache.arrow.flatbuf.Type;var se,oe,le=ee.apache.arrow.flatbuf.DateUnit,he=ee.apache.arrow.flatbuf.TimeUnit,ce=ee.apache.arrow.flatbuf.Precision,ue=ee.apache.arrow.flatbuf.UnionMode,de=ee.apache.arrow.flatbuf.IntervalUnit,pe=re.apache.arrow.flatbuf.MessageHeader,fe=ee.apache.arrow.flatbuf.MetadataVersion;function me(t,e,i,n){return 0!==(i&1<>n}function ye(t,e,i){return i?!!(t[e>>3]|=1<>3]&=~(1<0||i.byteLength>3):be(ve(i,t,e,null,me)).subarray(0,n)),a}return i}function be(t){let e=[],i=0,n=0,a=0;for(const s of t)s&&(a|=1<0)&&(e[i++]=a);let r=new Uint8Array(e.length+7&-8);return r.set(e),r}function*ve(t,e,i,n,a){let r=e%8,s=e>>3,o=0,l=i;for(;l>0;r=0){let e=t[s++];do{yield a(n,o++,e,r)}while(--l>0&&++r<8)}}function we(t,e,i){if(i-e<=0)return 0;if(i-e<8){let n=0;for(const a of ve(t,e,i-e,t,ge))n+=a;return n}const n=i>>3<<3,a=e+(e%8===0?0:8-e%8);return we(t,e,a)+we(t,n,i)+_e(t,a>>3,n-a>>3)}function _e(t,e,i){let n=0,a=0|e;const r=new DataView(t.buffer,t.byteOffset,t.byteLength),s=void 0===i?t.byteLength:a+i;for(;s-a>=4;)n+=ke(r.getUint32(a)),a+=4;for(;s-a>=2;)n+=ke(r.getUint16(a)),a+=2;for(;s-a>=1;)n+=ke(r.getUint8(a)),a+=1;return n}function ke(t){let e=0|t;return e-=e>>>1&1431655765,e=(858993459&e)+(e>>>2&858993459),16843009*(e+(e>>>4)&252645135)>>>24}!function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth"}(se||(se={})),function(t){t[t.OFFSET=0]="OFFSET",t[t.DATA=1]="DATA",t[t.VALIDITY=2]="VALIDITY",t[t.TYPE=3]="TYPE"}(oe||(oe={}));class Te{visitMany(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;nthis.visit(t,...i.map(t=>t[e])))}visit(){for(var t=arguments.length,e=new Array(t),i=0;i2&&void 0!==arguments[2])||arguments[2],n=null,a=se.NONE;e instanceof bi||e instanceof te?a=Me(e.type):e instanceof Ve?a=Me(e):"number"!==typeof(a=e)&&(a=se[e]);switch(a){case se.Null:n=t.visitNull;break;case se.Bool:n=t.visitBool;break;case se.Int:n=t.visitInt;break;case se.Int8:n=t.visitInt8||t.visitInt;break;case se.Int16:n=t.visitInt16||t.visitInt;break;case se.Int32:n=t.visitInt32||t.visitInt;break;case se.Int64:n=t.visitInt64||t.visitInt;break;case se.Uint8:n=t.visitUint8||t.visitInt;break;case se.Uint16:n=t.visitUint16||t.visitInt;break;case se.Uint32:n=t.visitUint32||t.visitInt;break;case se.Uint64:n=t.visitUint64||t.visitInt;break;case se.Float:n=t.visitFloat;break;case se.Float16:n=t.visitFloat16||t.visitFloat;break;case se.Float32:n=t.visitFloat32||t.visitFloat;break;case se.Float64:n=t.visitFloat64||t.visitFloat;break;case se.Utf8:n=t.visitUtf8;break;case se.Binary:n=t.visitBinary;break;case se.FixedSizeBinary:n=t.visitFixedSizeBinary;break;case se.Date:n=t.visitDate;break;case se.DateDay:n=t.visitDateDay||t.visitDate;break;case se.DateMillisecond:n=t.visitDateMillisecond||t.visitDate;break;case se.Timestamp:n=t.visitTimestamp;break;case se.TimestampSecond:n=t.visitTimestampSecond||t.visitTimestamp;break;case se.TimestampMillisecond:n=t.visitTimestampMillisecond||t.visitTimestamp;break;case se.TimestampMicrosecond:n=t.visitTimestampMicrosecond||t.visitTimestamp;break;case se.TimestampNanosecond:n=t.visitTimestampNanosecond||t.visitTimestamp;break;case se.Time:n=t.visitTime;break;case se.TimeSecond:n=t.visitTimeSecond||t.visitTime;break;case se.TimeMillisecond:n=t.visitTimeMillisecond||t.visitTime;break;case se.TimeMicrosecond:n=t.visitTimeMicrosecond||t.visitTime;break;case se.TimeNanosecond:n=t.visitTimeNanosecond||t.visitTime;break;case se.Decimal:n=t.visitDecimal;break;case se.List:n=t.visitList;break;case se.Struct:n=t.visitStruct;break;case se.Union:n=t.visitUnion;break;case se.DenseUnion:n=t.visitDenseUnion||t.visitUnion;break;case se.SparseUnion:n=t.visitSparseUnion||t.visitUnion;break;case se.Dictionary:n=t.visitDictionary;break;case se.Interval:n=t.visitInterval;break;case se.IntervalDayTime:n=t.visitIntervalDayTime||t.visitInterval;break;case se.IntervalYearMonth:n=t.visitIntervalYearMonth||t.visitInterval;break;case se.FixedSizeList:n=t.visitFixedSizeList;break;case se.Map:n=t.visitMap}if("function"===typeof n)return n;if(!i)return()=>null;throw new Error("Unrecognized type '".concat(se[a],"'"))}(this,t,!(arguments.length>1&&void 0!==arguments[1])||arguments[1])}visitNull(t){return null}visitBool(t){return null}visitInt(t){return null}visitFloat(t){return null}visitUtf8(t){return null}visitBinary(t){return null}visitFixedSizeBinary(t){return null}visitDate(t){return null}visitTimestamp(t){return null}visitTime(t){return null}visitDecimal(t){return null}visitList(t){return null}visitStruct(t){return null}visitUnion(t){return null}visitDictionary(t){return null}visitInterval(t){return null}visitFixedSizeList(t){return null}visitMap(t){return null}}function Me(t){switch(t.typeId){case se.Null:return se.Null;case se.Int:const{bitWidth:e,isSigned:i}=t;switch(e){case 8:return i?se.Int8:se.Uint8;case 16:return i?se.Int16:se.Uint16;case 32:return i?se.Int32:se.Uint32;case 64:return i?se.Int64:se.Uint64}return se.Int;case se.Float:switch(t.precision){case ce.HALF:return se.Float16;case ce.SINGLE:return se.Float32;case ce.DOUBLE:return se.Float64}return se.Float;case se.Binary:return se.Binary;case se.Utf8:return se.Utf8;case se.Bool:return se.Bool;case se.Decimal:return se.Decimal;case se.Time:switch(t.unit){case he.SECOND:return se.TimeSecond;case he.MILLISECOND:return se.TimeMillisecond;case he.MICROSECOND:return se.TimeMicrosecond;case he.NANOSECOND:return se.TimeNanosecond}return se.Time;case se.Timestamp:switch(t.unit){case he.SECOND:return se.TimestampSecond;case he.MILLISECOND:return se.TimestampMillisecond;case he.MICROSECOND:return se.TimestampMicrosecond;case he.NANOSECOND:return se.TimestampNanosecond}return se.Timestamp;case se.Date:switch(t.unit){case le.DAY:return se.DateDay;case le.MILLISECOND:return se.DateMillisecond}return se.Date;case se.Interval:switch(t.unit){case de.DAY_TIME:return se.IntervalDayTime;case de.YEAR_MONTH:return se.IntervalYearMonth}return se.Interval;case se.Map:return se.Map;case se.List:return se.List;case se.Struct:return se.Struct;case se.Union:switch(t.mode){case ue.Dense:return se.DenseUnion;case ue.Sparse:return se.SparseUnion}return se.Union;case se.FixedSizeBinary:return se.FixedSizeBinary;case se.FixedSizeList:return se.FixedSizeList;case se.Dictionary:return se.Dictionary}throw new Error("Unrecognized type '".concat(se[t.typeId],"'"))}Te.prototype.visitInt8=null,Te.prototype.visitInt16=null,Te.prototype.visitInt32=null,Te.prototype.visitInt64=null,Te.prototype.visitUint8=null,Te.prototype.visitUint16=null,Te.prototype.visitUint32=null,Te.prototype.visitUint64=null,Te.prototype.visitFloat16=null,Te.prototype.visitFloat32=null,Te.prototype.visitFloat64=null,Te.prototype.visitDateDay=null,Te.prototype.visitDateMillisecond=null,Te.prototype.visitTimestampSecond=null,Te.prototype.visitTimestampMillisecond=null,Te.prototype.visitTimestampMicrosecond=null,Te.prototype.visitTimestampNanosecond=null,Te.prototype.visitTimeSecond=null,Te.prototype.visitTimeMillisecond=null,Te.prototype.visitTimeMicrosecond=null,Te.prototype.visitTimeNanosecond=null,Te.prototype.visitDenseUnion=null,Te.prototype.visitSparseUnion=null,Te.prototype.visitIntervalDayTime=null,Te.prototype.visitIntervalYearMonth=null;class Se extends Te{compareSchemas(t,e){return t===e||e instanceof t.constructor&&Oe.compareFields(t.fields,e.fields)}compareFields(t,e){return t===e||Array.isArray(t)&&Array.isArray(e)&&t.length===e.length&&t.every((t,i)=>Oe.compareField(t,e[i]))}compareField(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&Oe.visit(t.type,e.type)}}function Ce(t,e){return e instanceof t.constructor}function Pe(t,e){return t===e||Ce(t,e)}function Ae(t,e){return t===e||Ce(t,e)&&t.bitWidth===e.bitWidth&&t.isSigned===e.isSigned}function Be(t,e){return t===e||Ce(t,e)&&t.precision===e.precision}function Ie(t,e){return t===e||Ce(t,e)&&t.unit===e.unit}function Fe(t,e){return t===e||Ce(t,e)&&t.unit===e.unit&&t.timezone===e.timezone}function De(t,e){return t===e||Ce(t,e)&&t.unit===e.unit&&t.bitWidth===e.bitWidth}function Le(t,e){return t===e||Ce(t,e)&&t.mode===e.mode&&t.typeIds.every((t,i)=>t===e.typeIds[i])&&Oe.compareFields(t.children,e.children)}function Ee(t,e){return t===e||Ce(t,e)&&t.unit===e.unit}Se.prototype.visitNull=Pe,Se.prototype.visitBool=Pe,Se.prototype.visitInt=Ae,Se.prototype.visitInt8=Ae,Se.prototype.visitInt16=Ae,Se.prototype.visitInt32=Ae,Se.prototype.visitInt64=Ae,Se.prototype.visitUint8=Ae,Se.prototype.visitUint16=Ae,Se.prototype.visitUint32=Ae,Se.prototype.visitUint64=Ae,Se.prototype.visitFloat=Be,Se.prototype.visitFloat16=Be,Se.prototype.visitFloat32=Be,Se.prototype.visitFloat64=Be,Se.prototype.visitUtf8=Pe,Se.prototype.visitBinary=Pe,Se.prototype.visitFixedSizeBinary=function(t,e){return t===e||Ce(t,e)&&t.byteWidth===e.byteWidth},Se.prototype.visitDate=Ie,Se.prototype.visitDateDay=Ie,Se.prototype.visitDateMillisecond=Ie,Se.prototype.visitTimestamp=Fe,Se.prototype.visitTimestampSecond=Fe,Se.prototype.visitTimestampMillisecond=Fe,Se.prototype.visitTimestampMicrosecond=Fe,Se.prototype.visitTimestampNanosecond=Fe,Se.prototype.visitTime=De,Se.prototype.visitTimeSecond=De,Se.prototype.visitTimeMillisecond=De,Se.prototype.visitTimeMicrosecond=De,Se.prototype.visitTimeNanosecond=De,Se.prototype.visitDecimal=Pe,Se.prototype.visitList=function(t,e){return t===e||Ce(t,e)&&t.children.length===e.children.length&&Oe.compareFields(t.children,e.children)},Se.prototype.visitStruct=function(t,e){return t===e||Ce(t,e)&&t.children.length===e.children.length&&Oe.compareFields(t.children,e.children)},Se.prototype.visitUnion=Le,Se.prototype.visitDenseUnion=Le,Se.prototype.visitSparseUnion=Le,Se.prototype.visitDictionary=function(t,e){return t===e||Ce(t,e)&&t.id===e.id&&t.isOrdered===e.isOrdered&&Oe.visit(t.indices,e.indices)&&Oe.visit(t.dictionary,e.dictionary)},Se.prototype.visitInterval=Ee,Se.prototype.visitIntervalDayTime=Ee,Se.prototype.visitIntervalYearMonth=Ee,Se.prototype.visitFixedSizeList=function(t,e){return t===e||Ce(t,e)&&t.listSize===e.listSize&&t.children.length===e.children.length&&Oe.compareFields(t.children,e.children)},Se.prototype.visitMap=function(t,e){return t===e||Ce(t,e)&&t.keysSorted===e.keysSorted&&t.children.length===e.children.length&&Oe.compareFields(t.children,e.children)};const Oe=new Se;class Ve{static isNull(t){return t&&t.typeId===se.Null}static isInt(t){return t&&t.typeId===se.Int}static isFloat(t){return t&&t.typeId===se.Float}static isBinary(t){return t&&t.typeId===se.Binary}static isUtf8(t){return t&&t.typeId===se.Utf8}static isBool(t){return t&&t.typeId===se.Bool}static isDecimal(t){return t&&t.typeId===se.Decimal}static isDate(t){return t&&t.typeId===se.Date}static isTime(t){return t&&t.typeId===se.Time}static isTimestamp(t){return t&&t.typeId===se.Timestamp}static isInterval(t){return t&&t.typeId===se.Interval}static isList(t){return t&&t.typeId===se.List}static isStruct(t){return t&&t.typeId===se.Struct}static isUnion(t){return t&&t.typeId===se.Union}static isFixedSizeBinary(t){return t&&t.typeId===se.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===se.FixedSizeList}static isMap(t){return t&&t.typeId===se.Map}static isDictionary(t){return t&&t.typeId===se.Dictionary}get typeId(){return se.NONE}compareTo(t){return Oe.visit(this,t)}}var ze;Ve[Symbol.toStringTag]=((ze=Ve.prototype).children=null,ze.ArrayType=Array,ze[Symbol.toStringTag]="DataType");class Ne extends Ve{toString(){return"Null"}get typeId(){return se.Null}}Ne[Symbol.toStringTag]=(t=>t[Symbol.toStringTag]="Null")(Ne.prototype);class We extends Ve{constructor(t,e){super(),this.isSigned=t,this.bitWidth=e}get typeId(){return se.Int}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:case 64:return this.isSigned?Int32Array:Uint32Array}throw new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}toString(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}We[Symbol.toStringTag]=(t=>(t.isSigned=null,t.bitWidth=null,t[Symbol.toStringTag]="Int"))(We.prototype);class Ye extends We{constructor(){super(!0,8)}}class Re extends We{constructor(){super(!0,16)}}class Ue extends We{constructor(){super(!0,32)}}class Xe extends We{constructor(){super(!0,64)}}class je extends We{constructor(){super(!1,8)}}class He extends We{constructor(){super(!1,16)}}class qe extends We{constructor(){super(!1,32)}}class Ge extends We{constructor(){super(!1,64)}}Object.defineProperty(Ye.prototype,"ArrayType",{value:Int8Array}),Object.defineProperty(Re.prototype,"ArrayType",{value:Int16Array}),Object.defineProperty(Ue.prototype,"ArrayType",{value:Int32Array}),Object.defineProperty(Xe.prototype,"ArrayType",{value:Int32Array}),Object.defineProperty(je.prototype,"ArrayType",{value:Uint8Array}),Object.defineProperty(He.prototype,"ArrayType",{value:Uint16Array}),Object.defineProperty(qe.prototype,"ArrayType",{value:Uint32Array}),Object.defineProperty(Ge.prototype,"ArrayType",{value:Uint32Array});class Ke extends Ve{constructor(t){super(),this.precision=t}get typeId(){return se.Float}get ArrayType(){switch(this.precision){case ce.HALF:return Uint16Array;case ce.SINGLE:return Float32Array;case ce.DOUBLE:return Float64Array}throw new Error("Unrecognized ".concat(this[Symbol.toStringTag]," type"))}toString(){return"Float".concat(this.precision<<5||16)}}Ke[Symbol.toStringTag]=(t=>(t.precision=null,t[Symbol.toStringTag]="Float"))(Ke.prototype);class Je extends Ke{constructor(){super(ce.HALF)}}class $e extends Ke{constructor(){super(ce.SINGLE)}}class Qe extends Ke{constructor(){super(ce.DOUBLE)}}Object.defineProperty(Je.prototype,"ArrayType",{value:Uint16Array}),Object.defineProperty($e.prototype,"ArrayType",{value:Float32Array}),Object.defineProperty(Qe.prototype,"ArrayType",{value:Float64Array});class Ze extends Ve{constructor(){super()}get typeId(){return se.Binary}toString(){return"Binary"}}Ze[Symbol.toStringTag]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Binary"))(Ze.prototype);class ti extends Ve{constructor(){super()}get typeId(){return se.Utf8}toString(){return"Utf8"}}ti[Symbol.toStringTag]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Utf8"))(ti.prototype);class ei extends Ve{constructor(){super()}get typeId(){return se.Bool}toString(){return"Bool"}}ei[Symbol.toStringTag]=(t=>(t.ArrayType=Uint8Array,t[Symbol.toStringTag]="Bool"))(ei.prototype);class ii extends Ve{constructor(t,e){super(),this.scale=t,this.precision=e}get typeId(){return se.Decimal}toString(){return"Decimal[".concat(this.precision,"e").concat(this.scale>0?"+":"").concat(this.scale,"]")}}ii[Symbol.toStringTag]=(t=>(t.scale=null,t.precision=null,t.ArrayType=Uint32Array,t[Symbol.toStringTag]="Decimal"))(ii.prototype);class ni extends Ve{constructor(t){super(),this.unit=t}get typeId(){return se.Date}toString(){return"Date".concat(32*(this.unit+1),"<").concat(le[this.unit],">")}}ni[Symbol.toStringTag]=(t=>(t.unit=null,t.ArrayType=Int32Array,t[Symbol.toStringTag]="Date"))(ni.prototype);class ai extends ni{constructor(){super(le.DAY)}}class ri extends ni{constructor(){super(le.MILLISECOND)}}class si extends Ve{constructor(t,e){super(),this.unit=t,this.bitWidth=e}get typeId(){return se.Time}toString(){return"Time".concat(this.bitWidth,"<").concat(he[this.unit],">")}}si[Symbol.toStringTag]=(t=>(t.unit=null,t.bitWidth=null,t.ArrayType=Int32Array,t[Symbol.toStringTag]="Time"))(si.prototype);class oi extends Ve{constructor(t,e){super(),this.unit=t,this.timezone=e}get typeId(){return se.Timestamp}toString(){return"Timestamp<".concat(he[this.unit]).concat(this.timezone?", ".concat(this.timezone):"",">")}}oi[Symbol.toStringTag]=(t=>(t.unit=null,t.timezone=null,t.ArrayType=Int32Array,t[Symbol.toStringTag]="Timestamp"))(oi.prototype);class li extends Ve{constructor(t){super(),this.unit=t}get typeId(){return se.Interval}toString(){return"Interval<".concat(de[this.unit],">")}}li[Symbol.toStringTag]=(t=>(t.unit=null,t.ArrayType=Int32Array,t[Symbol.toStringTag]="Interval"))(li.prototype);class hi extends Ve{constructor(t){super(),this.children=[t]}get typeId(){return se.List}toString(){return"List<".concat(this.valueType,">")}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}}hi[Symbol.toStringTag]=(t=>(t.children=null,t[Symbol.toStringTag]="List"))(hi.prototype);class ci extends Ve{constructor(t){super(),this.children=t}get typeId(){return se.Struct}toString(){return"Struct<{".concat(this.children.map(t=>"".concat(t.name,":").concat(t.type)).join(", "),"}>")}}ci[Symbol.toStringTag]=(t=>(t.children=null,t[Symbol.toStringTag]="Struct"))(ci.prototype);class ui extends Ve{constructor(t,e,i){super(),this.mode=t,this.children=i,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((t,e,i)=>(t[e]=i)&&t||t,Object.create(null))}get typeId(){return se.Union}toString(){return"".concat(this[Symbol.toStringTag],"<").concat(this.children.map(t=>"".concat(t.type)).join(" | "),">")}}ui[Symbol.toStringTag]=(t=>(t.mode=null,t.typeIds=null,t.children=null,t.typeIdToChildIndex=null,t.ArrayType=Int8Array,t[Symbol.toStringTag]="Union"))(ui.prototype);class di extends Ve{constructor(t){super(),this.byteWidth=t}get typeId(){return se.FixedSizeBinary}toString(){return"FixedSizeBinary[".concat(this.byteWidth,"]")}}di[Symbol.toStringTag]=(t=>(t.byteWidth=null,t.ArrayType=Uint8Array,t[Symbol.toStringTag]="FixedSizeBinary"))(di.prototype);class pi extends Ve{constructor(t,e){super(),this.listSize=t,this.children=[e]}get typeId(){return se.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}pi[Symbol.toStringTag]=(t=>(t.children=null,t.listSize=null,t[Symbol.toStringTag]="FixedSizeList"))(pi.prototype);class fi extends Ve{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super(),this.children=[t],this.keysSorted=e}get typeId(){return se.Map}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}toString(){return"Map<{".concat(this.children[0].type.children.map(t=>"".concat(t.name,":").concat(t.type)).join(", "),"}>")}}fi[Symbol.toStringTag]=(t=>(t.children=null,t.keysSorted=null,t[Symbol.toStringTag]="Map_"))(fi.prototype);const mi=(gi=-1,()=>++gi);var gi;class yi extends Ve{constructor(t,e,i,n){super(),this.indices=e,this.dictionary=t,this.isOrdered=n||!1,this.id=null==i?mi():"number"===typeof i?i:i.low}get typeId(){return se.Dictionary}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return"Dictionary<".concat(this.indices,", ").concat(this.dictionary,">")}}function xi(t){let e=t;switch(t.typeId){case se.Decimal:return 4;case se.Timestamp:return 2;case se.Date:case se.Interval:return 1+e.unit;case se.Int:case se.Time:return+(e.bitWidth>32)+1;case se.FixedSizeList:return e.listSize;case se.FixedSizeBinary:return e.byteWidth;default:return 1}}yi[Symbol.toStringTag]=(t=>(t.id=null,t.indices=null,t.isOrdered=null,t.dictionary=null,t[Symbol.toStringTag]="Dictionary"))(yi.prototype);class bi{constructor(t,e,i,n,a,r,s){let o;this.type=t,this.dictionary=s,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(i||0,0)),this._nullCount=Math.floor(Math.max(n||0,-1)),this.childData=(r||[]).map(t=>t instanceof bi?t:t.data),a instanceof bi?(this.stride=a.stride,this.values=a.values,this.typeIds=a.typeIds,this.nullBitmap=a.nullBitmap,this.valueOffsets=a.valueOffsets):(this.stride=xi(t),a&&((o=a[0])&&(this.valueOffsets=o),(o=a[1])&&(this.values=o),(o=a[2])&&(this.nullBitmap=o),(o=a[3])&&(this.typeIds=o)))}get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get byteLength(){let t=0,{valueOffsets:e,values:i,nullBitmap:n,typeIds:a}=this;return e&&(t+=e.byteLength),i&&(t+=i.byteLength),n&&(t+=n.byteLength),a&&(t+=a.byteLength),this.childData.reduce((t,e)=>t+e.byteLength,t)}get nullCount(){let t,e=this._nullCount;return e<=-1&&(t=this.nullBitmap)&&(this._nullCount=e=this.length-we(t,this.offset,this.offset+this.length)),e}clone(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.offset,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.length,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._nullCount,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:this.childData;return new bi(t,e,i,n,a,r,this.dictionary)}slice(t,e){const{stride:i,typeId:n,childData:a}=this,r=+(0===this._nullCount)-1,s=16===n?i:1,o=this._sliceBuffers(t,e,i,n);return this.clone(this.type,this.offset+t,e,r,o,!a.length||this.valueOffsets?a:this._sliceChildren(a,s*t,s*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===se.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:i}=this,n=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);n[e>>3]=(1<0&&n.set(xe(this.offset,e,this.nullBitmap),0);const a=this.buffers;return a[oe.VALIDITY]=n,this.clone(this.type,0,t,i+(t-e),a)}_sliceBuffers(t,e,i,n){let a,{buffers:r}=this;return(a=r[oe.TYPE])&&(r[oe.TYPE]=a.subarray(t,t+e)),(a=r[oe.OFFSET])&&(r[oe.OFFSET]=a.subarray(t,t+e+1))||(a=r[oe.DATA])&&(r[oe.DATA]=6===n?a:a.subarray(i*t,i*(t+e))),r}_sliceChildren(t,e,i){return t.map(t=>t.slice(e,i))}static new(t,e,i,n,a,r,s){switch(a instanceof bi?a=a.buffers:a||(a=[]),t.typeId){case se.Null:return bi.Null(t,e,i);case se.Int:return bi.Int(t,e,i,n||0,a[oe.VALIDITY],a[oe.DATA]||[]);case se.Dictionary:return bi.Dictionary(t,e,i,n||0,a[oe.VALIDITY],a[oe.DATA]||[],s);case se.Float:return bi.Float(t,e,i,n||0,a[oe.VALIDITY],a[oe.DATA]||[]);case se.Bool:return bi.Bool(t,e,i,n||0,a[oe.VALIDITY],a[oe.DATA]||[]);case se.Decimal:return bi.Decimal(t,e,i,n||0,a[oe.VALIDITY],a[oe.DATA]||[]);case se.Date:return bi.Date(t,e,i,n||0,a[oe.VALIDITY],a[oe.DATA]||[]);case se.Time:return bi.Time(t,e,i,n||0,a[oe.VALIDITY],a[oe.DATA]||[]);case se.Timestamp:return bi.Timestamp(t,e,i,n||0,a[oe.VALIDITY],a[oe.DATA]||[]);case se.Interval:return bi.Interval(t,e,i,n||0,a[oe.VALIDITY],a[oe.DATA]||[]);case se.FixedSizeBinary:return bi.FixedSizeBinary(t,e,i,n||0,a[oe.VALIDITY],a[oe.DATA]||[]);case se.Binary:return bi.Binary(t,e,i,n||0,a[oe.VALIDITY],a[oe.OFFSET]||[],a[oe.DATA]||[]);case se.Utf8:return bi.Utf8(t,e,i,n||0,a[oe.VALIDITY],a[oe.OFFSET]||[],a[oe.DATA]||[]);case se.List:return bi.List(t,e,i,n||0,a[oe.VALIDITY],a[oe.OFFSET]||[],(r||[])[0]);case se.FixedSizeList:return bi.FixedSizeList(t,e,i,n||0,a[oe.VALIDITY],(r||[])[0]);case se.Struct:return bi.Struct(t,e,i,n||0,a[oe.VALIDITY],r||[]);case se.Map:return bi.Map(t,e,i,n||0,a[oe.VALIDITY],a[oe.OFFSET]||[],(r||[])[0]);case se.Union:return bi.Union(t,e,i,n||0,a[oe.VALIDITY],a[oe.TYPE]||[],a[oe.OFFSET]||r,r)}throw new Error("Unrecognized typeId ".concat(t.typeId))}static Null(t,e,i){return new bi(t,e,i,0)}static Int(t,e,i,n,a,r){return new bi(t,e,i,n,[void 0,mt(t.ArrayType,r),vt(a)])}static Dictionary(t,e,i,n,a,r,s){return new bi(t,e,i,n,[void 0,mt(t.indices.ArrayType,r),vt(a)],[],s)}static Float(t,e,i,n,a,r){return new bi(t,e,i,n,[void 0,mt(t.ArrayType,r),vt(a)])}static Bool(t,e,i,n,a,r){return new bi(t,e,i,n,[void 0,mt(t.ArrayType,r),vt(a)])}static Decimal(t,e,i,n,a,r){return new bi(t,e,i,n,[void 0,mt(t.ArrayType,r),vt(a)])}static Date(t,e,i,n,a,r){return new bi(t,e,i,n,[void 0,mt(t.ArrayType,r),vt(a)])}static Time(t,e,i,n,a,r){return new bi(t,e,i,n,[void 0,mt(t.ArrayType,r),vt(a)])}static Timestamp(t,e,i,n,a,r){return new bi(t,e,i,n,[void 0,mt(t.ArrayType,r),vt(a)])}static Interval(t,e,i,n,a,r){return new bi(t,e,i,n,[void 0,mt(t.ArrayType,r),vt(a)])}static FixedSizeBinary(t,e,i,n,a,r){return new bi(t,e,i,n,[void 0,mt(t.ArrayType,r),vt(a)])}static Binary(t,e,i,n,a,r,s){return new bi(t,e,i,n,[xt(r),vt(s),vt(a)])}static Utf8(t,e,i,n,a,r,s){return new bi(t,e,i,n,[xt(r),vt(s),vt(a)])}static List(t,e,i,n,a,r,s){return new bi(t,e,i,n,[xt(r),void 0,vt(a)],[s])}static FixedSizeList(t,e,i,n,a,r){return new bi(t,e,i,n,[void 0,void 0,vt(a)],[r])}static Struct(t,e,i,n,a,r){return new bi(t,e,i,n,[void 0,void 0,vt(a)],r)}static Map(t,e,i,n,a,r,s){return new bi(t,e,i,n,[xt(r),void 0,vt(a)],[s])}static Union(t,e,i,n,a,r,s,o){const l=[void 0,void 0,vt(a),mt(t.ArrayType,r)];return t.mode===ue.Sparse?new bi(t,e,i,n,l,s):(l[oe.OFFSET]=xt(s),new bi(t,e,i,n,l,o))}}bi.prototype.childData=Object.freeze([]);function vi(t){if(null===t)return"null";if(void 0===t)return"undefined";switch(typeof t){case"number":case"bigint":return"".concat(t);case"string":return'"'.concat(t,'"')}return"function"===typeof t[Symbol.toPrimitive]?t[Symbol.toPrimitive]("string"):ArrayBuffer.isView(t)?"[".concat(t,"]"):JSON.stringify(t)}function wi(t){if(!t||t.length<=0)return function(t){return!0};let e="",i=t.filter(t=>t===t);return i.length>0&&(e="\n switch (x) {".concat(i.map(t=>"\n case ".concat(function(t){if("bigint"!==typeof t)return vi(t);if(q)return"".concat(vi(t),"n");return'"'.concat(vi(t),'"')}(t),":")).join(""),"\n return false;\n }")),t.length!==i.length&&(e="if (x !== x) return false;\n".concat(e)),new Function("x","".concat(e,"\nreturn true;"))}const _i=(t,e)=>(t*e+63&-64||64)/e;class ki{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.buffer=t,this.stride=e,this.BYTES_PER_ELEMENT=t.BYTES_PER_ELEMENT,this.ArrayType=t.constructor,this._resize(this.length=t.length/e|0)}get byteLength(){return this.length*this.stride*this.BYTES_PER_ELEMENT|0}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(t,e){return this}append(t){return this.set(this.length,t)}reserve(t){if(t>0){this.length+=t;const e=this.stride,i=this.length*e,n=this.buffer.length;i>=n&&this._resize(_i(0===n?1*i:2*i,this.BYTES_PER_ELEMENT))}return this}flush(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.length;t=_i(t*this.stride,this.BYTES_PER_ELEMENT);const e=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.length>=e?t.subarray(0,e):pt(new t.constructor(e),t,0)}(this.buffer,t);return this.clear(),e}clear(){return this.length=0,this._resize(0),this}_resize(t){return this.buffer=pt(new this.ArrayType(t),this.buffer)}}ki.prototype.offset=0;class Ti extends ki{last(){return this.get(this.length-1)}get(t){return this.buffer[t]}set(t,e){return this.reserve(t-this.length+1),this.buffer[t*this.stride]=e,this}}class Mi extends Ti{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Uint8Array(0),1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(t){return this.buffer[t>>3]>>t%8&1}set(t,e){const{buffer:i}=this.reserve(t-this.length+1),n=t>>3,a=t%8,r=i[n]>>a&1;return e?0===r&&(i[n]|=1<0&&void 0!==arguments[0]?arguments[0]:new Int32Array(1),1)}append(t){return this.set(this.length-1,t)}set(t,e){const i=this.length-1,n=this.reserve(t-i+1).buffer;return i0&&void 0!==arguments[0]?arguments[0]:this.length-1;return t>this.length&&this.set(t-1,0),super.flush(t+1)}}class Ci extends ki{get ArrayType64(){return this._ArrayType64||(this._ArrayType64=this.buffer instanceof Int32Array?G:J)}set(t,e){switch(this.reserve(t-this.length+1),typeof e){case"bigint":this.buffer64[t]=e;break;case"number":this.buffer[t*this.stride]=e;break;default:this.buffer.set(e,t*this.stride)}return this}_resize(t){const e=super._resize(t),i=e.byteLength/(this.BYTES_PER_ELEMENT*this.stride);return q&&(this.buffer64=new this.ArrayType64(e.buffer,e.byteOffset,i)),e}}class Pi{constructor(t){let{type:e,nullValues:i}=t;this.length=0,this.finished=!1,this.type=e,this.children=[],this.nullValues=i,this.stride=xi(e),this._nulls=new Mi,i&&i.length>0&&(this._isValid=wi(i))}static new(t){}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t){throw new Error('"throughDOM" not available in this environment')}static throughIterable(t){return function(t){const{queueingStrategy:e="count"}=t,{highWaterMark:i=("bytes"!==e?1e3:16384)}=t,n="bytes"!==e?"length":"byteLength";return function*(e){let a=0,r=Pi.new(t);for(const t of e)r.append(t)[n]>=i&&++a&&(yield r.toVector());(r.finish().length>0||0===a)&&(yield r.toVector())}}(t)}static throughAsyncIterable(t){return function(t){const{queueingStrategy:e="count"}=t,{highWaterMark:i=("bytes"!==e?1e3:16384)}=t,n="bytes"!==e?"length":"byteLength";return async function*(e){let a=0,r=Pi.new(t);for await(const t of e)r.append(t)[n]>=i&&++a&&(yield r.toVector());(r.finish().length>0||0===a)&&(yield r.toVector())}}(t)}toVector(){return te.new(this.flush())}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let t=0;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),this._typeIds&&(t+=this._typeIds.byteLength),this.children.reduce((t,e)=>t+e.byteLength,t)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let t=0;return this._offsets&&(t+=this._offsets.reservedByteLength),this._values&&(t+=this._values.reservedByteLength),this._nulls&&(t+=this._nulls.reservedByteLength),this._typeIds&&(t+=this._typeIds.reservedByteLength),this.children.reduce((t,e)=>t+e.reservedByteLength,t)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(t){return this.set(this.length,t)}isValid(t){return this._isValid(t)}set(t,e){return this.setValid(t,this.isValid(e))&&this.setValue(t,e),this}setValue(t,e){this._setValue(this,t,e)}setValid(t,e){return this.length=this._nulls.set(t,+e).length,e}addChild(t){arguments.length>1&&void 0!==arguments[1]||"".concat(this.numChildren);throw new Error('Cannot append children to non-nested type "'.concat(this.type,'"'))}getChildAt(t){return this.children[t]||null}flush(){const t=[],e=this._values,i=this._offsets,n=this._typeIds,{length:a,nullCount:r}=this;n?(t[oe.TYPE]=n.flush(a),i&&(t[oe.OFFSET]=i.flush(a))):i?(e&&(t[oe.DATA]=e.flush(i.last())),t[oe.OFFSET]=i.flush(a)):e&&(t[oe.DATA]=e.flush(a)),r>0&&(t[oe.VALIDITY]=this._nulls.flush(a));const s=bi.new(this.type,0,a,r,t,this.children.map(t=>t.flush()));return this.clear(),s}finish(){return this.finished=!0,this.children.forEach(t=>t.finish()),this}clear(){return this.length=0,this._offsets&&this._offsets.clear(),this._values&&this._values.clear(),this._nulls&&this._nulls.clear(),this._typeIds&&this._typeIds.clear(),this.children.forEach(t=>t.clear()),this}}Pi.prototype.length=1,Pi.prototype.stride=1,Pi.prototype.children=null,Pi.prototype.finished=!1,Pi.prototype.nullValues=null,Pi.prototype._isValid=()=>!0;class Ai extends Pi{constructor(t){super(t),this._values=new Ti(new this.ArrayType(0),this.stride)}setValue(t,e){const i=this._values;return i.reserve(t-i.length+1),super.setValue(t,e)}}class Bi extends Pi{constructor(t){super(t),this._pendingLength=0,this._offsets=new Si}setValue(t,e){const i=this._pending||(this._pending=new Map),n=i.get(t);n&&(this._pendingLength-=n.length),this._pendingLength+=e.length,i.set(t,e)}setValid(t,e){return!!super.setValid(t,e)||((this._pending||(this._pending=new Map)).set(t,void 0),!1)}clear(){return this._pendingLength=0,this._pending=void 0,super.clear()}flush(){return this._flush(),super.flush()}finish(){return this._flush(),super.finish()}_flush(){const t=this._pending,e=this._pendingLength;return this._pendingLength=0,this._pending=void 0,t&&t.size>0&&this._flushPending(t,e),this}}class Ii extends Pi{constructor(t){super(t),this._values=new Mi}setValue(t,e){this._values.set(t,+e)}}class Fi extends Pi{setValue(t,e){}setValid(t,e){return this.length=Math.max(t+1,this.length),e}}class Di extends Ai{}class Li extends Di{}class Ei extends Di{}class Oi extends Ai{}class Vi extends Pi{constructor(t){let{type:e,nullValues:i,dictionaryHashFunction:n}=t;super({type:new yi(e.dictionary,e.indices,e.id,e.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=Pi.new({type:this.type.indices,nullValues:i}),this.dictionary=Pi.new({type:this.type.dictionary,nullValues:null}),"function"===typeof n&&(this.valueToKey=n)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(t){return this.indices.isValid(t)}setValid(t,e){const i=this.indices;return e=i.setValid(t,e),this.length=i.length,e}setValue(t,e){let i=this._keysToIndices,n=this.valueToKey(e),a=i[n];return void 0===a&&(i[n]=a=this._dictionaryOffset+this.dictionary.append(e).length-1),this.indices.setValue(t,a)}flush(){const t=this.type,e=this._dictionary,i=this.dictionary.toVector(),n=this.indices.flush().clone(t);return n.dictionary=e?e.concat(i):i,this.finished||(this._dictionaryOffset+=i.length),this._dictionary=n.dictionary,this.clear(),n}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(t){return"string"===typeof t?t:"".concat(t)}}class zi extends Ai{}const Ni=new Float64Array(1),Wi=new Uint32Array(Ni.buffer);function Yi(t){let e=(31744&t)>>10,i=(1023&t)/1024,n=(-1)**((32768&t)>>15);switch(e){case 31:return n*(i?NaN:1/0);case 0:return n*(i?6103515625e-14*i:0)}return n*2**(e-15)*(1+i)}function Ri(t){if(t!==t)return 32256;Ni[0]=t;let e=(2147483648&Wi[1])>>16&65535,i=2146435072&Wi[1],n=0;return i>=1089470464?Wi[0]>0?i=31744:(i=(2080374784&i)>>16,n=(1048575&Wi[1])>>10):i<=1056964608?(n=1048576+(1048575&Wi[1]),n=1048576+(n<<(i>>20)-998)>>21,i=0):(i=i-1056964608>>10,n=512+(1048575&Wi[1])>>10),e|i|65535&n}class Ui extends Ai{}class Xi extends Ui{setValue(t,e){this._values.set(t,Ri(e))}}class ji extends Ui{setValue(t,e){this._values.set(t,e)}}class Hi extends Ui{setValue(t,e){this._values.set(t,e)}}const qi=Symbol.for("isArrowBigNum");function Gi(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n>>=0),l+=(i>>>0)+e*h**32;return l}let Zi,tn;function en(t){let e="",i=new Uint32Array(2),n=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),a=new Uint32Array((n=new Uint16Array(n).reverse()).buffer),r=-1,s=n.length-1;do{for(i[0]=n[r=0];r0&&void 0!==arguments[0]?arguments[0]:"default";switch(t){case"number":return Qi(this);case"string":return Zi(this);case"default":return tn(this)}return Zi(this)},Object.setPrototypeOf(Ki.prototype,Object.create(Int32Array.prototype)),Object.setPrototypeOf(Ji.prototype,Object.create(Uint32Array.prototype)),Object.setPrototypeOf($i.prototype,Object.create(Uint32Array.prototype)),Object.assign(Ki.prototype,Gi.prototype,{constructor:Ki,signed:!0,TypedArray:Int32Array,BigIntArray:G}),Object.assign(Ji.prototype,Gi.prototype,{constructor:Ji,signed:!1,TypedArray:Uint32Array,BigIntArray:J}),Object.assign($i.prototype,Gi.prototype,{constructor:$i,signed:!0,TypedArray:Uint32Array,BigIntArray:J}),q?(tn=t=>8===t.byteLength?new t.BigIntArray(t.buffer,t.byteOffset,1)[0]:en(t),Zi=t=>8===t.byteLength?"".concat(new t.BigIntArray(t.buffer,t.byteOffset,1)[0]):en(t)):(Zi=en,tn=Zi);class nn{constructor(t,e){return nn.new(t,e)}static new(t,e){switch(e){case!0:return new Ki(t);case!1:return new Ji(t)}switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:case G:return new Ki(t)}return 16===t.byteLength?new $i(t):new Ji(t)}static signed(t){return new Ki(t)}static unsigned(t){return new Ji(t)}static decimal(t){return new $i(t)}}class an extends Ai{setValue(t,e){this._values.set(t,e)}}class rn extends an{}class sn extends an{}class on extends an{}class ln extends an{constructor(t){t.nullValues&&(t.nullValues=t.nullValues.map(pn)),super(t),this._values=new Ci(new Int32Array(0),2)}get values64(){return this._values.buffer64}isValid(t){return super.isValid(pn(t))}}class hn extends an{}class cn extends an{}class un extends an{}class dn extends an{constructor(t){t.nullValues&&(t.nullValues=t.nullValues.map(pn)),super(t),this._values=new Ci(new Uint32Array(0),2)}get values64(){return this._values.buffer64}isValid(t){return super.isValid(pn(t))}}const pn=(fn={BigIntArray:G},t=>(ArrayBuffer.isView(t)&&(fn.buffer=t.buffer,fn.byteOffset=t.byteOffset,fn.byteLength=t.byteLength,t=tn(fn),fn.buffer=null),t));var fn;class mn extends Ai{}class gn extends mn{}class yn extends mn{}class xn extends mn{}class bn extends mn{}class vn extends Ai{}class wn extends vn{}class _n extends vn{}class kn extends vn{}class Tn extends vn{}class Mn extends Ai{}class Sn extends Mn{}class Cn extends Mn{}class Pn extends Bi{constructor(t){super(t),this._values=new ki(new Uint8Array(0))}get byteLength(){let t=this._pendingLength+4*this.length;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,e){return super.setValue(t,vt(e))}_flushPending(t,e){const i=this._offsets,n=this._values.reserve(e).buffer;let a,r=0,s=0,o=0;for([r,a]of t)void 0===a?i.set(r,0):(s=a.length,n.set(a,o),i.set(r,s),o+=s)}}class An extends Bi{constructor(t){super(t),this._values=new ki(new Uint8Array(0))}get byteLength(){let t=this._pendingLength+4*this.length;return this._offsets&&(t+=this._offsets.byteLength),this._values&&(t+=this._values.byteLength),this._nulls&&(t+=this._nulls.byteLength),t}setValue(t,e){return super.setValue(t,Y(e))}_flushPending(t,e){}}An.prototype._flushPending=Pn.prototype._flushPending;class Bn{get length(){return this._values.length}get(t){return this._values[t]}clear(){return this._values=null,this}bind(t){return t instanceof te?t:(this._values=t,this)}}const In=Symbol.for("parent"),Fn=Symbol.for("rowIndex"),Dn=Symbol.for("keyToIdx"),Ln=Symbol.for("idxToVal"),En=Symbol.for("nodejs.util.inspect.custom");class On{constructor(t,e){this[In]=t,this.size=e}entries(){return this[Symbol.iterator]()}has(t){return void 0!==this.get(t)}get(t){let e=void 0;if(null!==t&&void 0!==t){const i=this[Dn]||(this[Dn]=new Map);let n=i.get(t);if(void 0!==n){const t=this[Ln]||(this[Ln]=new Array(this.size));void 0!==(e=t[n])||(t[n]=e=this.getValue(n))}else if((n=this.getIndex(t))>-1){i.set(t,n);const a=this[Ln]||(this[Ln]=new Array(this.size));void 0!==(e=a[n])||(a[n]=e=this.getValue(n))}}return e}set(t,e){if(null!==t&&void 0!==t){const i=this[Dn]||(this[Dn]=new Map);let n=i.get(t);if(void 0===n&&i.set(t,n=this.getIndex(t)),n>-1){(this[Ln]||(this[Ln]=new Array(this.size)))[n]=this.setValue(n,e)}}return this}clear(){throw new Error("Clearing ".concat(this[Symbol.toStringTag]," not supported."))}delete(t){throw new Error("Deleting ".concat(this[Symbol.toStringTag]," values not supported."))}*[Symbol.iterator](){const t=this.keys(),e=this.values(),i=this[Dn]||(this[Dn]=new Map),n=this[Ln]||(this[Ln]=new Array(this.size));for(let a,r,s,o,l=0;!(s=t.next()).done&&!(o=e.next()).done;++l)a=s.value,r=o.value,n[l]=r,i.has(a)||i.set(a,l),yield[a,r]}forEach(t,e){const i=this.keys(),n=this.values(),a=void 0===e?t:(i,n,a)=>t.call(e,i,n,a),r=this[Dn]||(this[Dn]=new Map),s=this[Ln]||(this[Ln]=new Array(this.size));for(let o,l,h,c,u=0;!(h=i.next()).done&&!(c=n.next()).done;++u)o=h.value,l=c.value,s[u]=l,r.has(o)||r.set(o,u),a(l,o,this)}toArray(){return[...this.values()]}toJSON(){const t={};return this.forEach((e,i)=>t[i]=e),t}inspect(){return this.toString()}[En](){return this.toString()}toString(){const t=[];return this.forEach((e,i)=>{i=vi(i),e=vi(e),t.push("".concat(i,": ").concat(e))}),"{ ".concat(t.join(", ")," }")}}On[Symbol.toStringTag]=(t=>(Object.defineProperties(t,{size:{writable:!0,enumerable:!1,configurable:!1,value:0},[In]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Fn]:{writable:!0,enumerable:!1,configurable:!1,value:-1}}),t[Symbol.toStringTag]="Row"))(On.prototype);class Vn extends On{constructor(t){return super(t,t.length),Wn(this)}keys(){return this[In].getChildAt(0)[Symbol.iterator]()}values(){return this[In].getChildAt(1)[Symbol.iterator]()}getKey(t){return this[In].getChildAt(0).get(t)}getIndex(t){return this[In].getChildAt(0).indexOf(t)}getValue(t){return this[In].getChildAt(1).get(t)}setValue(t,e){this[In].getChildAt(1).set(t,e)}}class zn extends On{constructor(t){return super(t,t.type.children.length),Nn(this)}*keys(){for(const t of this[In].type.children)yield t.name}*values(){for(const t of this[In].type.children)yield this[t.name]}getKey(t){return this[In].type.children[t].name}getIndex(t){return this[In].type.children.findIndex(e=>e.name===t)}getValue(t){return this[In].getChildAt(t).get(this[Fn])}setValue(t,e){return this[In].getChildAt(t).set(this[Fn],e)}}Object.setPrototypeOf(On.prototype,Map.prototype);const Nn=(()=>{const t={enumerable:!0,configurable:!1,get:null,set:null};return e=>{let i=-1,n=e[Dn]||(e[Dn]=new Map);const a=t=>function(){return this.get(t)},r=t=>function(e){return this.set(t,e)};for(const s of e.keys())n.set(s,++i),t.get=a(s),t.set=r(s),e.hasOwnProperty(s)||(t.enumerable=!0,Object.defineProperty(e,s,t)),e.hasOwnProperty(i)||(t.enumerable=!1,Object.defineProperty(e,i,t));return t.get=t.set=null,e}})(),Wn=(()=>{if("undefined"===typeof Proxy)return Nn;const t=On.prototype.has,e=On.prototype.get,i=On.prototype.set,n=On.prototype.getKey,a={isExtensible:()=>!1,deleteProperty:()=>!1,preventExtensions:()=>!0,ownKeys:t=>[...t.keys()].map(t=>"".concat(t)),has(t,e){switch(e){case"getKey":case"getIndex":case"getValue":case"setValue":case"toArray":case"toJSON":case"inspect":case"constructor":case"isPrototypeOf":case"propertyIsEnumerable":case"toString":case"toLocaleString":case"valueOf":case"size":case"has":case"get":case"set":case"clear":case"delete":case"keys":case"values":case"entries":case"forEach":case"__proto__":case"__defineGetter__":case"__defineSetter__":case"hasOwnProperty":case"__lookupGetter__":case"__lookupSetter__":case Symbol.iterator:case Symbol.toStringTag:case In:case Fn:case Ln:case Dn:case En:return!0}return"number"!==typeof e||t.has(e)||(e=t.getKey(e)),t.has(e)},get(i,a,r){switch(a){case"getKey":case"getIndex":case"getValue":case"setValue":case"toArray":case"toJSON":case"inspect":case"constructor":case"isPrototypeOf":case"propertyIsEnumerable":case"toString":case"toLocaleString":case"valueOf":case"size":case"has":case"get":case"set":case"clear":case"delete":case"keys":case"values":case"entries":case"forEach":case"__proto__":case"__defineGetter__":case"__defineSetter__":case"hasOwnProperty":case"__lookupGetter__":case"__lookupSetter__":case Symbol.iterator:case Symbol.toStringTag:case In:case Fn:case Ln:case Dn:case En:return Reflect.get(i,a,r)}return"number"!==typeof a||t.call(r,a)||(a=n.call(r,a)),e.call(r,a)},set(e,a,r,s){switch(a){case In:case Fn:case Ln:case Dn:return Reflect.set(e,a,r,s);case"getKey":case"getIndex":case"getValue":case"setValue":case"toArray":case"toJSON":case"inspect":case"constructor":case"isPrototypeOf":case"propertyIsEnumerable":case"toString":case"toLocaleString":case"valueOf":case"size":case"has":case"get":case"set":case"clear":case"delete":case"keys":case"values":case"entries":case"forEach":case"__proto__":case"__defineGetter__":case"__defineSetter__":case"hasOwnProperty":case"__lookupGetter__":case"__lookupSetter__":case Symbol.iterator:case Symbol.toStringTag:return!1}return"number"!==typeof a||t.call(s,a)||(a=n.call(s,a)),!!t.call(s,a)&&!!i.call(s,a,r)}};return t=>new Proxy(t,a)})();function Yn(t,e,i){const n=t.length,a=e>-1?e:n+e%n;return i?i(t,a):a}let Rn;function Un(t,e,i,n){let{length:a=0}=t,r="number"!==typeof e?0:e,s="number"!==typeof i?a:i;return r<0&&(r=(r%a+a)%a),s<0&&(s=(s%a+a)%a),sa&&(s=a),n?n(t,r,s):[r,s]}const Xn=q?H(0):0,jn=t=>t!==t;function Hn(t){let e=typeof t;if("object"!==e||null===t)return jn(t)?jn:"bigint"!==e?e=>e===t:e=>Xn+e===t;if(t instanceof Date){const e=t.valueOf();return t=>t instanceof Date&&t.valueOf()===e}return ArrayBuffer.isView(t)?e=>!!e&&Kt(t,e):t instanceof Map?function(t){let e=-1;const i=[];return t.forEach(t=>i[++e]=Hn(t)),qn(i)}(t):Array.isArray(t)?function(t){const e=[];for(let i=-1,n=t.length;++i!1;const i=[];for(let n=-1,a=e.length;++n{if(!i||"object"!==typeof i)return!1;switch(i.constructor){case Array:return function(t,e){const i=t.length;if(e.length!==i)return!1;for(let n=-1;++n1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(t){let e=new Uint32Array((t||[]).length+1),i=e[0]=0,n=e.length;for(let a=0;++a")}get data(){return this._chunks[0]?this._chunks[0].data:null}get ArrayType(){return this._type.ArrayType}get numChildren(){return this._numChildren}get stride(){return this._chunks[0]?this._chunks[0].stride:1}get byteLength(){return this._chunks.reduce((t,e)=>t+e.byteLength,0)}get nullCount(){let t=this._nullCount;return t<0&&(this._nullCount=t=this._chunks.reduce((t,e)=>{let{nullCount:i}=e;return t+i},0)),t}get indices(){if(Ve.isDictionary(this._type)){if(!this._indices){const t=this._chunks;this._indices=1===t.length?t[0].indices:Kn.concat(...t.map(t=>t.indices))}return this._indices}return null}get dictionary(){return Ve.isDictionary(this._type)?this._chunks[this._chunks.length-1].data.dictionary:null}*[Symbol.iterator](){for(const t of this._chunks)yield*t}clone(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._chunks;return new Kn(this._type,t)}concat(){for(var t=arguments.length,e=new Array(t),i=0;i=this._numChildren)return null;let e,i,n,a=this._children||(this._children=[]);return(e=a[t])?e:(i=(this._type.children||[])[t])&&(n=this._chunks.map(e=>e.getChildAt(t)).filter(t=>null!=t),n.length>0)?a[t]=new Kn(i.type,n):null}search(t,e){let i=t,n=this._chunkOffsets,a=n.length-1;if(i<0)return null;if(i>=n[a])return null;if(a<=1)return e?e(this,0,i):[0,i];let r=0,s=0,o=0;do{if(r+1===a)return e?e(this,r,i-s):[r,i-s];o=r+(a-r)/2|0,i>=n[o]?r=o:a=o}while(i=(s=n[r]));return null}isValid(t){return!!this.search(t,this.isValidInternal)}get(t){return this.search(t,this.getInternal)}set(t,e){this.search(t,(t,i,n)=>{let{chunks:a}=t;return a[i].set(n,e)})}indexOf(t,e){return e&&"number"===typeof e?this.search(e,(e,i,n)=>this.indexOfInternal(e,i,n,t)):this.indexOfInternal(this,0,Math.max(0,e||0),t)}toArray(){const{chunks:t}=this,e=t.length;let i=this._type.ArrayType;if(e<=0)return new i(0);if(e<=1)return t[0].toArray();let n=0,a=new Array(e);for(let o=-1;++o=i)break;if(e>=l+o)continue;if(l>=e&&l+o<=i){n.push(t);continue}const h=Math.max(0,e-l),c=Math.min(i-l,o);n.push(t.slice(h,c))}return t.clone(n)}}const Jn=(t,e,i)=>(e.set(t,i),i+t.length),$n=(t,e,i)=>{let n=i;for(let a=-1,r=t.length;++a1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;if(e=Kn.flatten(...e),super(t.type,e,i),this._field=t,1===e.length&&!(this instanceof Zn))return new Zn(t,e[0],this._chunkOffsets)}static new(t,e){for(var i=arguments.length,n=new Array(i>2?i-2:0),a=2;a{let{nullCount:e}=t;return e>0})&&(t=t.clone({nullable:!0}));return new Qn(t,r)}get field(){return this._field}get name(){return this._field.name}get nullable(){return this._field.nullable}get metadata(){return this._field.metadata}clone(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._chunks;return new Qn(this._field,t)}getChildAt(t){if(t<0||t>=this.numChildren)return null;let e,i,n,a=this._children||(this._children=[]);return(e=a[t])?e:(i=(this.type.children||[])[t])&&(n=this._chunks.map(e=>e.getChildAt(t)).filter(t=>null!=t),n.length>0)?a[t]=new Qn(i,n):null}}class Zn extends Qn{constructor(t,e,i){super(t,[e],i),this._chunk=e}search(t,e){return e?e(this,0,t):[0,t]}isValid(t){return this._chunk.isValid(t)}get(t){return this._chunk.get(t)}set(t,e){this._chunk.set(t,e)}indexOf(t,e){return this._chunk.indexOf(t,e)}}const ta=Array.isArray,ea=(t,e)=>ra(t,e,[],0),ia=t=>oa(t,[[],[]]),na=(t,e)=>function t(e,i,n,a){let r,s=a,o=-1,l=i.length;for(;++ofunction t(e,i,n,a){let r,s=a,o=-1,l=i.length;for(;++or.getChildAt(e)),n,s).length:r instanceof te&&(n[s++]=r);return n}(t,e,[],0);function ra(t,e,i,n){let a,r=n,s=-1,o=e.length;for(;++s{let[n,a]=e;return t[0][i]=n,t[1][i]=a,t};function oa(t,e){let i,n;switch(n=t.length){case 0:return e;case 1:if(i=e[0],!t[0])return e;if(ta(t[0]))return oa(t[0],e);t[0]instanceof bi||t[0]instanceof te||t[0]instanceof Ve||([i,t]=Object.entries(t[0]).reduce(sa,e));break;default:ta(i=t[n-1])?t=ta(t[0])?t[0]:t.slice(0,n-1):(t=ta(t[0])?t[0]:t,i=[])}let a,r,s=-1,o=-1,l=-1,h=t.length,[c,u]=e;for(;++l0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;this.fields=t||[],this.metadata=e||new Map,i||(i=ua(t)),this.dictionaries=i}static from(){return la.new(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1])}static new(){for(var t=arguments.length,e=new Array(t),i=0;i"".concat(e,": ").concat(t)).join(", ")," }>")}compareTo(t){return Oe.compareSchemas(this,t)}select(){for(var t=arguments.length,e=new Array(t),i=0;i(t[e]=!0)&&t,Object.create(null));return new la(this.fields.filter(t=>n[t.name]),this.metadata)}selectAt(){for(var t=arguments.length,e=new Array(t),i=0;ithis.fields[t]).filter(Boolean),this.metadata)}assign(){for(var t=arguments.length,e=new Array(t),i=0;i{const e=a.findIndex(e=>e.name===t.name);return!~e||(a[e]=t.clone({metadata:ca(ca(new Map,a[e].metadata),t.metadata)}))&&!1}),o=ua(s,new Map);return new la([...a,...s],r,new Map([...this.dictionaries,...o]))}}class ha{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3?arguments[3]:void 0;this.name=t,this.type=e,this.nullable=i,this.metadata=n||new Map}static new(){for(var t=arguments.length,e=new Array(t),i=0;i1&&void 0!==arguments[1]?arguments[1]:new Map;for(let i=-1,n=t.length;++i0&&ua(n.children,e)}return e}la.prototype.fields=null,la.prototype.metadata=null,la.prototype.dictionaries=null,ha.prototype.type=null,ha.prototype.name=null,ha.prototype.nullable=null,ha.prototype.metadata=null;class da extends Bi{constructor(t){super(t),this._run=new Bn,this._offsets=new Si}addChild(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new hi(new ha(e,t.type,!0)),this.numChildren-1}clear(){return this._run.clear(),super.clear()}_flushPending(t){const e=this._run,i=this._offsets,n=this._setValue;let a,r=0;for([r,a]of t)void 0===a?i.set(r,0):(i.set(r,a.length),n(this,r,e.bind(a)))}}class pa extends Pi{constructor(){super(...arguments),this._run=new Bn}setValue(t,e){super.setValue(t,this._run.bind(e))}addChild(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");const i=this.children.push(t);return this.type=new pi(this.type.listSize,new ha(e,t.type,!0)),i}clear(){return this._run.clear(),super.clear()}}class fa extends Bi{set(t,e){return super.set(t,e)}setValue(t,e){e=e instanceof Map?e:new Map(Object.entries(e));const i=this._pending||(this._pending=new Map),n=i.get(t);n&&(this._pendingLength-=n.size),this._pendingLength+=e.size,i.set(t,e)}addChild(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"".concat(this.numChildren);if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=t,this.type=new fi(new ha(e,t.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(t){const e=this._offsets,i=this._setValue;t.forEach((t,n)=>{void 0===t?e.set(n,0):(e.set(n,t.size),i(this,n,t))})}}class ma extends Pi{addChild(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"".concat(this.numChildren);const i=this.children.push(t);return this.type=new ci([...this.type.children,new ha(e,t.type,!0)]),i}}class ga extends Pi{constructor(t){super(t),this._typeIds=new Ti(new Int8Array(0),1),"function"===typeof t.valueToChildTypeId&&(this._valueToChildTypeId=t.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(t,e){return this.set(this.length,t,e)}set(t,e,i){return void 0===i&&(i=this._valueToChildTypeId(this,e,t)),this.setValid(t,this.isValid(e))&&this.setValue(t,e,i),this}setValue(t,e,i){this._typeIds.set(t,i),super.setValue(t,e)}addChild(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"".concat(this.children.length);const i=this.children.push(t),{type:{children:n,mode:a,typeIds:r}}=this,s=[...n,new ha(e,t.type)];return this.type=new ui(a,[...r,i],s),i}_valueToChildTypeId(t,e,i){throw new Error("Cannot map UnionBuilder value to child typeId. Pass the `childTypeId` as the second argument to unionBuilder.append(), or supply a `valueToChildTypeId` function as part of the UnionBuilder constructor options.")}}class ya extends ga{}class xa extends ga{constructor(t){super(t),this._offsets=new Ti(new Int32Array(0))}setValue(t,e,i){const n=this.type.typeIdToChildIndex[i];return this._offsets.set(t,this.getChildAt(n).length),super.setValue(t,e,i)}}class ba extends Te{}const va=(t,e,i)=>{t[e]=i%4294967296|0,t[e+1]=i/4294967296|0},wa=(t,e,i,n)=>{const{[i]:a,[i+1]:r}=e;null!=a&&null!=r&&t.set(n.subarray(0,r-a),a)},_a=(t,e,i)=>{let{values:n}=t;((t,e,i)=>{t[e]=i/864e5|0})(n,e,i.valueOf())},ka=(t,e,i)=>{let{values:n}=t;va(n,2*e,i.valueOf())},Ta=(t,e,i)=>{let{stride:n,values:a}=t;a[n*e]=i},Ma=(t,e,i)=>{let{stride:n,values:a}=t;a[n*e]=Ri(i)},Sa=(t,e,i)=>{switch(typeof i){case"bigint":t.values64[e]=i;break;case"number":t.values[e*t.stride]=i;break;default:const n=i,{stride:a,ArrayType:r}=t,s=mt(r,n);t.values.set(s.subarray(0,a),a*e)}},Ca=(t,e,i)=>{let{values:n}=t;return va(n,2*e,i/1e3)},Pa=(t,e,i)=>{let{values:n}=t;return va(n,2*e,i)},Aa=(t,e,i)=>{let{values:n}=t;return((t,e,i)=>{t[e]=1e3*i%4294967296|0,t[e+1]=1e3*i/4294967296|0})(n,2*e,i)},Ba=(t,e,i)=>{let{values:n}=t;return((t,e,i)=>{t[e]=1e6*i%4294967296|0,t[e+1]=1e6*i/4294967296|0})(n,2*e,i)},Ia=(t,e,i)=>{let{values:n,stride:a}=t;n[a*e]=i},Fa=(t,e,i)=>{let{values:n,stride:a}=t;n[a*e]=i},Da=(t,e,i)=>{let{values:n}=t;n.set(i.subarray(0,2),2*e)},La=(t,e,i)=>{let{values:n}=t;n.set(i.subarray(0,2),2*e)},Ea=(t,e,i)=>{const n=t.typeIdToChildIndex[t.typeIds[e]],a=t.getChildAt(n);a&&a.set(t.valueOffsets[e],i)},Oa=(t,e,i)=>{const n=t.typeIdToChildIndex[t.typeIds[e]],a=t.getChildAt(n);a&&a.set(e,i)},Va=(t,e,i)=>{let{values:n}=t;n.set(i.subarray(0,2),2*e)},za=(t,e,i)=>{let{values:n}=t;n[e]=12*i[0]+i[1]%12};ba.prototype.visitBool=(t,e,i)=>{let{offset:n,values:a}=t;const r=n+e;i?a[r>>3]|=1<>3]&=~(1<{t.type.bitWidth<64?Ta(t,e,i):Sa(t,e,i)},ba.prototype.visitInt8=Ta,ba.prototype.visitInt16=Ta,ba.prototype.visitInt32=Ta,ba.prototype.visitInt64=Sa,ba.prototype.visitUint8=Ta,ba.prototype.visitUint16=Ta,ba.prototype.visitUint32=Ta,ba.prototype.visitUint64=Sa,ba.prototype.visitFloat=(t,e,i)=>{t.type.precision!==ce.HALF?Ta(t,e,i):Ma(t,e,i)},ba.prototype.visitFloat16=Ma,ba.prototype.visitFloat32=Ta,ba.prototype.visitFloat64=Ta,ba.prototype.visitUtf8=(t,e,i)=>{let{values:n,valueOffsets:a}=t;wa(n,a,e,Y(i))},ba.prototype.visitBinary=(t,e,i)=>{let{values:n,valueOffsets:a}=t;return wa(n,a,e,i)},ba.prototype.visitFixedSizeBinary=(t,e,i)=>{let{stride:n,values:a}=t;a.set(i.subarray(0,n),n*e)},ba.prototype.visitDate=(t,e,i)=>{t.type.unit===le.DAY?_a(t,e,i):ka(t,e,i)},ba.prototype.visitDateDay=_a,ba.prototype.visitDateMillisecond=ka,ba.prototype.visitTimestamp=(t,e,i)=>{switch(t.type.unit){case he.SECOND:return Ca(t,e,i);case he.MILLISECOND:return Pa(t,e,i);case he.MICROSECOND:return Aa(t,e,i);case he.NANOSECOND:return Ba(t,e,i)}},ba.prototype.visitTimestampSecond=Ca,ba.prototype.visitTimestampMillisecond=Pa,ba.prototype.visitTimestampMicrosecond=Aa,ba.prototype.visitTimestampNanosecond=Ba,ba.prototype.visitTime=(t,e,i)=>{switch(t.type.unit){case he.SECOND:return Ia(t,e,i);case he.MILLISECOND:return Fa(t,e,i);case he.MICROSECOND:return Da(t,e,i);case he.NANOSECOND:return La(t,e,i)}},ba.prototype.visitTimeSecond=Ia,ba.prototype.visitTimeMillisecond=Fa,ba.prototype.visitTimeMicrosecond=Da,ba.prototype.visitTimeNanosecond=La,ba.prototype.visitDecimal=(t,e,i)=>{let{values:n}=t;n.set(i.subarray(0,4),4*e)},ba.prototype.visitList=(t,e,i)=>{const n=t.getChildAt(0),a=t.valueOffsets;for(let r=-1,s=a[e],o=a[e+1];s{const n=i instanceof Map?(a=e,r=i,(t,e,i)=>t&&t.set(a,r.get(e.name))):i instanceof te?((t,e)=>(i,n,a)=>i&&i.set(t,e.get(a)))(e,i):Array.isArray(i)?((t,e)=>(i,n,a)=>i&&i.set(t,e[a]))(e,i):((t,e)=>(i,n,a)=>i&&i.set(t,e[n.name]))(e,i);var a,r;t.type.children.forEach((e,i)=>n(t.getChildAt(i),e,i))},ba.prototype.visitUnion=(t,e,i)=>{t.type.mode===ue.Dense?Ea(t,e,i):Oa(t,e,i)},ba.prototype.visitDenseUnion=Ea,ba.prototype.visitSparseUnion=Oa,ba.prototype.visitDictionary=(t,e,i)=>{const n=t.getKey(e);null!==n&&t.setValue(n,i)},ba.prototype.visitInterval=(t,e,i)=>{t.type.unit===de.DAY_TIME?Va(t,e,i):za(t,e,i)},ba.prototype.visitIntervalDayTime=Va,ba.prototype.visitIntervalYearMonth=za,ba.prototype.visitFixedSizeList=(t,e,i)=>{const n=t.getChildAt(0),{stride:a}=t;for(let r=-1,s=e*a;++r{const n=t.getChildAt(0),a=t.valueOffsets,r=i instanceof Map?[...i]:Object.entries(i);for(let s=-1,o=a[e],l=a[e+1];o0){const a=e.children||[],r={nullValues:e.nullValues},s=Array.isArray(a)?(t,e)=>a[e]||r:t=>{let{name:e}=t;return a[e]||r};i.children.forEach((e,i)=>{const{type:a}=e,r=s(e,i);n.children.push(t({...r,type:a}))})}return n},Object.keys(se).map(t=>se[t]).filter(t=>"number"===typeof t&&t!==se.NONE).forEach(t=>{Wa.visit(t).prototype._setValue=Na.getVisitFn(t)}),An.prototype._setValue=Na.visitBinary,function(t){!function(e){!function(e){!function(e){class i{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFooter(t,e){return(e||new i).__init(t.readInt32(t.position())+t.position(),t)}version(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ee.apache.arrow.flatbuf.MetadataVersion.V1}schema(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new ee.apache.arrow.flatbuf.Schema).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}dictionaries(e,i){let n=this.bb.__offset(this.bb_pos,8);return n?(i||new t.apache.arrow.flatbuf.Block).__init(this.bb.__vector(this.bb_pos+n)+24*e,this.bb):null}dictionariesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(e,i){let n=this.bb.__offset(this.bb_pos,10);return n?(i||new t.apache.arrow.flatbuf.Block).__init(this.bb.__vector(this.bb_pos+n)+24*e,this.bb):null}recordBatchesLength(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}static startFooter(t){t.startObject(4)}static addVersion(t,e){t.addFieldInt16(0,e,ee.apache.arrow.flatbuf.MetadataVersion.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 endFooter(t){return t.endObject()}static finishFooterBuffer(t,e){t.finish(e)}static createFooter(t,e,n,a,r){return i.startFooter(t),i.addVersion(t,e),i.addSchema(t,n),i.addDictionaries(t,a),i.addRecordBatches(t,r),i.endFooter(t)}}e.Footer=i}(e.flatbuf||(e.flatbuf={}))}(e.arrow||(e.arrow={}))}(t.apache||(t.apache={}))}(Ya||(Ya={})),function(t){!function(t){!function(t){!function(t){t.Block=class{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static createBlock(t,e,i,n){return t.prep(8,24),t.writeInt64(n),t.pad(4),t.writeInt32(i),t.writeInt64(e),t.offset()}}}(t.flatbuf||(t.flatbuf={}))}(t.arrow||(t.arrow={}))}(t.apache||(t.apache={}))}(Ya||(Ya={}));var Ra=A.Long,Ua=A.Builder,Xa=A.ByteBuffer,ja=Ya.apache.arrow.flatbuf.Block,Ha=Ya.apache.arrow.flatbuf.Footer;class qa{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fe.V4,i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;this.schema=t,this.version=e,i&&(this._recordBatches=i),n&&(this._dictionaryBatches=n)}static decode(t){t=new Xa(vt(t));const e=Ha.getRootAsFooter(t),i=la.decode(e.schema());return new Ga(i,e)}static encode(t){const e=new Ua,i=la.encode(e,t.schema);Ha.startRecordBatchesVector(e,t.numRecordBatches),[...t.recordBatches()].slice().reverse().forEach(t=>Ka.encode(e,t));const n=e.endVector();Ha.startDictionariesVector(e,t.numDictionaries),[...t.dictionaryBatches()].slice().reverse().forEach(t=>Ka.encode(e,t));const a=e.endVector();return Ha.startFooter(e),Ha.addSchema(e,i),Ha.addVersion(e,fe.V4),Ha.addRecordBatches(e,n),Ha.addDictionaries(e,a),Ha.finishFooterBuffer(e,Ha.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=0&&t=0&&t=0&&t=0&&t0)return super.write(t)}toString(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?W(this.toUint8Array(!0)):this.toUint8Array(!1).then(W)}toUint8Array(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?ft(this._values)[0]:(async()=>{let t=[],e=0;for await(const i of this)t.push(i),e+=i.byteLength;return ft(t,e)[0]})()}}class $a{constructor(t){t&&(this.source=new Za(Jt.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 Qa{constructor(t){t instanceof Qa?this.source=t.source:t instanceof Ja?this.source=new tr(Jt.fromAsyncIterable(t)):ct(t)?this.source=new tr(Jt.fromNodeStream(t)):ht(t)?this.source=new tr(Jt.fromDOMStream(t)):lt(t)?this.source=new tr(Jt.fromDOMStream(t.body)):nt(t)?this.source=new tr(Jt.fromIterable(t)):(it(t)||at(t))&&(this.source=new tr(Jt.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 Za{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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"read";return this.source.next({cmd:e,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||R)}return(t){return Object.create(this.source.return&&this.source.return(t)||R)}}class tr{constructor(t){this.source=t,this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}async cancel(t){await this.return(t)}get closed(){return this._closedPromise}async read(t){return(await this.next(t,"read")).value}async peek(t){return(await this.next(t,"peek")).value}async next(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"read";return await this.source.next({cmd:e,size:t})}async throw(t){const e=this.source.throw&&await this.source.throw(t)||R;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)}async return(t){const e=this.source.return&&await this.source.return(t)||R;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)}}class er extends $a{constructor(t,e){super(),this.position=0,this.buffer=vt(t),this.size="undefined"===typeof e?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=(await t.stat()).size,delete this._pending})()}async readInt32(t){const{buffer:e,byteOffset:i}=await this.readAt(t,4);return new DataView(e,i).getInt32(0,!0)}async seek(t){return this._pending&&await this._pending,this.position=Math.min(t,this.size),t>>16,65535&this.buffer[1],this.buffer[0]>>>16,65535&this.buffer[0]]),i=new Uint32Array([t.buffer[1]>>>16,65535&t.buffer[1],t.buffer[0]>>>16,65535&t.buffer[0]]);let n=e[3]*i[3];this.buffer[0]=65535&n;let a=n>>>16;return n=e[2]*i[3],a+=n,n=e[3]*i[2]>>>0,a+=n,this.buffer[0]+=a<<16,this.buffer[1]=a>>>0>>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>>0&&++this.buffer[1],this.buffer[0]=e}lessThan(t){return this.buffer[1]1&&void 0!==arguments[1]?arguments[1]:new Uint32Array(2);return sr.fromString("string"===typeof t?t:t.toString(),e)}static fromNumber(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Uint32Array(2);return sr.fromString(t.toString(),e)}static fromString(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Uint32Array(2);const i=t.length;let n=new sr(e);for(let a=0;a1&&void 0!==arguments[1]?arguments[1]:new Uint32Array(2);return or.fromString("string"===typeof t?t:t.toString(),e)}static fromNumber(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Uint32Array(2);return or.fromString(t.toString(),e)}static fromString(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Uint32Array(2);const i=t.startsWith("-"),n=t.length;let a=new or(e);for(let r=i?1:0;r>>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]>>0&&++e[1],e[1]>>0&&++e[2],e[2]>>0&&++e[3],this.buffer[3]=e[3],this.buffer[2]=e[2],this.buffer[1]=e[1],this.buffer[0]=e[0],this}hex(){return"".concat(nr(this.buffer[3])," ").concat(nr(this.buffer[2])," ").concat(nr(this.buffer[1])," ").concat(nr(this.buffer[0]))}static multiply(t,e){return new lr(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new lr(new Uint32Array(t.buffer)).plus(e)}static from(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Uint32Array(4);return lr.fromString("string"===typeof t?t:t.toString(),e)}static fromNumber(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Uint32Array(4);return lr.fromString(t.toString(),e)}static fromString(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Uint32Array(4);const i=t.startsWith("-"),n=t.length;let a=new lr(e);for(let r=i?1:0;r1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return bi.Null(t,0,e)}visitBool(t){let{length:e,nullCount:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return bi.Bool(t,0,e,i,this.readNullBitmap(t,i),this.readData(t))}visitInt(t){let{length:e,nullCount:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return bi.Int(t,0,e,i,this.readNullBitmap(t,i),this.readData(t))}visitFloat(t){let{length:e,nullCount:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return bi.Float(t,0,e,i,this.readNullBitmap(t,i),this.readData(t))}visitUtf8(t){let{length:e,nullCount:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return bi.Utf8(t,0,e,i,this.readNullBitmap(t,i),this.readOffsets(t),this.readData(t))}visitBinary(t){let{length:e,nullCount:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return bi.Binary(t,0,e,i,this.readNullBitmap(t,i),this.readOffsets(t),this.readData(t))}visitFixedSizeBinary(t){let{length:e,nullCount:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return bi.FixedSizeBinary(t,0,e,i,this.readNullBitmap(t,i),this.readData(t))}visitDate(t){let{length:e,nullCount:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return bi.Date(t,0,e,i,this.readNullBitmap(t,i),this.readData(t))}visitTimestamp(t){let{length:e,nullCount:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return bi.Timestamp(t,0,e,i,this.readNullBitmap(t,i),this.readData(t))}visitTime(t){let{length:e,nullCount:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return bi.Time(t,0,e,i,this.readNullBitmap(t,i),this.readData(t))}visitDecimal(t){let{length:e,nullCount:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return bi.Decimal(t,0,e,i,this.readNullBitmap(t,i),this.readData(t))}visitList(t){let{length:e,nullCount:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return bi.List(t,0,e,i,this.readNullBitmap(t,i),this.readOffsets(t),this.visit(t.children[0]))}visitStruct(t){let{length:e,nullCount:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return bi.Struct(t,0,e,i,this.readNullBitmap(t,i),this.visitMany(t.children))}visitUnion(t){return t.mode===ue.Sparse?this.visitSparseUnion(t):this.visitDenseUnion(t)}visitDenseUnion(t){let{length:e,nullCount:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return bi.Union(t,0,e,i,this.readNullBitmap(t,i),this.readTypeIds(t),this.readOffsets(t),this.visitMany(t.children))}visitSparseUnion(t){let{length:e,nullCount:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return bi.Union(t,0,e,i,this.readNullBitmap(t,i),this.readTypeIds(t),this.visitMany(t.children))}visitDictionary(t){let{length:e,nullCount:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return bi.Dictionary(t,0,e,i,this.readNullBitmap(t,i),this.readData(t.indices),this.readDictionary(t))}visitInterval(t){let{length:e,nullCount:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return bi.Interval(t,0,e,i,this.readNullBitmap(t,i),this.readData(t))}visitFixedSizeList(t){let{length:e,nullCount:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return bi.FixedSizeList(t,0,e,i,this.readNullBitmap(t,i),this.visit(t.children[0]))}visitMap(t){let{length:e,nullCount:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextFieldNode();return bi.Map(t,0,e,i,this.readNullBitmap(t,i),this.readOffsets(t),this.visit(t.children[0]))}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]: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){let{length:e,offset:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextBufferRange();return this.bytes.subarray(i,i+e)}readDictionary(t){return this.dictionaries.get(t.id)}}class cr extends hr{constructor(t,e,i,n){super(new Uint8Array(0),e,i,n),this.sources=t}readNullBitmap(t,e){let{offset:i}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.nextBufferRange();return e<=0?new Uint8Array(0):be(this.sources[i])}readOffsets(t){let{offset:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextBufferRange();return mt(Uint8Array,mt(Int32Array,this.sources[e]))}readTypeIds(t){let{offset:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextBufferRange();return mt(Uint8Array,mt(t.ArrayType,this.sources[e]))}readData(t){let{offset:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.nextBufferRange();const{sources:i}=this;return Ve.isTimestamp(t)||(Ve.isInt(t)||Ve.isTime(t))&&64===t.bitWidth||Ve.isDate(t)&&t.unit===le.MILLISECOND?mt(Uint8Array,or.convertArray(i[e])):Ve.isDecimal(t)?mt(Uint8Array,lr.convertArray(i[e])):Ve.isBinary(t)||Ve.isFixedSizeBinary(t)?function(t){const e=t.join(""),i=new Uint8Array(e.length/2);for(let n=0;n>1]=parseInt(e.substr(n,2),16);return i}(i[e]):Ve.isBool(t)?be(i[e]):Ve.isUtf8(t)?Y(i[e].join("")):mt(Uint8Array,mt(t.ArrayType,i[e].map(t=>+t)))}}var ur=A.Long,dr=ee.apache.arrow.flatbuf.Null,pr=ee.apache.arrow.flatbuf.Int,fr=ee.apache.arrow.flatbuf.FloatingPoint,mr=ee.apache.arrow.flatbuf.Binary,gr=ee.apache.arrow.flatbuf.Bool,yr=ee.apache.arrow.flatbuf.Utf8,xr=ee.apache.arrow.flatbuf.Decimal,br=ee.apache.arrow.flatbuf.Date,vr=ee.apache.arrow.flatbuf.Time,wr=ee.apache.arrow.flatbuf.Timestamp,_r=ee.apache.arrow.flatbuf.Interval,kr=ee.apache.arrow.flatbuf.List,Tr=ee.apache.arrow.flatbuf.Struct_,Mr=ee.apache.arrow.flatbuf.Union,Sr=ee.apache.arrow.flatbuf.DictionaryEncoding,Cr=ee.apache.arrow.flatbuf.FixedSizeBinary,Pr=ee.apache.arrow.flatbuf.FixedSizeList,Ar=ee.apache.arrow.flatbuf.Map;const Br=new class extends Te{visit(t,e){return null==t||null==e?void 0:super.visit(t,e)}visitNull(t,e){return dr.startNull(e),dr.endNull(e)}visitInt(t,e){return pr.startInt(e),pr.addBitWidth(e,t.bitWidth),pr.addIsSigned(e,t.isSigned),pr.endInt(e)}visitFloat(t,e){return fr.startFloatingPoint(e),fr.addPrecision(e,t.precision),fr.endFloatingPoint(e)}visitBinary(t,e){return mr.startBinary(e),mr.endBinary(e)}visitBool(t,e){return gr.startBool(e),gr.endBool(e)}visitUtf8(t,e){return yr.startUtf8(e),yr.endUtf8(e)}visitDecimal(t,e){return xr.startDecimal(e),xr.addScale(e,t.scale),xr.addPrecision(e,t.precision),xr.endDecimal(e)}visitDate(t,e){return br.startDate(e),br.addUnit(e,t.unit),br.endDate(e)}visitTime(t,e){return vr.startTime(e),vr.addUnit(e,t.unit),vr.addBitWidth(e,t.bitWidth),vr.endTime(e)}visitTimestamp(t,e){const i=t.timezone&&e.createString(t.timezone)||void 0;return wr.startTimestamp(e),wr.addUnit(e,t.unit),void 0!==i&&wr.addTimezone(e,i),wr.endTimestamp(e)}visitInterval(t,e){return _r.startInterval(e),_r.addUnit(e,t.unit),_r.endInterval(e)}visitList(t,e){return kr.startList(e),kr.endList(e)}visitStruct(t,e){return Tr.startStruct_(e),Tr.endStruct_(e)}visitUnion(t,e){Mr.startTypeIdsVector(e,t.typeIds.length);const i=Mr.createTypeIdsVector(e,t.typeIds);return Mr.startUnion(e),Mr.addMode(e,t.mode),Mr.addTypeIds(e,i),Mr.endUnion(e)}visitDictionary(t,e){const i=this.visit(t.indices,e);return Sr.startDictionaryEncoding(e),Sr.addId(e,new ur(t.id,0)),Sr.addIsOrdered(e,t.isOrdered),void 0!==i&&Sr.addIndexType(e,i),Sr.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return Cr.startFixedSizeBinary(e),Cr.addByteWidth(e,t.byteWidth),Cr.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return Pr.startFixedSizeList(e),Pr.addListSize(e,t.listSize),Pr.endFixedSizeList(e)}visitMap(t,e){return Ar.startMap(e),Ar.addKeysSorted(e,t.keysSorted),Ar.endMap(e)}};function Ir(t){return new $r(t.count,function t(e){return(e||[]).reduce((e,i)=>{return[...e,new ts(i.count,(n=i.VALIDITY,(n||[]).reduce((t,e)=>t+ +(0===e),0))),...t(i.children)];var n},[])}(t.columns),function t(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];for(let n=-1,a=(e||[]).length;++nha.fromJSON(t,e))}function Dr(t,e){return(t.children||[]).filter(Boolean).map(t=>ha.fromJSON(t,e))}function Lr(t){return new Map(Object.entries(t||{}))}function Er(t){return new We(t.isSigned,t.bitWidth)}function Or(t,e){const i=t.type.name;switch(i){case"NONE":case"null":return new Ne;case"binary":return new Ze;case"utf8":return new ti;case"bool":return new ei;case"list":return new hi((e||[])[0]);case"struct":case"struct_":return new ci(e||[])}switch(i){case"int":{const e=t.type;return new We(e.isSigned,e.bitWidth)}case"floatingpoint":{const e=t.type;return new Ke(ce[e.precision])}case"decimal":{const e=t.type;return new ii(e.scale,e.precision)}case"date":{const e=t.type;return new ni(le[e.unit])}case"time":{const e=t.type;return new si(he[e.unit],e.bitWidth)}case"timestamp":{const e=t.type;return new oi(he[e.unit],e.timezone)}case"interval":{const e=t.type;return new li(de[e.unit])}case"union":{const i=t.type;return new ui(ue[i.mode],i.typeIds||[],e||[])}case"fixedsizebinary":{const e=t.type;return new di(e.byteWidth)}case"fixedsizelist":{const i=t.type;return new pi(i.listSize,(e||[])[0])}case"map":{const i=t.type;return new fi((e||[])[0],i.keysSorted)}}throw new Error('Unrecognized type: "'.concat(i,'"'))}var Vr=A.Long,zr=A.Builder,Nr=A.ByteBuffer,Wr=ee.apache.arrow.flatbuf.Type,Yr=ee.apache.arrow.flatbuf.Field,Rr=ee.apache.arrow.flatbuf.Schema,Ur=ee.apache.arrow.flatbuf.Buffer,Xr=re.apache.arrow.flatbuf.Message,jr=ee.apache.arrow.flatbuf.KeyValue,Hr=re.apache.arrow.flatbuf.FieldNode,qr=ee.apache.arrow.flatbuf.Endianness,Gr=re.apache.arrow.flatbuf.RecordBatch,Kr=re.apache.arrow.flatbuf.DictionaryBatch;class Jr{constructor(t,e,i,n){this._version=e,this._headerType=i,this.body=new Uint8Array(0),n&&(this._createHeader=()=>n),this._bodyLength="number"===typeof t?t:t.low}static fromJSON(t,e){const i=new Jr(0,fe.V4,e);return i._createHeader=function(t,e){return()=>{switch(e){case pe.Schema:return la.fromJSON(t);case pe.RecordBatch:return $r.fromJSON(t);case pe.DictionaryBatch:return Qr.fromJSON(t)}throw new Error("Unrecognized Message type: { name: ".concat(pe[e],", type: ").concat(e," }"))}}(t,e),i}static decode(t){t=new Nr(vt(t));const e=Xr.getRootAsMessage(t),i=e.bodyLength(),n=e.version(),a=e.headerType(),r=new Jr(i,n,a);return r._createHeader=function(t,e){return()=>{switch(e){case pe.Schema:return la.decode(t.header(new Rr));case pe.RecordBatch:return $r.decode(t.header(new Gr),t.version());case pe.DictionaryBatch:return Qr.decode(t.header(new Kr),t.version())}throw new Error("Unrecognized Message type: { name: ".concat(pe[e],", type: ").concat(e," }"))}}(e,a),r}static encode(t){let e=new zr,i=-1;return t.isSchema()?i=la.encode(e,t.header()):t.isRecordBatch()?i=$r.encode(e,t.header()):t.isDictionaryBatch()&&(i=Qr.encode(e,t.header())),Xr.startMessage(e),Xr.addVersion(e,fe.V4),Xr.addHeader(e,i),Xr.addHeaderType(e,t.headerType),Xr.addBodyLength(e,new Vr(t.bodyLength,0)),Xr.finishMessageBuffer(e,Xr.endMessage(e)),e.asUint8Array()}static from(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(t instanceof la)return new Jr(0,fe.V4,pe.Schema,t);if(t instanceof $r)return new Jr(e,fe.V4,pe.RecordBatch,t);if(t instanceof Qr)return new Jr(e,fe.V4,pe.DictionaryBatch,t);throw new Error("Unrecognized Message header: ".concat(t))}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===pe.Schema}isRecordBatch(){return this.headerType===pe.RecordBatch}isDictionaryBatch(){return this.headerType===pe.DictionaryBatch}}class $r{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,e,i){this._nodes=e,this._buffers=i,this._length="number"===typeof t?t:t.low}}class Qr{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this._data=t,this._isDelta=i,this._id="number"===typeof e?e:e.low}}class Zr{constructor(t,e){this.offset="number"===typeof t?t:t.low,this.length="number"===typeof e?e:e.low}}class ts{constructor(t,e){this.length="number"===typeof t?t:t.low,this.nullCount="number"===typeof e?e:e.low}}function es(t){const e=[];for(let i,n=-1,a=-1,r=t.nodesLength();++nha.encode(t,e)),l=Yr.createChildrenVector(t,o),h=e.metadata&&e.metadata.size>0?Yr.createCustomMetadataVector(t,[...e.metadata].map(e=>{let[i,n]=e;const a=t.createString("".concat(i)),r=t.createString("".concat(n));return jr.startKeyValue(t),jr.addKey(t,a),jr.addValue(t,r),jr.endKeyValue(t)})):-1;e.name&&(i=t.createString(e.name));Yr.startField(t),Yr.addType(t,n),Yr.addTypeType(t,s),Yr.addChildren(t,l),Yr.addNullable(t,!!e.nullable),-1!==i&&Yr.addName(t,i);-1!==a&&Yr.addDictionary(t,a);-1!==h&&Yr.addCustomMetadata(t,h);return Yr.endField(t)},ha.decode=function(t,e){let i,n,a,r,s,o;e&&(o=t.dictionary())?e.has(i=o.id().low)?(r=(r=o.indexType())?ss(r):new Ue,s=new yi(e.get(i),r,i,o.isOrdered()),n=new ha(t.name(),s,t.nullable(),rs(t))):(r=(r=o.indexType())?ss(r):new Ue,e.set(i,a=os(t,as(t,e))),s=new yi(a,r,i,o.isOrdered()),n=new ha(t.name(),s,t.nullable(),rs(t))):(a=os(t,as(t,e)),n=new ha(t.name(),a,t.nullable(),rs(t)));return n||null},ha.fromJSON=function(t,e){let i,n,a,r,s,o;return e&&(r=t.dictionary)?e.has(i=r.id)?(n=(n=r.indexType)?Er(n):new Ue,o=new yi(e.get(i),n,i,r.isOrdered),a=new ha(t.name,o,t.nullable,Lr(t.customMetadata))):(n=(n=r.indexType)?Er(n):new Ue,e.set(i,s=Or(t,Dr(t,e))),o=new yi(s,n,i,r.isOrdered),a=new ha(t.name,o,t.nullable,Lr(t.customMetadata))):(s=Or(t,Dr(t,e)),a=new ha(t.name,s,t.nullable,Lr(t.customMetadata))),a||null},la.encode=function(t,e){const i=e.fields.map(e=>ha.encode(t,e));Rr.startFieldsVector(t,i.length);const n=Rr.createFieldsVector(t,i),a=e.metadata&&e.metadata.size>0?Rr.createCustomMetadataVector(t,[...e.metadata].map(e=>{let[i,n]=e;const a=t.createString("".concat(i)),r=t.createString("".concat(n));return jr.startKeyValue(t),jr.addKey(t,a),jr.addValue(t,r),jr.endKeyValue(t)})):-1;Rr.startSchema(t),Rr.addFields(t,n),Rr.addEndianness(t,ls?qr.Little:qr.Big),-1!==a&&Rr.addCustomMetadata(t,a);return Rr.endSchema(t)},la.decode=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Map;const i=ns(t,e);return new la(i,rs(t),e)},la.fromJSON=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Map;return new la(Fr(t,e),Lr(t.customMetadata),e)},$r.encode=function(t,e){const i=e.nodes||[],n=e.buffers||[];Gr.startNodesVector(t,i.length),i.slice().reverse().forEach(e=>ts.encode(t,e));const a=t.endVector();Gr.startBuffersVector(t,n.length),n.slice().reverse().forEach(e=>Zr.encode(t,e));const r=t.endVector();return Gr.startRecordBatch(t),Gr.addLength(t,new Vr(e.length,0)),Gr.addNodes(t,a),Gr.addBuffers(t,r),Gr.endRecordBatch(t)},$r.decode=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fe.V4;return new $r(t.length(),es(t),is(t,e))},$r.fromJSON=Ir,Qr.encode=function(t,e){const i=$r.encode(t,e.data);return Kr.startDictionaryBatch(t),Kr.addId(t,new Vr(e.id,0)),Kr.addIsDelta(t,e.isDelta),Kr.addData(t,i),Kr.endDictionaryBatch(t)},Qr.decode=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fe.V4;return new Qr($r.decode(t.data(),e),t.id(),t.isDelta())},Qr.fromJSON=function(t){return new Qr(Ir(t.data),t.id,t.isDelta)},ts.encode=function(t,e){return Hr.createFieldNode(t,new Vr(e.length,0),new Vr(e.nullCount,0))},ts.decode=function(t){return new ts(t.length(),t.nullCount())},Zr.encode=function(t,e){return Ur.createBuffer(t,new Vr(e.offset,0),new Vr(e.length,0))},Zr.decode=function(t){return new Zr(t.offset(),t.length())};const ls=function(){const t=new ArrayBuffer(2);return new DataView(t).setInt16(0,256,!0),256===new Int16Array(t)[0]}();var hs=A.ByteBuffer;const cs=t=>"Expected ".concat(pe[t]," Message in stream, but was null or length 0."),us=t=>"Header pointer of flatbuffer-encoded ".concat(pe[t]," Message is null or length 0."),ds=(t,e)=>"Expected to read ".concat(t," metadata bytes, but only read ").concat(e,"."),ps=(t,e)=>"Expected to read ".concat(t," bytes for message body, but only read ").concat(e,".");class fs{constructor(t){this.source=t instanceof $a?t:new $a(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done||-1===t.value&&(t=this.readMetadataLength()).done||(t=this.readMetadata(t.value)).done?R: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(null!=t&&e.value.headerType!==t)throw new Error(cs(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const e=vt(this.source.read(t));if(e.byteLength0&&void 0!==arguments[0]&&arguments[0];const e=pe.Schema,i=this.readMessage(e),n=i&&i.header();if(t&&!n)throw new Error(us(e));return n}readMetadataLength(){const t=this.source.read(ys),e=t&&new hs(t),i=e&&e.readInt32(0)||0;return{done:0===i,value:i}}readMetadata(t){const e=this.source.read(t);if(!e)return R;if(e.byteLength0&&void 0!==arguments[0]&&arguments[0];const e=pe.Schema,i=await this.readMessage(e),n=i&&i.header();if(t&&!n)throw new Error(us(e));return n}async readMetadataLength(){const t=await this.source.read(ys),e=t&&new hs(t),i=e&&e.readInt32(0)||0;return{done:0===i,value:i}}async readMetadata(t){const e=await this.source.read(t);if(!e)return R;if(e.byteLength[...e,...i.VALIDITY&&[i.VALIDITY]||[],...i.TYPE&&[i.TYPE]||[],...i.OFFSET&&[i.OFFSET]||[],...i.DATA&&[i.DATA]||[],...t(i.children)],[])}(this._body)}readMessage(t){let e;if((e=this.next()).done)return null;if(null!=t&&e.value.headerType!==t)throw new Error(cs(t));return e.value}readSchema(){const t=pe.Schema,e=this.readMessage(t),i=e&&e.header();if(!e||!i)throw new Error(us(t));return i}}const ys=4,xs=new Uint8Array("ARROW1".length);for(let ch=0;ch<"ARROW1".length;ch+=1)xs[ch]="ARROW1".charCodeAt(ch);function bs(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let i=-1,n=xs.length;++i2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");Ve.isNull(t.type)||Ts.call(this,n<=0?new Uint8Array(0):xe(e.offset,i,e.nullBitmap)),this.nodes.push(new ts(i,n))}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.indices)}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}}function Ts(t){const e=t.byteLength+7&-8;return this.buffers.push(t),this.bufferRegions.push(new Zr(this._byteLength,e)),this._byteLength+=e,this}function Ms(t){return Ts.call(this,t.values.subarray(0,t.length*t.stride))}function Ss(t){const{length:e,values:i,valueOffsets:n}=t,a=n[0],r=n[e],s=Math.min(r-a,i.byteLength-a);return Ts.call(this,Gt(-n[0],e,n)),Ts.call(this,i.subarray(a,a+s)),this}function Cs(t){const{length:e,valueOffsets:i}=t;return i&&Ts.call(this,Gt(i[0],e,i)),this.visit(t.getChildAt(0))}function Ps(t){return this.visitMany(t.type.children.map((e,i)=>t.getChildAt(i)).filter(Boolean))[0]}ks.prototype.visitBool=function(t){let e;return t.nullCount>=t.length?Ts.call(this,new Uint8Array(0)):(e=t.values)instanceof Uint8Array?Ts.call(this,xe(t.offset,t.length,e)):Ts.call(this,be(t))},ks.prototype.visitInt=Ms,ks.prototype.visitFloat=Ms,ks.prototype.visitUtf8=Ss,ks.prototype.visitBinary=Ss,ks.prototype.visitFixedSizeBinary=Ms,ks.prototype.visitDate=Ms,ks.prototype.visitTimestamp=Ms,ks.prototype.visitTime=Ms,ks.prototype.visitDecimal=Ms,ks.prototype.visitList=Cs,ks.prototype.visitStruct=Ps,ks.prototype.visitUnion=function(t){const{type:e,length:i,typeIds:n,valueOffsets:a}=t;if(Ts.call(this,n),e.mode===ue.Sparse)return Ps.call(this,t);if(e.mode===ue.Dense){if(t.offset<=0)return Ts.call(this,a),Ps.call(this,t);{const r=n.reduce((t,e)=>Math.max(t,e),n[0]),s=new Int32Array(r+1),o=new Int32Array(r+1).fill(-1),l=new Int32Array(i),h=Gt(-a[0],i,a);for(let t,e,a=-1;++a0&&void 0!==arguments[0]&&arguments[0];return this._sink.toString(t)}toUint8Array(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._sink.toUint8Array(t)}writeAll(t){return it(t)?t.then(t=>this.writeAll(t)):at(t)?Ds(this,t):Fs(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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._sink,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;var i;return t===this._sink||t instanceof Ja?this._sink=t:(this._sink=new Ja,t&&(et(i=t)&&tt(i.abort)&&tt(i.getWriter)&&!(i instanceof X))?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&(t=>et(t)&&tt(t.end)&&tt(t.write)&&Z(t.writable)&&!(t instanceof X))(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&&e.compareTo(this._schema)||(null===e?(this._position=0,this._schema=null):(this._started=!0,this._schema=e,this._writeSchema(e))),this}write(t){let e=null;if(!this._sink)throw new Error("RecordBatchWriter is closed");if(null===t||void 0===t)return this.finish()&&void 0;if(t instanceof wl&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof _l&&!(e=t.schema))return this.finish()&&void 0;if(e&&!e.compareTo(this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof _l?t instanceof kl||this._writeRecordBatch(t):t instanceof wl?this.writeAll(t.chunks):nt(t)&&this.writeAll(t)}_writeMessage(t){const e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:8)-1,i=Jr.encode(t),n=i.byteLength,a=this._writeLegacyIpcFormat?4:8,r=n+a+e&~e,s=r-n-a;return t.headerType===pe.RecordBatch?this._recordBatchBlocks.push(new Ka(r,t.bodyLength,this._position)):t.headerType===pe.DictionaryBatch&&this._dictionaryBlocks.push(new Ka(r,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(r-a)),n>0&&this._write(i),this._writePadding(s)}_write(t){if(this._started){const e=vt(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(Jr.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(xs)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:e,nodes:i,bufferRegions:n,buffers:a}=ks.assemble(t),r=new $r(t.length,i,n),s=Jr.from(r,e);return this._writeDictionaries(t)._writeMessage(s)._writeBodyBuffers(a)}_writeDictionaryBatch(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this._dictionaryDeltaOffsets.set(e,t.length+(this._dictionaryDeltaOffsets.get(e)||0));const{byteLength:n,nodes:a,bufferRegions:r,buffers:s}=ks.assemble(t),o=new $r(t.length,a,r),l=new Qr(o,e,i),h=Jr.from(l,n);return this._writeMessage(h)._writeBodyBuffers(s)}_writeBodyBuffers(t){let e,i,n;for(let a=-1,r=t.length;++a0&&(this._write(e),(n=(i+7&-8)-i)>0&&this._writePadding(n));return this}_writeDictionaries(t){for(let[e,i]of t.dictionaries){let t=this._dictionaryDeltaOffsets.get(e)||0;if(0===t||(i=i.slice(t)).length>0){const n="chunks"in i?i.chunks:[i];for(const i of n)this._writeDictionaryBatch(i,e,t>0),t+=i.length}}return this}}class Bs extends As{static writeAll(t,e){const i=new Bs(e);return it(t)?t.then(t=>i.writeAll(t)):at(t)?Ds(i,t):Fs(i,t)}}class Is extends As{constructor(){super(),this._autoDestroy=!0}static writeAll(t){const e=new Is;return it(t)?t.then(t=>e.writeAll(t)):at(t)?Ds(e,t):Fs(e,t)}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeFooter(t){const e=qa.encode(new qa(t,fe.V4,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}}function Fs(t,e){let i=e;e instanceof wl&&(i=e.chunks,t.reset(void 0,e.schema));for(const n of i)t.write(n);return t.finish()}async function Ds(t,e){for await(const i of e)t.write(i);return t.finish()}const Ls=new Uint8Array(0),Es=t=>[Ls,Ls,new Uint8Array(t),Ls];function Os(t,e){return function(t,e){const i=[...t.fields],n=[],a={numBatches:e.reduce((t,e)=>Math.max(t,e.length),0)};let r,s=0,o=0,l=-1,h=e.length,c=[];for(;a.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,l=-1;++l0&&(n[s++]=[o,c.slice()]))}return[t=new la(i,t.metadata),n.map(e=>new _l(t,...e))]}(t,e.map(t=>t instanceof Kn?t.chunks.map(t=>t.data):[t.data]))}function Vs(t,e,i,n,a){let r,s,o=0,l=-1,h=n.length;const c=(e+63&-64)>>3;for(;++l=e?o===e?i[l]=r:(i[l]=r.slice(0,e),r=r.slice(e,o-e),a.numBatches=Math.max(a.numBatches,n[l].unshift(r))):((s=t[l]).nullable||(t[l]=s.clone({nullable:!0})),i[l]=r?r._changeLengthAndBackfillNullBitmap(e):bi.new(s.type,0,e,e,Es(c)));return i}class zs extends te{constructor(t,e){super(),this._children=e,this.numChildren=t.childData.length,this._bindDataAccessors(this.data=t)}get type(){return this.data.type}get typeId(){return this.data.typeId}get length(){return this.data.length}get offset(){return this.data.offset}get stride(){return this.data.stride}get nullCount(){return this.data.nullCount}get byteLength(){return this.data.byteLength}get VectorName(){return"".concat(se[this.typeId],"Vector")}get ArrayType(){return this.type.ArrayType}get values(){return this.data.values}get typeIds(){return this.data.typeIds}get nullBitmap(){return this.data.nullBitmap}get valueOffsets(){return this.data.valueOffsets}get[Symbol.toStringTag](){return"".concat(this.VectorName,"<").concat(this.type[Symbol.toStringTag],">")}clone(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._children;return te.new(t,e)}concat(){for(var t=arguments.length,e=new Array(t),i=0;i0){const e=this.offset+t;return 0!==(this.nullBitmap[e>>3]&1<=this.numChildren?null:(this._children||(this._children=[]))[t]||(this._children[t]=te.new(this.data.childData[t]))}toJSON(){return[...this]}_sliceInternal(t,e,i){return t.clone(t.data.slice(e,i-e),null)}_bindDataAccessors(t){}}zs.prototype[Symbol.isConcatSpreadable]=!0;class Ns extends zs{asUtf8(){return te.new(this.data.clone(new ti))}}class Ws extends zs{static from(t){return vl(()=>new ei,t)}}class Ys extends zs{static from(){for(var t=arguments.length,e=new Array(t),i=0;ie[1]===le.DAY?new ai:new ri,e[0]):vl(()=>new ri,e[0])}}class Rs extends Ys{}class Us extends Ys{}class Xs extends zs{}class js extends zs{constructor(t){super(t),this.indices=te.new(t.clone(this.type.indices))}static from(){for(var t=arguments.length,e=new Array(t),i=0;ie[0].type,e[0])}get dictionary(){return this.data.dictionary}reverseLookup(t){return this.dictionary.indexOf(t)}getKey(t){return this.indices.get(t)}getValue(t){return this.dictionary.get(t)}setKey(t,e){return this.indices.set(t,e)}setValue(t,e){return this.dictionary.set(t,e)}}js.prototype.indices=null;class Hs extends zs{}class qs extends zs{}class Gs extends zs{static from(t){let e=to(this);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)){let i=Zs(t.constructor)||e;if(null===e&&(e=i),e&&e===i){let i=new e,n=t.byteLength/i.ArrayType.BYTES_PER_ELEMENT;if(!Qs(e,t.constructor))return te.new(bi.Float(i,0,n,0,null,t))}}if(e)return vl(()=>new e,t);if(t instanceof DataView||t instanceof ArrayBuffer)throw new TypeError("Cannot infer float type from instance of ".concat(t.constructor.name));throw new TypeError("Unrecognized FloatVector input")}}class Ks extends Gs{toFloat32Array(){return new Float32Array(this)}toFloat64Array(){return new Float64Array(this)}}class Js extends Gs{}class $s extends Gs{}const Qs=(t,e)=>t===Je&&e!==Uint16Array,Zs=t=>{switch(t){case Uint16Array:return Je;case Float32Array:return $e;case Float64Array:return Qe;default:return null}},to=t=>{switch(t){case Ks:return Je;case Js:return $e;case $s:return Qe;default:return null}};class eo extends zs{}class io extends eo{}class no extends eo{}class ao extends zs{static from(){for(var t=arguments.length,e=new Array(t),i=0;inew r,n);if(n instanceof DataView||n instanceof ArrayBuffer)throw new TypeError("Cannot infer integer type from instance of ".concat(n.constructor.name));throw new TypeError("Unrecognized IntVector input")}}class ro extends ao{}class so extends ao{}class oo extends ao{}class lo extends ao{toBigInt64Array(){return bt(this.values)}get values64(){return this._values64||(this._values64=this.toBigInt64Array())}}class ho extends ao{}class co extends ao{}class uo extends ao{}class po extends ao{toBigUint64Array(){return kt(this.values)}get values64(){return this._values64||(this._values64=this.toBigUint64Array())}}const fo=(t,e)=>(t===Xe||t===Ge)&&(e===Int32Array||e===Uint32Array),mo=(t,e)=>{switch(t){case Int8Array:return Ye;case Int16Array:return Re;case Int32Array:return e?Xe:Ue;case G:return Xe;case Uint8Array:return je;case Uint16Array:return He;case Uint32Array:return e?Ge:qe;case J:return Ge;default:return null}},go=(t,e)=>{switch(t){case ro:return Ye;case so:return Re;case oo:return e?Xe:Ue;case lo:return Xe;case ho:return je;case co:return He;case uo:return e?Ge:qe;case po:return Ge;default:return null}};class yo extends zs{}class xo extends zs{asList(){const t=this.type.children[0];return te.new(this.data.clone(new hi(t)))}bind(t){const e=this.getChildAt(0),{[t]:i,[t+1]:n}=this.valueOffsets;return new Vn(e.slice(i,n))}}class bo extends zs{}const vo=Symbol.for("rowIndex");class wo extends zs{bind(t){const e=this._row||(this._row=new zn(this)),i=Object.create(e);return i[vo]=t,i}}class _o extends zs{}class ko extends _o{}class To extends _o{}class Mo extends _o{}class So extends _o{}class Co extends zs{}class Po extends Co{}class Ao extends Co{}class Bo extends Co{}class Io extends Co{}class Fo extends zs{get typeIdToChildIndex(){return this.data.type.typeIdToChildIndex}}class Do extends Fo{get valueOffsets(){return this.data.valueOffsets}}class Lo extends Fo{}class Eo extends zs{static from(t){return vl(()=>new ti,t)}asBinary(){return te.new(this.data.clone(new Ze))}}function Oo(t){return function(){return t(this)}}function Vo(t){return function(e,i){return t(this,e,i)}}class zo extends Te{}const No=(t,e)=>4294967296*t[e+1]+(t[e]>>>0),Wo=t=>new Date(t),Yo=(t,e,i)=>{const{[i]:n,[i+1]:a}=e;return null!=n&&null!=a?t.subarray(n,a):null},Ro=(t,e)=>{let{values:i}=t;return((t,e)=>Wo(((t,e)=>864e5*t[e])(t,e)))(i,e)},Uo=(t,e)=>{let{values:i}=t;return((t,e)=>Wo(No(t,e)))(i,2*e)},Xo=(t,e)=>{let{stride:i,values:n}=t;return n[i*e]},jo=(t,e)=>{let{stride:i,values:n}=t;return Yi(n[i*e])},Ho=(t,e)=>{let{stride:i,values:n,type:a}=t;return nn.new(n.subarray(i*e,i*(e+1)),a.isSigned)},qo=(t,e)=>{let{values:i}=t;return 1e3*No(i,2*e)},Go=(t,e)=>{let{values:i}=t;return No(i,2*e)},Ko=(t,e)=>{let{values:i}=t;return((t,e)=>t[e+1]/1e3*4294967296+(t[e]>>>0)/1e3)(i,2*e)},Jo=(t,e)=>{let{values:i}=t;return((t,e)=>t[e+1]/1e6*4294967296+(t[e]>>>0)/1e6)(i,2*e)},$o=(t,e)=>{let{values:i,stride:n}=t;return i[n*e]},Qo=(t,e)=>{let{values:i,stride:n}=t;return i[n*e]},Zo=(t,e)=>{let{values:i}=t;return nn.signed(i.subarray(2*e,2*(e+1)))},tl=(t,e)=>{let{values:i}=t;return nn.signed(i.subarray(2*e,2*(e+1)))},el=(t,e)=>{const i=t.typeIdToChildIndex[t.typeIds[e]],n=t.getChildAt(i);return n?n.get(t.valueOffsets[e]):null},il=(t,e)=>{const i=t.typeIdToChildIndex[t.typeIds[e]],n=t.getChildAt(i);return n?n.get(e):null},nl=(t,e)=>{let{values:i}=t;return i.subarray(2*e,2*(e+1))},al=(t,e)=>{let{values:i}=t;const n=i[e],a=new Int32Array(2);return a[0]=n/12|0,a[1]=n%12|0,a};zo.prototype.visitNull=(t,e)=>null,zo.prototype.visitBool=(t,e)=>{let{offset:i,values:n}=t;const a=i+e;return 0!==(n[a>>3]&1<t.type.bitWidth<64?Xo(t,e):Ho(t,e),zo.prototype.visitInt8=Xo,zo.prototype.visitInt16=Xo,zo.prototype.visitInt32=Xo,zo.prototype.visitInt64=Ho,zo.prototype.visitUint8=Xo,zo.prototype.visitUint16=Xo,zo.prototype.visitUint32=Xo,zo.prototype.visitUint64=Ho,zo.prototype.visitFloat=(t,e)=>t.type.precision!==ce.HALF?Xo(t,e):jo(t,e),zo.prototype.visitFloat16=jo,zo.prototype.visitFloat32=Xo,zo.prototype.visitFloat64=Xo,zo.prototype.visitUtf8=(t,e)=>{let{values:i,valueOffsets:n}=t;const a=Yo(i,n,e);return null!==a?W(a):null},zo.prototype.visitBinary=(t,e)=>{let{values:i,valueOffsets:n}=t;return Yo(i,n,e)},zo.prototype.visitFixedSizeBinary=(t,e)=>{let{stride:i,values:n}=t;return n.subarray(i*e,i*(e+1))},zo.prototype.visitDate=(t,e)=>t.type.unit===le.DAY?Ro(t,e):Uo(t,e),zo.prototype.visitDateDay=Ro,zo.prototype.visitDateMillisecond=Uo,zo.prototype.visitTimestamp=(t,e)=>{switch(t.type.unit){case he.SECOND:return qo(t,e);case he.MILLISECOND:return Go(t,e);case he.MICROSECOND:return Ko(t,e);case he.NANOSECOND:return Jo(t,e)}},zo.prototype.visitTimestampSecond=qo,zo.prototype.visitTimestampMillisecond=Go,zo.prototype.visitTimestampMicrosecond=Ko,zo.prototype.visitTimestampNanosecond=Jo,zo.prototype.visitTime=(t,e)=>{switch(t.type.unit){case he.SECOND:return $o(t,e);case he.MILLISECOND:return Qo(t,e);case he.MICROSECOND:return Zo(t,e);case he.NANOSECOND:return tl(t,e)}},zo.prototype.visitTimeSecond=$o,zo.prototype.visitTimeMillisecond=Qo,zo.prototype.visitTimeMicrosecond=Zo,zo.prototype.visitTimeNanosecond=tl,zo.prototype.visitDecimal=(t,e)=>{let{values:i}=t;return nn.decimal(i.subarray(4*e,4*(e+1)))},zo.prototype.visitList=(t,e)=>{const i=t.getChildAt(0),{valueOffsets:n,stride:a}=t;return i.slice(n[e*a],n[e*a+1])},zo.prototype.visitStruct=(t,e)=>t.bind(e),zo.prototype.visitUnion=(t,e)=>t.type.mode===ue.Dense?el(t,e):il(t,e),zo.prototype.visitDenseUnion=el,zo.prototype.visitSparseUnion=il,zo.prototype.visitDictionary=(t,e)=>t.getValue(t.getKey(e)),zo.prototype.visitInterval=(t,e)=>t.type.unit===de.DAY_TIME?nl(t,e):al(t,e),zo.prototype.visitIntervalDayTime=nl,zo.prototype.visitIntervalYearMonth=al,zo.prototype.visitFixedSizeList=(t,e)=>{const i=t.getChildAt(0),{stride:n}=t;return i.slice(e*n,(e+1)*n)},zo.prototype.visitMap=(t,e)=>t.bind(e);const rl=new zo;class sl extends Te{}function ol(t,e,i){if(void 0===e)return-1;if(null===e)return function(t,e){const{nullBitmap:i}=t;if(!i||t.nullCount<=0)return-1;let n=0;for(const a of ve(i,t.data.offset+(e||0),t.length,i,me)){if(!a)return n;++n}return-1}(t,i);const n=Hn(e);for(let a=(i||0)-1,r=t.length;++a0?0:-1},sl.prototype.visitBool=ol,sl.prototype.visitInt=ol,sl.prototype.visitInt8=ol,sl.prototype.visitInt16=ol,sl.prototype.visitInt32=ol,sl.prototype.visitInt64=ol,sl.prototype.visitUint8=ol,sl.prototype.visitUint16=ol,sl.prototype.visitUint32=ol,sl.prototype.visitUint64=ol,sl.prototype.visitFloat=ol,sl.prototype.visitFloat16=ol,sl.prototype.visitFloat32=ol,sl.prototype.visitFloat64=ol,sl.prototype.visitUtf8=ol,sl.prototype.visitBinary=ol,sl.prototype.visitFixedSizeBinary=ol,sl.prototype.visitDate=ol,sl.prototype.visitDateDay=ol,sl.prototype.visitDateMillisecond=ol,sl.prototype.visitTimestamp=ol,sl.prototype.visitTimestampSecond=ol,sl.prototype.visitTimestampMillisecond=ol,sl.prototype.visitTimestampMicrosecond=ol,sl.prototype.visitTimestampNanosecond=ol,sl.prototype.visitTime=ol,sl.prototype.visitTimeSecond=ol,sl.prototype.visitTimeMillisecond=ol,sl.prototype.visitTimeMicrosecond=ol,sl.prototype.visitTimeNanosecond=ol,sl.prototype.visitDecimal=ol,sl.prototype.visitList=ol,sl.prototype.visitStruct=ol,sl.prototype.visitUnion=ol,sl.prototype.visitDenseUnion=ll,sl.prototype.visitSparseUnion=ll,sl.prototype.visitDictionary=ol,sl.prototype.visitInterval=ol,sl.prototype.visitIntervalDayTime=ol,sl.prototype.visitIntervalYearMonth=ol,sl.prototype.visitFixedSizeList=ol,sl.prototype.visitMap=ol;const hl=new sl;class cl extends Te{}function ul(t){if(t.nullCount>0)return function(t){const e=rl.getVisitFn(t);return ve(t.nullBitmap,t.offset,t.length,t,(t,i,n,a)=>0!==(n&1<0)?t.values.subarray(0,n)[Symbol.iterator]():function*(e){for(let i=-1;++it+e,yl=t=>"Cannot compute the byte width of variable-width column ".concat(t);const xl=new class extends Te{visitNull(t){return 0}visitInt(t){return t.bitWidth/8}visitFloat(t){return t.ArrayType.BYTES_PER_ELEMENT}visitBinary(t){throw new Error(yl(t))}visitUtf8(t){throw new Error(yl(t))}visitBool(t){return 1/8}visitDecimal(t){return 16}visitDate(t){return 4*(t.unit+1)}visitTime(t){return t.bitWidth/8}visitTimestamp(t){return t.unit===he.SECOND?4:8}visitInterval(t){return 4*(t.unit+1)}visitList(t){throw new Error(yl(t))}visitStruct(t){return this.visitFields(t.children).reduce(gl,0)}visitUnion(t){return this.visitFields(t.children).reduce(gl,0)}visitFixedSizeBinary(t){return t.byteWidth}visitFixedSizeList(t){return t.listSize*this.visitFields(t.children).reduce(gl,0)}visitMap(t){return this.visitFields(t.children).reduce(gl,0)}visitDictionary(t){return this.visit(t.indices)}visitFields(t){return(t||[]).map(t=>this.visit(t.type))}visitSchema(t){return this.visitFields(t.fields).reduce(gl,0)}};const bl=new class extends Te{visitNull(){return bo}visitBool(){return Ws}visitInt(){return ao}visitInt8(){return ro}visitInt16(){return so}visitInt32(){return oo}visitInt64(){return lo}visitUint8(){return ho}visitUint16(){return co}visitUint32(){return uo}visitUint64(){return po}visitFloat(){return Gs}visitFloat16(){return Ks}visitFloat32(){return Js}visitFloat64(){return $s}visitUtf8(){return Eo}visitBinary(){return Ns}visitFixedSizeBinary(){return Hs}visitDate(){return Ys}visitDateDay(){return Rs}visitDateMillisecond(){return Us}visitTimestamp(){return _o}visitTimestampSecond(){return ko}visitTimestampMillisecond(){return To}visitTimestampMicrosecond(){return Mo}visitTimestampNanosecond(){return So}visitTime(){return Co}visitTimeSecond(){return Po}visitTimeMillisecond(){return Ao}visitTimeMicrosecond(){return Bo}visitTimeNanosecond(){return Io}visitDecimal(){return Xs}visitList(){return yo}visitStruct(){return wo}visitUnion(){return Fo}visitDenseUnion(){return Do}visitSparseUnion(){return Lo}visitDictionary(){return js}visitInterval(){return eo}visitIntervalDayTime(){return io}visitIntervalYearMonth(){return no}visitFixedSizeList(){return qs}visitMap(){return xo}};function vl(t,e){if(nt(e))return te.from({nullValues:[null,void 0],type:t(),values:e});if(at(e))return te.from({nullValues:[null,void 0],type:t(),values:e});const{values:i=[],type:n=t(),nullValues:a=[null,void 0]}={...e};return nt(i),te.from({nullValues:a,...e,type:n})}te.new=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n{const n=Pi.throughAsyncIterable(i);for await(const i of n(e))t.push(i);return 1===t.length?t[0]:Kn.concat(t)})([])},zs.prototype.get=function(t){return rl.visit(this,t)},zs.prototype.set=function(t,e){return Na.visit(this,t,e)},zs.prototype.indexOf=function(t,e){return hl.visit(this,t,e)},zs.prototype.toArray=function(){return ml.visit(this)},zs.prototype.getByteWidth=function(){return xl.visit(this.type)},zs.prototype[Symbol.iterator]=function(){return dl.visit(this)},zs.prototype._bindDataAccessors=function(){const t=this.nullBitmap;t&&t.byteLength>0&&(this.get=(e=this.get,function(t){return this.isValid(t)?e.call(this,t):null}),this.set=function(t){return function(e,i){ye(this.nullBitmap,this.offset+e,!(null===i||void 0===i))&&t.call(this,e,i)}}(this.set));var e},Object.keys(se).map(t=>se[t]).filter(t=>"number"===typeof t).filter(t=>t!==se.NONE).forEach(t=>{const e=bl.visit(t);var i;e.prototype.get=(i=rl.getVisitFn(t),function(t){return i(this,t)}),e.prototype.set=Vo(Na.getVisitFn(t)),e.prototype.indexOf=Vo(hl.getVisitFn(t)),e.prototype.toArray=Oo(ml.getVisitFn(t)),e.prototype.getByteWidth=function(t){return function(){return t(this.type)}}(xl.getVisitFn(t)),e.prototype[Symbol.iterator]=Oo(dl.getVisitFn(t))});class wl extends Kn{constructor(){let t=null;for(var e=arguments.length,i=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:new la([]);return new wl(t,[])}static from(t){if(!t)return wl.empty();if("object"===typeof t){let e=nt(t.values)?function(t){const{type:e}=t;if(e instanceof ci)return wl.fromStruct(wo.from(t));return null}(t):at(t.values)?function(t){const{type:e}=t;if(e instanceof ci)return wo.from(t).then(t=>wl.fromStruct(t));return null}(t):null;if(null!==e)return e}let e=Ml.from(t);return it(e)?(async()=>await wl.from(await e))():e.isSync()&&(e=e.open())?e.schema?new wl(e.schema,[...e]):wl.empty():(async t=>{const e=await t,i=e.schema,n=[];if(i){for await(let t of e)n.push(t);return new wl(i,n)}return wl.empty()})(e.open())}static async fromAsync(t){return await wl.from(t)}static fromStruct(t){return wl.new(t.data.childData,t.type.children)}static new(){for(var t=arguments.length,e=new Array(t),i=0;i{const[e,i]=oa(t,[[],[]]);return i.map((t,i)=>t instanceof Qn?Qn.new(t.field.clone(e[i]),t):t instanceof te?Qn.new(e[i],t):Qn.new(e[i],[]))})(e),Os(new la(n.map(t=>{let{field:e}=t;return e})),n)));var n}get schema(){return this._schema}get length(){return this._length}get chunks(){return this._chunks}get numCols(){return this._numChildren}clone(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._chunks;return new wl(this._schema,t)}getColumn(t){return this.getColumnAt(this.getColumnIndex(t))}getColumnAt(t){return this.getChildAt(t)}getColumnIndex(t){return this._schema.fields.findIndex(e=>e.name===t)}getChildAt(t){if(t<0||t>=this.numChildren)return null;let e,i;const n=this._schema.fields,a=this._children||(this._children=[]);if(i=a[t])return i;if(e=n[t]){const i=this._chunks.map(e=>e.getChildAt(t)).filter(t=>null!=t);if(i.length>0)return a[t]=new Qn(e,i)}return null}serialize(){return(!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?Bs:Is).writeAll(this).toUint8Array(!0)}count(){return this._length}select(){const t=this._schema.fields.reduce((t,e,i)=>t.set(e.name,i),new Map);for(var e=arguments.length,i=new Array(e),n=0;nt.get(e)).filter(t=>t>-1))}selectAt(){for(var t=arguments.length,e=new Array(t),i=0;i{let{length:i,data:{childData:a}}=t;return new _l(n,i,e.map(t=>a[t]).filter(Boolean))}))}assign(t){var e=this;const i=this._schema.fields,[n,a]=t.schema.fields.reduce((t,e,n)=>{const[a,r]=t,s=i.findIndex(t=>t.name===e.name);return~s?r[s]=n:a.push(n),t},[[],[]]),r=this._schema.assign(t.schema),s=[...i.map((function(i,n,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a[n];return void 0===s?e.getColumnAt(n):t.getColumnAt(s)})),...n.map(e=>t.getColumnAt(e))].filter(Boolean);return new wl(...Os(r,s))}}class _l extends wo{constructor(){let t;for(var e=arguments.length,i=new Array(e),n=0;nt instanceof te);return new _l(...function(t,e){let i,n,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.reduce((t,e)=>Math.max(t,e.length),0),r=-1,s=e.length;const o=[...t.fields],l=[],h=(a+63&-64)>>3;for(;++rt.data)))}clone(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._children;return new _l(this._schema,t,e)}concat(){for(var t=arguments.length,e=new Array(t),i=0;i{let{data:e}=t;return new _l(n,e)}))}get schema(){return this._schema}get numCols(){return this._schema.fields.length}get dictionaries(){return this._dictionaries||(this._dictionaries=Tl.collect(this))}select(){const t=this._schema.fields.reduce((t,e,i)=>t.set(e.name,i),new Map);for(var e=arguments.length,i=new Array(e),n=0;nt.get(e)).filter(t=>t>-1))}selectAt(){for(var t=arguments.length,e=new Array(t),i=0;ithis.data.childData[t]).filter(Boolean);return new _l(n,this.length,a)}}class kl extends _l{constructor(t){super(t,0,t.fields.map(t=>bi.new(t.type,0,0,0)))}}class Tl extends Te{constructor(){super(...arguments),this.dictionaries=new Map}static collect(t){return(new Tl).visit(t.data,new ci(t.schema.fields)).dictionaries}visit(t,e){return Ve.isDictionary(e)?this.visitDictionary(t,e):(t.childData.forEach((t,i)=>this.visit(t,e.children[i].type)),this)}visitDictionary(t,e){const i=t.dictionary;return i&&i.length>0&&this.dictionaries.set(e.id,i),this}}class Ml extends X{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 it(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 Jt.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Jt.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 Ml?t:rt(t)?function(t){return new Sl(new El(t))}(t):ot(t)?async function(t){const{size:e}=await t.stat(),i=new ir(t,e);if(e>=_s&&bs(await i.readAt(0,vs+7&-8)))return new Al(new Ll(i));return new Cl(new Fl(i))}(t):it(t)?(async()=>await Ml.from(await t))():lt(t)||ht(t)||ct(t)||at(t)?async function(t){const e=await t.peek(vs+7&-8);return e&&e.byteLength>=4?bs(e)?new Pl(new Dl(await t.read())):new Cl(new Fl(t)):new Cl(new Fl(async function*(){}()))}(new Qa(t)):function(t){const e=t.peek(vs+7&-8);return e&&e.byteLength>=4?bs(e)?new Pl(new Dl(t.read())):new Sl(new Il(t)):new Sl(new Il(function*(){}()))}(new $a(t))}static readAll(t){return t instanceof Ml?t.isSync()?Vl(t):zl(t):rt(t)||ArrayBuffer.isView(t)||nt(t)||st(t)?Vl(t):zl(t)}}class Sl extends Ml{constructor(t){super(t),this._impl=t}[Symbol.iterator](){return this._impl[Symbol.iterator]()}async*[Symbol.asyncIterator](){yield*this[Symbol.iterator]()}}class Cl extends Ml{constructor(t){super(t),this._impl=t}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class Pl extends Sl{constructor(t){super(t),this._impl=t}}class Al extends Cl{constructor(t){super(t),this._impl=t}}class Bl{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]: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){return new _l(this.schema,t.length,this._loadVectors(t,e,this.schema.fields))}_loadDictionaryBatch(t,e){const{id:i,isDelta:n,data:a}=t,{dictionaries:r,schema:s}=this,o=r.get(i);if(n||!o){const t=s.dictionaries.get(i);return o&&n?o.concat(te.new(this._loadVectors(a,e,[t])[0])):te.new(this._loadVectors(a,e,[t])[0])}return o}_loadVectors(t,e,i){return new hr(e,t.nodes,t.buffers,this.dictionaries).visitMany(i)}}class Il extends Bl{constructor(t,e){super(e),this._reader=rt(t)?new gs(this._handle=t):new fs(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=Ol(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):R}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):R}next(){if(this.closed)return R;let t,{_reader:e}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else{if(t.isRecordBatch()){this._recordBatchIndex++;const i=t.header(),n=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(i,n)}}if(t.isDictionaryBatch()){this._dictionaryIndex++;const i=t.header(),n=e.readMessageBody(t.bodyLength),a=this._loadDictionaryBatch(i,n);this.dictionaries.set(i.id,a)}}return this.schema&&0===this._recordBatchIndex?(this._recordBatchIndex++,{done:!1,value:new kl(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class Fl extends Bl{constructor(t,e){super(e),this._reader=new ms(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}async cancel(){!this.closed&&(this.closed=!0)&&(await this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}async open(t){return this.closed||(this.autoDestroy=Ol(this,t),this.schema||(this.schema=await this._reader.readSchema())||await this.cancel()),this}async throw(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?await this.reset()._reader.throw(t):R}async return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?await this.reset()._reader.return(t):R}async next(){if(this.closed)return R;let t,{_reader:e}=this;for(;t=await this._readNextMessageAndValidate();)if(t.isSchema())await this.reset(t.header());else{if(t.isRecordBatch()){this._recordBatchIndex++;const i=t.header(),n=await e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(i,n)}}if(t.isDictionaryBatch()){this._dictionaryIndex++;const i=t.header(),n=await e.readMessageBody(t.bodyLength),a=this._loadDictionaryBatch(i,n);this.dictionaries.set(i.id,a)}}return this.schema&&0===this._recordBatchIndex?(this._recordBatchIndex++,{done:!1,value:new kl(this.schema)}):await this.return()}async _readNextMessageAndValidate(t){return await this._reader.readMessage(t)}}class Dl extends Il{constructor(t,e){super(t instanceof er?t:new er(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 t of this._footer.dictionaryBatches())t&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){if(this.closed)return null;this._footer||this.open();const e=this._footer&&this._footer.getRecordBatch(t);if(e&&this._handle.seek(e.offset)){const t=this._reader.readMessage(pe.RecordBatch);if(t&&t.isRecordBatch()){const e=t.header(),i=this._reader.readMessageBody(t.bodyLength);return this._loadRecordBatch(e,i)}}return null}_readDictionaryBatch(t){const e=this._footer&&this._footer.getDictionaryBatch(t);if(e&&this._handle.seek(e.offset)){const t=this._reader.readMessage(pe.DictionaryBatch);if(t&&t.isDictionaryBatch()){const e=t.header(),i=this._reader.readMessageBody(t.bodyLength),n=this._loadDictionaryBatch(e,i);this.dictionaries.set(e.id,n)}}}_readFooter(){const{_handle:t}=this,e=t.size-ws,i=t.readInt32(e),n=t.readAt(e-i,i);return qa.decode(n)}_readNextMessageAndValidate(t){if(this._footer||this.open(),this._footer&&this._recordBatchIndex1?e-1:0),n=1;n{this._builder.clear()},pull:t=>{this._maybeFlush(this._builder,this._controller=t)},start:t=>{this._maybeFlush(this._builder,this._controller=t)}},{highWaterMark:r,size:"bytes"!==n?Wl:Yl}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:s,size:t=>this._writeValueAndReturnChunkSize(t)})}_writeValueAndReturnChunkSize(t){const e=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(t)),this._bufferedSize-e}_maybeFlush(t,e){null!==e&&(this._bufferedSize>=e.desiredSize&&++this._numChunks&&this._enqueue(e,t.toVector()),t.finished&&((t.length>0||0===this._numChunks)&&++this._numChunks&&this._enqueue(e,t.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(e,null)))}_enqueue(t,e){this._bufferedSize=0,this._controller=null,null===e?t.close():t.enqueue(e)}}const Wl=t=>t.length,Yl=t=>t.byteLength;class Rl{eq(t){return t instanceof Rl||(t=new Ul(t)),new Jl(this,t)}le(t){return t instanceof Rl||(t=new Ul(t)),new $l(this,t)}ge(t){return t instanceof Rl||(t=new Ul(t)),new Ql(this,t)}lt(t){return new Zl(this.ge(t))}gt(t){return new Zl(this.le(t))}ne(t){return new Zl(this.eq(t))}}class Ul extends Rl{constructor(t){super(),this.v=t}}class Xl extends Rl{constructor(t){super(),this.name=t}bind(t){if(!this.colidx){this.colidx=-1;const e=t.schema.fields;for(let t=-1;++te.get(t)}}class jl{and(){for(var t=arguments.length,e=new Array(t),i=0;it.concat(e instanceof Gl?e.children:e),[]),super(...e)}bind(t){const e=this.children.map(e=>e.bind(t));return(t,i)=>e.every(e=>e(t,i))}}class Kl extends ql{constructor(){for(var t=arguments.length,e=new Array(t),i=0;it.concat(e instanceof Kl?e.children:e),[]),super(...e)}bind(t){const e=this.children.map(e=>e.bind(t));return(t,i)=>e.some(e=>e(t,i))}}class Jl extends Hl{_bindLitLit(t,e,i){const n=e.v==i.v;return()=>n}_bindColCol(t,e,i){const n=e.bind(t),a=i.bind(t);return(t,e)=>n(t,e)==a(t,e)}_bindColLit(t,e,i){const n=e.bind(t);if(e.vector instanceof js){let t;const n=e.vector;return n.dictionary!==this.lastDictionary?(t=n.reverseLookup(i.v),this.lastDictionary=n.dictionary,this.lastKey=t):t=this.lastKey,-1===t?()=>!1:e=>n.getKey(e)===t}return(t,e)=>n(t,e)==i.v}_bindLitCol(t,e,i){return this._bindColLit(t,i,e)}}class $l extends Hl{_bindLitLit(t,e,i){const n=e.v<=i.v;return()=>n}_bindColCol(t,e,i){const n=e.bind(t),a=i.bind(t);return(t,e)=>n(t,e)<=a(t,e)}_bindColLit(t,e,i){const n=e.bind(t);return(t,e)=>n(t,e)<=i.v}_bindLitCol(t,e,i){const n=i.bind(t);return(t,i)=>e.v<=n(t,i)}}class Ql extends Hl{_bindLitLit(t,e,i){const n=e.v>=i.v;return()=>n}_bindColCol(t,e,i){const n=e.bind(t),a=i.bind(t);return(t,e)=>n(t,e)>=a(t,e)}_bindColLit(t,e,i){const n=e.bind(t);return(t,e)=>n(t,e)>=i.v}_bindLitCol(t,e,i){const n=i.bind(t);return(t,i)=>e.v>=n(t,i)}}class Zl extends jl{constructor(t){super(),this.child=t}bind(t){const e=this.child.bind(t);return(t,i)=>!e(t,i)}}wl.prototype.countBy=function(t){return new th(this.chunks).countBy(t)},wl.prototype.scan=function(t,e){return new th(this.chunks).scan(t,e)},wl.prototype.scanReverse=function(t,e){return new th(this.chunks).scanReverse(t,e)},wl.prototype.filter=function(t){return new th(this.chunks).filter(t)};class th extends wl{filter(t){return new ih(this.chunks,t)}scan(t,e){const i=this.chunks,n=i.length;for(let a=-1;++a=0;){const a=i[n];e&&e(a);for(let e=a.length;--e>=0;)t(e,a)}}countBy(t){const e=this.chunks,i=e.length,n="string"===typeof t?new Xl(t):t;n.bind(e[i-1]);const a=n.vector;if(!Ve.isDictionary(a.type))throw new Error("countBy currently only supports dictionary-encoded columns");const r=Math.ceil(Math.log(a.length)/Math.log(256)),s=new(4==r?Uint32Array:r>=2?Uint16Array:Uint8Array)(a.dictionary.length);for(let o=-1;++o=0;){const a=i[n],r=this._predicate.bind(a);let s=!1;for(let i=a.length;--i>=0;)r(i,a)&&(e&&!s&&(e(a),s=!0),t(i,a))}}count(){let t=0;const e=this._chunks,i=e.length;for(let n=-1;++n=2?Uint16Array:Uint8Array)(a.dictionary.length);for(let o=-1;++o=a.headerRows&&e=a.headerColumns;if(i){var s=["blank"];return e>0&&s.push("level"+t),{type:"blank",classNames:s.join(" "),content:""}}if(r)return{type:"columns",classNames:(s=["col_heading","level"+t,"col"+(l=e-a.headerColumns)]).join(" "),content:a.getContent(a.columnsTable,l,t)};if(n){s=["row_heading","level"+e,"row"+(o=t-a.headerRows)];return{type:"index",id:"T_"+a.uuid+"level"+e+"_row"+o,classNames:s.join(" "),content:a.getContent(a.indexTable,o,e)}}s=["data","row"+(o=t-a.headerRows),"col"+(l=e-a.headerColumns)];var o,l,h=a.styler?a.getContent(a.styler.displayValuesTable,o,l):a.getContent(a.dataTable,o,l);return{type:"data",id:"T_"+a.uuid+"row"+o+"_col"+l,classNames:s.join(" "),content:h}},this.getContent=function(t,e,i){var n=t.getColumnAt(i);if(null===n)return"";switch(a.getColumnTypeId(t,i)){case se.Timestamp:return a.nanosToDate(n.get(e));default:return n.get(e)}},this.dataTable=wl.from(t),this.indexTable=wl.from(e),this.columnsTable=wl.from(i),this.styler=n?{caption:n.caption,displayValuesTable:wl.from(n.displayValues),styles:n.styles,uuid:n.uuid}:void 0}return Object.defineProperty(t.prototype,"rows",{get:function(){return this.indexTable.length+this.columnsTable.numCols},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"columns",{get:function(){return this.indexTable.numCols+this.columnsTable.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"headerRows",{get:function(){return this.rows-this.dataRows},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"headerColumns",{get:function(){return this.columns-this.dataColumns},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataRows",{get:function(){return this.dataTable.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataColumns",{get:function(){return this.dataTable.numCols},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"uuid",{get:function(){return this.styler&&this.styler.uuid},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"caption",{get:function(){return this.styler&&this.styler.caption},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"styles",{get:function(){return this.styler&&this.styler.styles},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"table",{get:function(){return this.dataTable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"index",{get:function(){return this.indexTable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"columnTable",{get:function(){return this.columnsTable},enumerable:!0,configurable:!0}),t.prototype.serialize=function(){return{data:this.dataTable.serialize(),index:this.indexTable.serialize(),columns:this.columnsTable.serialize()}},t.prototype.getColumnTypeId=function(t,e){return t.schema.fields[e].type.typeId},t.prototype.nanosToDate=function(t){return new Date(t/1e6)},t}(),rh=function(){return(rh=Object.assign||function(t){for(var e,i=1,n=arguments.length;i0?t.argsDataframeToObject(e.dfs):{};i=rh(rh({},i),n);var a=Boolean(e.disabled),r=e.theme;r&&oh(r);var s={disabled:a,args:i,theme:r},o=new CustomEvent(t.RENDER_EVENT,{detail:s});t.events.dispatchEvent(o)},t.argsDataframeToObject=function(e){var i=e.map((function(e){var i=e.key,n=e.value;return[i,t.toArrowTable(n)]}));return Object.fromEntries(i)},t.toArrowTable=function(t){var e=t.data,i=e.data,n=e.index,a=e.columns,r=e.styler;return new ah(i,n,a,r)},t.sendBackMsg=function(t,e){window.parent.postMessage(rh({isStreamlitMessage:!0,type:t},e),"*")},t}(),oh=function(t){var e=document.createElement("style");document.head.appendChild(e),e.innerHTML="\n :root {\n --primary-color: "+t.primaryColor+";\n --background-color: "+t.backgroundColor+";\n --secondary-background-color: "+t.secondaryBackgroundColor+";\n --text-color: "+t.textColor+";\n --font: "+t.font+";\n }\n\n body {\n background-color: var(--background-color);\n color: var(--text-color);\n }\n "};var lh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}lh(e,t),e.prototype.componentDidMount=function(){sh.setFrameHeight()},e.prototype.componentDidUpdate=function(){sh.setFrameHeight()}}(d.a.PureComponent);function hh(t){var e=function(e){function i(i){var n=e.call(this,i)||this;return n.componentDidMount=function(){sh.events.addEventListener(sh.RENDER_EVENT,n.onRenderEvent),sh.setComponentReady()},n.componentDidUpdate=function(){null!=n.state.componentError&&sh.setFrameHeight()},n.componentWillUnmount=function(){sh.events.removeEventListener(sh.RENDER_EVENT,n.onRenderEvent)},n.onRenderEvent=function(t){var e=t;n.setState({renderData:e.detail})},n.render=function(){return null!=n.state.componentError?d.a.createElement("div",null,d.a.createElement("h1",null,"Component Error"),d.a.createElement("span",null,n.state.componentError.message)):null==n.state.renderData?null:d.a.createElement(t,{width:window.innerWidth,disabled:n.state.renderData.disabled,args:n.state.renderData.args,theme:n.state.renderData.theme})},n.state={renderData:void 0,componentError:void 0},n}return lh(i,e),i.getDerivedStateFromError=function(t){return{componentError:t}},i}(d.a.PureComponent);return c()(e,t)}},function(t,e,i){"use strict";var n=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function s(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},i=0;i<10;i++)e["_"+String.fromCharCode(i)]=i;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(a){return!1}}()?Object.assign:function(t,e){for(var i,o,l=s(t),h=1;hB.length&&B.push(t)}function D(t,e,i){return null==t?0:function t(e,i,n,a){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var l=!1;if(null===e)l=!0;else switch(o){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case r:case s:l=!0}}if(l)return n(a,e,""===i?"."+L(e,0):i),1;if(l=0,i=""===i?".":i+":",Array.isArray(e))for(var h=0;h