g(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b}\nfunction g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if(\"object\"===typeof performance&&\"function\"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D=\"function\"===typeof setTimeout?setTimeout:null,E=\"function\"===typeof clearTimeout?clearTimeout:null,F=\"undefined\"!==typeof setImmediate?setImmediate:null;\n\"undefined\"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t)}}function H(a){B=!1;G(a);if(!A)if(null!==h(r))A=!0,I(J);else{var b=h(t);null!==b&&K(H,b.startTime-a)}}\nfunction J(a,b){A=!1;B&&(B=!1,E(L),L=-1);z=!0;var c=y;try{G(b);for(v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if(\"function\"===typeof d){v.callback=null;y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?v.callback=e:v===h(r)&&k(r);G(b)}else k(r);v=h(r)}if(null!==v)var w=!0;else{var m=h(t);null!==m&&K(H,m.startTime-b);w=!1}return w}finally{v=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1;\nfunction M(){return exports.unstable_now()-Qa||125d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a};\nexports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","/** @license React v16.14.0\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var l=require(\"object-assign\"),n=\"function\"===typeof Symbol&&Symbol.for,p=n?Symbol.for(\"react.element\"):60103,q=n?Symbol.for(\"react.portal\"):60106,r=n?Symbol.for(\"react.fragment\"):60107,t=n?Symbol.for(\"react.strict_mode\"):60108,u=n?Symbol.for(\"react.profiler\"):60114,v=n?Symbol.for(\"react.provider\"):60109,w=n?Symbol.for(\"react.context\"):60110,x=n?Symbol.for(\"react.forward_ref\"):60112,y=n?Symbol.for(\"react.suspense\"):60113,z=n?Symbol.for(\"react.memo\"):60115,A=n?Symbol.for(\"react.lazy\"):\n60116,B=\"function\"===typeof Symbol&&Symbol.iterator;function C(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;cQ.length&&Q.push(a)}\nfunction T(a,b,c,e){var d=typeof a;if(\"undefined\"===d||\"boolean\"===d)a=null;var g=!1;if(null===a)g=!0;else switch(d){case \"string\":case \"number\":g=!0;break;case \"object\":switch(a.$$typeof){case p:case q:g=!0}}if(g)return c(e,a,\"\"===b?\".\"+U(a,0):b),1;g=0;b=\"\"===b?\".\":b+\":\";if(Array.isArray(a))for(var k=0;k= 0) continue;\n target[key] = source[key];\n }\n return target;\n}","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;t {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// Licensed to the Apache Software Foundation (ASF) under one\n// or more contributor license agreements. See the NOTICE file\n// distributed with this work for additional information\n// regarding copyright ownership. The ASF licenses this file\n// to you under the Apache License, Version 2.0 (the\n// \"License\"); you may not use this file except in compliance\n// with the License. You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing,\n// software distributed under the License is distributed on an\n// \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n// KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations\n// under the License.\n\n////\n//\n// A few enums copied from `fb/Schema.ts` and `fb/Message.ts` because Webpack\n// v4 doesn't seem to be able to tree-shake the rest of those exports.\n//\n// We will have to keep these enums in sync when we re-generate the flatbuffers\n// code from the shchemas. See js/DEVELOP.md for info on how to run flatbuffers\n// code generation.\n//\n////\n\n/**\n * Logical types, vector layouts, and schemas\n *\n * @enum {number}\n */\nexport enum MetadataVersion {\n /**\n * 0.1.0 (October 2016).\n */\n V1 = 0,\n\n /**\n * 0.2.0 (February 2017). Non-backwards compatible with V1.\n */\n V2 = 1,\n\n /**\n * 0.3.0 -> 0.7.1 (May - December 2017). Non-backwards compatible with V2.\n */\n V3 = 2,\n\n /**\n * >= 0.8.0 (December 2017). Non-backwards compatible with V3.\n */\n V4 = 3,\n\n /**\n * >= 1.0.0 (July 2020. Backwards compatible with V4 (V5 readers can read V4\n * metadata and IPC messages). Implementations are recommended to provide a\n * V4 compatibility mode with V5 format changes disabled.\n *\n * Incompatible changes between V4 and V5:\n * - Union buffer layout has changed. In V5, Unions don't have a validity\n * bitmap buffer.\n */\n V5 = 4\n}\n\n/**\n * @enum {number}\n */\nexport enum UnionMode {\n Sparse = 0,\n Dense = 1\n}\n\n/**\n * @enum {number}\n */\nexport enum Precision {\n HALF = 0,\n SINGLE = 1,\n DOUBLE = 2\n}\n\n/**\n * @enum {number}\n */\nexport enum DateUnit {\n DAY = 0,\n MILLISECOND = 1\n}\n\n/**\n * @enum {number}\n */\nexport enum TimeUnit {\n SECOND = 0,\n MILLISECOND = 1,\n MICROSECOND = 2,\n NANOSECOND = 3\n}\n\n/**\n * @enum {number}\n */\nexport enum IntervalUnit {\n YEAR_MONTH = 0,\n DAY_TIME = 1,\n MONTH_DAY_NANO = 2\n}\n\n/**\n * ----------------------------------------------------------------------\n * The root Message type\n * This union enables us to easily send different message types without\n * redundant storage, and in the future we can easily add new message types.\n *\n * Arrow implementations do not need to implement all of the message types,\n * which may include experimental metadata types. For maximum compatibility,\n * it is best to send data using RecordBatch\n *\n * @enum {number}\n */\nexport enum MessageHeader {\n NONE = 0,\n Schema = 1,\n DictionaryBatch = 2,\n RecordBatch = 3,\n Tensor = 4,\n SparseTensor = 5\n}\n\n/**\n * Main data type enumeration.\n *\n * Data types in this library are all *logical*. They can be expressed as\n * either a primitive physical type (bytes or bits of some fixed size), a\n * nested type consisting of other data types, or another data type (e.g. a\n * timestamp encoded as an int64).\n *\n * **Note**: Only enum values 0-17 (NONE through Map) are written to an Arrow\n * IPC payload.\n *\n * The rest of the values are specified here so TypeScript can narrow the type\n * signatures further beyond the base Arrow Types. The Arrow DataTypes include\n * metadata like `bitWidth` that impact the type signatures of the values we\n * accept and return.\n *\n * For example, the `Int8Vector` reads 1-byte numbers from an `Int8Array`, an\n * `Int32Vector` reads a 4-byte number from an `Int32Array`, and an `Int64Vector`\n * reads a pair of 4-byte lo, hi 32-bit integers as a zero-copy slice from the\n * underlying `Int32Array`.\n *\n * Library consumers benefit by knowing the narrowest type, since we can ensure\n * the types across all public methods are propagated, and never bail to `any`.\n * These values are _never_ used at runtime, and they will _never_ be written\n * to the flatbuffers metadata of serialized Arrow IPC payloads.\n */\nexport enum Type {\n NONE = 0, /** The default placeholder type */\n Null = 1, /** A NULL type having no physical storage */\n Int = 2, /** Signed or unsigned 8, 16, 32, or 64-bit little-endian integer */\n Float = 3, /** 2, 4, or 8-byte floating point value */\n Binary = 4, /** Variable-length bytes (no guarantee of UTF8-ness) */\n Utf8 = 5, /** UTF8 variable-length string as List */\n Bool = 6, /** Boolean as 1 bit, LSB bit-packed ordering */\n Decimal = 7, /** Precision-and-scale-based decimal type. Storage type depends on the parameters. */\n Date = 8, /** int32_t days or int64_t milliseconds since the UNIX epoch */\n Time = 9, /** Time as signed 32 or 64-bit integer, representing either seconds, milliseconds, microseconds, or nanoseconds since midnight since midnight */\n Timestamp = 10, /** Exact timestamp encoded with int64 since UNIX epoch (Default unit millisecond) */\n Interval = 11, /** YEAR_MONTH or DAY_TIME interval in SQL style */\n List = 12, /** A list of some logical data type */\n Struct = 13, /** Struct of logical types */\n Union = 14, /** Union of logical types */\n FixedSizeBinary = 15, /** Fixed-size binary. Each value occupies the same number of bytes */\n FixedSizeList = 16, /** Fixed-size list. Each value occupies the same number of bytes */\n Map = 17, /** Map of named logical types */\n\n Dictionary = -1, /** Dictionary aka Category type */\n Int8 = -2,\n Int16 = -3,\n Int32 = -4,\n Int64 = -5,\n Uint8 = -6,\n Uint16 = -7,\n Uint32 = -8,\n Uint64 = -9,\n Float16 = -10,\n Float32 = -11,\n Float64 = -12,\n DateDay = -13,\n DateMillisecond = -14,\n TimestampSecond = -15,\n TimestampMillisecond = -16,\n TimestampMicrosecond = -17,\n TimestampNanosecond = -18,\n TimeSecond = -19,\n TimeMillisecond = -20,\n TimeMicrosecond = -21,\n TimeNanosecond = -22,\n DenseUnion = -23,\n SparseUnion = -24,\n IntervalDayTime = -25,\n IntervalYearMonth = -26,\n}\n\nexport enum BufferType {\n /**\n * used in List type, Dense Union and variable length primitive types (String, Binary)\n */\n OFFSET = 0,\n\n /**\n * actual data, either wixed width primitive types in slots or variable width delimited by an OFFSET vector\n */\n DATA = 1,\n\n /**\n * Bit vector indicating if each value is null\n */\n VALIDITY = 2,\n\n /**\n * Type vector used in Union type\n */\n TYPE = 3\n}\n","// Licensed to the Apache Software Foundation (ASF) under one\n// or more contributor license agreements. See the NOTICE file\n// distributed with this work for additional information\n// regarding copyright ownership. The ASF licenses this file\n// to you under the Apache License, Version 2.0 (the\n// \"License\"); you may not use this file except in compliance\n// with the License. You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing,\n// software distributed under the License is distributed on an\n// \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n// KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations\n// under the License.\n\nimport { ReadableInterop, ArrowJSONLike } from '../io/interfaces.js';\n\n/* eslint-disable unicorn/throw-new-error */\n\n/** @ignore */\ntype FSReadStream = import('fs').ReadStream;\n/** @ignore */\ntype FileHandle = import('fs').promises.FileHandle;\n\n/** @ignore */\nexport interface Subscription {\n unsubscribe: () => void;\n}\n\n/** @ignore */\nexport interface Observer {\n closed?: boolean;\n next: (value: T) => void;\n error: (err: any) => void;\n complete: () => void;\n}\n\n/** @ignore */\nexport interface Observable {\n subscribe: (observer: Observer) => Subscription;\n}\n\n/** @ignore */\nconst [BigIntCtor, BigIntAvailable] = (() => {\n const BigIntUnavailableError = () => { throw new Error('BigInt is not available in this environment'); };\n function BigIntUnavailable() { throw BigIntUnavailableError(); }\n BigIntUnavailable.asIntN = () => { throw BigIntUnavailableError(); };\n BigIntUnavailable.asUintN = () => { throw BigIntUnavailableError(); };\n return typeof BigInt !== 'undefined' ? [BigInt, true] : [BigIntUnavailable, false];\n})() as [BigIntConstructor, boolean];\n\n/** @ignore */\nconst [BigInt64ArrayCtor, BigInt64ArrayAvailable] = (() => {\n const BigInt64ArrayUnavailableError = () => { throw new Error('BigInt64Array is not available in this environment'); };\n class BigInt64ArrayUnavailable {\n static get BYTES_PER_ELEMENT() { return 8; }\n static of() { throw BigInt64ArrayUnavailableError(); }\n static from() { throw BigInt64ArrayUnavailableError(); }\n constructor() { throw BigInt64ArrayUnavailableError(); }\n }\n return typeof BigInt64Array !== 'undefined' ? [BigInt64Array, true] : [BigInt64ArrayUnavailable, false];\n})() as [BigInt64ArrayConstructor, boolean];\n\n/** @ignore */\nconst [BigUint64ArrayCtor, BigUint64ArrayAvailable] = (() => {\n const BigUint64ArrayUnavailableError = () => { throw new Error('BigUint64Array is not available in this environment'); };\n class BigUint64ArrayUnavailable {\n static get BYTES_PER_ELEMENT() { return 8; }\n static of() { throw BigUint64ArrayUnavailableError(); }\n static from() { throw BigUint64ArrayUnavailableError(); }\n constructor() { throw BigUint64ArrayUnavailableError(); }\n }\n return typeof BigUint64Array !== 'undefined' ? [BigUint64Array, true] : [BigUint64ArrayUnavailable, false];\n})() as [BigUint64ArrayConstructor, boolean];\n\nexport { BigIntCtor as BigInt, BigIntAvailable };\nexport { BigInt64ArrayCtor as BigInt64Array, BigInt64ArrayAvailable };\nexport { BigUint64ArrayCtor as BigUint64Array, BigUint64ArrayAvailable };\n\n/** @ignore */ const isNumber = (x: any) => typeof x === 'number';\n/** @ignore */ const isBoolean = (x: any) => typeof x === 'boolean';\n/** @ignore */ const isFunction = (x: any) => typeof x === 'function';\n/** @ignore */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport const isObject = (x: any): x is Object => x != null && Object(x) === x;\n\n/** @ignore */\nexport const isPromise = (x: any): x is PromiseLike => {\n return isObject(x) && isFunction(x.then);\n};\n\n/** @ignore */\nexport const isObservable = (x: any): x is Observable => {\n return isObject(x) && isFunction(x.subscribe);\n};\n\n/** @ignore */\nexport const isIterable = (x: any): x is Iterable => {\n return isObject(x) && isFunction(x[Symbol.iterator]);\n};\n\n/** @ignore */\nexport const isAsyncIterable = (x: any): x is AsyncIterable => {\n return isObject(x) && isFunction(x[Symbol.asyncIterator]);\n};\n\n/** @ignore */\nexport const isArrowJSON = (x: any): x is ArrowJSONLike => {\n return isObject(x) && isObject(x['schema']);\n};\n\n/** @ignore */\nexport const isArrayLike = (x: any): x is ArrayLike => {\n return isObject(x) && isNumber(x['length']);\n};\n\n/** @ignore */\nexport const isIteratorResult = (x: any): x is IteratorResult => {\n return isObject(x) && ('done' in x) && ('value' in x);\n};\n\n/** @ignore */\nexport const isUnderlyingSink = (x: any): x is UnderlyingSink => {\n return isObject(x) &&\n isFunction(x['abort']) &&\n isFunction(x['close']) &&\n isFunction(x['start']) &&\n isFunction(x['write']);\n};\n\n/** @ignore */\nexport const isFileHandle = (x: any): x is FileHandle => {\n return isObject(x) && isFunction(x['stat']) && isNumber(x['fd']);\n};\n\n/** @ignore */\nexport const isFSReadStream = (x: any): x is FSReadStream => {\n return isReadableNodeStream(x) && isNumber((x)['bytesRead']);\n};\n\n/** @ignore */\nexport const isFetchResponse = (x: any): x is Response => {\n return isObject(x) && isReadableDOMStream(x['body']);\n};\n\nconst isReadableInterop = (x: any): x is ReadableInterop => ('_getDOMStream' in x && '_getNodeStream' in x);\n\n/** @ignore */\nexport const isWritableDOMStream = (x: any): x is WritableStream => {\n return isObject(x) &&\n isFunction(x['abort']) &&\n isFunction(x['getWriter']) &&\n !isReadableInterop(x);\n};\n\n/** @ignore */\nexport const isReadableDOMStream = (x: any): x is ReadableStream => {\n return isObject(x) &&\n isFunction(x['cancel']) &&\n isFunction(x['getReader']) &&\n !isReadableInterop(x);\n};\n\n/** @ignore */\nexport const isWritableNodeStream = (x: any): x is NodeJS.WritableStream => {\n return isObject(x) &&\n isFunction(x['end']) &&\n isFunction(x['write']) &&\n isBoolean(x['writable']) &&\n !isReadableInterop(x);\n};\n\n/** @ignore */\nexport const isReadableNodeStream = (x: any): x is NodeJS.ReadableStream => {\n return isObject(x) &&\n isFunction(x['read']) &&\n isFunction(x['pipe']) &&\n isBoolean(x['readable']) &&\n !isReadableInterop(x);\n};\n\n/** @ignore */\nexport const isFlatbuffersByteBuffer = (x: any): x is import('flatbuffers').ByteBuffer => {\n return isObject(x) &&\n isFunction(x['clear']) &&\n isFunction(x['bytes']) &&\n isFunction(x['position']) &&\n isFunction(x['setPosition']) &&\n isFunction(x['capacity']) &&\n isFunction(x['getBufferIdentifier']) &&\n isFunction(x['createLong']);\n};\n","// Licensed to the Apache Software Foundation (ASF) under one\n// or more contributor license agreements. See the NOTICE file\n// distributed with this work for additional information\n// regarding copyright ownership. The ASF licenses this file\n// to you under the Apache License, Version 2.0 (the\n// \"License\"); you may not use this file except in compliance\n// with the License. You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing,\n// software distributed under the License is distributed on an\n// \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n// KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations\n// under the License.\n\nimport { BigInt64Array, BigUint64Array } from './compat.js';\n\n/** @ignore */ const undf = void (0);\n\n/** @ignore */\nexport function valueToString(x: any): string {\n if (x === null) { return 'null'; }\n if (x === undf) { return 'undefined'; }\n switch (typeof x) {\n case 'number': return `${x}`;\n case 'bigint': return `${x}`;\n case 'string': return `\"${x}\"`;\n }\n // If [Symbol.toPrimitive] is implemented (like in BN)\n // use it instead of JSON.stringify(). This ensures we\n // print BigInts, Decimals, and Binary in their native\n // representation\n if (typeof x[Symbol.toPrimitive] === 'function') {\n return x[Symbol.toPrimitive]('string');\n }\n if (ArrayBuffer.isView(x)) {\n if (x instanceof BigInt64Array || x instanceof BigUint64Array) {\n return `[${[...x].map(x => valueToString(x))}]`;\n }\n return `[${x}]`;\n }\n return ArrayBuffer.isView(x) ? `[${x}]` : JSON.stringify(x, (_, y) => typeof y === 'bigint' ? `${y}` : y);\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n function next() {\n while (env.stack.length) {\n var rec = env.stack.pop();\n try {\n var result = rec.dispose && rec.dispose.call(rec.value);\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n catch (e) {\n fail(e);\n }\n }\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","// Licensed to the Apache Software Foundation (ASF) under one\n// or more contributor license agreements. See the NOTICE file\n// distributed with this work for additional information\n// regarding copyright ownership. The ASF licenses this file\n// to you under the Apache License, Version 2.0 (the\n// \"License\"); you may not use this file except in compliance\n// with the License. You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing,\n// software distributed under the License is distributed on an\n// \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n// KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations\n// under the License.\n\nconst decoder = new TextDecoder('utf-8');\n/** @ignore */\nexport const decodeUtf8 = (buffer?: BufferSource) => decoder.decode(buffer);\n\nconst encoder = new TextEncoder();\n/** @ignore */\nexport const encodeUtf8 = (value?: string) => encoder.encode(value);\n","// Licensed to the Apache Software Foundation (ASF) under one\n// or more contributor license agreements. See the NOTICE file\n// distributed with this work for additional information\n// regarding copyright ownership. The ASF licenses this file\n// to you under the Apache License, Version 2.0 (the\n// \"License\"); you may not use this file except in compliance\n// with the License. You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing,\n// software distributed under the License is distributed on an\n// \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n// KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations\n// under the License.\n\nimport { encodeUtf8 } from '../util/utf8.js';\nimport { TypedArray, TypedArrayConstructor, BigIntArrayConstructor } from '../interfaces.js';\nimport { isPromise, isIterable, isAsyncIterable, isIteratorResult, isFlatbuffersByteBuffer, BigInt64Array, BigUint64Array } from './compat.js';\nimport { ByteBuffer } from 'flatbuffers';\n\n/** @ignore */\nconst SharedArrayBuf = (typeof SharedArrayBuffer !== 'undefined' ? SharedArrayBuffer : ArrayBuffer);\n\n/** @ignore */\nfunction collapseContiguousByteRanges(chunks: Uint8Array[]) {\n const result = chunks[0] ? [chunks[0]] : [];\n let xOffset: number, yOffset: number, xLen: number, yLen: number;\n for (let x, y, i = 0, j = 0, n = chunks.length; ++i < n;) {\n x = result[j];\n y = chunks[i];\n // continue if x and y don't share the same underlying ArrayBuffer, or if x isn't before y\n if (!x || !y || x.buffer !== y.buffer || y.byteOffset < x.byteOffset) {\n y && (result[++j] = y);\n continue;\n }\n ({ byteOffset: xOffset, byteLength: xLen } = x);\n ({ byteOffset: yOffset, byteLength: yLen } = y);\n // continue if the byte ranges of x and y aren't contiguous\n if ((xOffset + xLen) < yOffset || (yOffset + yLen) < xOffset) {\n y && (result[++j] = y);\n continue;\n }\n result[j] = new Uint8Array(x.buffer, xOffset, yOffset - xOffset + yLen);\n }\n return result;\n}\n\n/** @ignore */\nexport function memcpy(target: TTarget, source: TSource, targetByteOffset = 0, sourceByteLength = source.byteLength) {\n const targetByteLength = target.byteLength;\n const dst = new Uint8Array(target.buffer, target.byteOffset, targetByteLength);\n const src = new Uint8Array(source.buffer, source.byteOffset, Math.min(sourceByteLength, targetByteLength));\n dst.set(src, targetByteOffset);\n return target;\n}\n\n/** @ignore */\nexport function joinUint8Arrays(chunks: Uint8Array[], size?: number | null): [Uint8Array, Uint8Array[], number] {\n // collapse chunks that share the same underlying ArrayBuffer and whose byte ranges overlap,\n // to avoid unnecessarily copying the bytes to do this buffer join. This is a common case during\n // streaming, where we may be reading partial byte ranges out of the same underlying ArrayBuffer\n const result = collapseContiguousByteRanges(chunks);\n const byteLength = result.reduce((x, b) => x + b.byteLength, 0);\n let source: Uint8Array, sliced: Uint8Array, buffer: Uint8Array | void;\n let offset = 0, index = -1;\n const length = Math.min(size || Number.POSITIVE_INFINITY, byteLength);\n for (const n = result.length; ++index < n;) {\n source = result[index];\n sliced = source.subarray(0, Math.min(source.length, length - offset));\n if (length <= (offset + sliced.length)) {\n if (sliced.length < source.length) {\n result[index] = source.subarray(sliced.length);\n } else if (sliced.length === source.length) { index++; }\n buffer ? memcpy(buffer, sliced, offset) : (buffer = sliced);\n break;\n }\n memcpy(buffer || (buffer = new Uint8Array(length)), sliced, offset);\n offset += sliced.length;\n }\n return [buffer || new Uint8Array(0), result.slice(index), byteLength - (buffer ? buffer.byteLength : 0)];\n}\n\n/** @ignore */\nexport type ArrayBufferViewInput = ArrayBufferView | ArrayBufferLike | ArrayBufferView | Iterable | ArrayLike | ByteBuffer | string | null | undefined |\n IteratorResult | ArrayLike | ByteBuffer | string | null | undefined> |\n ReadableStreamReadResult | ArrayLike | ByteBuffer | string | null | undefined>;\n\n/** @ignore */\nexport function toArrayBufferView<\n T extends TypedArrayConstructor | BigIntArrayConstructor\n>(ArrayBufferViewCtor: any, input: ArrayBufferViewInput): InstanceType {\n\n let value: any = isIteratorResult(input) ? input.value : input;\n\n if (value instanceof ArrayBufferViewCtor) {\n if (ArrayBufferViewCtor === Uint8Array) {\n // Node's `Buffer` class passes the `instanceof Uint8Array` check, but we need\n // a real Uint8Array, since Buffer#slice isn't the same as Uint8Array#slice :/\n return new ArrayBufferViewCtor(value.buffer, value.byteOffset, value.byteLength);\n }\n return value;\n }\n if (!value) { return new ArrayBufferViewCtor(0); }\n if (typeof value === 'string') { value = encodeUtf8(value); }\n if (value instanceof ArrayBuffer) { return new ArrayBufferViewCtor(value); }\n if (value instanceof SharedArrayBuf) { return new ArrayBufferViewCtor(value); }\n if (isFlatbuffersByteBuffer(value)) { return toArrayBufferView(ArrayBufferViewCtor, value.bytes()); }\n return !ArrayBuffer.isView(value) ? ArrayBufferViewCtor.from(value) : (value.byteLength <= 0 ? new ArrayBufferViewCtor(0)\n : new ArrayBufferViewCtor(value.buffer, value.byteOffset, value.byteLength / ArrayBufferViewCtor.BYTES_PER_ELEMENT));\n}\n\n/** @ignore */ export const toInt8Array = (input: ArrayBufferViewInput) => toArrayBufferView(Int8Array, input);\n/** @ignore */ export const toInt16Array = (input: ArrayBufferViewInput) => toArrayBufferView(Int16Array, input);\n/** @ignore */ export const toInt32Array = (input: ArrayBufferViewInput) => toArrayBufferView(Int32Array, input);\n/** @ignore */ export const toBigInt64Array = (input: ArrayBufferViewInput) => toArrayBufferView(BigInt64Array, input);\n/** @ignore */ export const toUint8Array = (input: ArrayBufferViewInput) => toArrayBufferView(Uint8Array, input);\n/** @ignore */ export const toUint16Array = (input: ArrayBufferViewInput) => toArrayBufferView(Uint16Array, input);\n/** @ignore */ export const toUint32Array = (input: ArrayBufferViewInput) => toArrayBufferView(Uint32Array, input);\n/** @ignore */ export const toBigUint64Array = (input: ArrayBufferViewInput) => toArrayBufferView(BigUint64Array, input);\n/** @ignore */ export const toFloat32Array = (input: ArrayBufferViewInput) => toArrayBufferView(Float32Array, input);\n/** @ignore */ export const toFloat64Array = (input: ArrayBufferViewInput) => toArrayBufferView(Float64Array, input);\n/** @ignore */ export const toUint8ClampedArray = (input: ArrayBufferViewInput) => toArrayBufferView(Uint8ClampedArray, input);\n\n/** @ignore */\ntype ArrayBufferViewIteratorInput = Iterable | ArrayBufferViewInput;\n\n/** @ignore */\nconst pump = | AsyncIterator>(iterator: T) => { iterator.next(); return iterator; };\n\n/** @ignore */\nexport function* toArrayBufferViewIterator(ArrayCtor: TypedArrayConstructor, source: ArrayBufferViewIteratorInput) {\n const wrap = function*(x: T) { yield x; };\n const buffers: Iterable =\n (typeof source === 'string') ? wrap(source)\n : (ArrayBuffer.isView(source)) ? wrap(source)\n : (source instanceof ArrayBuffer) ? wrap(source)\n : (source instanceof SharedArrayBuf) ? wrap(source)\n : !isIterable(source) ? wrap(source) : source;\n\n yield* pump((function* (it: Iterator): Generator {\n let r: IteratorResult = null;\n do {\n r = it.next(yield toArrayBufferView(ArrayCtor, r));\n } while (!r.done);\n })(buffers[Symbol.iterator]()));\n return new ArrayCtor();\n}\n\n/** @ignore */ export const toInt8ArrayIterator = (input: ArrayBufferViewIteratorInput) => toArrayBufferViewIterator(Int8Array, input);\n/** @ignore */ export const toInt16ArrayIterator = (input: ArrayBufferViewIteratorInput) => toArrayBufferViewIterator(Int16Array, input);\n/** @ignore */ export const toInt32ArrayIterator = (input: ArrayBufferViewIteratorInput) => toArrayBufferViewIterator(Int32Array, input);\n/** @ignore */ export const toUint8ArrayIterator = (input: ArrayBufferViewIteratorInput) => toArrayBufferViewIterator(Uint8Array, input);\n/** @ignore */ export const toUint16ArrayIterator = (input: ArrayBufferViewIteratorInput) => toArrayBufferViewIterator(Uint16Array, input);\n/** @ignore */ export const toUint32ArrayIterator = (input: ArrayBufferViewIteratorInput) => toArrayBufferViewIterator(Uint32Array, input);\n/** @ignore */ export const toFloat32ArrayIterator = (input: ArrayBufferViewIteratorInput) => toArrayBufferViewIterator(Float32Array, input);\n/** @ignore */ export const toFloat64ArrayIterator = (input: ArrayBufferViewIteratorInput) => toArrayBufferViewIterator(Float64Array, input);\n/** @ignore */ export const toUint8ClampedArrayIterator = (input: ArrayBufferViewIteratorInput) => toArrayBufferViewIterator(Uint8ClampedArray, input);\n\n/** @ignore */\ntype ArrayBufferViewAsyncIteratorInput = AsyncIterable | Iterable | PromiseLike | ArrayBufferViewInput;\n\n/** @ignore */\nexport async function* toArrayBufferViewAsyncIterator(ArrayCtor: TypedArrayConstructor, source: ArrayBufferViewAsyncIteratorInput): AsyncGenerator {\n\n // if a Promise, unwrap the Promise and iterate the resolved value\n if (isPromise(source)) {\n return yield* toArrayBufferViewAsyncIterator(ArrayCtor, await source);\n }\n\n const wrap = async function*(x: T) { yield await x; };\n const emit = async function* >(source: T) {\n yield* pump((function* (it: Iterator) {\n let r: IteratorResult = null;\n do {\n r = it.next(yield r?.value);\n } while (!r.done);\n })(source[Symbol.iterator]()));\n };\n\n const buffers: AsyncIterable =\n (typeof source === 'string') ? wrap(source) // if string, wrap in an AsyncIterableIterator\n : (ArrayBuffer.isView(source)) ? wrap(source) // if TypedArray, wrap in an AsyncIterableIterator\n : (source instanceof ArrayBuffer) ? wrap(source) // if ArrayBuffer, wrap in an AsyncIterableIterator\n : (source instanceof SharedArrayBuf) ? wrap(source) // if SharedArrayBuffer, wrap in an AsyncIterableIterator\n : isIterable(source) ? emit(source) // If Iterable, wrap in an AsyncIterableIterator and compose the `next` values\n : !isAsyncIterable(source) ? wrap(source) // If not an AsyncIterable, treat as a sentinel and wrap in an AsyncIterableIterator\n : source; // otherwise if AsyncIterable, use it\n\n yield* pump((async function* (it: AsyncIterator): AsyncGenerator {\n let r: IteratorResult = null;\n do {\n r = await it.next(yield toArrayBufferView(ArrayCtor, r));\n } while (!r.done);\n })(buffers[Symbol.asyncIterator]()));\n return new ArrayCtor();\n}\n\n/** @ignore */ export const toInt8ArrayAsyncIterator = (input: ArrayBufferViewAsyncIteratorInput) => toArrayBufferViewAsyncIterator(Int8Array, input);\n/** @ignore */ export const toInt16ArrayAsyncIterator = (input: ArrayBufferViewAsyncIteratorInput) => toArrayBufferViewAsyncIterator(Int16Array, input);\n/** @ignore */ export const toInt32ArrayAsyncIterator = (input: ArrayBufferViewAsyncIteratorInput) => toArrayBufferViewAsyncIterator(Int32Array, input);\n/** @ignore */ export const toUint8ArrayAsyncIterator = (input: ArrayBufferViewAsyncIteratorInput) => toArrayBufferViewAsyncIterator(Uint8Array, input);\n/** @ignore */ export const toUint16ArrayAsyncIterator = (input: ArrayBufferViewAsyncIteratorInput) => toArrayBufferViewAsyncIterator(Uint16Array, input);\n/** @ignore */ export const toUint32ArrayAsyncIterator = (input: ArrayBufferViewAsyncIteratorInput) => toArrayBufferViewAsyncIterator(Uint32Array, input);\n/** @ignore */ export const toFloat32ArrayAsyncIterator = (input: ArrayBufferViewAsyncIteratorInput) => toArrayBufferViewAsyncIterator(Float32Array, input);\n/** @ignore */ export const toFloat64ArrayAsyncIterator = (input: ArrayBufferViewAsyncIteratorInput) => toArrayBufferViewAsyncIterator(Float64Array, input);\n/** @ignore */ export const toUint8ClampedArrayAsyncIterator = (input: ArrayBufferViewAsyncIteratorInput) => toArrayBufferViewAsyncIterator(Uint8ClampedArray, input);\n\n/** @ignore */\nexport function rebaseValueOffsets(offset: number, length: number, valueOffsets: Int32Array) {\n // If we have a non-zero offset, create a new offsets array with the values\n // shifted by the start offset, such that the new start offset is 0\n if (offset !== 0) {\n valueOffsets = valueOffsets.slice(0, length + 1);\n for (let i = -1; ++i <= length;) {\n valueOffsets[i] += offset;\n }\n }\n return valueOffsets;\n}\n\n/** @ignore */\nexport function compareArrayLike>(a: T, b: T) {\n let i = 0;\n const n = a.length;\n if (n !== b.length) { return false; }\n if (n > 0) {\n do { if (a[i] !== b[i]) { return false; } } while (++i < n);\n }\n return true;\n}\n","// Licensed to the Apache Software Foundation (ASF) under one\n// or more contributor license agreements. See the NOTICE file\n// distributed with this work for additional information\n// regarding copyright ownership. The ASF licenses this file\n// to you under the Apache License, Version 2.0 (the\n// \"License\"); you may not use this file except in compliance\n// with the License. You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing,\n// software distributed under the License is distributed on an\n// \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n// KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations\n// under the License.\n\nimport { ArrayBufferViewInput, toArrayBufferView } from './buffer.js';\nimport { TypedArray, TypedArrayConstructor } from '../interfaces.js';\nimport { BigIntArray, BigIntArrayConstructor } from '../interfaces.js';\nimport { BigIntAvailable, BigInt64Array, BigUint64Array } from './compat.js';\n\n/** @ignore */\nexport const isArrowBigNumSymbol = Symbol.for('isArrowBigNum');\n\n/** @ignore */ type BigNumArray = IntArray | UintArray;\n/** @ignore */ type IntArray = Int8Array | Int16Array | Int32Array;\n/** @ignore */ type UintArray = Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray;\n\n/** @ignore */\nfunction BigNum(this: any, x: any, ...xs: any) {\n if (xs.length === 0) {\n return Object.setPrototypeOf(toArrayBufferView(this['TypedArray'], x), this.constructor.prototype);\n }\n return Object.setPrototypeOf(new this['TypedArray'](x, ...xs), this.constructor.prototype);\n}\n\nBigNum.prototype[isArrowBigNumSymbol] = true;\nBigNum.prototype.toJSON = function >(this: T) { return `\"${bignumToString(this)}\"`; };\nBigNum.prototype.valueOf = function >(this: T) { return bignumToNumber(this); };\nBigNum.prototype.toString = function >(this: T) { return bignumToString(this); };\nBigNum.prototype[Symbol.toPrimitive] = function >(this: T, hint: 'string' | 'number' | 'default' = 'default') {\n switch (hint) {\n case 'number': return bignumToNumber(this);\n case 'string': return bignumToString(this);\n case 'default': return bignumToBigInt(this);\n }\n // @ts-ignore\n return bignumToString(this);\n};\n\n/** @ignore */\ntype TypedArrayConstructorArgs =\n [number | void] |\n [Iterable | Iterable] |\n [ArrayBufferLike, number | void, number | void];\n\n/** @ignore */\nfunction SignedBigNum(this: any, ...args: TypedArrayConstructorArgs) { return BigNum.apply(this, args); }\n/** @ignore */\nfunction UnsignedBigNum(this: any, ...args: TypedArrayConstructorArgs) { return BigNum.apply(this, args); }\n/** @ignore */\nfunction DecimalBigNum(this: any, ...args: TypedArrayConstructorArgs) { return BigNum.apply(this, args); }\n\nObject.setPrototypeOf(SignedBigNum.prototype, Object.create(Int32Array.prototype));\nObject.setPrototypeOf(UnsignedBigNum.prototype, Object.create(Uint32Array.prototype));\nObject.setPrototypeOf(DecimalBigNum.prototype, Object.create(Uint32Array.prototype));\nObject.assign(SignedBigNum.prototype, BigNum.prototype, { 'constructor': SignedBigNum, 'signed': true, 'TypedArray': Int32Array, 'BigIntArray': BigInt64Array });\nObject.assign(UnsignedBigNum.prototype, BigNum.prototype, { 'constructor': UnsignedBigNum, 'signed': false, 'TypedArray': Uint32Array, 'BigIntArray': BigUint64Array });\nObject.assign(DecimalBigNum.prototype, BigNum.prototype, { 'constructor': DecimalBigNum, 'signed': true, 'TypedArray': Uint32Array, 'BigIntArray': BigUint64Array });\n\n/** @ignore */\nfunction bignumToNumber>(bn: T) {\n const { buffer, byteOffset, length, 'signed': signed } = bn;\n const words = new BigUint64Array(buffer, byteOffset, length);\n const negative = signed && words[words.length - 1] & (BigInt(1) << BigInt(63));\n let number = negative ? BigInt(1) : BigInt(0);\n let i = BigInt(0);\n if (!negative) {\n for (const word of words) {\n number += word * (BigInt(1) << (BigInt(32) * i++));\n }\n } else {\n for (const word of words) {\n number += ~word * (BigInt(1) << (BigInt(32) * i++));\n }\n number *= BigInt(-1);\n }\n return number;\n}\n\n/** @ignore */\nexport let bignumToString: { >(a: T): string };\n/** @ignore */\nexport let bignumToBigInt: {