UNPKG

arrakis-js

Version:

Arrakis Javascript client library

4 lines 549 kB
{ "version": 3, "sources": ["../src/index.ts", "../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/util/buffer.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/util/utf8.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/util/compat.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/io/adapters.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/metadata-version.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/union-mode.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/precision.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/date-unit.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/time-unit.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/interval-unit.ts", "../node_modules/.pnpm/flatbuffers@25.9.23/node_modules/flatbuffers/mjs/constants.js", "../node_modules/.pnpm/flatbuffers@25.9.23/node_modules/flatbuffers/mjs/utils.js", "../node_modules/.pnpm/flatbuffers@25.9.23/node_modules/flatbuffers/mjs/encoding.js", "../node_modules/.pnpm/flatbuffers@25.9.23/node_modules/flatbuffers/mjs/byte-buffer.js", "../node_modules/.pnpm/flatbuffers@25.9.23/node_modules/flatbuffers/mjs/builder.js", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/body-compression-method.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/compression-type.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/body-compression.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/buffer.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/field-node.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/record-batch.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/dictionary-batch.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/endianness.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/dictionary-kind.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/int.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/dictionary-encoding.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/key-value.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/binary.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/bool.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/date.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/decimal.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/duration.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/fixed-size-binary.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/fixed-size-list.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/floating-point.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/interval.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/large-binary.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/large-utf8.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/list.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/map.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/null.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/struct-.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/time.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/timestamp.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/union.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/utf8.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/type.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/field.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/schema.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/message-header.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/src/enum.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/util/vector.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/util/pretty.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/util/bn.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/util/bigint.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/src/type.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/src/visitor.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/util/math.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/visitor/set.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/row/struct.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/visitor/get.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/row/map.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/util/bit.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/src/data.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/util/chunk.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/visitor/indexof.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/visitor/iterator.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/src/vector.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/builder/valid.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/builder/buffer.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/src/builder.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/block.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/footer.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/src/schema.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/ipc/metadata/file.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/fb/message.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/visitor/typeassembler.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/ipc/metadata/json.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/ipc/metadata/message.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/io/interfaces.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/io/stream.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/io/file.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/util/int.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/util/interval.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/visitor/vectorloader.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/builder/binary.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/builder/largebinary.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/builder/bool.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/builder/date.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/builder/decimal.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/builder/dictionary.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/builder/fixedsizebinary.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/builder/fixedsizelist.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/builder/float.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/builder/interval.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/builder/duration.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/builder/int.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/builder/list.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/builder/map.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/builder/null.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/builder/struct.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/builder/timestamp.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/builder/time.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/builder/union.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/builder/utf8.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/builder/largeutf8.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/visitor/builderctor.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/visitor/typecomparator.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/src/factories.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/util/recordbatch.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/src/table.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/src/recordbatch.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/ipc/message.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/ipc/compression/validators.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/ipc/compression/registry.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/ipc/compression/constants.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/ipc/reader.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/visitor/vectorassembler.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/ipc/writer.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/io/whatwg/iterable.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/io/whatwg/builder.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/io/whatwg/reader.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/io/whatwg/writer.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/src/Arrow.ts", "../node_modules/.pnpm/apache-arrow@21.1.0/node_modules/apache-arrow/src/Arrow.dom.ts", "../src/utils.ts", "../src/block.ts", "../src/channel.ts", "../src/constants.ts", "../src/query.ts", "../src/client.ts", "../src/api.ts"], "sourcesContent": ["// Copyright (c) 2025, California Institute of Technology and contributors\n//\n// You should have received a copy of the licensing terms for this\n// software included in the file \"LICENSE\" located in the top-level\n// directory of this package. If you did not, you can view a copy at\n// https://git.ligo.org/ngdd/arrakis-js/-/raw/main/LICENSE\n\nimport { count, describe, fetch, find, stream } from \"./api.js\";\nimport Client from \"./client.js\";\nimport { gpsToUnix, now, unixToGps } from \"./utils.js\";\n\nexport {\n Client,\n count,\n describe,\n fetch,\n find,\n gpsToUnix,\n now,\n stream,\n unixToGps,\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, Iterator */\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 = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"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 = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\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\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\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, inner;\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 if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\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 var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\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 __rewriteRelativeImportExtension,\n};\n", null, null, null, null, null, null, null, null, null, null, "export const SIZEOF_SHORT = 2;\nexport const SIZEOF_INT = 4;\nexport const FILE_IDENTIFIER_LENGTH = 4;\nexport const SIZE_PREFIX_LENGTH = 4;\n", "export const int32 = new Int32Array(2);\nexport const float32 = new Float32Array(int32.buffer);\nexport const float64 = new Float64Array(int32.buffer);\nexport const isLittleEndian = new Uint16Array(new Uint8Array([1, 0]).buffer)[0] === 1;\n", "export var Encoding;\n(function (Encoding) {\n Encoding[Encoding[\"UTF8_BYTES\"] = 1] = \"UTF8_BYTES\";\n Encoding[Encoding[\"UTF16_STRING\"] = 2] = \"UTF16_STRING\";\n})(Encoding || (Encoding = {}));\n", "import { FILE_IDENTIFIER_LENGTH, SIZEOF_INT } from './constants.js';\nimport { Encoding } from './encoding.js';\nimport { float32, float64, int32, isLittleEndian } from './utils.js';\nexport class ByteBuffer {\n /**\n * Create a new ByteBuffer with a given array of bytes (`Uint8Array`)\n */\n constructor(bytes_) {\n this.bytes_ = bytes_;\n this.position_ = 0;\n this.text_decoder_ = new TextDecoder();\n }\n /**\n * Create and allocate a new ByteBuffer with a given size.\n */\n static allocate(byte_size) {\n return new ByteBuffer(new Uint8Array(byte_size));\n }\n clear() {\n this.position_ = 0;\n }\n /**\n * Get the underlying `Uint8Array`.\n */\n bytes() {\n return this.bytes_;\n }\n /**\n * Get the buffer's position.\n */\n position() {\n return this.position_;\n }\n /**\n * Set the buffer's position.\n */\n setPosition(position) {\n this.position_ = position;\n }\n /**\n * Get the buffer's capacity.\n */\n capacity() {\n return this.bytes_.length;\n }\n readInt8(offset) {\n return (this.readUint8(offset) << 24) >> 24;\n }\n readUint8(offset) {\n return this.bytes_[offset];\n }\n readInt16(offset) {\n return (this.readUint16(offset) << 16) >> 16;\n }\n readUint16(offset) {\n return this.bytes_[offset] | (this.bytes_[offset + 1] << 8);\n }\n readInt32(offset) {\n return (this.bytes_[offset] |\n (this.bytes_[offset + 1] << 8) |\n (this.bytes_[offset + 2] << 16) |\n (this.bytes_[offset + 3] << 24));\n }\n readUint32(offset) {\n return this.readInt32(offset) >>> 0;\n }\n readInt64(offset) {\n return BigInt.asIntN(64, BigInt(this.readUint32(offset)) +\n (BigInt(this.readUint32(offset + 4)) << BigInt(32)));\n }\n readUint64(offset) {\n return BigInt.asUintN(64, BigInt(this.readUint32(offset)) +\n (BigInt(this.readUint32(offset + 4)) << BigInt(32)));\n }\n readFloat32(offset) {\n int32[0] = this.readInt32(offset);\n return float32[0];\n }\n readFloat64(offset) {\n int32[isLittleEndian ? 0 : 1] = this.readInt32(offset);\n int32[isLittleEndian ? 1 : 0] = this.readInt32(offset + 4);\n return float64[0];\n }\n writeInt8(offset, value) {\n this.bytes_[offset] = value;\n }\n writeUint8(offset, value) {\n this.bytes_[offset] = value;\n }\n writeInt16(offset, value) {\n this.bytes_[offset] = value;\n this.bytes_[offset + 1] = value >> 8;\n }\n writeUint16(offset, value) {\n this.bytes_[offset] = value;\n this.bytes_[offset + 1] = value >> 8;\n }\n writeInt32(offset, value) {\n this.bytes_[offset] = value;\n this.bytes_[offset + 1] = value >> 8;\n this.bytes_[offset + 2] = value >> 16;\n this.bytes_[offset + 3] = value >> 24;\n }\n writeUint32(offset, value) {\n this.bytes_[offset] = value;\n this.bytes_[offset + 1] = value >> 8;\n this.bytes_[offset + 2] = value >> 16;\n this.bytes_[offset + 3] = value >> 24;\n }\n writeInt64(offset, value) {\n this.writeInt32(offset, Number(BigInt.asIntN(32, value)));\n this.writeInt32(offset + 4, Number(BigInt.asIntN(32, value >> BigInt(32))));\n }\n writeUint64(offset, value) {\n this.writeUint32(offset, Number(BigInt.asUintN(32, value)));\n this.writeUint32(offset + 4, Number(BigInt.asUintN(32, value >> BigInt(32))));\n }\n writeFloat32(offset, value) {\n float32[0] = value;\n this.writeInt32(offset, int32[0]);\n }\n writeFloat64(offset, value) {\n float64[0] = value;\n this.writeInt32(offset, int32[isLittleEndian ? 0 : 1]);\n this.writeInt32(offset + 4, int32[isLittleEndian ? 1 : 0]);\n }\n /**\n * Return the file identifier. Behavior is undefined for FlatBuffers whose\n * schema does not include a file_identifier (likely points at padding or the\n * start of a the root vtable).\n */\n getBufferIdentifier() {\n if (this.bytes_.length <\n this.position_ + SIZEOF_INT + FILE_IDENTIFIER_LENGTH) {\n throw new Error('FlatBuffers: ByteBuffer is too short to contain an identifier.');\n }\n let result = '';\n for (let i = 0; i < FILE_IDENTIFIER_LENGTH; i++) {\n result += String.fromCharCode(this.readInt8(this.position_ + SIZEOF_INT + i));\n }\n return result;\n }\n /**\n * Look up a field in the vtable, return an offset into the object, or 0 if the\n * field is not present.\n */\n __offset(bb_pos, vtable_offset) {\n const vtable = bb_pos - this.readInt32(bb_pos);\n return vtable_offset < this.readInt16(vtable)\n ? this.readInt16(vtable + vtable_offset)\n : 0;\n }\n /**\n * Initialize any Table-derived type to point to the union at the given offset.\n */\n __union(t, offset) {\n t.bb_pos = offset + this.readInt32(offset);\n t.bb = this;\n return t;\n }\n /**\n * Create a JavaScript string from UTF-8 data stored inside the FlatBuffer.\n * This allocates a new string and converts to wide chars upon each access.\n *\n * To avoid the conversion to string, pass Encoding.UTF8_BYTES as the\n * \"optionalEncoding\" argument. This is useful for avoiding conversion when\n * the data will just be packaged back up in another FlatBuffer later on.\n *\n * @param offset\n * @param opt_encoding Defaults to UTF16_STRING\n */\n __string(offset, opt_encoding) {\n offset += this.readInt32(offset);\n const length = this.readInt32(offset);\n offset += SIZEOF_INT;\n const utf8bytes = this.bytes_.subarray(offset, offset + length);\n if (opt_encoding === Encoding.UTF8_BYTES)\n return utf8bytes;\n else\n return this.text_decoder_.decode(utf8bytes);\n }\n /**\n * Handle unions that can contain string as its member, if a Table-derived type then initialize it,\n * if a string then return a new one\n *\n * WARNING: strings are immutable in JS so we can't change the string that the user gave us, this\n * makes the behaviour of __union_with_string different compared to __union\n */\n __union_with_string(o, offset) {\n if (typeof o === 'string') {\n return this.__string(offset);\n }\n return this.__union(o, offset);\n }\n /**\n * Retrieve the relative offset stored at \"offset\"\n */\n __indirect(offset) {\n return offset + this.readInt32(offset);\n }\n /**\n * Get the start of data of a vector whose offset is stored at \"offset\" in this object.\n */\n __vector(offset) {\n return offset + this.readInt32(offset) + SIZEOF_INT; // data starts after the length\n }\n /**\n * Get the length of a vector whose offset is stored at \"offset\" in this object.\n */\n __vector_len(offset) {\n return this.readInt32(offset + this.readInt32(offset));\n }\n __has_identifier(ident) {\n if (ident.length != FILE_IDENTIFIER_LENGTH) {\n throw new Error('FlatBuffers: file identifier must be length ' + FILE_IDENTIFIER_LENGTH);\n }\n for (let i = 0; i < FILE_IDENTIFIER_LENGTH; i++) {\n if (ident.charCodeAt(i) != this.readInt8(this.position() + SIZEOF_INT + i)) {\n return false;\n }\n }\n return true;\n }\n /**\n * A helper function for generating list for obj api\n */\n createScalarList(listAccessor, listLength) {\n const ret = [];\n for (let i = 0; i < listLength; ++i) {\n const val = listAccessor(i);\n if (val !== null) {\n ret.push(val);\n }\n }\n return ret;\n }\n /**\n * A helper function for generating list for obj api\n * @param listAccessor function that accepts an index and return data at that index\n * @param listLength listLength\n * @param res result list\n */\n createObjList(listAccessor, listLength) {\n const ret = [];\n for (let i = 0; i < listLength; ++i) {\n const val = listAccessor(i);\n if (val !== null) {\n ret.push(val.unpack());\n }\n }\n return ret;\n }\n}\n", "import { ByteBuffer } from './byte-buffer.js';\nimport { FILE_IDENTIFIER_LENGTH, SIZE_PREFIX_LENGTH, SIZEOF_INT, SIZEOF_SHORT, } from './constants.js';\nexport class Builder {\n /**\n * Create a FlatBufferBuilder.\n */\n constructor(opt_initial_size) {\n /** Minimum alignment encountered so far. */\n this.minalign = 1;\n /** The vtable for the current table. */\n this.vtable = null;\n /** The amount of fields we're actually using. */\n this.vtable_in_use = 0;\n /** Whether we are currently serializing a table. */\n this.isNested = false;\n /** Starting offset of the current struct/table. */\n this.object_start = 0;\n /** List of offsets of all vtables. */\n this.vtables = [];\n /** For the current vector being built. */\n this.vector_num_elems = 0;\n /** False omits default values from the serialized data */\n this.force_defaults = false;\n this.string_maps = null;\n this.text_encoder = new TextEncoder();\n let initial_size;\n if (!opt_initial_size) {\n initial_size = 1024;\n }\n else {\n initial_size = opt_initial_size;\n }\n /**\n * @type {ByteBuffer}\n * @private\n */\n this.bb = ByteBuffer.allocate(initial_size);\n this.space = initial_size;\n }\n clear() {\n this.bb.clear();\n this.space = this.bb.capacity();\n this.minalign = 1;\n this.vtable = null;\n this.vtable_in_use = 0;\n this.isNested = false;\n this.object_start = 0;\n this.vtables = [];\n this.vector_num_elems = 0;\n this.force_defaults = false;\n this.string_maps = null;\n }\n /**\n * In order to save space, fields that are set to their default value\n * don't get serialized into the buffer. Forcing defaults provides a\n * way to manually disable this optimization.\n *\n * @param forceDefaults true always serializes default values\n */\n forceDefaults(forceDefaults) {\n this.force_defaults = forceDefaults;\n }\n /**\n * Get the ByteBuffer representing the FlatBuffer. Only call this after you've\n * called finish(). The actual data starts at the ByteBuffer's current position,\n * not necessarily at 0.\n */\n dataBuffer() {\n return this.bb;\n }\n /**\n * Get the bytes representing the FlatBuffer. Only call this after you've\n * called finish().\n */\n asUint8Array() {\n return this.bb\n .bytes()\n .subarray(this.bb.position(), this.bb.position() + this.offset());\n }\n /**\n * Prepare to write an element of `size` after `additional_bytes` have been\n * written, e.g. if you write a string, you need to align such the int length\n * field is aligned to 4 bytes, and the string data follows it directly. If all\n * you need to do is alignment, `additional_bytes` will be 0.\n *\n * @param size This is the of the new element to write\n * @param additional_bytes The padding size\n */\n prep(size, additional_bytes) {\n // Track the biggest thing we've ever aligned to.\n if (size > this.minalign) {\n this.minalign = size;\n }\n // Find the amount of alignment needed such that `size` is properly\n // aligned after `additional_bytes`\n const align_size = (~(this.bb.capacity() - this.space + additional_bytes) + 1) & (size - 1);\n // Reallocate the buffer if needed.\n while (this.space < align_size + size + additional_bytes) {\n const old_buf_size = this.bb.capacity();\n this.bb = Builder.growByteBuffer(this.bb);\n this.space += this.bb.capacity() - old_buf_size;\n }\n this.pad(align_size);\n }\n pad(byte_size) {\n for (let i = 0; i < byte_size; i++) {\n this.bb.writeInt8(--this.space, 0);\n }\n }\n writeInt8(value) {\n this.bb.writeInt8((this.space -= 1), value);\n }\n writeInt16(value) {\n this.bb.writeInt16((this.space -= 2), value);\n }\n writeInt32(value) {\n this.bb.writeInt32((this.space -= 4), value);\n }\n writeInt64(value) {\n this.bb.writeInt64((this.space -= 8), value);\n }\n writeFloat32(value) {\n this.bb.writeFloat32((this.space -= 4), value);\n }\n writeFloat64(value) {\n this.bb.writeFloat64((this.space -= 8), value);\n }\n /**\n * Add an `int8` to the buffer, properly aligned, and grows the buffer (if necessary).\n * @param value The `int8` to add the buffer.\n */\n addInt8(value) {\n this.prep(1, 0);\n this.writeInt8(value);\n }\n /**\n * Add an `int16` to the buffer, properly aligned, and grows the buffer (if necessary).\n * @param value The `int16` to add the buffer.\n */\n addInt16(value) {\n this.prep(2, 0);\n this.writeInt16(value);\n }\n /**\n * Add an `int32` to the buffer, properly aligned, and grows the buffer (if necessary).\n * @param value The `int32` to add the buffer.\n */\n addInt32(value) {\n this.prep(4, 0);\n this.writeInt32(value);\n }\n /**\n * Add an `int64` to the buffer, properly aligned, and grows the buffer (if necessary).\n * @param value The `int64` to add the buffer.\n */\n addInt64(value) {\n this.prep(8, 0);\n this.writeInt64(value);\n }\n /**\n * Add a `float32` to the buffer, properly aligned, and grows the buffer (if necessary).\n * @param value The `float32` to add the buffer.\n */\n addFloat32(value) {\n this.prep(4, 0);\n this.writeFloat32(value);\n }\n /**\n * Add a `float64` to the buffer, properly aligned, and grows the buffer (if necessary).\n * @param value The `float64` to add the buffer.\n */\n addFloat64(value) {\n this.prep(8, 0);\n this.writeFloat64(value);\n }\n addFieldInt8(voffset, value, defaultValue) {\n if (this.force_defaults || value != defaultValue) {\n this.addInt8(value);\n this.slot(voffset);\n }\n }\n addFieldInt16(voffset, value, defaultValue) {\n if (this.force_defaults || value != defaultValue) {\n this.addInt16(value);\n this.slot(voffset);\n }\n }\n addFieldInt32(voffset, value, defaultValue) {\n if (this.force_defaults || value != defaultValue) {\n this.addInt32(value);\n this.slot(voffset);\n }\n }\n addFieldInt64(voffset, value, defaultValue) {\n if (this.force_defaults || value !== defaultValue) {\n this.addInt64(value);\n this.slot(voffset);\n }\n }\n addFieldFloat32(voffset, value, defaultValue) {\n if (this.force_defaults || value != defaultValue) {\n this.addFloat32(value);\n this.slot(voffset);\n }\n }\n addFieldFloat64(voffset, value, defaultValue) {\n if (this.force_defaults || value != defaultValue) {\n this.addFloat64(value);\n this.slot(voffset);\n }\n }\n addFieldOffset(voffset, value, defaultValue) {\n if (this.force_defaults || value != defaultValue) {\n this.addOffset(value);\n this.slot(voffset);\n }\n }\n /**\n * Structs are stored inline, so nothing additional is being added. `d` is always 0.\n */\n addFieldStruct(voffset, value, defaultValue) {\n if (value != defaultValue) {\n this.nested(value);\n this.slot(voffset);\n }\n }\n /**\n * Structures are always stored inline, they need to be created right\n * where they're used. You'll get this assertion failure if you\n * created it elsewhere.\n */\n nested(obj) {\n if (obj != this.offset()) {\n throw new TypeError('FlatBuffers: struct must be serialized inline.');\n }\n }\n /**\n * Should not be creating any other object, string or vector\n * while an object is being constructed\n */\n notNested() {\n if (this.isNested) {\n throw new TypeError('FlatBuffers: object serialization must not be nested.');\n }\n }\n /**\n * Set the current vtable at `voffset` to the current location in the buffer.\n */\n slot(voffset) {\n if (this.vtable !== null)\n this.vtable[voffset] = this.offset();\n }\n /**\n * @returns Offset relative to the end of the buffer.\n */\n offset() {\n return this.bb.capacity() - this.space;\n }\n /**\n * Doubles the size of the backing ByteBuffer and copies the old data towards\n * the end of the new buffer (since we build the buffer backwards).\n *\n * @param bb The current buffer with the existing data\n * @returns A new byte buffer with the old data copied\n * to it. The data is located at the end of the buffer.\n *\n * uint8Array.set() formally takes {Array<number>|ArrayBufferView}, so to pass\n * it a uint8Array we need to suppress the type check:\n * @suppress {checkTypes}\n */\n static growByteBuffer(bb) {\n const old_buf_size = bb.capacity();\n // Ensure we don't grow beyond what fits in an int.\n if (old_buf_size & 0xc0000000) {\n throw new Error('FlatBuffers: cannot grow buffer beyond 2 gigabytes.');\n }\n const new_buf_size = old_buf_size << 1;\n const nbb = ByteBuffer.allocate(new_buf_size);\n nbb.setPosition(new_buf_size - old_buf_size);\n nbb.bytes().set(bb.bytes(), new_buf_size - old_buf_size);\n return nbb;\n }\n /**\n * Adds on offset, relative to where it will be written.\n *\n * @param offset The offset to add.\n */\n addOffset(offset) {\n this.prep(SIZEOF_INT, 0); // Ensure alignment is already done.\n this.writeInt32(this.offset() - offset + SIZEOF_INT);\n }\n /**\n * Start encoding a new object in the buffer. Users will not usually need to\n * call this directly. The FlatBuffers compiler will generate helper methods\n * that call this method internally.\n */\n startObject(numfields) {\n this.notNested();\n if (this.vtable == null) {\n this.vtable = [];\n }\n this.vtable_in