diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..84a6e3bf --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +/.yarn/** linguist-vendored + +*.zip filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..d47c7524 --- /dev/null +++ b/.gitignore @@ -0,0 +1,21 @@ +/.yarn/* +!.yarn/patches +!/.yarn/plugins +!/.yarn/releases +!/.yarn/sdks +!/.yarn/versions + +# Swap the comments on the following lines if you don't wish to use zero-installs +# Documentation here: https://yarnpkg.com/features/zero-installs +!/.yarn/cache +#/.pnp.* + +/build/ +/confio/ +/cosmos/ +/cosmos_proto/ +/cosmwasm/ +/gogoproto/ +/google/ +/ibc/ +/tendermint/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..fb077175 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "wasmd"] + path = wasmd-0.16 + url = https://github.com/cosmwasm/wasmd +[submodule "cosmos-sdk-0.43"] + path = cosmos-sdk-0.43 + url = https://github.com/cosmos/cosmos-sdk diff --git a/.pnp.js b/.pnp.js new file mode 100755 index 00000000..dcd3010b --- /dev/null +++ b/.pnp.js @@ -0,0 +1,10960 @@ +#!/usr/bin/env node +/* eslint-disable */ + +try { + Object.freeze({}).detectStrictMode = true; +} catch (error) { + throw new Error(`The whole PnP file got strict-mode-ified, which is known to break (Emscripten libraries aren't strict mode). This usually happens when the file goes through Babel.`); +} + +var __non_webpack_module__ = module; + +function $$SETUP_STATE(hydrateRuntimeState, basePath) { + return hydrateRuntimeState({ + "__info": [ + "This file is automatically generated. Do not touch it, or risk", + "your modifications being lost. We also recommend you not to read", + "it either without using the @yarnpkg/pnp package, as the data layout", + "is entirely unspecified and WILL change from a version to another." + ], + "dependencyTreeRoots": [ + { + "name": "cosmjs-types", + "reference": "workspace:." + } + ], + "enableTopLevelFallback": true, + "ignorePatternData": "(^(?:\\.yarn\\/sdks(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)|$))$)", + "fallbackExclusionList": [ + ["cosmjs-types", ["workspace:."]] + ], + "fallbackPool": [ + ], + "locationBlacklistData": [ + ], + "packageRegistryData": [ + [null, [ + [null, { + "packageLocation": "./", + "packageDependencies": [ + ["@types/long", "npm:4.0.1"], + ["@types/node", "npm:15.6.2"], + ["long", "npm:4.0.0"], + ["prettier", "npm:2.3.0"], + ["protobufjs", "npm:6.10.2"], + ["ts-proto", "npm:1.81.1"], + ["typescript", "patch:typescript@npm%3A4.0.7#builtin::version=4.0.7&hash=a45b0e"] + ], + "linkType": "SOFT", + }] + ]], + ["@protobufjs/aspromise", [ + ["npm:1.1.2", { + "packageLocation": "./.yarn/cache/@protobufjs-aspromise-npm-1.1.2-71d00b938f-83ced0798a.zip/node_modules/@protobufjs/aspromise/", + "packageDependencies": [ + ["@protobufjs/aspromise", "npm:1.1.2"] + ], + "linkType": "HARD", + }] + ]], + ["@protobufjs/base64", [ + ["npm:1.1.2", { + "packageLocation": "./.yarn/cache/@protobufjs-base64-npm-1.1.2-cd8ca6814a-ae9e84aaf6.zip/node_modules/@protobufjs/base64/", + "packageDependencies": [ + ["@protobufjs/base64", "npm:1.1.2"] + ], + "linkType": "HARD", + }] + ]], + ["@protobufjs/codegen", [ + ["npm:2.0.4", { + "packageLocation": "./.yarn/cache/@protobufjs-codegen-npm-2.0.4-36e188bbe6-a05d5f8892.zip/node_modules/@protobufjs/codegen/", + "packageDependencies": [ + ["@protobufjs/codegen", "npm:2.0.4"] + ], + "linkType": "HARD", + }] + ]], + ["@protobufjs/eventemitter", [ + ["npm:1.1.0", { + "packageLocation": "./.yarn/cache/@protobufjs-eventemitter-npm-1.1.0-029cc7d431-32a84e33f1.zip/node_modules/@protobufjs/eventemitter/", + "packageDependencies": [ + ["@protobufjs/eventemitter", "npm:1.1.0"] + ], + "linkType": "HARD", + }] + ]], + ["@protobufjs/fetch", [ + ["npm:1.1.0", { + "packageLocation": "./.yarn/cache/@protobufjs-fetch-npm-1.1.0-ca857b7df4-d682e5d8a1.zip/node_modules/@protobufjs/fetch/", + "packageDependencies": [ + ["@protobufjs/fetch", "npm:1.1.0"], + ["@protobufjs/aspromise", "npm:1.1.2"], + ["@protobufjs/inquire", "npm:1.1.0"] + ], + "linkType": "HARD", + }] + ]], + ["@protobufjs/float", [ + ["npm:1.0.2", { + "packageLocation": "./.yarn/cache/@protobufjs-float-npm-1.0.2-5678f64d08-eee7278de2.zip/node_modules/@protobufjs/float/", + "packageDependencies": [ + ["@protobufjs/float", "npm:1.0.2"] + ], + "linkType": "HARD", + }] + ]], + ["@protobufjs/inquire", [ + ["npm:1.1.0", { + "packageLocation": "./.yarn/cache/@protobufjs-inquire-npm-1.1.0-3c7759e9ce-3541518cca.zip/node_modules/@protobufjs/inquire/", + "packageDependencies": [ + ["@protobufjs/inquire", "npm:1.1.0"] + ], + "linkType": "HARD", + }] + ]], + ["@protobufjs/path", [ + ["npm:1.1.2", { + "packageLocation": "./.yarn/cache/@protobufjs-path-npm-1.1.2-641d08de76-22f10c5c22.zip/node_modules/@protobufjs/path/", + "packageDependencies": [ + ["@protobufjs/path", "npm:1.1.2"] + ], + "linkType": "HARD", + }] + ]], + ["@protobufjs/pool", [ + ["npm:1.1.0", { + "packageLocation": "./.yarn/cache/@protobufjs-pool-npm-1.1.0-47a76f96a1-5fc4af9e06.zip/node_modules/@protobufjs/pool/", + "packageDependencies": [ + ["@protobufjs/pool", "npm:1.1.0"] + ], + "linkType": "HARD", + }] + ]], + ["@protobufjs/utf8", [ + ["npm:1.1.0", { + "packageLocation": "./.yarn/cache/@protobufjs-utf8-npm-1.1.0-02c590807c-5b3fa7425f.zip/node_modules/@protobufjs/utf8/", + "packageDependencies": [ + ["@protobufjs/utf8", "npm:1.1.0"] + ], + "linkType": "HARD", + }] + ]], + ["@types/long", [ + ["npm:4.0.1", { + "packageLocation": "./.yarn/cache/@types-long-npm-4.0.1-022c8b6e77-ed2a125330.zip/node_modules/@types/long/", + "packageDependencies": [ + ["@types/long", "npm:4.0.1"] + ], + "linkType": "HARD", + }] + ]], + ["@types/node", [ + ["npm:13.13.52", { + "packageLocation": "./.yarn/cache/@types-node-npm-13.13.52-95159539bb-702db7930d.zip/node_modules/@types/node/", + "packageDependencies": [ + ["@types/node", "npm:13.13.52"] + ], + "linkType": "HARD", + }], + ["npm:15.6.1", { + "packageLocation": "./.yarn/cache/@types-node-npm-15.6.1-1a0b9c8653-07b3855bc0.zip/node_modules/@types/node/", + "packageDependencies": [ + ["@types/node", "npm:15.6.1"] + ], + "linkType": "HARD", + }], + ["npm:15.6.2", { + "packageLocation": "./.yarn/cache/@types-node-npm-15.6.2-9d8f9d46a0-e65d6d4750.zip/node_modules/@types/node/", + "packageDependencies": [ + ["@types/node", "npm:15.6.2"] + ], + "linkType": "HARD", + }] + ]], + ["@types/object-hash", [ + ["npm:1.3.4", { + "packageLocation": "./.yarn/cache/@types-object-hash-npm-1.3.4-3b3e2e44e8-2ae12c7b34.zip/node_modules/@types/object-hash/", + "packageDependencies": [ + ["@types/object-hash", "npm:1.3.4"] + ], + "linkType": "HARD", + }] + ]], + ["@types/prettier", [ + ["npm:1.19.1", { + "packageLocation": "./.yarn/cache/@types-prettier-npm-1.19.1-396f22bcd2-394a4364ce.zip/node_modules/@types/prettier/", + "packageDependencies": [ + ["@types/prettier", "npm:1.19.1"] + ], + "linkType": "HARD", + }] + ]], + ["cosmjs-types", [ + ["workspace:.", { + "packageLocation": "./", + "packageDependencies": [ + ["cosmjs-types", "workspace:."], + ["@types/long", "npm:4.0.1"], + ["@types/node", "npm:15.6.2"], + ["long", "npm:4.0.0"], + ["prettier", "npm:2.3.0"], + ["protobufjs", "npm:6.10.2"], + ["ts-proto", "npm:1.81.1"], + ["typescript", "patch:typescript@npm%3A4.0.7#builtin::version=4.0.7&hash=a45b0e"] + ], + "linkType": "SOFT", + }] + ]], + ["dataloader", [ + ["npm:1.4.0", { + "packageLocation": "./.yarn/cache/dataloader-npm-1.4.0-ba03bd2183-1c698b6d47.zip/node_modules/dataloader/", + "packageDependencies": [ + ["dataloader", "npm:1.4.0"] + ], + "linkType": "HARD", + }] + ]], + ["lodash", [ + ["npm:4.17.21", { + "packageLocation": "./.yarn/cache/lodash-npm-4.17.21-6382451519-4983720b9a.zip/node_modules/lodash/", + "packageDependencies": [ + ["lodash", "npm:4.17.21"] + ], + "linkType": "HARD", + }] + ]], + ["long", [ + ["npm:4.0.0", { + "packageLocation": "./.yarn/cache/long-npm-4.0.0-ecd96a31ed-9cebc1ee8b.zip/node_modules/long/", + "packageDependencies": [ + ["long", "npm:4.0.0"] + ], + "linkType": "HARD", + }] + ]], + ["object-hash", [ + ["npm:1.3.1", { + "packageLocation": "./.yarn/cache/object-hash-npm-1.3.1-ea495b8e52-035cb0b0e6.zip/node_modules/object-hash/", + "packageDependencies": [ + ["object-hash", "npm:1.3.1"] + ], + "linkType": "HARD", + }] + ]], + ["prettier", [ + ["npm:2.3.0", { + "packageLocation": "./.yarn/cache/prettier-npm-2.3.0-29ef37e8b6-652640cc8b.zip/node_modules/prettier/", + "packageDependencies": [ + ["prettier", "npm:2.3.0"] + ], + "linkType": "HARD", + }] + ]], + ["protobufjs", [ + ["npm:6.10.2", { + "packageLocation": "./.yarn/unplugged/protobufjs-npm-6.10.2-f0f2cab7fe/node_modules/protobufjs/", + "packageDependencies": [ + ["protobufjs", "npm:6.10.2"], + ["@protobufjs/aspromise", "npm:1.1.2"], + ["@protobufjs/base64", "npm:1.1.2"], + ["@protobufjs/codegen", "npm:2.0.4"], + ["@protobufjs/eventemitter", "npm:1.1.0"], + ["@protobufjs/fetch", "npm:1.1.0"], + ["@protobufjs/float", "npm:1.0.2"], + ["@protobufjs/inquire", "npm:1.1.0"], + ["@protobufjs/path", "npm:1.1.2"], + ["@protobufjs/pool", "npm:1.1.0"], + ["@protobufjs/utf8", "npm:1.1.0"], + ["@types/long", "npm:4.0.1"], + ["@types/node", "npm:13.13.52"], + ["long", "npm:4.0.0"] + ], + "linkType": "HARD", + }], + ["npm:6.11.2", { + "packageLocation": "./.yarn/unplugged/protobufjs-npm-6.11.2-9b422ce98e/node_modules/protobufjs/", + "packageDependencies": [ + ["protobufjs", "npm:6.11.2"], + ["@protobufjs/aspromise", "npm:1.1.2"], + ["@protobufjs/base64", "npm:1.1.2"], + ["@protobufjs/codegen", "npm:2.0.4"], + ["@protobufjs/eventemitter", "npm:1.1.0"], + ["@protobufjs/fetch", "npm:1.1.0"], + ["@protobufjs/float", "npm:1.0.2"], + ["@protobufjs/inquire", "npm:1.1.0"], + ["@protobufjs/path", "npm:1.1.2"], + ["@protobufjs/pool", "npm:1.1.0"], + ["@protobufjs/utf8", "npm:1.1.0"], + ["@types/long", "npm:4.0.1"], + ["@types/node", "npm:15.6.1"], + ["long", "npm:4.0.0"] + ], + "linkType": "HARD", + }] + ]], + ["ts-poet", [ + ["npm:4.5.0", { + "packageLocation": "./.yarn/unplugged/ts-poet-npm-4.5.0-5771bc00e9/node_modules/ts-poet/", + "packageDependencies": [ + ["ts-poet", "npm:4.5.0"], + ["@types/prettier", "npm:1.19.1"], + ["lodash", "npm:4.17.21"], + ["prettier", "npm:2.3.0"] + ], + "linkType": "HARD", + }] + ]], + ["ts-proto", [ + ["npm:1.81.1", { + "packageLocation": "./.yarn/cache/ts-proto-npm-1.81.1-638c7076bc-7d6f3387ea.zip/node_modules/ts-proto/", + "packageDependencies": [ + ["ts-proto", "npm:1.81.1"], + ["@types/object-hash", "npm:1.3.4"], + ["dataloader", "npm:1.4.0"], + ["object-hash", "npm:1.3.1"], + ["protobufjs", "npm:6.11.2"], + ["ts-poet", "npm:4.5.0"], + ["ts-proto-descriptors", "npm:1.2.1"] + ], + "linkType": "HARD", + }] + ]], + ["ts-proto-descriptors", [ + ["npm:1.2.1", { + "packageLocation": "./.yarn/cache/ts-proto-descriptors-npm-1.2.1-bdac3b6021-ad62bdf0a3.zip/node_modules/ts-proto-descriptors/", + "packageDependencies": [ + ["ts-proto-descriptors", "npm:1.2.1"], + ["long", "npm:4.0.0"], + ["protobufjs", "npm:6.11.2"] + ], + "linkType": "HARD", + }] + ]], + ["typescript", [ + ["patch:typescript@npm%3A4.0.7#builtin::version=4.0.7&hash=a45b0e", { + "packageLocation": "./.yarn/cache/typescript-patch-92bf6e8d8b-f234923fbe.zip/node_modules/typescript/", + "packageDependencies": [ + ["typescript", "patch:typescript@npm%3A4.0.7#builtin::version=4.0.7&hash=a45b0e"] + ], + "linkType": "HARD", + }] + ]] + ] + }, {basePath: basePath || __dirname}); + } + +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["pnpHook"] = factory(); + else + root["pnpHook"] = factory(); +})(global, function() { +return /******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ 936: +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + "default": () => /* binding */ _entryPoint +}); + +// EXTERNAL MODULE: external "fs" +var external_fs_ = __webpack_require__(747); +var external_fs_default = /*#__PURE__*/__webpack_require__.n(external_fs_); + +// CONCATENATED MODULE: external "os" +const external_os_namespaceObject = require("os");; +var external_os_default = /*#__PURE__*/__webpack_require__.n(external_os_namespaceObject); + +// EXTERNAL MODULE: external "path" +var external_path_ = __webpack_require__(622); +var external_path_default = /*#__PURE__*/__webpack_require__.n(external_path_); + +// CONCATENATED MODULE: ../yarnpkg-fslib/sources/path.ts + +var PathType; + +(function (PathType) { + PathType[PathType["File"] = 0] = "File"; + PathType[PathType["Portable"] = 1] = "Portable"; + PathType[PathType["Native"] = 2] = "Native"; +})(PathType || (PathType = {})); + +const PortablePath = { + root: `/`, + dot: `.` +}; +const Filename = { + nodeModules: `node_modules`, + manifest: `package.json`, + lockfile: `yarn.lock`, + pnpJs: `.pnp.js`, + rc: `.yarnrc.yml` +}; +const npath = Object.create((external_path_default())); +const ppath = Object.create((external_path_default()).posix); + +npath.cwd = () => process.cwd(); + +ppath.cwd = () => toPortablePath(process.cwd()); + +ppath.resolve = (...segments) => { + if (segments.length > 0 && ppath.isAbsolute(segments[0])) { + return external_path_default().posix.resolve(...segments); + } else { + return external_path_default().posix.resolve(ppath.cwd(), ...segments); + } +}; + +const contains = function (pathUtils, from, to) { + from = pathUtils.normalize(from); + to = pathUtils.normalize(to); + if (from === to) return `.`; + if (!from.endsWith(pathUtils.sep)) from = from + pathUtils.sep; + + if (to.startsWith(from)) { + return to.slice(from.length); + } else { + return null; + } +}; + +npath.fromPortablePath = fromPortablePath; +npath.toPortablePath = toPortablePath; + +npath.contains = (from, to) => contains(npath, from, to); + +ppath.contains = (from, to) => contains(ppath, from, to); + +const WINDOWS_PATH_REGEXP = /^([a-zA-Z]:.*)$/; +const UNC_WINDOWS_PATH_REGEXP = /^\\\\(\.\\)?(.*)$/; +const PORTABLE_PATH_REGEXP = /^\/([a-zA-Z]:.*)$/; +const UNC_PORTABLE_PATH_REGEXP = /^\/unc\/(\.dot\/)?(.*)$/; // Path should look like "/N:/berry/scripts/plugin-pack.js" +// And transform to "N:\berry\scripts\plugin-pack.js" + +function fromPortablePath(p) { + if (process.platform !== `win32`) return p; + if (p.match(PORTABLE_PATH_REGEXP)) p = p.replace(PORTABLE_PATH_REGEXP, `$1`);else if (p.match(UNC_PORTABLE_PATH_REGEXP)) p = p.replace(UNC_PORTABLE_PATH_REGEXP, (match, p1, p2) => `\\\\${p1 ? `.\\` : ``}${p2}`);else return p; + return p.replace(/\//g, `\\`); +} // Path should look like "N:/berry/scripts/plugin-pack.js" +// And transform to "/N:/berry/scripts/plugin-pack.js" + + +function toPortablePath(p) { + if (process.platform !== `win32`) return p; + if (p.match(WINDOWS_PATH_REGEXP)) p = p.replace(WINDOWS_PATH_REGEXP, `/$1`);else if (p.match(UNC_WINDOWS_PATH_REGEXP)) p = p.replace(UNC_WINDOWS_PATH_REGEXP, (match, p1, p2) => `/unc/${p1 ? `.dot/` : ``}${p2}`); + return p.replace(/\\/g, `/`); +} + +function convertPath(targetPathUtils, sourcePath) { + return targetPathUtils === npath ? fromPortablePath(sourcePath) : toPortablePath(sourcePath); +} +function toFilename(filename) { + if (npath.parse(filename).dir !== `` || ppath.parse(filename).dir !== ``) throw new Error(`Invalid filename: "${filename}"`); + return filename; +} +// CONCATENATED MODULE: ../yarnpkg-fslib/sources/algorithms/copyPromise.ts + + // 1980-01-01, like Fedora + +const defaultTime = new Date(315532800 * 1000); +async function copyPromise(destinationFs, destination, sourceFs, source, opts) { + const normalizedDestination = destinationFs.pathUtils.normalize(destination); + const normalizedSource = sourceFs.pathUtils.normalize(source); + const prelayout = []; + const postlayout = []; + await destinationFs.mkdirPromise(destinationFs.pathUtils.dirname(destination), { + recursive: true + }); + const updateTime = typeof destinationFs.lutimesPromise === `function` ? destinationFs.lutimesPromise.bind(destinationFs) : destinationFs.utimesPromise.bind(destinationFs); + await copyImpl(prelayout, postlayout, updateTime, destinationFs, normalizedDestination, sourceFs, normalizedSource, opts); + + for (const operation of prelayout) await operation(); + + await Promise.all(postlayout.map(operation => { + return operation(); + })); +} + +async function copyImpl(prelayout, postlayout, updateTime, destinationFs, destination, sourceFs, source, opts) { + var _a, _b; + + const destinationStat = await maybeLStat(destinationFs, destination); + const sourceStat = await sourceFs.lstatPromise(source); + const referenceTime = opts.stableTime ? { + mtime: defaultTime, + atime: defaultTime + } : sourceStat; + let updated; + + switch (true) { + case sourceStat.isDirectory(): + { + updated = await copyFolder(prelayout, postlayout, updateTime, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); + } + break; + + case sourceStat.isFile(): + { + updated = await copyFile(prelayout, postlayout, updateTime, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); + } + break; + + case sourceStat.isSymbolicLink(): + { + updated = await copySymlink(prelayout, postlayout, updateTime, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts); + } + break; + + default: + { + throw new Error(`Unsupported file type (${sourceStat.mode})`); + } + break; + } + + if (updated || ((_a = destinationStat === null || destinationStat === void 0 ? void 0 : destinationStat.mtime) === null || _a === void 0 ? void 0 : _a.getTime()) !== referenceTime.mtime.getTime() || ((_b = destinationStat === null || destinationStat === void 0 ? void 0 : destinationStat.atime) === null || _b === void 0 ? void 0 : _b.getTime()) !== referenceTime.atime.getTime()) { + postlayout.push(() => updateTime(destination, referenceTime.atime, referenceTime.mtime)); + updated = true; + } + + if (destinationStat === null || (destinationStat.mode & 0o777) !== (sourceStat.mode & 0o777)) { + postlayout.push(() => destinationFs.chmodPromise(destination, sourceStat.mode & 0o777)); + updated = true; + } + + return updated; +} + +async function maybeLStat(baseFs, p) { + try { + return await baseFs.lstatPromise(p); + } catch (e) { + return null; + } +} + +async function copyFolder(prelayout, postlayout, updateTime, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { + if (destinationStat !== null && !destinationStat.isDirectory()) { + if (opts.overwrite) { + prelayout.push(async () => destinationFs.removePromise(destination)); + destinationStat = null; + } else { + return false; + } + } + + let updated = false; + + if (destinationStat === null) { + prelayout.push(async () => destinationFs.mkdirPromise(destination, { + mode: sourceStat.mode + })); + updated = true; + } + + const entries = await sourceFs.readdirPromise(source); + + if (opts.stableSort) { + for (const entry of entries.sort()) { + if (await copyImpl(prelayout, postlayout, updateTime, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), opts)) { + updated = true; + } + } + } else { + const entriesUpdateStatus = await Promise.all(entries.map(async entry => { + await copyImpl(prelayout, postlayout, updateTime, destinationFs, destinationFs.pathUtils.join(destination, entry), sourceFs, sourceFs.pathUtils.join(source, entry), opts); + })); + + if (entriesUpdateStatus.some(status => status)) { + updated = true; + } + } + + return updated; +} + +async function copyFile(prelayout, postlayout, updateTime, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { + if (destinationStat !== null) { + if (opts.overwrite) { + prelayout.push(async () => destinationFs.removePromise(destination)); + destinationStat = null; + } else { + return false; + } + } + + const op = destinationFs === sourceFs ? async () => destinationFs.copyFilePromise(source, destination, (external_fs_default()).constants.COPYFILE_FICLONE) : async () => destinationFs.writeFilePromise(destination, await sourceFs.readFilePromise(source)); + prelayout.push(async () => op()); + return true; +} + +async function copySymlink(prelayout, postlayout, updateTime, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) { + if (destinationStat !== null) { + if (opts.overwrite) { + prelayout.push(async () => destinationFs.removePromise(destination)); + destinationStat = null; + } else { + return false; + } + } + + prelayout.push(async () => { + await destinationFs.symlinkPromise(convertPath(destinationFs.pathUtils, await sourceFs.readlinkPromise(source)), destination); + }); + return true; +} +// CONCATENATED MODULE: ../yarnpkg-fslib/sources/FakeFS.ts + + + +class FakeFS { + constructor(pathUtils) { + this.pathUtils = pathUtils; + } + + async *genTraversePromise(init, { + stableSort = false + } = {}) { + const stack = [init]; + + while (stack.length > 0) { + const p = stack.shift(); + const entry = await this.lstatPromise(p); + + if (entry.isDirectory()) { + const entries = await this.readdirPromise(p); + + if (stableSort) { + for (const entry of entries.sort()) { + stack.push(this.pathUtils.join(p, entry)); + } + } else { + throw new Error(`Not supported`); + } + } else { + yield p; + } + } + } + + async removePromise(p, { + recursive = true, + maxRetries = 5 + } = {}) { + let stat; + + try { + stat = await this.lstatPromise(p); + } catch (error) { + if (error.code === `ENOENT`) { + return; + } else { + throw error; + } + } + + if (stat.isDirectory()) { + if (recursive) for (const entry of await this.readdirPromise(p)) await this.removePromise(this.pathUtils.resolve(p, entry)); // 5 gives 1s worth of retries at worst + + let t = 0; + + do { + try { + await this.rmdirPromise(p); + break; + } catch (error) { + if (error.code === `EBUSY` || error.code === `ENOTEMPTY`) { + if (maxRetries === 0) { + break; + } else { + await new Promise(resolve => setTimeout(resolve, t * 100)); + continue; + } + } else { + throw error; + } + } + } while (t++ < maxRetries); + } else { + await this.unlinkPromise(p); + } + } + + removeSync(p, { + recursive = true + } = {}) { + let stat; + + try { + stat = this.lstatSync(p); + } catch (error) { + if (error.code === `ENOENT`) { + return; + } else { + throw error; + } + } + + if (stat.isDirectory()) { + if (recursive) for (const entry of this.readdirSync(p)) this.removeSync(this.pathUtils.resolve(p, entry)); + this.rmdirSync(p); + } else { + this.unlinkSync(p); + } + } + + async mkdirpPromise(p, { + chmod, + utimes + } = {}) { + p = this.resolve(p); + if (p === this.pathUtils.dirname(p)) return; + const parts = p.split(this.pathUtils.sep); + + for (let u = 2; u <= parts.length; ++u) { + const subPath = parts.slice(0, u).join(this.pathUtils.sep); + + if (!this.existsSync(subPath)) { + try { + await this.mkdirPromise(subPath); + } catch (error) { + if (error.code === `EEXIST`) { + continue; + } else { + throw error; + } + } + + if (chmod != null) await this.chmodPromise(subPath, chmod); + + if (utimes != null) { + await this.utimesPromise(subPath, utimes[0], utimes[1]); + } else { + const parentStat = await this.statPromise(this.pathUtils.dirname(subPath)); + await this.utimesPromise(subPath, parentStat.atime, parentStat.mtime); + } + } + } + } + + mkdirpSync(p, { + chmod, + utimes + } = {}) { + p = this.resolve(p); + if (p === this.pathUtils.dirname(p)) return; + const parts = p.split(this.pathUtils.sep); + + for (let u = 2; u <= parts.length; ++u) { + const subPath = parts.slice(0, u).join(this.pathUtils.sep); + + if (!this.existsSync(subPath)) { + try { + this.mkdirSync(subPath); + } catch (error) { + if (error.code === `EEXIST`) { + continue; + } else { + throw error; + } + } + + if (chmod != null) this.chmodSync(subPath, chmod); + + if (utimes != null) { + this.utimesSync(subPath, utimes[0], utimes[1]); + } else { + const parentStat = this.statSync(this.pathUtils.dirname(subPath)); + this.utimesSync(subPath, parentStat.atime, parentStat.mtime); + } + } + } + } + + async copyPromise(destination, source, { + baseFs = this, + overwrite = true, + stableSort = false, + stableTime = false + } = {}) { + return await copyPromise(this, destination, baseFs, source, { + overwrite, + stableSort, + stableTime + }); + } + + copySync(destination, source, { + baseFs = this, + overwrite = true + } = {}) { + const stat = baseFs.lstatSync(source); + const exists = this.existsSync(destination); + + if (stat.isDirectory()) { + this.mkdirpSync(destination); + const directoryListing = baseFs.readdirSync(source); + + for (const entry of directoryListing) { + this.copySync(this.pathUtils.join(destination, entry), baseFs.pathUtils.join(source, entry), { + baseFs, + overwrite + }); + } + } else if (stat.isFile()) { + if (!exists || overwrite) { + if (exists) this.removeSync(destination); + const content = baseFs.readFileSync(source); + this.writeFileSync(destination, content); + } + } else if (stat.isSymbolicLink()) { + if (!exists || overwrite) { + if (exists) this.removeSync(destination); + const target = baseFs.readlinkSync(source); + this.symlinkSync(convertPath(this.pathUtils, target), destination); + } + } else { + throw new Error(`Unsupported file type (file: ${source}, mode: 0o${stat.mode.toString(8).padStart(6, `0`)})`); + } + + const mode = stat.mode & 0o777; + this.chmodSync(destination, mode); + } + + async changeFilePromise(p, content, opts = {}) { + if (Buffer.isBuffer(content)) { + return this.changeFileBufferPromise(p, content); + } else { + return this.changeFileTextPromise(p, content, opts); + } + } + + async changeFileBufferPromise(p, content) { + let current = Buffer.alloc(0); + + try { + current = await this.readFilePromise(p); + } catch (error) {// ignore errors, no big deal + } + + if (Buffer.compare(current, content) === 0) return; + await this.writeFilePromise(p, content); + } + + async changeFileTextPromise(p, content, { + automaticNewlines + } = {}) { + let current = ``; + + try { + current = await this.readFilePromise(p, `utf8`); + } catch (error) {// ignore errors, no big deal + } + + const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; + if (current === normalizedContent) return; + await this.writeFilePromise(p, normalizedContent); + } + + changeFileSync(p, content, opts = {}) { + if (Buffer.isBuffer(content)) { + return this.changeFileBufferSync(p, content); + } else { + return this.changeFileTextSync(p, content, opts); + } + } + + changeFileBufferSync(p, content) { + let current = Buffer.alloc(0); + + try { + current = this.readFileSync(p); + } catch (error) {// ignore errors, no big deal + } + + if (Buffer.compare(current, content) === 0) return; + this.writeFileSync(p, content); + } + + changeFileTextSync(p, content, { + automaticNewlines = false + } = {}) { + let current = ``; + + try { + current = this.readFileSync(p, `utf8`); + } catch (error) {// ignore errors, no big deal + } + + const normalizedContent = automaticNewlines ? normalizeLineEndings(current, content) : content; + if (current === normalizedContent) return; + this.writeFileSync(p, normalizedContent); + } + + async movePromise(fromP, toP) { + try { + await this.renamePromise(fromP, toP); + } catch (error) { + if (error.code === `EXDEV`) { + await this.copyPromise(toP, fromP); + await this.removePromise(fromP); + } else { + throw error; + } + } + } + + moveSync(fromP, toP) { + try { + this.renameSync(fromP, toP); + } catch (error) { + if (error.code === `EXDEV`) { + this.copySync(toP, fromP); + this.removeSync(fromP); + } else { + throw error; + } + } + } + + async lockPromise(affectedPath, callback) { + const lockPath = `${affectedPath}.flock`; + const interval = 1000 / 60; + const startTime = Date.now(); + let fd = null; // Even when we detect that a lock file exists, we still look inside to see + // whether the pid that created it is still alive. It's not foolproof + // (there are false positive), but there are no false negative and that's + // all that matters in 99% of the cases. + + const isAlive = async () => { + let pid; + + try { + [pid] = await this.readJsonPromise(lockPath); + } catch (error) { + // If we can't read the file repeatedly, we assume the process was + // aborted before even writing finishing writing the payload. + return Date.now() - startTime < 500; + } + + try { + // "As a special case, a signal of 0 can be used to test for the + // existence of a process" - so we check whether it's alive. + process.kill(pid, 0); + return true; + } catch (error) { + return false; + } + }; + + while (fd === null) { + try { + fd = await this.openPromise(lockPath, `wx`); + } catch (error) { + if (error.code === `EEXIST`) { + if (!(await isAlive())) { + try { + await this.unlinkPromise(lockPath); + continue; + } catch (error) {// No big deal if we can't remove it. Just fallback to wait for + // it to be eventually released by its owner. + } + } + + if (Date.now() - startTime < 60 * 1000) { + await new Promise(resolve => setTimeout(resolve, interval)); + } else { + throw new Error(`Couldn't acquire a lock in a reasonable time (via ${lockPath})`); + } + } else { + throw error; + } + } + } + + await this.writePromise(fd, JSON.stringify([process.pid])); + + try { + return await callback(); + } finally { + try { + // closePromise needs to come before unlinkPromise otherwise another process can attempt + // to get the file handle after the unlink but before close resuling in + // EPERM: operation not permitted, open + await this.closePromise(fd); + await this.unlinkPromise(lockPath); + } catch (error) {// noop + } + } + } + + async readJsonPromise(p) { + const content = await this.readFilePromise(p, `utf8`); + + try { + return JSON.parse(content); + } catch (error) { + error.message += ` (in ${p})`; + throw error; + } + } + + readJsonSync(p) { + const content = this.readFileSync(p, `utf8`); + + try { + return JSON.parse(content); + } catch (error) { + error.message += ` (in ${p})`; + throw error; + } + } + + async writeJsonPromise(p, data) { + return await this.writeFilePromise(p, `${JSON.stringify(data, null, 2)}\n`); + } + + writeJsonSync(p, data) { + return this.writeFileSync(p, `${JSON.stringify(data, null, 2)}\n`); + } + + async preserveTimePromise(p, cb) { + const stat = await this.lstatPromise(p); + const result = await cb(); + if (typeof result !== `undefined`) p = result; + + if (this.lutimesPromise) { + await this.lutimesPromise(p, stat.atime, stat.mtime); + } else if (!stat.isSymbolicLink()) { + await this.utimesPromise(p, stat.atime, stat.mtime); + } + } + + async preserveTimeSync(p, cb) { + const stat = this.lstatSync(p); + const result = cb(); + if (typeof result !== `undefined`) p = result; + + if (this.lutimesSync) { + this.lutimesSync(p, stat.atime, stat.mtime); + } else if (!stat.isSymbolicLink()) { + this.utimesSync(p, stat.atime, stat.mtime); + } + } + +} +FakeFS.DEFAULT_TIME = 315532800; +class BasePortableFakeFS extends FakeFS { + constructor() { + super(ppath); + } + +} + +function getEndOfLine(content) { + const matches = content.match(/\r?\n/g); + if (matches === null) return external_os_namespaceObject.EOL; + const crlf = matches.filter(nl => nl === `\r\n`).length; + const lf = matches.length - crlf; + return crlf > lf ? `\r\n` : `\n`; +} + +function normalizeLineEndings(originalContent, newContent) { + return newContent.replace(/\r?\n/g, getEndOfLine(originalContent)); +} +// CONCATENATED MODULE: ../yarnpkg-fslib/sources/errors.ts +function makeError(code, message) { + return Object.assign(new Error(`${code}: ${message}`), { + code + }); +} + +function EBUSY(message) { + return makeError(`EBUSY`, message); +} +function ENOSYS(message, reason) { + return makeError(`ENOSYS`, `${message}, ${reason}`); +} +function EINVAL(reason) { + return makeError(`EINVAL`, `invalid argument, ${reason}`); +} +function EBADF(reason) { + return makeError(`EBADF`, `bad file descriptor, ${reason}`); +} +function ENOENT(reason) { + return makeError(`ENOENT`, `no such file or directory, ${reason}`); +} +function ENOTDIR(reason) { + return makeError(`ENOTDIR`, `not a directory, ${reason}`); +} +function EISDIR(reason) { + return makeError(`EISDIR`, `illegal operation on a directory, ${reason}`); +} +function EEXIST(reason) { + return makeError(`EEXIST`, `file already exists, ${reason}`); +} +function EROFS(reason) { + return makeError(`EROFS`, `read-only filesystem, ${reason}`); +} +function ENOTEMPTY(reason) { + return makeError(`ENOTEMPTY`, `directory not empty, ${reason}`); +} +function EOPNOTSUPP(reason) { + return makeError(`EOPNOTSUPP`, `operation not supported, ${reason}`); +} // ------------------------------------------------------------------------ + +function ERR_DIR_CLOSED() { + return makeError(`ERR_DIR_CLOSED`, `Directory handle was closed`); +} // ------------------------------------------------------------------------ + +class LibzipError extends Error { + constructor(message, code) { + super(message); + this.name = `Libzip Error`; + this.code = code; + } + +} +// CONCATENATED MODULE: ../yarnpkg-fslib/sources/NodeFS.ts + + + + +class NodeFS extends BasePortableFakeFS { + constructor(realFs = (external_fs_default())) { + super(); + this.realFs = realFs; // @ts-expect-error + + if (typeof this.realFs.lutimes !== `undefined`) { + this.lutimesPromise = this.lutimesPromiseImpl; + this.lutimesSync = this.lutimesSyncImpl; + } + } + + getExtractHint() { + return false; + } + + getRealPath() { + return PortablePath.root; + } + + resolve(p) { + return ppath.resolve(p); + } + + async openPromise(p, flags, mode) { + return await new Promise((resolve, reject) => { + this.realFs.open(npath.fromPortablePath(p), flags, mode, this.makeCallback(resolve, reject)); + }); + } + + openSync(p, flags, mode) { + return this.realFs.openSync(npath.fromPortablePath(p), flags, mode); + } + + async opendirPromise(p, opts) { + return await new Promise((resolve, reject) => { + if (typeof opts !== `undefined`) { + this.realFs.opendir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); + } else { + this.realFs.opendir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); + } + }).then(dir => { + return Object.defineProperty(dir, `path`, { + value: p, + configurable: true, + writable: true + }); + }); + } + + opendirSync(p, opts) { + const dir = typeof opts !== `undefined` ? this.realFs.opendirSync(npath.fromPortablePath(p), opts) : this.realFs.opendirSync(npath.fromPortablePath(p)); + return Object.defineProperty(dir, `path`, { + value: p, + configurable: true, + writable: true + }); + } + + async readPromise(fd, buffer, offset = 0, length = 0, position = -1) { + return await new Promise((resolve, reject) => { + this.realFs.read(fd, buffer, offset, length, position, (error, bytesRead) => { + if (error) { + reject(error); + } else { + resolve(bytesRead); + } + }); + }); + } + + readSync(fd, buffer, offset, length, position) { + return this.realFs.readSync(fd, buffer, offset, length, position); + } + + async writePromise(fd, buffer, offset, length, position) { + return await new Promise((resolve, reject) => { + if (typeof buffer === `string`) { + return this.realFs.write(fd, buffer, offset, this.makeCallback(resolve, reject)); + } else { + return this.realFs.write(fd, buffer, offset, length, position, this.makeCallback(resolve, reject)); + } + }); + } + + writeSync(fd, buffer, offset, length, position) { + if (typeof buffer === `string`) { + return this.realFs.writeSync(fd, buffer, offset); + } else { + return this.realFs.writeSync(fd, buffer, offset, length, position); + } + } + + async closePromise(fd) { + await new Promise((resolve, reject) => { + this.realFs.close(fd, this.makeCallback(resolve, reject)); + }); + } + + closeSync(fd) { + this.realFs.closeSync(fd); + } + + createReadStream(p, opts) { + const realPath = p !== null ? npath.fromPortablePath(p) : p; + return this.realFs.createReadStream(realPath, opts); + } + + createWriteStream(p, opts) { + const realPath = p !== null ? npath.fromPortablePath(p) : p; + return this.realFs.createWriteStream(realPath, opts); + } + + async realpathPromise(p) { + return await new Promise((resolve, reject) => { + this.realFs.realpath(npath.fromPortablePath(p), {}, this.makeCallback(resolve, reject)); + }).then(path => { + return npath.toPortablePath(path); + }); + } + + realpathSync(p) { + return npath.toPortablePath(this.realFs.realpathSync(npath.fromPortablePath(p), {})); + } + + async existsPromise(p) { + return await new Promise(resolve => { + this.realFs.exists(npath.fromPortablePath(p), resolve); + }); + } + + accessSync(p, mode) { + return this.realFs.accessSync(npath.fromPortablePath(p), mode); + } + + async accessPromise(p, mode) { + return await new Promise((resolve, reject) => { + this.realFs.access(npath.fromPortablePath(p), mode, this.makeCallback(resolve, reject)); + }); + } + + existsSync(p) { + return this.realFs.existsSync(npath.fromPortablePath(p)); + } + + async statPromise(p) { + return await new Promise((resolve, reject) => { + this.realFs.stat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); + }); + } + + statSync(p) { + return this.realFs.statSync(npath.fromPortablePath(p)); + } + + async lstatPromise(p) { + return await new Promise((resolve, reject) => { + this.realFs.lstat(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); + }); + } + + lstatSync(p) { + return this.realFs.lstatSync(npath.fromPortablePath(p)); + } + + async chmodPromise(p, mask) { + return await new Promise((resolve, reject) => { + this.realFs.chmod(npath.fromPortablePath(p), mask, this.makeCallback(resolve, reject)); + }); + } + + chmodSync(p, mask) { + return this.realFs.chmodSync(npath.fromPortablePath(p), mask); + } + + async chownPromise(p, uid, gid) { + return await new Promise((resolve, reject) => { + this.realFs.chown(npath.fromPortablePath(p), uid, gid, this.makeCallback(resolve, reject)); + }); + } + + chownSync(p, uid, gid) { + return this.realFs.chownSync(npath.fromPortablePath(p), uid, gid); + } + + async renamePromise(oldP, newP) { + return await new Promise((resolve, reject) => { + this.realFs.rename(npath.fromPortablePath(oldP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); + }); + } + + renameSync(oldP, newP) { + return this.realFs.renameSync(npath.fromPortablePath(oldP), npath.fromPortablePath(newP)); + } + + async copyFilePromise(sourceP, destP, flags = 0) { + return await new Promise((resolve, reject) => { + this.realFs.copyFile(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags, this.makeCallback(resolve, reject)); + }); + } + + copyFileSync(sourceP, destP, flags = 0) { + return this.realFs.copyFileSync(npath.fromPortablePath(sourceP), npath.fromPortablePath(destP), flags); + } + + async appendFilePromise(p, content, opts) { + return await new Promise((resolve, reject) => { + const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; + + if (opts) { + this.realFs.appendFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); + } else { + this.realFs.appendFile(fsNativePath, content, this.makeCallback(resolve, reject)); + } + }); + } + + appendFileSync(p, content, opts) { + const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; + + if (opts) { + this.realFs.appendFileSync(fsNativePath, content, opts); + } else { + this.realFs.appendFileSync(fsNativePath, content); + } + } + + async writeFilePromise(p, content, opts) { + return await new Promise((resolve, reject) => { + const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; + + if (opts) { + this.realFs.writeFile(fsNativePath, content, opts, this.makeCallback(resolve, reject)); + } else { + this.realFs.writeFile(fsNativePath, content, this.makeCallback(resolve, reject)); + } + }); + } + + writeFileSync(p, content, opts) { + const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; + + if (opts) { + this.realFs.writeFileSync(fsNativePath, content, opts); + } else { + this.realFs.writeFileSync(fsNativePath, content); + } + } + + async unlinkPromise(p) { + return await new Promise((resolve, reject) => { + this.realFs.unlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); + }); + } + + unlinkSync(p) { + return this.realFs.unlinkSync(npath.fromPortablePath(p)); + } + + async utimesPromise(p, atime, mtime) { + return await new Promise((resolve, reject) => { + this.realFs.utimes(npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); + }); + } + + utimesSync(p, atime, mtime) { + this.realFs.utimesSync(npath.fromPortablePath(p), atime, mtime); + } + + async lutimesPromiseImpl(p, atime, mtime) { + // @ts-expect-error: Not yet in DefinitelyTyped + const lutimes = this.realFs.lutimes; + if (typeof lutimes === `undefined`) throw ENOSYS(`unavailable Node binding`, `lutimes '${p}'`); + return await new Promise((resolve, reject) => { + lutimes.call(this.realFs, npath.fromPortablePath(p), atime, mtime, this.makeCallback(resolve, reject)); + }); + } + + lutimesSyncImpl(p, atime, mtime) { + // @ts-expect-error: Not yet in DefinitelyTyped + const lutimesSync = this.realFs.lutimesSync; + if (typeof lutimesSync === `undefined`) throw ENOSYS(`unavailable Node binding`, `lutimes '${p}'`); + lutimesSync.call(this.realFs, npath.fromPortablePath(p), atime, mtime); + } + + async mkdirPromise(p, opts) { + return await new Promise((resolve, reject) => { + this.realFs.mkdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); + }); + } + + mkdirSync(p, opts) { + return this.realFs.mkdirSync(npath.fromPortablePath(p), opts); + } + + async rmdirPromise(p, opts) { + return await new Promise((resolve, reject) => { + // TODO: always pass opts when min node version is 12.10+ + if (opts) { + this.realFs.rmdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject)); + } else { + this.realFs.rmdir(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); + } + }); + } + + rmdirSync(p, opts) { + return this.realFs.rmdirSync(npath.fromPortablePath(p), opts); + } + + async linkPromise(existingP, newP) { + return await new Promise((resolve, reject) => { + this.realFs.link(npath.fromPortablePath(existingP), npath.fromPortablePath(newP), this.makeCallback(resolve, reject)); + }); + } + + linkSync(existingP, newP) { + return this.realFs.linkSync(npath.fromPortablePath(existingP), npath.fromPortablePath(newP)); + } + + async symlinkPromise(target, p, type) { + const symlinkType = type || (target.endsWith(`/`) ? `dir` : `file`); + return await new Promise((resolve, reject) => { + this.realFs.symlink(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), symlinkType, this.makeCallback(resolve, reject)); + }); + } + + symlinkSync(target, p, type) { + const symlinkType = type || (target.endsWith(`/`) ? `dir` : `file`); + return this.realFs.symlinkSync(npath.fromPortablePath(target.replace(/\/+$/, ``)), npath.fromPortablePath(p), symlinkType); + } + + async readFilePromise(p, encoding) { + return await new Promise((resolve, reject) => { + const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; + this.realFs.readFile(fsNativePath, encoding, this.makeCallback(resolve, reject)); + }); + } + + readFileSync(p, encoding) { + const fsNativePath = typeof p === `string` ? npath.fromPortablePath(p) : p; + return this.realFs.readFileSync(fsNativePath, encoding); + } + + async readdirPromise(p, { + withFileTypes + } = {}) { + return await new Promise((resolve, reject) => { + if (withFileTypes) { + this.realFs.readdir(npath.fromPortablePath(p), { + withFileTypes: true + }, this.makeCallback(resolve, reject)); + } else { + this.realFs.readdir(npath.fromPortablePath(p), this.makeCallback(value => resolve(value), reject)); + } + }); + } + + readdirSync(p, { + withFileTypes + } = {}) { + if (withFileTypes) { + return this.realFs.readdirSync(npath.fromPortablePath(p), { + withFileTypes: true + }); + } else { + return this.realFs.readdirSync(npath.fromPortablePath(p)); + } + } + + async readlinkPromise(p) { + return await new Promise((resolve, reject) => { + this.realFs.readlink(npath.fromPortablePath(p), this.makeCallback(resolve, reject)); + }).then(path => { + return npath.toPortablePath(path); + }); + } + + readlinkSync(p) { + return npath.toPortablePath(this.realFs.readlinkSync(npath.fromPortablePath(p))); + } + + async truncatePromise(p, len) { + return await new Promise((resolve, reject) => { + this.realFs.truncate(npath.fromPortablePath(p), len, this.makeCallback(resolve, reject)); + }); + } + + truncateSync(p, len) { + return this.realFs.truncateSync(npath.fromPortablePath(p), len); + } + + watch(p, a, b) { + return this.realFs.watch(npath.fromPortablePath(p), // @ts-expect-error + a, b); + } + + watchFile(p, a, b) { + return this.realFs.watchFile(npath.fromPortablePath(p), // @ts-expect-error + a, b); + } + + unwatchFile(p, cb) { + return this.realFs.unwatchFile(npath.fromPortablePath(p), cb); + } + + makeCallback(resolve, reject) { + return (err, result) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }; + } + +} +// CONCATENATED MODULE: ../yarnpkg-fslib/sources/ProxiedFS.ts + +class ProxiedFS extends FakeFS { + getExtractHint(hints) { + return this.baseFs.getExtractHint(hints); + } + + resolve(path) { + return this.mapFromBase(this.baseFs.resolve(this.mapToBase(path))); + } + + getRealPath() { + return this.mapFromBase(this.baseFs.getRealPath()); + } + + async openPromise(p, flags, mode) { + return this.baseFs.openPromise(this.mapToBase(p), flags, mode); + } + + openSync(p, flags, mode) { + return this.baseFs.openSync(this.mapToBase(p), flags, mode); + } + + async opendirPromise(p, opts) { + return Object.assign(await this.baseFs.opendirPromise(this.mapToBase(p), opts), { + path: p + }); + } + + opendirSync(p, opts) { + return Object.assign(this.baseFs.opendirSync(this.mapToBase(p), opts), { + path: p + }); + } + + async readPromise(fd, buffer, offset, length, position) { + return await this.baseFs.readPromise(fd, buffer, offset, length, position); + } + + readSync(fd, buffer, offset, length, position) { + return this.baseFs.readSync(fd, buffer, offset, length, position); + } + + async writePromise(fd, buffer, offset, length, position) { + if (typeof buffer === `string`) { + return await this.baseFs.writePromise(fd, buffer, offset); + } else { + return await this.baseFs.writePromise(fd, buffer, offset, length, position); + } + } + + writeSync(fd, buffer, offset, length, position) { + if (typeof buffer === `string`) { + return this.baseFs.writeSync(fd, buffer, offset); + } else { + return this.baseFs.writeSync(fd, buffer, offset, length, position); + } + } + + async closePromise(fd) { + return this.baseFs.closePromise(fd); + } + + closeSync(fd) { + this.baseFs.closeSync(fd); + } + + createReadStream(p, opts) { + return this.baseFs.createReadStream(p !== null ? this.mapToBase(p) : p, opts); + } + + createWriteStream(p, opts) { + return this.baseFs.createWriteStream(p !== null ? this.mapToBase(p) : p, opts); + } + + async realpathPromise(p) { + return this.mapFromBase(await this.baseFs.realpathPromise(this.mapToBase(p))); + } + + realpathSync(p) { + return this.mapFromBase(this.baseFs.realpathSync(this.mapToBase(p))); + } + + async existsPromise(p) { + return this.baseFs.existsPromise(this.mapToBase(p)); + } + + existsSync(p) { + return this.baseFs.existsSync(this.mapToBase(p)); + } + + accessSync(p, mode) { + return this.baseFs.accessSync(this.mapToBase(p), mode); + } + + async accessPromise(p, mode) { + return this.baseFs.accessPromise(this.mapToBase(p), mode); + } + + async statPromise(p) { + return this.baseFs.statPromise(this.mapToBase(p)); + } + + statSync(p) { + return this.baseFs.statSync(this.mapToBase(p)); + } + + async lstatPromise(p) { + return this.baseFs.lstatPromise(this.mapToBase(p)); + } + + lstatSync(p) { + return this.baseFs.lstatSync(this.mapToBase(p)); + } + + async chmodPromise(p, mask) { + return this.baseFs.chmodPromise(this.mapToBase(p), mask); + } + + chmodSync(p, mask) { + return this.baseFs.chmodSync(this.mapToBase(p), mask); + } + + async chownPromise(p, uid, gid) { + return this.baseFs.chownPromise(this.mapToBase(p), uid, gid); + } + + chownSync(p, uid, gid) { + return this.baseFs.chownSync(this.mapToBase(p), uid, gid); + } + + async renamePromise(oldP, newP) { + return this.baseFs.renamePromise(this.mapToBase(oldP), this.mapToBase(newP)); + } + + renameSync(oldP, newP) { + return this.baseFs.renameSync(this.mapToBase(oldP), this.mapToBase(newP)); + } + + async copyFilePromise(sourceP, destP, flags = 0) { + return this.baseFs.copyFilePromise(this.mapToBase(sourceP), this.mapToBase(destP), flags); + } + + copyFileSync(sourceP, destP, flags = 0) { + return this.baseFs.copyFileSync(this.mapToBase(sourceP), this.mapToBase(destP), flags); + } + + async appendFilePromise(p, content, opts) { + return this.baseFs.appendFilePromise(this.fsMapToBase(p), content, opts); + } + + appendFileSync(p, content, opts) { + return this.baseFs.appendFileSync(this.fsMapToBase(p), content, opts); + } + + async writeFilePromise(p, content, opts) { + return this.baseFs.writeFilePromise(this.fsMapToBase(p), content, opts); + } + + writeFileSync(p, content, opts) { + return this.baseFs.writeFileSync(this.fsMapToBase(p), content, opts); + } + + async unlinkPromise(p) { + return this.baseFs.unlinkPromise(this.mapToBase(p)); + } + + unlinkSync(p) { + return this.baseFs.unlinkSync(this.mapToBase(p)); + } + + async utimesPromise(p, atime, mtime) { + return this.baseFs.utimesPromise(this.mapToBase(p), atime, mtime); + } + + utimesSync(p, atime, mtime) { + return this.baseFs.utimesSync(this.mapToBase(p), atime, mtime); + } + + async mkdirPromise(p, opts) { + return this.baseFs.mkdirPromise(this.mapToBase(p), opts); + } + + mkdirSync(p, opts) { + return this.baseFs.mkdirSync(this.mapToBase(p), opts); + } + + async rmdirPromise(p, opts) { + return this.baseFs.rmdirPromise(this.mapToBase(p), opts); + } + + rmdirSync(p, opts) { + return this.baseFs.rmdirSync(this.mapToBase(p), opts); + } + + async linkPromise(existingP, newP) { + return this.baseFs.linkPromise(this.mapToBase(existingP), this.mapToBase(newP)); + } + + linkSync(existingP, newP) { + return this.baseFs.linkSync(this.mapToBase(existingP), this.mapToBase(newP)); + } + + async symlinkPromise(target, p, type) { + return this.baseFs.symlinkPromise(this.mapToBase(target), this.mapToBase(p), type); + } + + symlinkSync(target, p, type) { + return this.baseFs.symlinkSync(this.mapToBase(target), this.mapToBase(p), type); + } + + async readFilePromise(p, encoding) { + // This weird condition is required to tell TypeScript that the signatures are proper (otherwise it thinks that only the generic one is covered) + if (encoding === `utf8`) { + return this.baseFs.readFilePromise(this.fsMapToBase(p), encoding); + } else { + return this.baseFs.readFilePromise(this.fsMapToBase(p), encoding); + } + } + + readFileSync(p, encoding) { + // This weird condition is required to tell TypeScript that the signatures are proper (otherwise it thinks that only the generic one is covered) + if (encoding === `utf8`) { + return this.baseFs.readFileSync(this.fsMapToBase(p), encoding); + } else { + return this.baseFs.readFileSync(this.fsMapToBase(p), encoding); + } + } + + async readdirPromise(p, { + withFileTypes + } = {}) { + return this.baseFs.readdirPromise(this.mapToBase(p), { + withFileTypes: withFileTypes + }); + } + + readdirSync(p, { + withFileTypes + } = {}) { + return this.baseFs.readdirSync(this.mapToBase(p), { + withFileTypes: withFileTypes + }); + } + + async readlinkPromise(p) { + return this.mapFromBase(await this.baseFs.readlinkPromise(this.mapToBase(p))); + } + + readlinkSync(p) { + return this.mapFromBase(this.baseFs.readlinkSync(this.mapToBase(p))); + } + + async truncatePromise(p, len) { + return this.baseFs.truncatePromise(this.mapToBase(p), len); + } + + truncateSync(p, len) { + return this.baseFs.truncateSync(this.mapToBase(p), len); + } + + watch(p, a, b) { + return this.baseFs.watch(this.mapToBase(p), // @ts-expect-error + a, b); + } + + watchFile(p, a, b) { + return this.baseFs.watchFile(this.mapToBase(p), // @ts-expect-error + a, b); + } + + unwatchFile(p, cb) { + return this.baseFs.unwatchFile(this.mapToBase(p), cb); + } + + fsMapToBase(p) { + if (typeof p === `number`) { + return p; + } else { + return this.mapToBase(p); + } + } + +} +// CONCATENATED MODULE: ../yarnpkg-fslib/sources/VirtualFS.ts + + + +const NUMBER_REGEXP = /^[0-9]+$/; // $0: full path +// $1: virtual folder +// $2: virtual segment +// $3: hash +// $4: depth +// $5: subpath + +const VIRTUAL_REGEXP = /^(\/(?:[^/]+\/)*?\$\$virtual)((?:\/((?:[^/]+-)?[a-f0-9]+)(?:\/([^/]+))?)?((?:\/.*)?))$/; +const VALID_COMPONENT = /^([^/]+-)?[a-f0-9]+$/; +class VirtualFS extends ProxiedFS { + constructor({ + baseFs = new NodeFS() + } = {}) { + super(ppath); + this.baseFs = baseFs; + } + + static makeVirtualPath(base, component, to) { + if (ppath.basename(base) !== `$$virtual`) throw new Error(`Assertion failed: Virtual folders must be named "$$virtual"`); + if (!ppath.basename(component).match(VALID_COMPONENT)) throw new Error(`Assertion failed: Virtual components must be ended by an hexadecimal hash`); // Obtains the relative distance between the virtual path and its actual target + + const target = ppath.relative(ppath.dirname(base), to); + const segments = target.split(`/`); // Counts how many levels we need to go back to start applying the rest of the path + + let depth = 0; + + while (depth < segments.length && segments[depth] === `..`) depth += 1; + + const finalSegments = segments.slice(depth); + const fullVirtualPath = ppath.join(base, component, String(depth), ...finalSegments); + return fullVirtualPath; + } + + static resolveVirtual(p) { + const match = p.match(VIRTUAL_REGEXP); + if (!match || !match[3] && match[5]) return p; + const target = ppath.dirname(match[1]); + if (!match[3] || !match[4]) return target; + const isnum = NUMBER_REGEXP.test(match[4]); + if (!isnum) return p; + const depth = Number(match[4]); + const backstep = `../`.repeat(depth); + const subpath = match[5] || `.`; + return VirtualFS.resolveVirtual(ppath.join(target, backstep, subpath)); + } + + getExtractHint(hints) { + return this.baseFs.getExtractHint(hints); + } + + getRealPath() { + return this.baseFs.getRealPath(); + } + + realpathSync(p) { + const match = p.match(VIRTUAL_REGEXP); + if (!match) return this.baseFs.realpathSync(p); + if (!match[5]) return p; + const realpath = this.baseFs.realpathSync(this.mapToBase(p)); + return VirtualFS.makeVirtualPath(match[1], match[3], realpath); + } + + async realpathPromise(p) { + const match = p.match(VIRTUAL_REGEXP); + if (!match) return await this.baseFs.realpathPromise(p); + if (!match[5]) return p; + const realpath = await this.baseFs.realpathPromise(this.mapToBase(p)); + return VirtualFS.makeVirtualPath(match[1], match[3], realpath); + } + + mapToBase(p) { + return VirtualFS.resolveVirtual(p); + } + + mapFromBase(p) { + return p; + } + +} +// CONCATENATED MODULE: external "stream" +const external_stream_namespaceObject = require("stream");; +// CONCATENATED MODULE: external "util" +const external_util_namespaceObject = require("util");; +// CONCATENATED MODULE: external "zlib" +const external_zlib_namespaceObject = require("zlib");; +var external_zlib_default = /*#__PURE__*/__webpack_require__.n(external_zlib_namespaceObject); + +// CONCATENATED MODULE: ../yarnpkg-fslib/sources/algorithms/opendir.ts + +class CustomDir { + constructor(path, nextDirent, opts = {}) { + this.path = path; + this.nextDirent = nextDirent; + this.opts = opts; + this.closed = false; + } + + throwIfClosed() { + if (this.closed) { + throw ERR_DIR_CLOSED(); + } + } + + async *[Symbol.asyncIterator]() { + try { + let dirent; // eslint-disable-next-line no-cond-assign + + while ((dirent = await this.read()) !== null) { + yield dirent; + } + } finally { + await this.close(); + } + } + + read(cb) { + const dirent = this.readSync(); + if (typeof cb !== `undefined`) return cb(null, dirent); + return Promise.resolve(dirent); + } + + readSync() { + this.throwIfClosed(); + return this.nextDirent(); + } + + close(cb) { + this.closeSync(); + if (typeof cb !== `undefined`) return cb(null); + return Promise.resolve(); + } + + closeSync() { + var _a, _b; + + this.throwIfClosed(); + (_b = (_a = this.opts).onClose) === null || _b === void 0 ? void 0 : _b.call(_a); + this.closed = true; + } + +} +function opendir(fakeFs, path, entries, opts) { + const nextDirent = () => { + const filename = entries.shift(); + if (typeof filename === `undefined`) return null; + return Object.assign(fakeFs.statSync(fakeFs.pathUtils.join(path, filename)), { + name: filename + }); + }; + + return new CustomDir(path, nextDirent, opts); +} +// CONCATENATED MODULE: external "events" +const external_events_namespaceObject = require("events");; +// CONCATENATED MODULE: ../yarnpkg-fslib/sources/constants.ts +const constants_S_IFMT = 0o170000; +const constants_S_IFDIR = 0o040000; +const constants_S_IFREG = 0o100000; +const constants_S_IFLNK = 0o120000; +// CONCATENATED MODULE: ../yarnpkg-fslib/sources/statUtils.ts + +class DirEntry { + constructor() { + this.name = ``; + this.mode = 0; + } + + isBlockDevice() { + return false; + } + + isCharacterDevice() { + return false; + } + + isDirectory() { + return (this.mode & S_IFMT) === S_IFDIR; + } + + isFIFO() { + return false; + } + + isFile() { + return (this.mode & S_IFMT) === S_IFREG; + } + + isSocket() { + return false; + } + + isSymbolicLink() { + return (this.mode & S_IFMT) === S_IFLNK; + } + +} +class StatEntry { + constructor() { + this.dev = 0; + this.ino = 0; + this.mode = 0; + this.nlink = 1; + this.rdev = 0; + this.blocks = 1; + } + + isBlockDevice() { + return false; + } + + isCharacterDevice() { + return false; + } + + isDirectory() { + return (this.mode & constants_S_IFMT) === constants_S_IFDIR; + } + + isFIFO() { + return false; + } + + isFile() { + return (this.mode & constants_S_IFMT) === constants_S_IFREG; + } + + isSocket() { + return false; + } + + isSymbolicLink() { + return (this.mode & constants_S_IFMT) === constants_S_IFLNK; + } + +} +function makeDefaultStats() { + return Object.assign(new StatEntry(), { + uid: 0, + gid: 0, + size: 0, + blksize: 0, + atimeMs: 0, + mtimeMs: 0, + ctimeMs: 0, + birthtimeMs: 0, + atime: new Date(0), + mtime: new Date(0), + ctime: new Date(0), + birthtime: new Date(0), + mode: constants_S_IFREG | 0o644 + }); +} +function makeEmptyStats() { + return Object.assign(makeDefaultStats(), { + nlink: 0, + blocks: 0, + mode: 0 + }); +} +function areStatsEqual(a, b) { + if (a.atimeMs !== b.atimeMs) return false; + if (a.birthtimeMs !== b.birthtimeMs) return false; + if (a.blksize !== b.blksize) return false; + if (a.blocks !== b.blocks) return false; + if (a.ctimeMs !== b.ctimeMs) return false; + if (a.dev !== b.dev) return false; + if (a.gid !== b.gid) return false; + if (a.ino !== b.ino) return false; + if (a.isBlockDevice() !== b.isBlockDevice()) return false; + if (a.isCharacterDevice() !== b.isCharacterDevice()) return false; + if (a.isDirectory() !== b.isDirectory()) return false; + if (a.isFIFO() !== b.isFIFO()) return false; + if (a.isFile() !== b.isFile()) return false; + if (a.isSocket() !== b.isSocket()) return false; + if (a.isSymbolicLink() !== b.isSymbolicLink()) return false; + if (a.mode !== b.mode) return false; + if (a.mtimeMs !== b.mtimeMs) return false; + if (a.nlink !== b.nlink) return false; + if (a.rdev !== b.rdev) return false; + if (a.size !== b.size) return false; + if (a.uid !== b.uid) return false; + return true; +} +// CONCATENATED MODULE: ../yarnpkg-fslib/sources/algorithms/watchFile/CustomStatWatcher.ts + + +var Event; + +(function (Event) { + Event["Change"] = "change"; + Event["Stop"] = "stop"; +})(Event || (Event = {})); + +var Status; + +(function (Status) { + Status["Ready"] = "ready"; + Status["Running"] = "running"; + Status["Stopped"] = "stopped"; +})(Status || (Status = {})); + +function assertStatus(current, expected) { + if (current !== expected) { + throw new Error(`Invalid StatWatcher status: expected '${expected}', got '${current}'`); + } +} +class CustomStatWatcher extends external_events_namespaceObject.EventEmitter { + constructor(fakeFs, path, { + bigint = false + } = {}) { + super(); + this.status = Status.Ready; + this.changeListeners = new Map(); + this.startTimeout = null; + this.fakeFs = fakeFs; + this.path = path; + this.bigint = bigint; + this.lastStats = this.stat(); + } + + static create(fakeFs, path, opts) { + const statWatcher = new CustomStatWatcher(fakeFs, path, opts); + statWatcher.start(); + return statWatcher; + } + + start() { + assertStatus(this.status, Status.Ready); + this.status = Status.Running; // Node allows other listeners to be registered up to 3 milliseconds + // after the watcher has been started, so that's what we're doing too + + this.startTimeout = setTimeout(() => { + this.startTimeout = null; // Per the Node FS docs: + // "When an fs.watchFile operation results in an ENOENT error, + // it will invoke the listener once, with all the fields zeroed + // (or, for dates, the Unix Epoch)." + + if (!this.fakeFs.existsSync(this.path)) { + this.emit(Event.Change, this.lastStats, this.lastStats); + } + }, 3); + } + + stop() { + assertStatus(this.status, Status.Running); + this.status = Status.Stopped; + + if (this.startTimeout !== null) { + clearTimeout(this.startTimeout); + this.startTimeout = null; + } + + this.emit(Event.Stop); + } + + stat() { + try { + return this.fakeFs.statSync(this.path); + } catch (error) { + if (error.code === `ENOENT`) { + return makeEmptyStats(); + } else { + throw error; + } + } + } + /** + * Creates an interval whose callback compares the current stats with the previous stats and notifies all listeners in case of changes. + * + * @param opts.persistent Decides whether the interval should be immediately unref-ed. + */ + + + makeInterval(opts) { + const interval = setInterval(() => { + const currentStats = this.stat(); + const previousStats = this.lastStats; + if (areStatsEqual(currentStats, previousStats)) return; + this.lastStats = currentStats; + this.emit(Event.Change, currentStats, previousStats); + }, opts.interval); + return opts.persistent ? interval : interval.unref(); + } + /** + * Registers a listener and assigns it an interval. + */ + + + registerChangeListener(listener, opts) { + this.addListener(Event.Change, listener); + this.changeListeners.set(listener, this.makeInterval(opts)); + } + /** + * Unregisters the listener and clears the assigned interval. + */ + + + unregisterChangeListener(listener) { + this.removeListener(Event.Change, listener); + const interval = this.changeListeners.get(listener); + if (typeof interval !== `undefined`) clearInterval(interval); + this.changeListeners.delete(listener); + } + /** + * Unregisters all listeners and clears all assigned intervals. + */ + + + unregisterAllChangeListeners() { + for (const listener of this.changeListeners.keys()) { + this.unregisterChangeListener(listener); + } + } + + hasChangeListeners() { + return this.changeListeners.size > 0; + } + /** + * Refs all stored intervals. + */ + + + ref() { + for (const interval of this.changeListeners.values()) interval.ref(); + + return this; + } + /** + * Unrefs all stored intervals. + */ + + + unref() { + for (const interval of this.changeListeners.values()) interval.unref(); + + return this; + } + +} +// CONCATENATED MODULE: ../yarnpkg-fslib/sources/algorithms/watchFile.ts + +const statWatchersByFakeFS = new WeakMap(); +function watchFile(fakeFs, path, a, b) { + let bigint; + let persistent; + let interval; + let listener; + + switch (typeof a) { + case `function`: + { + bigint = false; + persistent = true; + interval = 5007; + listener = a; + } + break; + + default: + { + ({ + bigint = false, + persistent = true, + interval = 5007 + } = a); + listener = b; + } + break; + } + + let statWatchers = statWatchersByFakeFS.get(fakeFs); + if (typeof statWatchers === `undefined`) statWatchersByFakeFS.set(fakeFs, statWatchers = new Map()); + let statWatcher = statWatchers.get(path); + + if (typeof statWatcher === `undefined`) { + statWatcher = CustomStatWatcher.create(fakeFs, path, { + bigint + }); + statWatchers.set(path, statWatcher); + } + + statWatcher.registerChangeListener(listener, { + persistent, + interval + }); + return statWatcher; +} +function unwatchFile(fakeFs, path, cb) { + const statWatchers = statWatchersByFakeFS.get(fakeFs); + if (typeof statWatchers === `undefined`) return; + const statWatcher = statWatchers.get(path); + if (typeof statWatcher === `undefined`) return; + if (typeof cb === `undefined`) statWatcher.unregisterAllChangeListeners();else statWatcher.unregisterChangeListener(cb); + + if (!statWatcher.hasChangeListeners()) { + statWatcher.stop(); + statWatchers.delete(path); + } +} +function unwatchAllFiles(fakeFs) { + const statWatchers = statWatchersByFakeFS.get(fakeFs); + if (typeof statWatchers === `undefined`) return; + + for (const path of statWatchers.keys()) { + unwatchFile(fakeFs, path); + } +} +// CONCATENATED MODULE: ../yarnpkg-fslib/sources/ZipFS.ts + + + + + + + + + + + + +const DEFAULT_COMPRESSION_LEVEL = `mixed`; + +function toUnixTimestamp(time) { + if (typeof time === `string` && String(+time) === time) return +time; + + if (Number.isFinite(time)) { + if (time < 0) { + return Date.now() / 1000; + } else { + return time; + } + } // convert to 123.456 UNIX timestamp + + + if ((0,external_util_namespaceObject.isDate)(time)) return time.getTime() / 1000; + throw new Error(`Invalid time`); +} + +class ZipFS extends BasePortableFakeFS { + constructor(source, opts) { + super(); + this.lzSource = null; + this.listings = new Map(); + this.entries = new Map(); + /** + * A cache of indices mapped to file sources. + * Populated by `setFileSource` calls. + * Required for supporting read after write. + */ + + this.fileSources = new Map(); + this.fds = new Map(); + this.nextFd = 0; + this.ready = false; + this.readOnly = false; + this.libzip = opts.libzip; + const pathOptions = opts; + this.level = typeof pathOptions.level !== `undefined` ? pathOptions.level : DEFAULT_COMPRESSION_LEVEL; + + if (source === null) { + source = Buffer.from([0x50, 0x4B, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]); + } + + if (typeof source === `string`) { + const { + baseFs = new NodeFS() + } = pathOptions; + this.baseFs = baseFs; + this.path = source; + } else { + this.path = null; + this.baseFs = null; + } + + if (opts.stats) { + this.stats = opts.stats; + } else { + if (typeof source === `string`) { + try { + this.stats = this.baseFs.statSync(source); + } catch (error) { + if (error.code === `ENOENT` && pathOptions.create) { + this.stats = makeDefaultStats(); + } else { + throw error; + } + } + } else { + this.stats = makeDefaultStats(); + } + } + + const errPtr = this.libzip.malloc(4); + + try { + let flags = 0; + if (typeof source === `string` && pathOptions.create) flags |= this.libzip.ZIP_CREATE | this.libzip.ZIP_TRUNCATE; + + if (opts.readOnly) { + flags |= this.libzip.ZIP_RDONLY; + this.readOnly = true; + } + + if (typeof source === `string`) { + this.zip = this.libzip.open(npath.fromPortablePath(source), flags, errPtr); + } else { + const lzSource = this.allocateUnattachedSource(source); + + try { + this.zip = this.libzip.openFromSource(lzSource, flags, errPtr); + this.lzSource = lzSource; + } catch (error) { + this.libzip.source.free(lzSource); + throw error; + } + } + + if (this.zip === 0) { + const error = this.libzip.struct.errorS(); + this.libzip.error.initWithCode(error, this.libzip.getValue(errPtr, `i32`)); + throw this.makeLibzipError(error); + } + } finally { + this.libzip.free(errPtr); + } + + this.listings.set(PortablePath.root, new Set()); + const entryCount = this.libzip.getNumEntries(this.zip, 0); + + for (let t = 0; t < entryCount; ++t) { + const raw = this.libzip.getName(this.zip, t, 0); + if (ppath.isAbsolute(raw)) continue; + const p = ppath.resolve(PortablePath.root, raw); + this.registerEntry(p, t); // If the raw path is a directory, register it + // to prevent empty folder being skipped + + if (raw.endsWith(`/`)) { + this.registerListing(p); + } + } + + this.symlinkCount = this.libzip.ext.countSymlinks(this.zip); + if (this.symlinkCount === -1) throw this.makeLibzipError(this.libzip.getError(this.zip)); + this.ready = true; + } + + makeLibzipError(error) { + const errorCode = this.libzip.struct.errorCodeZip(error); + const strerror = this.libzip.error.strerror(error); + const libzipError = new LibzipError(strerror, this.libzip.errors[errorCode]); // This error should never come up because of the file source cache + + if (errorCode === this.libzip.errors.ZIP_ER_CHANGED) throw new Error(`Assertion failed: Unexpected libzip error: ${libzipError.message}`); + return libzipError; + } + + getExtractHint(hints) { + for (const fileName of this.entries.keys()) { + const ext = this.pathUtils.extname(fileName); + + if (hints.relevantExtensions.has(ext)) { + return true; + } + } + + return false; + } + + getAllFiles() { + return Array.from(this.entries.keys()); + } + + getRealPath() { + if (!this.path) throw new Error(`ZipFS don't have real paths when loaded from a buffer`); + return this.path; + } + + getBufferAndClose() { + this.prepareClose(); + if (!this.lzSource) throw new Error(`ZipFS was not created from a Buffer`); + + try { + // Prevent close from cleaning up the source + this.libzip.source.keep(this.lzSource); // Close the zip archive + + if (this.libzip.close(this.zip) === -1) throw this.makeLibzipError(this.libzip.getError(this.zip)); // Open the source for reading + + if (this.libzip.source.open(this.lzSource) === -1) throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); // Move to the end of source + + if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_END) === -1) throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); // Get the size of source + + const size = this.libzip.source.tell(this.lzSource); + if (size === -1) throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); // Move to the start of source + + if (this.libzip.source.seek(this.lzSource, 0, 0, this.libzip.SEEK_SET) === -1) throw this.makeLibzipError(this.libzip.source.error(this.lzSource)); + const buffer = this.libzip.malloc(size); + if (!buffer) throw new Error(`Couldn't allocate enough memory`); + + try { + const rc = this.libzip.source.read(this.lzSource, buffer, size); + if (rc === -1) throw this.makeLibzipError(this.libzip.source.error(this.lzSource));else if (rc < size) throw new Error(`Incomplete read`);else if (rc > size) throw new Error(`Overread`); + const memory = this.libzip.HEAPU8.subarray(buffer, buffer + size); + return Buffer.from(memory); + } finally { + this.libzip.free(buffer); + } + } finally { + this.libzip.source.close(this.lzSource); + this.libzip.source.free(this.lzSource); + this.ready = false; + } + } + + prepareClose() { + if (!this.ready) throw EBUSY(`archive closed, close`); + unwatchAllFiles(this); + } + + saveAndClose() { + if (!this.path || !this.baseFs) throw new Error(`ZipFS cannot be saved and must be discarded when loaded from a buffer`); + this.prepareClose(); + + if (this.readOnly) { + this.discardAndClose(); + return; + } + + const previousMod = this.baseFs.existsSync(this.path) ? this.baseFs.statSync(this.path).mode & 0o777 : null; + const rc = this.libzip.close(this.zip); + if (rc === -1) throw this.makeLibzipError(this.libzip.getError(this.zip)); // this.libzip overrides the chmod when writing the archive, which is a weird + // behavior I don't totally understand (plus the umask seems bogus in some + // weird cases - maybe related to emscripten?) + // + // See also https://github.com/nih-at/libzip/issues/77 + + if (previousMod === null) this.baseFs.chmodSync(this.path, this.stats.mode);else if (previousMod !== (this.baseFs.statSync(this.path).mode & 0o777)) this.baseFs.chmodSync(this.path, previousMod); + this.ready = false; + } + + discardAndClose() { + this.prepareClose(); + this.libzip.discard(this.zip); + this.ready = false; + } + + resolve(p) { + return ppath.resolve(PortablePath.root, p); + } + + async openPromise(p, flags, mode) { + return this.openSync(p, flags, mode); + } + + openSync(p, flags, mode) { + const fd = this.nextFd++; + this.fds.set(fd, { + cursor: 0, + p + }); + return fd; + } + + hasOpenFileHandles() { + return !!this.fds.size; + } + + async opendirPromise(p, opts) { + return this.opendirSync(p, opts); + } + + opendirSync(p, opts = {}) { + const resolvedP = this.resolveFilename(`opendir '${p}'`, p); + if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) throw ENOENT(`opendir '${p}'`); + const directoryListing = this.listings.get(resolvedP); + if (!directoryListing) throw ENOTDIR(`opendir '${p}'`); + const entries = [...directoryListing]; + const fd = this.openSync(resolvedP, `r`); + + const onClose = () => { + this.closeSync(fd); + }; + + return opendir(this, resolvedP, entries, { + onClose + }); + } + + async readPromise(fd, buffer, offset, length, position) { + return this.readSync(fd, buffer, offset, length, position); + } + + readSync(fd, buffer, offset = 0, length = 0, position = -1) { + const entry = this.fds.get(fd); + if (typeof entry === `undefined`) throw EBADF(`read`); + let realPosition; + if (position === -1 || position === null) realPosition = entry.cursor;else realPosition = position; + const source = this.readFileSync(entry.p); + source.copy(buffer, offset, realPosition, realPosition + length); + const bytesRead = Math.max(0, Math.min(source.length - realPosition, length)); + if (position === -1 || position === null) entry.cursor += bytesRead; + return bytesRead; + } + + async writePromise(fd, buffer, offset, length, position) { + if (typeof buffer === `string`) { + return this.writeSync(fd, buffer, position); + } else { + return this.writeSync(fd, buffer, offset, length, position); + } + } + + writeSync(fd, buffer, offset, length, position) { + const entry = this.fds.get(fd); + if (typeof entry === `undefined`) throw EBADF(`read`); + throw new Error(`Unimplemented`); + } + + async closePromise(fd) { + return this.closeSync(fd); + } + + closeSync(fd) { + const entry = this.fds.get(fd); + if (typeof entry === `undefined`) throw EBADF(`read`); + this.fds.delete(fd); + } + + createReadStream(p, { + encoding + } = {}) { + if (p === null) throw new Error(`Unimplemented`); + const fd = this.openSync(p, `r`); + const stream = Object.assign(new external_stream_namespaceObject.PassThrough({ + emitClose: true, + autoDestroy: true, + destroy: (error, callback) => { + clearImmediate(immediate); + this.closeSync(fd); + callback(error); + } + }), { + close() { + stream.destroy(); + }, + + bytesRead: 0, + path: p + }); + const immediate = setImmediate(async () => { + try { + const data = await this.readFilePromise(p, encoding); + stream.bytesRead = data.length; + stream.end(data); + } catch (error) { + stream.destroy(error); + } + }); + return stream; + } + + createWriteStream(p, { + encoding + } = {}) { + if (this.readOnly) throw EROFS(`open '${p}'`); + if (p === null) throw new Error(`Unimplemented`); + const chunks = []; + const fd = this.openSync(p, `w`); + const stream = Object.assign(new external_stream_namespaceObject.PassThrough({ + autoDestroy: true, + emitClose: true, + destroy: (error, callback) => { + try { + if (error) { + callback(error); + } else { + this.writeFileSync(p, Buffer.concat(chunks), encoding); + callback(null); + } + } catch (err) { + callback(err); + } finally { + this.closeSync(fd); + } + } + }), { + bytesWritten: 0, + path: p, + + close() { + stream.destroy(); + } + + }); + stream.on(`data`, chunk => { + const chunkBuffer = Buffer.from(chunk); + stream.bytesWritten += chunkBuffer.length; + chunks.push(chunkBuffer); + }); + return stream; + } + + async realpathPromise(p) { + return this.realpathSync(p); + } + + realpathSync(p) { + const resolvedP = this.resolveFilename(`lstat '${p}'`, p); + if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) throw ENOENT(`lstat '${p}'`); + return resolvedP; + } + + async existsPromise(p) { + return this.existsSync(p); + } + + existsSync(p) { + if (!this.ready) throw EBUSY(`archive closed, existsSync '${p}'`); + + if (this.symlinkCount === 0) { + const resolvedP = ppath.resolve(PortablePath.root, p); + return this.entries.has(resolvedP) || this.listings.has(resolvedP); + } + + let resolvedP; + + try { + resolvedP = this.resolveFilename(`stat '${p}'`, p); + } catch (error) { + return false; + } + + return this.entries.has(resolvedP) || this.listings.has(resolvedP); + } + + async accessPromise(p, mode) { + return this.accessSync(p, mode); + } + + accessSync(p, mode = external_fs_.constants.F_OK) { + const resolvedP = this.resolveFilename(`access '${p}'`, p); + if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) throw ENOENT(`access '${p}'`); + + if (this.readOnly && mode & external_fs_.constants.W_OK) { + throw EROFS(`access '${p}'`); + } + } + + async statPromise(p) { + return this.statSync(p); + } + + statSync(p) { + const resolvedP = this.resolveFilename(`stat '${p}'`, p); + if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) throw ENOENT(`stat '${p}'`); + if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) throw ENOTDIR(`stat '${p}'`); + return this.statImpl(`stat '${p}'`, resolvedP); + } + + async lstatPromise(p) { + return this.lstatSync(p); + } + + lstatSync(p) { + const resolvedP = this.resolveFilename(`lstat '${p}'`, p, false); + if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) throw ENOENT(`lstat '${p}'`); + if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) throw ENOTDIR(`lstat '${p}'`); + return this.statImpl(`lstat '${p}'`, resolvedP); + } + + statImpl(reason, p) { + const entry = this.entries.get(p); // File, or explicit directory + + if (typeof entry !== `undefined`) { + const stat = this.libzip.struct.statS(); + const rc = this.libzip.statIndex(this.zip, entry, 0, 0, stat); + if (rc === -1) throw this.makeLibzipError(this.libzip.getError(this.zip)); + const uid = this.stats.uid; + const gid = this.stats.gid; + const size = this.libzip.struct.statSize(stat) >>> 0; + const blksize = 512; + const blocks = Math.ceil(size / blksize); + const mtimeMs = (this.libzip.struct.statMtime(stat) >>> 0) * 1000; + const atimeMs = mtimeMs; + const birthtimeMs = mtimeMs; + const ctimeMs = mtimeMs; + const atime = new Date(atimeMs); + const birthtime = new Date(birthtimeMs); + const ctime = new Date(ctimeMs); + const mtime = new Date(mtimeMs); + const type = this.listings.has(p) ? constants_S_IFDIR : this.isSymbolicLink(entry) ? constants_S_IFLNK : constants_S_IFREG; + const defaultMode = type === constants_S_IFDIR ? 0o755 : 0o644; + const mode = type | this.getUnixMode(entry, defaultMode) & 0o777; + return Object.assign(new StatEntry(), { + uid, + gid, + size, + blksize, + blocks, + atime, + birthtime, + ctime, + mtime, + atimeMs, + birthtimeMs, + ctimeMs, + mtimeMs, + mode + }); + } // Implicit directory + + + if (this.listings.has(p)) { + const uid = this.stats.uid; + const gid = this.stats.gid; + const size = 0; + const blksize = 512; + const blocks = 0; + const atimeMs = this.stats.mtimeMs; + const birthtimeMs = this.stats.mtimeMs; + const ctimeMs = this.stats.mtimeMs; + const mtimeMs = this.stats.mtimeMs; + const atime = new Date(atimeMs); + const birthtime = new Date(birthtimeMs); + const ctime = new Date(ctimeMs); + const mtime = new Date(mtimeMs); + const mode = constants_S_IFDIR | 0o755; + return Object.assign(new StatEntry(), { + uid, + gid, + size, + blksize, + blocks, + atime, + birthtime, + ctime, + mtime, + atimeMs, + birthtimeMs, + ctimeMs, + mtimeMs, + mode + }); + } + + throw new Error(`Unreachable`); + } + + getUnixMode(index, defaultMode) { + const rc = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); + if (rc === -1) throw this.makeLibzipError(this.libzip.getError(this.zip)); + const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; + if (opsys !== this.libzip.ZIP_OPSYS_UNIX) return defaultMode; + return this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; + } + + registerListing(p) { + let listing = this.listings.get(p); + if (listing) return listing; + const parentListing = this.registerListing(ppath.dirname(p)); + listing = new Set(); + parentListing.add(ppath.basename(p)); + this.listings.set(p, listing); + return listing; + } + + registerEntry(p, index) { + const parentListing = this.registerListing(ppath.dirname(p)); + parentListing.add(ppath.basename(p)); + this.entries.set(p, index); + } + + unregisterListing(p) { + this.listings.delete(p); + const parentListing = this.listings.get(ppath.dirname(p)); + parentListing === null || parentListing === void 0 ? void 0 : parentListing.delete(ppath.basename(p)); + } + + unregisterEntry(p) { + this.unregisterListing(p); + const entry = this.entries.get(p); + this.entries.delete(p); + if (typeof entry === `undefined`) return; + this.fileSources.delete(entry); + + if (this.isSymbolicLink(entry)) { + this.symlinkCount--; + } + } + + deleteEntry(p, index) { + this.unregisterEntry(p); + const rc = this.libzip.delete(this.zip, index); + + if (rc === -1) { + throw this.makeLibzipError(this.libzip.getError(this.zip)); + } + } + + resolveFilename(reason, p, resolveLastComponent = true) { + if (!this.ready) throw EBUSY(`archive closed, ${reason}`); + let resolvedP = ppath.resolve(PortablePath.root, p); + if (resolvedP === `/`) return PortablePath.root; + const fileIndex = this.entries.get(resolvedP); + + if (resolveLastComponent && fileIndex !== undefined) { + if (this.symlinkCount !== 0 && this.isSymbolicLink(fileIndex)) { + const target = this.getFileSource(fileIndex).toString(); + return this.resolveFilename(reason, ppath.resolve(ppath.dirname(resolvedP), target), true); + } else { + return resolvedP; + } + } + + while (true) { + const parentP = this.resolveFilename(reason, ppath.dirname(resolvedP), true); + const isDir = this.listings.has(parentP); + const doesExist = this.entries.has(parentP); + if (!isDir && !doesExist) throw ENOENT(reason); + if (!isDir) throw ENOTDIR(reason); + resolvedP = ppath.resolve(parentP, ppath.basename(resolvedP)); + if (!resolveLastComponent || this.symlinkCount === 0) break; + const index = this.libzip.name.locate(this.zip, resolvedP.slice(1)); + if (index === -1) break; + + if (this.isSymbolicLink(index)) { + const target = this.getFileSource(index).toString(); + resolvedP = ppath.resolve(ppath.dirname(resolvedP), target); + } else { + break; + } + } + + return resolvedP; + } + + allocateBuffer(content) { + if (!Buffer.isBuffer(content)) content = Buffer.from(content); + const buffer = this.libzip.malloc(content.byteLength); + if (!buffer) throw new Error(`Couldn't allocate enough memory`); // Copy the file into the Emscripten heap + + const heap = new Uint8Array(this.libzip.HEAPU8.buffer, buffer, content.byteLength); + heap.set(content); + return { + buffer, + byteLength: content.byteLength + }; + } + + allocateUnattachedSource(content) { + const error = this.libzip.struct.errorS(); + const { + buffer, + byteLength + } = this.allocateBuffer(content); + const source = this.libzip.source.fromUnattachedBuffer(buffer, byteLength, 0, true, error); + + if (source === 0) { + this.libzip.free(error); + throw this.makeLibzipError(error); + } + + return source; + } + + allocateSource(content) { + const { + buffer, + byteLength + } = this.allocateBuffer(content); + const source = this.libzip.source.fromBuffer(this.zip, buffer, byteLength, 0, true); + + if (source === 0) { + this.libzip.free(buffer); + throw this.makeLibzipError(this.libzip.getError(this.zip)); + } + + return source; + } + + setFileSource(p, content) { + const buffer = Buffer.isBuffer(content) ? content : Buffer.from(content); + const target = ppath.relative(PortablePath.root, p); + const lzSource = this.allocateSource(content); + + try { + const newIndex = this.libzip.file.add(this.zip, target, lzSource, this.libzip.ZIP_FL_OVERWRITE); + if (newIndex === -1) throw this.makeLibzipError(this.libzip.getError(this.zip)); + + if (this.level !== `mixed`) { + // Use store for level 0, and deflate for 1..9 + let method; + if (this.level === 0) method = this.libzip.ZIP_CM_STORE;else method = this.libzip.ZIP_CM_DEFLATE; + const rc = this.libzip.file.setCompression(this.zip, newIndex, 0, method, this.level); + + if (rc === -1) { + throw this.makeLibzipError(this.libzip.getError(this.zip)); + } + } + + this.fileSources.set(newIndex, buffer); + return newIndex; + } catch (error) { + this.libzip.source.free(lzSource); + throw error; + } + } + + isSymbolicLink(index) { + if (this.symlinkCount === 0) return false; + const attrs = this.libzip.file.getExternalAttributes(this.zip, index, 0, 0, this.libzip.uint08S, this.libzip.uint32S); + if (attrs === -1) throw this.makeLibzipError(this.libzip.getError(this.zip)); + const opsys = this.libzip.getValue(this.libzip.uint08S, `i8`) >>> 0; + if (opsys !== this.libzip.ZIP_OPSYS_UNIX) return false; + const attributes = this.libzip.getValue(this.libzip.uint32S, `i32`) >>> 16; + return (attributes & constants_S_IFMT) === constants_S_IFLNK; + } + + getFileSource(index, opts = { + asyncDecompress: false + }) { + const cachedFileSource = this.fileSources.get(index); + if (typeof cachedFileSource !== `undefined`) return cachedFileSource; + const stat = this.libzip.struct.statS(); + const rc = this.libzip.statIndex(this.zip, index, 0, 0, stat); + if (rc === -1) throw this.makeLibzipError(this.libzip.getError(this.zip)); + const size = this.libzip.struct.statCompSize(stat); + const compressionMethod = this.libzip.struct.statCompMethod(stat); + const buffer = this.libzip.malloc(size); + + try { + const file = this.libzip.fopenIndex(this.zip, index, 0, this.libzip.ZIP_FL_COMPRESSED); + if (file === 0) throw this.makeLibzipError(this.libzip.getError(this.zip)); + + try { + const rc = this.libzip.fread(file, buffer, size, 0); + if (rc === -1) throw this.makeLibzipError(this.libzip.file.getError(file));else if (rc < size) throw new Error(`Incomplete read`);else if (rc > size) throw new Error(`Overread`); + const memory = this.libzip.HEAPU8.subarray(buffer, buffer + size); + const data = Buffer.from(memory); + + if (compressionMethod === 0) { + this.fileSources.set(index, data); + return data; + } else if (opts.asyncDecompress) { + return new Promise((resolve, reject) => { + external_zlib_default().inflateRaw(data, (error, result) => { + if (error) { + reject(error); + } else { + this.fileSources.set(index, result); + resolve(result); + } + }); + }); + } else { + const decompressedData = external_zlib_default().inflateRawSync(data); + this.fileSources.set(index, decompressedData); + return decompressedData; + } + } finally { + this.libzip.fclose(file); + } + } finally { + this.libzip.free(buffer); + } + } + + async chmodPromise(p, mask) { + return this.chmodSync(p, mask); + } + + chmodSync(p, mask) { + if (this.readOnly) throw EROFS(`chmod '${p}'`); // We don't allow to make the extracted entries group-writable + + mask &= 0o755; + const resolvedP = this.resolveFilename(`chmod '${p}'`, p, false); + const entry = this.entries.get(resolvedP); + if (typeof entry === `undefined`) throw new Error(`Assertion failed: The entry should have been registered (${resolvedP})`); + const oldMod = this.getUnixMode(entry, constants_S_IFREG | 0o000); + const newMod = oldMod & ~0o777 | mask; + const rc = this.libzip.file.setExternalAttributes(this.zip, entry, 0, 0, this.libzip.ZIP_OPSYS_UNIX, newMod << 16); + + if (rc === -1) { + throw this.makeLibzipError(this.libzip.getError(this.zip)); + } + } + + async chownPromise(p, uid, gid) { + return this.chownSync(p, uid, gid); + } + + chownSync(p, uid, gid) { + throw new Error(`Unimplemented`); + } + + async renamePromise(oldP, newP) { + return this.renameSync(oldP, newP); + } + + renameSync(oldP, newP) { + throw new Error(`Unimplemented`); + } + + async copyFilePromise(sourceP, destP, flags) { + const { + indexSource, + indexDest, + resolvedDestP + } = this.prepareCopyFile(sourceP, destP, flags); + const source = await this.getFileSource(indexSource, { + asyncDecompress: true + }); + const newIndex = this.setFileSource(resolvedDestP, source); + + if (newIndex !== indexDest) { + this.registerEntry(resolvedDestP, newIndex); + } + } + + copyFileSync(sourceP, destP, flags = 0) { + const { + indexSource, + indexDest, + resolvedDestP + } = this.prepareCopyFile(sourceP, destP, flags); + const source = this.getFileSource(indexSource); + const newIndex = this.setFileSource(resolvedDestP, source); + + if (newIndex !== indexDest) { + this.registerEntry(resolvedDestP, newIndex); + } + } + + prepareCopyFile(sourceP, destP, flags = 0) { + if (this.readOnly) throw EROFS(`copyfile '${sourceP} -> '${destP}'`); + if ((flags & external_fs_.constants.COPYFILE_FICLONE_FORCE) !== 0) throw ENOSYS(`unsupported clone operation`, `copyfile '${sourceP}' -> ${destP}'`); + const resolvedSourceP = this.resolveFilename(`copyfile '${sourceP} -> ${destP}'`, sourceP); + const indexSource = this.entries.get(resolvedSourceP); + if (typeof indexSource === `undefined`) throw EINVAL(`copyfile '${sourceP}' -> '${destP}'`); + const resolvedDestP = this.resolveFilename(`copyfile '${sourceP}' -> ${destP}'`, destP); + const indexDest = this.entries.get(resolvedDestP); + if ((flags & (external_fs_.constants.COPYFILE_EXCL | external_fs_.constants.COPYFILE_FICLONE_FORCE)) !== 0 && typeof indexDest !== `undefined`) throw EEXIST(`copyfile '${sourceP}' -> '${destP}'`); + return { + indexSource, + resolvedDestP, + indexDest + }; + } + + async appendFilePromise(p, content, opts) { + if (this.readOnly) throw EROFS(`open '${p}'`); + if (typeof opts === `undefined`) opts = { + flag: `a` + };else if (typeof opts === `string`) opts = { + flag: `a`, + encoding: opts + };else if (typeof opts.flag === `undefined`) opts = { + flag: `a`, + ...opts + }; + return this.writeFilePromise(p, content, opts); + } + + appendFileSync(p, content, opts = {}) { + if (this.readOnly) throw EROFS(`open '${p}'`); + if (typeof opts === `undefined`) opts = { + flag: `a` + };else if (typeof opts === `string`) opts = { + flag: `a`, + encoding: opts + };else if (typeof opts.flag === `undefined`) opts = { + flag: `a`, + ...opts + }; + return this.writeFileSync(p, content, opts); + } + + async writeFilePromise(p, content, opts) { + const { + encoding, + index, + resolvedP + } = this.prepareWriteFile(p, opts); + if (index !== undefined && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) content = Buffer.concat([await this.getFileSource(index, { + asyncDecompress: true + }), Buffer.from(content)]); + if (encoding !== null) content = content.toString(encoding); + const newIndex = this.setFileSource(resolvedP, content); + + if (newIndex !== index) { + this.registerEntry(resolvedP, newIndex); + } + } + + writeFileSync(p, content, opts) { + const { + encoding, + index, + resolvedP + } = this.prepareWriteFile(p, opts); + if (index !== undefined && typeof opts === `object` && opts.flag && opts.flag.includes(`a`)) content = Buffer.concat([this.getFileSource(index), Buffer.from(content)]); + if (encoding !== null) content = content.toString(encoding); + const newIndex = this.setFileSource(resolvedP, content); + + if (newIndex !== index) { + this.registerEntry(resolvedP, newIndex); + } + } + + prepareWriteFile(p, opts) { + if (typeof p !== `string`) throw EBADF(`read`); + if (this.readOnly) throw EROFS(`open '${p}'`); + const resolvedP = this.resolveFilename(`open '${p}'`, p); + if (this.listings.has(resolvedP)) throw EISDIR(`open '${p}'`); + let encoding = null; + if (typeof opts === `string`) encoding = opts;else if (typeof opts === `object` && opts.encoding) encoding = opts.encoding; + const index = this.entries.get(resolvedP); + return { + encoding, + resolvedP, + index + }; + } + + async unlinkPromise(p) { + return this.unlinkSync(p); + } + + unlinkSync(p) { + if (this.readOnly) throw EROFS(`unlink '${p}'`); + const resolvedP = this.resolveFilename(`unlink '${p}'`, p); + if (this.listings.has(resolvedP)) throw EISDIR(`unlink '${p}'`); + const index = this.entries.get(resolvedP); + if (typeof index === `undefined`) throw EINVAL(`unlink '${p}'`); + this.deleteEntry(resolvedP, index); + } + + async utimesPromise(p, atime, mtime) { + return this.utimesSync(p, atime, mtime); + } + + utimesSync(p, atime, mtime) { + if (this.readOnly) throw EROFS(`utimes '${p}'`); + const resolvedP = this.resolveFilename(`utimes '${p}'`, p); + this.utimesImpl(resolvedP, mtime); + } + + async lutimesPromise(p, atime, mtime) { + return this.lutimesSync(p, atime, mtime); + } + + lutimesSync(p, atime, mtime) { + if (this.readOnly) throw EROFS(`lutimes '${p}'`); + const resolvedP = this.resolveFilename(`utimes '${p}'`, p, false); + this.utimesImpl(resolvedP, mtime); + } + + utimesImpl(resolvedP, mtime) { + if (this.listings.has(resolvedP)) if (!this.entries.has(resolvedP)) this.hydrateDirectory(resolvedP); + const entry = this.entries.get(resolvedP); + if (entry === undefined) throw new Error(`Unreachable`); + const rc = this.libzip.file.setMtime(this.zip, entry, 0, toUnixTimestamp(mtime), 0); + + if (rc === -1) { + throw this.makeLibzipError(this.libzip.getError(this.zip)); + } + } + + async mkdirPromise(p, opts) { + return this.mkdirSync(p, opts); + } + + mkdirSync(p, { + mode = 0o755, + recursive = false + } = {}) { + if (recursive) { + this.mkdirpSync(p, { + chmod: mode + }); + return; + } + + if (this.readOnly) throw EROFS(`mkdir '${p}'`); + const resolvedP = this.resolveFilename(`mkdir '${p}'`, p); + if (this.entries.has(resolvedP) || this.listings.has(resolvedP)) throw EEXIST(`mkdir '${p}'`); + this.hydrateDirectory(resolvedP); + this.chmodSync(resolvedP, mode); + } + + async rmdirPromise(p, opts) { + return this.rmdirSync(p, opts); + } + + rmdirSync(p, { + recursive = false + } = {}) { + if (this.readOnly) throw EROFS(`rmdir '${p}'`); + + if (recursive) { + this.removeSync(p); + return; + } + + const resolvedP = this.resolveFilename(`rmdir '${p}'`, p); + const directoryListing = this.listings.get(resolvedP); + if (!directoryListing) throw ENOTDIR(`rmdir '${p}'`); + if (directoryListing.size > 0) throw ENOTEMPTY(`rmdir '${p}'`); + const index = this.entries.get(resolvedP); + if (typeof index === `undefined`) throw EINVAL(`rmdir '${p}'`); + this.deleteEntry(p, index); + } + + hydrateDirectory(resolvedP) { + const index = this.libzip.dir.add(this.zip, ppath.relative(PortablePath.root, resolvedP)); + if (index === -1) throw this.makeLibzipError(this.libzip.getError(this.zip)); + this.registerListing(resolvedP); + this.registerEntry(resolvedP, index); + return index; + } + + async linkPromise(existingP, newP) { + return this.linkSync(existingP, newP); + } + + linkSync(existingP, newP) { + // Zip archives don't support hard links: + // https://stackoverflow.com/questions/8859616/are-hard-links-possible-within-a-zip-archive + throw EOPNOTSUPP(`link '${existingP}' -> '${newP}'`); + } + + async symlinkPromise(target, p) { + return this.symlinkSync(target, p); + } + + symlinkSync(target, p) { + if (this.readOnly) throw EROFS(`symlink '${target}' -> '${p}'`); + const resolvedP = this.resolveFilename(`symlink '${target}' -> '${p}'`, p); + if (this.listings.has(resolvedP)) throw EISDIR(`symlink '${target}' -> '${p}'`); + if (this.entries.has(resolvedP)) throw EEXIST(`symlink '${target}' -> '${p}'`); + const index = this.setFileSource(resolvedP, target); + this.registerEntry(resolvedP, index); + const rc = this.libzip.file.setExternalAttributes(this.zip, index, 0, 0, this.libzip.ZIP_OPSYS_UNIX, (constants_S_IFLNK | 0o777) << 16); + if (rc === -1) throw this.makeLibzipError(this.libzip.getError(this.zip)); + this.symlinkCount += 1; + } + + async readFilePromise(p, encoding) { + // This is messed up regarding the TS signatures + if (typeof encoding === `object`) // @ts-expect-error + encoding = encoding ? encoding.encoding : undefined; + const data = await this.readFileBuffer(p, { + asyncDecompress: true + }); + return encoding ? data.toString(encoding) : data; + } + + readFileSync(p, encoding) { + // This is messed up regarding the TS signatures + if (typeof encoding === `object`) // @ts-expect-error + encoding = encoding ? encoding.encoding : undefined; + const data = this.readFileBuffer(p); + return encoding ? data.toString(encoding) : data; + } + + readFileBuffer(p, opts = { + asyncDecompress: false + }) { + if (typeof p !== `string`) throw EBADF(`read`); + const resolvedP = this.resolveFilename(`open '${p}'`, p); + if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) throw ENOENT(`open '${p}'`); // Ensures that the last component is a directory, if the user said so (even if it is we'll throw right after with EISDIR anyway) + + if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) throw ENOTDIR(`open '${p}'`); + if (this.listings.has(resolvedP)) throw EISDIR(`read`); + const entry = this.entries.get(resolvedP); + if (entry === undefined) throw new Error(`Unreachable`); + return this.getFileSource(entry, opts); + } + + async readdirPromise(p, { + withFileTypes + } = {}) { + return this.readdirSync(p, { + withFileTypes: withFileTypes + }); + } + + readdirSync(p, { + withFileTypes + } = {}) { + const resolvedP = this.resolveFilename(`scandir '${p}'`, p); + if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) throw ENOENT(`scandir '${p}'`); + const directoryListing = this.listings.get(resolvedP); + if (!directoryListing) throw ENOTDIR(`scandir '${p}'`); + const entries = [...directoryListing]; + if (!withFileTypes) return entries; + return entries.map(name => { + return Object.assign(this.statImpl(`lstat`, ppath.join(p, name)), { + name + }); + }); + } + + async readlinkPromise(p) { + const entry = this.prepareReadlink(p); + return (await this.getFileSource(entry, { + asyncDecompress: true + })).toString(); + } + + readlinkSync(p) { + const entry = this.prepareReadlink(p); + return this.getFileSource(entry).toString(); + } + + prepareReadlink(p) { + const resolvedP = this.resolveFilename(`readlink '${p}'`, p, false); + if (!this.entries.has(resolvedP) && !this.listings.has(resolvedP)) throw ENOENT(`readlink '${p}'`); // Ensure that the last component is a directory (if it is we'll throw right after with EISDIR anyway) + + if (p[p.length - 1] === `/` && !this.listings.has(resolvedP)) throw ENOTDIR(`open '${p}'`); + if (this.listings.has(resolvedP)) throw EINVAL(`readlink '${p}'`); + const entry = this.entries.get(resolvedP); + if (entry === undefined) throw new Error(`Unreachable`); + if (!this.isSymbolicLink(entry)) throw EINVAL(`readlink '${p}'`); + return entry; + } + + async truncatePromise(p, len = 0) { + const resolvedP = this.resolveFilename(`open '${p}'`, p); + const index = this.entries.get(resolvedP); + if (typeof index === `undefined`) throw EINVAL(`open '${p}'`); + const source = await this.getFileSource(index, { + asyncDecompress: true + }); + const truncated = Buffer.alloc(len, 0x00); + source.copy(truncated); + return await this.writeFilePromise(p, truncated); + } + + truncateSync(p, len = 0) { + const resolvedP = this.resolveFilename(`open '${p}'`, p); + const index = this.entries.get(resolvedP); + if (typeof index === `undefined`) throw EINVAL(`open '${p}'`); + const source = this.getFileSource(index); + const truncated = Buffer.alloc(len, 0x00); + source.copy(truncated); + return this.writeFileSync(p, truncated); + } + + watch(p, a, b) { + let persistent; + + switch (typeof a) { + case `function`: + case `string`: + case `undefined`: + { + persistent = true; + } + break; + + default: + { + ({ + persistent = true + } = a); + } + break; + } + + if (!persistent) return { + on: () => {}, + close: () => {} + }; + const interval = setInterval(() => {}, 24 * 60 * 60 * 1000); + return { + on: () => {}, + close: () => { + clearInterval(interval); + } + }; + } + + watchFile(p, a, b) { + const resolvedP = this.resolveFilename(`open '${p}'`, p); + return watchFile(this, resolvedP, a, b); + } + + unwatchFile(p, cb) { + const resolvedP = this.resolveFilename(`open '${p}'`, p); + return unwatchFile(this, resolvedP, cb); + } + +} +// CONCATENATED MODULE: ../yarnpkg-fslib/sources/ZipOpenFS.ts + + + + + + +const ZIP_FD = 0x80000000; +const FILE_PARTS_REGEX = /.*?(? { + return await this.baseFs.openPromise(p, flags, mode); + }, async (zipFs, { + subPath + }) => { + return this.remapFd(zipFs, await zipFs.openPromise(subPath, flags, mode)); + }); + } + + openSync(p, flags, mode) { + return this.makeCallSync(p, () => { + return this.baseFs.openSync(p, flags, mode); + }, (zipFs, { + subPath + }) => { + return this.remapFd(zipFs, zipFs.openSync(subPath, flags, mode)); + }); + } + + async opendirPromise(p, opts) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.opendirPromise(p, opts); + }, async (zipFs, { + subPath + }) => { + return await zipFs.opendirPromise(subPath, opts); + }, { + requireSubpath: false + }); + } + + opendirSync(p, opts) { + return this.makeCallSync(p, () => { + return this.baseFs.opendirSync(p, opts); + }, (zipFs, { + subPath + }) => { + return zipFs.opendirSync(subPath, opts); + }, { + requireSubpath: false + }); + } + + async readPromise(fd, buffer, offset, length, position) { + if ((fd & ZIP_FD) === 0) return await this.baseFs.readPromise(fd, buffer, offset, length, position); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) throw Object.assign(new Error(`EBADF: bad file descriptor, read`), { + code: `EBADF` + }); + const [zipFs, realFd] = entry; + return await zipFs.readPromise(realFd, buffer, offset, length, position); + } + + readSync(fd, buffer, offset, length, position) { + if ((fd & ZIP_FD) === 0) return this.baseFs.readSync(fd, buffer, offset, length, position); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) throw Object.assign(new Error(`EBADF: bad file descriptor, read`), { + code: `EBADF` + }); + const [zipFs, realFd] = entry; + return zipFs.readSync(realFd, buffer, offset, length, position); + } + + async writePromise(fd, buffer, offset, length, position) { + if ((fd & ZIP_FD) === 0) { + if (typeof buffer === `string`) { + return await this.baseFs.writePromise(fd, buffer, offset); + } else { + return await this.baseFs.writePromise(fd, buffer, offset, length, position); + } + } + + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) throw Object.assign(new Error(`EBADF: bad file descriptor, write`), { + code: `EBADF` + }); + const [zipFs, realFd] = entry; + + if (typeof buffer === `string`) { + return await zipFs.writePromise(realFd, buffer, offset); + } else { + return await zipFs.writePromise(realFd, buffer, offset, length, position); + } + } + + writeSync(fd, buffer, offset, length, position) { + if ((fd & ZIP_FD) === 0) { + if (typeof buffer === `string`) { + return this.baseFs.writeSync(fd, buffer, offset); + } else { + return this.baseFs.writeSync(fd, buffer, offset, length, position); + } + } + + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) throw Object.assign(new Error(`EBADF: bad file descriptor, write`), { + code: `EBADF` + }); + const [zipFs, realFd] = entry; + + if (typeof buffer === `string`) { + return zipFs.writeSync(realFd, buffer, offset); + } else { + return zipFs.writeSync(realFd, buffer, offset, length, position); + } + } + + async closePromise(fd) { + if ((fd & ZIP_FD) === 0) return await this.baseFs.closePromise(fd); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) throw Object.assign(new Error(`EBADF: bad file descriptor, close`), { + code: `EBADF` + }); + this.fdMap.delete(fd); + const [zipFs, realFd] = entry; + return await zipFs.closePromise(realFd); + } + + closeSync(fd) { + if ((fd & ZIP_FD) === 0) return this.baseFs.closeSync(fd); + const entry = this.fdMap.get(fd); + if (typeof entry === `undefined`) throw Object.assign(new Error(`EBADF: bad file descriptor, close`), { + code: `EBADF` + }); + this.fdMap.delete(fd); + const [zipFs, realFd] = entry; + return zipFs.closeSync(realFd); + } + + createReadStream(p, opts) { + if (p === null) return this.baseFs.createReadStream(p, opts); + return this.makeCallSync(p, () => { + return this.baseFs.createReadStream(p, opts); + }, (zipFs, { + subPath + }) => { + return zipFs.createReadStream(subPath, opts); + }); + } + + createWriteStream(p, opts) { + if (p === null) return this.baseFs.createWriteStream(p, opts); + return this.makeCallSync(p, () => { + return this.baseFs.createWriteStream(p, opts); + }, (zipFs, { + subPath + }) => { + return zipFs.createWriteStream(subPath, opts); + }); + } + + async realpathPromise(p) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.realpathPromise(p); + }, async (zipFs, { + archivePath, + subPath + }) => { + let realArchivePath = this.realPaths.get(archivePath); + + if (typeof realArchivePath === `undefined`) { + realArchivePath = await this.baseFs.realpathPromise(archivePath); + this.realPaths.set(archivePath, realArchivePath); + } + + return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, await zipFs.realpathPromise(subPath))); + }); + } + + realpathSync(p) { + return this.makeCallSync(p, () => { + return this.baseFs.realpathSync(p); + }, (zipFs, { + archivePath, + subPath + }) => { + let realArchivePath = this.realPaths.get(archivePath); + + if (typeof realArchivePath === `undefined`) { + realArchivePath = this.baseFs.realpathSync(archivePath); + this.realPaths.set(archivePath, realArchivePath); + } + + return this.pathUtils.join(realArchivePath, this.pathUtils.relative(PortablePath.root, zipFs.realpathSync(subPath))); + }); + } + + async existsPromise(p) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.existsPromise(p); + }, async (zipFs, { + subPath + }) => { + return await zipFs.existsPromise(subPath); + }); + } + + existsSync(p) { + return this.makeCallSync(p, () => { + return this.baseFs.existsSync(p); + }, (zipFs, { + subPath + }) => { + return zipFs.existsSync(subPath); + }); + } + + async accessPromise(p, mode) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.accessPromise(p, mode); + }, async (zipFs, { + subPath + }) => { + return await zipFs.accessPromise(subPath, mode); + }); + } + + accessSync(p, mode) { + return this.makeCallSync(p, () => { + return this.baseFs.accessSync(p, mode); + }, (zipFs, { + subPath + }) => { + return zipFs.accessSync(subPath, mode); + }); + } + + async statPromise(p) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.statPromise(p); + }, async (zipFs, { + subPath + }) => { + return await zipFs.statPromise(subPath); + }); + } + + statSync(p) { + return this.makeCallSync(p, () => { + return this.baseFs.statSync(p); + }, (zipFs, { + subPath + }) => { + return zipFs.statSync(subPath); + }); + } + + async lstatPromise(p) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.lstatPromise(p); + }, async (zipFs, { + subPath + }) => { + return await zipFs.lstatPromise(subPath); + }); + } + + lstatSync(p) { + return this.makeCallSync(p, () => { + return this.baseFs.lstatSync(p); + }, (zipFs, { + subPath + }) => { + return zipFs.lstatSync(subPath); + }); + } + + async chmodPromise(p, mask) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.chmodPromise(p, mask); + }, async (zipFs, { + subPath + }) => { + return await zipFs.chmodPromise(subPath, mask); + }); + } + + chmodSync(p, mask) { + return this.makeCallSync(p, () => { + return this.baseFs.chmodSync(p, mask); + }, (zipFs, { + subPath + }) => { + return zipFs.chmodSync(subPath, mask); + }); + } + + async chownPromise(p, uid, gid) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.chownPromise(p, uid, gid); + }, async (zipFs, { + subPath + }) => { + return await zipFs.chownPromise(subPath, uid, gid); + }); + } + + chownSync(p, uid, gid) { + return this.makeCallSync(p, () => { + return this.baseFs.chownSync(p, uid, gid); + }, (zipFs, { + subPath + }) => { + return zipFs.chownSync(subPath, uid, gid); + }); + } + + async renamePromise(oldP, newP) { + return await this.makeCallPromise(oldP, async () => { + return await this.makeCallPromise(newP, async () => { + return await this.baseFs.renamePromise(oldP, newP); + }, async () => { + throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { + code: `EEXDEV` + }); + }); + }, async (zipFsO, { + subPath: subPathO + }) => { + return await this.makeCallPromise(newP, async () => { + throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { + code: `EEXDEV` + }); + }, async (zipFsN, { + subPath: subPathN + }) => { + if (zipFsO !== zipFsN) { + throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { + code: `EEXDEV` + }); + } else { + return await zipFsO.renamePromise(subPathO, subPathN); + } + }); + }); + } + + renameSync(oldP, newP) { + return this.makeCallSync(oldP, () => { + return this.makeCallSync(newP, () => { + return this.baseFs.renameSync(oldP, newP); + }, async () => { + throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { + code: `EEXDEV` + }); + }); + }, (zipFsO, { + subPath: subPathO + }) => { + return this.makeCallSync(newP, () => { + throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { + code: `EEXDEV` + }); + }, (zipFsN, { + subPath: subPathN + }) => { + if (zipFsO !== zipFsN) { + throw Object.assign(new Error(`EEXDEV: cross-device link not permitted`), { + code: `EEXDEV` + }); + } else { + return zipFsO.renameSync(subPathO, subPathN); + } + }); + }); + } + + async copyFilePromise(sourceP, destP, flags = 0) { + const fallback = async (sourceFs, sourceP, destFs, destP) => { + if ((flags & external_fs_.constants.COPYFILE_FICLONE_FORCE) !== 0) throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP}' -> ${destP}'`), { + code: `EXDEV` + }); + if (flags & external_fs_.constants.COPYFILE_EXCL && (await this.existsPromise(sourceP))) throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP}' -> '${destP}'`), { + code: `EEXIST` + }); + let content; + + try { + content = await sourceFs.readFilePromise(sourceP); + } catch (error) { + throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP}' -> '${destP}'`), { + code: `EINVAL` + }); + } + + await destFs.writeFilePromise(destP, content); + }; + + return await this.makeCallPromise(sourceP, async () => { + return await this.makeCallPromise(destP, async () => { + return await this.baseFs.copyFilePromise(sourceP, destP, flags); + }, async (zipFsD, { + subPath: subPathD + }) => { + return await fallback(this.baseFs, sourceP, zipFsD, subPathD); + }); + }, async (zipFsS, { + subPath: subPathS + }) => { + return await this.makeCallPromise(destP, async () => { + return await fallback(zipFsS, subPathS, this.baseFs, destP); + }, async (zipFsD, { + subPath: subPathD + }) => { + if (zipFsS !== zipFsD) { + return await fallback(zipFsS, subPathS, zipFsD, subPathD); + } else { + return await zipFsS.copyFilePromise(subPathS, subPathD, flags); + } + }); + }); + } + + copyFileSync(sourceP, destP, flags = 0) { + const fallback = (sourceFs, sourceP, destFs, destP) => { + if ((flags & external_fs_.constants.COPYFILE_FICLONE_FORCE) !== 0) throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${sourceP}' -> ${destP}'`), { + code: `EXDEV` + }); + if (flags & external_fs_.constants.COPYFILE_EXCL && this.existsSync(sourceP)) throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${sourceP}' -> '${destP}'`), { + code: `EEXIST` + }); + let content; + + try { + content = sourceFs.readFileSync(sourceP); + } catch (error) { + throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${sourceP}' -> '${destP}'`), { + code: `EINVAL` + }); + } + + destFs.writeFileSync(destP, content); + }; + + return this.makeCallSync(sourceP, () => { + return this.makeCallSync(destP, () => { + return this.baseFs.copyFileSync(sourceP, destP, flags); + }, (zipFsD, { + subPath: subPathD + }) => { + return fallback(this.baseFs, sourceP, zipFsD, subPathD); + }); + }, (zipFsS, { + subPath: subPathS + }) => { + return this.makeCallSync(destP, () => { + return fallback(zipFsS, subPathS, this.baseFs, destP); + }, (zipFsD, { + subPath: subPathD + }) => { + if (zipFsS !== zipFsD) { + return fallback(zipFsS, subPathS, zipFsD, subPathD); + } else { + return zipFsS.copyFileSync(subPathS, subPathD, flags); + } + }); + }); + } + + async appendFilePromise(p, content, opts) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.appendFilePromise(p, content, opts); + }, async (zipFs, { + subPath + }) => { + return await zipFs.appendFilePromise(subPath, content, opts); + }); + } + + appendFileSync(p, content, opts) { + return this.makeCallSync(p, () => { + return this.baseFs.appendFileSync(p, content, opts); + }, (zipFs, { + subPath + }) => { + return zipFs.appendFileSync(subPath, content, opts); + }); + } + + async writeFilePromise(p, content, opts) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.writeFilePromise(p, content, opts); + }, async (zipFs, { + subPath + }) => { + return await zipFs.writeFilePromise(subPath, content, opts); + }); + } + + writeFileSync(p, content, opts) { + return this.makeCallSync(p, () => { + return this.baseFs.writeFileSync(p, content, opts); + }, (zipFs, { + subPath + }) => { + return zipFs.writeFileSync(subPath, content, opts); + }); + } + + async unlinkPromise(p) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.unlinkPromise(p); + }, async (zipFs, { + subPath + }) => { + return await zipFs.unlinkPromise(subPath); + }); + } + + unlinkSync(p) { + return this.makeCallSync(p, () => { + return this.baseFs.unlinkSync(p); + }, (zipFs, { + subPath + }) => { + return zipFs.unlinkSync(subPath); + }); + } + + async utimesPromise(p, atime, mtime) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.utimesPromise(p, atime, mtime); + }, async (zipFs, { + subPath + }) => { + return await zipFs.utimesPromise(subPath, atime, mtime); + }); + } + + utimesSync(p, atime, mtime) { + return this.makeCallSync(p, () => { + return this.baseFs.utimesSync(p, atime, mtime); + }, (zipFs, { + subPath + }) => { + return zipFs.utimesSync(subPath, atime, mtime); + }); + } + + async mkdirPromise(p, opts) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.mkdirPromise(p, opts); + }, async (zipFs, { + subPath + }) => { + return await zipFs.mkdirPromise(subPath, opts); + }); + } + + mkdirSync(p, opts) { + return this.makeCallSync(p, () => { + return this.baseFs.mkdirSync(p, opts); + }, (zipFs, { + subPath + }) => { + return zipFs.mkdirSync(subPath, opts); + }); + } + + async rmdirPromise(p, opts) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.rmdirPromise(p, opts); + }, async (zipFs, { + subPath + }) => { + return await zipFs.rmdirPromise(subPath, opts); + }); + } + + rmdirSync(p, opts) { + return this.makeCallSync(p, () => { + return this.baseFs.rmdirSync(p, opts); + }, (zipFs, { + subPath + }) => { + return zipFs.rmdirSync(subPath, opts); + }); + } + + async linkPromise(existingP, newP) { + return await this.makeCallPromise(newP, async () => { + return await this.baseFs.linkPromise(existingP, newP); + }, async (zipFs, { + subPath + }) => { + return await zipFs.linkPromise(existingP, subPath); + }); + } + + linkSync(existingP, newP) { + return this.makeCallSync(newP, () => { + return this.baseFs.linkSync(existingP, newP); + }, (zipFs, { + subPath + }) => { + return zipFs.linkSync(existingP, subPath); + }); + } + + async symlinkPromise(target, p, type) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.symlinkPromise(target, p, type); + }, async (zipFs, { + subPath + }) => { + return await zipFs.symlinkPromise(target, subPath); + }); + } + + symlinkSync(target, p, type) { + return this.makeCallSync(p, () => { + return this.baseFs.symlinkSync(target, p, type); + }, (zipFs, { + subPath + }) => { + return zipFs.symlinkSync(target, subPath); + }); + } + + async readFilePromise(p, encoding) { + return this.makeCallPromise(p, async () => { + // This weird switch is required to tell TypeScript that the signatures are proper (otherwise it thinks that only the generic one is covered) + switch (encoding) { + case `utf8`: + return await this.baseFs.readFilePromise(p, encoding); + + default: + return await this.baseFs.readFilePromise(p, encoding); + } + }, async (zipFs, { + subPath + }) => { + return await zipFs.readFilePromise(subPath, encoding); + }); + } + + readFileSync(p, encoding) { + return this.makeCallSync(p, () => { + // This weird switch is required to tell TypeScript that the signatures are proper (otherwise it thinks that only the generic one is covered) + switch (encoding) { + case `utf8`: + return this.baseFs.readFileSync(p, encoding); + + default: + return this.baseFs.readFileSync(p, encoding); + } + }, (zipFs, { + subPath + }) => { + return zipFs.readFileSync(subPath, encoding); + }); + } + + async readdirPromise(p, { + withFileTypes + } = {}) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.readdirPromise(p, { + withFileTypes: withFileTypes + }); + }, async (zipFs, { + subPath + }) => { + return await zipFs.readdirPromise(subPath, { + withFileTypes: withFileTypes + }); + }, { + requireSubpath: false + }); + } + + readdirSync(p, { + withFileTypes + } = {}) { + return this.makeCallSync(p, () => { + return this.baseFs.readdirSync(p, { + withFileTypes: withFileTypes + }); + }, (zipFs, { + subPath + }) => { + return zipFs.readdirSync(subPath, { + withFileTypes: withFileTypes + }); + }, { + requireSubpath: false + }); + } + + async readlinkPromise(p) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.readlinkPromise(p); + }, async (zipFs, { + subPath + }) => { + return await zipFs.readlinkPromise(subPath); + }); + } + + readlinkSync(p) { + return this.makeCallSync(p, () => { + return this.baseFs.readlinkSync(p); + }, (zipFs, { + subPath + }) => { + return zipFs.readlinkSync(subPath); + }); + } + + async truncatePromise(p, len) { + return await this.makeCallPromise(p, async () => { + return await this.baseFs.truncatePromise(p, len); + }, async (zipFs, { + subPath + }) => { + return await zipFs.truncatePromise(subPath, len); + }); + } + + truncateSync(p, len) { + return this.makeCallSync(p, () => { + return this.baseFs.truncateSync(p, len); + }, (zipFs, { + subPath + }) => { + return zipFs.truncateSync(subPath, len); + }); + } + + watch(p, a, b) { + return this.makeCallSync(p, () => { + return this.baseFs.watch(p, // @ts-expect-error + a, b); + }, (zipFs, { + subPath + }) => { + return zipFs.watch(subPath, // @ts-expect-error + a, b); + }); + } + + watchFile(p, a, b) { + return this.makeCallSync(p, () => { + return this.baseFs.watchFile(p, // @ts-expect-error + a, b); + }, () => { + return watchFile(this, p, a, b); + }); + } + + unwatchFile(p, cb) { + return this.makeCallSync(p, () => { + return this.baseFs.unwatchFile(p, cb); + }, () => { + return unwatchFile(this, p, cb); + }); + } + + async makeCallPromise(p, discard, accept, { + requireSubpath = true + } = {}) { + if (typeof p !== `string`) return await discard(); + const normalizedP = this.resolve(p); + const zipInfo = this.findZip(normalizedP); + if (!zipInfo) return await discard(); + if (requireSubpath && zipInfo.subPath === `/`) return await discard(); + return await this.getZipPromise(zipInfo.archivePath, async zipFs => await accept(zipFs, zipInfo)); + } + + makeCallSync(p, discard, accept, { + requireSubpath = true + } = {}) { + if (typeof p !== `string`) return discard(); + const normalizedP = this.resolve(p); + const zipInfo = this.findZip(normalizedP); + if (!zipInfo) return discard(); + if (requireSubpath && zipInfo.subPath === `/`) return discard(); + return this.getZipSync(zipInfo.archivePath, zipFs => accept(zipFs, zipInfo)); + } + + findZip(p) { + if (this.filter && !this.filter.test(p)) return null; + let filePath = ``; + + while (true) { + const parts = FILE_PARTS_REGEX.exec(p.substr(filePath.length)); + if (!parts) return null; + filePath = this.pathUtils.join(filePath, parts[0]); + + if (this.isZip.has(filePath) === false) { + if (this.notZip.has(filePath)) continue; + + try { + if (!this.baseFs.lstatSync(filePath).isFile()) { + this.notZip.add(filePath); + continue; + } + } catch (_a) { + return null; + } + + this.isZip.add(filePath); + } + + return { + archivePath: filePath, + subPath: this.pathUtils.join(PortablePath.root, p.substr(filePath.length)) + }; + } + } + + limitOpenFiles(max) { + if (this.zipInstances === null) return; + const now = Date.now(); + let nextExpiresAt = now + this.maxAge; + let closeCount = max === null ? 0 : this.zipInstances.size - max; + + for (const [path, { + zipFs, + expiresAt, + refCount + }] of this.zipInstances.entries()) { + if (refCount !== 0 || zipFs.hasOpenFileHandles()) { + continue; + } else if (now >= expiresAt) { + zipFs.saveAndClose(); + this.zipInstances.delete(path); + closeCount -= 1; + continue; + } else if (max === null || closeCount <= 0) { + nextExpiresAt = expiresAt; + break; + } + + zipFs.saveAndClose(); + this.zipInstances.delete(path); + closeCount -= 1; + } + + if (this.limitOpenFilesTimeout === null && (max === null && this.zipInstances.size > 0 || max !== null)) { + this.limitOpenFilesTimeout = setTimeout(() => { + this.limitOpenFilesTimeout = null; + this.limitOpenFiles(null); + }, nextExpiresAt - now).unref(); + } + } + + async getZipPromise(p, accept) { + const getZipOptions = async () => ({ + baseFs: this.baseFs, + libzip: this.libzip, + readOnly: this.readOnlyArchives, + stats: await this.baseFs.statPromise(p) + }); + + if (this.zipInstances) { + let cachedZipFs = this.zipInstances.get(p); + + if (!cachedZipFs) { + const zipOptions = await getZipOptions(); // We need to recheck because concurrent getZipPromise calls may + // have instantiated the zip archive while we were waiting + + cachedZipFs = this.zipInstances.get(p); + + if (!cachedZipFs) { + cachedZipFs = { + zipFs: new ZipFS(p, zipOptions), + expiresAt: 0, + refCount: 0 + }; + } + } // Removing then re-adding the field allows us to easily implement + // a basic LRU garbage collection strategy + + + this.zipInstances.delete(p); + this.limitOpenFiles(this.maxOpenFiles - 1); + this.zipInstances.set(p, cachedZipFs); + cachedZipFs.expiresAt = Date.now() + this.maxAge; + cachedZipFs.refCount += 1; + + try { + return await accept(cachedZipFs.zipFs); + } finally { + cachedZipFs.refCount -= 1; + } + } else { + const zipFs = new ZipFS(p, await getZipOptions()); + + try { + return await accept(zipFs); + } finally { + zipFs.saveAndClose(); + } + } + } + + getZipSync(p, accept) { + const getZipOptions = () => ({ + baseFs: this.baseFs, + libzip: this.libzip, + readOnly: this.readOnlyArchives, + stats: this.baseFs.statSync(p) + }); + + if (this.zipInstances) { + let cachedZipFs = this.zipInstances.get(p); + + if (!cachedZipFs) { + cachedZipFs = { + zipFs: new ZipFS(p, getZipOptions()), + expiresAt: 0, + refCount: 0 + }; + } // Removing then re-adding the field allows us to easily implement + // a basic LRU garbage collection strategy + + + this.zipInstances.delete(p); + this.limitOpenFiles(this.maxOpenFiles - 1); + this.zipInstances.set(p, cachedZipFs); + cachedZipFs.expiresAt = Date.now() + this.maxAge; + return accept(cachedZipFs.zipFs); + } else { + const zipFs = new ZipFS(p, getZipOptions()); + + try { + return accept(zipFs); + } finally { + zipFs.saveAndClose(); + } + } + } + +} +// CONCATENATED MODULE: ../yarnpkg-libzip/sources/makeInterface.ts +const number64 = [`number`, `number`]; +var Errors; + +(function (Errors) { + Errors[Errors["ZIP_ER_OK"] = 0] = "ZIP_ER_OK"; + Errors[Errors["ZIP_ER_MULTIDISK"] = 1] = "ZIP_ER_MULTIDISK"; + Errors[Errors["ZIP_ER_RENAME"] = 2] = "ZIP_ER_RENAME"; + Errors[Errors["ZIP_ER_CLOSE"] = 3] = "ZIP_ER_CLOSE"; + Errors[Errors["ZIP_ER_SEEK"] = 4] = "ZIP_ER_SEEK"; + Errors[Errors["ZIP_ER_READ"] = 5] = "ZIP_ER_READ"; + Errors[Errors["ZIP_ER_WRITE"] = 6] = "ZIP_ER_WRITE"; + Errors[Errors["ZIP_ER_CRC"] = 7] = "ZIP_ER_CRC"; + Errors[Errors["ZIP_ER_ZIPCLOSED"] = 8] = "ZIP_ER_ZIPCLOSED"; + Errors[Errors["ZIP_ER_NOENT"] = 9] = "ZIP_ER_NOENT"; + Errors[Errors["ZIP_ER_EXISTS"] = 10] = "ZIP_ER_EXISTS"; + Errors[Errors["ZIP_ER_OPEN"] = 11] = "ZIP_ER_OPEN"; + Errors[Errors["ZIP_ER_TMPOPEN"] = 12] = "ZIP_ER_TMPOPEN"; + Errors[Errors["ZIP_ER_ZLIB"] = 13] = "ZIP_ER_ZLIB"; + Errors[Errors["ZIP_ER_MEMORY"] = 14] = "ZIP_ER_MEMORY"; + Errors[Errors["ZIP_ER_CHANGED"] = 15] = "ZIP_ER_CHANGED"; + Errors[Errors["ZIP_ER_COMPNOTSUPP"] = 16] = "ZIP_ER_COMPNOTSUPP"; + Errors[Errors["ZIP_ER_EOF"] = 17] = "ZIP_ER_EOF"; + Errors[Errors["ZIP_ER_INVAL"] = 18] = "ZIP_ER_INVAL"; + Errors[Errors["ZIP_ER_NOZIP"] = 19] = "ZIP_ER_NOZIP"; + Errors[Errors["ZIP_ER_INTERNAL"] = 20] = "ZIP_ER_INTERNAL"; + Errors[Errors["ZIP_ER_INCONS"] = 21] = "ZIP_ER_INCONS"; + Errors[Errors["ZIP_ER_REMOVE"] = 22] = "ZIP_ER_REMOVE"; + Errors[Errors["ZIP_ER_DELETED"] = 23] = "ZIP_ER_DELETED"; + Errors[Errors["ZIP_ER_ENCRNOTSUPP"] = 24] = "ZIP_ER_ENCRNOTSUPP"; + Errors[Errors["ZIP_ER_RDONLY"] = 25] = "ZIP_ER_RDONLY"; + Errors[Errors["ZIP_ER_NOPASSWD"] = 26] = "ZIP_ER_NOPASSWD"; + Errors[Errors["ZIP_ER_WRONGPASSWD"] = 27] = "ZIP_ER_WRONGPASSWD"; + Errors[Errors["ZIP_ER_OPNOTSUPP"] = 28] = "ZIP_ER_OPNOTSUPP"; + Errors[Errors["ZIP_ER_INUSE"] = 29] = "ZIP_ER_INUSE"; + Errors[Errors["ZIP_ER_TELL"] = 30] = "ZIP_ER_TELL"; + Errors[Errors["ZIP_ER_COMPRESSED_DATA"] = 31] = "ZIP_ER_COMPRESSED_DATA"; +})(Errors || (Errors = {})); + +const makeInterface = libzip => ({ + // Those are getters because they can change after memory growth + get HEAP8() { + return libzip.HEAP8; + }, + + get HEAPU8() { + return libzip.HEAPU8; + }, + + errors: Errors, + SEEK_SET: 0, + SEEK_CUR: 1, + SEEK_END: 2, + ZIP_CHECKCONS: 4, + ZIP_CREATE: 1, + ZIP_EXCL: 2, + ZIP_TRUNCATE: 8, + ZIP_RDONLY: 16, + ZIP_FL_OVERWRITE: 8192, + ZIP_FL_COMPRESSED: 4, + ZIP_OPSYS_DOS: 0x00, + ZIP_OPSYS_AMIGA: 0x01, + ZIP_OPSYS_OPENVMS: 0x02, + ZIP_OPSYS_UNIX: 0x03, + ZIP_OPSYS_VM_CMS: 0x04, + ZIP_OPSYS_ATARI_ST: 0x05, + ZIP_OPSYS_OS_2: 0x06, + ZIP_OPSYS_MACINTOSH: 0x07, + ZIP_OPSYS_Z_SYSTEM: 0x08, + ZIP_OPSYS_CPM: 0x09, + ZIP_OPSYS_WINDOWS_NTFS: 0x0a, + ZIP_OPSYS_MVS: 0x0b, + ZIP_OPSYS_VSE: 0x0c, + ZIP_OPSYS_ACORN_RISC: 0x0d, + ZIP_OPSYS_VFAT: 0x0e, + ZIP_OPSYS_ALTERNATE_MVS: 0x0f, + ZIP_OPSYS_BEOS: 0x10, + ZIP_OPSYS_TANDEM: 0x11, + ZIP_OPSYS_OS_400: 0x12, + ZIP_OPSYS_OS_X: 0x13, + ZIP_CM_DEFAULT: -1, + ZIP_CM_STORE: 0, + ZIP_CM_DEFLATE: 8, + uint08S: libzip._malloc(1), + uint16S: libzip._malloc(2), + uint32S: libzip._malloc(4), + uint64S: libzip._malloc(8), + malloc: libzip._malloc, + free: libzip._free, + getValue: libzip.getValue, + open: libzip.cwrap(`zip_open`, `number`, [`string`, `number`, `number`]), + openFromSource: libzip.cwrap(`zip_open_from_source`, `number`, [`number`, `number`, `number`]), + close: libzip.cwrap(`zip_close`, `number`, [`number`]), + discard: libzip.cwrap(`zip_discard`, null, [`number`]), + getError: libzip.cwrap(`zip_get_error`, `number`, [`number`]), + getName: libzip.cwrap(`zip_get_name`, `string`, [`number`, `number`, `number`]), + getNumEntries: libzip.cwrap(`zip_get_num_entries`, `number`, [`number`, `number`]), + delete: libzip.cwrap(`zip_delete`, `number`, [`number`, `number`]), + stat: libzip.cwrap(`zip_stat`, `number`, [`number`, `string`, `number`, `number`]), + statIndex: libzip.cwrap(`zip_stat_index`, `number`, [`number`, ...number64, `number`, `number`]), + fopen: libzip.cwrap(`zip_fopen`, `number`, [`number`, `string`, `number`]), + fopenIndex: libzip.cwrap(`zip_fopen_index`, `number`, [`number`, ...number64, `number`]), + fread: libzip.cwrap(`zip_fread`, `number`, [`number`, `number`, `number`, `number`]), + fclose: libzip.cwrap(`zip_fclose`, `number`, [`number`]), + dir: { + add: libzip.cwrap(`zip_dir_add`, `number`, [`number`, `string`]) + }, + file: { + add: libzip.cwrap(`zip_file_add`, `number`, [`number`, `string`, `number`, `number`]), + getError: libzip.cwrap(`zip_file_get_error`, `number`, [`number`]), + getExternalAttributes: libzip.cwrap(`zip_file_get_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), + setExternalAttributes: libzip.cwrap(`zip_file_set_external_attributes`, `number`, [`number`, ...number64, `number`, `number`, `number`]), + setMtime: libzip.cwrap(`zip_file_set_mtime`, `number`, [`number`, ...number64, `number`, `number`]), + setCompression: libzip.cwrap(`zip_set_file_compression`, `number`, [`number`, ...number64, `number`, `number`]) + }, + ext: { + countSymlinks: libzip.cwrap(`zip_ext_count_symlinks`, `number`, [`number`]) + }, + error: { + initWithCode: libzip.cwrap(`zip_error_init_with_code`, null, [`number`, `number`]), + strerror: libzip.cwrap(`zip_error_strerror`, `string`, [`number`]) + }, + name: { + locate: libzip.cwrap(`zip_name_locate`, `number`, [`number`, `string`, `number`]) + }, + source: { + fromUnattachedBuffer: libzip.cwrap(`zip_source_buffer_create`, `number`, [`number`, `number`, `number`, `number`]), + fromBuffer: libzip.cwrap(`zip_source_buffer`, `number`, [`number`, `number`, ...number64, `number`]), + free: libzip.cwrap(`zip_source_free`, null, [`number`]), + keep: libzip.cwrap(`zip_source_keep`, null, [`number`]), + open: libzip.cwrap(`zip_source_open`, `number`, [`number`]), + close: libzip.cwrap(`zip_source_close`, `number`, [`number`]), + seek: libzip.cwrap(`zip_source_seek`, `number`, [`number`, ...number64, `number`]), + tell: libzip.cwrap(`zip_source_tell`, `number`, [`number`]), + read: libzip.cwrap(`zip_source_read`, `number`, [`number`, `number`, `number`]), + error: libzip.cwrap(`zip_source_error`, `number`, [`number`]), + setMtime: libzip.cwrap(`zip_source_set_mtime`, `number`, [`number`, `number`]) + }, + struct: { + stat: libzip.cwrap(`zipstruct_stat`, `number`, []), + statS: libzip.cwrap(`zipstruct_statS`, `number`, []), + statName: libzip.cwrap(`zipstruct_stat_name`, `string`, [`number`]), + statIndex: libzip.cwrap(`zipstruct_stat_index`, `number`, [`number`]), + statSize: libzip.cwrap(`zipstruct_stat_size`, `number`, [`number`]), + statCompSize: libzip.cwrap(`zipstruct_stat_comp_size`, `number`, [`number`]), + statCompMethod: libzip.cwrap(`zipstruct_stat_comp_method`, `number`, [`number`]), + statMtime: libzip.cwrap(`zipstruct_stat_mtime`, `number`, [`number`]), + error: libzip.cwrap(`zipstruct_error`, `number`, []), + errorS: libzip.cwrap(`zipstruct_errorS`, `number`, []), + errorCodeZip: libzip.cwrap(`zipstruct_error_code_zip`, `number`, [`number`]) + } +}); +// CONCATENATED MODULE: ../yarnpkg-libzip/sources/sync.ts + +let mod = null; +function getLibzipSync() { + if (mod === null) mod = makeInterface(__webpack_require__(368)); + return mod; +} +async function getLibzipPromise() { + return getLibzipSync(); +} +// EXTERNAL MODULE: external "module" +var external_module_ = __webpack_require__(282); +var external_module_default = /*#__PURE__*/__webpack_require__.n(external_module_); + +// CONCATENATED MODULE: external "string_decoder" +const external_string_decoder_namespaceObject = require("string_decoder");; +var external_string_decoder_default = /*#__PURE__*/__webpack_require__.n(external_string_decoder_namespaceObject); + +// CONCATENATED MODULE: ../yarnpkg-fslib/sources/index.ts + + + + + + + + + + + + + + + + + + + + + + + + +function getTempName(prefix) { + const tmpdir = npath.toPortablePath(external_os_default().tmpdir()); + const hash = Math.ceil(Math.random() * 0x100000000).toString(16).padStart(8, `0`); + return ppath.join(tmpdir, `${prefix}${hash}`); +} + +function patchFs(patchedFs, fakeFs) { + const SYNC_IMPLEMENTATIONS = new Set([`accessSync`, `appendFileSync`, `createReadStream`, `chmodSync`, `chownSync`, `closeSync`, `copyFileSync`, `linkSync`, `lstatSync`, `lutimesSync`, `mkdirSync`, `openSync`, `opendirSync`, `readSync`, `readlinkSync`, `readFileSync`, `readdirSync`, `readlinkSync`, `realpathSync`, `renameSync`, `rmdirSync`, `statSync`, `symlinkSync`, `truncateSync`, `unlinkSync`, `unwatchFile`, `utimesSync`, `watch`, `watchFile`, `writeFileSync`, `writeSync`]); + const ASYNC_IMPLEMENTATIONS = new Set([`accessPromise`, `appendFilePromise`, `chmodPromise`, `chownPromise`, `closePromise`, `copyFilePromise`, `linkPromise`, `lstatPromise`, `lutimesPromise`, `mkdirPromise`, `openPromise`, `opendirPromise`, `readdirPromise`, `realpathPromise`, `readFilePromise`, `readdirPromise`, `readlinkPromise`, `renamePromise`, `rmdirPromise`, `statPromise`, `symlinkPromise`, `truncatePromise`, `unlinkPromise`, `utimesPromise`, `writeFilePromise`, `writeSync`]); + const FILEHANDLE_IMPLEMENTATIONS = new Set([`appendFilePromise`, `chmodPromise`, `chownPromise`, `closePromise`, `readPromise`, `readFilePromise`, `statPromise`, `truncatePromise`, `utimesPromise`, `writePromise`, `writeFilePromise`]); + + const setupFn = (target, name, replacement) => { + const orig = target[name]; + target[name] = replacement; // Preserve any util.promisify implementations + + if (typeof (orig === null || orig === void 0 ? void 0 : orig[external_util_namespaceObject.promisify.custom]) !== `undefined`) { + replacement[external_util_namespaceObject.promisify.custom] = orig[external_util_namespaceObject.promisify.custom]; + } + }; + /** Callback implementations */ + + + { + setupFn(patchedFs, `exists`, (p, ...args) => { + const hasCallback = typeof args[args.length - 1] === `function`; + const callback = hasCallback ? args.pop() : () => {}; + process.nextTick(() => { + fakeFs.existsPromise(p).then(exists => { + callback(exists); + }, () => { + callback(false); + }); + }); + }); + setupFn(patchedFs, `read`, (p, buffer, ...args) => { + const hasCallback = typeof args[args.length - 1] === `function`; + const callback = hasCallback ? args.pop() : () => {}; + process.nextTick(() => { + fakeFs.readPromise(p, buffer, ...args).then(bytesRead => { + callback(null, bytesRead, buffer); + }, error => { + callback(error); + }); + }); + }); + + for (const fnName of ASYNC_IMPLEMENTATIONS) { + const origName = fnName.replace(/Promise$/, ``); + if (typeof patchedFs[origName] === `undefined`) continue; + const fakeImpl = fakeFs[fnName]; + if (typeof fakeImpl === `undefined`) continue; + + const wrapper = (...args) => { + const hasCallback = typeof args[args.length - 1] === `function`; + const callback = hasCallback ? args.pop() : () => {}; + process.nextTick(() => { + fakeImpl.apply(fakeFs, args).then(result => { + callback(null, result); + }, error => { + callback(error); + }); + }); + }; + + setupFn(patchedFs, origName, wrapper); + } + + patchedFs.realpath.native = patchedFs.realpath; + } + /** Sync implementations */ + + { + setupFn(patchedFs, `existsSync`, p => { + try { + return fakeFs.existsSync(p); + } catch (error) { + return false; + } + }); + + for (const fnName of SYNC_IMPLEMENTATIONS) { + const origName = fnName; + if (typeof patchedFs[origName] === `undefined`) continue; + const fakeImpl = fakeFs[fnName]; + if (typeof fakeImpl === `undefined`) continue; + setupFn(patchedFs, origName, fakeImpl.bind(fakeFs)); + } + + patchedFs.realpathSync.native = patchedFs.realpathSync; + } + /** Promise implementations */ + + { + // `fs.promises` is a getter that returns a reference to require(`fs/promises`), + // so we can just patch `fs.promises` and both will be updated + const origEmitWarning = process.emitWarning; + + process.emitWarning = () => {}; + + let patchedFsPromises; + + try { + patchedFsPromises = patchedFs.promises; + } finally { + process.emitWarning = origEmitWarning; + } + + if (typeof patchedFsPromises !== `undefined`) { + // `fs.promises.exists` doesn't exist + for (const fnName of ASYNC_IMPLEMENTATIONS) { + const origName = fnName.replace(/Promise$/, ``); + if (typeof patchedFsPromises[origName] === `undefined`) continue; + const fakeImpl = fakeFs[fnName]; + if (typeof fakeImpl === `undefined`) continue; // Open is a bit particular with fs.promises: it returns a file handle + // instance instead of the traditional file descriptor number + + if (fnName === `open`) continue; + setupFn(patchedFsPromises, origName, fakeImpl.bind(fakeFs)); + } + + class FileHandle { + constructor(fd) { + this.fd = fd; + } + + } + + for (const fnName of FILEHANDLE_IMPLEMENTATIONS) { + const origName = fnName.replace(/Promise$/, ``); + const fakeImpl = fakeFs[fnName]; + if (typeof fakeImpl === `undefined`) continue; + setupFn(FileHandle.prototype, origName, function (...args) { + return fakeImpl.call(fakeFs, this.fd, ...args); + }); + } + + setupFn(patchedFsPromises, `open`, async (...args) => { + // @ts-expect-error + const fd = await fakeFs.openPromise(...args); + return new FileHandle(fd); + }); // `fs.promises.realpath` doesn't have a `native` property + } + } + /** util.promisify implementations */ + + { + // Override the promisified version of `fs.read` to return an object as per + // https://github.com/nodejs/node/blob/dc79f3f37caf6f25b8efee4623bec31e2c20f595/lib/fs.js#L559-L560 + // and + // https://github.com/nodejs/node/blob/ba684805b6c0eded76e5cd89ee00328ac7a59365/lib/internal/util.js#L293 + // @ts-expect-error + patchedFs.read[external_util_namespaceObject.promisify.custom] = async (p, buffer, ...args) => { + const res = fakeFs.readPromise(p, buffer, ...args); + return { + bytesRead: await res, + buffer + }; + }; + } +} +function extendFs(realFs, fakeFs) { + const patchedFs = Object.create(realFs); + patchFs(patchedFs, fakeFs); + return patchedFs; +} +const tmpdirs = new Set(); +let cleanExitRegistered = false; + +function registerCleanExit() { + if (cleanExitRegistered) return; + cleanExitRegistered = true; + process.once(`exit`, () => { + xfs.rmtempSync(); + }); +} + +const xfs = Object.assign(new NodeFS(), { + detachTemp(p) { + tmpdirs.delete(p); + }, + + mktempSync(cb) { + registerCleanExit(); + + while (true) { + const p = getTempName(`xfs-`); + + try { + this.mkdirSync(p); + } catch (error) { + if (error.code === `EEXIST`) { + continue; + } else { + throw error; + } + } + + const realP = this.realpathSync(p); + tmpdirs.add(realP); + + if (typeof cb !== `undefined`) { + try { + return cb(realP); + } finally { + if (tmpdirs.has(realP)) { + tmpdirs.delete(realP); + + try { + this.removeSync(realP); + } catch (_a) {// Too bad if there's an error + } + } + } + } else { + return p; + } + } + }, + + async mktempPromise(cb) { + registerCleanExit(); + + while (true) { + const p = getTempName(`xfs-`); + + try { + await this.mkdirPromise(p); + } catch (error) { + if (error.code === `EEXIST`) { + continue; + } else { + throw error; + } + } + + const realP = await this.realpathPromise(p); + tmpdirs.add(realP); + + if (typeof cb !== `undefined`) { + try { + return await cb(realP); + } finally { + if (tmpdirs.has(realP)) { + tmpdirs.delete(realP); + + try { + await this.removePromise(realP); + } catch (_a) {// Too bad if there's an error + } + } + } + } else { + return realP; + } + } + }, + + async rmtempPromise() { + await Promise.all(Array.from(tmpdirs.values()).map(async p => { + try { + await xfs.removePromise(p, { + maxRetries: 0 + }); + tmpdirs.delete(p); + } catch (_a) {// Too bad if there's an error + } + })); + }, + + rmtempSync() { + for (const p of tmpdirs) { + try { + xfs.removeSync(p); + tmpdirs.delete(p); + } catch (_a) {// Too bad if there's an error + } + } + } + +}); +// CONCATENATED MODULE: ../yarnpkg-fslib/sources/PosixFS.ts + + +class PosixFS extends ProxiedFS { + constructor(baseFs) { + super(npath); + this.baseFs = baseFs; + } + + mapFromBase(path) { + return npath.fromPortablePath(path); + } + + mapToBase(path) { + return npath.toPortablePath(path); + } + +} +// CONCATENATED MODULE: external "url" +const external_url_namespaceObject = require("url");; +// CONCATENATED MODULE: ./sources/loader/internalTools.ts + +var ErrorCode; + +(function (ErrorCode) { + ErrorCode["API_ERROR"] = "API_ERROR"; + ErrorCode["BLACKLISTED"] = "BLACKLISTED"; + ErrorCode["BUILTIN_NODE_RESOLUTION_FAILED"] = "BUILTIN_NODE_RESOLUTION_FAILED"; + ErrorCode["MISSING_DEPENDENCY"] = "MISSING_DEPENDENCY"; + ErrorCode["MISSING_PEER_DEPENDENCY"] = "MISSING_PEER_DEPENDENCY"; + ErrorCode["QUALIFIED_PATH_RESOLUTION_FAILED"] = "QUALIFIED_PATH_RESOLUTION_FAILED"; + ErrorCode["INTERNAL"] = "INTERNAL"; + ErrorCode["UNDECLARED_DEPENDENCY"] = "UNDECLARED_DEPENDENCY"; + ErrorCode["UNSUPPORTED"] = "UNSUPPORTED"; +})(ErrorCode || (ErrorCode = {})); // Some errors are exposed as MODULE_NOT_FOUND for compatibility with packages +// that expect this umbrella error when the resolution fails + + +const MODULE_NOT_FOUND_ERRORS = new Set([ErrorCode.BLACKLISTED, ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, ErrorCode.MISSING_DEPENDENCY, ErrorCode.MISSING_PEER_DEPENDENCY, ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, ErrorCode.UNDECLARED_DEPENDENCY]); +/** + * Simple helper function that assign an error code to an error, so that it can more easily be caught and used + * by third-parties. + */ + +function internalTools_makeError(pnpCode, message, data = {}) { + const code = MODULE_NOT_FOUND_ERRORS.has(pnpCode) ? `MODULE_NOT_FOUND` : pnpCode; + const propertySpec = { + configurable: true, + writable: true, + enumerable: false + }; + return Object.defineProperties(new Error(message), { + code: { ...propertySpec, + value: code + }, + pnpCode: { ...propertySpec, + value: pnpCode + }, + data: { ...propertySpec, + value: data + } + }); +} +/** + * Returns the module that should be used to resolve require calls. It's usually the direct parent, except if we're + * inside an eval expression. + */ + +function getIssuerModule(parent) { + let issuer = parent; + + while (issuer && (issuer.id === `[eval]` || issuer.id === `` || !issuer.filename)) issuer = issuer.parent; + + return issuer || null; +} +function getPathForDisplay(p) { + return npath.normalize(npath.fromPortablePath(p)); +} +// CONCATENATED MODULE: ./sources/loader/applyPatch.ts + + + + + +function applyPatch(pnpapi, opts) { + // @ts-expect-error + const builtinModules = new Set(external_module_.Module.builtinModules || Object.keys(process.binding(`natives`))); + /** + * The cache that will be used for all accesses occuring outside of a PnP context. + */ + + const defaultCache = {}; + /** + * Used to disable the resolution hooks (for when we want to fallback to the previous resolution - we then need + * a way to "reset" the environment temporarily) + */ + + let enableNativeHooks = true; // @ts-expect-error + + process.versions.pnp = String(pnpapi.VERSIONS.std); + + const moduleExports = __webpack_require__(282); + + moduleExports.findPnpApi = lookupSource => { + const lookupPath = lookupSource instanceof external_url_namespaceObject.URL ? (0,external_url_namespaceObject.fileURLToPath)(lookupSource) : lookupSource; + const apiPath = opts.manager.findApiPathFor(lookupPath); + if (apiPath === null) return null; + const apiEntry = opts.manager.getApiEntry(apiPath, true); + return apiEntry.instance; + }; + + function getRequireStack(parent) { + const requireStack = []; + + for (let cursor = parent; cursor; cursor = cursor.parent) requireStack.push(cursor.filename || cursor.id); + + return requireStack; + } // A small note: we don't replace the cache here (and instead use the native one). This is an effort to not + // break code similar to "delete require.cache[require.resolve(FOO)]", where FOO is a package located outside + // of the Yarn dependency tree. In this case, we defer the load to the native loader. If we were to replace the + // cache by our own, the native loader would populate its own cache, which wouldn't be exposed anymore, so the + // delete call would be broken. + + + const originalModuleLoad = external_module_.Module._load; + + external_module_.Module._load = function (request, parent, isMain) { + if (!enableNativeHooks) return originalModuleLoad.call(external_module_.Module, request, parent, isMain); // Builtins are managed by the regular Node loader + + if (builtinModules.has(request)) { + try { + enableNativeHooks = false; + return originalModuleLoad.call(external_module_.Module, request, parent, isMain); + } finally { + enableNativeHooks = true; + } + } + + const parentApiPath = opts.manager.getApiPathFromParent(parent); + const parentApi = parentApiPath !== null ? opts.manager.getApiEntry(parentApiPath, true).instance : null; // Requests that aren't covered by the PnP runtime goes through the + // parent `_load` implementation. This is required for VSCode, for example, + // which override `_load` to provide additional builtins to its extensions. + + if (parentApi === null) return originalModuleLoad(request, parent, isMain); // The 'pnpapi' name is reserved to return the PnP api currently in use + // by the program + + if (request === `pnpapi`) return parentApi; // Request `Module._resolveFilename` (ie. `resolveRequest`) to tell us + // which file we should load + + const modulePath = external_module_.Module._resolveFilename(request, parent, isMain); // We check whether the module is owned by the dependency tree of the + // module that required it. If it isn't, then we need to create a new + // store and possibly load its sandboxed PnP runtime. + + + const isOwnedByRuntime = parentApi !== null ? parentApi.findPackageLocator(modulePath) !== null : false; + const moduleApiPath = isOwnedByRuntime ? parentApiPath : opts.manager.findApiPathFor(npath.dirname(modulePath)); + const entry = moduleApiPath !== null ? opts.manager.getApiEntry(moduleApiPath) : { + instance: null, + cache: defaultCache + }; // Check if the module has already been created for the given file + + const cacheEntry = entry.cache[modulePath]; + if (cacheEntry) return cacheEntry.exports; // Create a new module and store it into the cache + // @ts-expect-error + + const module = new external_module_.Module(modulePath, parent); // @ts-expect-error + + module.pnpApiPath = moduleApiPath; + entry.cache[modulePath] = module; // The main module is exposed as global variable + + if (isMain) { + process.mainModule = module; + module.id = `.`; + } // Try to load the module, and remove it from the cache if it fails + + + let hasThrown = true; + + try { + // @ts-expect-error + module.load(modulePath); + hasThrown = false; + } finally { + if (hasThrown) { + delete external_module_.Module._cache[modulePath]; + } + } + + return module.exports; + }; + + function getIssuerSpecsFromPaths(paths) { + return paths.map(path => ({ + apiPath: opts.manager.findApiPathFor(path), + path, + module: null + })); + } + + function getIssuerSpecsFromModule(module) { + const issuer = getIssuerModule(module); + const issuerPath = issuer !== null ? npath.dirname(issuer.filename) : process.cwd(); + return [{ + apiPath: opts.manager.getApiPathFromParent(issuer), + path: issuerPath, + module + }]; + } + + function makeFakeParent(path) { + const fakeParent = new external_module_.Module(``); + const fakeFilePath = npath.join(path, `[file]`); + fakeParent.paths = external_module_.Module._nodeModulePaths(fakeFilePath); + return fakeParent; + } // Splits a require request into its components, or return null if the request is a file path + + + const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:@[^/]+\/)?[^/]+)\/*(.*|)$/; + const originalModuleResolveFilename = external_module_.Module._resolveFilename; + + external_module_.Module._resolveFilename = function (request, parent, isMain, options) { + if (builtinModules.has(request)) return request; + if (!enableNativeHooks) return originalModuleResolveFilename.call(external_module_.Module, request, parent, isMain, options); + + if (options && options.plugnplay === false) { + const { + plugnplay, + ...rest + } = options; // Workaround a bug present in some version of Node (now fixed) + // https://github.com/nodejs/node/pull/28078 + + const forwardedOptions = Object.keys(rest).length > 0 ? rest : undefined; + + try { + enableNativeHooks = false; + return originalModuleResolveFilename.call(external_module_.Module, request, parent, isMain, forwardedOptions); + } finally { + enableNativeHooks = true; + } + } // We check that all the options present here are supported; better + // to fail fast than to introduce subtle bugs in the runtime. + + + if (options) { + const optionNames = new Set(Object.keys(options)); + optionNames.delete(`paths`); + optionNames.delete(`plugnplay`); + + if (optionNames.size > 0) { + throw internalTools_makeError(ErrorCode.UNSUPPORTED, `Some options passed to require() aren't supported by PnP yet (${Array.from(optionNames).join(`, `)})`); + } + } + + const issuerSpecs = options && options.paths ? getIssuerSpecsFromPaths(options.paths) : getIssuerSpecsFromModule(parent); + + if (request.match(pathRegExp) === null) { + const parentDirectory = (parent === null || parent === void 0 ? void 0 : parent.filename) != null ? npath.dirname(parent.filename) : null; + const absoluteRequest = npath.isAbsolute(request) ? request : parentDirectory !== null ? npath.resolve(parentDirectory, request) : null; + + if (absoluteRequest !== null) { + const apiPath = parentDirectory === npath.dirname(absoluteRequest) && (parent === null || parent === void 0 ? void 0 : parent.pnpApiPath) ? parent.pnpApiPath : opts.manager.findApiPathFor(absoluteRequest); + + if (apiPath !== null) { + issuerSpecs.unshift({ + apiPath, + path: parentDirectory, + module: null + }); + } + } + } + + let firstError; + + for (const { + apiPath, + path, + module + } of issuerSpecs) { + let resolution; + const issuerApi = apiPath !== null ? opts.manager.getApiEntry(apiPath, true).instance : null; + + try { + if (issuerApi !== null) { + resolution = issuerApi.resolveRequest(request, path !== null ? `${path}/` : null); + } else { + if (path === null) throw new Error(`Assertion failed: Expected the path to be set`); + resolution = originalModuleResolveFilename.call(external_module_.Module, request, module || makeFakeParent(path), isMain); + } + } catch (error) { + firstError = firstError || error; + continue; + } + + if (resolution !== null) { + return resolution; + } + } + + const requireStack = getRequireStack(parent); + Object.defineProperty(firstError, `requireStack`, { + configurable: true, + writable: true, + enumerable: false, + value: requireStack + }); + if (requireStack.length > 0) firstError.message += `\nRequire stack:\n- ${requireStack.join(`\n- `)}`; + throw firstError; + }; + + const originalFindPath = external_module_.Module._findPath; + + external_module_.Module._findPath = function (request, paths, isMain) { + if (request === `pnpapi`) return false; // Node sometimes call this function with an absolute path and a `null` set + // of paths. This would cause the resolution to fail. To avoid that, we + // fallback on the regular resolution. We only do this when `isMain` is + // true because the Node default resolution doesn't handle well in-zip + // paths, even absolute, so we try to use it as little as possible. + + if (!enableNativeHooks || isMain && npath.isAbsolute(request)) return originalFindPath.call(external_module_.Module, request, paths, isMain); + + for (const path of paths || []) { + let resolution; + + try { + const pnpApiPath = opts.manager.findApiPathFor(path); + + if (pnpApiPath !== null) { + const api = opts.manager.getApiEntry(pnpApiPath, true).instance; + resolution = api.resolveRequest(request, path) || false; + } else { + resolution = originalFindPath.call(external_module_.Module, request, [path], isMain); + } + } catch (error) { + continue; + } + + if (resolution) { + return resolution; + } + } + + return false; + }; + + patchFs((external_fs_default()), new PosixFS(opts.fakeFs)); +} +// CONCATENATED MODULE: ./sources/loader/hydrateRuntimeState.ts + +function hydrateRuntimeState(data, { + basePath +}) { + const portablePath = npath.toPortablePath(basePath); + const absolutePortablePath = ppath.resolve(portablePath); + const ignorePattern = data.ignorePatternData !== null ? new RegExp(data.ignorePatternData) : null; + const packageRegistry = new Map(data.packageRegistryData.map(([packageName, packageStoreData]) => { + return [packageName, new Map(packageStoreData.map(([packageReference, packageInformationData]) => { + return [packageReference, { + // We use ppath.join instead of ppath.resolve because: + // 1) packageInformationData.packageLocation is a relative path when part of the SerializedState + // 2) ppath.join preserves trailing slashes + packageLocation: ppath.join(absolutePortablePath, packageInformationData.packageLocation), + packageDependencies: new Map(packageInformationData.packageDependencies), + packagePeers: new Set(packageInformationData.packagePeers), + linkType: packageInformationData.linkType, + discardFromLookup: packageInformationData.discardFromLookup || false + }]; + }))]; + })); + const packageLocatorsByLocations = new Map(); + const packageLocationLengths = new Set(); + + for (const [packageName, storeData] of data.packageRegistryData) { + for (const [packageReference, packageInformationData] of storeData) { + if (packageName === null !== (packageReference === null)) throw new Error(`Assertion failed: The name and reference should be null, or neither should`); + if (packageInformationData.discardFromLookup) continue; // @ts-expect-error: TypeScript isn't smart enough to understand the type assertion + + const packageLocator = { + name: packageName, + reference: packageReference + }; + packageLocatorsByLocations.set(packageInformationData.packageLocation, packageLocator); + packageLocationLengths.add(packageInformationData.packageLocation.length); + } + } + + for (const location of data.locationBlacklistData) packageLocatorsByLocations.set(location, null); + + const fallbackExclusionList = new Map(data.fallbackExclusionList.map(([packageName, packageReferences]) => { + return [packageName, new Set(packageReferences)]; + })); + const fallbackPool = new Map(data.fallbackPool); + const dependencyTreeRoots = data.dependencyTreeRoots; + const enableTopLevelFallback = data.enableTopLevelFallback; + return { + basePath: portablePath, + dependencyTreeRoots, + enableTopLevelFallback, + fallbackExclusionList, + fallbackPool, + ignorePattern, + packageLocationLengths: [...packageLocationLengths].sort((a, b) => b - a), + packageLocatorsByLocations, + packageRegistry + }; +} +// CONCATENATED MODULE: ./sources/loader/makeApi.ts + + + + +function makeApi(runtimeState, opts) { + const alwaysWarnOnFallback = Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK) > 0; + const debugLevel = Number(process.env.PNP_DEBUG_LEVEL); // @ts-expect-error + + const builtinModules = new Set(external_module_.Module.builtinModules || Object.keys(process.binding(`natives`))); // Splits a require request into its components, or return null if the request is a file path + + const pathRegExp = /^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:@[^/]+\/)?[^/]+)\/*(.*|)$/; // Matches if the path starts with a valid path qualifier (./, ../, /) + // eslint-disable-next-line no-unused-vars + + const isStrictRegExp = /^(\/|\.{1,2}(\/|$))/; // Matches if the path must point to a directory (ie ends with /) + + const isDirRegExp = /\/$/; // We only instantiate one of those so that we can use strict-equal comparisons + + const topLevelLocator = { + name: null, + reference: null + }; // Used for compatibility purposes - cf setupCompatibilityLayer + + const fallbackLocators = []; // To avoid emitting the same warning multiple times + + const emittedWarnings = new Set(); + if (runtimeState.enableTopLevelFallback === true) fallbackLocators.push(topLevelLocator); + + if (opts.compatibilityMode !== false) { + // ESLint currently doesn't have any portable way for shared configs to + // specify their own plugins that should be used (cf issue #10125). This + // will likely get fixed at some point but it'll take time, so in the + // meantime we'll just add additional fallback entries for common shared + // configs. + // Similarly, Gatsby generates files within the `public` folder located + // within the project, but doesn't pre-resolve the `require` calls to use + // its own dependencies. Meaning that when PnP see a file from the `public` + // folder making a require, it thinks that your project forgot to list one + // of your dependencies. + for (const name of [`react-scripts`, `gatsby`]) { + const packageStore = runtimeState.packageRegistry.get(name); + + if (packageStore) { + for (const reference of packageStore.keys()) { + if (reference === null) { + throw new Error(`Assertion failed: This reference shouldn't be null`); + } else { + fallbackLocators.push({ + name, + reference + }); + } + } + } + } + } + /** + * The setup code will be injected here. The tables listed below are guaranteed to be filled after the call to + * the $$DYNAMICALLY_GENERATED_CODE function. + */ + + + const { + ignorePattern, + packageRegistry, + packageLocatorsByLocations, + packageLocationLengths + } = runtimeState; + /** + * Allows to print useful logs just be setting a value in the environment + */ + + function makeLogEntry(name, args) { + return { + fn: name, + args, + error: null, + result: null + }; + } + + function maybeLog(name, fn) { + if (opts.allowDebug === false) return fn; + + if (Number.isFinite(debugLevel)) { + if (debugLevel >= 2) { + return (...args) => { + const logEntry = makeLogEntry(name, args); + + try { + return logEntry.result = fn(...args); + } catch (error) { + throw logEntry.error = error; + } finally { + console.trace(logEntry); + } + }; + } else if (debugLevel >= 1) { + return (...args) => { + try { + return fn(...args); + } catch (error) { + const logEntry = makeLogEntry(name, args); + logEntry.error = error; + console.trace(logEntry); + throw error; + } + }; + } + } + + return fn; + } + /** + * Returns information about a package in a safe way (will throw if they cannot be retrieved) + */ + + + function getPackageInformationSafe(packageLocator) { + const packageInformation = getPackageInformation(packageLocator); + + if (!packageInformation) { + throw internalTools_makeError(ErrorCode.INTERNAL, `Couldn't find a matching entry in the dependency tree for the specified parent (this is probably an internal error)`); + } + + return packageInformation; + } + /** + * Returns whether the specified locator is a dependency tree root (in which case it's part of the project) or not + */ + + + function isDependencyTreeRoot(packageLocator) { + if (packageLocator.name === null) return true; + + for (const dependencyTreeRoot of runtimeState.dependencyTreeRoots) if (dependencyTreeRoot.name === packageLocator.name && dependencyTreeRoot.reference === packageLocator.reference) return true; + + return false; + } + /** + * Implements the node resolution for folder access and extension selection + */ + + + function applyNodeExtensionResolution(unqualifiedPath, candidates, { + extensions + }) { + let stat; + + try { + candidates.push(unqualifiedPath); + stat = opts.fakeFs.statSync(unqualifiedPath); + } catch (error) {} // If the file exists and is a file, we can stop right there + + + if (stat && !stat.isDirectory()) return opts.fakeFs.realpathSync(unqualifiedPath); // If the file is a directory, we must check if it contains a package.json with a "main" entry + + if (stat && stat.isDirectory()) { + let pkgJson; + + try { + pkgJson = JSON.parse(opts.fakeFs.readFileSync(ppath.join(unqualifiedPath, `package.json`), `utf8`)); + } catch (error) {} + + let nextUnqualifiedPath; + if (pkgJson && pkgJson.main) nextUnqualifiedPath = ppath.resolve(unqualifiedPath, pkgJson.main); // If the "main" field changed the path, we start again from this new location + + if (nextUnqualifiedPath && nextUnqualifiedPath !== unqualifiedPath) { + const resolution = applyNodeExtensionResolution(nextUnqualifiedPath, candidates, { + extensions + }); + + if (resolution !== null) { + return resolution; + } + } + } // Otherwise we check if we find a file that match one of the supported extensions + + + for (let i = 0, length = extensions.length; i < length; i++) { + const candidateFile = `${unqualifiedPath}${extensions[i]}`; + candidates.push(candidateFile); + + if (opts.fakeFs.existsSync(candidateFile)) { + return candidateFile; + } + } // Otherwise, we check if the path is a folder - in such a case, we try to use its index + + + if (stat && stat.isDirectory()) { + for (let i = 0, length = extensions.length; i < length; i++) { + const candidateFile = ppath.format({ + dir: unqualifiedPath, + name: `index`, + ext: extensions[i] + }); + candidates.push(candidateFile); + + if (opts.fakeFs.existsSync(candidateFile)) { + return candidateFile; + } + } + } // Otherwise there's nothing else we can do :( + + + return null; + } + /** + * This function creates fake modules that can be used with the _resolveFilename function. + * Ideally it would be nice to be able to avoid this, since it causes useless allocations + * and cannot be cached efficiently (we recompute the nodeModulePaths every time). + * + * Fortunately, this should only affect the fallback, and there hopefully shouldn't have a + * lot of them. + */ + + + function makeFakeModule(path) { + // @ts-expect-error + const fakeModule = new external_module_.Module(path, null); + fakeModule.filename = path; + fakeModule.paths = external_module_.Module._nodeModulePaths(path); + return fakeModule; + } + /** + * Normalize path to posix format. + */ + + + function normalizePath(p) { + return npath.toPortablePath(p); + } + /** + * Forward the resolution to the next resolver (usually the native one) + */ + + + function callNativeResolution(request, issuer) { + if (issuer.endsWith(`/`)) issuer = ppath.join(issuer, `internal.js`); // Since we would need to create a fake module anyway (to call _resolveLookupPath that + // would give us the paths to give to _resolveFilename), we can as well not use + // the {paths} option at all, since it internally makes _resolveFilename create another + // fake module anyway. + + return external_module_.Module._resolveFilename(npath.fromPortablePath(request), makeFakeModule(npath.fromPortablePath(issuer)), false, { + plugnplay: false + }); + } + /** + * + */ + + + function isPathIgnored(path) { + if (ignorePattern === null) return false; + const subPath = ppath.contains(runtimeState.basePath, path); + if (subPath === null) return false; + + if (ignorePattern.test(subPath.replace(/\/$/, ``))) { + return true; + } else { + return false; + } + } + /** + * This key indicates which version of the standard is implemented by this resolver. The `std` key is the + * Plug'n'Play standard, and any other key are third-party extensions. Third-party extensions are not allowed + * to override the standard, and can only offer new methods. + * + * If a new version of the Plug'n'Play standard is released and some extensions conflict with newly added + * functions, they'll just have to fix the conflicts and bump their own version number. + */ + + + const VERSIONS = { + std: 3, + resolveVirtual: 1, + getAllLocators: 1 + }; + /** + * We export a special symbol for easy access to the top level locator. + */ + + const topLevel = topLevelLocator; + /** + * Gets the package information for a given locator. Returns null if they cannot be retrieved. + */ + + function getPackageInformation({ + name, + reference + }) { + const packageInformationStore = packageRegistry.get(name); + if (!packageInformationStore) return null; + const packageInformation = packageInformationStore.get(reference); + if (!packageInformation) return null; + return packageInformation; + } + /** + * Find all packages that depend on the specified one. + * + * Note: This is a private function; we expect consumers to implement it + * themselves. We keep it that way because this implementation isn't + * optimized at all, since we only need it when printing errors. + */ + + + function findPackageDependents({ + name, + reference + }) { + const dependents = []; + + for (const [dependentName, packageInformationStore] of packageRegistry) { + if (dependentName === null) continue; + + for (const [dependentReference, packageInformation] of packageInformationStore) { + if (dependentReference === null) continue; + const dependencyReference = packageInformation.packageDependencies.get(name); + if (dependencyReference !== reference) continue; // Don't forget that all packages depend on themselves + + if (dependentName === name && dependentReference === reference) continue; + dependents.push({ + name: dependentName, + reference: dependentReference + }); + } + } + + return dependents; + } + /** + * Find all packages that broke the peer dependency on X, starting from Y. + * + * Note: This is a private function; we expect consumers to implement it + * themselves. We keep it that way because this implementation isn't + * optimized at all, since we only need it when printing errors. + */ + + + function findBrokenPeerDependencies(dependency, initialPackage) { + const brokenPackages = new Map(); + const alreadyVisited = new Set(); + + const traversal = currentPackage => { + const identifier = JSON.stringify(currentPackage.name); + if (alreadyVisited.has(identifier)) return; + alreadyVisited.add(identifier); + const dependents = findPackageDependents(currentPackage); + + for (const dependent of dependents) { + const dependentInformation = getPackageInformationSafe(dependent); + + if (dependentInformation.packagePeers.has(dependency)) { + traversal(dependent); + } else { + let brokenSet = brokenPackages.get(dependent.name); + if (typeof brokenSet === `undefined`) brokenPackages.set(dependent.name, brokenSet = new Set()); + brokenSet.add(dependent.reference); + } + } + }; + + traversal(initialPackage); + const brokenList = []; + + for (const name of [...brokenPackages.keys()].sort()) for (const reference of [...brokenPackages.get(name)].sort()) brokenList.push({ + name, + reference + }); + + return brokenList; + } + /** + * Finds the package locator that owns the specified path. If none is found, returns null instead. + */ + + + function findPackageLocator(location) { + if (isPathIgnored(location)) return null; + let relativeLocation = normalizePath(ppath.relative(runtimeState.basePath, location)); + if (!relativeLocation.match(isStrictRegExp)) relativeLocation = `./${relativeLocation}`; + if (location.match(isDirRegExp) && !relativeLocation.endsWith(`/`)) relativeLocation = `${relativeLocation}/`; + let from = 0; // If someone wants to use a binary search to go from O(n) to O(log n), be my guest + + while (from < packageLocationLengths.length && packageLocationLengths[from] > relativeLocation.length) from += 1; + + for (let t = from; t < packageLocationLengths.length; ++t) { + const locator = packageLocatorsByLocations.get(relativeLocation.substr(0, packageLocationLengths[t])); + if (typeof locator === `undefined`) continue; // Ensures that the returned locator isn't a blacklisted one. + // + // Blacklisted packages are packages that cannot be used because their dependencies cannot be deduced. This only + // happens with peer dependencies, which effectively have different sets of dependencies depending on their + // parents. + // + // In order to deambiguate those different sets of dependencies, the Yarn implementation of PnP will generate a + // symlink for each combination of // it will find, and will + // blacklist the target of those symlinks. By doing this, we ensure that files loaded through a specific path + // will always have the same set of dependencies, provided the symlinks are correctly preserved. + // + // Unfortunately, some tools do not preserve them, and when it happens PnP isn't able anymore to deduce the set of + // dependencies based on the path of the file that makes the require calls. But since we've blacklisted those + // paths, we're able to print a more helpful error message that points out that a third-party package is doing + // something incompatible! + + if (locator === null) { + const locationForDisplay = getPathForDisplay(location); + throw internalTools_makeError(ErrorCode.BLACKLISTED, `A forbidden path has been used in the package resolution process - this is usually caused by one of your tools calling 'fs.realpath' on the return value of 'require.resolve'. Since we need to use symlinks to simultaneously provide valid filesystem paths and disambiguate peer dependencies, they must be passed untransformed to 'require'.\n\nForbidden path: ${locationForDisplay}`, { + location: locationForDisplay + }); + } + + return locator; + } + + return null; + } + /** + * Transforms a request (what's typically passed as argument to the require function) into an unqualified path. + * This path is called "unqualified" because it only changes the package name to the package location on the disk, + * which means that the end result still cannot be directly accessed (for example, it doesn't try to resolve the + * file extension, or to resolve directories to their "index.js" content). Use the "resolveUnqualified" function + * to convert them to fully-qualified paths, or just use "resolveRequest" that do both operations in one go. + * + * Note that it is extremely important that the `issuer` path ends with a forward slash if the issuer is to be + * treated as a folder (ie. "/tmp/foo/" rather than "/tmp/foo" if "foo" is a directory). Otherwise relative + * imports won't be computed correctly (they'll get resolved relative to "/tmp/" instead of "/tmp/foo/"). + */ + + + function resolveToUnqualified(request, issuer, { + considerBuiltins = true + } = {}) { + // The 'pnpapi' request is reserved and will always return the path to the PnP file, from everywhere + if (request === `pnpapi`) return npath.toPortablePath(opts.pnpapiResolution); // Bailout if the request is a native module + + if (considerBuiltins && builtinModules.has(request)) return null; + const requestForDisplay = getPathForDisplay(request); + const issuerForDisplay = issuer && getPathForDisplay(issuer); // We allow disabling the pnp resolution for some subpaths. + // This is because some projects, often legacy, contain multiple + // levels of dependencies (ie. a yarn.lock inside a subfolder of + // a yarn.lock). This is typically solved using workspaces, but + // not all of them have been converted already. + + if (issuer && isPathIgnored(issuer)) { + // Absolute paths that seem to belong to a PnP tree are still + // handled by our runtime even if the issuer isn't. This is + // because the native Node resolution uses a special version + // of the `stat` syscall which would otherwise bypass the + // filesystem layer we require to access the files. + if (!ppath.isAbsolute(request) || findPackageLocator(request) === null) { + const result = callNativeResolution(request, issuer); + + if (result === false) { + throw internalTools_makeError(ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer was explicitely ignored by the regexp)\n\nRequire request: "${requestForDisplay}"\nRequired by: ${issuerForDisplay}\n`, { + request: requestForDisplay, + issuer: issuerForDisplay + }); + } + + return npath.toPortablePath(result); + } + } + + let unqualifiedPath; // If the request is a relative or absolute path, we just return it normalized + + const dependencyNameMatch = request.match(pathRegExp); + + if (!dependencyNameMatch) { + if (ppath.isAbsolute(request)) { + unqualifiedPath = ppath.normalize(request); + } else { + if (!issuer) { + throw internalTools_makeError(ErrorCode.API_ERROR, `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, { + request: requestForDisplay, + issuer: issuerForDisplay + }); + } // We use ppath.join instead of ppath.resolve because: + // 1) The request is a relative path in this branch + // 2) ppath.join preserves trailing slashes + + + const absoluteIssuer = ppath.resolve(issuer); + + if (issuer.match(isDirRegExp)) { + unqualifiedPath = ppath.normalize(ppath.join(absoluteIssuer, request)); + } else { + unqualifiedPath = ppath.normalize(ppath.join(ppath.dirname(absoluteIssuer), request)); + } + } // No need to use the return value; we just want to check the blacklist status + + + findPackageLocator(unqualifiedPath); + } // Things are more hairy if it's a package require - we then need to figure out which package is needed, and in + // particular the exact version for the given location on the dependency tree + else { + if (!issuer) { + throw internalTools_makeError(ErrorCode.API_ERROR, `The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute`, { + request: requestForDisplay, + issuer: issuerForDisplay + }); + } + + const [, dependencyName, subPath] = dependencyNameMatch; + const issuerLocator = findPackageLocator(issuer); // If the issuer file doesn't seem to be owned by a package managed through pnp, then we resort to using the next + // resolution algorithm in the chain, usually the native Node resolution one + + if (!issuerLocator) { + const result = callNativeResolution(request, issuer); + + if (result === false) { + throw internalTools_makeError(ErrorCode.BUILTIN_NODE_RESOLUTION_FAILED, `The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree).\n\nRequire path: "${requestForDisplay}"\nRequired by: ${issuerForDisplay}\n`, { + request: requestForDisplay, + issuer: issuerForDisplay + }); + } + + return npath.toPortablePath(result); + } + + const issuerInformation = getPackageInformationSafe(issuerLocator); // We obtain the dependency reference in regard to the package that request it + + let dependencyReference = issuerInformation.packageDependencies.get(dependencyName); + let fallbackReference = null; // If we can't find it, we check if we can potentially load it from the packages that have been defined as potential fallbacks. + // It's a bit of a hack, but it improves compatibility with the existing Node ecosystem. Hopefully we should eventually be able + // to kill this logic and become stricter once pnp gets enough traction and the affected packages fix themselves. + + if (dependencyReference == null) { + if (issuerLocator.name !== null) { + // To allow programs to become gradually stricter, starting from the v2 we enforce that workspaces cannot depend on fallbacks. + // This works by having a list containing all their locators, and checking when a fallback is required whether it's one of them. + const exclusionEntry = runtimeState.fallbackExclusionList.get(issuerLocator.name); + const canUseFallbacks = !exclusionEntry || !exclusionEntry.has(issuerLocator.reference); + + if (canUseFallbacks) { + for (let t = 0, T = fallbackLocators.length; t < T; ++t) { + const fallbackInformation = getPackageInformationSafe(fallbackLocators[t]); + const reference = fallbackInformation.packageDependencies.get(dependencyName); + if (reference == null) continue; + if (alwaysWarnOnFallback) fallbackReference = reference;else dependencyReference = reference; + break; + } + + if (runtimeState.enableTopLevelFallback) { + if (dependencyReference == null && fallbackReference === null) { + const reference = runtimeState.fallbackPool.get(dependencyName); + + if (reference != null) { + fallbackReference = reference; + } + } + } + } + } + } // If we can't find the path, and if the package making the request is the top-level, we can offer nicer error messages + + + let error = null; + + if (dependencyReference === null) { + if (isDependencyTreeRoot(issuerLocator)) { + error = internalTools_makeError(ErrorCode.MISSING_PEER_DEPENDENCY, `Your application tried to access ${dependencyName} (a peer dependency); this isn't allowed as there is no ancestor to satisfy the requirement. Use a devDependency if needed.\n\nRequired package: ${dependencyName} (via "${requestForDisplay}")\nRequired by: ${issuerForDisplay}\n`, { + request: requestForDisplay, + issuer: issuerForDisplay, + dependencyName + }); + } else { + const brokenAncestors = findBrokenPeerDependencies(dependencyName, issuerLocator); + + if (brokenAncestors.every(ancestor => isDependencyTreeRoot(ancestor))) { + error = internalTools_makeError(ErrorCode.MISSING_PEER_DEPENDENCY, `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound.\n\nRequired package: ${dependencyName} (via "${requestForDisplay}")\nRequired by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay})\n${brokenAncestors.map(ancestorLocator => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference}\n`).join(``)}\n`, { + request: requestForDisplay, + issuer: issuerForDisplay, + issuerLocator: Object.assign({}, issuerLocator), + dependencyName, + brokenAncestors + }); + } else { + error = internalTools_makeError(ErrorCode.MISSING_PEER_DEPENDENCY, `${issuerLocator.name} tried to access ${dependencyName} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.\n\nRequired package: ${dependencyName} (via "${requestForDisplay}")\nRequired by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay})\n${brokenAncestors.map(ancestorLocator => `Ancestor breaking the chain: ${ancestorLocator.name}@${ancestorLocator.reference}\n`).join(``)}\n`, { + request: requestForDisplay, + issuer: issuerForDisplay, + issuerLocator: Object.assign({}, issuerLocator), + dependencyName, + brokenAncestors + }); + } + } + } else if (dependencyReference === undefined) { + if (!considerBuiltins && builtinModules.has(request)) { + if (isDependencyTreeRoot(issuerLocator)) { + error = internalTools_makeError(ErrorCode.UNDECLARED_DEPENDENCY, `Your application tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound.\n\nRequired package: ${dependencyName} (via "${requestForDisplay}")\nRequired by: ${issuerForDisplay}\n`, { + request: requestForDisplay, + issuer: issuerForDisplay, + dependencyName + }); + } else { + error = internalTools_makeError(ErrorCode.UNDECLARED_DEPENDENCY, `${issuerLocator.name} tried to access ${dependencyName}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${dependencyName} isn't otherwise declared in ${issuerLocator.name}'s dependencies, this makes the require call ambiguous and unsound.\n\nRequired package: ${dependencyName} (via "${requestForDisplay}")\nRequired by: ${issuerForDisplay}\n`, { + request: requestForDisplay, + issuer: issuerForDisplay, + issuerLocator: Object.assign({}, issuerLocator), + dependencyName + }); + } + } else { + if (isDependencyTreeRoot(issuerLocator)) { + error = internalTools_makeError(ErrorCode.UNDECLARED_DEPENDENCY, `Your application tried to access ${dependencyName}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.\n\nRequired package: ${dependencyName} (via "${requestForDisplay}")\nRequired by: ${issuerForDisplay}\n`, { + request: requestForDisplay, + issuer: issuerForDisplay, + dependencyName + }); + } else { + error = internalTools_makeError(ErrorCode.UNDECLARED_DEPENDENCY, `${issuerLocator.name} tried to access ${dependencyName}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.\n\nRequired package: ${dependencyName} (via "${requestForDisplay}")\nRequired by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay})\n`, { + request: requestForDisplay, + issuer: issuerForDisplay, + issuerLocator: Object.assign({}, issuerLocator), + dependencyName + }); + } + } + } + + if (dependencyReference == null) { + if (fallbackReference === null || error === null) throw error || new Error(`Assertion failed: Expected an error to have been set`); + dependencyReference = fallbackReference; + const message = error.message.replace(/\n.*/g, ``); + error.message = message; + + if (!emittedWarnings.has(message)) { + emittedWarnings.add(message); + process.emitWarning(error); + } + } // We need to check that the package exists on the filesystem, because it might not have been installed + + + const dependencyLocator = Array.isArray(dependencyReference) ? { + name: dependencyReference[0], + reference: dependencyReference[1] + } : { + name: dependencyName, + reference: dependencyReference + }; + const dependencyInformation = getPackageInformationSafe(dependencyLocator); + + if (!dependencyInformation.packageLocation) { + throw internalTools_makeError(ErrorCode.MISSING_DEPENDENCY, `A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod.\n\nRequired package: ${dependencyLocator.name}@${dependencyLocator.reference} (via "${requestForDisplay}")\nRequired by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDisplay})\n`, { + request: requestForDisplay, + issuer: issuerForDisplay, + dependencyLocator: Object.assign({}, dependencyLocator) + }); + } // Now that we know which package we should resolve to, we only have to find out the file location + // packageLocation is always absolute as it's returned by getPackageInformationSafe + + + const dependencyLocation = dependencyInformation.packageLocation; + + if (subPath) { + // We use ppath.join instead of ppath.resolve because: + // 1) subPath is always a relative path + // 2) ppath.join preserves trailing slashes + unqualifiedPath = ppath.join(dependencyLocation, subPath); + } else { + unqualifiedPath = dependencyLocation; + } + } + + return ppath.normalize(unqualifiedPath); + } + /** + * Transforms an unqualified path into a qualified path by using the Node resolution algorithm (which automatically + * appends ".js" / ".json", and transforms directory accesses into "index.js"). + */ + + + function resolveUnqualified(unqualifiedPath, { + extensions = Object.keys(external_module_.Module._extensions) + } = {}) { + const candidates = []; + const qualifiedPath = applyNodeExtensionResolution(unqualifiedPath, candidates, { + extensions + }); + + if (qualifiedPath) { + return ppath.normalize(qualifiedPath); + } else { + const unqualifiedPathForDisplay = getPathForDisplay(unqualifiedPath); + throw internalTools_makeError(ErrorCode.QUALIFIED_PATH_RESOLUTION_FAILED, `Qualified path resolution failed - none of the candidates can be found on the disk.\n\nSource path: ${unqualifiedPathForDisplay}\n${candidates.map(candidate => `Rejected candidate: ${getPathForDisplay(candidate)}\n`).join(``)}`, { + unqualifiedPath: unqualifiedPathForDisplay + }); + } + } + /** + * Transforms a request into a fully qualified path. + * + * Note that it is extremely important that the `issuer` path ends with a forward slash if the issuer is to be + * treated as a folder (ie. "/tmp/foo/" rather than "/tmp/foo" if "foo" is a directory). Otherwise relative + * imports won't be computed correctly (they'll get resolved relative to "/tmp/" instead of "/tmp/foo/"). + */ + + + function resolveRequest(request, issuer, { + considerBuiltins, + extensions + } = {}) { + const unqualifiedPath = resolveToUnqualified(request, issuer, { + considerBuiltins + }); + if (unqualifiedPath === null) return null; + + try { + return resolveUnqualified(unqualifiedPath, { + extensions + }); + } catch (resolutionError) { + if (resolutionError.pnpCode === `QUALIFIED_PATH_RESOLUTION_FAILED`) Object.assign(resolutionError.data, { + request: getPathForDisplay(request), + issuer: issuer && getPathForDisplay(issuer) + }); + throw resolutionError; + } + } + + function resolveVirtual(request) { + const normalized = ppath.normalize(request); + const resolved = VirtualFS.resolveVirtual(normalized); + return resolved !== normalized ? resolved : null; + } + + return { + VERSIONS, + topLevel, + getLocator: (name, referencish) => { + if (Array.isArray(referencish)) { + return { + name: referencish[0], + reference: referencish[1] + }; + } else { + return { + name, + reference: referencish + }; + } + }, + getDependencyTreeRoots: () => { + return [...runtimeState.dependencyTreeRoots]; + }, + + getAllLocators() { + const locators = []; + + for (const [name, entry] of packageRegistry) for (const reference of entry.keys()) if (name !== null && reference !== null) locators.push({ + name, + reference + }); + + return locators; + }, + + getPackageInformation: locator => { + const info = getPackageInformation(locator); + if (info === null) return null; + const packageLocation = npath.fromPortablePath(info.packageLocation); + const nativeInfo = { ...info, + packageLocation + }; + return nativeInfo; + }, + findPackageLocator: path => { + return findPackageLocator(npath.toPortablePath(path)); + }, + resolveToUnqualified: maybeLog(`resolveToUnqualified`, (request, issuer, opts) => { + const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; + const resolution = resolveToUnqualified(npath.toPortablePath(request), portableIssuer, opts); + if (resolution === null) return null; + return npath.fromPortablePath(resolution); + }), + resolveUnqualified: maybeLog(`resolveUnqualified`, (unqualifiedPath, opts) => { + return npath.fromPortablePath(resolveUnqualified(npath.toPortablePath(unqualifiedPath), opts)); + }), + resolveRequest: maybeLog(`resolveRequest`, (request, issuer, opts) => { + const portableIssuer = issuer !== null ? npath.toPortablePath(issuer) : null; + const resolution = resolveRequest(npath.toPortablePath(request), portableIssuer, opts); + if (resolution === null) return null; + return npath.fromPortablePath(resolution); + }), + resolveVirtual: maybeLog(`resolveVirtual`, path => { + const result = resolveVirtual(npath.toPortablePath(path)); + + if (result !== null) { + return npath.fromPortablePath(result); + } else { + return null; + } + }) + }; +} +// CONCATENATED MODULE: ./sources/loader/makeManager.ts + + +function makeManager(pnpapi, opts) { + const initialApiPath = npath.toPortablePath(pnpapi.resolveToUnqualified(`pnpapi`, null)); + const initialApiStats = opts.fakeFs.statSync(npath.toPortablePath(initialApiPath)); + const apiMetadata = new Map([[initialApiPath, { + cache: external_module_.Module._cache, + instance: pnpapi, + stats: initialApiStats, + lastRefreshCheck: Date.now() + }]]); + + function loadApiInstance(pnpApiPath) { + const nativePath = npath.fromPortablePath(pnpApiPath); // @ts-expect-error + + const module = new external_module_.Module(nativePath, null); // @ts-expect-error + + module.load(nativePath); + return module.exports; + } + + function refreshApiEntry(pnpApiPath, apiEntry) { + const timeNow = Date.now(); + if (timeNow - apiEntry.lastRefreshCheck < 500) return; + apiEntry.lastRefreshCheck = timeNow; + const stats = opts.fakeFs.statSync(pnpApiPath); + + if (stats.mtime > apiEntry.stats.mtime) { + console.warn(`[Warning] The runtime detected new informations in a PnP file; reloading the API instance (${npath.fromPortablePath(pnpApiPath)})`); + apiEntry.stats = stats; + apiEntry.instance = loadApiInstance(pnpApiPath); + } + } + + function getApiEntry(pnpApiPath, refresh = false) { + let apiEntry = apiMetadata.get(pnpApiPath); + + if (typeof apiEntry !== `undefined`) { + if (refresh) { + refreshApiEntry(pnpApiPath, apiEntry); + } + } else { + apiMetadata.set(pnpApiPath, apiEntry = { + cache: {}, + instance: loadApiInstance(pnpApiPath), + stats: opts.fakeFs.statSync(pnpApiPath), + lastRefreshCheck: Date.now() + }); + } + + return apiEntry; + } + + const findApiPathCache = new Map(); + + function addToCacheAndReturn(start, end, target) { + if (target !== null) target = VirtualFS.resolveVirtual(target); + let curr; + let next = start; + + do { + curr = next; + findApiPathCache.set(curr, target); + next = ppath.dirname(curr); + } while (curr !== end); + + return target; + } + + function findApiPathFor(modulePath) { + const controlledBy = []; + + for (const [apiPath, apiEntry] of apiMetadata) { + const locator = apiEntry.instance.findPackageLocator(modulePath); + + if (locator) { + if (apiMetadata.size === 1) { + return apiPath; + } else { + controlledBy.push(apiPath); + } + } + } + + if (controlledBy.length !== 0) { + if (controlledBy.length === 1) return controlledBy[0]; + throw new Error(`Unable to locate pnpapi, the module '${modulePath}' is controlled by multiple pnpapi instances.\nThis is usually caused by using the global cache (enableGlobalCache: true)\n\nControlled by:\n${controlledBy.map(pnpPath => ` ${npath.fromPortablePath(pnpPath)}`).join(`\n`)}`); + } + + const start = ppath.resolve(npath.toPortablePath(modulePath)); + let curr; + let next = start; + + do { + curr = next; + const cached = findApiPathCache.get(curr); + if (cached !== undefined) return addToCacheAndReturn(start, curr, cached); + const candidate = ppath.join(curr, `.pnp.js`); + if (xfs.existsSync(candidate) && xfs.statSync(candidate).isFile()) return addToCacheAndReturn(start, curr, candidate); + const cjsCandidate = ppath.join(curr, `.pnp.cjs`); + if (xfs.existsSync(cjsCandidate) && xfs.statSync(cjsCandidate).isFile()) return addToCacheAndReturn(start, curr, cjsCandidate); + next = ppath.dirname(curr); + } while (curr !== PortablePath.root); + + return addToCacheAndReturn(start, curr, null); + } + + function getApiPathFromParent(parent) { + if (parent == null) return initialApiPath; + + if (typeof parent.pnpApiPath === `undefined`) { + if (parent.filename !== null) { + return parent.pnpApiPath = findApiPathFor(parent.filename); + } else { + return initialApiPath; + } + } + + if (parent.pnpApiPath !== null) return parent.pnpApiPath; + return null; + } + + return { + getApiPathFromParent, + findApiPathFor, + getApiEntry + }; +} +// CONCATENATED MODULE: ./sources/loader/_entryPoint.ts + + + + + + + + + // We must copy the fs into a local, because otherwise +// 1. we would make the NodeFS instance use the function that we patched (infinite loop) +// 2. Object.create(fs) isn't enough, since it won't prevent the proto from being modified + +const localFs = { ...(external_fs_default()) +}; +const nodeFs = new NodeFS(localFs); +const defaultRuntimeState = $$SETUP_STATE(hydrateRuntimeState); +const defaultPnpapiResolution = __filename; // We create a virtual filesystem that will do three things: +// 1. all requests inside a folder named "$$virtual" will be remapped according the virtual folder rules +// 2. all requests going inside a Zip archive will be handled by the Zip fs implementation +// 3. any remaining request will be forwarded to Node as-is + +const defaultFsLayer = new VirtualFS({ + baseFs: new ZipOpenFS({ + baseFs: nodeFs, + libzip: getLibzipSync(), + maxOpenFiles: 80, + readOnlyArchives: true + }) +}); +let manager; +const defaultApi = Object.assign(makeApi(defaultRuntimeState, { + fakeFs: defaultFsLayer, + pnpapiResolution: defaultPnpapiResolution +}), { + /** + * Can be used to generate a different API than the default one (for example + * to map it on `/` rather than the local directory path, or to use a + * different FS layer than the default one). + */ + makeApi: ({ + basePath = undefined, + fakeFs = defaultFsLayer, + pnpapiResolution = defaultPnpapiResolution, + ...rest + }) => { + const apiRuntimeState = typeof basePath !== `undefined` ? $$SETUP_STATE(hydrateRuntimeState, basePath) : defaultRuntimeState; + return makeApi(apiRuntimeState, { + fakeFs, + pnpapiResolution, + ...rest + }); + }, + + /** + * Will inject the specified API into the environment, monkey-patching FS. Is + * automatically called when the hook is loaded through `--require`. + */ + setup: api => { + applyPatch(api || defaultApi, { + fakeFs: defaultFsLayer, + manager + }); + } +}); +manager = makeManager(defaultApi, { + fakeFs: defaultFsLayer +}); // eslint-disable-next-line arca/no-default-export + +/* harmony default export */ const _entryPoint = (defaultApi); + +if (__non_webpack_module__.parent && __non_webpack_module__.parent.id === `internal/preload`) { + defaultApi.setup(); + + if (__non_webpack_module__.filename) { + // We delete it from the cache in order to support the case where the CLI resolver is invoked from "yarn run" + // It's annoying because it might cause some issues when the file is multiple times in NODE_OPTIONS, but it shouldn't happen anyway. + delete (external_module_default())._cache[__non_webpack_module__.filename]; + } +} + +if (process.mainModule === __non_webpack_module__) { + const reportError = (code, message, data) => { + process.stdout.write(`${JSON.stringify([{ + code, + message, + data + }, null])}\n`); + }; + + const reportSuccess = resolution => { + process.stdout.write(`${JSON.stringify([null, resolution])}\n`); + }; + + const processResolution = (request, issuer) => { + try { + reportSuccess(defaultApi.resolveRequest(request, issuer)); + } catch (error) { + reportError(error.code, error.message, error.data); + } + }; + + const processRequest = data => { + try { + const [request, issuer] = JSON.parse(data); + processResolution(request, issuer); + } catch (error) { + reportError(`INVALID_JSON`, error.message, error.data); + } + }; + + if (process.argv.length > 2) { + if (process.argv.length !== 4) { + process.stderr.write(`Usage: ${process.argv[0]} ${process.argv[1]} \n`); + process.exitCode = 64; + /* EX_USAGE */ + } else { + processResolution(process.argv[2], process.argv[3]); + } + } else { + let buffer = ``; + const decoder = new (external_string_decoder_default()).StringDecoder(); + process.stdin.on(`data`, chunk => { + buffer += decoder.write(chunk); + + do { + const index = buffer.indexOf(`\n`); + if (index === -1) break; + const line = buffer.slice(0, index); + buffer = buffer.slice(index + 1); + processRequest(line); + } while (true); + }); + } +} + +/***/ }), + +/***/ 368: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var frozenFs = Object.assign({}, __webpack_require__(747)); +var Module = typeof Module !== "undefined" ? Module : {}; +var moduleOverrides = {}; +var key; +for (key in Module) { + if (Module.hasOwnProperty(key)) { + moduleOverrides[key] = Module[key]; + } +} +var arguments_ = []; +var thisProgram = "./this.program"; +var quit_ = function(status, toThrow) { + throw toThrow; +}; +var ENVIRONMENT_IS_WORKER = false; +var ENVIRONMENT_IS_NODE = true; +var scriptDirectory = ""; +function locateFile(path) { + if (Module["locateFile"]) { + return Module["locateFile"](path, scriptDirectory); + } + return scriptDirectory + path; +} +var read_, readBinary; +var nodeFS; +var nodePath; +if (ENVIRONMENT_IS_NODE) { + if (ENVIRONMENT_IS_WORKER) { + scriptDirectory = __webpack_require__(622).dirname(scriptDirectory) + "/"; + } else { + scriptDirectory = __dirname + "/"; + } + read_ = function shell_read(filename, binary) { + var ret = tryParseAsDataURI(filename); + if (ret) { + return binary ? ret : ret.toString(); + } + if (!nodeFS) nodeFS = frozenFs; + if (!nodePath) nodePath = __webpack_require__(622); + filename = nodePath["normalize"](filename); + return nodeFS["readFileSync"](filename, binary ? null : "utf8"); + }; + readBinary = function readBinary(filename) { + var ret = read_(filename, true); + if (!ret.buffer) { + ret = new Uint8Array(ret); + } + assert(ret.buffer); + return ret; + }; + if (process["argv"].length > 1) { + thisProgram = process["argv"][1].replace(/\\/g, "/"); + } + arguments_ = process["argv"].slice(2); + if (true) { + module["exports"] = Module; + } + quit_ = function(status) { + process["exit"](status); + }; + Module["inspect"] = function() { + return "[Emscripten Module object]"; + }; +} else { +} +var out = Module["print"] || console.log.bind(console); +var err = Module["printErr"] || console.warn.bind(console); +for (key in moduleOverrides) { + if (moduleOverrides.hasOwnProperty(key)) { + Module[key] = moduleOverrides[key]; + } +} +moduleOverrides = null; +if (Module["arguments"]) arguments_ = Module["arguments"]; +if (Module["thisProgram"]) thisProgram = Module["thisProgram"]; +if (Module["quit"]) quit_ = Module["quit"]; +var STACK_ALIGN = 16; +function alignMemory(size, factor) { + if (!factor) factor = STACK_ALIGN; + return Math.ceil(size / factor) * factor; +} +var tempRet0 = 0; +var setTempRet0 = function(value) { + tempRet0 = value; +}; +var wasmBinary; +if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"]; +var noExitRuntime; +if (Module["noExitRuntime"]) noExitRuntime = Module["noExitRuntime"]; +if (typeof WebAssembly !== "object") { + abort("no native wasm support detected"); +} +function getValue(ptr, type, noSafe) { + type = type || "i8"; + if (type.charAt(type.length - 1) === "*") type = "i32"; + switch (type) { + case "i1": + return HEAP8[ptr >> 0]; + case "i8": + return HEAP8[ptr >> 0]; + case "i16": + return HEAP16[ptr >> 1]; + case "i32": + return HEAP32[ptr >> 2]; + case "i64": + return HEAP32[ptr >> 2]; + case "float": + return HEAPF32[ptr >> 2]; + case "double": + return HEAPF64[ptr >> 3]; + default: + abort("invalid type for getValue: " + type); + } + return null; +} +var wasmMemory; +var wasmTable = new WebAssembly.Table({ + initial: 31, + maximum: 31, + element: "anyfunc" +}); +var ABORT = false; +var EXITSTATUS = 0; +function assert(condition, text) { + if (!condition) { + abort("Assertion failed: " + text); + } +} +function getCFunc(ident) { + var func = Module["_" + ident]; + assert( + func, + "Cannot call unknown function " + ident + ", make sure it is exported" + ); + return func; +} +function ccall(ident, returnType, argTypes, args, opts) { + var toC = { + string: function(str) { + var ret = 0; + if (str !== null && str !== undefined && str !== 0) { + var len = (str.length << 2) + 1; + ret = stackAlloc(len); + stringToUTF8(str, ret, len); + } + return ret; + }, + array: function(arr) { + var ret = stackAlloc(arr.length); + writeArrayToMemory(arr, ret); + return ret; + } + }; + function convertReturnValue(ret) { + if (returnType === "string") return UTF8ToString(ret); + if (returnType === "boolean") return Boolean(ret); + return ret; + } + var func = getCFunc(ident); + var cArgs = []; + var stack = 0; + if (args) { + for (var i = 0; i < args.length; i++) { + var converter = toC[argTypes[i]]; + if (converter) { + if (stack === 0) stack = stackSave(); + cArgs[i] = converter(args[i]); + } else { + cArgs[i] = args[i]; + } + } + } + var ret = func.apply(null, cArgs); + ret = convertReturnValue(ret); + if (stack !== 0) stackRestore(stack); + return ret; +} +function cwrap(ident, returnType, argTypes, opts) { + argTypes = argTypes || []; + var numericArgs = argTypes.every(function(type) { + return type === "number"; + }); + var numericRet = returnType !== "string"; + if (numericRet && numericArgs && !opts) { + return getCFunc(ident); + } + return function() { + return ccall(ident, returnType, argTypes, arguments, opts); + }; +} +var UTF8Decoder = + typeof TextDecoder !== "undefined" ? new TextDecoder("utf8") : undefined; +function UTF8ArrayToString(heap, idx, maxBytesToRead) { + var endIdx = idx + maxBytesToRead; + var endPtr = idx; + while (heap[endPtr] && !(endPtr >= endIdx)) ++endPtr; + if (endPtr - idx > 16 && heap.subarray && UTF8Decoder) { + return UTF8Decoder.decode(heap.subarray(idx, endPtr)); + } else { + var str = ""; + while (idx < endPtr) { + var u0 = heap[idx++]; + if (!(u0 & 128)) { + str += String.fromCharCode(u0); + continue; + } + var u1 = heap[idx++] & 63; + if ((u0 & 224) == 192) { + str += String.fromCharCode(((u0 & 31) << 6) | u1); + continue; + } + var u2 = heap[idx++] & 63; + if ((u0 & 240) == 224) { + u0 = ((u0 & 15) << 12) | (u1 << 6) | u2; + } else { + u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | (heap[idx++] & 63); + } + if (u0 < 65536) { + str += String.fromCharCode(u0); + } else { + var ch = u0 - 65536; + str += String.fromCharCode(55296 | (ch >> 10), 56320 | (ch & 1023)); + } + } + } + return str; +} +function UTF8ToString(ptr, maxBytesToRead) { + return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : ""; +} +function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { + if (!(maxBytesToWrite > 0)) return 0; + var startIdx = outIdx; + var endIdx = outIdx + maxBytesToWrite - 1; + for (var i = 0; i < str.length; ++i) { + var u = str.charCodeAt(i); + if (u >= 55296 && u <= 57343) { + var u1 = str.charCodeAt(++i); + u = (65536 + ((u & 1023) << 10)) | (u1 & 1023); + } + if (u <= 127) { + if (outIdx >= endIdx) break; + heap[outIdx++] = u; + } else if (u <= 2047) { + if (outIdx + 1 >= endIdx) break; + heap[outIdx++] = 192 | (u >> 6); + heap[outIdx++] = 128 | (u & 63); + } else if (u <= 65535) { + if (outIdx + 2 >= endIdx) break; + heap[outIdx++] = 224 | (u >> 12); + heap[outIdx++] = 128 | ((u >> 6) & 63); + heap[outIdx++] = 128 | (u & 63); + } else { + if (outIdx + 3 >= endIdx) break; + heap[outIdx++] = 240 | (u >> 18); + heap[outIdx++] = 128 | ((u >> 12) & 63); + heap[outIdx++] = 128 | ((u >> 6) & 63); + heap[outIdx++] = 128 | (u & 63); + } + } + heap[outIdx] = 0; + return outIdx - startIdx; +} +function stringToUTF8(str, outPtr, maxBytesToWrite) { + return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite); +} +function lengthBytesUTF8(str) { + var len = 0; + for (var i = 0; i < str.length; ++i) { + var u = str.charCodeAt(i); + if (u >= 55296 && u <= 57343) + u = (65536 + ((u & 1023) << 10)) | (str.charCodeAt(++i) & 1023); + if (u <= 127) ++len; + else if (u <= 2047) len += 2; + else if (u <= 65535) len += 3; + else len += 4; + } + return len; +} +function allocateUTF8(str) { + var size = lengthBytesUTF8(str) + 1; + var ret = _malloc(size); + if (ret) stringToUTF8Array(str, HEAP8, ret, size); + return ret; +} +function writeArrayToMemory(array, buffer) { + HEAP8.set(array, buffer); +} +var WASM_PAGE_SIZE = 65536; +function alignUp(x, multiple) { + if (x % multiple > 0) { + x += multiple - (x % multiple); + } + return x; +} +var buffer, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64; +function updateGlobalBufferAndViews(buf) { + buffer = buf; + Module["HEAP8"] = HEAP8 = new Int8Array(buf); + Module["HEAP16"] = HEAP16 = new Int16Array(buf); + Module["HEAP32"] = HEAP32 = new Int32Array(buf); + Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf); + Module["HEAPU16"] = HEAPU16 = new Uint16Array(buf); + Module["HEAPU32"] = HEAPU32 = new Uint32Array(buf); + Module["HEAPF32"] = HEAPF32 = new Float32Array(buf); + Module["HEAPF64"] = HEAPF64 = new Float64Array(buf); +} +var INITIAL_INITIAL_MEMORY = Module["INITIAL_MEMORY"] || 16777216; +if (Module["wasmMemory"]) { + wasmMemory = Module["wasmMemory"]; +} else { + wasmMemory = new WebAssembly.Memory({ + initial: INITIAL_INITIAL_MEMORY / WASM_PAGE_SIZE, + maximum: 2147483648 / WASM_PAGE_SIZE + }); +} +if (wasmMemory) { + buffer = wasmMemory.buffer; +} +INITIAL_INITIAL_MEMORY = buffer.byteLength; +updateGlobalBufferAndViews(buffer); +var __ATPRERUN__ = []; +var __ATINIT__ = []; +var __ATMAIN__ = []; +var __ATPOSTRUN__ = []; +var runtimeInitialized = false; +function preRun() { + if (Module["preRun"]) { + if (typeof Module["preRun"] == "function") + Module["preRun"] = [Module["preRun"]]; + while (Module["preRun"].length) { + addOnPreRun(Module["preRun"].shift()); + } + } + callRuntimeCallbacks(__ATPRERUN__); +} +function initRuntime() { + runtimeInitialized = true; + if (!Module["noFSInit"] && !FS.init.initialized) FS.init(); + TTY.init(); + callRuntimeCallbacks(__ATINIT__); +} +function preMain() { + FS.ignorePermissions = false; + callRuntimeCallbacks(__ATMAIN__); +} +function postRun() { + if (Module["postRun"]) { + if (typeof Module["postRun"] == "function") + Module["postRun"] = [Module["postRun"]]; + while (Module["postRun"].length) { + addOnPostRun(Module["postRun"].shift()); + } + } + callRuntimeCallbacks(__ATPOSTRUN__); +} +function addOnPreRun(cb) { + __ATPRERUN__.unshift(cb); +} +function addOnPostRun(cb) { + __ATPOSTRUN__.unshift(cb); +} +var Math_abs = Math.abs; +var Math_ceil = Math.ceil; +var Math_floor = Math.floor; +var Math_min = Math.min; +var runDependencies = 0; +var runDependencyWatcher = null; +var dependenciesFulfilled = null; +function getUniqueRunDependency(id) { + return id; +} +function addRunDependency(id) { + runDependencies++; + if (Module["monitorRunDependencies"]) { + Module["monitorRunDependencies"](runDependencies); + } +} +function removeRunDependency(id) { + runDependencies--; + if (Module["monitorRunDependencies"]) { + Module["monitorRunDependencies"](runDependencies); + } + if (runDependencies == 0) { + if (runDependencyWatcher !== null) { + clearInterval(runDependencyWatcher); + runDependencyWatcher = null; + } + if (dependenciesFulfilled) { + var callback = dependenciesFulfilled; + dependenciesFulfilled = null; + callback(); + } + } +} +Module["preloadedImages"] = {}; +Module["preloadedAudios"] = {}; +function abort(what) { + if (Module["onAbort"]) { + Module["onAbort"](what); + } + what += ""; + err(what); + ABORT = true; + EXITSTATUS = 1; + what = "abort(" + what + "). Build with -s ASSERTIONS=1 for more info."; + var e = new WebAssembly.RuntimeError(what); + throw e; +} +function hasPrefix(str, prefix) { + return String.prototype.startsWith + ? str.startsWith(prefix) + : str.indexOf(prefix) === 0; +} +var dataURIPrefix = "data:application/octet-stream;base64,"; +function isDataURI(filename) { + return hasPrefix(filename, dataURIPrefix); +} +var wasmBinaryFile = + "data:application/octet-stream;base64,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AkEgaiQAC4sDAQF/IwBBMGsiAyQAIAMgADYCJCADIAE2AiAgAyACNwMYAkAgAygCJC0AKEEBcQRAIANCfzcDKAwBCwJAAkAgAygCJCgCIEEATQ0AIAMpAxhC////////////AFYNACADKQMYQgBYDQEgAygCIA0BCyADKAIkQQxqQRJBABAVIANCfzcDKAwBCyADKAIkLQA1QQFxBEAgA0J/NwMoDAELAn8jAEEQayIAIAMoAiQ2AgwgACgCDC0ANEEBcQsEQCADQgA3AygMAQsgAykDGFAEQCADQgA3AygMAQsgA0IANwMQA0AgAykDECADKQMYVARAIAMgAygCJCADKAIgIAMpAxCnaiADKQMYIAMpAxB9QQEQIiICNwMIIAJCAFMEQCADKAIkQQE6ADUgAykDEFAEQCADQn83AygMBAsgAyADKQMQNwMoDAMLIAMpAwhQBEAgAygCJEEBOgA0BSADIAMpAwggAykDEHw3AxAMAgsLCyADIAMpAxA3AygLIAMpAyghAiADQTBqJAAgAgs2AQF/IwBBEGsiASAANgIMAn4gASgCDC0AAEEBcQRAIAEoAgwpAwggASgCDCkDEH0MAQtCAAsLsgECAX8BfiMAQRBrIgEkACABIAA2AgQgASABKAIEQggQHzYCAAJAIAEoAgBFBEAgAUIANwMIDAELIAEgASgCAC0AAK0gASgCAC0AB61COIYgASgCAC0ABq1CMIZ8IAEoAgAtAAWtQiiGfCABKAIALQAErUIghnwgASgCAC0AA61CGIZ8IAEoAgAtAAKtQhCGfCABKAIALQABrUIIhnx8NwMICyABKQMIIQIgAUEQaiQAIAILqAEBAX8jAEEQayIBJAAgASAANgIIAkAgASgCCCgCIEEATQRAIAEoAghBDGpBEkEAEBUgAUF/NgIMDAELIAEoAggiACAAKAIgQX9qNgIgIAEoAggoAiBFBEAgASgCCEEAQgBBAhAiGiABKAIIKAIABEAgASgCCCgCABAyQQBIBEAgASgCCEEMakEUQQAQFQsLCyABQQA2AgwLIAEoAgwhACABQRBqJAAgAAvxAgICfwF+AkAgAkUNACAAIAJqIgNBf2ogAToAACAAIAE6AAAgAkEDSQ0AIANBfmogAToAACAAIAE6AAEgA0F9aiABOgAAIAAgAToAAiACQQdJDQAgA0F8aiAB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ECwQMwsgASgCDCgCVBAWIAEoAgxBADYCVAsgAUEQaiQAC/EBAQF/IwBBEGsiASAANgIMIAEoAgxBADYCACABKAIMQQA6AAQgASgCDEEAOgAFIAEoAgxBAToABiABKAIMQb8GOwEIIAEoAgxBCjsBCiABKAIMQQA7AQwgASgCDEF/NgIQIAEoAgxBADYCFCABKAIMQQA2AhggASgCDEIANwMgIAEoAgxCADcDKCABKAIMQQA2AjAgASgCDEEANgI0IAEoAgxBADYCOCABKAIMQQA2AjwgASgCDEEAOwFAIAEoAgxBgIDYjXg2AkQgASgCDEIANwNIIAEoAgxBADsBUCABKAIMQQA7AVIgASgCDEEANgJUC9oTAQF/IwBBsAFrIgMkACADIAA2AqgBIAMgATYCpAEgAyACNgKgASADQQA2ApABIAMgAygCpAEoAjBBABA7NgKUASADIAMoAqQBKAI4QQAQOzYCmAECQAJAAkACQCADKAKUAUECRgRAIAMoApgBQQFGDQELIAMoApQBQQFGBEAgAygCmAFBAkYNAQsgAygClAFBAkcNASADKAKYAUECRw0BCyADKAKkASIAIAAvAQxBgBByOwEMDAELIAMoAqQBIgAgAC8BDEH/7wNxOwEMIAMoApQBQQJGBEAgA0H14AEgAygCpAEoAjAgAygCqAFBCGoQxAE2ApABIAMoApABRQRAIANBfzYCrAEMAwsLAkAgAygCoAFBgAJxDQAgAygCmAFBAkcNACADQfXGASADKAKkASgCOCADKAKoAUEIahDEATYCSCADKAJIRQRAIAMoApABECQgA0F/NgKsAQwDCyADKAJIIAMoApABNgIAIAMgAygCSDYCkAELCwJAIAMoAqQBLwFSRQRAIAMoAqQBIgAgAC8BDEH+/wNxOwEMDAELIAMoAqQBIgAgAC8BDEEBcjsBDAsgAyADKAKkASADKAKgARCAAUEBcToAhgEgAyADKAKgAUGACnFBgApHBH8gAy0AhgEFQQELQQFxOgCHASADAn9BASADKAKkAS8BUkGBAkYNABpBASADKAKkAS8BUkGCAkYNABogAygCpAEvAVJBgwJGC0EBcToAhQEgAy0AhwFBAXEEQCADIANBIGpCHBAqNgIcIAMoAhxFBEAgAygCqAFBCGpBDkEAEBUgAygCkAEQJCADQX82AqwBDAILAkAgAygCoAFBgAJxBEACQCADKAKgAUGACHENACADKAKkASkDIEL/////D1YNACADKAKkASkDKEL/////D1gNAgsgAygCHCADKAKkASkDKBAuIAMoAhwgAygCpAEpAyAQLgwBCwJAAkAgAygCoAFBgAhxDQAgAygCpAEpAyBC/////w9WDQAgAygCpAEpAyhC/////w9WDQAgAygCpAEpA0hC/////w9YDQELIAMoAqQBKQMoQv////8PWgRAIAMoAhwgAygCpAEpAygQLgsgAygCpAEpAyBC/////w9aBEAgAygCHCADKAKkASkDIBAuCyADKAKkASkDSEL/////D1oEQCADKAIcIAMoAqQBKQNIEC4LCwsCfyMAQRBrIgAgAygCHDYCDCAAKAIMLQAAQQFxRQsEQCADKAKoAUEIakEUQQAQFSADKAIcEBcgAygCkAEQJCADQX82AqwBDAILIANBAQJ/IwBBEGsiACADKAIcNgIMAn4gACgCDC0AAEEBcQRAIAAoAgwpAxAMAQtCAAunQf//A3ELIANBIGpBgAYQUDYCjAEgAygCHBAXIAMoAowBIAMoApABNgIAIAMgAygCjAE2ApABCyADLQCFAUEBcQRAIAMgA0EVakIHECo2AhAgAygCEEUEQCADKAKoAUEIakEOQQAQFSADKAKQARAkIANBfzYCrAEMAgsgAygCEEECECAgAygCEEHP0wBBAhBAIAMoAhAgAygCpAEvAVJB/wFxEIoBIAMoAhAgAygCpAEoAhBB//8DcRAgAn8jAEEQayIAIAMoAhA2AgwgACgCDC0AAEEBcUULBEAgAygCqAFBCGpBFEEAEBUgAygCEBAXIAMoApABECQgA0F/NgKsAQwCCyADQYGyAkEHIANBFWpBgAYQUDYCDCADKAIQEBcgAygCDCADKAKQATYCACADIAMoAgw2ApABCyADIANB0ABqQi4QKiIANgJMIABFBEAgAygCqAFBCGpBDkEAEBUgAygCkAEQJCADQX82AqwBDAELIAMoAkxBxdMAQcrTACADKAKgAUGAAnEbQQQQQCADKAKgAUGAAnFFBEAgAygCTAJ/QS0gAy0AhgFBAXENABogAygCpAEvAQgLQf//A3EQIAsgAygCTAJ/QS0gAy0AhgFBAXENABogAygCpAEvAQoLQf//A3EQICADKAJMIAMoAqQBLwEMECACQCADLQCFAUEBcQRAIAMoAkxB4wAQIAwBCyADKAJMIAMoAqQBKAIQQf//A3EQIAsgAygCpAEoAhQgA0GeAWogA0GcAWoQwwEgAygCTCADLwGeARAgIAMoAkwgAy8BnAEQIAJAAkAgAy0AhQFBAXFFDQAgAygCpAEpAyhCFFoNACADKAJMQQAQIQwBCyADKAJMIAMoAqQBKAIYECELAkACQCADKAKgAUGAAnFBgAJHDQAgAygCpAEpAyBC/////w9UBEAgAygCpAEpAyhC/////w9UDQELIAMoAkxBfxAhIAMoAkxBfxAhDAELAkAgAygCpAEpAyBC/////w9UBEAgAygCTCADKAKkASkDIKcQIQwBCyADKAJMQX8QIQsCQCADKAKkASkDKEL/////D1QEQCADKAJMIAMoAqQBKQMopxAhDAELIAMoAkxBfxAhCwsgAygCTCADKAKkASgCMBBSQf//A3EQICADIAMoAqQBKAI0IAMoAqABEIIBQf//A3EgAygCkAFBgAYQggFB//8DcWo2AogBIAMoAkwgAygCiAFB//8DcRAgIAMoAqABQYACcUUEQCADKAJMIAMoAqQBKAI4EFJB//8DcRAgIAMoAkwgAygCpAEoAjxB//8DcRAgIAMoAkwgAygCpAEvAUAQICADKAJMIAMoAqQBKAJEECECQCADKAKkASkDSEL/////D1QEQCADKAJMIAMoAqQBKQNIpxAhDAELIAMoAkxBfxAhCwsCfyMAQRBrIgAgAygCTDYCDCAAKAIMLQAAQQFxRQsEQCADKAKoAUEIakEUQQAQFSADKAJMEBcgAygCkAEQJCADQX82AqwBDAELIAMoAqgBIANB0ABqAn4jAEEQayIAIAMoAkw2AgwCfiAAKAIMLQAAQQFxBEAgACgCDCkDEAwBC0IACwsQNkEASARAIAMoAkwQFyADKAKQARAkIANBfzYCrAEMAQsgAygCTBAXIAMoAqQBKAIwBEAgAygCqAEgAygCpAEoAjAQhgFBAEgEQCADKAKQARAkIANBfzYCrAEMAgsLIAMoApABBEAgAygCqAEgAygCkAFBgAYQgQFBAEgEQCADKAKQARAkIANBfzYCrAEMAgsLIAMoApABECQgAygCpAEoAjQEQCADKAKoASADKAKkASgCNCADKAKgARCBAUEASARAIANBfzYC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IAMoAoABKAIAIAMpA3CnQQR0aigCACADEPEBBEAgAygCfEEVQQAQFSADEFwgA0J/NwOIAQwDBSADKAKAASgCACADKQNwp0EEdGooAgAoAjQgAygCNBCFASEAIAMoAoABKAIAIAMpA3CnQQR0aigCACAANgI0IAMoAoABKAIAIAMpA3CnQQR0aigCAEEBOgAEIANBADYCNCADEFwgAyADKQNwQgF8NwNwDAILAAsLIAMCfiADKQNgIAMpA2h9Qv///////////wBUBEAgAykDYCADKQNofQwBC0L///////////8ACzcDiAELIAMpA4gBIQQgA0GQAWokACAEC6YBAQF/IwBBIGsiAyQAIAMgADYCGCADIAE2AhQgAyACNgIQIAMgAygCEBD6ASIANgIMAkAgAEUEQCADQQA2AhwMAQsgAygCDCADKAIYNgIAIAMoAgwgAygCFDYCBCADKAIUQRBxBEAgAygCDCIAIAAoAhRBAnI2AhQgAygCDCIAIAAoAhhBAnI2AhgLIAMgAygCDDYCHAsgAygCHCEAIANBIGokACAAC9UBAQF/IwBBIGsiBCQAIAQgADYCGCAEIAE3AxAgBCACNgIMIAQgAzYCCAJAAkAgBCkDEEL///////////8AVwRAIAQpAxBCgICAgICAgICAf1kNAQsgBCgCCEEEQT0QFSAEQX82AhwMAQsCfyAEKQMQIQEgBCgCDCEAIAQoAhgiAigCTEF/TARAIAIgASAAEJYBDAELIAIgASAAEJYBC0EASARAIAQoAghBBEG0nAEoAgAQFSAEQX82AhwMAQsgBEEANgIcCyAEKAIcIQAgBEEgaiQAIAALJwACf0EAQQAgABAFIgAgAEEbRhsiAEUNABpBtJwBIAA2AgBBAAsaC14BAX8jAEEQayIDJAAgAyABQcCAgAJxBH8gAyACQQRqNgIMIAIoAgAFQQALNgIAIAAgAUGAgAJyIAMQESIAQYFgTwRAQbScAUEAIABrNgIAQX8hAAsgA0EQaiQAIAALVQEBfyMAQRBrIgEkACABIAA2AgwCQAJAIAEoAgwoAiRBAUYNACABKAIMKAIkQQJGDQAMAQsgASgCDEEAQgBBChAiGiABKAIMQQA2AiQLIAFBEGokAAszAQF/An8gABAGIgFBYUYEQCAAEBIhAQsgAUGBYE8LBH9BtJwBQQAgAWs2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IEUNACABKAIIKAIkDQELIAFBATYCDAwBCyABIAEoAggoAhw2AgQCQAJAIAEoAgRFDQAgASgCBCgCACABKAIIRw0AIAEoAgQoAgRBKkYNASABKAIEKAIEQTlGDQEgASgCBCgCBEHFAEYNASABKAIEKAIEQckARg0BIAEoAgQoAgRB2wBGDQEgASgCBCgCBEHnAEYNASABKAIEKAIEQfEARg0BIAEoAgQoAgRBmgVGDQELIAFBATYCDAwBCyABQQA2AgwLIAEoAgwL0gQBAX8jAEEgayIDIAA2AhwgAyABNgIYIAMgAjYCFCADIAMoAhxB3BZqIAMoAhRBAnRqKAIANgIQIAMgAygCFEEBdDYCDANAAkAgAygCDCADKAIcKALQKEoNAAJAIAMoAgwgAygCHCgC0ChODQAgAygCGCADKAIcIAMoAgxBAnRqQeAWaigCAEECdGovAQAgAygCGCADKAIcQdwWaiADKAIMQQJ0aigCAEECdGovAQBOBEAgAygCGCADKAIcIAMoAgxBAnRqQeAWaigCAEECdGovAQAgAygCGCADKAIcQdwWaiADKAIMQQJ0aigCAEECdGovAQBHDQEgAygCHCADKAIMQQJ0akHgFmooAgAgAygCHEHYKGpqLQAAIAMoAhxB3BZqIAMoAgxBAnRqKAIAIAMoAhxB2Chqai0AAEoNAQsgAyADKAIMQQFqNgIMCyADKAIYIAMoAhBBAnRqLwEAIAMoAhggAygCHEHcFmogAygCDEECdGooAgBBAnRqLwEASA0AAkAgAygCGCADKAIQQQJ0ai8BACADKAIYIAMoAhxB3BZqIAMoAgxBAnRqKAIAQQJ0ai8BAEcNACADKAIQIAMoAhxB2Chqai0AACADKAIcQdwWaiADKAIMQQJ0aigCACADKAIcQdgoamotAABKDQAMAQsgAygCHEHcFmogAygCFEECdGogAygCHEHcFmogAygCDEECdGooAgA2AgAgAyADKAIMNgIUIAMgAygCDEEBdDYCDAwBCwsgAygCHEHcFmogAygCFEECdGogAygCEDYCAAvnCAEDfyMAQTBrIgIkACACIAA2AiwgAiABNgIoIAIgAigCKCgCADYCJCACIAIoAigoAggoAgA2AiAgAiACKAIoKAIIKAIMNgIcIAJBfzYCECACKAIsQQA2AtAoIAIoAixBvQQ2AtQoIAJBADYCGANAIAIoAhggAigCHE5FBEACQCACKAIkIAIoAhhBAnRqLwEABEAgAiACKAIYIgE2AhAgAigCLEHcFmohAyACKAIsIgQoAtAoQQFqIQAgBCAANgLQKCAAQQJ0IANqIAE2AgAgAigCGCACKAIsQdgoampBADoAAAwBCyACKAIkIAIoAhhBAnRqQQA7AQILIAIgAigCGEEBajYCGAwBCwsDQCACKAIsKALQKEECSARAAkAgAigCEEECSARAIAIgAigCEEEBaiIANgIQDAELQQAhAAsgAigCLEHcFmohAyACKAIsIgQoAtAoQQFqIQEgBCABNgLQKCABQQJ0IANqIAA2AgAgAiAANgIMIAIoAiQgAigCDEECdGpBATsBACACKAIMIAIoAixB2ChqakEAOgAAIAIoAiwiACAAKAKoLUF/ajYCqC0gAigCIARAIAIoAiwiACAAKAKsLSACKAIgIAIoAgxBAnRqLwECazYCrC0LDAELCyACKAIoIAIoAhA2AgQgAiACKAIsKALQKEECbTYCGANAIAIoAhhBAUhFBEAgAigCLCACKAIkIAIoAhgQdSACIAIoAhhBf2o2AhgMAQsLIAIgAigCHDYCDANAIAIgAigCLCgC4BY2AhggAigCLEHcFmohASACKAIsIgMoAtAoIQAgAyAAQX9qNgLQKCACKAIsIABBAnQgAWooAgA2AuAWIAIoAiwgAigCJEEBEHUgAiACKAIsKALgFjYCFCACKAIYIQEgAigCLEHcFmohAyACKAIsIgQoAtQoQX9qIQAgBCAANgLUKCAAQQJ0IANqIAE2AgAgAigCFCEBIAIoAixB3BZqIQMgAigCLCIEKALUKEF/aiEAIAQgADYC1CggAEECdCADaiABNgIAIAIoAiQgAigCDEECdGogAigCJCACKAIYQQJ0ai8BACACKAIkIAIoAhRBAnRqLwEAajsBACACKAIMIAIoAixB2ChqagJ/IAIoAhggAigCLEHYKGpqLQAAIAIoAhQgAigCLEHYKGpqLQAATgRAIAIoAhggAigCLEHYKGpqLQAADAELIAIoAhQgAigCLEHYKGpqLQAAC0EBajoAACACKAIkIAIoAhRBAnRqIAIoAgwiADsBAiACKAIkIAIoAhhBAnRqIAA7AQIgAiACKAIMIgBBAWo2AgwgAigCLCAANgLgFiACKAIs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AykDKCEBIANBMGokACABC3cBAX8jAEEQayICIAA2AgggAiABNgIEAkACQAJAIAIoAggpAyhC/////w9aDQAgAigCCCkDIEL/////D1oNACACKAIEQYAEcUUNASACKAIIKQNIQv////8PVA0BCyACQQE6AA8MAQsgAkEAOgAPCyACLQAPQQFxC9kCAQF/IwBBIGsiAyQAIAMgADYCGCADIAE2AhQgAyACNgIQIAMgA0EMakIEECo2AggCQCADKAIIRQRAIANBfzYCHAwBCwNAIAMoAhQEQCADKAIUKAIEIAMoAhBxQYAGcQRAIAMoAghCABAtGiADKAIIIAMoAhQvAQgQICADKAIIIAMoAhQvAQoQIAJ/IwBBEGsiACADKAIINgIMIAAoAgwtAABBAXFFCwRAIAMoAhhBCGpBFEEAEBUgAygCCBAXIANBfzYCHAwECyADKAIYIANBDGpCBBA2QQBIBEAgAygCCBAXIANBfzYCHAwECyADKAIULwEKQQBKBEAgAygCGCADKAIUKAIMIAMoAhQvAQqtEDZBAEgEQCADKAIIEBcgA0F/NgIcDAULCwsgAyADKAIUKAIANgIUDAELCyADKAIIEBcgA0EANgIcCyADKAIcIQAgA0EgaiQAIAALaAEBfyMAQRBrIgIgADYCDCACIAE2AgggAkEAOwEGA0AgAigCDARAIAIoAgwoAgQgAigCCHFBgAZxBEAgAiACKAIMLwEKIAIvAQZBBGpqOwEGCyACIAIoAgwoAgA2AgwMAQsLIAIvAQYL8AEBAX8jAEEQayIBJAAgASAANgIMIAEgASgCDDYCCCABQQA2AgQDQCABKAIMBEACQAJAIAEoAgwvAQhB9cYBRg0AIAEoAgwvAQhB9eABRg0AIAEoAgwvAQhBgbICRg0AIAEoAgwvAQhBAUcNAQsgASABKAIMKAIANgIAIAEoAgggASgCDEYEQCABIAEoAgA2AggLIAEoAgxBADYCACABKAIMECQgASgCBARAIAEoAgQgASgCADYCAAsgASABKAIANgIMDAILIAEgASgCDDYCBCABIAEoAgwoAgA2AgwMAQsLIAEoAgghACABQRBqJAAgAAuzBAEBfyMAQUBqIgUkACAFIAA2AjggBSABOwE2IAUgAjYCMCAFIAM2AiwgBSAENgIoIAUgBSgCOCAFLwE2rRAqIgA2AiQCQCAARQRAIAUoAihBDkEAEBUgBUEAOgA/DAELIAVBADYCICAFQQA2AhgDQAJ/IwBBEGsiACAFKAIkNgIMIAAoAgwtAABBAXELBH8gBSgCJBAwQgRaBUEAC0EBcQRAIAUgBSgCJBAeOwEWIAUgBSgCJBAeOwEUIAUgBSgCJCAFLwEUrRAfNgIQIAUoAhBFBEAgBSgCKEEVQQAQFSAFKAIkEBcgBSgCGBAkIAVBADoAPwwDCyAFIAUvARYgBS8BFCAFKAIQIAUoAjAQUCIANgIcIABFBEAgBSgCKEEOQQAQFSAFKAIkEBcgBSgCGBAkIAVBADoAPwwDCwJAIAUoAhgEQCAFKAIgIAUoAhw2AgAgBSAFKAIcNgIgDAELIAUgBSgCHCIANgIgIAUgADYCGAsMAQsLIAUoAiQQSEEBcUUEQCAFIAUoAiQQMD4CDCAFIAUoAiQgBSgCDK0QHzYCCAJAAkAgBSgCDEEETw0AIAUoAghFDQAgBSgCCEGy0wAgBSgCDBBTRQ0BCyAFKAIoQRVBABAVIAUoAiQQFyAFKAIYECQgBUEAOgA/DAILCyAFKAIkEBcCQCAFKAIsBEAgBSgCLCAFKAIYNgIADAELIAUoAhgQJAsgBUEBOgA/CyAFLQA/QQFxIQAgBUFAayQAIAAL7wIBAX8jAEEgayICJAAgAiAANgIYIAIgATYCFAJAIAIoAhhFBEAgAiACKAIUNgIcDAELIAIgAigCGDYCCANAIAIoAggoAgAEQCACIAIoAggoAgA2AggMAQsLA0AgAigCFARAIAIgAigCFCgCADYCECACQQA2AgQgAiACKAIYNgIMA0ACQCACKAIMRQ0AAkAgAigCDC8BCCACKAIULwEIRw0AIAIoAgwvAQogAigCFC8BCkcNACACKAIMLwEKBEAgAigCDCgCDCACKAIUKAIMIAIoAgwvAQoQUw0BCyACKAIMIgAgACgCBCACKAIUKAIEQYAGcXI2AgQgAkEBNgIEDAELIAIgAigCDCgCADYCDAwBCwsgAigCFEEANgIAAkAgAigCBARAIAIoAhQQJAwBCyACKAIIIAIoAhQiADYCACACIAA2AggLIAIgAigCEDYCFAwBCwsgAiACKAIYNgIcCyACKAIcIQAgAkEgaiQAIAALXQEBfyMAQRBrIgIkACACIAA2AgggAiABNgIEAkAgAigCBEUEQCACQQA2AgwMAQsgAiACKAIIIAIoAgQoAgAgAigCBC8BBK0QNjYCDAsgAigCDCEAIAJBEGokACAAC48BAQF/IwBBEGsiAiQAIAIgADYCCCACIAE2AgQCQAJAIAIoAggEQCACKAIEDQELIAIgAigCCCACKAIERjYCDAwBCyACKAIILwEEIAIoAgQvAQRHBEAgAkEANgIMDAELIAIgAigCCCgCACACKAIEKAIAIAIoAggvAQQQU0U2AgwLIAIoAgwhACACQRBqJAAgAAtVAQF/IwBBEGsiASQAIAEgADYCDCABQQBBAEEAEBs2AgggASgCDARAIAEgASgCCCABKAIMKAIAIAEoAgwvAQQQGzYCCAsgASgCCCEAIAFBEGokACAAC6ABAQF/IwBBIGsiBSQAIAUgADYCGCAFIAE2AhQgBSACOwESIAUgAzoAESAFIAQ2AgwgBSAFKAIYIAUoAhQgBS8BEiAFLQARQQFxIAUoAgwQYCIANgIIAkAgAEUEQCAFQQA2AhwMAQsgBSAFKAIIIAUvARJBACAFKAIMEFE2AgQgBSgCCBAWIAUgBSgCBDYCHAsgBSgCHCEAIAVBIGokACAAC18BAX8jAEEQayICJAAgAiAANgIIIAIgAToAByACIAIoAghCARAfNgIAAkAgAigCAEUEQCACQX82AgwMAQsgAigCACACLQAHOgAAIAJBADYCDAsgAigCDBogAkEQaiQAC1QBAX8jAEEQayIBJAAgASAANgIIIAEgASgCCEIBEB82AgQCQCABKAIERQRAIAFBADoADwwBCyABIAEoAgQtAAA6AA8LIAEtAA8hACABQRBqJAAgAAs4AQF/IwBBEGsiASAANgIMIAEoAgxBADYCACABKAIMQQA2AgQgASgCDEEANgIIIAEoAgxBADoADAufAgEBfyMAQUBqIgUkACAFIAA3AzAgBSABNwMoIAUgAjYCJCAFIAM3AxggBSAENgIUIAUCfyAFKQMYQhBUBEAgBSgCFEESQQAQFUEADAELIAUoAiQLNgIEAkAgBSgCBEUEQCAFQn83AzgMAQsCQAJAAkACQAJAIAUoAgQoAggOAwIAAQMLIAUgBSkDMCAFKAIEKQMAfDcDCAwDCyAFIAUpAyggBSgCBCkDAHw3AwgMAgsgBSAFKAIEKQMANwMIDAELIAUoAhRBEkEAEBUgBUJ/NwM4DAELAkAgBSkDCEIAWQRAIAUpAwggBSkDKFgNAQsgBSgCFEESQQAQFSAFQn83AzgMAQsgBSAFKQMINwM4CyAFKQM4IQAgBUFAayQAIAAL6gECAX8BfiMAQSBrIgQkACAEIAA2AhggBCABNgIUIAQgAjYCECAEIAM2AgwgBCAEKAIMEI8BIgA2AggCQCAARQRAIARBADYCHAwBCyMAQRBrIgAgBCgCGDYCDCAAKAIMIgAgACgCMEEBajYCMCAEKAIIIAQoAhg2AgAgBCgCCCAEKAIUNgIEIAQoAgggBCgCEDYCCCAEKAIYIAQoAhBBAEIAQQ4gBCgCFBENACEFIAQoAgggBTcDGCAEKAIIKQMYQgBTBEAgBCgCCEI/NwMYCyAEIAQoAgg2AhwLIAQoAhwhACAEQSBqJAAgAAvqAQEBfyMAQRBrIgEkACABIAA2AgggAUE4EBkiADYCBAJAIABFBEAgASgCCEEOQQAQFSABQQA2AgwMAQsgASgCBEEANgIAIAEoAgRBADYCBCABKAIEQQA2AgggASgCBEEANgIgIAEoAgRBADYCJCABKAIEQQA6ACggASgCBEEANgIsIAEoAgRBATYCMCMAQRBrIgAgASgCBEEMajYCDCAAKAIMQQA2AgAgACgCDEEANgIEIAAoAgxBADYCCCABKAIEQQA6ADQgASgCBEEAOgA1IAEgASgCBDYCDAsgASgCDCEAIAFBEGokACAAC7ABAgF/AX4jAEEgayIDJAAgAyAANgIYIAMgATYCFCADIAI2AhAgAyADKAIQEI8BIgA2AgwCQCAARQRAIANBADYCHAwBCyADKAIMIAMoAhg2AgQgAygCDCADKAIUNgIIIAMoAhRBAEIAQQ4gAygCGBEPACEEIAMoAgwgBDcDGCADKAIMKQMYQgBTBEAgAygCDEI/NwMYCyADIAMoAgw2AhwLIAMoAhwhACADQSBqJAAgAAvDAgEBfyMAQRBrIgMgADYCDCADIAE2AgggAyACNgIEIAMoAggpAwBCAoNCAFIEQCADKAIMIAMoAggpAxA3AxALIAMoAggpAwBCBINCAFIEQCADKAIMIAMoAggpAxg3AxgLIAMoAggpAwBCCINCAFIEQCADKAIMIAMoAggpAyA3AyALIAMoAggpAwBCEINCAFIEQCADKAIMIAMoAggoAig2AigLIAMoAggpAwBCIINCAFIEQCADKAIMIAMoAggoAiw2AiwLIAMoAggpAwBCwACDQgBSBEAgAygCDCADKAIILwEwOwEwCyADKAIIKQMAQoABg0IAUgRAIAMoAgwgAygCCC8BMjsBMgsgAygCCCkDAEKAAoNCAFIEQCADKAIMIAMoAggoAjQ2AjQLIAMoAgwiACADKAIIKQMAIAApAwCENwMAQQALggUBAX8jAEHgAGsiAyQAIAMgADYCWCADIAE2AlQgAyACNgJQAkACQCADKAJUQQBOBEAgAygCWA0BCyADKAJQQRJBABAVIANBADYCXAwBCyADIAMoAlQ2AkwjAEEQayIAIAMoAlg2AgwgAyAAKAIMKQMYNwNAQeCbASkDAEJ/UQRAIANBfzYCFCADQQM2AhAgA0EHNgIMIANBBjYCCCADQQI2AgQgA0EBNgIAQeCbAUEAIAMQNzcDACADQX82AjQgA0EPNgIwIANBDTYCLCADQQw2AiggA0EKNgIkIANBCTYCIEHomwFBCCADQSBqEDc3AwALQeCbASkDACADKQNAQeCbASkDAINSBEAgAygCUEEcQQAQFSADQQA2AlwMAQtB6JsBKQMAIAMpA0BB6JsBKQMAg1IEQCADIAMoAkxBEHI2AkwLIAMoAkxBGHFBGEYEQCADKAJQQRlBABAVIANBADYCXAwBCyADIAMoAlggAygCUBD4ATYCPAJAAkACQCADKAI8QQFqDgIAAQILIANBADYCXAwCCyADKAJMQQFxRQRAIAMoAlBBCUEAEBUgA0EANgJcDAILIAMgAygCWCADKAJMIAMoAlAQZjYCXAwBCyADKAJMQQJxBEAgAygCUEEKQQAQFSADQQA2AlwMAQsgAygCWBBJQQBIBEAgAygCUCADKAJYEBggA0EANgJcDAELAkAgAygCTEEIcQRAIAMgAygCWCADKAJMIAMoAlAQZjYCOAwBCyADIAMoAlggAygCTCADKAJQEPcBNgI4CyADKAI4RQRAIAMoAlgQMhogA0EANgJcDAELIAMgAygCODYCXAsgAygCXCEAIANB4ABqJAAgAAuOAQEBfyMAQRBrIgIkACACIAA2AgwgAiABNgIIIAJBADYCBCACKAIIBEAjAEEQayIAIAIoAgg2AgwgAiAAKAIMKAIANgIEIAIoAggQpwFBAUYEQCMAQRBrIgAgAigCCDYCDEG0nAEgACgCDCgCBDYCAAsLIAIoAgwEQCACKAIMIAIoAgQ2AgALIAJBEGokAAuVAQEBfyMAQRBrIgEkACABIAA2AggCQAJ/IwBBEGsiACABKAIINgIMIAAoAgwpAxhCgIAQg1ALBEAgASgCCCgCAARAIAEgASgCCCgCABCUAUEBcToADwwCCyABQQE6AA8MAQsgASABKAIIQQBCAEESECI+AgQgASABKAIEQQBHOgAPCyABLQAPQQFxIQAgAUEQaiQAIAALfwEBfyMAQSBrIgMkACADIAA2AhggAyABNwMQIANBADYCDCADIAI2AggCQCADKQMQQv///////////wBWBEAgAygCCEEEQT0QFSADQX82AhwMAQsgAyADKAIYIAMpAxAgAygCDCADKAIIEGc2AhwLIAMoAhwhACADQSBqJAAgAAt9ACACQQFGBEAgASAAKAIIIAAoAgRrrH0hAQsCQCAAKAIUIAAoAhxLBEAgAEEAQQAgACgCJBEBABogACgCFEUNAQsgAEEANgIcIABCADcDECAAIAEgAiAAKAIoERAAQgBTDQAgAEIANwIEIAAgACgCAEFvcTYCAEEADwtBfwviAgECfyMAQSBrIgMkAAJ/AkACQEH0lwEgASwAABCYAUUEQEG0nAFBHDYCAAwBC0GYCRAZIgINAQtBAAwBCyACQQBBkAEQMyABQSsQmAFFBEAgAkEIQQQgAS0AAEHyAEYbNgIACwJAIAEtAABB4QBHBEAgAigCACEBDAELIABBA0EAEAQiAUGACHFFBEAgAyABQYAIcjYCECAAQQQgA0EQahAEGgsgAiACKAIAQYABciIBNgIACyACQf8BOgBLIAJBgAg2AjAgAiAANgI8IAIgAkGYAWo2AiwCQCABQQhxDQAgAyADQRhqNgIAIABBk6gBIAMQDg0AIAJBCjoASwsgAkEaNgIoIAJBGzYCJCACQRw2AiAgAkEdNgIMQdygASgCAEUEQCACQX82AkwLIAJBsKEBKAIANgI4QbChASgCACIABEAgACACNgI0C0GwoQEgAjYCACACCyEAIANBIGokACAACxoAIAAgARCFAiIAQQAgAC0AACABQf8BcUYbCxgAIAAoAkxBf0wEQCAAEJoBDwsgABCaAQtgAgJ/AX4gACgCKCEBQQEhAiAAQgAgAC0AAEGAAXEEf0ECQQEgACgCFCAAKAIc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KAIYKQMwWgRAIAIoAhhBCGpBEkEAEBUgAkF/NgIcDAELIAIoAhgoAhhBAnEEQCACKAIYQQhqQRlBABAVIAJBfzYCHAwBCyACIAIoAhggAikDEEEAIAIoAhhBCGoQTyIANgIMIABFBEAgAkF/NgIcDAELIAIoAhgoAlAgAigCDCACKAIYQQhqEFlBAXFFBEAgAkF/NgIcDAELIAIoAhggAikDEBCgAgRAIAJBfzYCHAwBCyACKAIYKAJAIAIpAxCnQQR0akEBOgAMIAJBADYCHAsgAigCHCEAIAJBIGokACAAC5gCAAJAAkAgAUEUSw0AAkACQAJAAkACQAJAAkACQCABQXdqDgoAAQIJAwQFBgkHCAsgAiACKAIAIgFBBGo2AgAgACABKAIANgIADwsgAiACKAIAIgFBBGo2AgAgACABNAIANwMADwsgAiACKAIAIgFBBGo2AgAgACABNQIANwMADwsgAiACKAIAIgFBBGo2AgAgACABMgEANwMADwsgAiACKAIAIgFBBGo2AgAgACABMwEANwMADwsgAiACKAIAIgFBBGo2AgAgACABMAAANwMADwsgAiACKAIAIgFBBGo2AgAgACABMQAANwMADwsgACACQRYRBAALDwsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKQMANwMAC0oBA38gACgCACwAAEFQakEKSQRAA0AgACgCACIBLAAAIQMgACABQQFqNgIAIAMgAkEKbGpBUGohAiABLAABQVBqQQpJDQALCyACC38CAX8BfiAAvSIDQjSIp0H/D3EiAkH/D0cEfCACRQRAIAEgAEQAAAAAAAAAAGEEf0EABSAARAAAAAAAAPBDoiABEKQBIQAgASgCAEFAags2AgAgAA8LIAEgAkGCeGo2AgAgA0L/////////h4B/g0KAgICAgICA8D+EvwUgAAsLEgAgAEUEQEEADwsgACABELQCC+UBAQJ/IAJBAEchAwJAAkACQCACRQ0AIABBA3FFDQAgAUH/AXEhBANAIAAtAAAgBEYNAiAAQQFqIQAgAkF/aiICQQBHIQMgAkUNASAAQQNxDQALCyADRQ0BCwJAIAAtAAAgAUH/AXFGDQAgAkEESQ0AIAFB/wFxQYGChAhsIQMDQCAAKAIAIANzIgRBf3MgBEH//ft3anFBgIGChHhxDQEgAEEEaiEAIAJB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HAvkAQEBfyMAQSBrIgMkACADIAA6ABsgAyABNgIUIAMgAjYCECADQcgAEBkiADYCDAJAIABFBEAgAygCEEEBQbScASgCABAVIANBADYCHAwBCyADKAIMIAMoAhA2AgAgAygCDCADLQAbQQFxOgAEIAMoAgwgAygCFDYCCAJAIAMoAgwoAghBAU4EQCADKAIMKAIIQQlMDQELIAMoAgxBCTYCCAsgAygCDEEAOgAMIAMoAgxBADYCMCADKAIMQQA2AjQgAygCDEEANgI4IAMgAygCDDYCHAsgAygCHCEAIANBIGokACAAC+MIAQF/IwBBQGoiAiAANgI4IAIgATYCNCACIAIoAjgoAnw2AjAgAiACKAI4KAI4IAIoAjgoAmxqNgIsIAIgAigCOCgCeDYCICACIAIoAjgoApABNgIcIAICfyACKAI4KAJsIAIoAjgoAixBhgJrSwRAIAIoAjgoAmwgAigCOCgCLEGGAmtrDAELQQALNgIYIAIgAigCOCgCQDYCFCACIAIoAjgoAjQ2AhAgAiACKAI4KAI4IAIoAjgoAmxqQYICajYCDCACIAIoAiwgAigCIEEBa2otAAA6AAsgAiACKAIsIAIoAiBqLQAAOgAKIAIoAjgoAnggAigCOCgCjAFPBEAgAiACKAIwQQJ2NgIwCyACKAIcIAIoAjgoAnRLBEAgAiACKAI4KAJ0NgIcCwNAAkAgAiACKAI4KAI4IAIoAjRqNgIoAkAgAigCKCACKAIgai0AACACLQAKRw0AIAIoAiggAigCIEEBa2otAAAgAi0AC0cNACACKAIoLQAAIAIoAiwtAABHDQAgAiACKAIoIgBBAWo2AiggAC0AASACKAIsLQABRwRADAELIAIgAigCLEECajYCLCACIAIoAihBAWo2AigDQCACIAIoAiwiAEEBajYCLCAALQABIQEgAiACKAIoIgBBAWo2AigCf0EAIAAtAAEgAUcNABogAiACKAIsIgBBAWo2AiwgAC0AASEBIAIgAigCKCIAQQFqNgIoQQAgAC0AASABRw0AGiACIAIoAiwiAEEBajYCLCAALQABIQEgAiACKAIoIgBBAWo2AihBACAALQABIAFHDQAaIAIgAigCLCIAQQFqNgIsIAAtAAEhASACIAIoAigiAEEBajYCKEEAIAAtAAEgAUcNABogAiACKAIsIgBBAWo2AiwgAC0AASEBIAIgAigCKCIAQQFqNgIoQQAgAC0AASABRw0AGiACIAIoAiwiAEEBajYCLCAALQABIQEgAiACKAIoIgBBAWo2AihBACAALQABIAFHDQAaIAIgAigCLCIAQQFqNgIsIAAtAAEhASACIAIoAigiAEEBajYCKEEAIAAtAAEgAUcNABogAiACKAIsIgBBAWo2AiwgAC0AASEBIAIgAigCKCIAQQFqNgIoQQAgAC0AASABRw0AGiACKAIsIAIoAgxJC0EBcQ0ACyACQYICIAIoAgwgAigCLGtrNgIkIAIgAigCDEH+fWo2AiwgAigCJCACKAIgSgRAIAIoAjggAigCNDYCcCACIAIoAiQ2AiAgAigCJCACKAIcTg0CIAIgAigCLCACKAIgQQFrai0AADoACyACIAIoAiwgAigCIGotAAA6AAoLCyACIAIoAhQgAigCNCACKAIQcUEBdGovAQAiATYCNEEAIQAgASACKAIYSwR/IAIgAigCMEF/aiIANgIwIABBAEcFQQALQQFxDQELCwJAIAIoAiAgAigCOCgCdE0EQCACIAIoAiA2AjwMAQsgAiACKAI4KAJ0NgI8CyACKAI8C5gQAQF/IwBBMGsiAiQAIAIgADYCKCACIAE2AiQgAgJ/IAIoAigoAgxBBWsgAigCKCgCLEsEQCACKAIoKAIsDAELIAIoAigoAgxBBWsLNgIgIAJBADYCECACIAIoAigoAgAoAgQ2AgwDQAJAIAJB//8DNgIcIAIgAigCKCgCvC1BKmpBA3U2AhQgAigCKCgCACgCECACKAIUSQ0AIAIgAigCKCgCACgCECACKAIUazYCFCACIAIoAigoAmwgAigCKCgCXGs2AhggAigCHCACKAIYIAIoAigoAgAoAgRqSwRAIAIgAigCGCACKAIoKAIAKAIEajYCHAsgAigCHCACKAIUSwRAIAIgAigCFDYCHAsCQCACKAIcIAIoAiBPDQACQCACKAIcRQRAIAIoAiRBBEcNAQsgAigCJEUNACACKAIcIAIoAhggAigCKCgCACgCBGpGDQELDAELQQAhACACIAIoAiRBBEYEfyACKAIcIAIoAhggAigCKCgCACgCBGpGBUEAC0EBcUVFNgIQIAIoAihBAEEAIAIoAhAQVyACKAIoKAIIIAIoAigoAhRBBGtqIAIoAhw6AAAgAigCKCgCCCACKAIoKAIUQQNraiACKAIcQQh2OgAAIAIoAigoAgggAigCKCgCFEECa2ogAigCHEF/czoAACACKAIoKAIIIAIoAigoAhRBAWtqIAIoAhxBf3NBCHY6AAAgAigCKCgCABAdIAIoAhgEQCACKAIYIAIoAhxLBEAgAiACKAIcNgIYCyACKAIoKAIAKAIMIAIoAigoAjggAigCKCgCXGogAigCGBAaGiACKAIoKAIAIgAgAigCGCAAKAIMajYCDCACKAIoKAIAIgAgACgCECACKAIYazYCECACKAIoKAIAIgAgAigCGCAAKAIUajYCFCACKAIoIgAgAigCGCAAKAJcajYCXCACIAIoAhwgAigCGGs2AhwLIAIoAhwEQCACKAIoKAIAIAIoAigoAgAoAgwgAigCHBBzGiACKAIoKAIAIgAgAigCHCAAKAIMajYCDCACKAIoKAIAIgAgACgCECACKAIcazYCECACKAIoKAIAIgAgAigCHCAAKAIUajYCFAsgAigCEEUNAQsLIAIgAigCDCACKAIoKAIAKAIEazYCDCACKAIMBEACQCACKAIMIAIoAigoAixPBEAgAigCKEECNgKwLSACKAIoKAI4IAIoAigoAgAoAgAgAigCKCgCLGsgAigCKCgCLBAaGiACKAIoIAIoAigoAiw2AmwMAQsgAigCKCgCPCACKAIoKAJsayACKAIMTQRAIAIoAigiACAAKAJsIAIoAigoAixrNgJsIAIoAigoAjggAigCKCgCOCACKAIoKAIsaiACKAIoKAJsEBoaIAIoAigoArAtQQJJBEAgAigCKCIAIAAoArAtQQFqNgKwLQsLIAIoAigoAjggAigCKCgCbGogAigCKCgCACgCACACKAIMayACKAIMEBoaIAIoAigiACACKAIMIAAoAmxqNgJsCyACKAIoIAIoAigoAmw2AlwgAigCKCIBAn8gAigCDCACKAIoKAIsIAIoAigoArQta0sEQCACKAIoKAIsIAIoAigoArQtawwBCyACKAIMCyABKAK0LWo2ArQtCyACKAIoKALALSACKAIoKAJsSQRAIAIoAiggAigCKCgCbDYCwC0LAkAgAigCEARAIAJBAzYCLAwBCwJAIAIoAiRFDQAgAigCJEEERg0AIAIoAigoAgAoAgQNACACKAIoKAJsIAIoAigoAlxHDQAgAkEBNgIsDAELIAIgAigCKCgCPCACKAIoKAJsa0EBazYCFAJAIAIoAigoAgAoAgQgAigCFE0NACACKAIoKAJcIAIoAigoAixIDQAgAigCKCIAIAAoAlwgAigCKCgCLGs2AlwgAigCKCIAIAAoAmwgAigCKCgCLGs2AmwgAigCKCgCOCACKAIoKAI4IAIoAigoAixqIAIoAigoAmwQGhogAigCKCgCsC1BAkkEQCACKAIoIgAgACgCsC1BAWo2ArAtCyACIAIoAigoAiwgAigCFGo2AhQLIAIoAhQgAigCKCgCACgCBEsEQCACIAIoAigoAgAoAgQ2AhQLIAIoAhQEQCACKAIoKAIAIAIoAigoAjggAigCKCgCbGogAigCFBBzGiACKAIoIgAgAigCFCAAKAJsajYCbAsgAigCKCgCwC0gAigCKCgCbEkEQCACKAIoIAIoAigoAmw2AsAtCyACIAIoAigoArwtQSpqQQN1NgIUIAICf0H//wMgAigCKCgCDCACKAIUa0H//wNLDQAaIAIoAigoAgwgAigCFGsLNgIUIAICfyACKAIUIAIoAigoAixLBEAgAigCKCgCLAwBCyACKAIUCzYCICACIAIoAigoAmwgAigCKCgCXGs2AhgCQCACKAIYIAIoAiBJBEAgAigCGEUEQCACKAIkQQRHDQILIAIoAiRFDQEgAigCKCgCACgCBA0BIAIoAhggAigCFEsNAQsgAgJ/IAIoAhggAigCFEsEQCACKAIUDAELIAIoAhgLNgIcIAICf0EAIAIoAiRBBEcNABpBACACKAIoKAIAKAIEDQAaIAIoAhwgAigCGEYLQQFxRUU2AhAgAigCKCACKAIoKAI4IAIoAigoAlxqIAIoAhwgAigCEBBXIAIoAigiACACKAIcIAAoAlxqNgJcIAIoAigoAgAQHQsgAkECQQAgAigCEBs2AiwLIAIoAiwhACACQTBqJAAgAAuyAgEBfyMAQRBrIgEkACABIAA2AggCQCABKAIIEHQEQCABQX42AgwMAQsgASABKAIIKAIcKAIENgIEIAEoAggoAhwoAggEQCABKAIIKAIoIAEoAggoAhwoAgggASgCCCgCJBEEAAsgASgCCCgCHCgCRARAIAEoAggoAiggASgCCCgCHCgCRCABKAIIKAIkEQQACyABKAIIKAIcKAJABEAgASgCCCgCKCAB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A0hCGnxBABAoQQBIBEAgAigCKEEIaiACKAIoKAIAEBggAkF/NgIsDAELIAIgAigCKCgCAEIEIAJBGGogAigCKEEIahBBIgA2AhQgAEUEQCACQX82AiwMAQsgAiACKAIUEB47ARIgAiACKAIUEB47ARAgAigCFBBIQQFxRQRAIAIoAhQQFyACKAIoQQhqQRRBABAVIAJBfzYCLAwBCyACKAIUEBcgAi8BEEEASgRAIAIoAigoAgAgAi8BEq1BARAoQQBIBEAgAigCKEEIakEEQbScASgCABAVIAJBfzYCLAwCCyACQQAgAigCKCgCACACLwEQQQAgAigCKEEIahBgNgIIIAIoAghFBEAgAkF/NgIsDAILIAIoAgggAi8BEEGAAiACQQxqIAIoAihBCGoQhAFBAXFFBEAgAigCCBAWIAJBfzYCLAwCCyACKAIIEBYgAigCDARAIAIgAigCDBCDATYCDCACKAIcKAIAKAI0IAIoAgwQhQEhACACKAIcKAIAIAA2AjQLCyACKAIcKAIAQQE6AAQCQCACKAIcKAIERQ0AIAIoAhwoAgQtAARBAXENACACKAIcKAIEIAIoAhwoAgAoAjQ2AjQgAigCHCgCBEEBOgAECyACQQA2AiwLIAIoAiwhACACQTBqJAAgAAsHACAAKAIAC4wBAQF/IwBBIGsiAiQAIAIgADYCGCACIAE2AhQgAkEANgIQAkAgAigCFEUEQCACQQA2AhwMAQsgAiACKAIUEBk2AgwgAigCDEUEQCACKAIQQQ5BABAVIAJBADYCHAwBCyACKAIMIAIoAhggAigCFBAaGiACIAIoAgw2AhwLIAIoAhwhACACQSBqJAAgAAsYAEGonAFCADcCAEGwnAFBADYCAEGonAELiAEBAX8jAEEgayIDJAAgAyAANgIUIAMgATYCECADIAI3AwgCQAJAIAMoAhQoAiRBAUYEQCADKQMIQv///////////wBYDQELIAMoAhRBDGpBEkEAEBUgA0J/NwMYDAELIAMgAygCFCADKAIQIAMpAwhBCxAiNwMYCyADKQMYIQIgA0EgaiQAIAILcwEBfyMAQSBrIgEkACABIAA2AhggAUIINwMQIAEgASgCGCkDECABKQMQfDcDCAJAIAEpAwggASgCGCkDEFQEQCABKAIYQQA6AAAgAUF/NgIcDAELIAEgASgCGCAB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IAIgADYCSCACIAE2AkQgAkEIaiIAEDwCQCACKAJIIAAQOQRAIwBBEGsiACACKAJINgIMIAIgACgCDEEMajYCBCMAQRBrIgAgAigCBDYCDAJAIAAoAgwoAgBBBUcNACMAQRBrIgAgAigCBDYCDCAAKAIMKAIEQSxHDQAgAkEANgJMDAILIAIoAkQgAigCBBBEIAJBfzYCTAwBCyACQQE2AkwLIAIoAkwhACACQdAAaiQAIAAL6gEBAX8jAEEwayIDJAAgAyAANgIoIAMgATYCJCADIAI2AiAjAEEQayIAIANBCGoiATYCDCAAKAIMQQA2AgAgACgCDEEANgIEIAAoAgxBADYCCCADIAMoAiggARD7ASIANgIYAkAgAEUEQCADKAIgIANBCGoiABCTASAAEDggA0EANgIsDAELIAMgAygCGCADKAIkIANBCGoQkgEiADYCHCAARQRAIAMoAhgQHCADKAIgIANBCGoiABCTASAAEDggA0EANgIsDAELIANBCGoQOCADIAMoAhw2AiwLIAMoAiwhACADQTBqJAAgAAvIAgEBfyMAQRBrIgEkACABIAA2AgggAUHYABAZNgIEAkAgASgCBEUEQCABKAIIQQ5BABAVIAFBADYCDAwBCyABKAIIEIEDIQAgASgCBCAANgJQIABFBEAgASgCBBAWIAFBADYCDAwBCyABKAIEQQA2AgAgASgCBEEANgIEIwBBEGsiACABKAIEQQhqNgIMIAAoAgxBADYCACAAKAIMQQA2AgQgACgCDEEANgIIIAEoAgRBADYCGCABKAIEQQA2AhQgASgCBEEANgIcIAEoAgRBADYCJCABKAIEQQA2AiAgASgCBEEAOgAoIAEoAgRCADcDOCABKAIEQgA3AzAgASgCBEEANgJAIAEoAgRBADYCSCABKAIEQQA2AkQgASgCBEEANgJMIAEoAgRBADYCVCABIAEoAgQ2AgwLIAEoAgwhACABQRBqJAAgAAuBAQEBfyMAQSBrIgIkACACIAA2AhggAkIANwMQIAJCfzcDCCACIAE2AgQCQAJAIAIoAhgEQCACKQMIQn9ZDQELIAIoAgRBEkEAEBUgAkEANgIcDAELIAIgAigCGCACKQMQIAIpAwggAigCBBD/ATYCHAsgAigCHCEAIAJBIGokACAAC80BAQJ/IwBBIGsiASQAIAEgADYCGCAB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CyAAIAFBf2oiAWoiAi0AAEEvRw0ACyACC6kBAQN/AkAgAC0AACICRQ0AA0AgAS0AACIERQRAIAIhAwwCCwJAIAIgBEYNACACQSByIAIgAkG/f2pBGkkbIAEtAAAiAkEgciACIAJBv39qQRpJG0YNACAALQAAIQMMAgsgAUEBaiEBIAAtAAEhAiAAQQFqIQAgAg0ACwsgA0H/AXEiAEEgciAAIABBv39qQRpJGyABLQAAIgBBIHIgACAAQb9/akEaSRtrC+gDAQN/IwBBsAFrIgEkACABIAA2AqgBIAEoAqgBEDgCQAJAIAEoAqgBKAIAQQBOBEAgASgCqAEoAgBBoA4oAgBIDQELIAEgASgCqAEoAgA2AhAgAUEgakG8lwEgAUEQahBvIAFBADYCpAEgASABQSBqNgKgAQwBCyABIAEoAqgBKAIAQQJ0QaANaigCADYCpAECQAJAAkACQCABKAKoASgCAEECdEGwDmooAgBBf2oOAgABAgsgASABKAKoASgCBEGQmgEoAgAQpAI2AqABDAILIwBBEGsiACABKAKoASgCBDYCDCABQQAgACgCDGtBAnRB2NQAaigCADYCoAEMAQsgAUEANgKgAQsLAkAgASgCoAFFBEAgASABKAKkATYCrAEMAQsgASABKAKgARAsAn8gASgCpAEEQCABKAKkARAsQQJqDAELQQALakEBahAZIgA2AhwgAEUEQCABQdgNKAIANgKsAQwBCyABKAIcIQACfyABKAKkAQRAIAEoAqQBDAELQdSXAQshAkHVlwFB1JcBIAEoAqQBGyEDIAEgASgCoAE2AgggASADNgIEIAEgAjYCACAAQc2XASABEG8gASgCqAEgASgCHDYCCCABIAEoAhw2AqwBCyABKAKsASEAIAFBsAFqJAAgAAtxAQN/AkACQANAIAAgAkHQiAFqLQAARwRAQdcAIQMgAkEBaiICQdcARw0BDAILCyACIgMNAEGwiQEhAAwBC0GwiQEhAgNAIAItAAAhBCACQQFqIgAhAiAEDQAgACECIANBf2oiAw0ACwsgASgCFBogAAszAQF/IAAoAhQiAyABIAIgACgCECADayIBIAEgAksbIgEQGhogACAAKAIUIAFqNgIUIAILigEBAn8jAEGgAWsiAyQAIANBCGpBuIcBQZABEBoaIAMgADYCNCADIAA2AhwgA0F+IABrIgRB/////wdB/////wcgBEsbIgQ2AjggAyAAIARqIgA2AiQgAyAANgIYIANBCGogASACEKsCIAQEQCADKAIcIgAgACADKAIYRmtBADoAAAsgA0GgAWokAAspACABIAEoAgBBD2pBcHEiAUEQajYCACAAIAEpAwAgASkDCBCxAjkDAAuKFwMSfwJ+AXwjAEGwBGsiCSQAIAlBADYCLAJ/IAG9IhhCf1cEQEEBIRIgAZoiAb0hGEGQhwEMAQtBASESQZOHASAEQYAQcQ0AGkGWhwEgBEEBcQ0AGkEAIRJBASETQZGHAQshFQJAIBhCgICAgICAgPj/AINCgICAgICAgPj/AFEEQCAAQSAgAiASQQNqIg0gBEH//3txECcgACAVIBIQIyAAQauHAUGvhwEgBUEgcSIDG0GjhwFBp4cBIAMbIAEgAWIbQQMQIwwBCyAJQRBqIRACQAJ/AkAgASAJQSxqEKQBIgEgAaAiAUQAAAAAAAAAAGIEQCAJIAkoAiwiBkF/ajYCLCAFQSByIhZB4QBHDQEMAwsgBUEgciIWQeEARg0CIAkoAiwhC0EGIAMgA0EASBsMAQsgCSAGQWNqIgs2AiwgAUQAAAAAAACwQaIhAUEGIAMgA0EASBsLIQogCUEwaiAJQdACaiALQQBIGyIPIQgDQCAIAn8gAUQAAAAAAADwQWMgAUQAAAAAAAAAAGZxBEAgAasMAQtBAAsiAzYCACAIQQRqIQggASADuKFEAAAAAGXNzUGiIgFEAAAAAAAAAABiDQALAkAgC0EBSARAIAshAyAIIQYgDyEHDAELIA8hByALIQMDQCADQR0gA0EdSBshDAJAIAhBfGoiBiAHSQ0AIAytIRlCACEYA0AgBiAYQv////8PgyAGNQIAIBmGfCIYIBhCgJTr3AOAIhhCgJTr3AN+fT4CACAGQXxqIgYgB08NAAsgGKciA0UNACAHQXxqIgcgAzYCAAsDQCAIIgYgB0sEQCAGQXxqIggoAgBFDQELCyAJIAkoAiwgDGsiAzYCLCAGIQggA0EASg0ACwsgA0F/TARAIApBGWpBCW1BAWohESAWQeYARiENA0BBCUEAIANrIANBd0gbIRcCQCAHIAZPBEAgByAHQQRqIAcoAgAbIQcMAQtBgJTr3AMgF3YhFEF/IBd0QX9zIQ5BACEDIAchCANAIAggAyAIKAIAIgwgF3ZqNgIAIAwgDnEgFGwhAyAIQQRqIgggBkkNAAsgByAHQQRqIAcoAgAbIQcgA0UNACAGIAM2AgAgBkEEaiEGCyAJIAkoAiwgF2oiAzYCLCAPIAcgDRsiCCARQQJ0aiAGIAYgCGtBAnUgEUobIQYgA0EASA0ACwtBACEIAkAgByAGTw0AIA8gB2tBAnVBCWwhCEEKIQMgBygCACIMQQpJDQADQCAIQQFqIQggDCADQQpsIgNPDQALCyAKQQAgCCAWQeYARhtrIBZB5wBGIApBAEdxayIDIAYgD2tBAnVBCWxBd2pIBEAgA0GAyABqIg5BCW0iDEECdCAJQTBqQQRyIAlB1AJqIAtBAEgbakGAYGohDUEKIQMgDiAMQQlsayIOQQdMBEADQCADQQpsIQMgDkEBaiIOQQhHDQALCwJAQQAgBiANQQRqIhFGIA0oAgAiDiAOIANuIgwgA2xrIhQbDQBEAAAAAAAA4D9EAAAAAAAA8D9EAAAAAAAA+D8gFCADQQF2IgtGG0QAAAAAAAD4PyAGIBFGGyAUIAtJGyEaRAEAAAAAAEBDRAAAAAAAAEBDIAxBAXEbIQECQCATDQAgFS0AAEEtRw0AIBqaIRogAZohAQsgDSAOIBRrIgs2AgAgASAaoCABYQ0AIA0gAyALaiIDNgIAIANBgJTr3ANPBEADQCANQQA2AgAgDUF8aiINIAdJBEAgB0F8aiIHQQA2AgALIA0gDSgCAEEBaiIDNgIAIANB/5Pr3ANLDQALCyAPIAdrQQJ1QQlsIQhBCiEDIAcoAgAiC0EKSQ0AA0AgCEEBaiEIIAsgA0EKbCIDTw0ACwsgDUEEaiIDIAYgBiADSxshBgsDQCAGIgsgB00iDEUEQCALQXxqIgYoAgBFDQELCwJAIBZB5wBHBEAgBEEIcSETDAELIAhBf3NBfyAKQQEgChsiBiAISiAIQXtKcSIDGyAGaiEKQX9BfiADGyAFaiEFIARBCHEiEw0AQXchBgJAIAwNACALQXxqKAIAIgxFDQBBCiEOQQAhBiAMQQpwDQADQCAGIgNBAWohBiAMIA5BCmwiDnBFDQALIANBf3MhBgsgCyAPa0ECdUEJbCEDIAVBX3FBxgBGBEBBACETIAogAyAGakF3aiIDQQAgA0EAShsiAyAKIANIGyEKDAELQQAhEyAKIAMgCGogBmpBd2oiA0EAIANBAEobIgMgCiADSBshCgsgCiATciIUQQBHIQ4gAEEgIAICfyAIQQAgCEEAShsgBUFfcSIMQcYARg0AGiAQIAggCEEfdSIDaiADc60gEBBDIgZrQQFMBEADQCAGQX9qIgZBMDoAACAQIAZrQQJIDQALCyAGQX5qIhEgBToAACAGQX9qQS1BKyAIQQBIGzoAACAQIBFrCyAKIBJqIA5qakEBaiINIAQQJyAAIBUgEhAjIABBMCACIA0gBEGAgARzECcCQAJAAkAgDEHGAEYEQCAJQRBqQQhyIQMgCUEQakEJciEIIA8gByAHIA9LGyIFIQcDQCAHNQIAIAgQQyEGAkAgBSAHRwRAIAYgCUEQak0NAQNAIAZBf2oiBkEwOgAAIAYgCUEQaksNAAsMAQsgBiAIRw0AIAlBMDoAGCADIQYLIAAgBiAIIAZrECMgB0EEaiIHIA9NDQALIBQEQCAAQbOHAUEBECMLIAcgC08NASAKQQFIDQEDQCAHNQIAIAgQQyIGIAlBEGpLBEADQCAGQX9qIgZBMDoAACAGIAlBEGpLDQALCyAAIAYgCkEJIApBCUgbECMgCkF3aiEGIAdBBGoiByALTw0DIApBCUohAyAGIQogAw0ACwwCCwJAIApBAEgNACALIAdBBGogCyAHSxshBSAJQRBqQQhyIQMgCUEQakEJciELIAchCANAIAsgCDUCACALEEMiBkYEQCAJQTA6ABggAyEGCwJAIAcgCEcEQCAGIAlBEGpNDQEDQCAGQX9qIgZBMDoAACAGIAlBEGpLDQALDAELIAAgBkEBECMgBkEBaiEGIBNFQQAgCkEBSBsNACAAQbOHAUEBECMLIAAgBiALIAZrIgYgCiAKIAZKGxAjIAogBmshCiAIQQRqIgggBU8NASAKQX9KDQALCyAAQTAgCkESakESQQAQJyAAIBEgECARaxAjDAILIAohBgsgAEEwIAZBCWpBCUEAECcLDAELIBVBCWogFSAFQSBxIgsbIQoCQCADQQtLDQBBDCADayIGRQ0ARAAAAAAAACBAIRoDQCAaRAAAAAAAADBAoiEaIAZBf2oiBg0ACyAKLQAAQS1GBEAgGiABmiAaoaCaIQEMAQsgASAaoCAaoSEBCyAQIAkoAiwiBiAGQR91IgZqIAZzrSAQEEMiBkYEQCAJQTA6AA8gCUEPaiEGCyASQQJyIQ8gCSgCLCEIIAZBfmoiDCAFQQ9qOgAAIAZBf2pBLUErIAhBAEgbOgAAIARBCHEhCCAJQRBqIQcDQCAHIgUCfyABmUQAAAAAAADgQWMEQCABqgwBC0GAgICAeAsiBkGAhwFqLQAAIAtyOgAAIAEgBrehRAAAAAAAADBAoiEBAkAgBUEBaiIHIAlBEGprQQFHDQACQCAIDQAgA0EASg0AIAFEAAAAAAAAAABhDQELIAVBLjoAASAFQQJqIQcLIAFEAAAAAAAAAABiDQALIABBICACIA8CfwJAIANFDQAgByAJa0FuaiADTg0AIAMgEGogDGtBAmoMAQsgECAJQRBqayAMayAHagsiA2oiDSAEECcgACAKIA8QIyAAQTAgAiANIARBgIAEcxAnIAAgCUEQaiAHIAlBEGprIgUQIyAAQTAgAyAFIBAgDGsiA2prQQBBABAnIAAgDCADECMLIABBICACIA0gBEGAwABzECcgCUGwBGokACACIA0gDSACSBsLLQAgAFBFBEADQCABQX9qIgEgAKdBB3FBMHI6AAAgAEIDiCIAQgBSDQALCyABCzUAIABQRQRAA0AgAUF/aiIBIACnQQ9xQYCHAWotAAAgAnI6AAAgAEIEiCIAQgBSDQALCyABC8sCAQN/IwBB0AFrIgMkACADIAI2AswBQQAhAiADQaABakEAQSgQMyADIAMoAswBNgLIAQJAQQAgASADQcgBaiADQdAAaiADQaABahBwQQBIDQAgACgCTEEATgRAQQEhAgsgACgCACEEIAAsAEpBAEwEQCAAIARBX3E2AgALIARBIHEhBQJ/IAAoAjAEQCAAIAEgA0HIAWogA0HQAGogA0GgAWoQcAwBCyAAQdAANgIwIAAgA0HQAGo2AhAgACADNgIcIAAgAzYCFCAAKAIsIQQgACADNgIsIAAgASADQcgBaiADQdAAaiADQaABahBwIARFDQAaIABBAEEAIAAoAiQRAQAaIABBADYCMCAAIAQ2AiwgAEEANgIcIABBADYCECAAKAIUGiAAQQA2AhRBAAsaIAAgACgCACAFcjYCACACRQ0ACyADQdABaiQACy8AIAECfyACKAJMQX9MBEAgACABIAIQcQwBCyAAIAEgAhBxCyIARgRAIAEPCyAAC1kBAX8gACAALQBKIgFBf2ogAXI6AEogACgCACIBQQhxBEAgACABQSByNgIAQX8PCyAAQgA3AgQgACAAKAIsIgE2AhwgACABNgIUIAAgASAAKAIwajYCEEEACwYAQaShAQsGAEGgoQELBgBBmKEBC9kDAgJ/An4jAEEgayICJAACQCABQv///////////wCDIgVCgICAgICAwP9DfCAFQoCAgICAgMCAvH98VARAIAFCBIYgAEI8iIQhBCAAQv//////////D4MiAEKBgICAgICAgAhaBEAgBEKBgICAgICAgMAAfCEEDAILIARCgICAgICAgIBAfSEEIABCgICAgICAgIAIhUIAUg0BIARCAYMgBHwhBAwBCyAAUCAFQoCAgICAgMD//wBUIAVCgICAgICAwP//AFEbRQRAIAFCBIYgAEI8iIRC/////////wODQoCAgICAgID8/wCEIQQMAQtCgICAgICAgPj/ACEEIAVC////////v//DAFYNAEIAIQQgBUIwiKciA0GR9wBJDQAgAkEQaiAAIAFC////////P4NCgICAgICAwACEIgQgA0H/iH9qELMCIAIgACAEQYH4ACADaxCyAiACKQMIQgSGIAIpAwAiAEI8iIQhBCACKQMQIAIpAxiEQgBSrSAAQv//////////D4OEIgBCgYCAgICAgIAIWgRAIARCAXwhBAwBCyAAQoCAgICAgICACIVCAFINACAEQgGDIAR8IQQLIAJBIGokACAEIAFCgICAgICAgICAf4OEvwtQAQF+AkAgA0HAAHEEQCACIANBQGqtiCEBQgAhAgwBCyADRQ0AIAJBwAAgA2uthiABIAOtIgSIhCEBIAIgBIghAgsgACABNwMAIAAgAjcDCAtQAQF+AkAgA0HAAHEEQCABIANBQGqthiECQgAhAQwBCyADRQ0AIAIgA60iBIYgAUHAACADa62IhCECIAEgBIYhAQsgACABNwMAIAAgAjcDCAuLAgACQCAABH8gAUH/AE0NAQJAQZCaASgCACgCAEUEQCABQYB/cUGAvwNGDQMMAQsgAUH/D00EQCAAIAFBP3FBgAFyOgABIAAgAUEGdkHAAXI6AABBAg8LIAFBgLADT0EAIAFBgEBxQYDAA0cbRQRAIAAgAUE/cUGAAXI6AAIgACABQQx2QeABcjoAACAAIAFBBnZBP3FBgAFyOgABQQMPCyABQYCAfGpB//8/TQRAIAAgAUE/cUGAAXI6AAMgACABQRJ2QfABcjoAACAAIAFBBnZBP3FBgAFyOgACIAAgAUEMdkE/cUGAAXI6AAFBBA8LC0G0nAFBGTYCAEF/BUEBCw8LIAAgAToAAEEBC74CAQF/IwBBwMAAayIDJAAgAyAANgK4QCADIAE2ArRAIAMgAjcDqEACQCADKAK0QBBJQQBIBEAgAygCuEBBCGogAygCtEAQGCADQX82ArxADAELIANBADYCDCADQgA3AxADQAJAIAMgAygCtEAgA0EgakKAwAAQLyICNwMYIAJCAFcNACADKAK4QCADQSBqIAMpAxgQNkEASARAIANBfzYCDAUgAykDGEKAwABSDQIgAygCuEAoAlRFDQIgAykDqEBCAFcNAiADIAMpAxggAykDEHw3AxAgAygCuEAoAlQgAykDELkgAykDqEC5oxBYDAILCwsgAykDGEIAUwRAIAMoArhAQQhqIAMoArRAEBggA0F/NgIMCyADKAK0QBAyGiADIAMoAgw2ArxACyADKAK8QCEAIANBwMAAaiQAIAALqgEBAX8jAEEwayIDJAAgAyAANgIoIAMgATYCJCADIAI3AxggAyADKAIoKAIAEDUiAjcDEAJAIAJCAFMEQCADQX82AiwMAQsgAyADKAIoIAMoAiQgAykDGBCQAyICNwMAIAJCAFMEQCADQX82AiwMAQsgAyADKAIoKAIAEDUiAjcDCCACQgBTBEAgA0F/NgIsDAELIANBADYCLAsgAygCLCEAIANBMGokACAAC/4BAQF/IwBBoMAAayICJAAgAiAANgKYQCACIAE3A5BAIAIgAikDkEC6OQMAAkADQCACKQOQQEIAVgRAIAICfkKAwAAgAikDkEBCgMAAVg0AGiACKQOQQAs+AgwgAigCmEAoAgAgAkEQaiACKAIMrSACKAKYQEEIahBhQQBIBEAgAkF/NgKcQAwDCyACKAKYQCACQRBqIAIoAgytEDZBAEgEQCACQX82ApxADAMFIAIgAikDkEAgAjUCDH03A5BAIAIoAphAKAJUIAIrAwAgAikDkEC6oSACKwMAoxBYDAILAAsLIAJBADYCnEALIAIoApxAIQAgAkGgwABqJAAgAAvnEQIBfwF+IwBBoAFrIgMkACADIAA2ApgBIAMgATYClAEgAyACNgKQAQJAIAMoApQBIANBOGoQOUEASARAIAMoApgBQQhqIAMoApQBEBggA0F/NgKcAQwBCyADKQM4QsAAg1AEQCADIAMpAzhCwACENwM4IANBADsBaAsCQAJAIAMoApABKAIQQX9HBEAgAygCkAEoAhBBfkcNAQsgAy8BaEUNACADKAKQASADLwFoNgIQDAELAkACQCADKAKQASgCEA0AIAMpAzhCBINQDQAgAyADKQM4QgiENwM4IAMgAykDUDcDWAwBCyADIAMpAzhC9////w+DNwM4CwsgAykDOEKAAYNQBEAgAyADKQM4QoABhDcDOCADQQA7AWoLIANBgAI2AiQCQCADKQM4QgSDUARAIAMgAygCJEGACHI2AiQgA0J/NwNwDAELIAMoApABIAMpA1A3AyggAyADKQNQNwNwAkAgAykDOEIIg1AEQAJAAkACQAJAAkACfwJAIAMoApABKAIQQX9HBEAgAygCkAEoAhBBfkcNAQtBCAwBCyADKAKQASgCEAtB//8DcQ4NAgMDAwMDAwMBAwMDAAMLIANClMLk8w83AxAMAwsgA0KDg7D/DzcDEAwCCyADQv////8PNwMQDAELIANCADcDEAsgAykDUCADKQMQVgRAIAMgAygCJEGACHI2AiQLDAELIAMoApABIAMpA1g3AyALCyADIAMoApgBKAIAEDUiBDcDiAEgBEIAUwRAIAMoApgBQQhqIAMoApgBKAIAEBggA0F/NgKcAQwBCyADKAKQASIAIAAvAQxB9/8DcTsBDCADIAMoApgBIAMoApABIAMoAiQQXiIANgIoIABBAEgEQCADQX82ApwBDAELIAMgAy8BaAJ/AkAgAygCkAEoAhBBf0cEQCADKAKQASgCEEF+Rw0BC0EIDAELIAMoApABKAIQC0H//wNxRzoAIiADIAMtACJBAXEEfyADLwFoQQBHBUEAC0EBcToAISADIAMvAWgEfyADLQAhBUEBC0EBcToAICADIAMtACJBAXEEfyADKAKQASgCEEEARwVBAAtBAXE6AB8gAwJ/QQEgAy0AIkEBcQ0AGkEBIAMoApABKAIAQYABcQ0AGiADKAKQAS8BUiADLwFqRwtBAXE6AB4gAyADLQAeQQFxBH8gAy8BakEARwVBAAtBAXE6AB0gAyADLQAeQQFxBH8gAygCkAEvAVJBAEcFQQALQQFxOgAcIAMgAygClAE2AjQjAEEQayIAIAMoAjQ2AgwgACgCDCIAIAAoAjBBAWo2AjAgAy0AHUEBcQRAIAMgAy8BakEAEHciADYCDCAARQRAIAMoApgBQQhqQRhBABAVIAMoAjQQHCADQX82ApwBDAILIAMgAygCmAEgAygCNCADLwFqQQAgAygCmAEoAhwgAygCDBEGACIANgIwIABFBEAgAygCNBAcIANBfzYCnAEMAgsgAygCNBAcIAMgAygCMDYCNAsgAy0AIUEBcQRAIAMgAygCmAEgAygCNCADLwFoEKsBIgA2AjAgAEUEQCADKAI0EBwgA0F/NgKcAQwCCyADKAI0EBwgAyADKAIwNgI0CyADLQAgQQFxBEAgAyADKAKYASADKAI0QQAQqgEiADYCMCAARQRAIAMoAjQQHCADQX82ApwBDAILIAMoAjQQHCADIAMoAjA2AjQLIAMtAB9BAXEEQCADIAMoApgBIAMoAjQgAygCkAEoAhAgAygCkAEvAVAQwgIiADYCMCAARQRAIAMoAjQQHCADQX82ApwBDAILIAMoAjQQHCADIAMoAjA2AjQLIAMtABxBAXEEQCADQQA2AgQCQCADKAKQASgCVARAIAMgAygCkAEoAlQ2AgQMAQsgAygCmAEoAhwEQCADIAMoApgBKAIcNgIECwsgAyADKAKQAS8BUkEBEHciADYCCCAARQRAIAMoApgBQQhqQRhBABAVIAMoAjQQHCADQX82ApwBDAILIAMgAygCmAEgAygCNCADKAKQAS8BUkEBIAMoAgQgAygCCBEGACIANgIwIABFBEAgAygCNBAcIANBfzYCnAEMAgsgAygCNBAcIAMgAygCMDYCNAsgAyADKAKYASgCABA1IgQ3A4ABIARCAFMEQCADKAKYAUEIaiADKAKYASgCABAYIANBfzYCnAEMAQsgAyADKAKYASADKAI0IAMpA3AQtQI2AiwgAygCNCADQThqEDlBAEgEQCADKAKYAUEIaiADKAI0EBggA0F/NgIsCyADIAMoAjQQuwIiADoAIyAAQRh0QRh1QQBIBEAgAygCmAFBCGogAygCNBAYIANBfzYCLAsgAygCNBAcIAMoAixBAEgEQCADQX82ApwBDAELIAMgAygCmAEoAgAQNSIENwN4IARCAFMEQCADKAKYAUEIaiADKAKYASgCABAYIANBfzYCnAEMAQsgAygCmAEoAgAgAykDiAEQqAFBAEgEQCADKAKYAUEIaiADKAKYASgCABAYIANBfzYCnAEMAQsgAykDOELkAINC5ABSBEAgAygCmAFBCGpBFEEAEBUgA0F/NgKcAQwBCyADKAKQASgCAEEgcUUEQAJAIAMpAzhCEINCAFIEQCADKAKQASADKAJgNgIUDAELIAMoApABQRRqEAEaCwsgAygCkAEgAy8BaDYCECADKAKQASADKAJkNgIYIAMoApABIAMpA1A3AyggAygCkAEgAykDeCADKQOAAX03AyAgAygCkAEgAygCkAEvAQxB+f8DcSADLQAjQQF0cjsBDCADKAKQASADKAIkQYAIcUEARxCKAyADIAMoApgBIAMoApABIAMoAiQQXiIANgIsIABBAEgEQCADQX82ApwBDAELIAMoAiggAygCLEcEQCADKAKYAUEIakEUQQAQFSADQX82ApwBDAELIAMoApgBKAIAIAMpA3gQqAFBAEgEQCADKAKYAUEIaiADKAKYASgCABAYIANBfzYCnAEMAQsgA0EANgKcAQsgAygCnAEhACADQaABaiQAIAALrwIBAX8jAEEgayICIAA2AhwgAiABNgIYIAJBADYCFCACQgA3AwACQCACKAIcLQAoQQFxRQRAIAIoAhwoAhggAigCHCgCFEYNAQsgAkEBNgIUCyACQgA3AwgDQCACKQMIIAIoAhwpAzBUBEACQAJAIAIoAhwoAkAgAikDCKdBBHRqKAIIDQAgAigCHCgCQCACKQMIp0EEdGotAAxBAXENACACKAIcKAJAIAIpAwinQQR0aigCBEUNASACKAIcKAJAIAIpAwinQQR0aigCBCgCAEUNAQsgAkEBNgIUCyACKAIcKAJAIAIpAwinQQR0ai0ADEEBcUUEQCACIAIpAwBCAXw3AwALIAIgAikDCEIBfDcDCAwBCwsgAigCGARAIAIoAhggAikDADcDAAsgAigCFAuMEAMCfwF+AXwjAEHgAGsiASQAIAEgADYCWAJAIAEoAlhFBEAgAUF/NgJcDAELIAEgASgCWCABQUBrELkCNgIkIAEpA0BQBEACQCABKAJYKAIEQQhxRQRAIAEoAiRFDQELIAEoAlgoAgAQhAJBAEgEQAJAAn8jAEEQayICIAEoAlgoAgA2AgwjAEEQayIAIAIoAgxBDGo2AgwgACgCDCgCAEEWRgsEQCMAQRBrIgIgASgC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NgI8IAEoAlAgASgCODYCQCABKAJYIAEoAjAQ1gIgASABKAJYKAIMNgJIIAEgASgCWCgCEDYCQCABIAEoAlgoAgA2AkwgASABKAJYKAIENgJEIAEgASgCUCgCPDYCPCABIAEoAlAoAkA2AjggASgCUCgCBEG//gBGBEAgASgCUEF/NgLINwsMDQsgASgCUEEANgLINwNAAkAgASABKAJQKAJQIAEoAjxBASABKAJQKAJYdEEBa3FBAnRqKAEANgEgIAEtACEgASgCOE0NACABKAJERQ0NIAEgASgCREF/ajYCRCABIAEoAkwiAEEBajYCTCABIAEoAjwgAC0AACABKAI4dGo2AjwgASABKAI4QQhqNgI4DAELCwJAIAEtACBFDQAgAS0AIEHwAXENACABIAEoASA2ARgDQAJAIAEgASgCUCgCUCABLwEaIAEoAjxBASABLQAZIAEtABhqdEEBa3EgAS0AGXZqQQJ0aigBADYBICABLQAZIAEtACFqIAEoAjhNDQAgASgCREUNDiABIAEoAkRBf2o2AkQgASABKAJMIgBBAWo2AkwgASABKAI8IAAtAAAgASgCOHRqNgI8IAEgASgCOEEIajYCOAwBCwsgASABKAI8IAEtABl2NgI8IAEgASgCOCABLQAZazYCOCABKAJQIgAgAS0AGSAAKALIN2o2Asg3CyABIAEoAjwgAS0AIXY2AjwgASABKAI4IAEtACFrNgI4IAEoAlAiACABLQAhIAAoAsg3ajYCyDcgASgCUCABLwEiNgJEIAEtACBFBEAgASgCUEHN/gA2AgQMDQsgAS0AIEEgcQRAIAEoAlBBfzYCyDcgASgCUEG//gA2AgQMDQsgAS0AIEHAAHEEQCABKAJYQYfxADYCGCABKAJQQdH+ADYCBAwNCyABKAJQIAEtACBBD3E2AkwgASgCUEHJ/gA2AgQLIAEoAlAoAkwEQANAIAEoAjggASgCUCgCTEkEQCABKAJERQ0NIAEgASgCREF/ajYCRCABIAEoAkwiAEEBajYCTCABIAEoAjwgAC0AACABKAI4dGo2AjwgASABKAI4QQhqNgI4DAELCyABKAJQIgAgACgCRCABKAI8QQEgASgCUCgCTHRBAWtxajYCRCABIAEoAjwgASgCUCgCTHY2AjwgASABKAI4IAEoAlAoAkxrNgI4IAEoAlAiACAB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KAIMSQRAIAIgAigCUCIAQQFqNgJQIAIgAigCLCAALQAAIAIoAih0ajYCLCACIAIoAihBCGo2AiggAigCKCACKAIMSQRAIAIgAigCUCIAQQFqNgJQIAIgAigCLCAALQAAIAIoAih0ajYCLCACIAIoAihBCGo2AigLCyACIAIoAgQgAigCLEEBIAIoAgx0QQFrcWo2AgQgAiACKAIsIAIoAgx2NgIsIAIgAigCKCACKAIMazYCKCACIAIoAkggAigCRGs2AgwCQCACKAIEIAIoAgxLBEAgAiACKAIEIAIoAgxrNgIMIAIoAgwgAigCOEsEQCACKAJUKALENwRAIAIoAlxBsO0ANgIYIAIoAlRB0f4ANgIEDAoLCyACIAIoAjA2AgACQCACKAI0RQRAIAIgAigCACACKAI8IAIoAgxrajYCACACKAIMIAIoAghJBEAgAiACKAIIIAIoAgxrNgIIA0AgAiACKAIAIgBBAWo2AgAgAC0AACEAIAIgAigCSCIBQQFqNgJIIAEgADoAACACIAIoAgxBf2oiADYCDCAADQALIAIgAigCSCACKAIEazYCAAsMAQsCQCACKAI0IAIoAgxJBEAgAiACKAIAIAIoAjwgAigCNGogAigCDGtqNgIAIAIgAigCDCACKAI0azYCDCACKAIMIAIoAghJBEAgAiACKAIIIAIoAgxrNgIIA0AgAiACKAIAIgBBAWo2AgAgAC0AACEAIAIgAigCSCIBQQFqNgJIIAEgADoAACACIAIoAgxBf2oiADYCDCAADQALIAIgAigCMDYCACACKAI0IAIoAghJBEAgAiACKAI0NgIMIAIgAigCCCACKAIMazYCCANAIAIgAigCACIAQQFqNgIAIAAtAAAhACACIAIoAkgiAUEBajYCSCABIAA6AAAgAiACKAIMQX9qIgA2AgwgAA0ACyACIAIoAkggAigCBGs2AgALCwwBCyACIAIoAgAgAigCNCACKAIMa2o2AgAgAigCDCACKAIISQRAIAIgAigCCCACKAIMazYCCANAIAIgAigCACIAQQFqNgIAIAAtAAAhACACIAIoAkgiAUEBajYCSCABIAA6AAAgAiACKAIMQX9qIgA2AgwgAA0ACyACIAIoAkggAigCBGs2AgALCwsDQCACKAIIQQJNRQRAIAIgAigCACIAQQFqNgIAIAAtAAAhACACIAIoAkgiAUEBajYCSCABIAA6AAAgAiACKAIAIgBBAWo2AgAgAC0AACEAIAIgAigCSCIBQQFqNgJIIAEgADoAACACIAIoAgAiAEEBajYCACAALQAAIQAgAiACKAJIIgFBAWo2AkggASAAOgAAIAIgAigCCEEDazYCCAwBCwsMAQsgAiACKAJIIAIoAgRrNgIAA0AgAiACKAIAIgBBAWo2AgAgAC0AACEAIAIgAigCSCIBQQFqNgJIIAEgADoAACACIAIoAgAiAEEBajYCACAALQAAIQAgAiACKAJIIgFBAWo2AkggASAAOgAAIAIgAigCACIAQQFqNgIAIAAtAAAhACACIAIoAkgiAUEBajYCSCABIAA6AAAgAiACKAIIQQNrNgIIIAIoAghBAksNAAsLIAIoAggEQCACIAIoAgAiAEEBajYCACAALQAAIQAgAiACKAJIIgFBAWo2AkggASAAOgAAIAIoAghBAUsEQCACIAIoAgAiAEEBajYCACAALQAAIQAgAiACKAJIIgFBAWo2AkggASAAOgAACwsMAgsgAigCDEHAAHFFBEAgAkEQaiACKAIgIAIvARIgAigCLEEBIAIoAgx0QQFrcWpBAnRqKAEANgEADAELCyACKAJcQc7tADYCGCACKAJUQdH+ADYCBAwECwwCCyACKAIMQcAAcUUEQCACQRBqIAIoAiQgAi8BEiACKAIsQQEgAigCDHRBAWtxakECdGooAQA2AQAMAQsLIAIoAgxBIHEEQCACKAJUQb/+ADYCBAwCCyACKAJcQeTtADYCGCACKAJUQdH+ADYCBAwBC0EAIQAgAigCUCACKAJMSQR/IAIoAkggAigCQEkFQQALQQFxDQELCyACIAIoAihBA3Y2AgggAiACKAJQIAIoAghrNgJQIAIgAigCKCACKAIIQQN0azYCKCACIAIoAixBASACKAIodEEBa3E2AiwgAigCXCACKAJQNgIAIAIoAlwgAigCSDYCDCACKAJcAn8gAigCUCACKAJMSQRAIAIoAkwgAigCUGtBBWoMAQtBBSACKAJQIAIoAkxraws2AgQgAigCXAJ/IAIoAkggAigCQEkEQCACKAJAIAIoAkhrQYECagwBC0GBAiACKAJIIAIoAkBraws2AhAgAigCVCACKAIsNgI8IAIoAlQgAigCKDYCQAvBEAECfyMAQSBrIgIk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LSAAKAKgLUEBdGogAi8BEDsBACACLQATIQEgAigCKCIAKAKYLSEDIAAgACgCoC0iAEEBajYCoC0gACADaiABOgAAIAIgAi8BEEF/ajsBECACKAIoIAItABNBgNkAai0AAEECdGpBmAlqIgAgAC8BAEEBajsBACACKAIoQYgTagJ/IAIvARBBgAJIBEAgAi8BEC0AgFUMAQsgAi8BEEEHdUGAAmotAIBVC0ECdGoiACAALwEAQQFqOwEAIAIgAigCKCgCoC0gAigCKCgCnC1BAWtGNgIgIAIoAigiACAAKAJ0IAIoAigoAmBrNgJ0IAIoAigiACACKAIoKAJgIAAoAmxqNgJsIAIoAihBADYCYAwBCyACIAIoAigiACgCOCAAKAJsai0AADoADyACKAIoIgAoAqQtIAAoAqAtQQF0akEAOwEAIAItAA8hASACKAIoIgAoApgtIQMgACAAKAKgLSIAQQFqNgKgLSAAIANqIAE6AAAgAigCKCACLQAPQQJ0aiIAIAAvAZQBQQFqOwGUASACIAIoAigoAqAtIAIoAigoApwtQQFrRjYCICACKAIoIgAgACgCdEF/ajYCdCACKAIoIgAgACgCbEEBajYCbAsgAigCIARAIAIoAigCfyACKAIoKAJcQQBOBEAgAigCKCgCOCACKAIoKAJcagwBC0EACyACKAIoKAJsIAIoAigoAlxrQQAQKSACKAIoIAIoAigoAmw2AlwgAigCKCgCABAdIAIoAigoAgAoAhBFBEAgAkEANgIsDAQLCwwBCwsgAigCKEEANgK0LSACKAIkQQRGBEAgAigCKAJ/IAIoAigoAlxBAE4EQCACKAIoKAI4IAIoAigoAlxqDAELQQALIAIoAigoAmwgAigCKCgCXGtBARApIAIoAiggAigCKCgCbDYCXCACKAIoKAIAEB0gAigCKCgCACgCEEUEQCACQQI2AiwMAgsgAkEDNgIsDAELIAIoAigoAqAtBEAgAigCKAJ/IAIoAigoAlxBAE4EQCACKAIoKAI4IAIoAigoAlxqDAELQQALIAIoAigoAmwgAigCKCgCXGtBABApIAIoAiggAigCKCgCbDYCXCACKAIoKAIAEB0gAigCKCgCACgCEEUEQCACQQA2AiwMAgsLIAJBATYCLAsgAigCLCEAIAJBMGokACAAC8AFAQJ/IwBBIGsiAiQA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AgQgAkEANgIQA0AgAigCEEEPSkUEQCACKAI8QbwWaiACKAIQQQF0akEAOwEAIAIgAigCEEEBajYCEAwBCwsgAigCNCACKAI8QdwWaiACKAI8KALUKEECdGooAgBBAnRqQQA7AQIgAiACKAI8KALUKEEBajYCHANAIAIoAhxBvQRIBEAgAiACKAI8QdwWaiACKAIcQQJ0aigCADYCGCACIAIoAjQgAigCNCACKAIYQQJ0ai8BAkECdGovAQJBAWo2AhAgAigCECACKAIgSgRAIAIgAigCIDYCECACIAIoAgRBAWo2AgQLIAIoAjQgAigCGEECdGogAigCEDsBAiACKAIYIAIoAjBMBEAgAigCPCACKAIQQQF0akG8FmoiACAALwEAQQFqOwEAIAJBADYCDCACKAIYIAIoAiROBEAgAiACKAIoIAIoAhggAigCJGtBAnRqKAIANgIMCyACIAIoAjQgAigCGEECdGovAQA7AQogAigCPCIAIAAoAqgtIAIvAQogAigCECACKAIMamxqNgKoLSACKAIsBEAgAigCPCIAIAAoAqwtIAIvAQogAigCLCACKAIYQQJ0ai8BAiACKAIMamxqNgKsLQsLIAIgAigCHEEBajYCHAwBCwsCQCACKAIERQ0AA0AgAiACKAIgQQFrNgIQA0AgAigCPEG8FmogAigCEEEBdGovAQBFBEAgAiACKAIQQX9qNgIQDAELCyACKAI8IAIoAhBBAXRqQbwWaiIAIAAvAQBBf2o7AQAgAigCPCACKAIQQQF0akG+FmoiACAALwEAQQJqOwEAIAIoAjwgAigCIEEBdGpBvBZqIgAgAC8BAEF/ajsBACACIAIoAgRBAms2AgQgAigCBEEASg0ACyACIAIoAiA2AhADQCACKAIQRQ0BIAIgAigCPEG8FmogAigCEEEBdGovAQA2AhgDQCACKAIYBEAgAigCPEHcFmohACACIAIoAhxBf2oiATYCHCACIAFBAnQgAGooAgA2AhQgAigCFCACKAIwSg0BIAIoAjQgAigCFEECdGovAQIgAigCEEcEQCACKAI8IgAgACgCqC0gAigCNCACKAIUQQJ0ai8BACACKAIQIAIoAjQgAigCFEECdGovAQJrbGo2AqgtIAIoAjQgAigCFEECdGogAigCEDsBAgsgAiACKAIYQX9qNgIYDAELCyACIAIo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KAIMIAEoAgxB/BRqNgKwFiABKAIMQajbADYCuBYgASgCDEEAOwG4LSABKAIMQQA2ArwtIAEoAgwQuQEgAUEQaiQAC9cNAQF/IwBBIGsiAyAANgIYIAMgATYCFCADIAI2AhAgAyADKAIYQRB2NgIMIAMgAygCGEH//wNxNgIYAkAgAygCEEEBRgRAIAMgAygCFC0AACADKAIYajYCGCADKAIYQfH/A08EQCADIAMoAhhB8f8DazYCGAsgAyADKAIYIAMoAgxqNgIMIAMoAgxB8f8DTwRAIAMgAygCDEHx/wNrNgIMCyADIAMoAhggAygCDEEQdHI2AhwMAQsgAygCFEUEQCADQQE2AhwMAQsgAygCEEEQSQRAA0AgAyADKAIQIgBBf2o2AhAgAARAIAMgAygCFCIAQQFqNgIUIAMgAC0AACADKAIYajYCGCADIAMoAhggAygCDGo2AgwMAQsLIAMoAhhB8f8DTwRAIAMgAygCGEHx/wNrNgIYCyADIAMoAgxB8f8DcDYCDCADIAMoAhggAygCDEEQdHI2AhwMAQsDQCADKAIQQbArSUUEQCADIAMoAhBBsCtrNgIQIANB2wI2AggDQCADIAMoAhQtAAAgAygCGGo2AhggAyADKAIYIAMoAgxqNgIMIAMgAygCFC0AASADKAIYajYCGCADIAMoAhggAygCDGo2AgwgAyADKAIULQACIAMoAhhqNgIYIAMgAygCGCADKAIMajYCDCADIAMoAhQtAAMgAygCGGo2AhggAyADKAIYIAMoAgxqNgIMIAMgAygCFC0ABCADKAIYajYCGCADIAMoAhggAygCDGo2AgwgAyADKAIULQAFIAMoAhhqNgIYIAMgAygCGCADKAIMajYCDCADIAMoAhQtAAYgAygCGGo2AhggAyADKAIYIAMoAgxqNgIMIAMgAygCFC0AByADKAIYajYCGCADIAMoAhggAygCDGo2AgwgAyADKAIULQAIIAMoAhhqNgIYIAMgAygCGCADKAIMajYCDCADIAMoAhQtAAkgAygCGGo2AhggAyADKAIYIAMoAgxqNgIMIAMgAygCFC0ACiADKAIYajYCGCADIAMoAhggAygCDGo2AgwgAyADKAIULQALIAMoAhhqNgIYIAMgAygCGCADKAIMajYCDCADIAMoAhQtAAwgAygCGGo2AhggAyADKAIYIAMoAgxqNgIMIAMgAygCFC0ADSADKAIYajYCGCADIAMoAhggAygCDGo2AgwgAyADKAIULQAOIAMoAhhqNgIYIAMgAygCGCADKAIMajYCDCADIAMoAhQtAA8gAygCGGo2AhggAyADKAIYIAMoAgxqNgIMIAMgAygCFEEQajYCFCADIAMoAghBf2oiADYCCCAADQALIAMgAygCGEHx/wNwNgIYIAMgAygCDEHx/wNwNgIMDAELCyADKAIQBEADQCADKAIQQRBJRQRAIAMgAygCEEEQazYCECADIAMoAhQtAAAgAygCGGo2AhggAyADKAIYIAMoAgxqNgIMIAMgAygCFC0AASADKAIYajYCGCADIAMoAhggAygCDGo2AgwgAyADKAIULQACIAMoAhhqNgIYIAMgAygCGCADKAIMajYCDCADIAMoAhQtAAMgAygCGGo2AhggAyADKAIYIAMoAgxqNgIMIAMgAygCFC0ABCADKAIYajYCGCADIAMoAhggAygCDGo2AgwgAyADKAIULQAFIAMoAhhqNgIYIAMgAygCGCADKAIMajYCDCADIAMoAhQtAAYgAygCGGo2AhggAyADKAIYIAMoAgxqNgIMIAMgAygCFC0AByADKAIYajYCGCADIAMoAhggAygCDGo2AgwgAyADKAIULQAIIAMoAhhqNgIYIAMgAygCGCADKAIMajYCDCADIAMoAhQtAAkgAygCGGo2AhggAyADKAIYIAMoAgxqNgIMIAMgAygCFC0ACiADKAIYajYCGCADIAMoAhggAygCDGo2AgwgAyADKAIULQALIAMoAhhqNgIYIAMgAygCGCADKAIMajYCDCADIAMoAhQtAAwgAygCGGo2AhggAyADKAIYIAMoAgxqNgIMIAMgAygCFC0ADSADKAIYajYCGCADIAMoAhggAygCDGo2AgwgAyADKAIULQAOIAMoAhhqNgIYIAMgAygCGCADKAIMajYCDCADIAMoAhQtAA8gAygCGGo2AhggAyADKAIYIAMoAgxqNgIMIAMgAygCFEEQajYCFAwBCwsDQCADIAMoAhAiAEF/ajYCECAABEAgAyADKAIUIgBBAWo2AhQgAyAALQAAIAMoAhhqNgIYIAMgAygCGCADKAIMajYCDAwBCwsgAyADKAIYQfH/A3A2AhggAyADKAIMQfH/A3A2AgwLIAMgAygC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KAIEDAELIAMoAgwoAgALQYAEEF4iADYCECAAQQBIBEAgA0J/NwO4AQwDCyADKAIQBEAgA0EBOgAXCyADIAMpAxhCAXw3AxgMAQsLIAMgAygCtAEoAgAQNSICNwMgIAJCAFMEQCADKAK0AUEIaiADKAK0ASgCABAYIANCfzcDuAEMAQsgAyADKQMgIAMpA6ABfTcDmAECQCADKQOgAUL/////D1gEQCADKQOoAUL//wNYDQELIANBAToAFwsgAyADQTBqQuIAECoiADYCLCAARQRAIAMoArQBQQhqQQ5BABAVIANCfzcDuAEMAQsgAy0AF0EBcQRAIAMoAixBttMAQQQQQCADKAIsQiwQLiADKAIsQS0QICADKAIsQS0QICADKAIsQQAQISADKAIsQQAQISADKAIsIAMpA6gBEC4gAygCLCADKQOoARAuIAMoAiwgAykDmAEQLiADKAIsIAMpA6ABEC4gAygCLEG70wBBBBBAIAMoAixBABAhIAMoAiwgAykDoAEgAykDmAF8EC4gAygCLEEBECELIAMoAixBwNMAQQQQQCADKAIsQQAQISADKAIsAn5C//8DIAMpA6gBQv//A1oNABogAykDqAELp0H//wNxECAgAygCLAJ+Qv//AyADKQOoAUL//wNaDQAaIAMpA6gBC6dB//8DcRAgIAMoAiwCf0F/IAMpA5gBQv////8PWg0AGiADKQOYAacLECEgAygCLAJ/QX8gAykDoAFC/////w9aDQAaIAMpA6ABpwsQISADAn8gAygCtAEtAChBAXEEQCADKAK0ASgCJAwBCyADKAK0ASgCIAs2ApQBIAMoAiwCfyADKAKUAQRAIAMoApQBLwEEDAELQQALQf//A3EQIAJ/IwBBEGsiACADKAIsNgIMIAAoAgwtAABBAXFFCwRAIAMoArQBQQhqQRRBABAVIAMoAiwQFyADQn83A7gBDAELIAMoArQBAn8jAEEQayIAIAMoAiw2AgwgACgCDCgCBAsCfiMAQRBrIgAgAygCLDYCDAJ+IAAoAgwtAABBAXEEQCAAKAIMKQMQDAELQgALCxA2QQBIBEAgAygCLBAXIANCfzcDuAEMAQsgAygCLBAXIAMoApQBBEAgAygCtAEgAygClAEoAgAgAygClAEvAQStEDZBAEgEQCADQn83A7gBDAILCyADIAMpA5gBNwO4AQsgAykDuAEhAiADQcABaiQAIAILBwAgACgCIAsIAEEBQTgQewsDAAELC/KNAScAQYAIC5QFTm8gZXJyb3IATXVsdGktZGlzayB6aXAgYXJjaGl2ZXMgbm90IHN1cHBvcnRlZABSZW5hbWluZyB0ZW1wb3JhcnkgZmlsZSBmYWlsZWQAQ2xvc2luZyB6aXAgYXJjaGl2ZSBmYWlsZWQAU2VlayBlcnJvcgBSZWFkIGVycm9yAFdyaXRlIGVycm9yAENSQyBlcnJvcgBDb250YWluaW5nIHppcCBhcmNoaXZlIHdhcyBjbG9zZWQATm8gc3VjaCBmaWxlAEZpbGUgYWxyZWFkeSBleGlzdHMAQ2FuJ3Qgb3BlbiBmaWxlAEZhaWx1cmUgdG8gY3JlYXRlIHRlbXBvcmFyeSBmaWxlAFpsaWIgZXJyb3IATWFsbG9jIGZhaWx1cmUARW50cnkgaGFzIGJlZW4gY2hhbmdlZABDb21wcmVzc2lvbiBtZXRob2Qgbm90IHN1cHBvcnRlZABQcmVtYXR1cmUgZW5kIG9mIGZpbGUASW52YWxpZCBhcmd1bWVudABOb3QgYSB6aXAgYXJjaGl2ZQBJbnRlcm5hbCBlcnJvcgBaaXAgYXJjaGl2ZSBpbmNvbnNpc3RlbnQAQ2FuJ3QgcmVtb3ZlIGZpbGUARW50cnkgaGFzIGJlZW4gZGVsZXRlZABFbmNyeXB0aW9uIG1ldGhvZCBub3Qgc3VwcG9ydGVkAFJlYWQtb25seSBhcmNoaXZlAE5vIHBhc3N3b3JkIHByb3ZpZGVkAFdyb25nIHBhc3N3b3JkIHByb3ZpZGVkAE9wZXJhdGlvbiBub3Qgc3VwcG9ydGVkAFJlc291cmNlIHN0aWxsIGluIHVzZQBUZWxsIGVycm9yAENvbXByZXNzZWQgZGF0YSBpbnZhbGlkAEGhDQuAAQQAAAkEAAAvBAAATgQAAGkEAAB0BAAAfwQAAIsEAACVBAAAtwQAAMQEAADYBAAA6AQAAAkFAAAUBQAAIwUAADoFAABbBQAAcQUAAIIFAACUBQAAowUAALwFAADOBQAA5QUAAAUGAAAXBgAALAYAAEQGAABcBgAAcgYAAH0GAAAgAEG4DgsRAQAAAAEAAAABAAAAAQAAAAEAQdwOCwkBAAAAAQAAAAIAQYgPCwEBAEGoDwsB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CAAaAAgAmgAIAFoACADaAAgAOgAIALoACAB6AAgA+gAIAAYACACGAAgARgAIAMYACAAmAAgApgAIAGYACADmAAgAFgAIAJYACABWAAgA1gAIADYACAC2AAgAdgAIAPYACAAOAAgAjgAIAE4ACADOAAgALgAIAK4ACABuAAgA7gAIAB4ACACeAAgAXgAIAN4ACAA+AAgAvgAIAH4ACAD+AAgAAQAIAIEACABBAAgAwQAIACEACAChAAgAYQAIAOEACAARAAgAkQAIAFEACADRAAgAMQAIALEACABxAAgA8QAIAAkACACJAAgASQAIAMkACAApAAgAqQAIAGkACADpAAgAGQAIAJkACABZAAgA2QAIADkACAC5AAgAeQAIAPkACAAFAAgAhQAIAEUACADFAAgAJQAIAKUACABlAAgA5QAIABUACACVAAgAVQAIANUACAA1AAgAtQAIAHUACAD1AAgADQAIAI0ACABNAAgAzQAIAC0ACACtAAgAbQAIAO0ACAAdAAgAnQAIAF0ACADdAAgAPQAIAL0ACAB9AAgA/QAIABMACQATAQkAkwAJAJMBCQBTAAkAUwEJANMACQDTAQkAMwAJADMBCQCzAAkAswEJAHMACQBzAQkA8wAJAPMBCQALAAkACwEJAIsACQCLAQkASwAJAEsBCQDLAAkAywEJACsACQArAQkAqwAJAKsBCQBrAAkAawEJAOsACQDrAQkAGwAJABsBCQCbAAkAmwEJAFsACQBbAQkA2wAJANsBCQA7AAkAOwEJALsACQC7AQkAewAJAHsBCQD7AAkA+wEJAAcACQAHAQkAhwAJAIcBCQBHAAkARwEJAMcACQDHAQkAJwAJACcBCQCnAAkApwEJAGcACQBnAQkA5wAJAOcBCQAXAAkAFwEJAJcACQCXAQkAVwAJAFcBCQDXAAkA1wEJADcACQA3AQkAtwAJALcBCQB3AAkAdwEJAPcACQD3AQkADwAJAA8BCQCPAAkAjwEJAE8ACQBPAQkAzwAJAM8BCQAvAAkALwEJAK8ACQCvAQkAbwAJAG8BCQDvAAkA7wEJAB8ACQAfAQkAnwAJAJ8BCQBfAAkAXwEJAN8ACQDfAQkAPwAJAD8BCQC/AAkAvwEJAH8ACQB/AQkA/wAJAP8BCQAAAAcAQAAHACAABwBgAAcAEAAHAFAABwAwAAcAcAAHAAgA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cnkATm8gc3VjaCBwcm9jZXNzAEZpbGUgZXhpc3RzAFZhbHVlIHRvbyBsYXJnZSBmb3IgZGF0YSB0eXBlAE5vIHNwYWNlIGxlZnQgb24gZGV2aWNlAE91dCBvZiBtZW1vcnkAUmVzb3VyY2UgYnVzeQBJbnRlcnJ1cHRlZCBzeXN0ZW0gY2FsbABSZXNvdXJjZSB0ZW1wb3JhcmlseSB1bmF2YWlsYWJsZQBJbnZhbGlkIHNlZWsAQ3Jvc3MtZGV2aWNlIGxpbmsAUmVhZC1vbmx5IGZpbGUgc3lzdGVtAERpcmVjdG9yeSBub3QgZW1wdHkAQ29ubmVjdGlvbiByZXNldCBieSBwZWVyAE9wZXJhdGlvbiB0aW1lZCBvdXQAQ29ubmVjdGlvbiByZWZ1c2VkAEhvc3QgaXMgZG93bgBIb3N0IGlzIHVucmVhY2hhYmxlAEFkZHJlc3MgaW4gdXNlAEJyb2tlbiBwaXBlAEkvTyBlcnJvcgBObyBzdWNoIGRldmljZSBvciBhZGRyZXNzAEJsb2NrIGRldmljZSByZXF1aXJlZABObyBzdWNoIGRldmljZQBOb3QgYSBkaXJlY3RvcnkASXMgYSBkaXJlY3RvcnkAVGV4dCBmaWxlIGJ1c3kARXhlYyBmb3JtYXQgZXJyb3IASW52YWxpZCBhcmd1bWVudABBcmd1bWVudCBsaXN0IHRvbyBsb25nAFN5bWJvbGljIGxpbmsgbG9vcABGaWxlbmFtZSB0b28gbG9uZwBUb28gbWFueSBvcGVuIGZpbGVzIGluIHN5c3RlbQBObyBmaWxlIGRlc2NyaXB0b3JzIGF2YWlsYWJsZQBCYWQgZmlsZSBkZXNjcmlwdG9yAE5vIGNoaWxkIHByb2Nlc3MAQmFkIGFkZHJlc3MARmlsZSB0b28gbGFyZ2UAVG9vIG1hbnkgbGlua3MATm8gbG9ja3MgYXZhaWxhYmxlAFJlc291cmNlIGRlYWRsb2NrIHdvdWxkIG9jY3VyAFN0YXRlIG5vdCByZWNvdmVyYWJsZQBQcmV2aW91cyBvd25lciBkaWVkAE9wZXJhdGlvbiBjYW5jZWxlZABGdW5jdGlvbiBub3QgaW1wbGVtZW50ZWQATm8gbWVzc2FnZSBvZiBkZXNpcmVkIHR5cGUASWRlbnRpZmllciByZW1vdmVkAERldmljZSBub3QgYSBzdHJlYW0ATm8gZGF0YSBhdmFpbGFibGUARGV2aWNlIHRpbWVvdXQAT3V0IG9mIHN0cmVhbXMgcmVzb3VyY2VzAExpbmsgaGFzIGJlZW4gc2V2ZXJlZABQcm90b2NvbCBlcnJvcgBCYWQgbWVzc2FnZQBGaWxlIGRlc2NyaXB0b3IgaW4gYmFkIHN0YXRlAE5vdCBhIHNvY2tldABEZXN0aW5hdGlvbiBhZGRyZXNzIHJlcXVpcmVkAE1lc3NhZ2UgdG9vIGxhcmdlAFByb3RvY29sIHdyb25nIHR5cGUgZm9yIHNvY2tldABQcm90b2NvbCBub3QgYXZhaWxhYmxlAFByb3RvY29sIG5vdCBzdXBwb3J0ZWQAU29ja2V0IHR5cGUgbm90IHN1cHBvcnRlZABOb3Qgc3VwcG9ydGVkAFByb3RvY29sIGZhbWlseSBub3Qgc3VwcG9ydGVkAEFkZHJlc3MgZmFtaWx5IG5vdCBzdXBwb3J0ZWQgYnkgcHJvdG9jb2wAQWRkcmVzcyBub3QgYXZhaWxhYmxlAE5ldHdvcmsgaXMgZG93bgBOZXR3b3JrIHVucmVhY2hhYmxlAENvbm5lY3Rpb24gcmVzZXQgYnkgbmV0d29yawBDb25uZWN0aW9uIGFib3J0ZWQATm8gYnVmZmVyIHNwYWNlIGF2YWlsYWJsZQBTb2NrZXQgaXMgY29ubmVjdGVkAFNvY2tldCBub3QgY29ubmVjdGVkAENhbm5vdCBzZW5kIGFmdGVyIHNvY2tldCBzaHV0ZG93bgBPcGVyYXRpb24gYWxyZWFkeSBpbiBwcm9ncmVzcwBPcGVyYXRpb24gaW4gcHJvZ3Jlc3MAU3RhbGUgZmlsZSBoYW5kbGUAUmVtb3RlIEkvTyBlcnJvcgBRdW90YSBleGNlZWRlZABObyBtZWRpdW0gZm91bmQAV3JvbmcgbWVkaXVtIHR5cGUATm8gZXJyb3IgaW5mb3JtYXRpb24AAFVua25vd24gZXJyb3IgJWQAJXMlcyVzAAA6IAAvcHJvYy9zZWxmL2ZkLwAvZGV2L3VyYW5kb20AcndhACVzLlhYWFhYWAByK2IAcmIAUEsFBgBBkJgBC04KAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAALAAAADAAAAA0AAAAOAAAADwAAABAAAAARAAAAAQAAAAgAAAAQTAAAMEwAQZCaAQsCgFAAQciaAQsJHwAAAGRNAAADAEHkmgELjAEt9FFYz4yxwEb2tcspMQPHBFtwMLRd/SB4f4ua2FkpUGhIiaunVgNs/7fNiD/Ud7QrpaNw8brkqPxBg/3Zb+GKei8tdJYHHw0JXgN2LHD3QKUsp29XQaiqdN+gWGQDSsfEPFOur18YBBWx420ohqsMpL9D8OlQgTlXFlI3/////////////////////w=="; +if (!isDataURI(wasmBinaryFile)) { + wasmBinaryFile = locateFile(wasmBinaryFile); +} +function getBinary() { + try { + if (wasmBinary) { + return new Uint8Array(wasmBinary); + } + var binary = tryParseAsDataURI(wasmBinaryFile); + if (binary) { + return binary; + } + if (readBinary) { + return readBinary(wasmBinaryFile); + } else { + throw "sync fetching of the wasm failed: you can preload it to Module['wasmBinary'] manually, or emcc.py will do that for you when generating HTML (but not JS)"; + } + } catch (err) { + abort(err); + } +} +function createWasm() { + var info = { a: asmLibraryArg }; + function receiveInstance(instance, module) { + var exports = instance.exports; + Module["asm"] = exports; + removeRunDependency("wasm-instantiate"); + } + addRunDependency("wasm-instantiate"); + function instantiateSync() { + var instance; + var module; + var binary; + try { + binary = getBinary(); + module = new WebAssembly.Module(binary); + instance = new WebAssembly.Instance(module, info); + } catch (e) { + var str = e.toString(); + err("failed to compile wasm module: " + str); + if ( + str.indexOf("imported Memory") >= 0 || + str.indexOf("memory import") >= 0 + ) { + err( + "Memory size incompatibility issues may be due to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time)." + ); + } + throw e; + } + receiveInstance(instance, module); + } + if (Module["instantiateWasm"]) { + try { + var exports = Module["instantiateWasm"](info, receiveInstance); + return exports; + } catch (e) { + err("Module.instantiateWasm callback failed with error: " + e); + return false; + } + } + instantiateSync(); + return Module["asm"]; +} +var tempDouble; +var tempI64; +__ATINIT__.push({ + func: function() { + ___wasm_call_ctors(); + } +}); +function callRuntimeCallbacks(callbacks) { + while (callbacks.length > 0) { + var callback = callbacks.shift(); + if (typeof callback == "function") { + callback(Module); + continue; + } + var func = callback.func; + if (typeof func === "number") { + if (callback.arg === undefined) { + wasmTable.get(func)(); + } else { + wasmTable.get(func)(callback.arg); + } + } else { + func(callback.arg === undefined ? null : callback.arg); + } + } +} +function demangle(func) { + return func; +} +function demangleAll(text) { + var regex = /\b_Z[\w\d_]+/g; + return text.replace(regex, function(x) { + var y = demangle(x); + return x === y ? x : y + " [" + x + "]"; + }); +} +function jsStackTrace() { + var error = new Error(); + if (!error.stack) { + try { + throw new Error(); + } catch (e) { + error = e; + } + if (!error.stack) { + return "(no stack trace available)"; + } + } + return error.stack.toString(); +} +function stackTrace() { + var js = jsStackTrace(); + if (Module["extraStackTrace"]) js += "\n" + Module["extraStackTrace"](); + return demangleAll(js); +} +function _gmtime_r(time, tmPtr) { + var date = new Date(HEAP32[time >> 2] * 1e3); + HEAP32[tmPtr >> 2] = date.getUTCSeconds(); + HEAP32[(tmPtr + 4) >> 2] = date.getUTCMinutes(); + HEAP32[(tmPtr + 8) >> 2] = date.getUTCHours(); + HEAP32[(tmPtr + 12) >> 2] = date.getUTCDate(); + HEAP32[(tmPtr + 16) >> 2] = date.getUTCMonth(); + HEAP32[(tmPtr + 20) >> 2] = date.getUTCFullYear() - 1900; + HEAP32[(tmPtr + 24) >> 2] = date.getUTCDay(); + HEAP32[(tmPtr + 36) >> 2] = 0; + HEAP32[(tmPtr + 32) >> 2] = 0; + var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); + var yday = ((date.getTime() - start) / (1e3 * 60 * 60 * 24)) | 0; + HEAP32[(tmPtr + 28) >> 2] = yday; + if (!_gmtime_r.GMTString) _gmtime_r.GMTString = allocateUTF8("GMT"); + HEAP32[(tmPtr + 40) >> 2] = _gmtime_r.GMTString; + return tmPtr; +} +function ___gmtime_r(a0, a1) { + return _gmtime_r(a0, a1); +} +var PATH = { + splitPath: function(filename) { + var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; + return splitPathRe.exec(filename).slice(1); + }, + normalizeArray: function(parts, allowAboveRoot) { + var up = 0; + for (var i = parts.length - 1; i >= 0; i--) { + var last = parts[i]; + if (last === ".") { + parts.splice(i, 1); + } else if (last === "..") { + parts.splice(i, 1); + up++; + } else if (up) { + parts.splice(i, 1); + up--; + } + } + if (allowAboveRoot) { + for (; up; up--) { + parts.unshift(".."); + } + } + return parts; + }, + normalize: function(path) { + var isAbsolute = path.charAt(0) === "/", + trailingSlash = path.substr(-1) === "/"; + path = PATH.normalizeArray( + path.split("/").filter(function(p) { + return !!p; + }), + !isAbsolute + ).join("/"); + if (!path && !isAbsolute) { + path = "."; + } + if (path && trailingSlash) { + path += "/"; + } + return (isAbsolute ? "/" : "") + path; + }, + dirname: function(path) { + var result = PATH.splitPath(path), + root = result[0], + dir = result[1]; + if (!root && !dir) { + return "."; + } + if (dir) { + dir = dir.substr(0, dir.length - 1); + } + return root + dir; + }, + basename: function(path) { + if (path === "/") return "/"; + path = PATH.normalize(path); + path = path.replace(/\/$/, ""); + var lastSlash = path.lastIndexOf("/"); + if (lastSlash === -1) return path; + return path.substr(lastSlash + 1); + }, + extname: function(path) { + return PATH.splitPath(path)[3]; + }, + join: function() { + var paths = Array.prototype.slice.call(arguments, 0); + return PATH.normalize(paths.join("/")); + }, + join2: function(l, r) { + return PATH.normalize(l + "/" + r); + } +}; +function setErrNo(value) { + HEAP32[___errno_location() >> 2] = value; + return value; +} +var PATH_FS = { + resolve: function() { + var resolvedPath = "", + resolvedAbsolute = false; + for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { + var path = i >= 0 ? arguments[i] : FS.cwd(); + if (typeof path !== "string") { + throw new TypeError("Arguments to path.resolve must be strings"); + } else if (!path) { + return ""; + } + resolvedPath = path + "/" + resolvedPath; + resolvedAbsolute = path.charAt(0) === "/"; + } + resolvedPath = PATH.normalizeArray( + resolvedPath.split("/").filter(function(p) { + return !!p; + }), + !resolvedAbsolute + ).join("/"); + return (resolvedAbsolute ? "/" : "") + resolvedPath || "."; + }, + relative: function(from, to) { + from = PATH_FS.resolve(from).substr(1); + to = PATH_FS.resolve(to).substr(1); + function trim(arr) { + var start = 0; + for (; start < arr.length; start++) { + if (arr[start] !== "") break; + } + var end = arr.length - 1; + for (; end >= 0; end--) { + if (arr[end] !== "") break; + } + if (start > end) return []; + return arr.slice(start, end - start + 1); + } + var fromParts = trim(from.split("/")); + var toParts = trim(to.split("/")); + var length = Math.min(fromParts.length, toParts.length); + var samePartsLength = length; + for (var i = 0; i < length; i++) { + if (fromParts[i] !== toParts[i]) { + samePartsLength = i; + break; + } + } + var outputParts = []; + for (var i = samePartsLength; i < fromParts.length; i++) { + outputParts.push(".."); + } + outputParts = outputParts.concat(toParts.slice(samePartsLength)); + return outputParts.join("/"); + } +}; +var TTY = { + ttys: [], + init: function() {}, + shutdown: function() {}, + register: function(dev, ops) { + TTY.ttys[dev] = { input: [], output: [], ops: ops }; + FS.registerDevice(dev, TTY.stream_ops); + }, + stream_ops: { + open: function(stream) { + var tty = TTY.ttys[stream.node.rdev]; + if (!tty) { + throw new FS.ErrnoError(43); + } + stream.tty = tty; + stream.seekable = false; + }, + close: function(stream) { + stream.tty.ops.flush(stream.tty); + }, + flush: function(stream) { + stream.tty.ops.flush(stream.tty); + }, + read: function(stream, buffer, offset, length, pos) { + if (!stream.tty || !stream.tty.ops.get_char) { + throw new FS.ErrnoError(60); + } + var bytesRead = 0; + for (var i = 0; i < length; i++) { + var result; + try { + result = stream.tty.ops.get_char(stream.tty); + } catch (e) { + throw new FS.ErrnoError(29); + } + if (result === undefined && bytesRead === 0) { + throw new FS.ErrnoError(6); + } + if (result === null || result === undefined) break; + bytesRead++; + buffer[offset + i] = result; + } + if (bytesRead) { + stream.node.timestamp = Date.now(); + } + return bytesRead; + }, + write: function(stream, buffer, offset, length, pos) { + if (!stream.tty || !stream.tty.ops.put_char) { + throw new FS.ErrnoError(60); + } + try { + for (var i = 0; i < length; i++) { + stream.tty.ops.put_char(stream.tty, buffer[offset + i]); + } + } catch (e) { + throw new FS.ErrnoError(29); + } + if (length) { + stream.node.timestamp = Date.now(); + } + return i; + } + }, + default_tty_ops: { + get_char: function(tty) { + if (!tty.input.length) { + var result = null; + if (ENVIRONMENT_IS_NODE) { + var BUFSIZE = 256; + var buf = Buffer.alloc ? Buffer.alloc(BUFSIZE) : new Buffer(BUFSIZE); + var bytesRead = 0; + try { + bytesRead = nodeFS.readSync( + process.stdin.fd, + buf, + 0, + BUFSIZE, + null + ); + } catch (e) { + if (e.toString().indexOf("EOF") != -1) bytesRead = 0; + else throw e; + } + if (bytesRead > 0) { + result = buf.slice(0, bytesRead).toString("utf-8"); + } else { + result = null; + } + } else if ( + typeof window != "undefined" && + typeof window.prompt == "function" + ) { + result = window.prompt("Input: "); + if (result !== null) { + result += "\n"; + } + } else if (typeof readline == "function") { + result = readline(); + if (result !== null) { + result += "\n"; + } + } + if (!result) { + return null; + } + tty.input = intArrayFromString(result, true); + } + return tty.input.shift(); + }, + put_char: function(tty, val) { + if (val === null || val === 10) { + out(UTF8ArrayToString(tty.output, 0)); + tty.output = []; + } else { + if (val != 0) tty.output.push(val); + } + }, + flush: function(tty) { + if (tty.output && tty.output.length > 0) { + out(UTF8ArrayToString(tty.output, 0)); + tty.output = []; + } + } + }, + default_tty1_ops: { + put_char: function(tty, val) { + if (val === null || val === 10) { + err(UTF8ArrayToString(tty.output, 0)); + tty.output = []; + } else { + if (val != 0) tty.output.push(val); + } + }, + flush: function(tty) { + if (tty.output && tty.output.length > 0) { + err(UTF8ArrayToString(tty.output, 0)); + tty.output = []; + } + } + } +}; +var MEMFS = { + ops_table: null, + mount: function(mount) { + return MEMFS.createNode(null, "/", 16384 | 511, 0); + }, + createNode: function(parent, name, mode, dev) { + if (FS.isBlkdev(mode) || FS.isFIFO(mode)) { + throw new FS.ErrnoError(63); + } + if (!MEMFS.ops_table) { + MEMFS.ops_table = { + dir: { + node: { + getattr: MEMFS.node_ops.getattr, + setattr: MEMFS.node_ops.setattr, + lookup: MEMFS.node_ops.lookup, + mknod: MEMFS.node_ops.mknod, + rename: MEMFS.node_ops.rename, + unlink: MEMFS.node_ops.unlink, + rmdir: MEMFS.node_ops.rmdir, + readdir: MEMFS.node_ops.readdir, + symlink: MEMFS.node_ops.symlink + }, + stream: { llseek: MEMFS.stream_ops.llseek } + }, + file: { + node: { + getattr: MEMFS.node_ops.getattr, + setattr: MEMFS.node_ops.setattr + }, + stream: { + llseek: MEMFS.stream_ops.llseek, + read: MEMFS.stream_ops.read, + write: MEMFS.stream_ops.write, + allocate: MEMFS.stream_ops.allocate, + mmap: MEMFS.stream_ops.mmap, + msync: MEMFS.stream_ops.msync + } + }, + link: { + node: { + getattr: MEMFS.node_ops.getattr, + setattr: MEMFS.node_ops.setattr, + readlink: MEMFS.node_ops.readlink + }, + stream: {} + }, + chrdev: { + node: { + getattr: MEMFS.node_ops.getattr, + setattr: MEMFS.node_ops.setattr + }, + stream: FS.chrdev_stream_ops + } + }; + } + var node = FS.createNode(parent, name, mode, dev); + if (FS.isDir(node.mode)) { + node.node_ops = MEMFS.ops_table.dir.node; + node.stream_ops = MEMFS.ops_table.dir.stream; + node.contents = {}; + } else if (FS.isFile(node.mode)) { + node.node_ops = MEMFS.ops_table.file.node; + node.stream_ops = MEMFS.ops_table.file.stream; + node.usedBytes = 0; + node.contents = null; + } else if (FS.isLink(node.mode)) { + node.node_ops = MEMFS.ops_table.link.node; + node.stream_ops = MEMFS.ops_table.link.stream; + } else if (FS.isChrdev(node.mode)) { + node.node_ops = MEMFS.ops_table.chrdev.node; + node.stream_ops = MEMFS.ops_table.chrdev.stream; + } + node.timestamp = Date.now(); + if (parent) { + parent.contents[name] = node; + } + return node; + }, + getFileDataAsRegularArray: function(node) { + if (node.contents && node.contents.subarray) { + var arr = []; + for (var i = 0; i < node.usedBytes; ++i) arr.push(node.contents[i]); + return arr; + } + return node.contents; + }, + getFileDataAsTypedArray: function(node) { + if (!node.contents) return new Uint8Array(0); + if (node.contents.subarray) + return node.contents.subarray(0, node.usedBytes); + return new Uint8Array(node.contents); + }, + expandFileStorage: function(node, newCapacity) { + var prevCapacity = node.contents ? node.contents.length : 0; + if (prevCapacity >= newCapacity) return; + var CAPACITY_DOUBLING_MAX = 1024 * 1024; + newCapacity = Math.max( + newCapacity, + (prevCapacity * (prevCapacity < CAPACITY_DOUBLING_MAX ? 2 : 1.125)) >>> 0 + ); + if (prevCapacity != 0) newCapacity = Math.max(newCapacity, 256); + var oldContents = node.contents; + node.contents = new Uint8Array(newCapacity); + if (node.usedBytes > 0) + node.contents.set(oldContents.subarray(0, node.usedBytes), 0); + return; + }, + resizeFileStorage: function(node, newSize) { + if (node.usedBytes == newSize) return; + if (newSize == 0) { + node.contents = null; + node.usedBytes = 0; + return; + } + if (!node.contents || node.contents.subarray) { + var oldContents = node.contents; + node.contents = new Uint8Array(newSize); + if (oldContents) { + node.contents.set( + oldContents.subarray(0, Math.min(newSize, node.usedBytes)) + ); + } + node.usedBytes = newSize; + return; + } + if (!node.contents) node.contents = []; + if (node.contents.length > newSize) node.contents.length = newSize; + else while (node.contents.length < newSize) node.contents.push(0); + node.usedBytes = newSize; + }, + node_ops: { + getattr: function(node) { + var attr = {}; + attr.dev = FS.isChrdev(node.mode) ? node.id : 1; + attr.ino = node.id; + attr.mode = node.mode; + attr.nlink = 1; + attr.uid = 0; + attr.gid = 0; + attr.rdev = node.rdev; + if (FS.isDir(node.mode)) { + attr.size = 4096; + } else if (FS.isFile(node.mode)) { + attr.size = node.usedBytes; + } else if (FS.isLink(node.mode)) { + attr.size = node.link.length; + } else { + attr.size = 0; + } + attr.atime = new Date(node.timestamp); + attr.mtime = new Date(node.timestamp); + attr.ctime = new Date(node.timestamp); + attr.blksize = 4096; + attr.blocks = Math.ceil(attr.size / attr.blksize); + return attr; + }, + setattr: function(node, attr) { + if (attr.mode !== undefined) { + node.mode = attr.mode; + } + if (attr.timestamp !== undefined) { + node.timestamp = attr.timestamp; + } + if (attr.size !== undefined) { + MEMFS.resizeFileStorage(node, attr.size); + } + }, + lookup: function(parent, name) { + throw FS.genericErrors[44]; + }, + mknod: function(parent, name, mode, dev) { + return MEMFS.createNode(parent, name, mode, dev); + }, + rename: function(old_node, new_dir, new_name) { + if (FS.isDir(old_node.mode)) { + var new_node; + try { + new_node = FS.lookupNode(new_dir, new_name); + } catch (e) {} + if (new_node) { + for (var i in new_node.contents) { + throw new FS.ErrnoError(55); + } + } + } + delete old_node.parent.contents[old_node.name]; + old_node.name = new_name; + new_dir.contents[new_name] = old_node; + old_node.parent = new_dir; + }, + unlink: function(parent, name) { + delete parent.contents[name]; + }, + rmdir: function(parent, name) { + var node = FS.lookupNode(parent, name); + for (var i in node.contents) { + throw new FS.ErrnoError(55); + } + delete parent.contents[name]; + }, + readdir: function(node) { + var entries = [".", ".."]; + for (var key in node.contents) { + if (!node.contents.hasOwnProperty(key)) { + continue; + } + entries.push(key); + } + return entries; + }, + symlink: function(parent, newname, oldpath) { + var node = MEMFS.createNode(parent, newname, 511 | 40960, 0); + node.link = oldpath; + return node; + }, + readlink: function(node) { + if (!FS.isLink(node.mode)) { + throw new FS.ErrnoError(28); + } + return node.link; + } + }, + stream_ops: { + read: function(stream, buffer, offset, length, position) { + var contents = stream.node.contents; + if (position >= stream.node.usedBytes) return 0; + var size = Math.min(stream.node.usedBytes - position, length); + if (size > 8 && contents.subarray) { + buffer.set(contents.subarray(position, position + size), offset); + } else { + for (var i = 0; i < size; i++) + buffer[offset + i] = contents[position + i]; + } + return size; + }, + write: function(stream, buffer, offset, length, position, canOwn) { + if (buffer.buffer === HEAP8.buffer) { + canOwn = false; + } + if (!length) return 0; + var node = stream.node; + node.timestamp = Date.now(); + if (buffer.subarray && (!node.contents || node.contents.subarray)) { + if (canOwn) { + node.contents = buffer.subarray(offset, offset + length); + node.usedBytes = length; + return length; + } else if (node.usedBytes === 0 && position === 0) { + node.contents = buffer.slice(offset, offset + length); + node.usedBytes = length; + return length; + } else if (position + length <= node.usedBytes) { + node.contents.set(buffer.subarray(offset, offset + length), position); + return length; + } + } + MEMFS.expandFileStorage(node, position + length); + if (node.contents.subarray && buffer.subarray) { + node.contents.set(buffer.subarray(offset, offset + length), position); + } else { + for (var i = 0; i < length; i++) { + node.contents[position + i] = buffer[offset + i]; + } + } + node.usedBytes = Math.max(node.usedBytes, position + length); + return length; + }, + llseek: function(stream, offset, whence) { + var position = offset; + if (whence === 1) { + position += stream.position; + } else if (whence === 2) { + if (FS.isFile(stream.node.mode)) { + position += stream.node.usedBytes; + } + } + if (position < 0) { + throw new FS.ErrnoError(28); + } + return position; + }, + allocate: function(stream, offset, length) { + MEMFS.expandFileStorage(stream.node, offset + length); + stream.node.usedBytes = Math.max(stream.node.usedBytes, offset + length); + }, + mmap: function(stream, address, length, position, prot, flags) { + assert(address === 0); + if (!FS.isFile(stream.node.mode)) { + throw new FS.ErrnoError(43); + } + var ptr; + var allocated; + var contents = stream.node.contents; + if (!(flags & 2) && contents.buffer === buffer) { + allocated = false; + ptr = contents.byteOffset; + } else { + if (position > 0 || position + length < contents.length) { + if (contents.subarray) { + contents = contents.subarray(position, position + length); + } else { + contents = Array.prototype.slice.call( + contents, + position, + position + length + ); + } + } + allocated = true; + ptr = FS.mmapAlloc(length); + if (!ptr) { + throw new FS.ErrnoError(48); + } + HEAP8.set(contents, ptr); + } + return { ptr: ptr, allocated: allocated }; + }, + msync: function(stream, buffer, offset, length, mmapFlags) { + if (!FS.isFile(stream.node.mode)) { + throw new FS.ErrnoError(43); + } + if (mmapFlags & 2) { + return 0; + } + var bytesWritten = MEMFS.stream_ops.write( + stream, + buffer, + 0, + length, + offset, + false + ); + return 0; + } + } +}; +var ERRNO_CODES = { + EPERM: 63, + ENOENT: 44, + ESRCH: 71, + EINTR: 27, + EIO: 29, + ENXIO: 60, + E2BIG: 1, + ENOEXEC: 45, + EBADF: 8, + ECHILD: 12, + EAGAIN: 6, + EWOULDBLOCK: 6, + ENOMEM: 48, + EACCES: 2, + EFAULT: 21, + ENOTBLK: 105, + EBUSY: 10, + EEXIST: 20, + EXDEV: 75, + ENODEV: 43, + ENOTDIR: 54, + EISDIR: 31, + EINVAL: 28, + ENFILE: 41, + EMFILE: 33, + ENOTTY: 59, + ETXTBSY: 74, + EFBIG: 22, + ENOSPC: 51, + ESPIPE: 70, + EROFS: 69, + EMLINK: 34, + EPIPE: 64, + EDOM: 18, + ERANGE: 68, + ENOMSG: 49, + EIDRM: 24, + ECHRNG: 106, + EL2NSYNC: 156, + EL3HLT: 107, + EL3RST: 108, + ELNRNG: 109, + EUNATCH: 110, + ENOCSI: 111, + EL2HLT: 112, + EDEADLK: 16, + ENOLCK: 46, + EBADE: 113, + EBADR: 114, + EXFULL: 115, + ENOANO: 104, + EBADRQC: 103, + EBADSLT: 102, + EDEADLOCK: 16, + EBFONT: 101, + ENOSTR: 100, + ENODATA: 116, + ETIME: 117, + ENOSR: 118, + ENONET: 119, + ENOPKG: 120, + EREMOTE: 121, + ENOLINK: 47, + EADV: 122, + ESRMNT: 123, + ECOMM: 124, + EPROTO: 65, + EMULTIHOP: 36, + EDOTDOT: 125, + EBADMSG: 9, + ENOTUNIQ: 126, + EBADFD: 127, + EREMCHG: 128, + ELIBACC: 129, + ELIBBAD: 130, + ELIBSCN: 131, + ELIBMAX: 132, + ELIBEXEC: 133, + ENOSYS: 52, + ENOTEMPTY: 55, + ENAMETOOLONG: 37, + ELOOP: 32, + EOPNOTSUPP: 138, + EPFNOSUPPORT: 139, + ECONNRESET: 15, + ENOBUFS: 42, + EAFNOSUPPORT: 5, + EPROTOTYPE: 67, + ENOTSOCK: 57, + ENOPROTOOPT: 50, + ESHUTDOWN: 140, + ECONNREFUSED: 14, + EADDRINUSE: 3, + ECONNABORTED: 13, + ENETUNREACH: 40, + ENETDOWN: 38, + ETIMEDOUT: 73, + EHOSTDOWN: 142, + EHOSTUNREACH: 23, + EINPROGRESS: 26, + EALREADY: 7, + EDESTADDRREQ: 17, + EMSGSIZE: 35, + EPROTONOSUPPORT: 66, + ESOCKTNOSUPPORT: 137, + EADDRNOTAVAIL: 4, + ENETRESET: 39, + EISCONN: 30, + ENOTCONN: 53, + ETOOMANYREFS: 141, + EUSERS: 136, + EDQUOT: 19, + ESTALE: 72, + ENOTSUP: 138, + ENOMEDIUM: 148, + EILSEQ: 25, + EOVERFLOW: 61, + ECANCELED: 11, + ENOTRECOVERABLE: 56, + EOWNERDEAD: 62, + ESTRPIPE: 135 +}; +var NODEFS = { + isWindows: false, + staticInit: function() { + NODEFS.isWindows = !!process.platform.match(/^win/); + var flags = { fs: fs.constants }; + if (flags["fs"]) { + flags = flags["fs"]; + } + NODEFS.flagsForNodeMap = { + 1024: flags["O_APPEND"], + 64: flags["O_CREAT"], + 128: flags["O_EXCL"], + 0: flags["O_RDONLY"], + 2: flags["O_RDWR"], + 4096: flags["O_SYNC"], + 512: flags["O_TRUNC"], + 1: flags["O_WRONLY"] + }; + }, + bufferFrom: function(arrayBuffer) { + return Buffer["alloc"] ? Buffer.from(arrayBuffer) : new Buffer(arrayBuffer); + }, + convertNodeCode: function(e) { + var code = e.code; + return ERRNO_CODES[code]; + }, + mount: function(mount) { + return NODEFS.createNode(null, "/", NODEFS.getMode(mount.opts.root), 0); + }, + createNode: function(parent, name, mode, dev) { + if (!FS.isDir(mode) && !FS.isFile(mode) && !FS.isLink(mode)) { + throw new FS.ErrnoError(28); + } + var node = FS.createNode(parent, name, mode); + node.node_ops = NODEFS.node_ops; + node.stream_ops = NODEFS.stream_ops; + return node; + }, + getMode: function(path) { + var stat; + try { + stat = fs.lstatSync(path); + if (NODEFS.isWindows) { + stat.mode = stat.mode | ((stat.mode & 292) >> 2); + } + } catch (e) { + if (!e.code) throw e; + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + return stat.mode; + }, + realPath: function(node) { + var parts = []; + while (node.parent !== node) { + parts.push(node.name); + node = node.parent; + } + parts.push(node.mount.opts.root); + parts.reverse(); + return PATH.join.apply(null, parts); + }, + flagsForNode: function(flags) { + flags &= ~2097152; + flags &= ~2048; + flags &= ~32768; + flags &= ~524288; + var newFlags = 0; + for (var k in NODEFS.flagsForNodeMap) { + if (flags & k) { + newFlags |= NODEFS.flagsForNodeMap[k]; + flags ^= k; + } + } + if (!flags) { + return newFlags; + } else { + throw new FS.ErrnoError(28); + } + }, + node_ops: { + getattr: function(node) { + var path = NODEFS.realPath(node); + var stat; + try { + stat = fs.lstatSync(path); + } catch (e) { + if (!e.code) throw e; + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + if (NODEFS.isWindows && !stat.blksize) { + stat.blksize = 4096; + } + if (NODEFS.isWindows && !stat.blocks) { + stat.blocks = ((stat.size + stat.blksize - 1) / stat.blksize) | 0; + } + return { + dev: stat.dev, + ino: stat.ino, + mode: stat.mode, + nlink: stat.nlink, + uid: stat.uid, + gid: stat.gid, + rdev: stat.rdev, + size: stat.size, + atime: stat.atime, + mtime: stat.mtime, + ctime: stat.ctime, + blksize: stat.blksize, + blocks: stat.blocks + }; + }, + setattr: function(node, attr) { + var path = NODEFS.realPath(node); + try { + if (attr.mode !== undefined) { + fs.chmodSync(path, attr.mode); + node.mode = attr.mode; + } + if (attr.timestamp !== undefined) { + var date = new Date(attr.timestamp); + fs.utimesSync(path, date, date); + } + if (attr.size !== undefined) { + fs.truncateSync(path, attr.size); + } + } catch (e) { + if (!e.code) throw e; + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + }, + lookup: function(parent, name) { + var path = PATH.join2(NODEFS.realPath(parent), name); + var mode = NODEFS.getMode(path); + return NODEFS.createNode(parent, name, mode); + }, + mknod: function(parent, name, mode, dev) { + var node = NODEFS.createNode(parent, name, mode, dev); + var path = NODEFS.realPath(node); + try { + if (FS.isDir(node.mode)) { + fs.mkdirSync(path, node.mode); + } else { + fs.writeFileSync(path, "", { mode: node.mode }); + } + } catch (e) { + if (!e.code) throw e; + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + return node; + }, + rename: function(oldNode, newDir, newName) { + var oldPath = NODEFS.realPath(oldNode); + var newPath = PATH.join2(NODEFS.realPath(newDir), newName); + try { + fs.renameSync(oldPath, newPath); + } catch (e) { + if (!e.code) throw e; + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + oldNode.name = newName; + }, + unlink: function(parent, name) { + var path = PATH.join2(NODEFS.realPath(parent), name); + try { + fs.unlinkSync(path); + } catch (e) { + if (!e.code) throw e; + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + }, + rmdir: function(parent, name) { + var path = PATH.join2(NODEFS.realPath(parent), name); + try { + fs.rmdirSync(path); + } catch (e) { + if (!e.code) throw e; + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + }, + readdir: function(node) { + var path = NODEFS.realPath(node); + try { + return fs.readdirSync(path); + } catch (e) { + if (!e.code) throw e; + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + }, + symlink: function(parent, newName, oldPath) { + var newPath = PATH.join2(NODEFS.realPath(parent), newName); + try { + fs.symlinkSync(oldPath, newPath); + } catch (e) { + if (!e.code) throw e; + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + }, + readlink: function(node) { + var path = NODEFS.realPath(node); + try { + path = fs.readlinkSync(path); + path = NODEJS_PATH.relative( + NODEJS_PATH.resolve(node.mount.opts.root), + path + ); + return path; + } catch (e) { + if (!e.code) throw e; + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + } + }, + stream_ops: { + open: function(stream) { + var path = NODEFS.realPath(stream.node); + try { + if (FS.isFile(stream.node.mode)) { + stream.nfd = fs.openSync(path, NODEFS.flagsForNode(stream.flags)); + } + } catch (e) { + if (!e.code) throw e; + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + }, + close: function(stream) { + try { + if (FS.isFile(stream.node.mode) && stream.nfd) { + fs.closeSync(stream.nfd); + } + } catch (e) { + if (!e.code) throw e; + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + }, + read: function(stream, buffer, offset, length, position) { + if (length === 0) return 0; + try { + return fs.readSync( + stream.nfd, + NODEFS.bufferFrom(buffer.buffer), + offset, + length, + position + ); + } catch (e) { + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + }, + write: function(stream, buffer, offset, length, position) { + try { + return fs.writeSync( + stream.nfd, + NODEFS.bufferFrom(buffer.buffer), + offset, + length, + position + ); + } catch (e) { + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + }, + llseek: function(stream, offset, whence) { + var position = offset; + if (whence === 1) { + position += stream.position; + } else if (whence === 2) { + if (FS.isFile(stream.node.mode)) { + try { + var stat = fs.fstatSync(stream.nfd); + position += stat.size; + } catch (e) { + throw new FS.ErrnoError(NODEFS.convertNodeCode(e)); + } + } + } + if (position < 0) { + throw new FS.ErrnoError(28); + } + return position; + }, + mmap: function(stream, address, length, position, prot, flags) { + assert(address === 0); + if (!FS.isFile(stream.node.mode)) { + throw new FS.ErrnoError(43); + } + var ptr = FS.mmapAlloc(length); + NODEFS.stream_ops.read(stream, HEAP8, ptr, length, position); + return { ptr: ptr, allocated: true }; + }, + msync: function(stream, buffer, offset, length, mmapFlags) { + if (!FS.isFile(stream.node.mode)) { + throw new FS.ErrnoError(43); + } + if (mmapFlags & 2) { + return 0; + } + var bytesWritten = NODEFS.stream_ops.write( + stream, + buffer, + 0, + length, + offset, + false + ); + return 0; + } + } +}; +var NODERAWFS = { + lookupPath: function(path) { + return { path: path, node: { mode: NODEFS.getMode(path) } }; + }, + createStandardStreams: function() { + FS.streams[0] = { + fd: 0, + nfd: 0, + position: 0, + path: "", + flags: 0, + tty: true, + seekable: false + }; + for (var i = 1; i < 3; i++) { + FS.streams[i] = { + fd: i, + nfd: i, + position: 0, + path: "", + flags: 577, + tty: true, + seekable: false + }; + } + }, + cwd: function() { + return process.cwd(); + }, + chdir: function() { + process.chdir.apply(void 0, arguments); + }, + mknod: function(path, mode) { + if (FS.isDir(path)) { + fs.mkdirSync(path, mode); + } else { + fs.writeFileSync(path, "", { mode: mode }); + } + }, + mkdir: function() { + fs.mkdirSync.apply(void 0, arguments); + }, + symlink: function() { + fs.symlinkSync.apply(void 0, arguments); + }, + rename: function() { + fs.renameSync.apply(void 0, arguments); + }, + rmdir: function() { + fs.rmdirSync.apply(void 0, arguments); + }, + readdir: function() { + fs.readdirSync.apply(void 0, arguments); + }, + unlink: function() { + fs.unlinkSync.apply(void 0, arguments); + }, + readlink: function() { + return fs.readlinkSync.apply(void 0, arguments); + }, + stat: function() { + return fs.statSync.apply(void 0, arguments); + }, + lstat: function() { + return fs.lstatSync.apply(void 0, arguments); + }, + chmod: function() { + fs.chmodSync.apply(void 0, arguments); + }, + fchmod: function() { + fs.fchmodSync.apply(void 0, arguments); + }, + chown: function() { + fs.chownSync.apply(void 0, arguments); + }, + fchown: function() { + fs.fchownSync.apply(void 0, arguments); + }, + truncate: function() { + fs.truncateSync.apply(void 0, arguments); + }, + ftruncate: function() { + fs.ftruncateSync.apply(void 0, arguments); + }, + utime: function() { + fs.utimesSync.apply(void 0, arguments); + }, + open: function(path, flags, mode, suggestFD) { + if (typeof flags === "string") { + flags = VFS.modeStringToFlags(flags); + } + var nfd = fs.openSync(path, NODEFS.flagsForNode(flags), mode); + var fd = suggestFD != null ? suggestFD : FS.nextfd(nfd); + var stream = { + fd: fd, + nfd: nfd, + position: 0, + path: path, + flags: flags, + seekable: true + }; + FS.streams[fd] = stream; + return stream; + }, + close: function(stream) { + if (!stream.stream_ops) { + fs.closeSync(stream.nfd); + } + FS.closeStream(stream.fd); + }, + llseek: function(stream, offset, whence) { + if (stream.stream_ops) { + return VFS.llseek(stream, offset, whence); + } + var position = offset; + if (whence === 1) { + position += stream.position; + } else if (whence === 2) { + position += fs.fstatSync(stream.nfd).size; + } else if (whence !== 0) { + throw new FS.ErrnoError(ERRNO_CODES.EINVAL); + } + if (position < 0) { + throw new FS.ErrnoError(ERRNO_CODES.EINVAL); + } + stream.position = position; + return position; + }, + read: function(stream, buffer, offset, length, position) { + if (stream.stream_ops) { + return VFS.read(stream, buffer, offset, length, position); + } + var seeking = typeof position !== "undefined"; + if (!seeking && stream.seekable) position = stream.position; + var bytesRead = fs.readSync( + stream.nfd, + NODEFS.bufferFrom(buffer.buffer), + offset, + length, + position + ); + if (!seeking) stream.position += bytesRead; + return bytesRead; + }, + write: function(stream, buffer, offset, length, position) { + if (stream.stream_ops) { + return VFS.write(stream, buffer, offset, length, position); + } + if (stream.flags & +"1024") { + FS.llseek(stream, 0, +"2"); + } + var seeking = typeof position !== "undefined"; + if (!seeking && stream.seekable) position = stream.position; + var bytesWritten = fs.writeSync( + stream.nfd, + NODEFS.bufferFrom(buffer.buffer), + offset, + length, + position + ); + if (!seeking) stream.position += bytesWritten; + return bytesWritten; + }, + allocate: function() { + throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP); + }, + mmap: function() { + throw new FS.ErrnoError(ERRNO_CODES.ENODEV); + }, + msync: function() { + return 0; + }, + munmap: function() { + return 0; + }, + ioctl: function() { + throw new FS.ErrnoError(ERRNO_CODES.ENOTTY); + } +}; +var FS = { + root: null, + mounts: [], + devices: {}, + streams: [], + nextInode: 1, + nameTable: null, + currentPath: "/", + initialized: false, + ignorePermissions: true, + trackingDelegate: {}, + tracking: { openFlags: { READ: 1, WRITE: 2 } }, + ErrnoError: null, + genericErrors: {}, + filesystems: null, + syncFSRequests: 0, + handleFSError: function(e) { + if (!(e instanceof FS.ErrnoError)) throw e + " : " + stackTrace(); + return setErrNo(e.errno); + }, + lookupPath: function(path, opts) { + path = PATH_FS.resolve(FS.cwd(), path); + opts = opts || {}; + if (!path) return { path: "", node: null }; + var defaults = { follow_mount: true, recurse_count: 0 }; + for (var key in defaults) { + if (opts[key] === undefined) { + opts[key] = defaults[key]; + } + } + if (opts.recurse_count > 8) { + throw new FS.ErrnoError(32); + } + var parts = PATH.normalizeArray( + path.split("/").filter(function(p) { + return !!p; + }), + false + ); + var current = FS.root; + var current_path = "/"; + for (var i = 0; i < parts.length; i++) { + var islast = i === parts.length - 1; + if (islast && opts.parent) { + break; + } + current = FS.lookupNode(current, parts[i]); + current_path = PATH.join2(current_path, parts[i]); + if (FS.isMountpoint(current)) { + if (!islast || (islast && opts.follow_mount)) { + current = current.mounted.root; + } + } + if (!islast || opts.follow) { + var count = 0; + while (FS.isLink(current.mode)) { + var link = FS.readlink(current_path); + current_path = PATH_FS.resolve(PATH.dirname(current_path), link); + var lookup = FS.lookupPath(current_path, { + recurse_count: opts.recurse_count + }); + current = lookup.node; + if (count++ > 40) { + throw new FS.ErrnoError(32); + } + } + } + } + return { path: current_path, node: current }; + }, + getPath: function(node) { + var path; + while (true) { + if (FS.isRoot(node)) { + var mount = node.mount.mountpoint; + if (!path) return mount; + return mount[mount.length - 1] !== "/" + ? mount + "/" + path + : mount + path; + } + path = path ? node.name + "/" + path : node.name; + node = node.parent; + } + }, + hashName: function(parentid, name) { + var hash = 0; + for (var i = 0; i < name.length; i++) { + hash = ((hash << 5) - hash + name.charCodeAt(i)) | 0; + } + return ((parentid + hash) >>> 0) % FS.nameTable.length; + }, + hashAddNode: function(node) { + var hash = FS.hashName(node.parent.id, node.name); + node.name_next = FS.nameTable[hash]; + FS.nameTable[hash] = node; + }, + hashRemoveNode: function(node) { + var hash = FS.hashName(node.parent.id, node.name); + if (FS.nameTable[hash] === node) { + FS.nameTable[hash] = node.name_next; + } else { + var current = FS.nameTable[hash]; + while (current) { + if (current.name_next === node) { + current.name_next = node.name_next; + break; + } + current = current.name_next; + } + } + }, + lookupNode: function(parent, name) { + var errCode = FS.mayLookup(parent); + if (errCode) { + throw new FS.ErrnoError(errCode, parent); + } + var hash = FS.hashName(parent.id, name); + for (var node = FS.nameTable[hash]; node; node = node.name_next) { + var nodeName = node.name; + if (node.parent.id === parent.id && nodeName === name) { + return node; + } + } + return FS.lookup(parent, name); + }, + createNode: function(parent, name, mode, rdev) { + var node = new FS.FSNode(parent, name, mode, rdev); + FS.hashAddNode(node); + return node; + }, + destroyNode: function(node) { + FS.hashRemoveNode(node); + }, + isRoot: function(node) { + return node === node.parent; + }, + isMountpoint: function(node) { + return !!node.mounted; + }, + isFile: function(mode) { + return (mode & 61440) === 32768; + }, + isDir: function(mode) { + return (mode & 61440) === 16384; + }, + isLink: function(mode) { + return (mode & 61440) === 40960; + }, + isChrdev: function(mode) { + return (mode & 61440) === 8192; + }, + isBlkdev: function(mode) { + return (mode & 61440) === 24576; + }, + isFIFO: function(mode) { + return (mode & 61440) === 4096; + }, + isSocket: function(mode) { + return (mode & 49152) === 49152; + }, + flagModes: { + r: 0, + rs: 1052672, + "r+": 2, + w: 577, + wx: 705, + xw: 705, + "w+": 578, + "wx+": 706, + "xw+": 706, + a: 1089, + ax: 1217, + xa: 1217, + "a+": 1090, + "ax+": 1218, + "xa+": 1218 + }, + modeStringToFlags: function(str) { + var flags = FS.flagModes[str]; + if (typeof flags === "undefined") { + throw new Error("Unknown file open mode: " + str); + } + return flags; + }, + flagsToPermissionString: function(flag) { + var perms = ["r", "w", "rw"][flag & 3]; + if (flag & 512) { + perms += "w"; + } + return perms; + }, + nodePermissions: function(node, perms) { + if (FS.ignorePermissions) { + return 0; + } + if (perms.indexOf("r") !== -1 && !(node.mode & 292)) { + return 2; + } else if (perms.indexOf("w") !== -1 && !(node.mode & 146)) { + return 2; + } else if (perms.indexOf("x") !== -1 && !(node.mode & 73)) { + return 2; + } + return 0; + }, + mayLookup: function(dir) { + var errCode = FS.nodePermissions(dir, "x"); + if (errCode) return errCode; + if (!dir.node_ops.lookup) return 2; + return 0; + }, + mayCreate: function(dir, name) { + try { + var node = FS.lookupNode(dir, name); + return 20; + } catch (e) {} + return FS.nodePermissions(dir, "wx"); + }, + mayDelete: function(dir, name, isdir) { + var node; + try { + node = FS.lookupNode(dir, name); + } catch (e) { + return e.errno; + } + var errCode = FS.nodePermissions(dir, "wx"); + if (errCode) { + return errCode; + } + if (isdir) { + if (!FS.isDir(node.mode)) { + return 54; + } + if (FS.isRoot(node) || FS.getPath(node) === FS.cwd()) { + return 10; + } + } else { + if (FS.isDir(node.mode)) { + return 31; + } + } + return 0; + }, + mayOpen: function(node, flags) { + if (!node) { + return 44; + } + if (FS.isLink(node.mode)) { + return 32; + } else if (FS.isDir(node.mode)) { + if (FS.flagsToPermissionString(flags) !== "r" || flags & 512) { + return 31; + } + } + return FS.nodePermissions(node, FS.flagsToPermissionString(flags)); + }, + MAX_OPEN_FDS: 4096, + nextfd: function(fd_start, fd_end) { + fd_start = fd_start || 0; + fd_end = fd_end || FS.MAX_OPEN_FDS; + for (var fd = fd_start; fd <= fd_end; fd++) { + if (!FS.streams[fd]) { + return fd; + } + } + throw new FS.ErrnoError(33); + }, + getStream: function(fd) { + return FS.streams[fd]; + }, + createStream: function(stream, fd_start, fd_end) { + if (!FS.FSStream) { + FS.FSStream = function() {}; + FS.FSStream.prototype = { + object: { + get: function() { + return this.node; + }, + set: function(val) { + this.node = val; + } + }, + isRead: { + get: function() { + return (this.flags & 2097155) !== 1; + } + }, + isWrite: { + get: function() { + return (this.flags & 2097155) !== 0; + } + }, + isAppend: { + get: function() { + return this.flags & 1024; + } + } + }; + } + var newStream = new FS.FSStream(); + for (var p in stream) { + newStream[p] = stream[p]; + } + stream = newStream; + var fd = FS.nextfd(fd_start, fd_end); + stream.fd = fd; + FS.streams[fd] = stream; + return stream; + }, + closeStream: function(fd) { + FS.streams[fd] = null; + }, + chrdev_stream_ops: { + open: function(stream) { + var device = FS.getDevice(stream.node.rdev); + stream.stream_ops = device.stream_ops; + if (stream.stream_ops.open) { + stream.stream_ops.open(stream); + } + }, + llseek: function() { + throw new FS.ErrnoError(70); + } + }, + major: function(dev) { + return dev >> 8; + }, + minor: function(dev) { + return dev & 255; + }, + makedev: function(ma, mi) { + return (ma << 8) | mi; + }, + registerDevice: function(dev, ops) { + FS.devices[dev] = { stream_ops: ops }; + }, + getDevice: function(dev) { + return FS.devices[dev]; + }, + getMounts: function(mount) { + var mounts = []; + var check = [mount]; + while (check.length) { + var m = check.pop(); + mounts.push(m); + check.push.apply(check, m.mounts); + } + return mounts; + }, + syncfs: function(populate, callback) { + if (typeof populate === "function") { + callback = populate; + populate = false; + } + FS.syncFSRequests++; + if (FS.syncFSRequests > 1) { + err( + "warning: " + + FS.syncFSRequests + + " FS.syncfs operations in flight at once, probably just doing extra work" + ); + } + var mounts = FS.getMounts(FS.root.mount); + var completed = 0; + function doCallback(errCode) { + FS.syncFSRequests--; + return callback(errCode); + } + function done(errCode) { + if (errCode) { + if (!done.errored) { + done.errored = true; + return doCallback(errCode); + } + return; + } + if (++completed >= mounts.length) { + doCallback(null); + } + } + mounts.forEach(function(mount) { + if (!mount.type.syncfs) { + return done(null); + } + mount.type.syncfs(mount, populate, done); + }); + }, + mount: function(type, opts, mountpoint) { + var root = mountpoint === "/"; + var pseudo = !mountpoint; + var node; + if (root && FS.root) { + throw new FS.ErrnoError(10); + } else if (!root && !pseudo) { + var lookup = FS.lookupPath(mountpoint, { follow_mount: false }); + mountpoint = lookup.path; + node = lookup.node; + if (FS.isMountpoint(node)) { + throw new FS.ErrnoError(10); + } + if (!FS.isDir(node.mode)) { + throw new FS.ErrnoError(54); + } + } + var mount = { type: type, opts: opts, mountpoint: mountpoint, mounts: [] }; + var mountRoot = type.mount(mount); + mountRoot.mount = mount; + mount.root = mountRoot; + if (root) { + FS.root = mountRoot; + } else if (node) { + node.mounted = mount; + if (node.mount) { + node.mount.mounts.push(mount); + } + } + return mountRoot; + }, + unmount: function(mountpoint) { + var lookup = FS.lookupPath(mountpoint, { follow_mount: false }); + if (!FS.isMountpoint(lookup.node)) { + throw new FS.ErrnoError(28); + } + var node = lookup.node; + var mount = node.mounted; + var mounts = FS.getMounts(mount); + Object.keys(FS.nameTable).forEach(function(hash) { + var current = FS.nameTable[hash]; + while (current) { + var next = current.name_next; + if (mounts.indexOf(current.mount) !== -1) { + FS.destroyNode(current); + } + current = next; + } + }); + node.mounted = null; + var idx = node.mount.mounts.indexOf(mount); + node.mount.mounts.splice(idx, 1); + }, + lookup: function(parent, name) { + return parent.node_ops.lookup(parent, name); + }, + mknod: function(path, mode, dev) { + var lookup = FS.lookupPath(path, { parent: true }); + var parent = lookup.node; + var name = PATH.basename(path); + if (!name || name === "." || name === "..") { + throw new FS.ErrnoError(28); + } + var errCode = FS.mayCreate(parent, name); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + if (!parent.node_ops.mknod) { + throw new FS.ErrnoError(63); + } + return parent.node_ops.mknod(parent, name, mode, dev); + }, + create: function(path, mode) { + mode = mode !== undefined ? mode : 438; + mode &= 4095; + mode |= 32768; + return FS.mknod(path, mode, 0); + }, + mkdir: function(path, mode) { + mode = mode !== undefined ? mode : 511; + mode &= 511 | 512; + mode |= 16384; + return FS.mknod(path, mode, 0); + }, + mkdirTree: function(path, mode) { + var dirs = path.split("/"); + var d = ""; + for (var i = 0; i < dirs.length; ++i) { + if (!dirs[i]) continue; + d += "/" + dirs[i]; + try { + FS.mkdir(d, mode); + } catch (e) { + if (e.errno != 20) throw e; + } + } + }, + mkdev: function(path, mode, dev) { + if (typeof dev === "undefined") { + dev = mode; + mode = 438; + } + mode |= 8192; + return FS.mknod(path, mode, dev); + }, + symlink: function(oldpath, newpath) { + if (!PATH_FS.resolve(oldpath)) { + throw new FS.ErrnoError(44); + } + var lookup = FS.lookupPath(newpath, { parent: true }); + var parent = lookup.node; + if (!parent) { + throw new FS.ErrnoError(44); + } + var newname = PATH.basename(newpath); + var errCode = FS.mayCreate(parent, newname); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + if (!parent.node_ops.symlink) { + throw new FS.ErrnoError(63); + } + return parent.node_ops.symlink(parent, newname, oldpath); + }, + rename: function(old_path, new_path) { + var old_dirname = PATH.dirname(old_path); + var new_dirname = PATH.dirname(new_path); + var old_name = PATH.basename(old_path); + var new_name = PATH.basename(new_path); + var lookup, old_dir, new_dir; + lookup = FS.lookupPath(old_path, { parent: true }); + old_dir = lookup.node; + lookup = FS.lookupPath(new_path, { parent: true }); + new_dir = lookup.node; + if (!old_dir || !new_dir) throw new FS.ErrnoError(44); + if (old_dir.mount !== new_dir.mount) { + throw new FS.ErrnoError(75); + } + var old_node = FS.lookupNode(old_dir, old_name); + var relative = PATH_FS.relative(old_path, new_dirname); + if (relative.charAt(0) !== ".") { + throw new FS.ErrnoError(28); + } + relative = PATH_FS.relative(new_path, old_dirname); + if (relative.charAt(0) !== ".") { + throw new FS.ErrnoError(55); + } + var new_node; + try { + new_node = FS.lookupNode(new_dir, new_name); + } catch (e) {} + if (old_node === new_node) { + return; + } + var isdir = FS.isDir(old_node.mode); + var errCode = FS.mayDelete(old_dir, old_name, isdir); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + errCode = new_node + ? FS.mayDelete(new_dir, new_name, isdir) + : FS.mayCreate(new_dir, new_name); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + if (!old_dir.node_ops.rename) { + throw new FS.ErrnoError(63); + } + if (FS.isMountpoint(old_node) || (new_node && FS.isMountpoint(new_node))) { + throw new FS.ErrnoError(10); + } + if (new_dir !== old_dir) { + errCode = FS.nodePermissions(old_dir, "w"); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + } + try { + if (FS.trackingDelegate["willMovePath"]) { + FS.trackingDelegate["willMovePath"](old_path, new_path); + } + } catch (e) { + err( + "FS.trackingDelegate['willMovePath']('" + + old_path + + "', '" + + new_path + + "') threw an exception: " + + e.message + ); + } + FS.hashRemoveNode(old_node); + try { + old_dir.node_ops.rename(old_node, new_dir, new_name); + } catch (e) { + throw e; + } finally { + FS.hashAddNode(old_node); + } + try { + if (FS.trackingDelegate["onMovePath"]) + FS.trackingDelegate["onMovePath"](old_path, new_path); + } catch (e) { + err( + "FS.trackingDelegate['onMovePath']('" + + old_path + + "', '" + + new_path + + "') threw an exception: " + + e.message + ); + } + }, + rmdir: function(path) { + var lookup = FS.lookupPath(path, { parent: true }); + var parent = lookup.node; + var name = PATH.basename(path); + var node = FS.lookupNode(parent, name); + var errCode = FS.mayDelete(parent, name, true); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + if (!parent.node_ops.rmdir) { + throw new FS.ErrnoError(63); + } + if (FS.isMountpoint(node)) { + throw new FS.ErrnoError(10); + } + try { + if (FS.trackingDelegate["willDeletePath"]) { + FS.trackingDelegate["willDeletePath"](path); + } + } catch (e) { + err( + "FS.trackingDelegate['willDeletePath']('" + + path + + "') threw an exception: " + + e.message + ); + } + parent.node_ops.rmdir(parent, name); + FS.destroyNode(node); + try { + if (FS.trackingDelegate["onDeletePath"]) + FS.trackingDelegate["onDeletePath"](path); + } catch (e) { + err( + "FS.trackingDelegate['onDeletePath']('" + + path + + "') threw an exception: " + + e.message + ); + } + }, + readdir: function(path) { + var lookup = FS.lookupPath(path, { follow: true }); + var node = lookup.node; + if (!node.node_ops.readdir) { + throw new FS.ErrnoError(54); + } + return node.node_ops.readdir(node); + }, + unlink: function(path) { + var lookup = FS.lookupPath(path, { parent: true }); + var parent = lookup.node; + var name = PATH.basename(path); + var node = FS.lookupNode(parent, name); + var errCode = FS.mayDelete(parent, name, false); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + if (!parent.node_ops.unlink) { + throw new FS.ErrnoError(63); + } + if (FS.isMountpoint(node)) { + throw new FS.ErrnoError(10); + } + try { + if (FS.trackingDelegate["willDeletePath"]) { + FS.trackingDelegate["willDeletePath"](path); + } + } catch (e) { + err( + "FS.trackingDelegate['willDeletePath']('" + + path + + "') threw an exception: " + + e.message + ); + } + parent.node_ops.unlink(parent, name); + FS.destroyNode(node); + try { + if (FS.trackingDelegate["onDeletePath"]) + FS.trackingDelegate["onDeletePath"](path); + } catch (e) { + err( + "FS.trackingDelegate['onDeletePath']('" + + path + + "') threw an exception: " + + e.message + ); + } + }, + readlink: function(path) { + var lookup = FS.lookupPath(path); + var link = lookup.node; + if (!link) { + throw new FS.ErrnoError(44); + } + if (!link.node_ops.readlink) { + throw new FS.ErrnoError(28); + } + return PATH_FS.resolve( + FS.getPath(link.parent), + link.node_ops.readlink(link) + ); + }, + stat: function(path, dontFollow) { + var lookup = FS.lookupPath(path, { follow: !dontFollow }); + var node = lookup.node; + if (!node) { + throw new FS.ErrnoError(44); + } + if (!node.node_ops.getattr) { + throw new FS.ErrnoError(63); + } + return node.node_ops.getattr(node); + }, + lstat: function(path) { + return FS.stat(path, true); + }, + chmod: function(path, mode, dontFollow) { + var node; + if (typeof path === "string") { + var lookup = FS.lookupPath(path, { follow: !dontFollow }); + node = lookup.node; + } else { + node = path; + } + if (!node.node_ops.setattr) { + throw new FS.ErrnoError(63); + } + node.node_ops.setattr(node, { + mode: (mode & 4095) | (node.mode & ~4095), + timestamp: Date.now() + }); + }, + lchmod: function(path, mode) { + FS.chmod(path, mode, true); + }, + fchmod: function(fd, mode) { + var stream = FS.getStream(fd); + if (!stream) { + throw new FS.ErrnoError(8); + } + FS.chmod(stream.node, mode); + }, + chown: function(path, uid, gid, dontFollow) { + var node; + if (typeof path === "string") { + var lookup = FS.lookupPath(path, { follow: !dontFollow }); + node = lookup.node; + } else { + node = path; + } + if (!node.node_ops.setattr) { + throw new FS.ErrnoError(63); + } + node.node_ops.setattr(node, { timestamp: Date.now() }); + }, + lchown: function(path, uid, gid) { + FS.chown(path, uid, gid, true); + }, + fchown: function(fd, uid, gid) { + var stream = FS.getStream(fd); + if (!stream) { + throw new FS.ErrnoError(8); + } + FS.chown(stream.node, uid, gid); + }, + truncate: function(path, len) { + if (len < 0) { + throw new FS.ErrnoError(28); + } + var node; + if (typeof path === "string") { + var lookup = FS.lookupPath(path, { follow: true }); + node = lookup.node; + } else { + node = path; + } + if (!node.node_ops.setattr) { + throw new FS.ErrnoError(63); + } + if (FS.isDir(node.mode)) { + throw new FS.ErrnoError(31); + } + if (!FS.isFile(node.mode)) { + throw new FS.ErrnoError(28); + } + var errCode = FS.nodePermissions(node, "w"); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + node.node_ops.setattr(node, { size: len, timestamp: Date.now() }); + }, + ftruncate: function(fd, len) { + var stream = FS.getStream(fd); + if (!stream) { + throw new FS.ErrnoError(8); + } + if ((stream.flags & 2097155) === 0) { + throw new FS.ErrnoError(28); + } + FS.truncate(stream.node, len); + }, + utime: function(path, atime, mtime) { + var lookup = FS.lookupPath(path, { follow: true }); + var node = lookup.node; + node.node_ops.setattr(node, { timestamp: Math.max(atime, mtime) }); + }, + open: function(path, flags, mode, fd_start, fd_end) { + if (path === "") { + throw new FS.ErrnoError(44); + } + flags = typeof flags === "string" ? FS.modeStringToFlags(flags) : flags; + mode = typeof mode === "undefined" ? 438 : mode; + if (flags & 64) { + mode = (mode & 4095) | 32768; + } else { + mode = 0; + } + var node; + if (typeof path === "object") { + node = path; + } else { + path = PATH.normalize(path); + try { + var lookup = FS.lookupPath(path, { follow: !(flags & 131072) }); + node = lookup.node; + } catch (e) {} + } + var created = false; + if (flags & 64) { + if (node) { + if (flags & 128) { + throw new FS.ErrnoError(20); + } + } else { + node = FS.mknod(path, mode, 0); + created = true; + } + } + if (!node) { + throw new FS.ErrnoError(44); + } + if (FS.isChrdev(node.mode)) { + flags &= ~512; + } + if (flags & 65536 && !FS.isDir(node.mode)) { + throw new FS.ErrnoError(54); + } + if (!created) { + var errCode = FS.mayOpen(node, flags); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + } + if (flags & 512) { + FS.truncate(node, 0); + } + flags &= ~(128 | 512 | 131072); + var stream = FS.createStream( + { + node: node, + path: FS.getPath(node), + flags: flags, + seekable: true, + position: 0, + stream_ops: node.stream_ops, + ungotten: [], + error: false + }, + fd_start, + fd_end + ); + if (stream.stream_ops.open) { + stream.stream_ops.open(stream); + } + if (Module["logReadFiles"] && !(flags & 1)) { + if (!FS.readFiles) FS.readFiles = {}; + if (!(path in FS.readFiles)) { + FS.readFiles[path] = 1; + err("FS.trackingDelegate error on read file: " + path); + } + } + try { + if (FS.trackingDelegate["onOpenFile"]) { + var trackingFlags = 0; + if ((flags & 2097155) !== 1) { + trackingFlags |= FS.tracking.openFlags.READ; + } + if ((flags & 2097155) !== 0) { + trackingFlags |= FS.tracking.openFlags.WRITE; + } + FS.trackingDelegate["onOpenFile"](path, trackingFlags); + } + } catch (e) { + err( + "FS.trackingDelegate['onOpenFile']('" + + path + + "', flags) threw an exception: " + + e.message + ); + } + return stream; + }, + close: function(stream) { + if (FS.isClosed(stream)) { + throw new FS.ErrnoError(8); + } + if (stream.getdents) stream.getdents = null; + try { + if (stream.stream_ops.close) { + stream.stream_ops.close(stream); + } + } catch (e) { + throw e; + } finally { + FS.closeStream(stream.fd); + } + stream.fd = null; + }, + isClosed: function(stream) { + return stream.fd === null; + }, + llseek: function(stream, offset, whence) { + if (FS.isClosed(stream)) { + throw new FS.ErrnoError(8); + } + if (!stream.seekable || !stream.stream_ops.llseek) { + throw new FS.ErrnoError(70); + } + if (whence != 0 && whence != 1 && whence != 2) { + throw new FS.ErrnoError(28); + } + stream.position = stream.stream_ops.llseek(stream, offset, whence); + stream.ungotten = []; + return stream.position; + }, + read: function(stream, buffer, offset, length, position) { + if (length < 0 || position < 0) { + throw new FS.ErrnoError(28); + } + if (FS.isClosed(stream)) { + throw new FS.ErrnoError(8); + } + if ((stream.flags & 2097155) === 1) { + throw new FS.ErrnoError(8); + } + if (FS.isDir(stream.node.mode)) { + throw new FS.ErrnoError(31); + } + if (!stream.stream_ops.read) { + throw new FS.ErrnoError(28); + } + var seeking = typeof position !== "undefined"; + if (!seeking) { + position = stream.position; + } else if (!stream.seekable) { + throw new FS.ErrnoError(70); + } + var bytesRead = stream.stream_ops.read( + stream, + buffer, + offset, + length, + position + ); + if (!seeking) stream.position += bytesRead; + return bytesRead; + }, + write: function(stream, buffer, offset, length, position, canOwn) { + if (length < 0 || position < 0) { + throw new FS.ErrnoError(28); + } + if (FS.isClosed(stream)) { + throw new FS.ErrnoError(8); + } + if ((stream.flags & 2097155) === 0) { + throw new FS.ErrnoError(8); + } + if (FS.isDir(stream.node.mode)) { + throw new FS.ErrnoError(31); + } + if (!stream.stream_ops.write) { + throw new FS.ErrnoError(28); + } + if (stream.seekable && stream.flags & 1024) { + FS.llseek(stream, 0, 2); + } + var seeking = typeof position !== "undefined"; + if (!seeking) { + position = stream.position; + } else if (!stream.seekable) { + throw new FS.ErrnoError(70); + } + var bytesWritten = stream.stream_ops.write( + stream, + buffer, + offset, + length, + position, + canOwn + ); + if (!seeking) stream.position += bytesWritten; + try { + if (stream.path && FS.trackingDelegate["onWriteToFile"]) + FS.trackingDelegate["onWriteToFile"](stream.path); + } catch (e) { + err( + "FS.trackingDelegate['onWriteToFile']('" + + stream.path + + "') threw an exception: " + + e.message + ); + } + return bytesWritten; + }, + allocate: function(stream, offset, length) { + if (FS.isClosed(stream)) { + throw new FS.ErrnoError(8); + } + if (offset < 0 || length <= 0) { + throw new FS.ErrnoError(28); + } + if ((stream.flags & 2097155) === 0) { + throw new FS.ErrnoError(8); + } + if (!FS.isFile(stream.node.mode) && !FS.isDir(stream.node.mode)) { + throw new FS.ErrnoError(43); + } + if (!stream.stream_ops.allocate) { + throw new FS.ErrnoError(138); + } + stream.stream_ops.allocate(stream, offset, length); + }, + mmap: function(stream, address, length, position, prot, flags) { + if ( + (prot & 2) !== 0 && + (flags & 2) === 0 && + (stream.flags & 2097155) !== 2 + ) { + throw new FS.ErrnoError(2); + } + if ((stream.flags & 2097155) === 1) { + throw new FS.ErrnoError(2); + } + if (!stream.stream_ops.mmap) { + throw new FS.ErrnoError(43); + } + return stream.stream_ops.mmap( + stream, + address, + length, + position, + prot, + flags + ); + }, + msync: function(stream, buffer, offset, length, mmapFlags) { + if (!stream || !stream.stream_ops.msync) { + return 0; + } + return stream.stream_ops.msync(stream, buffer, offset, length, mmapFlags); + }, + munmap: function(stream) { + return 0; + }, + ioctl: function(stream, cmd, arg) { + if (!stream.stream_ops.ioctl) { + throw new FS.ErrnoError(59); + } + return stream.stream_ops.ioctl(stream, cmd, arg); + }, + readFile: function(path, opts) { + opts = opts || {}; + opts.flags = opts.flags || "r"; + opts.encoding = opts.encoding || "binary"; + if (opts.encoding !== "utf8" && opts.encoding !== "binary") { + throw new Error('Invalid encoding type "' + opts.encoding + '"'); + } + var ret; + var stream = FS.open(path, opts.flags); + var stat = FS.stat(path); + var length = stat.size; + var buf = new Uint8Array(length); + FS.read(stream, buf, 0, length, 0); + if (opts.encoding === "utf8") { + ret = UTF8ArrayToString(buf, 0); + } else if (opts.encoding === "binary") { + ret = buf; + } + FS.close(stream); + return ret; + }, + writeFile: function(path, data, opts) { + opts = opts || {}; + opts.flags = opts.flags || "w"; + var stream = FS.open(path, opts.flags, opts.mode); + if (typeof data === "string") { + var buf = new Uint8Array(lengthBytesUTF8(data) + 1); + var actualNumBytes = stringToUTF8Array(data, buf, 0, buf.length); + FS.write(stream, buf, 0, actualNumBytes, undefined, opts.canOwn); + } else if (ArrayBuffer.isView(data)) { + FS.write(stream, data, 0, data.byteLength, undefined, opts.canOwn); + } else { + throw new Error("Unsupported data type"); + } + FS.close(stream); + }, + cwd: function() { + return FS.currentPath; + }, + chdir: function(path) { + var lookup = FS.lookupPath(path, { follow: true }); + if (lookup.node === null) { + throw new FS.ErrnoError(44); + } + if (!FS.isDir(lookup.node.mode)) { + throw new FS.ErrnoError(54); + } + var errCode = FS.nodePermissions(lookup.node, "x"); + if (errCode) { + throw new FS.ErrnoError(errCode); + } + FS.currentPath = lookup.path; + }, + createDefaultDirectories: function() { + FS.mkdir("/tmp"); + FS.mkdir("/home"); + FS.mkdir("/home/web_user"); + }, + createDefaultDevices: function() { + FS.mkdir("/dev"); + FS.registerDevice(FS.makedev(1, 3), { + read: function() { + return 0; + }, + write: function(stream, buffer, offset, length, pos) { + return length; + } + }); + FS.mkdev("/dev/null", FS.makedev(1, 3)); + TTY.register(FS.makedev(5, 0), TTY.default_tty_ops); + TTY.register(FS.makedev(6, 0), TTY.default_tty1_ops); + FS.mkdev("/dev/tty", FS.makedev(5, 0)); + FS.mkdev("/dev/tty1", FS.makedev(6, 0)); + var random_device; + if ( + typeof crypto === "object" && + typeof crypto["getRandomValues"] === "function" + ) { + var randomBuffer = new Uint8Array(1); + random_device = function() { + crypto.getRandomValues(randomBuffer); + return randomBuffer[0]; + }; + } else if (ENVIRONMENT_IS_NODE) { + try { + var crypto_module = __webpack_require__(417); + random_device = function() { + return crypto_module["randomBytes"](1)[0]; + }; + } catch (e) {} + } else { + } + if (!random_device) { + random_device = function() { + abort("random_device"); + }; + } + FS.createDevice("/dev", "random", random_device); + FS.createDevice("/dev", "urandom", random_device); + FS.mkdir("/dev/shm"); + FS.mkdir("/dev/shm/tmp"); + }, + createSpecialDirectories: function() { + FS.mkdir("/proc"); + FS.mkdir("/proc/self"); + FS.mkdir("/proc/self/fd"); + FS.mount( + { + mount: function() { + var node = FS.createNode("/proc/self", "fd", 16384 | 511, 73); + node.node_ops = { + lookup: function(parent, name) { + var fd = +name; + var stream = FS.getStream(fd); + if (!stream) throw new FS.ErrnoError(8); + var ret = { + parent: null, + mount: { mountpoint: "fake" }, + node_ops: { + readlink: function() { + return stream.path; + } + } + }; + ret.parent = ret; + return ret; + } + }; + return node; + } + }, + {}, + "/proc/self/fd" + ); + }, + createStandardStreams: function() { + if (Module["stdin"]) { + FS.createDevice("/dev", "stdin", Module["stdin"]); + } else { + FS.symlink("/dev/tty", "/dev/stdin"); + } + if (Module["stdout"]) { + FS.createDevice("/dev", "stdout", null, Module["stdout"]); + } else { + FS.symlink("/dev/tty", "/dev/stdout"); + } + if (Module["stderr"]) { + FS.createDevice("/dev", "stderr", null, Module["stderr"]); + } else { + FS.symlink("/dev/tty1", "/dev/stderr"); + } + var stdin = FS.open("/dev/stdin", "r"); + var stdout = FS.open("/dev/stdout", "w"); + var stderr = FS.open("/dev/stderr", "w"); + }, + ensureErrnoError: function() { + if (FS.ErrnoError) return; + FS.ErrnoError = function ErrnoError(errno, node) { + this.node = node; + this.setErrno = function(errno) { + this.errno = errno; + }; + this.setErrno(errno); + this.message = "FS error"; + }; + FS.ErrnoError.prototype = new Error(); + FS.ErrnoError.prototype.constructor = FS.ErrnoError; + [44].forEach(function(code) { + FS.genericErrors[code] = new FS.ErrnoError(code); + FS.genericErrors[code].stack = ""; + }); + }, + staticInit: function() { + FS.ensureErrnoError(); + FS.nameTable = new Array(4096); + FS.mount(MEMFS, {}, "/"); + FS.createDefaultDirectories(); + FS.createDefaultDevices(); + FS.createSpecialDirectories(); + FS.filesystems = { MEMFS: MEMFS, NODEFS: NODEFS }; + }, + init: function(input, output, error) { + FS.init.initialized = true; + FS.ensureErrnoError(); + Module["stdin"] = input || Module["stdin"]; + Module["stdout"] = output || Module["stdout"]; + Module["stderr"] = error || Module["stderr"]; + FS.createStandardStreams(); + }, + quit: function() { + FS.init.initialized = false; + var fflush = Module["_fflush"]; + if (fflush) fflush(0); + for (var i = 0; i < FS.streams.length; i++) { + var stream = FS.streams[i]; + if (!stream) { + continue; + } + FS.close(stream); + } + }, + getMode: function(canRead, canWrite) { + var mode = 0; + if (canRead) mode |= 292 | 73; + if (canWrite) mode |= 146; + return mode; + }, + joinPath: function(parts, forceRelative) { + var path = PATH.join.apply(null, parts); + if (forceRelative && path[0] == "/") path = path.substr(1); + return path; + }, + absolutePath: function(relative, base) { + return PATH_FS.resolve(base, relative); + }, + standardizePath: function(path) { + return PATH.normalize(path); + }, + findObject: function(path, dontResolveLastLink) { + var ret = FS.analyzePath(path, dontResolveLastLink); + if (ret.exists) { + return ret.object; + } else { + setErrNo(ret.error); + return null; + } + }, + analyzePath: function(path, dontResolveLastLink) { + try { + var lookup = FS.lookupPath(path, { follow: !dontResolveLastLink }); + path = lookup.path; + } catch (e) {} + var ret = { + isRoot: false, + exists: false, + error: 0, + name: null, + path: null, + object: null, + parentExists: false, + parentPath: null, + parentObject: null + }; + try { + var lookup = FS.lookupPath(path, { parent: true }); + ret.parentExists = true; + ret.parentPath = lookup.path; + ret.parentObject = lookup.node; + ret.name = PATH.basename(path); + lookup = FS.lookupPath(path, { follow: !dontResolveLastLink }); + ret.exists = true; + ret.path = lookup.path; + ret.object = lookup.node; + ret.name = lookup.node.name; + ret.isRoot = lookup.path === "/"; + } catch (e) { + ret.error = e.errno; + } + return ret; + }, + createFolder: function(parent, name, canRead, canWrite) { + var path = PATH.join2( + typeof parent === "string" ? parent : FS.getPath(parent), + name + ); + var mode = FS.getMode(canRead, canWrite); + return FS.mkdir(path, mode); + }, + createPath: function(parent, path, canRead, canWrite) { + parent = typeof parent === "string" ? parent : FS.getPath(parent); + var parts = path.split("/").reverse(); + while (parts.length) { + var part = parts.pop(); + if (!part) continue; + var current = PATH.join2(parent, part); + try { + FS.mkdir(current); + } catch (e) {} + parent = current; + } + return current; + }, + createFile: function(parent, name, properties, canRead, canWrite) { + var path = PATH.join2( + typeof parent === "string" ? parent : FS.getPath(parent), + name + ); + var mode = FS.getMode(canRead, canWrite); + return FS.create(path, mode); + }, + createDataFile: function(parent, name, data, canRead, canWrite, canOwn) { + var path = name + ? PATH.join2( + typeof parent === "string" ? parent : FS.getPath(parent), + name + ) + : parent; + var mode = FS.getMode(canRead, canWrite); + var node = FS.create(path, mode); + if (data) { + if (typeof data === "string") { + var arr = new Array(data.length); + for (var i = 0, len = data.length; i < len; ++i) + arr[i] = data.charCodeAt(i); + data = arr; + } + FS.chmod(node, mode | 146); + var stream = FS.open(node, "w"); + FS.write(stream, data, 0, data.length, 0, canOwn); + FS.close(stream); + FS.chmod(node, mode); + } + return node; + }, + createDevice: function(parent, name, input, output) { + var path = PATH.join2( + typeof parent === "string" ? parent : FS.getPath(parent), + name + ); + var mode = FS.getMode(!!input, !!output); + if (!FS.createDevice.major) FS.createDevice.major = 64; + var dev = FS.makedev(FS.createDevice.major++, 0); + FS.registerDevice(dev, { + open: function(stream) { + stream.seekable = false; + }, + close: function(stream) { + if (output && output.buffer && output.buffer.length) { + output(10); + } + }, + read: function(stream, buffer, offset, length, pos) { + var bytesRead = 0; + for (var i = 0; i < length; i++) { + var result; + try { + result = input(); + } catch (e) { + throw new FS.ErrnoError(29); + } + if (result === undefined && bytesRead === 0) { + throw new FS.ErrnoError(6); + } + if (result === null || result === undefined) break; + bytesRead++; + buffer[offset + i] = result; + } + if (bytesRead) { + stream.node.timestamp = Date.now(); + } + return bytesRead; + }, + write: function(stream, buffer, offset, length, pos) { + for (var i = 0; i < length; i++) { + try { + output(buffer[offset + i]); + } catch (e) { + throw new FS.ErrnoError(29); + } + } + if (length) { + stream.node.timestamp = Date.now(); + } + return i; + } + }); + return FS.mkdev(path, mode, dev); + }, + createLink: function(parent, name, target, canRead, canWrite) { + var path = PATH.join2( + typeof parent === "string" ? parent : FS.getPath(parent), + name + ); + return FS.symlink(target, path); + }, + forceLoadFile: function(obj) { + if (obj.isDevice || obj.isFolder || obj.link || obj.contents) return true; + var success = true; + if (typeof XMLHttpRequest !== "undefined") { + throw new Error( + "Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread." + ); + } else if (read_) { + try { + obj.contents = intArrayFromString(read_(obj.url), true); + obj.usedBytes = obj.contents.length; + } catch (e) { + success = false; + } + } else { + throw new Error("Cannot load without read() or XMLHttpRequest."); + } + if (!success) setErrNo(29); + return success; + }, + createLazyFile: function(parent, name, url, canRead, canWrite) { + function LazyUint8Array() { + this.lengthKnown = false; + this.chunks = []; + } + LazyUint8Array.prototype.get = function LazyUint8Array_get(idx) { + if (idx > this.length - 1 || idx < 0) { + return undefined; + } + var chunkOffset = idx % this.chunkSize; + var chunkNum = (idx / this.chunkSize) | 0; + return this.getter(chunkNum)[chunkOffset]; + }; + LazyUint8Array.prototype.setDataGetter = function LazyUint8Array_setDataGetter( + getter + ) { + this.getter = getter; + }; + LazyUint8Array.prototype.cacheLength = function LazyUint8Array_cacheLength() { + var xhr = new XMLHttpRequest(); + xhr.open("HEAD", url, false); + xhr.send(null); + if (!((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304)) + throw new Error("Couldn't load " + url + ". Status: " + xhr.status); + var datalength = Number(xhr.getResponseHeader("Content-length")); + var header; + var hasByteServing = + (header = xhr.getResponseHeader("Accept-Ranges")) && header === "bytes"; + var usesGzip = + (header = xhr.getResponseHeader("Content-Encoding")) && + header === "gzip"; + var chunkSize = 1024 * 1024; + if (!hasByteServing) chunkSize = datalength; + var doXHR = function(from, to) { + if (from > to) + throw new Error( + "invalid range (" + from + ", " + to + ") or no bytes requested!" + ); + if (to > datalength - 1) + throw new Error( + "only " + datalength + " bytes available! programmer error!" + ); + var xhr = new XMLHttpRequest(); + xhr.open("GET", url, false); + if (datalength !== chunkSize) + xhr.setRequestHeader("Range", "bytes=" + from + "-" + to); + if (typeof Uint8Array != "undefined") xhr.responseType = "arraybuffer"; + if (xhr.overrideMimeType) { + xhr.overrideMimeType("text/plain; charset=x-user-defined"); + } + xhr.send(null); + if (!((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304)) + throw new Error("Couldn't load " + url + ". Status: " + xhr.status); + if (xhr.response !== undefined) { + return new Uint8Array(xhr.response || []); + } else { + return intArrayFromString(xhr.responseText || "", true); + } + }; + var lazyArray = this; + lazyArray.setDataGetter(function(chunkNum) { + var start = chunkNum * chunkSize; + var end = (chunkNum + 1) * chunkSize - 1; + end = Math.min(end, datalength - 1); + if (typeof lazyArray.chunks[chunkNum] === "undefined") { + lazyArray.chunks[chunkNum] = doXHR(start, end); + } + if (typeof lazyArray.chunks[chunkNum] === "undefined") + throw new Error("doXHR failed!"); + return lazyArray.chunks[chunkNum]; + }); + if (usesGzip || !datalength) { + chunkSize = datalength = 1; + datalength = this.getter(0).length; + chunkSize = datalength; + out( + "LazyFiles on gzip forces download of the whole file when length is accessed" + ); + } + this._length = datalength; + this._chunkSize = chunkSize; + this.lengthKnown = true; + }; + if (typeof XMLHttpRequest !== "undefined") { + if (!ENVIRONMENT_IS_WORKER) + throw "Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc"; + var lazyArray = new LazyUint8Array(); + Object.defineProperties(lazyArray, { + length: { + get: function() { + if (!this.lengthKnown) { + this.cacheLength(); + } + return this._length; + } + }, + chunkSize: { + get: function() { + if (!this.lengthKnown) { + this.cacheLength(); + } + return this._chunkSize; + } + } + }); + var properties = { isDevice: false, contents: lazyArray }; + } else { + var properties = { isDevice: false, url: url }; + } + var node = FS.createFile(parent, name, properties, canRead, canWrite); + if (properties.contents) { + node.contents = properties.contents; + } else if (properties.url) { + node.contents = null; + node.url = properties.url; + } + Object.defineProperties(node, { + usedBytes: { + get: function() { + return this.contents.length; + } + } + }); + var stream_ops = {}; + var keys = Object.keys(node.stream_ops); + keys.forEach(function(key) { + var fn = node.stream_ops[key]; + stream_ops[key] = function forceLoadLazyFile() { + if (!FS.forceLoadFile(node)) { + throw new FS.ErrnoError(29); + } + return fn.apply(null, arguments); + }; + }); + stream_ops.read = function stream_ops_read( + stream, + buffer, + offset, + length, + position + ) { + if (!FS.forceLoadFile(node)) { + throw new FS.ErrnoError(29); + } + var contents = stream.node.contents; + if (position >= contents.length) return 0; + var size = Math.min(contents.length - position, length); + if (contents.slice) { + for (var i = 0; i < size; i++) { + buffer[offset + i] = contents[position + i]; + } + } else { + for (var i = 0; i < size; i++) { + buffer[offset + i] = contents.get(position + i); + } + } + return size; + }; + node.stream_ops = stream_ops; + return node; + }, + createPreloadedFile: function( + parent, + name, + url, + canRead, + canWrite, + onload, + onerror, + dontCreateFile, + canOwn, + preFinish + ) { + Browser.init(); + var fullname = name ? PATH_FS.resolve(PATH.join2(parent, name)) : parent; + var dep = getUniqueRunDependency("cp " + fullname); + function processData(byteArray) { + function finish(byteArray) { + if (preFinish) preFinish(); + if (!dontCreateFile) { + FS.createDataFile(parent, name, byteArray, canRead, canWrite, canOwn); + } + if (onload) onload(); + removeRunDependency(dep); + } + var handled = false; + Module["preloadPlugins"].forEach(function(plugin) { + if (handled) return; + if (plugin["canHandle"](fullname)) { + plugin["handle"](byteArray, fullname, finish, function() { + if (onerror) onerror(); + removeRunDependency(dep); + }); + handled = true; + } + }); + if (!handled) finish(byteArray); + } + addRunDependency(dep); + if (typeof url == "string") { + Browser.asyncLoad( + url, + function(byteArray) { + processData(byteArray); + }, + onerror + ); + } else { + processData(url); + } + }, + indexedDB: function() { + return ( + window.indexedDB || + window.mozIndexedDB || + window.webkitIndexedDB || + window.msIndexedDB + ); + }, + DB_NAME: function() { + return "EM_FS_" + window.location.pathname; + }, + DB_VERSION: 20, + DB_STORE_NAME: "FILE_DATA", + saveFilesToDB: function(paths, onload, onerror) { + onload = onload || function() {}; + onerror = onerror || function() {}; + var indexedDB = FS.indexedDB(); + try { + var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION); + } catch (e) { + return onerror(e); + } + openRequest.onupgradeneeded = function openRequest_onupgradeneeded() { + out("creating db"); + var db = openRequest.result; + db.createObjectStore(FS.DB_STORE_NAME); + }; + openRequest.onsuccess = function openRequest_onsuccess() { + var db = openRequest.result; + var transaction = db.transaction([FS.DB_STORE_NAME], "readwrite"); + var files = transaction.objectStore(FS.DB_STORE_NAME); + var ok = 0, + fail = 0, + total = paths.length; + function finish() { + if (fail == 0) onload(); + else onerror(); + } + paths.forEach(function(path) { + var putRequest = files.put(FS.analyzePath(path).object.contents, path); + putRequest.onsuccess = function putRequest_onsuccess() { + ok++; + if (ok + fail == total) finish(); + }; + putRequest.onerror = function putRequest_onerror() { + fail++; + if (ok + fail == total) finish(); + }; + }); + transaction.onerror = onerror; + }; + openRequest.onerror = onerror; + }, + loadFilesFromDB: function(paths, onload, onerror) { + onload = onload || function() {}; + onerror = onerror || function() {}; + var indexedDB = FS.indexedDB(); + try { + var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION); + } catch (e) { + return onerror(e); + } + openRequest.onupgradeneeded = onerror; + openRequest.onsuccess = function openRequest_onsuccess() { + var db = openRequest.result; + try { + var transaction = db.transaction([FS.DB_STORE_NAME], "readonly"); + } catch (e) { + onerror(e); + return; + } + var files = transaction.objectStore(FS.DB_STORE_NAME); + var ok = 0, + fail = 0, + total = paths.length; + function finish() { + if (fail == 0) onload(); + else onerror(); + } + paths.forEach(function(path) { + var getRequest = files.get(path); + getRequest.onsuccess = function getRequest_onsuccess() { + if (FS.analyzePath(path).exists) { + FS.unlink(path); + } + FS.createDataFile( + PATH.dirname(path), + PATH.basename(path), + getRequest.result, + true, + true, + true + ); + ok++; + if (ok + fail == total) finish(); + }; + getRequest.onerror = function getRequest_onerror() { + fail++; + if (ok + fail == total) finish(); + }; + }); + transaction.onerror = onerror; + }; + openRequest.onerror = onerror; + }, + mmapAlloc: function(size) { + var alignedSize = alignMemory(size, 16384); + var ptr = _malloc(alignedSize); + while (size < alignedSize) HEAP8[ptr + size++] = 0; + return ptr; + } +}; +var SYSCALLS = { + mappings: {}, + DEFAULT_POLLMASK: 5, + umask: 511, + calculateAt: function(dirfd, path) { + if (path[0] !== "/") { + var dir; + if (dirfd === -100) { + dir = FS.cwd(); + } else { + var dirstream = FS.getStream(dirfd); + if (!dirstream) throw new FS.ErrnoError(8); + dir = dirstream.path; + } + path = PATH.join2(dir, path); + } + return path; + }, + doStat: function(func, path, buf) { + try { + var stat = func(path); + } catch (e) { + if ( + e && + e.node && + PATH.normalize(path) !== PATH.normalize(FS.getPath(e.node)) + ) { + return -54; + } + throw e; + } + HEAP32[buf >> 2] = stat.dev; + HEAP32[(buf + 4) >> 2] = 0; + HEAP32[(buf + 8) >> 2] = stat.ino; + HEAP32[(buf + 12) >> 2] = stat.mode; + HEAP32[(buf + 16) >> 2] = stat.nlink; + HEAP32[(buf + 20) >> 2] = stat.uid; + HEAP32[(buf + 24) >> 2] = stat.gid; + HEAP32[(buf + 28) >> 2] = stat.rdev; + HEAP32[(buf + 32) >> 2] = 0; + (tempI64 = [ + stat.size >>> 0, + ((tempDouble = stat.size), + +Math_abs(tempDouble) >= 1 + ? tempDouble > 0 + ? (Math_min(+Math_floor(tempDouble / 4294967296), 4294967295) | 0) >>> + 0 + : ~~+Math_ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> + 0 + : 0) + ]), + (HEAP32[(buf + 40) >> 2] = tempI64[0]), + (HEAP32[(buf + 44) >> 2] = tempI64[1]); + HEAP32[(buf + 48) >> 2] = 4096; + HEAP32[(buf + 52) >> 2] = stat.blocks; + HEAP32[(buf + 56) >> 2] = (stat.atime.getTime() / 1e3) | 0; + HEAP32[(buf + 60) >> 2] = 0; + HEAP32[(buf + 64) >> 2] = (stat.mtime.getTime() / 1e3) | 0; + HEAP32[(buf + 68) >> 2] = 0; + HEAP32[(buf + 72) >> 2] = (stat.ctime.getTime() / 1e3) | 0; + HEAP32[(buf + 76) >> 2] = 0; + (tempI64 = [ + stat.ino >>> 0, + ((tempDouble = stat.ino), + +Math_abs(tempDouble) >= 1 + ? tempDouble > 0 + ? (Math_min(+Math_floor(tempDouble / 4294967296), 4294967295) | 0) >>> + 0 + : ~~+Math_ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> + 0 + : 0) + ]), + (HEAP32[(buf + 80) >> 2] = tempI64[0]), + (HEAP32[(buf + 84) >> 2] = tempI64[1]); + return 0; + }, + doMsync: function(addr, stream, len, flags, offset) { + var buffer = HEAPU8.slice(addr, addr + len); + FS.msync(stream, buffer, offset, len, flags); + }, + doMkdir: function(path, mode) { + path = PATH.normalize(path); + if (path[path.length - 1] === "/") path = path.substr(0, path.length - 1); + FS.mkdir(path, mode, 0); + return 0; + }, + doMknod: function(path, mode, dev) { + switch (mode & 61440) { + case 32768: + case 8192: + case 24576: + case 4096: + case 49152: + break; + default: + return -28; + } + FS.mknod(path, mode, dev); + return 0; + }, + doReadlink: function(path, buf, bufsize) { + if (bufsize <= 0) return -28; + var ret = FS.readlink(path); + var len = Math.min(bufsize, lengthBytesUTF8(ret)); + var endChar = HEAP8[buf + len]; + stringToUTF8(ret, buf, bufsize + 1); + HEAP8[buf + len] = endChar; + return len; + }, + doAccess: function(path, amode) { + if (amode & ~7) { + return -28; + } + var node; + var lookup = FS.lookupPath(path, { follow: true }); + node = lookup.node; + if (!node) { + return -44; + } + var perms = ""; + if (amode & 4) perms += "r"; + if (amode & 2) perms += "w"; + if (amode & 1) perms += "x"; + if (perms && FS.nodePermissions(node, perms)) { + return -2; + } + return 0; + }, + doDup: function(path, flags, suggestFD) { + var suggest = FS.getStream(suggestFD); + if (suggest) FS.close(suggest); + return FS.open(path, flags, 0, suggestFD, suggestFD).fd; + }, + doReadv: function(stream, iov, iovcnt, offset) { + var ret = 0; + for (var i = 0; i < iovcnt; i++) { + var ptr = HEAP32[(iov + i * 8) >> 2]; + var len = HEAP32[(iov + (i * 8 + 4)) >> 2]; + var curr = FS.read(stream, HEAP8, ptr, len, offset); + if (curr < 0) return -1; + ret += curr; + if (curr < len) break; + } + return ret; + }, + doWritev: function(stream, iov, iovcnt, offset) { + var ret = 0; + for (var i = 0; i < iovcnt; i++) { + var ptr = HEAP32[(iov + i * 8) >> 2]; + var len = HEAP32[(iov + (i * 8 + 4)) >> 2]; + var curr = FS.write(stream, HEAP8, ptr, len, offset); + if (curr < 0) return -1; + ret += curr; + } + return ret; + }, + varargs: undefined, + get: function() { + SYSCALLS.varargs += 4; + var ret = HEAP32[(SYSCALLS.varargs - 4) >> 2]; + return ret; + }, + getStr: function(ptr) { + var ret = UTF8ToString(ptr); + return ret; + }, + getStreamFromFD: function(fd) { + var stream = FS.getStream(fd); + if (!stream) throw new FS.ErrnoError(8); + return stream; + }, + get64: function(low, high) { + return low; + } +}; +function ___sys_chmod(path, mode) { + try { + path = SYSCALLS.getStr(path); + FS.chmod(path, mode); + return 0; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); + return -e.errno; + } +} +function ___sys_fcntl64(fd, cmd, varargs) { + SYSCALLS.varargs = varargs; + try { + var stream = SYSCALLS.getStreamFromFD(fd); + switch (cmd) { + case 0: { + var arg = SYSCALLS.get(); + if (arg < 0) { + return -28; + } + var newStream; + newStream = FS.open(stream.path, stream.flags, 0, arg); + return newStream.fd; + } + case 1: + case 2: + return 0; + case 3: + return stream.flags; + case 4: { + var arg = SYSCALLS.get(); + stream.flags |= arg; + return 0; + } + case 12: { + var arg = SYSCALLS.get(); + var offset = 0; + HEAP16[(arg + offset) >> 1] = 2; + return 0; + } + case 13: + case 14: + return 0; + case 16: + case 8: + return -28; + case 9: + setErrNo(28); + return -1; + default: { + return -28; + } + } + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); + return -e.errno; + } +} +function ___sys_fstat64(fd, buf) { + try { + var stream = SYSCALLS.getStreamFromFD(fd); + return SYSCALLS.doStat(FS.stat, stream.path, buf); + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); + return -e.errno; + } +} +function ___sys_ioctl(fd, op, varargs) { + SYSCALLS.varargs = varargs; + try { + var stream = SYSCALLS.getStreamFromFD(fd); + switch (op) { + case 21509: + case 21505: { + if (!stream.tty) return -59; + return 0; + } + case 21510: + case 21511: + case 21512: + case 21506: + case 21507: + case 21508: { + if (!stream.tty) return -59; + return 0; + } + case 21519: { + if (!stream.tty) return -59; + var argp = SYSCALLS.get(); + HEAP32[argp >> 2] = 0; + return 0; + } + case 21520: { + if (!stream.tty) return -59; + return -28; + } + case 21531: { + var argp = SYSCALLS.get(); + return FS.ioctl(stream, op, argp); + } + case 21523: { + if (!stream.tty) return -59; + return 0; + } + case 21524: { + if (!stream.tty) return -59; + return 0; + } + default: + abort("bad ioctl syscall " + op); + } + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); + return -e.errno; + } +} +function ___sys_open(path, flags, varargs) { + SYSCALLS.varargs = varargs; + try { + var pathname = SYSCALLS.getStr(path); + var mode = SYSCALLS.get(); + var stream = FS.open(pathname, flags, mode); + return stream.fd; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); + return -e.errno; + } +} +function ___sys_read(fd, buf, count) { + try { + var stream = SYSCALLS.getStreamFromFD(fd); + return FS.read(stream, HEAP8, buf, count); + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); + return -e.errno; + } +} +function ___sys_rename(old_path, new_path) { + try { + old_path = SYSCALLS.getStr(old_path); + new_path = SYSCALLS.getStr(new_path); + FS.rename(old_path, new_path); + return 0; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); + return -e.errno; + } +} +function ___sys_rmdir(path) { + try { + path = SYSCALLS.getStr(path); + FS.rmdir(path); + return 0; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); + return -e.errno; + } +} +function ___sys_stat64(path, buf) { + try { + path = SYSCALLS.getStr(path); + return SYSCALLS.doStat(FS.stat, path, buf); + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); + return -e.errno; + } +} +function ___sys_unlink(path) { + try { + path = SYSCALLS.getStr(path); + FS.unlink(path); + return 0; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); + return -e.errno; + } +} +function _emscripten_memcpy_big(dest, src, num) { + HEAPU8.copyWithin(dest, src, src + num); +} +function _emscripten_get_heap_size() { + return HEAPU8.length; +} +function emscripten_realloc_buffer(size) { + try { + wasmMemory.grow((size - buffer.byteLength + 65535) >>> 16); + updateGlobalBufferAndViews(wasmMemory.buffer); + return 1; + } catch (e) {} +} +function _emscripten_resize_heap(requestedSize) { + requestedSize = requestedSize >>> 0; + var oldSize = _emscripten_get_heap_size(); + var maxHeapSize = 2147483648; + if (requestedSize > maxHeapSize) { + return false; + } + var minHeapSize = 16777216; + for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { + var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); + overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296); + var newSize = Math.min( + maxHeapSize, + alignUp(Math.max(minHeapSize, requestedSize, overGrownHeapSize), 65536) + ); + var replacement = emscripten_realloc_buffer(newSize); + if (replacement) { + return true; + } + } + return false; +} +function _fd_close(fd) { + try { + var stream = SYSCALLS.getStreamFromFD(fd); + FS.close(stream); + return 0; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); + return e.errno; + } +} +function _fd_fdstat_get(fd, pbuf) { + try { + var stream = SYSCALLS.getStreamFromFD(fd); + var type = stream.tty + ? 2 + : FS.isDir(stream.mode) + ? 3 + : FS.isLink(stream.mode) + ? 7 + : 4; + HEAP8[pbuf >> 0] = type; + return 0; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); + return e.errno; + } +} +function _fd_read(fd, iov, iovcnt, pnum) { + try { + var stream = SYSCALLS.getStreamFromFD(fd); + var num = SYSCALLS.doReadv(stream, iov, iovcnt); + HEAP32[pnum >> 2] = num; + return 0; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); + return e.errno; + } +} +function _fd_seek(fd, offset_low, offset_high, whence, newOffset) { + try { + var stream = SYSCALLS.getStreamFromFD(fd); + var HIGH_OFFSET = 4294967296; + var offset = offset_high * HIGH_OFFSET + (offset_low >>> 0); + var DOUBLE_LIMIT = 9007199254740992; + if (offset <= -DOUBLE_LIMIT || offset >= DOUBLE_LIMIT) { + return -61; + } + FS.llseek(stream, offset, whence); + (tempI64 = [ + stream.position >>> 0, + ((tempDouble = stream.position), + +Math_abs(tempDouble) >= 1 + ? tempDouble > 0 + ? (Math_min(+Math_floor(tempDouble / 4294967296), 4294967295) | 0) >>> + 0 + : ~~+Math_ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296) >>> + 0 + : 0) + ]), + (HEAP32[newOffset >> 2] = tempI64[0]), + (HEAP32[(newOffset + 4) >> 2] = tempI64[1]); + if (stream.getdents && offset === 0 && whence === 0) stream.getdents = null; + return 0; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); + return e.errno; + } +} +function _fd_write(fd, iov, iovcnt, pnum) { + try { + var stream = SYSCALLS.getStreamFromFD(fd); + var num = SYSCALLS.doWritev(stream, iov, iovcnt); + HEAP32[pnum >> 2] = num; + return 0; + } catch (e) { + if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e); + return e.errno; + } +} +function _setTempRet0($i) { + setTempRet0($i | 0); +} +function _time(ptr) { + var ret = (Date.now() / 1e3) | 0; + if (ptr) { + HEAP32[ptr >> 2] = ret; + } + return ret; +} +function _tzset() { + if (_tzset.called) return; + _tzset.called = true; + HEAP32[__get_timezone() >> 2] = new Date().getTimezoneOffset() * 60; + var currentYear = new Date().getFullYear(); + var winter = new Date(currentYear, 0, 1); + var summer = new Date(currentYear, 6, 1); + HEAP32[__get_daylight() >> 2] = Number( + winter.getTimezoneOffset() != summer.getTimezoneOffset() + ); + function extractZone(date) { + var match = date.toTimeString().match(/\(([A-Za-z ]+)\)$/); + return match ? match[1] : "GMT"; + } + var winterName = extractZone(winter); + var summerName = extractZone(summer); + var winterNamePtr = allocateUTF8(winterName); + var summerNamePtr = allocateUTF8(summerName); + if (summer.getTimezoneOffset() < winter.getTimezoneOffset()) { + HEAP32[__get_tzname() >> 2] = winterNamePtr; + HEAP32[(__get_tzname() + 4) >> 2] = summerNamePtr; + } else { + HEAP32[__get_tzname() >> 2] = summerNamePtr; + HEAP32[(__get_tzname() + 4) >> 2] = winterNamePtr; + } +} +function _timegm(tmPtr) { + _tzset(); + var time = Date.UTC( + HEAP32[(tmPtr + 20) >> 2] + 1900, + HEAP32[(tmPtr + 16) >> 2], + HEAP32[(tmPtr + 12) >> 2], + HEAP32[(tmPtr + 8) >> 2], + HEAP32[(tmPtr + 4) >> 2], + HEAP32[tmPtr >> 2], + 0 + ); + var date = new Date(time); + HEAP32[(tmPtr + 24) >> 2] = date.getUTCDay(); + var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0); + var yday = ((date.getTime() - start) / (1e3 * 60 * 60 * 24)) | 0; + HEAP32[(tmPtr + 28) >> 2] = yday; + return (date.getTime() / 1e3) | 0; +} +var FSNode = function(parent, name, mode, rdev) { + if (!parent) { + parent = this; + } + this.parent = parent; + this.mount = parent.mount; + this.mounted = null; + this.id = FS.nextInode++; + this.name = name; + this.mode = mode; + this.node_ops = {}; + this.stream_ops = {}; + this.rdev = rdev; +}; +var readMode = 292 | 73; +var writeMode = 146; +Object.defineProperties(FSNode.prototype, { + read: { + get: function() { + return (this.mode & readMode) === readMode; + }, + set: function(val) { + val ? (this.mode |= readMode) : (this.mode &= ~readMode); + } + }, + write: { + get: function() { + return (this.mode & writeMode) === writeMode; + }, + set: function(val) { + val ? (this.mode |= writeMode) : (this.mode &= ~writeMode); + } + }, + isFolder: { + get: function() { + return FS.isDir(this.mode); + } + }, + isDevice: { + get: function() { + return FS.isChrdev(this.mode); + } + } +}); +FS.FSNode = FSNode; +FS.staticInit(); +if (ENVIRONMENT_IS_NODE) { + var fs = frozenFs; + var NODEJS_PATH = __webpack_require__(622); + NODEFS.staticInit(); +} +if (ENVIRONMENT_IS_NODE) { + var _wrapNodeError = function(func) { + return function() { + try { + return func.apply(this, arguments); + } catch (e) { + if (!e.code) throw e; + throw new FS.ErrnoError(ERRNO_CODES[e.code]); + } + }; + }; + var VFS = Object.assign({}, FS); + for (var _key in NODERAWFS) FS[_key] = _wrapNodeError(NODERAWFS[_key]); +} else { + throw new Error( + "NODERAWFS is currently only supported on Node.js environment." + ); +} +function intArrayFromString(stringy, dontAddNull, length) { + var len = length > 0 ? length : lengthBytesUTF8(stringy) + 1; + var u8array = new Array(len); + var numBytesWritten = stringToUTF8Array(stringy, u8array, 0, u8array.length); + if (dontAddNull) u8array.length = numBytesWritten; + return u8array; +} +var decodeBase64 = + typeof atob === "function" + ? atob + : function(input) { + var keyStr = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + var output = ""; + var chr1, chr2, chr3; + var enc1, enc2, enc3, enc4; + var i = 0; + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); + do { + enc1 = keyStr.indexOf(input.charAt(i++)); + enc2 = keyStr.indexOf(input.charAt(i++)); + enc3 = keyStr.indexOf(input.charAt(i++)); + enc4 = keyStr.indexOf(input.charAt(i++)); + chr1 = (enc1 << 2) | (enc2 >> 4); + chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); + chr3 = ((enc3 & 3) << 6) | enc4; + output = output + String.fromCharCode(chr1); + if (enc3 !== 64) { + output = output + String.fromCharCode(chr2); + } + if (enc4 !== 64) { + output = output + String.fromCharCode(chr3); + } + } while (i < input.length); + return output; + }; +function intArrayFromBase64(s) { + if (typeof ENVIRONMENT_IS_NODE === "boolean" && ENVIRONMENT_IS_NODE) { + var buf; + try { + buf = Buffer.from(s, "base64"); + } catch (_) { + buf = new Buffer(s, "base64"); + } + return new Uint8Array(buf["buffer"], buf["byteOffset"], buf["byteLength"]); + } + try { + var decoded = decodeBase64(s); + var bytes = new Uint8Array(decoded.length); + for (var i = 0; i < decoded.length; ++i) { + bytes[i] = decoded.charCodeAt(i); + } + return bytes; + } catch (_) { + throw new Error("Converting base64 string to bytes failed."); + } +} +function tryParseAsDataURI(filename) { + if (!isDataURI(filename)) { + return; + } + return intArrayFromBase64(filename.slice(dataURIPrefix.length)); +} +var asmLibraryArg = { + m: ___gmtime_r, + b: wasmTable, + r: ___sys_chmod, + g: ___sys_fcntl64, + l: ___sys_fstat64, + q: ___sys_ioctl, + t: ___sys_open, + s: ___sys_read, + j: ___sys_rename, + u: ___sys_rmdir, + e: ___sys_stat64, + i: ___sys_unlink, + v: _emscripten_memcpy_big, + w: _emscripten_resize_heap, + h: _fd_close, + k: _fd_fdstat_get, + p: _fd_read, + n: _fd_seek, + f: _fd_write, + a: wasmMemory, + c: _setTempRet0, + d: _time, + o: _timegm +}; +var asm = createWasm(); +var ___wasm_call_ctors = (Module["___wasm_call_ctors"] = asm["x"]); +var _zipstruct_stat = (Module["_zipstruct_stat"] = asm["y"]); +var _zipstruct_statS = (Module["_zipstruct_statS"] = asm["z"]); +var _zipstruct_stat_name = (Module["_zipstruct_stat_name"] = asm["A"]); +var _zipstruct_stat_index = (Module["_zipstruct_stat_index"] = asm["B"]); +var _zipstruct_stat_size = (Module["_zipstruct_stat_size"] = asm["C"]); +var _zipstruct_stat_mtime = (Module["_zipstruct_stat_mtime"] = asm["D"]); +var _zipstruct_error = (Module["_zipstruct_error"] = asm["E"]); +var _zipstruct_errorS = (Module["_zipstruct_errorS"] = asm["F"]); +var _zipstruct_error_code_zip = (Module["_zipstruct_error_code_zip"] = + asm["G"]); +var _zipstruct_stat_comp_size = (Module["_zipstruct_stat_comp_size"] = + asm["H"]); +var _zipstruct_stat_comp_method = (Module["_zipstruct_stat_comp_method"] = + asm["I"]); +var _zip_close = (Module["_zip_close"] = asm["J"]); +var _zip_delete = (Module["_zip_delete"] = asm["K"]); +var _zip_dir_add = (Module["_zip_dir_add"] = asm["L"]); +var _zip_discard = (Module["_zip_discard"] = asm["M"]); +var _zip_error_init_with_code = (Module["_zip_error_init_with_code"] = + asm["N"]); +var _zip_get_error = (Module["_zip_get_error"] = asm["O"]); +var _zip_file_get_error = (Module["_zip_file_get_error"] = asm["P"]); +var _zip_error_strerror = (Module["_zip_error_strerror"] = asm["Q"]); +var _zip_fclose = (Module["_zip_fclose"] = asm["R"]); +var _zip_file_add = (Module["_zip_file_add"] = asm["S"]); +var _zip_file_get_external_attributes = (Module[ + "_zip_file_get_external_attributes" +] = asm["T"]); +var _zip_file_set_external_attributes = (Module[ + "_zip_file_set_external_attributes" +] = asm["U"]); +var _zip_file_set_mtime = (Module["_zip_file_set_mtime"] = asm["V"]); +var _zip_fopen = (Module["_zip_fopen"] = asm["W"]); +var _zip_fopen_index = (Module["_zip_fopen_index"] = asm["X"]); +var _zip_fread = (Module["_zip_fread"] = asm["Y"]); +var _zip_get_name = (Module["_zip_get_name"] = asm["Z"]); +var _zip_get_num_entries = (Module["_zip_get_num_entries"] = asm["_"]); +var _zip_name_locate = (Module["_zip_name_locate"] = asm["$"]); +var _zip_open = (Module["_zip_open"] = asm["aa"]); +var _zip_open_from_source = (Module["_zip_open_from_source"] = asm["ba"]); +var _zip_set_file_compression = (Module["_zip_set_file_compression"] = + asm["ca"]); +var _zip_source_buffer = (Module["_zip_source_buffer"] = asm["da"]); +var _zip_source_buffer_create = (Module["_zip_source_buffer_create"] = + asm["ea"]); +var _zip_source_close = (Module["_zip_source_close"] = asm["fa"]); +var _zip_source_error = (Module["_zip_source_error"] = asm["ga"]); +var _zip_source_free = (Module["_zip_source_free"] = asm["ha"]); +var _zip_source_keep = (Module["_zip_source_keep"] = asm["ia"]); +var _zip_source_open = (Module["_zip_source_open"] = asm["ja"]); +var _zip_source_read = (Module["_zip_source_read"] = asm["ka"]); +var _zip_source_seek = (Module["_zip_source_seek"] = asm["la"]); +var _zip_source_set_mtime = (Module["_zip_source_set_mtime"] = asm["ma"]); +var _zip_source_tell = (Module["_zip_source_tell"] = asm["na"]); +var _zip_stat = (Module["_zip_stat"] = asm["oa"]); +var _zip_stat_index = (Module["_zip_stat_index"] = asm["pa"]); +var _zip_ext_count_symlinks = (Module["_zip_ext_count_symlinks"] = asm["qa"]); +var ___errno_location = (Module["___errno_location"] = asm["ra"]); +var __get_tzname = (Module["__get_tzname"] = asm["sa"]); +var __get_daylight = (Module["__get_daylight"] = asm["ta"]); +var __get_timezone = (Module["__get_timezone"] = asm["ua"]); +var stackSave = (Module["stackSave"] = asm["va"]); +var stackRestore = (Module["stackRestore"] = asm["wa"]); +var stackAlloc = (Module["stackAlloc"] = asm["xa"]); +var _malloc = (Module["_malloc"] = asm["ya"]); +var _free = (Module["_free"] = asm["za"]); +Module["cwrap"] = cwrap; +Module["getValue"] = getValue; +var calledRun; +dependenciesFulfilled = function runCaller() { + if (!calledRun) run(); + if (!calledRun) dependenciesFulfilled = runCaller; +}; +function run(args) { + args = args || arguments_; + if (runDependencies > 0) { + return; + } + preRun(); + if (runDependencies > 0) return; + function doRun() { + if (calledRun) return; + calledRun = true; + Module["calledRun"] = true; + if (ABORT) return; + initRuntime(); + preMain(); + if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"](); + postRun(); + } + if (Module["setStatus"]) { + Module["setStatus"]("Running..."); + setTimeout(function() { + setTimeout(function() { + Module["setStatus"](""); + }, 1); + doRun(); + }, 1); + } else { + doRun(); + } +} +Module["run"] = run; +if (Module["preInit"]) { + if (typeof Module["preInit"] == "function") + Module["preInit"] = [Module["preInit"]]; + while (Module["preInit"].length > 0) { + Module["preInit"].pop()(); + } +} +noExitRuntime = true; +run(); + + +/***/ }), + +/***/ 417: +/***/ ((module) => { + +"use strict"; +module.exports = require("crypto");; + +/***/ }), + +/***/ 747: +/***/ ((module) => { + +"use strict"; +module.exports = require("fs");; + +/***/ }), + +/***/ 282: +/***/ ((module) => { + +"use strict"; +module.exports = require("module");; + +/***/ }), + +/***/ 622: +/***/ ((module) => { + +"use strict"; +module.exports = require("path");; + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ if(__webpack_module_cache__[moduleId]) { +/******/ return __webpack_module_cache__[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ (() => { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = (module) => { +/******/ var getter = module && module.__esModule ? +/******/ () => module['default'] : +/******/ () => module; +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) +/******/ })(); +/******/ +/************************************************************************/ +/******/ // module exports must be returned from runtime so entry inlining is disabled +/******/ // startup +/******/ // Load entry module and return exports +/******/ return __webpack_require__(936); +/******/ })() +.default; +}); \ No newline at end of file diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 00000000..c0527f7f --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,13 @@ +{ + "printWidth": 110, + "trailingComma": "all", + "overrides": [ + { + "files": "*.md", + "options": { + "printWidth": 80, + "proseWrap": "always" + } + } + ] +} diff --git a/.yarn/cache/@protobufjs-aspromise-npm-1.1.2-71d00b938f-83ced0798a.zip b/.yarn/cache/@protobufjs-aspromise-npm-1.1.2-71d00b938f-83ced0798a.zip new file mode 100644 index 00000000..c293c46e --- /dev/null +++ b/.yarn/cache/@protobufjs-aspromise-npm-1.1.2-71d00b938f-83ced0798a.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fafd90c221207d35f83457841b004bce4799a3e10a2904f18d07923029ebec07 +size 4234 diff --git a/.yarn/cache/@protobufjs-base64-npm-1.1.2-cd8ca6814a-ae9e84aaf6.zip b/.yarn/cache/@protobufjs-base64-npm-1.1.2-cd8ca6814a-ae9e84aaf6.zip new file mode 100644 index 00000000..507a97aa --- /dev/null +++ b/.yarn/cache/@protobufjs-base64-npm-1.1.2-cd8ca6814a-ae9e84aaf6.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cfdbe56fb2355ca7fdbe9cdcb608fa9d82b4de3bc03aeb3146ac6b559ea8a5f2 +size 5049 diff --git a/.yarn/cache/@protobufjs-codegen-npm-2.0.4-36e188bbe6-a05d5f8892.zip b/.yarn/cache/@protobufjs-codegen-npm-2.0.4-36e188bbe6-a05d5f8892.zip new file mode 100644 index 00000000..1ea576e4 --- /dev/null +++ b/.yarn/cache/@protobufjs-codegen-npm-2.0.4-36e188bbe6-a05d5f8892.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8b5dfa514d5ac23b4525ab6dc2de56e9a11d1030e0bfd6f1cd3a9c128215f6f3 +size 5293 diff --git a/.yarn/cache/@protobufjs-eventemitter-npm-1.1.0-029cc7d431-32a84e33f1.zip b/.yarn/cache/@protobufjs-eventemitter-npm-1.1.0-029cc7d431-32a84e33f1.zip new file mode 100644 index 00000000..de01cd8b --- /dev/null +++ b/.yarn/cache/@protobufjs-eventemitter-npm-1.1.0-029cc7d431-32a84e33f1.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d8612573a8cf78c639ddf8d8e997f0ab86550b6e0d35cfae25f12d543ebf4173 +size 4617 diff --git a/.yarn/cache/@protobufjs-fetch-npm-1.1.0-ca857b7df4-d682e5d8a1.zip b/.yarn/cache/@protobufjs-fetch-npm-1.1.0-ca857b7df4-d682e5d8a1.zip new file mode 100644 index 00000000..fc40f132 --- /dev/null +++ b/.yarn/cache/@protobufjs-fetch-npm-1.1.0-ca857b7df4-d682e5d8a1.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac1c90b52006a041553faa97d1b587d0aaadbf2a4003f823b9106dae7b801d8e +size 5210 diff --git a/.yarn/cache/@protobufjs-float-npm-1.0.2-5678f64d08-eee7278de2.zip b/.yarn/cache/@protobufjs-float-npm-1.0.2-5678f64d08-eee7278de2.zip new file mode 100644 index 00000000..81848e93 --- /dev/null +++ b/.yarn/cache/@protobufjs-float-npm-1.0.2-5678f64d08-eee7278de2.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6a735c80472bccf2d92f236fac59d5a6a52cfeadf29180c731d56afe38aac49 +size 8365 diff --git a/.yarn/cache/@protobufjs-inquire-npm-1.1.0-3c7759e9ce-3541518cca.zip b/.yarn/cache/@protobufjs-inquire-npm-1.1.0-3c7759e9ce-3541518cca.zip new file mode 100644 index 00000000..401e1539 --- /dev/null +++ b/.yarn/cache/@protobufjs-inquire-npm-1.1.0-3c7759e9ce-3541518cca.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5d2c6044f40605720df6db15d652f5f8f64dfb1d175303a8a6fe8bd975ccf64a +size 4866 diff --git a/.yarn/cache/@protobufjs-path-npm-1.1.2-641d08de76-22f10c5c22.zip b/.yarn/cache/@protobufjs-path-npm-1.1.2-641d08de76-22f10c5c22.zip new file mode 100644 index 00000000..985d5eca --- /dev/null +++ b/.yarn/cache/@protobufjs-path-npm-1.1.2-641d08de76-22f10c5c22.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aab124affa410e950d1a81e57a589e18ec086e5f0a4aeaa23e0b8045ca982b18 +size 4406 diff --git a/.yarn/cache/@protobufjs-pool-npm-1.1.0-47a76f96a1-5fc4af9e06.zip b/.yarn/cache/@protobufjs-pool-npm-1.1.0-47a76f96a1-5fc4af9e06.zip new file mode 100644 index 00000000..6fbc12c9 --- /dev/null +++ b/.yarn/cache/@protobufjs-pool-npm-1.1.0-47a76f96a1-5fc4af9e06.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab11e239ad7255c553d4751b8f35019f2d493b8b5b390b5fbe2433d8c9877d3a +size 4353 diff --git a/.yarn/cache/@protobufjs-utf8-npm-1.1.0-02c590807c-5b3fa7425f.zip b/.yarn/cache/@protobufjs-utf8-npm-1.1.0-02c590807c-5b3fa7425f.zip new file mode 100644 index 00000000..9f64df76 --- /dev/null +++ b/.yarn/cache/@protobufjs-utf8-npm-1.1.0-02c590807c-5b3fa7425f.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d81a102ed162d1fbfb46c5e3e34045873fda2350ab9b62f0cee59d1baea06ec0 +size 11511 diff --git a/.yarn/cache/@types-long-npm-4.0.1-022c8b6e77-ed2a125330.zip b/.yarn/cache/@types-long-npm-4.0.1-022c8b6e77-ed2a125330.zip new file mode 100644 index 00000000..8cbcd7e1 --- /dev/null +++ b/.yarn/cache/@types-long-npm-4.0.1-022c8b6e77-ed2a125330.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1eb91b4607d4c1143025e27954c0f17d5804b4af87e83ca5df6e90354b6dcf8 +size 3904 diff --git a/.yarn/cache/@types-node-npm-13.13.52-95159539bb-702db7930d.zip b/.yarn/cache/@types-node-npm-13.13.52-95159539bb-702db7930d.zip new file mode 100644 index 00000000..2479d120 --- /dev/null +++ b/.yarn/cache/@types-node-npm-13.13.52-95159539bb-702db7930d.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07aa74f31bf0241a34b18e34b0af2e9bcbcaa8ddb8b5b7f7076ecabb3c10a3fa +size 119225 diff --git a/.yarn/cache/@types-node-npm-15.6.1-1a0b9c8653-07b3855bc0.zip b/.yarn/cache/@types-node-npm-15.6.1-1a0b9c8653-07b3855bc0.zip new file mode 100644 index 00000000..0207fccb --- /dev/null +++ b/.yarn/cache/@types-node-npm-15.6.1-1a0b9c8653-07b3855bc0.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64ada7a04781ebb5264dc1806759036a0cc15dac0b5b83090ab377c75072ba67 +size 134023 diff --git a/.yarn/cache/@types-node-npm-15.6.2-9d8f9d46a0-e65d6d4750.zip b/.yarn/cache/@types-node-npm-15.6.2-9d8f9d46a0-e65d6d4750.zip new file mode 100644 index 00000000..7d2a9494 --- /dev/null +++ b/.yarn/cache/@types-node-npm-15.6.2-9d8f9d46a0-e65d6d4750.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9391971c1c2e1be27c5b92e8b7103cfc3d6c4748ddd80fc1b1c7322a60510a41 +size 134051 diff --git a/.yarn/cache/@types-object-hash-npm-1.3.4-3b3e2e44e8-2ae12c7b34.zip b/.yarn/cache/@types-object-hash-npm-1.3.4-3b3e2e44e8-2ae12c7b34.zip new file mode 100644 index 00000000..b9178c74 --- /dev/null +++ b/.yarn/cache/@types-object-hash-npm-1.3.4-3b3e2e44e8-2ae12c7b34.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c0e7308ef0f899329a44dfde29ef1d3decae809c55c5305ad26507738d1894ab +size 2934 diff --git a/.yarn/cache/@types-prettier-npm-1.19.1-396f22bcd2-394a4364ce.zip b/.yarn/cache/@types-prettier-npm-1.19.1-396f22bcd2-394a4364ce.zip new file mode 100644 index 00000000..9d4f66aa --- /dev/null +++ b/.yarn/cache/@types-prettier-npm-1.19.1-396f22bcd2-394a4364ce.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d6ac102cac1d3cd1d32aa7e41318def37cb47626556a881ae099836becb4a69 +size 10374 diff --git a/.yarn/cache/dataloader-npm-1.4.0-ba03bd2183-1c698b6d47.zip b/.yarn/cache/dataloader-npm-1.4.0-ba03bd2183-1c698b6d47.zip new file mode 100644 index 00000000..4f007d4b --- /dev/null +++ b/.yarn/cache/dataloader-npm-1.4.0-ba03bd2183-1c698b6d47.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c9c31225a239b5934624863d29cae2b4d68424dc107606ff639221095d78c584 +size 18519 diff --git a/.yarn/cache/lodash-npm-4.17.21-6382451519-4983720b9a.zip b/.yarn/cache/lodash-npm-4.17.21-6382451519-4983720b9a.zip new file mode 100644 index 00000000..8608a17e --- /dev/null +++ b/.yarn/cache/lodash-npm-4.17.21-6382451519-4983720b9a.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be9037b1bf81f7f9fd17f9d7ec032b9007498419c4e55d8081ce02847b13b924 +size 617983 diff --git a/.yarn/cache/long-npm-4.0.0-ecd96a31ed-9cebc1ee8b.zip b/.yarn/cache/long-npm-4.0.0-ecd96a31ed-9cebc1ee8b.zip new file mode 100644 index 00000000..381d6a2b --- /dev/null +++ b/.yarn/cache/long-npm-4.0.0-ecd96a31ed-9cebc1ee8b.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1983a3937d5e2317c1940ea573f1b84cf34f7f40c2e28a9e45948c602157623 +size 40633 diff --git a/.yarn/cache/object-hash-npm-1.3.1-ea495b8e52-035cb0b0e6.zip b/.yarn/cache/object-hash-npm-1.3.1-ea495b8e52-035cb0b0e6.zip new file mode 100644 index 00000000..838129d5 --- /dev/null +++ b/.yarn/cache/object-hash-npm-1.3.1-ea495b8e52-035cb0b0e6.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e1146874ebb460e175ddd5a547cec8f13cb3393595802229d207a0643716d198 +size 90142 diff --git a/.yarn/cache/prettier-npm-2.3.0-29ef37e8b6-652640cc8b.zip b/.yarn/cache/prettier-npm-2.3.0-29ef37e8b6-652640cc8b.zip new file mode 100644 index 00000000..18a5c54c --- /dev/null +++ b/.yarn/cache/prettier-npm-2.3.0-29ef37e8b6-652640cc8b.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fcf82e8e67a26c93fbfd6db2ca31c79a65cd035f34586c4ebe33b47a87cb3d52 +size 4204917 diff --git a/.yarn/cache/protobufjs-npm-6.10.2-f0f2cab7fe-09d6292362.zip b/.yarn/cache/protobufjs-npm-6.10.2-f0f2cab7fe-09d6292362.zip new file mode 100644 index 00000000..6987fb74 --- /dev/null +++ b/.yarn/cache/protobufjs-npm-6.10.2-f0f2cab7fe-09d6292362.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:426354b164432f8c4806e602a3042a547d92c9f121e7042a8eae6c4e2df12a77 +size 754870 diff --git a/.yarn/cache/protobufjs-npm-6.11.2-9b422ce98e-3c7c6875ca.zip b/.yarn/cache/protobufjs-npm-6.11.2-9b422ce98e-3c7c6875ca.zip new file mode 100644 index 00000000..dd313066 --- /dev/null +++ b/.yarn/cache/protobufjs-npm-6.11.2-9b422ce98e-3c7c6875ca.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:021e895bf63d6660df40684ad395de7e3af7324b658021c6cd929fc18cc0d80d +size 1455286 diff --git a/.yarn/cache/ts-poet-npm-4.5.0-5771bc00e9-8d8e59a29d.zip b/.yarn/cache/ts-poet-npm-4.5.0-5771bc00e9-8d8e59a29d.zip new file mode 100644 index 00000000..9bc93557 --- /dev/null +++ b/.yarn/cache/ts-poet-npm-4.5.0-5771bc00e9-8d8e59a29d.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9db3baf703eb53af744aa7cb77f69fb90593dcca393036d09d58f8a2730b9aa +size 35105 diff --git a/.yarn/cache/ts-proto-descriptors-npm-1.2.1-bdac3b6021-ad62bdf0a3.zip b/.yarn/cache/ts-proto-descriptors-npm-1.2.1-bdac3b6021-ad62bdf0a3.zip new file mode 100644 index 00000000..cce402d5 --- /dev/null +++ b/.yarn/cache/ts-proto-descriptors-npm-1.2.1-bdac3b6021-ad62bdf0a3.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f15eca06d282aa33be1b2089bb68f6d15e00975f1dacaa62af93b968ddd38353 +size 58205 diff --git a/.yarn/cache/ts-proto-npm-1.81.1-638c7076bc-7d6f3387ea.zip b/.yarn/cache/ts-proto-npm-1.81.1-638c7076bc-7d6f3387ea.zip new file mode 100644 index 00000000..c831d920 --- /dev/null +++ b/.yarn/cache/ts-proto-npm-1.81.1-638c7076bc-7d6f3387ea.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89ba86f3d3bfda5df99e8a419bc0eeca72ef7aab55e92bb9f866178d4692afc8 +size 53866 diff --git a/.yarn/cache/typescript-npm-4.0.7-e760e37efc-1b4c63a228.zip b/.yarn/cache/typescript-npm-4.0.7-e760e37efc-1b4c63a228.zip new file mode 100644 index 00000000..02b71019 --- /dev/null +++ b/.yarn/cache/typescript-npm-4.0.7-e760e37efc-1b4c63a228.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d1a83f03a1aa8ac78f1400932860b334ab4dcc83b557d64a00f4da432304edf4 +size 9937612 diff --git a/.yarn/cache/typescript-patch-92bf6e8d8b-f234923fbe.zip b/.yarn/cache/typescript-patch-92bf6e8d8b-f234923fbe.zip new file mode 100644 index 00000000..49cbf234 --- /dev/null +++ b/.yarn/cache/typescript-patch-92bf6e8d8b-f234923fbe.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a2f7d42c02cef57e2160f320545ef6c81707dcc31f0056ac3f552c92ce0adcca +size 9948568 diff --git a/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs b/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs new file mode 100644 index 00000000..e64e6dda --- /dev/null +++ b/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs @@ -0,0 +1,77 @@ +/* eslint-disable */ +module.exports = { +name: "@yarnpkg/plugin-interactive-tools", +factory: function (require) { +var plugin;plugin=(()=>{var __webpack_modules__={7560:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>K});function r(e,t,n,r){var i,o=arguments.length,u=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(u=(o<3?i(u):o>3?i(t,n,u):i(t,n))||u);return o>3&&u&&Object.defineProperty(t,n,u),u}const i=require("@yarnpkg/cli"),o=require("@yarnpkg/core");var u=n(9245),a=n(7382);const l=(0,a.memo)(({active:e})=>{const t=(0,a.useMemo)(()=>e?"◉":"◯",[e]),n=(0,a.useMemo)(()=>e?"green":"yellow",[e]);return a.createElement(u.Text,{color:n},t)});function s({active:e},t,n){const{stdin:r}=(0,u.useStdin)(),i=(0,a.useCallback)((e,n)=>t(e,n),n);(0,a.useEffect)(()=>{if(e&&r)return r.on("keypress",i),()=>{r.off("keypress",i)}},[e,i,r])}var c;!function(e){e.BEFORE="before",e.AFTER="after"}(c||(c={}));const f=function(e,t,{active:n,minus:r,plus:i,set:o,loop:u=!0}){s({active:n},(n,a)=>{const l=t.indexOf(e);switch(a.name){case r:{const e=l-1;if(u)return void o(t[(t.length+e)%t.length]);if(e<0)return;o(t[e])}break;case i:{const e=l+1;if(u)return void o(t[e%t.length]);if(e>=t.length)return;o(t[e])}}},[t,e,i,o,u])},d=({active:e=!0,children:t=[],radius:n=10,size:r=1,loop:i=!0,onFocusRequest:o,willReachEnd:l})=>{const d=a.Children.map(t,e=>(e=>{if(null===e.key)throw new Error("Expected all children to have a key");return e.key})(e)),p=d[0],[h,v]=(0,a.useState)(p),m=d.indexOf(h);(0,a.useEffect)(()=>{d.includes(h)||v(p)},[t]),(0,a.useEffect)(()=>{l&&m>=d.length-2&&l()},[m]),function({active:e},t,n){s({active:e},(e,n)=>{"tab"===n.name&&(n.shift?t(c.BEFORE):t(c.AFTER))},n)}({active:e&&!!o},e=>{null==o||o(e)},[o]),f(h,d,{active:e,minus:"up",plus:"down",set:v,loop:i});let g=m-n,y=m+n;y>d.length&&(g-=y-d.length,y=d.length),g<0&&(y+=-g,g=0),y>=d.length&&(y=d.length-1);const _=[];for(let n=g;n<=y;++n){const i=d[n],o=e&&i===h;_.push(a.createElement(u.Box,{key:i,height:r},a.createElement(u.Box,{marginLeft:1,marginRight:1},a.createElement(u.Text,null,o?a.createElement(u.Text,{color:"cyan",bold:!0},">"):" ")),a.createElement(u.Box,null,a.cloneElement(t[n],{active:o}))))}return a.createElement(u.Box,{flexDirection:"column",width:"100%"},_)},p=require("readline"),h=a.createContext(null),v=({children:e})=>{const{stdin:t,setRawMode:n}=(0,u.useStdin)();(0,a.useEffect)(()=>{n&&n(!0),t&&(0,p.emitKeypressEvents)(t)},[t,n]);const[r,i]=(0,a.useState)(new Map),o=(0,a.useMemo)(()=>({getAll:()=>r,get:e=>r.get(e),set:(e,t)=>i(new Map([...r,[e,t]]))}),[r,i]);return a.createElement(h.Provider,{value:o,children:e})};function m(e,t){const n=(0,a.useContext)(h);if(null===n)throw new Error("Expected this hook to run with a ministore context attached");if(void 0===e)return n.getAll();const r=(0,a.useCallback)(t=>{n.set(e,t)},[e,n.set]);let i=n.get(e);return void 0===i&&(i=t),[i,r]}async function g(e,t){let n;const{waitUntilExit:r}=(0,u.render)(a.createElement(v,null,a.createElement(e,Object.assign({},t,{useSubmit:e=>{const{exit:t}=(0,u.useApp)();s({active:!0},(r,i)=>{"return"===i.name&&(n=e,t())},[t,e])}}))));return await r(),n}const y=require("clipanion");var _=n(7840),b=n(4410);const w={appId:"OFCNCOG2CU",apiKey:"6fe4476ee5a1832882e326b506d14126",indexName:"npm-search"},E=n.n(b)()(w.appId,w.apiKey).initIndex(w.indexName),D=async(e,t=0)=>await E.search(e,{analyticsTags:["yarn-plugin-interactive-tools"],attributesToRetrieve:["name","version","owner","repository","humanDownloadsLast30Days"],page:t,hitsPerPage:10}),S=["regular","dev","peer"];class C extends i.BaseCommand{async execute(){const e=await o.Configuration.find(this.context.cwd,this.context.plugins),t=()=>a.createElement(u.Box,{flexDirection:"row"},a.createElement(u.Box,{flexDirection:"column",width:48},a.createElement(u.Box,null,a.createElement(u.Text,null,"Press ",a.createElement(u.Text,{bold:!0,color:"cyanBright"},""),"/",a.createElement(u.Text,{bold:!0,color:"cyanBright"},"")," to move between packages.")),a.createElement(u.Box,null,a.createElement(u.Text,null,"Press ",a.createElement(u.Text,{bold:!0,color:"cyanBright"},"")," to select a package.")),a.createElement(u.Box,null,a.createElement(u.Text,null,"Press ",a.createElement(u.Text,{bold:!0,color:"cyanBright"},"")," again to change the target."))),a.createElement(u.Box,{flexDirection:"column"},a.createElement(u.Box,{marginLeft:1},a.createElement(u.Text,null,"Press ",a.createElement(u.Text,{bold:!0,color:"cyanBright"},"")," to install the selected packages.")),a.createElement(u.Box,{marginLeft:1},a.createElement(u.Text,null,"Press ",a.createElement(u.Text,{bold:!0,color:"cyanBright"},"")," to abort.")))),n=()=>a.createElement(a.Fragment,null,a.createElement(u.Box,{width:15},a.createElement(u.Text,{bold:!0,underline:!0,color:"gray"},"Owner")),a.createElement(u.Box,{width:11},a.createElement(u.Text,{bold:!0,underline:!0,color:"gray"},"Version")),a.createElement(u.Box,{width:10},a.createElement(u.Text,{bold:!0,underline:!0,color:"gray"},"Downloads"))),r=()=>a.createElement(u.Box,{width:17},a.createElement(u.Text,{bold:!0,underline:!0,color:"gray"},"Target")),i=({hit:t,active:n})=>{const[r,i]=m(t.name,null);s({active:n},(e,t)=>{if("space"!==t.name)return;if(!r)return void i(S[0]);const n=S.indexOf(r)+1;n===S.length?i(null):i(S[n])},[r,i]);const l=o.structUtils.parseIdent(t.name),c=o.structUtils.prettyIdent(e,l);return a.createElement(u.Box,null,a.createElement(u.Box,{width:45},a.createElement(u.Text,{bold:!0,wrap:"wrap"},c)),a.createElement(u.Box,{width:14,marginLeft:1},a.createElement(u.Text,{bold:!0,wrap:"truncate"},t.owner.name)),a.createElement(u.Box,{width:10,marginLeft:1},a.createElement(u.Text,{italic:!0,wrap:"truncate"},t.version)),a.createElement(u.Box,{width:16,marginLeft:1},a.createElement(u.Text,null,t.humanDownloadsLast30Days)))},c=({name:t,active:n})=>{const[r]=m(t,null),i=o.structUtils.parseIdent(t);return a.createElement(u.Box,null,a.createElement(u.Box,{width:47},a.createElement(u.Text,{bold:!0}," - ",o.structUtils.prettyIdent(e,i))),S.map(e=>a.createElement(u.Box,{key:e,width:14,marginLeft:1},a.createElement(u.Text,null," ",a.createElement(l,{active:r===e})," ",a.createElement(u.Text,{bold:!0},e)))))},f=()=>a.createElement(u.Box,{marginTop:1},a.createElement(u.Text,null,"Powered by Algolia.")),p=await g(({useSubmit:e})=>{const o=m();e(o);const l=Array.from(o.keys()).filter(e=>null!==o.get(e)),[s,p]=(0,a.useState)(""),[h,v]=(0,a.useState)(0),[g,y]=(0,a.useState)([]);return(0,a.useEffect)(()=>{s?(async()=>{v(0);const e=await D(s);e.query===s&&y(e.hits)})():y([])},[s]),a.createElement(u.Box,{flexDirection:"column"},a.createElement(t,null),a.createElement(u.Box,{flexDirection:"row",marginTop:1},a.createElement(u.Text,{bold:!0},"Search: "),a.createElement(u.Box,{width:41},a.createElement(_.ZP,{value:s,onChange:e=>{e.match(/\t| /)||p(e)},placeholder:"i.e. babel, webpack, react...",showCursor:!1})),a.createElement(n,null)),g.length?a.createElement(d,{radius:2,loop:!1,children:g.map(e=>a.createElement(i,{key:e.name,hit:e,active:!1})),willReachEnd:async()=>{const e=await D(s,h+1);e.query===s&&e.page-1===h&&(v(e.page),y([...g,...e.hits]))}}):a.createElement(u.Text,{color:"gray"},"Start typing..."),a.createElement(u.Box,{flexDirection:"row",marginTop:1},a.createElement(u.Box,{width:49},a.createElement(u.Text,{bold:!0},"Selected:")),a.createElement(r,null)),l.length?l.map(e=>a.createElement(c,{key:e,name:e,active:!1})):a.createElement(u.Text,{color:"gray"},"No selected packages..."),a.createElement(f,null))},{});if(void 0===p)return 1;const h=Array.from(p.keys()).filter(e=>"regular"===p.get(e)),v=Array.from(p.keys()).filter(e=>"dev"===p.get(e)),y=Array.from(p.keys()).filter(e=>"peer"===p.get(e));return h.length&&await this.cli.run(["add",...h]),v.length&&await this.cli.run(["add","--dev",...v]),y&&await this.cli.run(["add","--peer",...y]),0}}C.usage=y.Command.Usage({category:"Interactive commands",description:"open the search interface",details:"\n This command opens a fullscreen terminal interface where you can search for and install packages from the npm registry.\n ",examples:[["Open the search window","yarn search"]]}),r([y.Command.Path("search")],C.prototype,"execute",null);var k=n(5882),T=n.n(k);const x=({length:e,active:t})=>{if(0===e)return null;const n=e>1?" "+T().underline(" ".repeat(e-1)):" ";return a.createElement(u.Text,{dimColor:!t},n)},A=function({active:e,skewer:t,options:n,value:r,onChange:i,sizes:o=[]}){const s=n.map(({value:e})=>e),c=s.indexOf(r);return f(r,s,{active:e,minus:"left",plus:"right",set:i}),a.createElement(a.Fragment,null,n.map(({label:n},r)=>{const i=r===c,s=o[r]-1||0,f=n.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,""),d=Math.max(0,s-f.length-2);return a.createElement(u.Box,{key:n,width:s,marginLeft:1},a.createElement(u.Text,{wrap:"truncate"},a.createElement(l,{active:i})," ",n),t?a.createElement(x,{active:e,length:d}):null)}))},O=require("@yarnpkg/plugin-essentials");function P(){}function I(e,t,n,r,i){for(var o=0,u=t.length,a=0,l=0;oe.length?n:e})),s.value=e.join(f)}else s.value=e.join(n.slice(a,a+s.count));a+=s.count,s.added||(l+=s.count)}}var d=t[u-1];return u>1&&"string"==typeof d.value&&(d.added||d.removed)&&e.equals("",d.value)&&(t[u-2].value+=d.value,t.pop()),t}function N(e){return{newPos:e.newPos,components:e.components.slice(0)}}P.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.callback;"function"==typeof n&&(r=n,n={}),this.options=n;var i=this;function o(e){return r?(setTimeout((function(){r(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var u=(t=this.removeEmpty(this.tokenize(t))).length,a=e.length,l=1,s=u+a,c=[{newPos:-1,components:[]}],f=this.extractCommon(c[0],t,e,0);if(c[0].newPos+1>=u&&f+1>=a)return o([{value:this.join(t),count:t.length}]);function d(){for(var n=-1*l;n<=l;n+=2){var r=void 0,s=c[n-1],f=c[n+1],d=(f?f.newPos:0)-n;s&&(c[n-1]=void 0);var p=s&&s.newPos+1=u&&d+1>=a)return o(I(i,r.components,t,e,i.useLongestToken));c[n]=r}else c[n]=void 0}l++}if(r)!function e(){setTimeout((function(){if(l>s)return r();d()||e()}),0)}();else for(;l<=s;){var p=d();if(p)return p}},pushComponent:function(e,t,n){var r=e[e.length-1];r&&r.added===t&&r.removed===n?e[e.length-1]={count:r.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,r){for(var i=t.length,o=n.length,u=e.newPos,a=u-r,l=0;u+1=?)?)([0-9]+)(\.[0-9]+)(\.[0-9]+)((?:-\S+)?)$/;class Y extends i.BaseCommand{async execute(){const e=await o.Configuration.find(this.context.cwd,this.context.plugins),{project:t,workspace:n}=await o.Project.find(e,this.context.cwd),r=await o.Cache.find(e);if(!n)throw new i.WorkspaceRequiredError(t.cwd,this.context.cwd);const l=(t,n)=>{const r=(i=t,u=n,a=M(a,{ignoreWhitespace:!0}),L.diff(i,u,a));var i,u,a;let l="";for(const t of r)t.added?l+=o.formatUtils.pretty(e,t.value,"green"):t.removed||(l+=t.value);return l},s=(t,n)=>{if(t===n)return n;const r=o.structUtils.parseRange(t),i=o.structUtils.parseRange(n),u=r.selector.match($),a=i.selector.match($);if(!u||!a)return l(t,n);const s=["gray","red","yellow","green","magenta"];let c=null,f="";for(let t=1;t{const u=await O.suggestUtils.fetchDescriptorFrom(e,o,{project:t,cache:r,preserveModifier:i,workspace:n});return null!==u?u.range:e.range},f=()=>a.createElement(u.Box,{flexDirection:"row"},a.createElement(u.Box,{flexDirection:"column",width:49},a.createElement(u.Box,{marginLeft:1},a.createElement(u.Text,null,"Press ",a.createElement(u.Text,{bold:!0,color:"cyanBright"},""),"/",a.createElement(u.Text,{bold:!0,color:"cyanBright"},"")," to select packages.")),a.createElement(u.Box,{marginLeft:1},a.createElement(u.Text,null,"Press ",a.createElement(u.Text,{bold:!0,color:"cyanBright"},""),"/",a.createElement(u.Text,{bold:!0,color:"cyanBright"},"")," to select versions."))),a.createElement(u.Box,{flexDirection:"column"},a.createElement(u.Box,{marginLeft:1},a.createElement(u.Text,null,"Press ",a.createElement(u.Text,{bold:!0,color:"cyanBright"},"")," to install.")),a.createElement(u.Box,{marginLeft:1},a.createElement(u.Text,null,"Press ",a.createElement(u.Text,{bold:!0,color:"cyanBright"},"")," to abort.")))),p=()=>a.createElement(u.Box,{flexDirection:"row",paddingTop:1,paddingBottom:1},a.createElement(u.Box,{width:50},a.createElement(u.Text,{bold:!0},a.createElement(u.Text,{color:"greenBright"},"?")," Pick the packages you want to upgrade.")),a.createElement(u.Box,{width:17},a.createElement(u.Text,{bold:!0,underline:!0,color:"gray"},"Current")),a.createElement(u.Box,{width:17},a.createElement(u.Text,{bold:!0,underline:!0,color:"gray"},"Range")),a.createElement(u.Box,{width:17},a.createElement(u.Text,{bold:!0,underline:!0,color:"gray"},"Latest"))),h=({active:t,descriptor:n,suggestions:r})=>{const[i,l]=m(n.descriptorHash,null),s=o.structUtils.stringifyIdent(n),c=Math.max(0,45-s.length);return a.createElement(a.Fragment,null,a.createElement(u.Box,null,a.createElement(u.Box,{width:45},a.createElement(u.Text,{bold:!0},o.structUtils.prettyIdent(e,n)),a.createElement(x,{active:t,length:c})),null!==r?a.createElement(A,{active:t,options:r,value:i,skewer:!0,onChange:l,sizes:[17,17,17]}):a.createElement(u.Box,{marginLeft:2},a.createElement(u.Text,{color:"gray"},"Fetching suggestions..."))))},v=({dependencies:e})=>{const[t,n]=(0,a.useState)(null),r=(0,a.useRef)(!0);return(0,a.useEffect)(()=>()=>{r.current=!1}),(0,a.useEffect)(()=>{Promise.all(e.map(e=>(async e=>{const t=G().valid(e.range)?"^"+e.range:e.range,[n,r]=await Promise.all([c(e,e.range,t).catch(()=>null),c(e,e.range,"latest").catch(()=>null)]),i=[{value:null,label:e.range}];return n&&n!==e.range&&i.push({value:n,label:s(e.range,n)}),r&&r!==n&&r!==e.range&&i.push({value:r,label:s(e.range,r)}),i})(e))).then(t=>{const i=e.map((e,n)=>[e,t[n]]).filter(([e,t])=>t.length>1);r.current&&n(i)})},[]),t?t.length?a.createElement(d,{radius:10,children:t.map(([e,t])=>a.createElement(h,{key:e.descriptorHash,active:!1,descriptor:e,suggestions:t}))}):a.createElement(u.Text,null,"No upgrades found"):a.createElement(u.Text,null,"Fetching suggestions...")},y=await g(({useSubmit:e})=>{e(m());const n=new Map;for(const e of t.workspaces)for(const r of["dependencies","devDependencies"])for(const i of e.manifest[r].values())null===t.tryWorkspaceByDescriptor(i)&&n.set(i.descriptorHash,i);const r=o.miscUtils.sortMap(n.values(),e=>o.structUtils.stringifyDescriptor(e));return a.createElement(u.Box,{flexDirection:"column"},a.createElement(f,null),a.createElement(p,null),a.createElement(v,{dependencies:r}))},{});if(void 0===y)return 1;let _=!1;for(const e of t.workspaces)for(const t of["dependencies","devDependencies"]){const n=e.manifest[t];for(const e of n.values()){const t=y.get(e.descriptorHash);null!=t&&(n.set(e.identHash,o.structUtils.makeDescriptor(e,t)),_=!0)}}if(!_)return 0;return(await o.StreamReport.start({configuration:e,stdout:this.context.stdout,includeLogs:!this.context.quiet},async e=>{await t.install({cache:r,report:e})})).exitCode()}}Y.usage=y.Command.Usage({category:"Interactive commands",description:"open the upgrade interface",details:"\n This command opens a fullscreen terminal interface where you can see any out of date packages used by your application, their status compared to the latest versions available on the remote registry, and select packages to upgrade.\n ",examples:[["Open the upgrade window","yarn upgrade-interactive"]]}),r([y.Command.Path("upgrade-interactive")],Y.prototype,"execute",null);const K={commands:[C,Y]}},7840:(e,t,n)=>{"use strict";const r=n(7382),i=n(7382),o=n(9245),u=n(1525),a=({value:e,placeholder:t="",focus:n=!0,mask:a,highlightPastedText:l=!1,showCursor:s=!0,onChange:c,onSubmit:f})=>{const[{cursorOffset:d,cursorWidth:p},h]=i.useState({cursorOffset:(e||"").length,cursorWidth:0});i.useEffect(()=>{h(t=>{if(!n||!s)return t;const r=e||"";return t.cursorOffset>r.length-1?{cursorOffset:r.length,cursorWidth:0}:t})},[e,n,s]);const v=l?p:0,m=a?a.repeat(e.length):e;let g=m,y=t?u.grey(t):void 0;if(s&&n){y=t.length>0?u.inverse(t[0])+u.grey(t.slice(1)):u.inverse(" "),g=m.length>0?"":u.inverse(" ");let e=0;for(const t of m)g+=e>=d-v&&e<=d?u.inverse(t):t,e++;m.length>0&&d===m.length&&(g+=u.inverse(" "))}return o.useInput((t,n)=>{if(n.upArrow||n.downArrow||n.ctrl&&"c"===t||n.tab||n.shift&&n.tab)return;if(n.return)return void(f&&f(e));let r=d,i=e,o=0;n.leftArrow?s&&r--:n.rightArrow?s&&r++:n.backspace||n.delete?d>0&&(i=e.slice(0,d-1)+e.slice(d,e.length),r--):(i=e.slice(0,d)+t+e.slice(d,e.length),r+=t.length,t.length>1&&(o=t.length)),d<0&&(r=0),d>e.length&&(r=e.length),h({cursorOffset:r,cursorWidth:o}),i!==e&&c(i)},{isActive:n}),r.createElement(o.Text,null,t?m.length>0?g:y:g)};t.ZP=a},9902:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(1525)),o=/^(rgb|hsl|hsv|hwb)\(\s?(\d+),\s?(\d+),\s?(\d+)\s?\)$/,u=/^(ansi|ansi256)\(\s?(\d+)\s?\)$/,a=(e,t)=>"foreground"===t?e:"bg"+e[0].toUpperCase()+e.slice(1);t.default=(e,t,n)=>{if(!t)return e;if(t in i.default){const r=a(t,n);return i.default[r](e)}if(t.startsWith("#")){const r=a("hex",n);return i.default[r](t)(e)}if(t.startsWith("ansi")){const r=u.exec(t);if(!r)return e;const o=a(r[1],n),l=Number(r[2]);return i.default[o](l)(e)}if(t.startsWith("rgb")||t.startsWith("hsl")||t.startsWith("hsv")||t.startsWith("hwb")){const r=o.exec(t);if(!r)return e;const u=a(r[1],n),l=Number(r[2]),s=Number(r[3]),c=Number(r[4]);return i.default[u](l,s,c)(e)}return e}},2773:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(n(7382)),l=u(n(1696)),s=u(n(5512)),c=u(n(1489)),f=u(n(6834)),d=u(n(5001)),p=u(n(2560)),h=u(n(9052));class v extends a.PureComponent{constructor(){super(...arguments),this.state={isFocusEnabled:!0,activeFocusId:void 0,focusables:[],error:void 0},this.rawModeEnabledCount=0,this.handleSetRawMode=e=>{const{stdin:t}=this.props;if(!this.isRawModeSupported())throw t===process.stdin?new Error("Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.\nRead about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported"):new Error("Raw mode is not supported on the stdin provided to Ink.\nRead about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported");if(t.setEncoding("utf8"),e)return 0===this.rawModeEnabledCount&&(t.addListener("data",this.handleInput),t.resume(),t.setRawMode(!0)),void this.rawModeEnabledCount++;0==--this.rawModeEnabledCount&&(t.setRawMode(!1),t.removeListener("data",this.handleInput),t.pause())},this.handleInput=e=>{""===e&&this.props.exitOnCtrlC&&this.handleExit(),""===e&&this.state.activeFocusId&&this.setState({activeFocusId:void 0}),this.state.isFocusEnabled&&this.state.focusables.length>0&&("\t"===e&&this.focusNext(),""===e&&this.focusPrevious())},this.handleExit=e=>{this.isRawModeSupported()&&this.handleSetRawMode(!1),this.props.onExit(e)},this.enableFocus=()=>{this.setState({isFocusEnabled:!0})},this.disableFocus=()=>{this.setState({isFocusEnabled:!1})},this.focusNext=()=>{this.setState(e=>{const t=e.focusables[0].id;return{activeFocusId:this.findNextFocusable(e)||t}})},this.focusPrevious=()=>{this.setState(e=>{const t=e.focusables[e.focusables.length-1].id;return{activeFocusId:this.findPreviousFocusable(e)||t}})},this.addFocusable=(e,{autoFocus:t})=>{this.setState(n=>{let r=n.activeFocusId;return!r&&t&&(r=e),{activeFocusId:r,focusables:[...n.focusables,{id:e,isActive:!0}]}})},this.removeFocusable=e=>{this.setState(t=>({activeFocusId:t.activeFocusId===e?void 0:t.activeFocusId,focusables:t.focusables.filter(t=>t.id!==e)}))},this.activateFocusable=e=>{this.setState(t=>({focusables:t.focusables.map(t=>t.id!==e?t:{id:e,isActive:!0})}))},this.deactivateFocusable=e=>{this.setState(t=>({activeFocusId:t.activeFocusId===e?void 0:t.activeFocusId,focusables:t.focusables.map(t=>t.id!==e?t:{id:e,isActive:!1})}))},this.findNextFocusable=e=>{for(let t=e.focusables.findIndex(t=>t.id===e.activeFocusId)+1;t{for(let t=e.focusables.findIndex(t=>t.id===e.activeFocusId)-1;t>=0;t--)if(e.focusables[t].isActive)return e.focusables[t].id}}static getDerivedStateFromError(e){return{error:e}}isRawModeSupported(){return this.props.stdin.isTTY}render(){return a.default.createElement(s.default.Provider,{value:{exit:this.handleExit}},a.default.createElement(c.default.Provider,{value:{stdin:this.props.stdin,setRawMode:this.handleSetRawMode,isRawModeSupported:this.isRawModeSupported(),internal_exitOnCtrlC:this.props.exitOnCtrlC}},a.default.createElement(f.default.Provider,{value:{stdout:this.props.stdout,write:this.props.writeToStdout}},a.default.createElement(d.default.Provider,{value:{stderr:this.props.stderr,write:this.props.writeToStderr}},a.default.createElement(p.default.Provider,{value:{activeId:this.state.activeFocusId,add:this.addFocusable,remove:this.removeFocusable,activate:this.activateFocusable,deactivate:this.deactivateFocusable,enableFocus:this.enableFocus,disableFocus:this.disableFocus,focusNext:this.focusNext,focusPrevious:this.focusPrevious}},this.state.error?a.default.createElement(h.default,{error:this.state.error}):this.props.children)))))}componentDidMount(){l.default.hide(this.props.stdout)}componentWillUnmount(){l.default.show(this.props.stdout),this.isRawModeSupported()&&this.handleSetRawMode(!1)}componentDidCatch(e){this.handleExit(e)}}t.default=v,v.displayName="InternalApp"},5512:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7382).createContext({exit:()=>{}});r.displayName="InternalAppContext",t.default=r},5277:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},u=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{var{children:n}=e,r=u(e,["children"]);const i=Object.assign(Object.assign({},r),{marginLeft:r.marginLeft||r.marginX||r.margin||0,marginRight:r.marginRight||r.marginX||r.margin||0,marginTop:r.marginTop||r.marginY||r.margin||0,marginBottom:r.marginBottom||r.marginY||r.margin||0,paddingLeft:r.paddingLeft||r.paddingX||r.padding||0,paddingRight:r.paddingRight||r.paddingX||r.padding||0,paddingTop:r.paddingTop||r.paddingY||r.padding||0,paddingBottom:r.paddingBottom||r.paddingY||r.padding||0});return a.default.createElement("ink-box",{ref:t,style:i},n)});l.displayName="Box",l.defaultProps={flexDirection:"row",flexGrow:0,flexShrink:1},t.default=l},9052:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(n(5747)),l=u(n(7382)),s=u(n(9796)),c=u(n(9908)),f=u(n(5277)),d=u(n(9146)),p=new s.default({cwd:process.cwd(),internals:s.default.nodeInternals()});t.default=({error:e})=>{const t=e.stack?e.stack.split("\n").slice(1):void 0,n=t?p.parseLine(t[0]):void 0;let r,i=0;if((null==n?void 0:n.file)&&(null==n?void 0:n.line)&&a.existsSync(n.file)){const e=a.readFileSync(n.file,"utf8");if(r=c.default(e,n.line),r)for(const{line:e}of r)i=Math.max(i,String(e).length)}return l.default.createElement(f.default,{flexDirection:"column",padding:1},l.default.createElement(f.default,null,l.default.createElement(d.default,{backgroundColor:"red",color:"white"}," ","ERROR"," "),l.default.createElement(d.default,null," ",e.message)),n&&l.default.createElement(f.default,{marginTop:1},l.default.createElement(d.default,{dimColor:!0},n.file,":",n.line,":",n.column)),n&&r&&l.default.createElement(f.default,{marginTop:1,flexDirection:"column"},r.map(({line:e,value:t})=>l.default.createElement(f.default,{key:e},l.default.createElement(f.default,{width:i+1},l.default.createElement(d.default,{dimColor:e!==n.line,backgroundColor:e===n.line?"red":void 0,color:e===n.line?"white":void 0},String(e).padStart(i," "),":")),l.default.createElement(d.default,{key:e,backgroundColor:e===n.line?"red":void 0,color:e===n.line?"white":void 0}," "+t)))),e.stack&&l.default.createElement(f.default,{marginTop:1,flexDirection:"column"},e.stack.split("\n").slice(1).map(e=>{const t=p.parseLine(e);return t?l.default.createElement(f.default,{key:e},l.default.createElement(d.default,{dimColor:!0},"- "),l.default.createElement(d.default,{dimColor:!0,bold:!0},t.function),l.default.createElement(d.default,{dimColor:!0,color:"gray"}," ","(",t.file,":",t.line,":",t.column,")")):l.default.createElement(f.default,{key:e},l.default.createElement(d.default,{dimColor:!0},"- "),l.default.createElement(d.default,{dimColor:!0,bold:!0},e))})))}},2560:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7382).createContext({activeId:void 0,add:()=>{},remove:()=>{},activate:()=>{},deactivate:()=>{},enableFocus:()=>{},disableFocus:()=>{},focusNext:()=>{},focusPrevious:()=>{}});r.displayName="InternalFocusContext",t.default=r},8200:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(7382)),o=({count:e=1})=>i.default.createElement("ink-text",null,"\n".repeat(e));o.displayName="Newline",t.default=o},2198:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(7382)),o=r(n(5277)),u=()=>i.default.createElement(o.default,{flexGrow:1});u.displayName="Spacer",t.default=u},8915:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const u=o(n(7382)),a=e=>{const{items:t,children:n,style:r}=e,[i,o]=u.useState(0),a=u.useMemo(()=>t.slice(i),[t,i]);u.useLayoutEffect(()=>{o(t.length)},[t.length]);const l=a.map((e,t)=>n(e,i+t)),s=u.useMemo(()=>Object.assign({position:"absolute",flexDirection:"column"},r),[r]);return u.default.createElement("ink-box",{internal_static:!0,style:s},l)};a.displayName="Static",t.default=a},5001:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7382).createContext({stderr:void 0,write:()=>{}});r.displayName="InternalStderrContext",t.default=r},1489:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7382).createContext({stdin:void 0,setRawMode:()=>{},isRawModeSupported:!1,internal_exitOnCtrlC:!0});r.displayName="InternalStdinContext",t.default=r},6834:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7382).createContext({stdout:void 0,write:()=>{}});r.displayName="InternalStdoutContext",t.default=r},9146:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(7382)),o=r(n(1525)),u=r(n(9902)),a=({color:e,backgroundColor:t,dimColor:n,bold:r,italic:a,underline:l,strikethrough:s,inverse:c,wrap:f,children:d})=>{if(null==d)return null;return i.default.createElement("ink-text",{style:{flexGrow:0,flexShrink:1,flexDirection:"row",textWrap:f},internal_transform:i=>(n&&(i=o.default.dim(i)),e&&(i=u.default(i,e,"foreground")),t&&(i=u.default(i,t,"background")),r&&(i=o.default.bold(i)),a&&(i=o.default.italic(i)),l&&(i=o.default.underline(i)),s&&(i=o.default.strikethrough(i)),c&&(i=o.default.inverse(i)),i)},d)};a.displayName="Text",a.defaultProps={dimColor:!1,bold:!1,italic:!1,underline:!1,strikethrough:!1,wrap:"wrap"},t.default=a},4592:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(7382)),o=({children:e,transform:t})=>null==e?null:i.default.createElement("ink-text",{style:{flexGrow:0,flexShrink:1,flexDirection:"row"},internal_transform:t},e);o.displayName="Transform",t.default=o},146:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(3296)),o=n(5187),u=global;u.WebSocket||(u.WebSocket=i.default),u.window||(u.window=global),u.window.__REACT_DEVTOOLS_COMPONENT_FILTERS__=[{type:1,value:7,isEnabled:!0},{type:2,value:"InternalApp",isEnabled:!0,isValid:!0},{type:2,value:"InternalAppContext",isEnabled:!0,isValid:!0},{type:2,value:"InternalStdoutContext",isEnabled:!0,isValid:!0},{type:2,value:"InternalStderrContext",isEnabled:!0,isValid:!0},{type:2,value:"InternalStdinContext",isEnabled:!0,isValid:!0},{type:2,value:"InternalFocusContext",isEnabled:!0,isValid:!0}],o.connectToDevTools()},9864:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.setTextNodeValue=t.createTextNode=t.setStyle=t.setAttribute=t.removeChildNode=t.insertBeforeNode=t.appendChildNode=t.createNode=t.TEXT_NAME=void 0;const i=r(n(6401)),o=r(n(8113)),u=r(n(5809)),a=r(n(2030)),l=r(n(9099));t.TEXT_NAME="#text",t.createNode=e=>{var t;const n={nodeName:e,style:{},attributes:{},childNodes:[],parentNode:null,yogaNode:"ink-virtual-text"===e?void 0:i.default.Node.create()};return"ink-text"===e&&(null===(t=n.yogaNode)||void 0===t||t.setMeasureFunc(s.bind(null,n))),n},t.appendChildNode=(e,n)=>{var r;n.parentNode&&t.removeChildNode(n.parentNode,n),n.parentNode=e,e.childNodes.push(n),n.yogaNode&&(null===(r=e.yogaNode)||void 0===r||r.insertChild(n.yogaNode,e.yogaNode.getChildCount())),"ink-text"!==e.nodeName&&"ink-virtual-text"!==e.nodeName||f(e)},t.insertBeforeNode=(e,n,r)=>{var i,o;n.parentNode&&t.removeChildNode(n.parentNode,n),n.parentNode=e;const u=e.childNodes.indexOf(r);if(u>=0)return e.childNodes.splice(u,0,n),void(n.yogaNode&&(null===(i=e.yogaNode)||void 0===i||i.insertChild(n.yogaNode,u)));e.childNodes.push(n),n.yogaNode&&(null===(o=e.yogaNode)||void 0===o||o.insertChild(n.yogaNode,e.yogaNode.getChildCount())),"ink-text"!==e.nodeName&&"ink-virtual-text"!==e.nodeName||f(e)},t.removeChildNode=(e,t)=>{var n,r;t.yogaNode&&(null===(r=null===(n=t.parentNode)||void 0===n?void 0:n.yogaNode)||void 0===r||r.removeChild(t.yogaNode)),t.parentNode=null;const i=e.childNodes.indexOf(t);i>=0&&e.childNodes.splice(i,1),"ink-text"!==e.nodeName&&"ink-virtual-text"!==e.nodeName||f(e)},t.setAttribute=(e,t,n)=>{e.attributes[t]=n},t.setStyle=(e,t)=>{e.style=t,e.yogaNode&&u.default(e.yogaNode,t)},t.createTextNode=e=>{const n={nodeName:"#text",nodeValue:e,yogaNode:void 0,parentNode:null,style:{}};return t.setTextNodeValue(n,e),n};const s=function(e,t){var n,r;const i="#text"===e.nodeName?e.nodeValue:l.default(e),u=o.default(i);if(u.width<=t)return u;if(u.width>=1&&t>0&&t<1)return u;const s=null!==(r=null===(n=e.style)||void 0===n?void 0:n.textWrap)&&void 0!==r?r:"wrap",c=a.default(i,t,s);return o.default(c)},c=e=>{var t;if(e&&e.parentNode)return null!==(t=e.yogaNode)&&void 0!==t?t:c(e.parentNode)},f=e=>{const t=c(e);null==t||t.markDirty()};t.setTextNodeValue=(e,t)=>{"string"!=typeof t&&(t=String(t)),e.nodeValue=t,f(e)}},317:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(6401));t.default=e=>e.getComputedWidth()-e.getComputedPadding(i.default.EDGE_LEFT)-e.getComputedPadding(i.default.EDGE_RIGHT)-e.getComputedBorder(i.default.EDGE_LEFT)-e.getComputedBorder(i.default.EDGE_RIGHT)},4699:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(7382),o=r(n(5512));t.default=()=>i.useContext(o.default)},5442:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(7382),o=r(n(2560));t.default=()=>{const e=i.useContext(o.default);return{enableFocus:e.enableFocus,disableFocus:e.disableFocus,focusNext:e.focusNext,focusPrevious:e.focusPrevious}}},8230:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(7382),o=r(n(2560)),u=r(n(1541));t.default=({isActive:e=!0,autoFocus:t=!1}={})=>{const{isRawModeSupported:n,setRawMode:r}=u.default(),{activeId:a,add:l,remove:s,activate:c,deactivate:f}=i.useContext(o.default),d=i.useMemo(()=>Math.random().toString().slice(2,7),[]);return i.useEffect(()=>(l(d,{autoFocus:t}),()=>{s(d)}),[d,t]),i.useEffect(()=>{e?c(d):f(d)},[e,d]),i.useEffect(()=>{if(n&&e)return r(!0),()=>{r(!1)}},[e]),{isFocused:Boolean(d)&&a===d}}},4495:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(7382),o=r(n(1541));t.default=(e,t={})=>{const{stdin:n,setRawMode:r,internal_exitOnCtrlC:u}=o.default();i.useEffect(()=>{if(!1!==t.isActive)return r(!0),()=>{r(!1)}},[t.isActive,r]),i.useEffect(()=>{if(!1===t.isActive)return;const r=t=>{let n=String(t);const r={upArrow:""===n,downArrow:""===n,leftArrow:""===n,rightArrow:""===n,pageDown:"[6~"===n,pageUp:"[5~"===n,return:"\r"===n,escape:""===n,ctrl:!1,shift:!1,tab:"\t"===n||""===n,backspace:"\b"===n,delete:""===n||"[3~"===n,meta:!1};n<=""&&!r.return&&(n=String.fromCharCode(n.charCodeAt(0)+"a".charCodeAt(0)-1),r.ctrl=!0),n.startsWith("")&&(n=n.slice(1),r.meta=!0);const i=n>="A"&&n<="Z",o=n>="А"&&n<="Я";1===n.length&&(i||o)&&(r.shift=!0),r.tab&&"[Z"===n&&(r.shift=!0),(r.tab||r.backspace||r.delete)&&(n=""),"c"===n&&r.ctrl&&u||e(n,r)};return null==n||n.on("data",r),()=>{null==n||n.off("data",r)}},[t.isActive,n,u,e])}},1686:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(7382),o=r(n(5001));t.default=()=>i.useContext(o.default)},1541:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(7382),o=r(n(1489));t.default=()=>i.useContext(o.default)},9890:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(7382),o=r(n(6834));t.default=()=>i.useContext(o.default)},9245:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9417);Object.defineProperty(t,"render",{enumerable:!0,get:function(){return r.default}});var i=n(5277);Object.defineProperty(t,"Box",{enumerable:!0,get:function(){return i.default}});var o=n(9146);Object.defineProperty(t,"Text",{enumerable:!0,get:function(){return o.default}});var u=n(8915);Object.defineProperty(t,"Static",{enumerable:!0,get:function(){return u.default}});var a=n(4592);Object.defineProperty(t,"Transform",{enumerable:!0,get:function(){return a.default}});var l=n(8200);Object.defineProperty(t,"Newline",{enumerable:!0,get:function(){return l.default}});var s=n(2198);Object.defineProperty(t,"Spacer",{enumerable:!0,get:function(){return s.default}});var c=n(4495);Object.defineProperty(t,"useInput",{enumerable:!0,get:function(){return c.default}});var f=n(4699);Object.defineProperty(t,"useApp",{enumerable:!0,get:function(){return f.default}});var d=n(1541);Object.defineProperty(t,"useStdin",{enumerable:!0,get:function(){return d.default}});var p=n(9890);Object.defineProperty(t,"useStdout",{enumerable:!0,get:function(){return p.default}});var h=n(1686);Object.defineProperty(t,"useStderr",{enumerable:!0,get:function(){return h.default}});var v=n(8230);Object.defineProperty(t,"useFocus",{enumerable:!0,get:function(){return v.default}});var m=n(5442);Object.defineProperty(t,"useFocusManager",{enumerable:!0,get:function(){return m.default}});var g=n(3887);Object.defineProperty(t,"measureElement",{enumerable:!0,get:function(){return g.default}})},3206:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=u(n(7382)),l=n(464),s=u(n(503)),c=u(n(7589)),f=u(n(2738)),d=u(n(2633)),p=u(n(5117)),h=u(n(5691)),v=u(n(6458)),m=u(n(8070)),g=o(n(9864)),y=u(n(9679)),_=u(n(2773)),b="false"!==process.env.CI&&f.default,w=()=>{};t.default=class{constructor(e){this.resolveExitPromise=()=>{},this.rejectExitPromise=()=>{},this.unsubscribeExit=()=>{},this.onRender=()=>{if(this.isUnmounted)return;const{output:e,outputHeight:t,staticOutput:n}=h.default(this.rootNode,this.options.stdout.columns||80),r=n&&"\n"!==n;return this.options.debug?(r&&(this.fullStaticOutput+=n),void this.options.stdout.write(this.fullStaticOutput+e)):b?(r&&this.options.stdout.write(n),void(this.lastOutput=e)):(r&&(this.fullStaticOutput+=n),t>=this.options.stdout.rows?(this.options.stdout.write(c.default.clearTerminal+this.fullStaticOutput+e),void(this.lastOutput=e)):(r&&(this.log.clear(),this.options.stdout.write(n),this.log(e)),r||e===this.lastOutput||this.throttledLog(e),void(this.lastOutput=e)))},d.default(this),this.options=e,this.rootNode=g.createNode("ink-root"),this.rootNode.onRender=e.debug?this.onRender:l.throttle(this.onRender,32,{leading:!0,trailing:!0}),this.rootNode.onImmediateRender=this.onRender,this.log=s.default.create(e.stdout),this.throttledLog=e.debug?this.log:l.throttle(this.log,void 0,{leading:!0,trailing:!0}),this.isUnmounted=!1,this.lastOutput="",this.fullStaticOutput="",this.container=p.default.createContainer(this.rootNode,!1,!1),this.unsubscribeExit=v.default(this.unmount,{alwaysLast:!1}),"true"===process.env.DEV&&p.default.injectIntoDevTools({bundleType:0,version:"16.13.1",rendererPackageName:"ink"}),e.patchConsole&&this.patchConsole(),b||(e.stdout.on("resize",this.onRender),this.unsubscribeResize=()=>{e.stdout.off("resize",this.onRender)})}render(e){const t=a.default.createElement(_.default,{stdin:this.options.stdin,stdout:this.options.stdout,stderr:this.options.stderr,writeToStdout:this.writeToStdout,writeToStderr:this.writeToStderr,exitOnCtrlC:this.options.exitOnCtrlC,onExit:this.unmount},e);p.default.updateContainer(t,this.container,null,w)}writeToStdout(e){this.isUnmounted||(this.options.debug?this.options.stdout.write(e+this.fullStaticOutput+this.lastOutput):b?this.options.stdout.write(e):(this.log.clear(),this.options.stdout.write(e),this.log(this.lastOutput)))}writeToStderr(e){if(!this.isUnmounted)return this.options.debug?(this.options.stderr.write(e),void this.options.stdout.write(this.fullStaticOutput+this.lastOutput)):void(b?this.options.stderr.write(e):(this.log.clear(),this.options.stderr.write(e),this.log(this.lastOutput)))}unmount(e){this.isUnmounted||(this.onRender(),this.unsubscribeExit(),"function"==typeof this.restoreConsole&&this.restoreConsole(),"function"==typeof this.unsubscribeResize&&this.unsubscribeResize(),b?this.options.stdout.write(this.lastOutput+"\n"):this.options.debug||this.log.done(),this.isUnmounted=!0,p.default.updateContainer(null,this.container,null,w),y.default.delete(this.options.stdout),e instanceof Error?this.rejectExitPromise(e):this.resolveExitPromise())}waitUntilExit(){return this.exitPromise||(this.exitPromise=new Promise((e,t)=>{this.resolveExitPromise=e,this.rejectExitPromise=t})),this.exitPromise}clear(){b||this.options.debug||this.log.clear()}patchConsole(){this.options.debug||(this.restoreConsole=m.default((e,t)=>{if("stdout"===e&&this.writeToStdout(t),"stderr"===e){t.startsWith("The above error occurred")||this.writeToStderr(t)}}))}}},9679:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=new WeakMap},503:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(7589)),o=r(n(1696));t.default={create:(e,{showCursor:t=!1}={})=>{let n=0,r="",u=!1;const a=a=>{t||u||(o.default.hide(),u=!0);const l=a+"\n";l!==r&&(r=l,e.write(i.default.eraseLines(n)+l),n=l.split("\n").length)};return a.clear=()=>{e.write(i.default.eraseLines(n)),r="",n=0},a.done=()=>{r="",n=0,t||(o.default.show(),u=!1)},a}}},3887:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=e=>{var t,n,r,i;return{width:null!==(n=null===(t=e.yogaNode)||void 0===t?void 0:t.getComputedWidth())&&void 0!==n?n:0,height:null!==(i=null===(r=e.yogaNode)||void 0===r?void 0:r.getComputedHeight())&&void 0!==i?i:0}}},8113:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(8949)),o={};t.default=e=>{if(0===e.length)return{width:0,height:0};if(o[e])return o[e];const t=i.default(e),n=e.split("\n").length;return o[e]={width:t,height:n},{width:t,height:n}}},4110:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(1566)),o=r(n(3262));t.default=class{constructor(e){this.writes=[];const{width:t,height:n}=e;this.width=t,this.height=n}write(e,t,n,r){const{transformers:i}=r;n&&this.writes.push({x:e,y:t,text:n,transformers:i})}get(){const e=[];for(let t=0;te.trimRight()).join("\n"),height:e.length}}}},5117:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(7181),o=r(n(7714)),u=r(n(6401)),a=n(9864);"true"===process.env.DEV&&n(146);const l=e=>{null==e||e.unsetMeasureFunc(),null==e||e.freeRecursive()};t.default=o.default({schedulePassiveEffects:i.unstable_scheduleCallback,cancelPassiveEffects:i.unstable_cancelCallback,now:Date.now,getRootHostContext:()=>({isInsideText:!1}),prepareForCommit:()=>{},resetAfterCommit:e=>{if(e.isStaticDirty)return e.isStaticDirty=!1,void("function"==typeof e.onImmediateRender&&e.onImmediateRender());"function"==typeof e.onRender&&e.onRender()},getChildHostContext:(e,t)=>{const n="ink-text"===t||"ink-virtual-text"===t;return e.isInsideText===n?e:{isInsideText:n}},shouldSetTextContent:()=>!1,createInstance:(e,t,n,r)=>{if(r.isInsideText&&"ink-box"===e)throw new Error(" can’t be nested inside component");const i="ink-text"===e&&r.isInsideText?"ink-virtual-text":e,o=a.createNode(i);for(const[e,n]of Object.entries(t))"children"!==e&&("style"===e?a.setStyle(o,n):"internal_transform"===e?o.internal_transform=n:"internal_static"===e?o.internal_static=!0:a.setAttribute(o,e,n));return o},createTextInstance:(e,t,n)=>{if(!n.isInsideText)throw new Error(`Text string "${e}" must be rendered inside component`);return a.createTextNode(e)},resetTextContent:()=>{},hideTextInstance:e=>{a.setTextNodeValue(e,"")},unhideTextInstance:(e,t)=>{a.setTextNodeValue(e,t)},getPublicInstance:e=>e,hideInstance:e=>{var t;null===(t=e.yogaNode)||void 0===t||t.setDisplay(u.default.DISPLAY_NONE)},unhideInstance:e=>{var t;null===(t=e.yogaNode)||void 0===t||t.setDisplay(u.default.DISPLAY_FLEX)},appendInitialChild:a.appendChildNode,appendChild:a.appendChildNode,insertBefore:a.insertBeforeNode,finalizeInitialChildren:(e,t,n,r)=>(e.internal_static&&(r.isStaticDirty=!0,r.staticNode=e),!1),supportsMutation:!0,appendChildToContainer:a.appendChildNode,insertInContainerBefore:a.insertBeforeNode,removeChildFromContainer:(e,t)=>{a.removeChildNode(e,t),l(t.yogaNode)},prepareUpdate:(e,t,n,r,i)=>{e.internal_static&&(i.isStaticDirty=!0);const o={},u=Object.keys(r);for(const e of u)if(r[e]!==n[e]){if("style"===e&&"object"==typeof r.style&&"object"==typeof n.style){const e=r.style,t=n.style,i=Object.keys(e);for(const n of i){if("borderStyle"===n||"borderColor"===n){if("object"!=typeof o.style){const e={};o.style=e}o.style.borderStyle=e.borderStyle,o.style.borderColor=e.borderColor}if(e[n]!==t[n]){if("object"!=typeof o.style){const e={};o.style=e}o.style[n]=e[n]}}continue}o[e]=r[e]}return o},commitUpdate:(e,t)=>{for(const[n,r]of Object.entries(t))"children"!==n&&("style"===n?a.setStyle(e,r):"internal_transform"===n?e.internal_transform=r:"internal_static"===n?e.internal_static=!0:a.setAttribute(e,n,r))},commitTextUpdate:(e,t,n)=>{a.setTextNodeValue(e,n)},removeChild:(e,t)=>{a.removeChildNode(e,t),l(t.yogaNode)}})},4907:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(4097)),o=r(n(9902));t.default=(e,t,n,r)=>{if("string"==typeof n.style.borderStyle){const u=n.yogaNode.getComputedWidth(),a=n.yogaNode.getComputedHeight(),l=n.style.borderColor,s=i.default[n.style.borderStyle],c=o.default(s.topLeft+s.horizontal.repeat(u-2)+s.topRight,l,"foreground"),f=(o.default(s.vertical,l,"foreground")+"\n").repeat(a-2),d=o.default(s.bottomLeft+s.horizontal.repeat(u-2)+s.bottomRight,l,"foreground");r.write(e,t,c,{transformers:[]}),r.write(e,t+1,f,{transformers:[]}),r.write(e+u-1,t+1,f,{transformers:[]}),r.write(e,t+a-1,d,{transformers:[]})}}},3782:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(6401)),o=r(n(8949)),u=r(n(9646)),a=r(n(2030)),l=r(n(317)),s=r(n(9099)),c=r(n(4907)),f=(e,t,n)=>{var r;const{offsetX:d=0,offsetY:p=0,transformers:h=[],skipStaticElements:v}=n;if(v&&e.internal_static)return;const{yogaNode:m}=e;if(m){if(m.getDisplay()===i.default.DISPLAY_NONE)return;const n=d+m.getComputedLeft(),g=p+m.getComputedTop();let y=h;if("function"==typeof e.internal_transform&&(y=[e.internal_transform,...h]),"ink-text"===e.nodeName){let i=s.default(e);if(i.length>0){const s=o.default(i),c=l.default(m);if(s>c){const t=null!==(r=e.style.textWrap)&&void 0!==r?r:"wrap";i=a.default(i,c,t)}i=((e,t)=>{var n;const r=null===(n=e.childNodes[0])||void 0===n?void 0:n.yogaNode;if(r){const e=r.getComputedLeft(),n=r.getComputedTop();t="\n".repeat(n)+u.default(t,e)}return t})(e,i),t.write(n,g,i,{transformers:y})}return}if("ink-box"===e.nodeName&&c.default(n,g,e,t),"ink-root"===e.nodeName||"ink-box"===e.nodeName)for(const r of e.childNodes)f(r,t,{offsetX:n,offsetY:g,transformers:y,skipStaticElements:v})}};t.default=f},9417:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(3206)),o=r(n(9679)),u=n(2413);t.default=(e,t)=>{const n=Object.assign({stdout:process.stdout,stdin:process.stdin,stderr:process.stderr,debug:!1,exitOnCtrlC:!0,patchConsole:!0},a(t)),r=l(n.stdout,()=>new i.default(n));return r.render(e),{rerender:r.render,unmount:()=>r.unmount(),waitUntilExit:r.waitUntilExit,cleanup:()=>o.default.delete(n.stdout),clear:r.clear}};const a=(e={})=>e instanceof u.Stream?{stdout:e,stdin:process.stdin}:e,l=(e,t)=>{let n;return o.default.has(e)?n=o.default.get(e):(n=t(),o.default.set(e,n)),n}},5691:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(6401)),o=r(n(3782)),u=r(n(4110));t.default=(e,t)=>{var n;if(e.yogaNode.setWidth(t),e.yogaNode){e.yogaNode.calculateLayout(void 0,void 0,i.default.DIRECTION_LTR);const t=new u.default({width:e.yogaNode.getComputedWidth(),height:e.yogaNode.getComputedHeight()});let r;o.default(e,t,{skipStaticElements:!0}),(null===(n=e.staticNode)||void 0===n?void 0:n.yogaNode)&&(r=new u.default({width:e.staticNode.yogaNode.getComputedWidth(),height:e.staticNode.yogaNode.getComputedHeight()}),o.default(e.staticNode,r,{skipStaticElements:!1}));const{output:a,height:l}=t.get();return{output:a,outputHeight:l,staticOutput:r?r.get().output+"\n":""}}return{output:"",outputHeight:0,staticOutput:""}}},9099:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e=>{let t="";if(e.childNodes.length>0)for(const r of e.childNodes){let e="";"#text"===r.nodeName?e=r.nodeValue:("ink-text"!==r.nodeName&&"ink-virtual-text"!==r.nodeName||(e=n(r)),e.length>0&&"function"==typeof r.internal_transform&&(e=r.internal_transform(e))),t+=e}return t};t.default=n},5809:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(6401));t.default=(e,t={})=>{((e,t)=>{"position"in t&&e.setPositionType("absolute"===t.position?i.default.POSITION_TYPE_ABSOLUTE:i.default.POSITION_TYPE_RELATIVE)})(e,t),((e,t)=>{"marginLeft"in t&&e.setMargin(i.default.EDGE_START,t.marginLeft||0),"marginRight"in t&&e.setMargin(i.default.EDGE_END,t.marginRight||0),"marginTop"in t&&e.setMargin(i.default.EDGE_TOP,t.marginTop||0),"marginBottom"in t&&e.setMargin(i.default.EDGE_BOTTOM,t.marginBottom||0)})(e,t),((e,t)=>{"paddingLeft"in t&&e.setPadding(i.default.EDGE_LEFT,t.paddingLeft||0),"paddingRight"in t&&e.setPadding(i.default.EDGE_RIGHT,t.paddingRight||0),"paddingTop"in t&&e.setPadding(i.default.EDGE_TOP,t.paddingTop||0),"paddingBottom"in t&&e.setPadding(i.default.EDGE_BOTTOM,t.paddingBottom||0)})(e,t),((e,t)=>{var n;"flexGrow"in t&&e.setFlexGrow(null!==(n=t.flexGrow)&&void 0!==n?n:0),"flexShrink"in t&&e.setFlexShrink("number"==typeof t.flexShrink?t.flexShrink:1),"flexDirection"in t&&("row"===t.flexDirection&&e.setFlexDirection(i.default.FLEX_DIRECTION_ROW),"row-reverse"===t.flexDirection&&e.setFlexDirection(i.default.FLEX_DIRECTION_ROW_REVERSE),"column"===t.flexDirection&&e.setFlexDirection(i.default.FLEX_DIRECTION_COLUMN),"column-reverse"===t.flexDirection&&e.setFlexDirection(i.default.FLEX_DIRECTION_COLUMN_REVERSE)),"flexBasis"in t&&("number"==typeof t.flexBasis?e.setFlexBasis(t.flexBasis):"string"==typeof t.flexBasis?e.setFlexBasisPercent(Number.parseInt(t.flexBasis,10)):e.setFlexBasis(NaN)),"alignItems"in t&&("stretch"!==t.alignItems&&t.alignItems||e.setAlignItems(i.default.ALIGN_STRETCH),"flex-start"===t.alignItems&&e.setAlignItems(i.default.ALIGN_FLEX_START),"center"===t.alignItems&&e.setAlignItems(i.default.ALIGN_CENTER),"flex-end"===t.alignItems&&e.setAlignItems(i.default.ALIGN_FLEX_END)),"alignSelf"in t&&("auto"!==t.alignSelf&&t.alignSelf||e.setAlignSelf(i.default.ALIGN_AUTO),"flex-start"===t.alignSelf&&e.setAlignSelf(i.default.ALIGN_FLEX_START),"center"===t.alignSelf&&e.setAlignSelf(i.default.ALIGN_CENTER),"flex-end"===t.alignSelf&&e.setAlignSelf(i.default.ALIGN_FLEX_END)),"justifyContent"in t&&("flex-start"!==t.justifyContent&&t.justifyContent||e.setJustifyContent(i.default.JUSTIFY_FLEX_START),"center"===t.justifyContent&&e.setJustifyContent(i.default.JUSTIFY_CENTER),"flex-end"===t.justifyContent&&e.setJustifyContent(i.default.JUSTIFY_FLEX_END),"space-between"===t.justifyContent&&e.setJustifyContent(i.default.JUSTIFY_SPACE_BETWEEN),"space-around"===t.justifyContent&&e.setJustifyContent(i.default.JUSTIFY_SPACE_AROUND))})(e,t),((e,t)=>{var n,r;"width"in t&&("number"==typeof t.width?e.setWidth(t.width):"string"==typeof t.width?e.setWidthPercent(Number.parseInt(t.width,10)):e.setWidthAuto()),"height"in t&&("number"==typeof t.height?e.setHeight(t.height):"string"==typeof t.height?e.setHeightPercent(Number.parseInt(t.height,10)):e.setHeightAuto()),"minWidth"in t&&("string"==typeof t.minWidth?e.setMinWidthPercent(Number.parseInt(t.minWidth,10)):e.setMinWidth(null!==(n=t.minWidth)&&void 0!==n?n:0)),"minHeight"in t&&("string"==typeof t.minHeight?e.setMinHeightPercent(Number.parseInt(t.minHeight,10)):e.setMinHeight(null!==(r=t.minHeight)&&void 0!==r?r:0))})(e,t),((e,t)=>{"display"in t&&e.setDisplay("flex"===t.display?i.default.DISPLAY_FLEX:i.default.DISPLAY_NONE)})(e,t),((e,t)=>{if("borderStyle"in t){const n="string"==typeof t.borderStyle?1:0;e.setBorder(i.default.EDGE_TOP,n),e.setBorder(i.default.EDGE_BOTTOM,n),e.setBorder(i.default.EDGE_LEFT,n),e.setBorder(i.default.EDGE_RIGHT,n)}})(e,t)}},2030:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(4332)),o=r(n(5301)),u={};t.default=(e,t,n)=>{const r=e+String(t)+String(n);if(u[r])return u[r];let a=e;if("wrap"===n&&(a=i.default(e,t,{trim:!1,hard:!0})),n.startsWith("truncate")){let r="end";"truncate-middle"===n&&(r="middle"),"truncate-start"===n&&(r="start"),a=o.default(e,t,{position:r})}return u[r]=a,a}},5767:(e,t,n)=>{ +/** @license React v0.24.0 + * react-reconciler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +e.exports=function t(r){"use strict";var i=n(9381),o=n(7382),u=n(7181);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nOe||(e.current=Ae[Oe],Ae[Oe]=null,Oe--)}function Ie(e,t){Oe++,Ae[Oe]=e.current,e.current=t}var Ne={},Me={current:Ne},Re={current:!1},Fe=Ne;function Le(e,t){var n=e.type.contextTypes;if(!n)return Ne;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Be(e){return null!=(e=e.childContextTypes)}function je(e){Pe(Re),Pe(Me)}function Ue(e){Pe(Re),Pe(Me)}function ze(e,t,n){if(Me.current!==Ne)throw Error(a(168));Ie(Me,t),Ie(Re,n)}function We(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var o in r=r.getChildContext())if(!(o in e))throw Error(a(108,C(t)||"Unknown",o));return i({},n,{},r)}function He(e){var t=e.stateNode;return t=t&&t.__reactInternalMemoizedMergedChildContext||Ne,Fe=Me.current,Ie(Me,t),Ie(Re,Re.current),!0}function Ve(e,t,n){var r=e.stateNode;if(!r)throw Error(a(169));n?(t=We(e,t,Fe),r.__reactInternalMemoizedMergedChildContext=t,Pe(Re),Pe(Me),Ie(Me,t)):Pe(Re),Ie(Re,n)}var qe=u.unstable_runWithPriority,Ge=u.unstable_scheduleCallback,$e=u.unstable_cancelCallback,Ye=u.unstable_shouldYield,Ke=u.unstable_requestPaint,Xe=u.unstable_now,Qe=u.unstable_getCurrentPriorityLevel,Je=u.unstable_ImmediatePriority,Ze=u.unstable_UserBlockingPriority,et=u.unstable_NormalPriority,tt=u.unstable_LowPriority,nt=u.unstable_IdlePriority,rt={},it=void 0!==Ke?Ke:function(){},ot=null,ut=null,at=!1,lt=Xe(),st=1e4>lt?Xe:function(){return Xe()-lt};function ct(){switch(Qe()){case Je:return 99;case Ze:return 98;case et:return 97;case tt:return 96;case nt:return 95;default:throw Error(a(332))}}function ft(e){switch(e){case 99:return Je;case 98:return Ze;case 97:return et;case 96:return tt;case 95:return nt;default:throw Error(a(332))}}function dt(e,t){return e=ft(e),qe(e,t)}function pt(e,t,n){return e=ft(e),Ge(e,t,n)}function ht(e){return null===ot?(ot=[e],ut=Ge(Je,mt)):ot.push(e),rt}function vt(){if(null!==ut){var e=ut;ut=null,$e(e)}mt()}function mt(){if(!at&&null!==ot){at=!0;var e=0;try{var t=ot;dt(99,(function(){for(;e=t&&(dr=!0),e.firstContext=null)}function It(e,t){if(kt!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(kt=e,t=1073741823),t={context:e,observedBits:t,next:null},null===Ct){if(null===St)throw Error(a(308));Ct=t,St.dependencies={expirationTime:0,firstContext:t,responders:null}}else Ct=Ct.next=t;return q?e._currentValue:e._currentValue2}var Nt=!1;function Mt(e){return{baseState:e,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Rt(e){return{baseState:e.baseState,firstUpdate:e.firstUpdate,lastUpdate:e.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Ft(e,t){return{expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null,nextEffect:null}}function Lt(e,t){null===e.lastUpdate?e.firstUpdate=e.lastUpdate=t:(e.lastUpdate.next=t,e.lastUpdate=t)}function Bt(e,t){var n=e.alternate;if(null===n){var r=e.updateQueue,i=null;null===r&&(r=e.updateQueue=Mt(e.memoizedState))}else r=e.updateQueue,i=n.updateQueue,null===r?null===i?(r=e.updateQueue=Mt(e.memoizedState),i=n.updateQueue=Mt(n.memoizedState)):r=e.updateQueue=Rt(i):null===i&&(i=n.updateQueue=Rt(r));null===i||r===i?Lt(r,t):null===r.lastUpdate||null===i.lastUpdate?(Lt(r,t),Lt(i,t)):(Lt(r,t),i.lastUpdate=t)}function jt(e,t){var n=e.updateQueue;null===(n=null===n?e.updateQueue=Mt(e.memoizedState):Ut(e,n)).lastCapturedUpdate?n.firstCapturedUpdate=n.lastCapturedUpdate=t:(n.lastCapturedUpdate.next=t,n.lastCapturedUpdate=t)}function Ut(e,t){var n=e.alternate;return null!==n&&t===n.updateQueue&&(t=e.updateQueue=Rt(t)),t}function zt(e,t,n,r,o,u){switch(n.tag){case 1:return"function"==typeof(e=n.payload)?e.call(u,r,o):e;case 3:e.effectTag=-4097&e.effectTag|64;case 0:if(null==(o="function"==typeof(e=n.payload)?e.call(u,r,o):e))break;return i({},r,o);case 2:Nt=!0}return r}function Wt(e,t,n,r,i){Nt=!1;for(var o=(t=Ut(e,t)).baseState,u=null,a=0,l=t.firstUpdate,s=o;null!==l;){var c=l.expirationTime;cd?(p=f,f=null):p=f.sibling;var h=m(i,f,a[d],l);if(null===h){null===f&&(f=p);break}e&&f&&null===h.alternate&&t(i,f),u=o(h,u,d),null===c?s=h:c.sibling=h,c=h,f=p}if(d===a.length)return n(i,f),s;if(null===f){for(;dp?(h=d,d=null):h=d.sibling;var _=m(i,d,y.value,s);if(null===_){null===d&&(d=h);break}e&&d&&null===_.alternate&&t(i,d),u=o(_,u,p),null===f?c=_:f.sibling=_,f=_,d=h}if(y.done)return n(i,d),c;if(null===d){for(;!y.done;p++,y=l.next())null!==(y=v(i,y.value,s))&&(u=o(y,u,p),null===f?c=y:f.sibling=y,f=y);return c}for(d=r(i,d);!y.done;p++,y=l.next())null!==(y=g(d,i,p,y.value,s))&&(e&&null!==y.alternate&&d.delete(null===y.key?p:y.key),u=o(y,u,p),null===f?c=y:f.sibling=y,f=y);return e&&d.forEach((function(e){return t(i,e)})),c}return function(e,r,o,l){var s="object"==typeof o&&null!==o&&o.type===d&&null===o.key;s&&(o=o.props.children);var p="object"==typeof o&&null!==o;if(p)switch(o.$$typeof){case c:e:{for(p=o.key,s=r;null!==s;){if(s.key===p){if(7===s.tag?o.type===d:s.elementType===o.type){n(e,s.sibling),(r=i(s,o.type===d?o.props.children:o.props)).ref=en(e,s,o),r.return=e,e=r;break e}n(e,s);break}t(e,s),s=s.sibling}o.type===d?((r=so(o.props.children,e.mode,l,o.key)).return=e,e=r):((l=lo(o.type,o.key,o.props,null,e.mode,l)).ref=en(e,r,o),l.return=e,e=l)}return u(e);case f:e:{for(s=o.key;null!==r;){if(r.key===s){if(4===r.tag&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),(r=i(r,o.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=fo(o,e.mode,l)).return=e,e=r}return u(e)}if("string"==typeof o||"number"==typeof o)return o=""+o,null!==r&&6===r.tag?(n(e,r.sibling),(r=i(r,o)).return=e,e=r):(n(e,r),(r=co(o,e.mode,l)).return=e,e=r),u(e);if(Zt(o))return y(e,r,o,l);if(S(o))return _(e,r,o,l);if(p&&tn(e,o),void 0===o&&!s)switch(e.tag){case 1:case 0:throw e=e.type,Error(a(152,e.displayName||e.name||"Component"))}return n(e,r)}}var rn=nn(!0),on=nn(!1),un={},an={current:un},ln={current:un},sn={current:un};function cn(e){if(e===un)throw Error(a(174));return e}function fn(e,t){Ie(sn,t),Ie(ln,e),Ie(an,un),t=P(t),Pe(an),Ie(an,t)}function dn(e){Pe(an),Pe(ln),Pe(sn)}function pn(e){var t=cn(sn.current),n=cn(an.current);n!==(t=I(n,e.type,t))&&(Ie(ln,e),Ie(an,t))}function hn(e){ln.current===e&&(Pe(an),Pe(ln))}var vn={current:0};function mn(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||ye(n)||_e(n)))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.effectTag))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function gn(e,t){return{responder:e,props:t}}var yn=l.ReactCurrentDispatcher,_n=l.ReactCurrentBatchConfig,bn=0,wn=null,En=null,Dn=null,Sn=null,Cn=null,kn=null,Tn=0,xn=null,An=0,On=!1,Pn=null,In=0;function Nn(){throw Error(a(321))}function Mn(e,t){if(null===t)return!1;for(var n=0;nTn&&zi(Tn=f)):(Ui(f,s.suspenseConfig),o=s.eagerReducer===e?s.eagerState:e(o,s.action)),u=s,s=s.next}while(null!==s&&s!==r);c||(l=u,i=o),_t(o,t.memoizedState)||(dr=!0),t.memoizedState=o,t.baseUpdate=l,t.baseState=i,n.lastRenderedState=o}return[t.memoizedState,n.dispatch]}function zn(e){var t=Ln();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={last:null,dispatch:null,lastRenderedReducer:jn,lastRenderedState:e}).dispatch=Jn.bind(null,wn,e),[t.memoizedState,e]}function Wn(e){return Un(jn)}function Hn(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===xn?(xn={lastEffect:null}).lastEffect=e.next=e:null===(t=xn.lastEffect)?xn.lastEffect=e.next=e:(n=t.next,t.next=e,e.next=n,xn.lastEffect=e),e}function Vn(e,t,n,r){var i=Ln();An|=e,i.memoizedState=Hn(t,n,void 0,void 0===r?null:r)}function qn(e,t,n,r){var i=Bn();r=void 0===r?null:r;var o=void 0;if(null!==En){var u=En.memoizedState;if(o=u.destroy,null!==r&&Mn(r,u.deps))return void Hn(0,n,o,r)}An|=e,i.memoizedState=Hn(t,n,o,r)}function Gn(e,t){return Vn(516,192,e,t)}function $n(e,t){return qn(516,192,e,t)}function Yn(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Kn(){}function Xn(e,t){return Ln().memoizedState=[e,void 0===t?null:t],e}function Qn(e,t){var n=Bn();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Mn(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Jn(e,t,n){if(!(25>In))throw Error(a(301));var r=e.alternate;if(e===wn||null!==r&&r===wn)if(On=!0,e={expirationTime:bn,suspenseConfig:null,action:n,eagerReducer:null,eagerState:null,next:null},null===Pn&&(Pn=new Map),void 0===(n=Pn.get(t)))Pn.set(t,e);else{for(t=n;null!==t.next;)t=t.next;t.next=e}else{var i=xi(),o=qt.suspense;o={expirationTime:i=Ai(i,e,o),suspenseConfig:o,action:n,eagerReducer:null,eagerState:null,next:null};var u=t.last;if(null===u)o.next=o;else{var l=u.next;null!==l&&(o.next=l),u.next=o}if(t.last=o,0===e.expirationTime&&(null===r||0===r.expirationTime)&&null!==(r=t.lastRenderedReducer))try{var s=t.lastRenderedState,c=r(s,n);if(o.eagerReducer=r,o.eagerState=c,_t(c,s))return}catch(e){}Oi(e,i)}}var Zn={readContext:It,useCallback:Nn,useContext:Nn,useEffect:Nn,useImperativeHandle:Nn,useLayoutEffect:Nn,useMemo:Nn,useReducer:Nn,useRef:Nn,useState:Nn,useDebugValue:Nn,useResponder:Nn,useDeferredValue:Nn,useTransition:Nn},er={readContext:It,useCallback:Xn,useContext:It,useEffect:Gn,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Vn(4,36,Yn.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Vn(4,36,e,t)},useMemo:function(e,t){var n=Ln();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ln();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={last:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=Jn.bind(null,wn,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Ln().memoizedState=e},useState:zn,useDebugValue:Kn,useResponder:gn,useDeferredValue:function(e,t){var n=zn(e),r=n[0],i=n[1];return Gn((function(){u.unstable_next((function(){var n=_n.suspense;_n.suspense=void 0===t?null:t;try{i(e)}finally{_n.suspense=n}}))}),[e,t]),r},useTransition:function(e){var t=zn(!1),n=t[0],r=t[1];return[Xn((function(t){r(!0),u.unstable_next((function(){var n=_n.suspense;_n.suspense=void 0===e?null:e;try{r(!1),t()}finally{_n.suspense=n}}))}),[e,n]),n]}},tr={readContext:It,useCallback:Qn,useContext:It,useEffect:$n,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,qn(4,36,Yn.bind(null,t,e),n)},useLayoutEffect:function(e,t){return qn(4,36,e,t)},useMemo:function(e,t){var n=Bn();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Mn(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)},useReducer:Un,useRef:function(){return Bn().memoizedState},useState:Wn,useDebugValue:Kn,useResponder:gn,useDeferredValue:function(e,t){var n=Wn(),r=n[0],i=n[1];return $n((function(){u.unstable_next((function(){var n=_n.suspense;_n.suspense=void 0===t?null:t;try{i(e)}finally{_n.suspense=n}}))}),[e,t]),r},useTransition:function(e){var t=Wn(),n=t[0],r=t[1];return[Qn((function(t){r(!0),u.unstable_next((function(){var n=_n.suspense;_n.suspense=void 0===e?null:e;try{r(!1),t()}finally{_n.suspense=n}}))}),[e,n]),n]}},nr=null,rr=null,ir=!1;function or(e,t){var n=oo(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function ur(e,t){switch(e.tag){case 5:return null!==(t=me(t,e.type,e.pendingProps))&&(e.stateNode=t,!0);case 6:return null!==(t=ge(t,e.pendingProps))&&(e.stateNode=t,!0);case 13:default:return!1}}function ar(e){if(ir){var t=rr;if(t){var n=t;if(!ur(e,t)){if(!(t=be(n))||!ur(e,t))return e.effectTag=-1025&e.effectTag|2,ir=!1,void(nr=e);or(nr,n)}nr=e,rr=we(t)}else e.effectTag=-1025&e.effectTag|2,ir=!1,nr=e}}function lr(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;nr=e}function sr(e){if(!Y||e!==nr)return!1;if(!ir)return lr(e),ir=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!j(t,e.memoizedProps))for(t=rr;t;)or(e,t),t=be(t);if(lr(e),13===e.tag){if(!Y)throw Error(a(316));if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(a(317));rr=Se(e)}else rr=nr?be(e.stateNode):null;return!0}function cr(){Y&&(rr=nr=null,ir=!1)}var fr=l.ReactCurrentOwner,dr=!1;function pr(e,t,n,r){t.child=null===e?on(t,null,n,r):rn(t,e.child,n,r)}function hr(e,t,n,r,i){n=n.render;var o=t.ref;return Pt(t,i),r=Rn(e,t,n,r,o,i),null===e||dr?(t.effectTag|=1,pr(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=i&&(e.expirationTime=0),Pr(e,t,i))}function vr(e,t,n,r,i,o){if(null===e){var u=n.type;return"function"!=typeof u||uo(u)||void 0!==u.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=lo(n.type,null,r,null,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=u,mr(e,t,u,r,i,o))}return u=e.child,it)&&Si.set(e,t))}}function Pi(e,t){e.expirationTime(e=e.nextKnownPendingLevel)?t:e:t}function Ni(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=ht(Ri.bind(null,e));else{var t=Ii(e),n=e.callbackNode;if(0===t)null!==n&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var r=xi();if(1073741823===t?r=99:1===t||2===t?r=95:r=0>=(r=10*(1073741821-t)-10*(1073741821-r))?99:250>=r?98:5250>=r?97:95,null!==n){var i=e.callbackPriority;if(e.callbackExpirationTime===t&&i>=r)return;n!==rt&&$e(n)}e.callbackExpirationTime=t,e.callbackPriority=r,t=1073741823===t?ht(Ri.bind(null,e)):pt(r,Mi.bind(null,e),{timeout:10*(1073741821-t)-st()}),e.callbackNode=t}}}function Mi(e,t){if(Ti=0,t)return go(e,t=xi()),Ni(e),null;var n=Ii(e);if(0!==n){if(t=e.callbackNode,0!=(48&oi))throw Error(a(327));if(Xi(),e===ui&&n===li||Li(e,n),null!==ai){var r=oi;oi|=ii;for(var i=ji();;)try{Hi();break}catch(t){Bi(e,t)}if(Tt(),oi=r,ni.current=i,1===si)throw t=ci,Li(e,n),vo(e,n),Ni(e),t;if(null===ai)switch(i=e.finishedWork=e.current.alternate,e.finishedExpirationTime=n,r=si,ui=null,r){case 0:case 1:throw Error(a(345));case 2:go(e,2=n){e.lastPingedTime=n,Li(e,n);break}}if(0!==(o=Ii(e))&&o!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}e.timeoutHandle=W($i.bind(null,e),i);break}$i(e);break;case 4:if(vo(e,n),n===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=Gi(i)),vi&&(0===(i=e.lastPingedTime)||i>=n)){e.lastPingedTime=n,Li(e,n);break}if(0!==(i=Ii(e))&&i!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}if(1073741823!==di?r=10*(1073741821-di)-st():1073741823===fi?r=0:(r=10*(1073741821-fi)-5e3,0>(r=(i=st())-r)&&(r=0),(n=10*(1073741821-n)-i)<(r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ti(r/1960))-r)&&(r=n)),10=(r=0|u.busyMinDurationMs)?r=0:(i=0|u.busyDelayMs,r=(o=st()-(10*(1073741821-o)-(0|u.timeoutMs||5e3)))<=i?0:i+r-o),10 component higher in the tree to provide a loading indicator or placeholder to display."+xe(i))}5!==si&&(si=2),o=Fr(o,i),l=r;do{switch(l.tag){case 3:u=o,l.effectTag|=4096,l.expirationTime=t,jt(l,Jr(l,u,t));break e;case 1:u=o;var g=l.type,y=l.stateNode;if(0==(64&l.effectTag)&&("function"==typeof g.getDerivedStateFromError||null!==y&&"function"==typeof y.componentDidCatch&&(null===bi||!bi.has(y)))){l.effectTag|=4096,l.expirationTime=t,jt(l,Zr(l,u,t));break e}}l=l.return}while(null!==l)}ai=qi(ai)}catch(e){t=e;continue}break}}function ji(){var e=ni.current;return ni.current=Zn,null===e?Zn:e}function Ui(e,t){ehi&&(hi=e)}function Wi(){for(;null!==ai;)ai=Vi(ai)}function Hi(){for(;null!==ai&&!Ye();)ai=Vi(ai)}function Vi(e){var t=ei(e.alternate,e,li);return e.memoizedProps=e.pendingProps,null===t&&(t=qi(e)),ri.current=null,t}function qi(e){ai=e;do{var t=ai.alternate;if(e=ai.return,0==(2048&ai.effectTag)){e:{var n=t,r=li,i=(t=ai).pendingProps;switch(t.tag){case 2:case 16:break;case 15:case 0:break;case 1:Be(t.type)&&je();break;case 3:dn(),Ue(),(i=t.stateNode).pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(null===n||null===n.child)&&sr(t)&&Ir(t),Dr(t);break;case 5:hn(t);var o=cn(sn.current);if(r=t.type,null!==n&&null!=t.stateNode)Sr(n,t,r,i,o),n.ref!==t.ref&&(t.effectTag|=128);else if(i){if(n=cn(an.current),sr(t)){if(i=t,!Y)throw Error(a(175));n=Ee(i.stateNode,i.type,i.memoizedProps,o,n,i),i.updateQueue=n,(n=null!==n)&&Ir(t)}else{var u=R(r,i,o,n,t);Er(u,t,!1,!1),t.stateNode=u,L(u,r,i,o,n)&&Ir(t)}null!==t.ref&&(t.effectTag|=128)}else if(null===t.stateNode)throw Error(a(166));break;case 6:if(n&&null!=t.stateNode)Cr(n,t,n.memoizedProps,i);else{if("string"!=typeof i&&null===t.stateNode)throw Error(a(166));if(n=cn(sn.current),o=cn(an.current),sr(t)){if(n=t,!Y)throw Error(a(176));(n=De(n.stateNode,n.memoizedProps,n))&&Ir(t)}else t.stateNode=z(i,n,o,t)}break;case 11:break;case 13:if(Pe(vn),i=t.memoizedState,0!=(64&t.effectTag)){t.expirationTime=r;break e}i=null!==i,o=!1,null===n?void 0!==t.memoizedProps.fallback&&sr(t):(o=null!==(r=n.memoizedState),i||null===r||null!==(r=n.child.sibling)&&(null!==(u=t.firstEffect)?(t.firstEffect=r,r.nextEffect=u):(t.firstEffect=t.lastEffect=r,r.nextEffect=null),r.effectTag=8)),i&&!o&&0!=(2&t.mode)&&(null===n&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&vn.current)?0===si&&(si=3):(0!==si&&3!==si||(si=4),0!==hi&&null!==ui&&(vo(ui,li),mo(ui,hi)))),$&&i&&(t.effectTag|=4),G&&(i||o)&&(t.effectTag|=4);break;case 7:case 8:case 12:break;case 4:dn(),Dr(t);break;case 10:At(t);break;case 9:case 14:break;case 17:Be(t.type)&&je();break;case 19:if(Pe(vn),null===(i=t.memoizedState))break;if(o=0!=(64&t.effectTag),null===(u=i.rendering)){if(o)Mr(i,!1);else if(0!==si||null!==n&&0!=(64&n.effectTag))for(n=t.child;null!==n;){if(null!==(u=mn(n))){for(t.effectTag|=64,Mr(i,!1),null!==(n=u.updateQueue)&&(t.updateQueue=n,t.effectTag|=4),null===i.lastEffect&&(t.firstEffect=null),t.lastEffect=i.lastEffect,n=r,i=t.child;null!==i;)r=n,(o=i).effectTag&=2,o.nextEffect=null,o.firstEffect=null,o.lastEffect=null,null===(u=o.alternate)?(o.childExpirationTime=0,o.expirationTime=r,o.child=null,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null):(o.childExpirationTime=u.childExpirationTime,o.expirationTime=u.expirationTime,o.child=u.child,o.memoizedProps=u.memoizedProps,o.memoizedState=u.memoizedState,o.updateQueue=u.updateQueue,r=u.dependencies,o.dependencies=null===r?null:{expirationTime:r.expirationTime,firstContext:r.firstContext,responders:r.responders}),i=i.sibling;Ie(vn,1&vn.current|2),t=t.child;break e}n=n.sibling}}else{if(!o)if(null!==(n=mn(u))){if(t.effectTag|=64,o=!0,null!==(n=n.updateQueue)&&(t.updateQueue=n,t.effectTag|=4),Mr(i,!0),null===i.tail&&"hidden"===i.tailMode&&!u.alternate){null!==(t=t.lastEffect=i.lastEffect)&&(t.nextEffect=null);break}}else st()>i.tailExpiration&&1i&&(i=r),(u=o.childExpirationTime)>i&&(i=u),o=o.sibling;n.childExpirationTime=i}if(null!==t)return t;null!==e&&0==(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=ai.firstEffect),null!==ai.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=ai.firstEffect),e.lastEffect=ai.lastEffect),1(e=e.childExpirationTime)?t:e}function $i(e){var t=ct();return dt(99,Yi.bind(null,e,t)),null}function Yi(e,t){do{Xi()}while(null!==Ei);if(0!=(48&oi))throw Error(a(327));var n=e.finishedWork,r=e.finishedExpirationTime;if(null===n)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,n===e.current)throw Error(a(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var i=Gi(n);if(e.firstPendingTime=i,r<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:r<=e.firstSuspendedTime&&(e.firstSuspendedTime=r-1),r<=e.lastPingedTime&&(e.lastPingedTime=0),r<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===ui&&(ai=ui=null,li=0),1=n?Tr(e,t,n):(Ie(vn,1&vn.current),null!==(t=Pr(e,t,n))?t.sibling:null);Ie(vn,1&vn.current);break;case 19:if(r=t.childExpirationTime>=n,0!=(64&e.effectTag)){if(r)return Or(e,t,n);t.effectTag|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null),Ie(vn,vn.current),!r)return null}return Pr(e,t,n)}dr=!1}}else dr=!1;switch(t.expirationTime=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,i=Le(t,Me.current),Pt(t,n),i=Rn(null,t,r,e,i,n),t.effectTag|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,Fn(),Be(r)){var o=!0;He(t)}else o=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null;var u=r.getDerivedStateFromProps;"function"==typeof u&&$t(t,r,u,e),i.updater=Yt,t.stateNode=i,i._reactInternalFiber=t,Jt(t,r,e,n),t=br(null,t,r,!0,o,n)}else t.tag=0,pr(null,t,i,n),t=t.child;return t;case 16:if(i=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,function(e){if(-1===e._status){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}}(i),1!==i._status)throw i._result;switch(i=i._result,t.type=i,o=t.tag=function(e){if("function"==typeof e)return uo(e)?1:0;if(null!=e){if((e=e.$$typeof)===y)return 11;if(e===w)return 14}return 2}(i),e=Et(i,e),o){case 0:t=yr(null,t,i,e,n);break;case 1:t=_r(null,t,i,e,n);break;case 11:t=hr(null,t,i,e,n);break;case 14:t=vr(null,t,i,Et(i.type,e),r,n);break;default:throw Error(a(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,yr(e,t,r,i=t.elementType===r?i:Et(r,i),n);case 1:return r=t.type,i=t.pendingProps,_r(e,t,r,i=t.elementType===r?i:Et(r,i),n);case 3:if(wr(t),null===(r=t.updateQueue))throw Error(a(282));if(i=null!==(i=t.memoizedState)?i.element:null,Wt(t,r,t.pendingProps,null,n),(r=t.memoizedState.element)===i)cr(),t=Pr(e,t,n);else{if((i=t.stateNode.hydrate)&&(Y?(rr=we(t.stateNode.containerInfo),nr=t,i=ir=!0):i=!1),i)for(n=on(t,null,r,n),t.child=n;n;)n.effectTag=-3&n.effectTag|1024,n=n.sibling;else pr(e,t,r,n),cr();t=t.child}return t;case 5:return pn(t),null===e&&ar(t),r=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,u=i.children,j(r,i)?u=null:null!==o&&j(r,o)&&(t.effectTag|=16),gr(e,t),4&t.mode&&1!==n&&U(r,i)?(t.expirationTime=t.childExpirationTime=1,t=null):(pr(e,t,u,n),t=t.child),t;case 6:return null===e&&ar(t),null;case 13:return Tr(e,t,n);case 4:return fn(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=rn(t,null,r,n):pr(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,hr(e,t,r,i=t.elementType===r?i:Et(r,i),n);case 7:return pr(e,t,t.pendingProps,n),t.child;case 8:case 12:return pr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,u=t.memoizedProps,xt(t,o=i.value),null!==u){var l=u.value;if(0===(o=_t(l,o)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(l,o):1073741823))){if(u.children===i.children&&!Re.current){t=Pr(e,t,n);break e}}else for(null!==(l=t.child)&&(l.return=t);null!==l;){var s=l.dependencies;if(null!==s){u=l.child;for(var c=s.firstContext;null!==c;){if(c.context===r&&0!=(c.observedBits&o)){1===l.tag&&((c=Ft(n,null)).tag=2,Bt(l,c)),l.expirationTime=t&&e<=t}function vo(e,t){var n=e.firstSuspendedTime,r=e.lastSuspendedTime;nt||0===n)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function mo(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var n=e.firstSuspendedTime;0!==n&&(t>=n?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function go(e,t){var n=e.lastExpiredTime;(0===n||n>t)&&(e.lastExpiredTime=t)}function yo(e){var t=e._reactInternalFiber;if(void 0===t){if("function"==typeof e.render)throw Error(a(188));throw Error(a(268,Object.keys(e)))}return null===(e=A(t))?null:e.stateNode}function _o(e,t){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime{"use strict";e.exports=n(5767)},3296:(e,t,n)=>{"use strict";const r=n(5760);r.createWebSocketStream=n(6387),r.Server=n(43),r.Receiver=n(1762),r.Sender=n(9576),e.exports=r},8716:(e,t,n)=>{"use strict";const{EMPTY_BUFFER:r}=n(5739);function i(e,t){if(0===e.length)return r;if(1===e.length)return e[0];const n=Buffer.allocUnsafe(t);let i=0;for(let t=0;t{"use strict";e.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),EMPTY_BUFFER:Buffer.alloc(0),NOOP:()=>{}}},7002:e=>{"use strict";class t{constructor(e,t){this.target=t,this.type=e}}class n extends t{constructor(e,t){super("message",t),this.data=e}}class r extends t{constructor(e,t,n){super("close",n),this.wasClean=n._closeFrameReceived&&n._closeFrameSent,this.reason=t,this.code=e}}class i extends t{constructor(e){super("open",e)}}class o extends t{constructor(e,t){super("error",t),this.message=e.message,this.error=e}}const u={addEventListener(e,t,u){if("function"!=typeof t)return;function a(e){t.call(this,new n(e,this))}function l(e,n){t.call(this,new r(e,n,this))}function s(e){t.call(this,new o(e,this))}function c(){t.call(this,new i(this))}const f=u&&u.once?"once":"on";"message"===e?(a._listener=t,this[f](e,a)):"close"===e?(l._listener=t,this[f](e,l)):"error"===e?(s._listener=t,this[f](e,s)):"open"===e?(c._listener=t,this[f](e,c)):this[f](e,t)},removeEventListener(e,t){const n=this.listeners(e);for(let r=0;r{"use strict";const t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function n(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}e.exports={format:function(e){return Object.keys(e).map(t=>{let n=e[t];return Array.isArray(n)||(n=[n]),n.map(e=>[t].concat(Object.keys(e).map(t=>{let n=e[t];return Array.isArray(n)||(n=[n]),n.map(e=>!0===e?t:`${t}=${e}`).join("; ")})).join("; ")).join(", ")}).join(", ")},parse:function(e){const r=Object.create(null);if(void 0===e||""===e)return r;let i,o,u=Object.create(null),a=!1,l=!1,s=!1,c=-1,f=-1,d=0;for(;d{"use strict";const t=Symbol("kDone"),n=Symbol("kRun");e.exports=class{constructor(e){this[t]=()=>{this.pending--,this[n]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[n]()}[n](){if(this.pending!==this.concurrency&&this.jobs.length){const e=this.jobs.shift();this.pending++,e(this[t])}}}},2309:(e,t,n)=>{"use strict";const r=n(8761),i=n(8716),o=n(1390),{kStatusCode:u,NOOP:a}=n(5739),l=Buffer.from([0,0,255,255]),s=Symbol("permessage-deflate"),c=Symbol("total-length"),f=Symbol("callback"),d=Symbol("buffers"),p=Symbol("error");let h;function v(e){this[d].push(e),this[c]+=e.length}function m(e){this[c]+=e.length,this[s]._maxPayload<1||this[c]<=this[s]._maxPayload?this[d].push(e):(this[p]=new RangeError("Max payload size exceeded"),this[p][u]=1009,this.removeListener("data",m),this.reset())}function g(e){this[s]._inflate=null,e[u]=1007,this[f](e)}e.exports=class{constructor(e,t,n){if(this._maxPayload=0|n,this._options=e||{},this._threshold=void 0!==this._options.threshold?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!h){const e=void 0!==this._options.concurrencyLimit?this._options.concurrencyLimit:10;h=new o(e)}}static get extensionName(){return"permessage-deflate"}offer(){const e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:null==this._options.clientMaxWindowBits&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){const e=this._deflate[f];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){const t=this._options,n=e.find(e=>!(!1===t.serverNoContextTakeover&&e.server_no_context_takeover||e.server_max_window_bits&&(!1===t.serverMaxWindowBits||"number"==typeof t.serverMaxWindowBits&&t.serverMaxWindowBits>e.server_max_window_bits)||"number"==typeof t.clientMaxWindowBits&&!e.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(n.server_no_context_takeover=!0),t.clientNoContextTakeover&&(n.client_no_context_takeover=!0),"number"==typeof t.serverMaxWindowBits&&(n.server_max_window_bits=t.serverMaxWindowBits),"number"==typeof t.clientMaxWindowBits?n.client_max_window_bits=t.clientMaxWindowBits:!0!==n.client_max_window_bits&&!1!==t.clientMaxWindowBits||delete n.client_max_window_bits,n}acceptAsClient(e){const t=e[0];if(!1===this._options.clientNoContextTakeover&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(t.client_max_window_bits){if(!1===this._options.clientMaxWindowBits||"number"==typeof this._options.clientMaxWindowBits&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"')}else"number"==typeof this._options.clientMaxWindowBits&&(t.client_max_window_bits=this._options.clientMaxWindowBits);return t}normalizeParams(e){return e.forEach(e=>{Object.keys(e).forEach(t=>{let n=e[t];if(n.length>1)throw new Error(`Parameter "${t}" must have only a single value`);if(n=n[0],"client_max_window_bits"===t){if(!0!==n){const e=+n;if(!Number.isInteger(e)||e<8||e>15)throw new TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${t}": ${n}`)}else if("server_max_window_bits"===t){const e=+n;if(!Number.isInteger(e)||e<8||e>15)throw new TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else{if("client_no_context_takeover"!==t&&"server_no_context_takeover"!==t)throw new Error(`Unknown parameter "${t}"`);if(!0!==n)throw new TypeError(`Invalid value for parameter "${t}": ${n}`)}e[t]=n})}),e}decompress(e,t,n){h.add(r=>{this._decompress(e,t,(e,t)=>{r(),n(e,t)})})}compress(e,t,n){h.add(r=>{this._compress(e,t,(e,t)=>{r(),n(e,t)})})}_decompress(e,t,n){const o=this._isServer?"client":"server";if(!this._inflate){const e=o+"_max_window_bits",t="number"!=typeof this.params[e]?r.Z_DEFAULT_WINDOWBITS:this.params[e];this._inflate=r.createInflateRaw({...this._options.zlibInflateOptions,windowBits:t}),this._inflate[s]=this,this._inflate[c]=0,this._inflate[d]=[],this._inflate.on("error",g),this._inflate.on("data",m)}this._inflate[f]=n,this._inflate.write(e),t&&this._inflate.write(l),this._inflate.flush(()=>{const e=this._inflate[p];if(e)return this._inflate.close(),this._inflate=null,void n(e);const r=i.concat(this._inflate[d],this._inflate[c]);t&&this.params[o+"_no_context_takeover"]?(this._inflate.close(),this._inflate=null):(this._inflate[c]=0,this._inflate[d]=[]),n(null,r)})}_compress(e,t,n){const o=this._isServer?"server":"client";if(!this._deflate){const e=o+"_max_window_bits",t="number"!=typeof this.params[e]?r.Z_DEFAULT_WINDOWBITS:this.params[e];this._deflate=r.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:t}),this._deflate[c]=0,this._deflate[d]=[],this._deflate.on("error",a),this._deflate.on("data",v)}this._deflate[f]=n,this._deflate.write(e),this._deflate.flush(r.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let e=i.concat(this._deflate[d],this._deflate[c]);t&&(e=e.slice(0,e.length-4)),this._deflate[f]=null,t&&this.params[o+"_no_context_takeover"]?(this._deflate.close(),this._deflate=null):(this._deflate[c]=0,this._deflate[d]=[]),n(null,e)})}}},1762:(e,t,n)=>{"use strict";const{Writable:r}=n(2413),i=n(2309),{BINARY_TYPES:o,EMPTY_BUFFER:u,kStatusCode:a,kWebSocket:l}=n(5739),{concat:s,toArrayBuffer:c,unmask:f}=n(8716),{isValidStatusCode:d,isValidUTF8:p}=n(9498);function h(e,t,n,r){const i=new e(n?"Invalid WebSocket frame: "+t:t);return Error.captureStackTrace(i,h),i[a]=r,i}e.exports=class extends r{constructor(e,t,n,r){super(),this._binaryType=e||o[0],this[l]=void 0,this._extensions=t||{},this._isServer=!!n,this._maxPayload=0|r,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._state=0,this._loop=!1}_write(e,t,n){if(8===this._opcode&&0==this._state)return n();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e=n.length?t.set(this._buffers.shift(),r):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),r),this._buffers[0]=n.slice(e)),e-=n.length}while(e>0);return t}startLoop(e){let t;this._loop=!0;do{switch(this._state){case 0:t=this.getInfo();break;case 1:t=this.getPayloadLength16();break;case 2:t=this.getPayloadLength64();break;case 3:this.getMask();break;case 4:t=this.getData(e);break;default:return void(this._loop=!1)}}while(this._loop);e(t)}getInfo(){if(this._bufferedBytes<2)return void(this._loop=!1);const e=this.consume(2);if(0!=(48&e[0]))return this._loop=!1,h(RangeError,"RSV2 and RSV3 must be clear",!0,1002);const t=64==(64&e[0]);if(t&&!this._extensions[i.extensionName])return this._loop=!1,h(RangeError,"RSV1 must be clear",!0,1002);if(this._fin=128==(128&e[0]),this._opcode=15&e[0],this._payloadLength=127&e[1],0===this._opcode){if(t)return this._loop=!1,h(RangeError,"RSV1 must be clear",!0,1002);if(!this._fragmented)return this._loop=!1,h(RangeError,"invalid opcode 0",!0,1002);this._opcode=this._fragmented}else if(1===this._opcode||2===this._opcode){if(this._fragmented)return this._loop=!1,h(RangeError,"invalid opcode "+this._opcode,!0,1002);this._compressed=t}else{if(!(this._opcode>7&&this._opcode<11))return this._loop=!1,h(RangeError,"invalid opcode "+this._opcode,!0,1002);if(!this._fin)return this._loop=!1,h(RangeError,"FIN must be set",!0,1002);if(t)return this._loop=!1,h(RangeError,"RSV1 must be clear",!0,1002);if(this._payloadLength>125)return this._loop=!1,h(RangeError,"invalid payload length "+this._payloadLength,!0,1002)}if(this._fin||this._fragmented||(this._fragmented=this._opcode),this._masked=128==(128&e[1]),this._isServer){if(!this._masked)return this._loop=!1,h(RangeError,"MASK must be set",!0,1002)}else if(this._masked)return this._loop=!1,h(RangeError,"MASK must be clear",!0,1002);if(126===this._payloadLength)this._state=1;else{if(127!==this._payloadLength)return this.haveLength();this._state=2}}getPayloadLength16(){if(!(this._bufferedBytes<2))return this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength();this._loop=!1}getPayloadLength64(){if(this._bufferedBytes<8)return void(this._loop=!1);const e=this.consume(8),t=e.readUInt32BE(0);return t>Math.pow(2,21)-1?(this._loop=!1,h(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009)):(this._payloadLength=t*Math.pow(2,32)+e.readUInt32BE(4),this.haveLength())}haveLength(){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0))return this._loop=!1,h(RangeError,"Max payload size exceeded",!1,1009);this._masked?this._state=3:this._state=4}getMask(){this._bufferedBytes<4?this._loop=!1:(this._mask=this.consume(4),this._state=4)}getData(e){let t=u;if(this._payloadLength){if(this._bufferedBytes7?this.controlMessage(t):this._compressed?(this._state=5,void this.decompress(t,e)):(t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage())}decompress(e,t){this._extensions[i.extensionName].decompress(e,this._fin,(e,n)=>{if(e)return t(e);if(n.length){if(this._messageLength+=n.length,this._messageLength>this._maxPayload&&this._maxPayload>0)return t(h(RangeError,"Max payload size exceeded",!1,1009));this._fragments.push(n)}const r=this.dataMessage();if(r)return t(r);this.startLoop(t)})}dataMessage(){if(this._fin){const e=this._messageLength,t=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],2===this._opcode){let n;n="nodebuffer"===this._binaryType?s(t,e):"arraybuffer"===this._binaryType?c(s(t,e)):t,this.emit("message",n)}else{const n=s(t,e);if(!p(n))return this._loop=!1,h(Error,"invalid UTF-8 sequence",!0,1007);this.emit("message",n.toString())}}this._state=0}controlMessage(e){if(8===this._opcode)if(this._loop=!1,0===e.length)this.emit("conclude",1005,""),this.end();else{if(1===e.length)return h(RangeError,"invalid payload length 1",!0,1002);{const t=e.readUInt16BE(0);if(!d(t))return h(RangeError,"invalid status code "+t,!0,1002);const n=e.slice(2);if(!p(n))return h(Error,"invalid UTF-8 sequence",!0,1007);this.emit("conclude",t,n.toString()),this.end()}}else 9===this._opcode?this.emit("ping",e):this.emit("pong",e);this._state=0}}},9576:(e,t,n)=>{"use strict";const{randomFillSync:r}=n(6417),i=n(2309),{EMPTY_BUFFER:o}=n(5739),{isValidStatusCode:u}=n(9498),{mask:a,toBuffer:l}=n(8716),s=Buffer.alloc(4);class c{constructor(e,t){this._extensions=t||{},this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(e,t){const n=t.mask&&t.readOnly;let i=t.mask?6:2,o=e.length;e.length>=65536?(i+=8,o=127):e.length>125&&(i+=2,o=126);const u=Buffer.allocUnsafe(n?e.length+i:i);return u[0]=t.fin?128|t.opcode:t.opcode,t.rsv1&&(u[0]|=64),u[1]=o,126===o?u.writeUInt16BE(e.length,2):127===o&&(u.writeUInt32BE(0,2),u.writeUInt32BE(e.length,6)),t.mask?(r(s,0,4),u[1]|=128,u[i-4]=s[0],u[i-3]=s[1],u[i-2]=s[2],u[i-1]=s[3],n?(a(e,s,u,i,e.length),[u]):(a(e,s,e,0,e.length),[u,e])):[u,e]}close(e,t,n,r){let i;if(void 0===e)i=o;else{if("number"!=typeof e||!u(e))throw new TypeError("First argument must be a valid error code number");if(void 0===t||""===t)i=Buffer.allocUnsafe(2),i.writeUInt16BE(e,0);else{const n=Buffer.byteLength(t);if(n>123)throw new RangeError("The message must not be greater than 123 bytes");i=Buffer.allocUnsafe(2+n),i.writeUInt16BE(e,0),i.write(t,2)}}this._deflating?this.enqueue([this.doClose,i,n,r]):this.doClose(i,n,r)}doClose(e,t,n){this.sendFrame(c.frame(e,{fin:!0,rsv1:!1,opcode:8,mask:t,readOnly:!1}),n)}ping(e,t,n){const r=l(e);if(r.length>125)throw new RangeError("The data size must not be greater than 125 bytes");this._deflating?this.enqueue([this.doPing,r,t,l.readOnly,n]):this.doPing(r,t,l.readOnly,n)}doPing(e,t,n,r){this.sendFrame(c.frame(e,{fin:!0,rsv1:!1,opcode:9,mask:t,readOnly:n}),r)}pong(e,t,n){const r=l(e);if(r.length>125)throw new RangeError("The data size must not be greater than 125 bytes");this._deflating?this.enqueue([this.doPong,r,t,l.readOnly,n]):this.doPong(r,t,l.readOnly,n)}doPong(e,t,n,r){this.sendFrame(c.frame(e,{fin:!0,rsv1:!1,opcode:10,mask:t,readOnly:n}),r)}send(e,t,n){const r=l(e),o=this._extensions[i.extensionName];let u=t.binary?2:1,a=t.compress;if(this._firstFragment?(this._firstFragment=!1,a&&o&&(a=r.length>=o._threshold),this._compress=a):(a=!1,u=0),t.fin&&(this._firstFragment=!0),o){const e={fin:t.fin,rsv1:a,opcode:u,mask:t.mask,readOnly:l.readOnly};this._deflating?this.enqueue([this.dispatch,r,this._compress,e,n]):this.dispatch(r,this._compress,e,n)}else this.sendFrame(c.frame(r,{fin:t.fin,rsv1:!1,opcode:u,mask:t.mask,readOnly:l.readOnly}),n)}dispatch(e,t,n,r){if(!t)return void this.sendFrame(c.frame(e,n),r);const o=this._extensions[i.extensionName];this._bufferedBytes+=e.length,this._deflating=!0,o.compress(e,n.fin,(t,i)=>{if(this._socket.destroyed){const e=new Error("The socket was closed while data was being compressed");"function"==typeof r&&r(e);for(let t=0;t{"use strict";const{Duplex:r}=n(2413);function i(e){e.emit("close")}function o(){!this.destroyed&&this._writableState.finished&&this.destroy()}function u(e){this.removeListener("error",u),this.destroy(),0===this.listenerCount("error")&&this.emit("error",e)}e.exports=function(e,t){let n=!0;function a(){n&&e._socket.resume()}e.readyState===e.CONNECTING?e.once("open",(function(){e._receiver.removeAllListeners("drain"),e._receiver.on("drain",a)})):(e._receiver.removeAllListeners("drain"),e._receiver.on("drain",a));const l=new r({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",(function(t){l.push(t)||(n=!1,e._socket.pause())})),e.once("error",(function(e){l.destroyed||l.destroy(e)})),e.once("close",(function(){l.destroyed||l.push(null)})),l._destroy=function(t,n){if(e.readyState===e.CLOSED)return n(t),void process.nextTick(i,l);let r=!1;e.once("error",(function(e){r=!0,n(e)})),e.once("close",(function(){r||n(t),process.nextTick(i,l)})),e.terminate()},l._final=function(t){e.readyState!==e.CONNECTING?null!==e._socket&&(e._socket._writableState.finished?(t(),l._readableState.endEmitted&&l.destroy()):(e._socket.once("finish",(function(){t()})),e.close())):e.once("open",(function(){l._final(t)}))},l._read=function(){e.readyState!==e.OPEN||n||(n=!0,e._receiver._writableState.needDrain||e._socket.resume())},l._write=function(t,n,r){e.readyState!==e.CONNECTING?e.send(t,r):e.once("open",(function(){l._write(t,n,r)}))},l.on("end",o),l.on("error",u),l}},9498:(e,t,n)=>{"use strict";try{const e=n(Object(function(){var e=new Error("Cannot find module 'utf-8-validate'");throw e.code="MODULE_NOT_FOUND",e}()));t.isValidUTF8="object"==typeof e?e.Validation.isValidUTF8:e}catch(e){t.isValidUTF8=()=>!0}t.isValidStatusCode=e=>e>=1e3&&e<=1014&&1004!==e&&1005!==e&&1006!==e||e>=3e3&&e<=4999},43:(e,t,n)=>{"use strict";const r=n(8614),{createHash:i}=n(6417),{createServer:o,STATUS_CODES:u}=n(8605),a=n(2309),l=n(5760),{format:s,parse:c}=n(8162),{GUID:f,kWebSocket:d}=n(5739),p=/^[+/0-9A-Za-z]{22}==$/;function h(e){e.emit("close")}function v(){this.destroy()}function m(e,t,n,r){e.writable&&(n=n||u[t],r={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(n),...r},e.write(`HTTP/1.1 ${t} ${u[t]}\r\n`+Object.keys(r).map(e=>`${e}: ${r[e]}`).join("\r\n")+"\r\n\r\n"+n)),e.removeListener("error",v),e.destroy()}e.exports=class extends r{constructor(e,t){if(super(),null==(e={maxPayload:104857600,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,...e}).port&&!e.server&&!e.noServer)throw new TypeError('One of the "port", "server", or "noServer" options must be specified');null!=e.port?(this._server=o((e,t)=>{const n=u[426];t.writeHead(426,{"Content-Length":n.length,"Content-Type":"text/plain"}),t.end(n)}),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server&&(this._removeListeners=function(e,t){for(const n of Object.keys(t))e.on(n,t[n]);return function(){for(const n of Object.keys(t))e.removeListener(n,t[n])}}(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(e,t,n)=>{this.handleUpgrade(e,t,n,t=>{this.emit("connection",t,e)})}})),!0===e.perMessageDeflate&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set),this.options=e}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(e&&this.once("close",e),this.clients)for(const e of this.clients)e.terminate();const t=this._server;t&&(this._removeListeners(),this._removeListeners=this._server=null,null!=this.options.port)?t.close(()=>this.emit("close")):process.nextTick(h,this)}shouldHandle(e){if(this.options.path){const t=e.url.indexOf("?");if((-1!==t?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,n,r){t.on("error",v);const i=void 0!==e.headers["sec-websocket-key"]&&e.headers["sec-websocket-key"].trim(),o=+e.headers["sec-websocket-version"],u={};if("GET"!==e.method||"websocket"!==e.headers.upgrade.toLowerCase()||!i||!p.test(i)||8!==o&&13!==o||!this.shouldHandle(e))return m(t,400);if(this.options.perMessageDeflate){const n=new a(this.options.perMessageDeflate,!0,this.options.maxPayload);try{const t=c(e.headers["sec-websocket-extensions"]);t[a.extensionName]&&(n.accept(t[a.extensionName]),u[a.extensionName]=n)}catch(e){return m(t,400)}}if(this.options.verifyClient){const a={origin:e.headers[""+(8===o?"sec-websocket-origin":"origin")],secure:!(!e.connection.authorized&&!e.connection.encrypted),req:e};if(2===this.options.verifyClient.length)return void this.options.verifyClient(a,(o,a,l,s)=>{if(!o)return m(t,a||401,l,s);this.completeUpgrade(i,u,e,t,n,r)});if(!this.options.verifyClient(a))return m(t,401)}this.completeUpgrade(i,u,e,t,n,r)}completeUpgrade(e,t,n,r,o,u){if(!r.readable||!r.writable)return r.destroy();if(r[d])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");const c=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade","Sec-WebSocket-Accept: "+i("sha1").update(e+f).digest("base64")],p=new l(null);let h=n.headers["sec-websocket-protocol"];if(h&&(h=h.trim().split(/ *, */),h=this.options.handleProtocols?this.options.handleProtocols(h,n):h[0],h&&(c.push("Sec-WebSocket-Protocol: "+h),p.protocol=h)),t[a.extensionName]){const e=t[a.extensionName].params,n=s({[a.extensionName]:[e]});c.push("Sec-WebSocket-Extensions: "+n),p._extensions=t}this.emit("headers",c,n),r.write(c.concat("\r\n").join("\r\n")),r.removeListener("error",v),p.setSocket(r,o,this.options.maxPayload),this.clients&&(this.clients.add(p),p.on("close",()=>this.clients.delete(p))),u(p)}}},5760:(e,t,n)=>{"use strict";const r=n(8614),i=n(7211),o=n(8605),u=n(1631),a=n(4016),{randomBytes:l,createHash:s}=n(6417),{URL:c}=n(8835),f=n(2309),d=n(1762),p=n(9576),{BINARY_TYPES:h,EMPTY_BUFFER:v,GUID:m,kStatusCode:g,kWebSocket:y,NOOP:_}=n(5739),{addEventListener:b,removeEventListener:w}=n(7002),{format:E,parse:D}=n(8162),{toBuffer:S}=n(8716),C=["CONNECTING","OPEN","CLOSING","CLOSED"],k=[8,13];class T extends r{constructor(e,t,n){super(),this.readyState=T.CONNECTING,this.protocol="",this._binaryType=h[0],this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage="",this._closeTimer=null,this._closeCode=1006,this._extensions={},this._receiver=null,this._sender=null,this._socket=null,null!==e?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,Array.isArray(t)?t=t.join(", "):"object"==typeof t&&null!==t&&(n=t,t=void 0),function e(t,n,r,u){const a={protocolVersion:k[1],maxPayload:104857600,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...u,createConnection:void 0,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:void 0,host:void 0,path:void 0,port:void 0};if(!k.includes(a.protocolVersion))throw new RangeError(`Unsupported protocol version: ${a.protocolVersion} (supported versions: ${k.join(", ")})`);let d;n instanceof c?(d=n,t.url=n.href):(d=new c(n),t.url=n);const p="ws+unix:"===d.protocol;if(!(d.host||p&&d.pathname))throw new Error("Invalid URL: "+t.url);const h="wss:"===d.protocol||"https:"===d.protocol,v=h?443:80,g=l(16).toString("base64"),y=h?i.get:o.get;let _;a.createConnection=h?A:x,a.defaultPort=a.defaultPort||v,a.port=d.port||v,a.host=d.hostname.startsWith("[")?d.hostname.slice(1,-1):d.hostname,a.headers={"Sec-WebSocket-Version":a.protocolVersion,"Sec-WebSocket-Key":g,Connection:"Upgrade",Upgrade:"websocket",...a.headers},a.path=d.pathname+d.search,a.timeout=a.handshakeTimeout,a.perMessageDeflate&&(_=new f(!0!==a.perMessageDeflate?a.perMessageDeflate:{},!1,a.maxPayload),a.headers["Sec-WebSocket-Extensions"]=E({[f.extensionName]:_.offer()}));r&&(a.headers["Sec-WebSocket-Protocol"]=r);a.origin&&(a.protocolVersion<13?a.headers["Sec-WebSocket-Origin"]=a.origin:a.headers.Origin=a.origin);(d.username||d.password)&&(a.auth=`${d.username}:${d.password}`);if(p){const e=a.path.split(":");a.socketPath=e[0],a.path=e[1]}let b=t._req=y(a);a.timeout&&b.on("timeout",()=>{O(t,b,"Opening handshake has timed out")});b.on("error",e=>{t._req.aborted||(b=t._req=null,t.readyState=T.CLOSING,t.emit("error",e),t.emitClose())}),b.on("response",i=>{const o=i.headers.location,l=i.statusCode;if(o&&a.followRedirects&&l>=300&&l<400){if(++t._redirects>a.maxRedirects)return void O(t,b,"Maximum redirects exceeded");b.abort();const i=new c(o,n);e(t,i,r,u)}else t.emit("unexpected-response",b,i)||O(t,b,"Unexpected server response: "+i.statusCode)}),b.on("upgrade",(e,n,i)=>{if(t.emit("upgrade",e),t.readyState!==T.CONNECTING)return;b=t._req=null;const o=s("sha1").update(g+m).digest("base64");if(e.headers["sec-websocket-accept"]!==o)return void O(t,n,"Invalid Sec-WebSocket-Accept header");const u=e.headers["sec-websocket-protocol"],l=(r||"").split(/, */);let c;if(!r&&u?c="Server sent a subprotocol but none was requested":r&&!u?c="Server sent no subprotocol":u&&!l.includes(u)&&(c="Server sent an invalid subprotocol"),c)O(t,n,c);else{if(u&&(t.protocol=u),_)try{const n=D(e.headers["sec-websocket-extensions"]);n[f.extensionName]&&(_.accept(n[f.extensionName]),t._extensions[f.extensionName]=_)}catch(e){return void O(t,n,"Invalid Sec-WebSocket-Extensions header")}t.setSocket(n,i,a.maxPayload)}})}(this,e,t,n)):this._isServer=!0}get CONNECTING(){return T.CONNECTING}get CLOSING(){return T.CLOSING}get CLOSED(){return T.CLOSED}get OPEN(){return T.OPEN}get binaryType(){return this._binaryType}set binaryType(e){h.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}setSocket(e,t,n){const r=new d(this._binaryType,this._extensions,this._isServer,n);this._sender=new p(e,this._extensions),this._receiver=r,this._socket=e,r[y]=this,e[y]=this,r.on("conclude",I),r.on("drain",N),r.on("error",M),r.on("message",F),r.on("ping",L),r.on("pong",B),e.setTimeout(0),e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",j),e.on("data",U),e.on("end",z),e.on("error",W),this.readyState=T.OPEN,this.emit("open")}emitClose(){if(!this._socket)return this.readyState=T.CLOSED,void this.emit("close",this._closeCode,this._closeMessage);this._extensions[f.extensionName]&&this._extensions[f.extensionName].cleanup(),this._receiver.removeAllListeners(),this.readyState=T.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==T.CLOSED){if(this.readyState===T.CONNECTING){const e="WebSocket was closed before the connection was established";return O(this,this._req,e)}this.readyState!==T.CLOSING?(this.readyState=T.CLOSING,this._sender.close(e,t,!this._isServer,e=>{e||(this._closeFrameSent=!0,this._closeFrameReceived&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),3e4)):this._closeFrameSent&&this._closeFrameReceived&&this._socket.end()}}ping(e,t,n){if(this.readyState===T.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof e?(n=e,e=t=void 0):"function"==typeof t&&(n=t,t=void 0),"number"==typeof e&&(e=e.toString()),this.readyState===T.OPEN?(void 0===t&&(t=!this._isServer),this._sender.ping(e||v,t,n)):P(this,e,n)}pong(e,t,n){if(this.readyState===T.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof e?(n=e,e=t=void 0):"function"==typeof t&&(n=t,t=void 0),"number"==typeof e&&(e=e.toString()),this.readyState===T.OPEN?(void 0===t&&(t=!this._isServer),this._sender.pong(e||v,t,n)):P(this,e,n)}send(e,t,n){if(this.readyState===T.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if("function"==typeof t&&(n=t,t={}),"number"==typeof e&&(e=e.toString()),this.readyState!==T.OPEN)return void P(this,e,n);const r={binary:"string"!=typeof e,mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[f.extensionName]||(r.compress=!1),this._sender.send(e||v,r,n)}terminate(){if(this.readyState!==T.CLOSED){if(this.readyState===T.CONNECTING){const e="WebSocket was closed before the connection was established";return O(this,this._req,e)}this._socket&&(this.readyState=T.CLOSING,this._socket.destroy())}}}function x(e){return e.path=e.socketPath,u.connect(e)}function A(e){return e.path=void 0,e.servername||""===e.servername||(e.servername=e.host),a.connect(e)}function O(e,t,n){e.readyState=T.CLOSING;const r=new Error(n);Error.captureStackTrace(r,O),t.setHeader?(t.abort(),t.once("abort",e.emitClose.bind(e)),e.emit("error",r)):(t.destroy(r),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function P(e,t,n){if(t){const n=S(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(n){n(new Error(`WebSocket is not open: readyState ${e.readyState} (${C[e.readyState]})`))}}function I(e,t){const n=this[y];n._socket.removeListener("data",U),n._socket.resume(),n._closeFrameReceived=!0,n._closeMessage=t,n._closeCode=e,1005===e?n.close():n.close(e,t)}function N(){this[y]._socket.resume()}function M(e){const t=this[y];t._socket.removeListener("data",U),t.readyState=T.CLOSING,t._closeCode=e[g],t.emit("error",e),t._socket.destroy()}function R(){this[y].emitClose()}function F(e){this[y].emit("message",e)}function L(e){const t=this[y];t.pong(e,!t._isServer,_),t.emit("ping",e)}function B(e){this[y].emit("pong",e)}function j(){const e=this[y];this.removeListener("close",j),this.removeListener("end",z),e.readyState=T.CLOSING,e._socket.read(),e._receiver.end(),this.removeListener("data",U),this[y]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",R),e._receiver.on("finish",R))}function U(e){this[y]._receiver.write(e)||this.pause()}function z(){const e=this[y];e.readyState=T.CLOSING,e._receiver.end(),this.end()}function W(){const e=this[y];this.removeListener("error",W),this.on("error",_),e&&(e.readyState=T.CLOSING,this.destroy())}C.forEach((e,t)=>{T[e]=t}),["open","error","close","message"].forEach(e=>{Object.defineProperty(T.prototype,"on"+e,{get(){const t=this.listeners(e);for(let e=0;e{"use strict";function r(e){const t=[...e.caches],n=t.shift();return void 0===n?i():{get:(e,i,o={miss:()=>Promise.resolve()})=>n.get(e,i,o).catch(()=>r({caches:t}).get(e,i,o)),set:(e,i)=>n.set(e,i).catch(()=>r({caches:t}).set(e,i)),delete:e=>n.delete(e).catch(()=>r({caches:t}).delete(e)),clear:()=>n.clear().catch(()=>r({caches:t}).clear())}}function i(){return{get:(e,t,n={miss:()=>Promise.resolve()})=>t().then(e=>Promise.all([e,n.miss(e)])).then(([e])=>e),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}}n.r(t),n.d(t,{createFallbackableCache:()=>r,createNullCache:()=>i})},6712:(e,t,n)=>{"use strict";function r(e={serializable:!0}){let t={};return{get(n,r,i={miss:()=>Promise.resolve()}){const o=JSON.stringify(n);if(o in t)return Promise.resolve(e.serializable?JSON.parse(t[o]):t[o]);const u=r(),a=i&&i.miss||(()=>Promise.resolve());return u.then(e=>a(e)).then(()=>u)},set:(n,r)=>(t[JSON.stringify(n)]=e.serializable?JSON.stringify(r):r,Promise.resolve(r)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}n.r(t),n.d(t,{createInMemoryCache:()=>r})},2223:(e,t,n)=>{"use strict";n.r(t),n.d(t,{addABTest:()=>a,createAnalyticsClient:()=>u,deleteABTest:()=>l,getABTest:()=>s,getABTests:()=>c,stopABTest:()=>f});var r=n(1757),i=n(7858),o=n(5541);const u=e=>{const t=e.region||"us",n=(0,r.createAuth)(r.AuthMode.WithinHeaders,e.appId,e.apiKey),o=(0,i.createTransporter)({hosts:[{url:`analytics.${t}.algolia.com`}],...e,headers:{...n.headers(),"content-type":"application/json",...e.headers},queryParameters:{...n.queryParameters(),...e.queryParameters}}),u=e.appId;return(0,r.addMethods)({appId:u,transporter:o},e.methods)},a=e=>(t,n)=>e.transporter.write({method:o.N.Post,path:"2/abtests",data:t},n),l=e=>(t,n)=>e.transporter.write({method:o.N.Delete,path:(0,r.encode)("2/abtests/%s",t)},n),s=e=>(t,n)=>e.transporter.read({method:o.N.Get,path:(0,r.encode)("2/abtests/%s",t)},n),c=e=>t=>e.transporter.read({method:o.N.Get,path:"2/abtests"},t),f=e=>(t,n)=>e.transporter.write({method:o.N.Post,path:(0,r.encode)("2/abtests/%s/stop",t)},n)},1757:(e,t,n)=>{"use strict";function r(e,t,n){const r={"x-algolia-api-key":n,"x-algolia-application-id":t};return{headers:()=>e===f.WithinHeaders?r:{},queryParameters:()=>e===f.WithinQueryParameters?r:{}}}function i(e){let t=0;const n=()=>(t++,new Promise(r=>{setTimeout(()=>{r(e(n))},Math.min(100*t,1e3))}));return e(n)}function o(e,t=((e,t)=>Promise.resolve())){return Object.assign(e,{wait:n=>o(e.then(e=>Promise.all([t(e,n),e])).then(e=>e[1]))})}function u(e){let t=e.length-1;for(;t>0;t--){const n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e}function a(e,t){return Object.keys(void 0!==t?t:{}).forEach(n=>{e[n]=t[n](e)}),e}function l(e,...t){let n=0;return e.replace(/%s/g,()=>encodeURIComponent(t[n++]))}n.r(t),n.d(t,{AuthMode:()=>f,addMethods:()=>a,createAuth:()=>r,createRetryablePromise:()=>i,createWaitablePromise:()=>o,destroy:()=>c,encode:()=>l,shuffle:()=>u,version:()=>s});const s="4.2.0",c=e=>()=>e.transporter.requester.destroy(),f={WithinQueryParameters:0,WithinHeaders:1}},103:(e,t,n)=>{"use strict";n.r(t),n.d(t,{createRecommendationClient:()=>u,getPersonalizationStrategy:()=>a,setPersonalizationStrategy:()=>l});var r=n(1757),i=n(7858),o=n(5541);const u=e=>{const t=e.region||"us",n=(0,r.createAuth)(r.AuthMode.WithinHeaders,e.appId,e.apiKey),o=(0,i.createTransporter)({hosts:[{url:`recommendation.${t}.algolia.com`}],...e,headers:{...n.headers(),"content-type":"application/json",...e.headers},queryParameters:{...n.queryParameters(),...e.queryParameters}});return(0,r.addMethods)({appId:e.appId,transporter:o},e.methods)},a=e=>t=>e.transporter.read({method:o.N.Get,path:"1/strategies/personalization"},t),l=e=>(t,n)=>e.transporter.write({method:o.N.Post,path:"1/strategies/personalization",data:t},n)},6586:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ApiKeyACLEnum:()=>Te,BatchActionEnum:()=>xe,ScopeEnum:()=>Ae,StrategyEnum:()=>Oe,SynonymEnum:()=>Pe,addApiKey:()=>d,assignUserID:()=>p,assignUserIDs:()=>h,batch:()=>z,browseObjects:()=>W,browseRules:()=>H,browseSynonyms:()=>V,chunkedBatch:()=>q,clearObjects:()=>G,clearRules:()=>$,clearSynonyms:()=>Y,copyIndex:()=>v,copyRules:()=>m,copySettings:()=>g,copySynonyms:()=>y,createBrowsablePromise:()=>a,createMissingObjectIDError:()=>s,createObjectNotFoundError:()=>c,createSearchClient:()=>l,createValidUntilNotFoundError:()=>f,deleteApiKey:()=>_,deleteBy:()=>K,deleteIndex:()=>X,deleteObject:()=>Q,deleteObjects:()=>J,deleteRule:()=>Z,deleteSynonym:()=>ee,exists:()=>te,findObject:()=>ne,generateSecuredApiKey:()=>b,getApiKey:()=>w,getLogs:()=>E,getObject:()=>re,getObjectPosition:()=>ie,getObjects:()=>oe,getRule:()=>ue,getSecuredApiKeyRemainingValidity:()=>D,getSettings:()=>ae,getSynonym:()=>le,getTask:()=>se,getTopUserIDs:()=>S,getUserID:()=>C,hasPendingMappings:()=>k,initIndex:()=>T,listApiKeys:()=>x,listClusters:()=>A,listIndices:()=>O,listUserIDs:()=>P,moveIndex:()=>I,multipleBatch:()=>N,multipleGetObjects:()=>M,multipleQueries:()=>R,multipleSearchForFacetValues:()=>F,partialUpdateObject:()=>ce,partialUpdateObjects:()=>fe,removeUserID:()=>L,replaceAllObjects:()=>de,replaceAllRules:()=>pe,replaceAllSynonyms:()=>he,restoreApiKey:()=>B,saveObject:()=>ve,saveObjects:()=>me,saveRule:()=>ge,saveRules:()=>ye,saveSynonym:()=>_e,saveSynonyms:()=>be,search:()=>we,searchForFacetValues:()=>Ee,searchRules:()=>De,searchSynonyms:()=>Se,searchUserIDs:()=>j,setSettings:()=>Ce,updateApiKey:()=>U,waitTask:()=>ke});var r=n(1757),i=n(7858),o=n(5541),u=n(6417);function a(e){const t=n=>e.request(n).then(r=>{if(void 0!==e.batch&&e.batch(r.hits),!e.shouldStop(r))return r.cursor?t({cursor:r.cursor}):t({page:(n.page||0)+1})});return t({})}const l=e=>{const t=e.appId,n=(0,r.createAuth)(void 0!==e.authMode?e.authMode:r.AuthMode.WithinHeaders,t,e.apiKey),o=(0,i.createTransporter)({hosts:[{url:t+"-dsn.algolia.net",accept:i.CallEnum.Read},{url:t+".algolia.net",accept:i.CallEnum.Write}].concat((0,r.shuffle)([{url:t+"-1.algolianet.com"},{url:t+"-2.algolianet.com"},{url:t+"-3.algolianet.com"}])),...e,headers:{...n.headers(),"content-type":"application/x-www-form-urlencoded",...e.headers},queryParameters:{...n.queryParameters(),...e.queryParameters}}),u={transporter:o,appId:t,addAlgoliaAgent(e,t){o.userAgent.add({segment:e,version:t})},clearCache:()=>Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then(()=>{})};return(0,r.addMethods)(u,e.methods)};function s(){return{name:"MissingObjectIDError",message:"All objects must have an unique objectID (like a primary key) to be valid. Algolia is also able to generate objectIDs automatically but *it's not recommended*. To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option."}}function c(){return{name:"ObjectNotFoundError",message:"Object not found."}}function f(){return{name:"ValidUntilNotFoundError",message:"ValidUntil not found in given secured api key."}}const d=e=>(t,n)=>{const{queryParameters:i,...u}=n||{},a={acl:t,...void 0!==i?{queryParameters:i}:{}};return(0,r.createWaitablePromise)(e.transporter.write({method:o.N.Post,path:"1/keys",data:a},u),(t,n)=>(0,r.createRetryablePromise)(r=>w(e)(t.key,n).catch(e=>{if(404!==e.status)throw e;return r()})))},p=e=>(t,n,r)=>{const u=(0,i.createMappedRequestOptions)(r);return u.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:o.N.Post,path:"1/clusters/mapping",data:{cluster:n}},u)},h=e=>(t,n,r)=>e.transporter.write({method:o.N.Post,path:"1/clusters/mapping/batch",data:{users:t,cluster:n}},r),v=e=>(t,n,i)=>(0,r.createWaitablePromise)(e.transporter.write({method:o.N.Post,path:(0,r.encode)("1/indexes/%s/operation",t),data:{operation:"copy",destination:n}},i),(n,r)=>T(e)(t,{methods:{waitTask:ke}}).waitTask(n.taskID,r)),m=e=>(t,n,r)=>v(e)(t,n,{...r,scope:[Ae.Rules]}),g=e=>(t,n,r)=>v(e)(t,n,{...r,scope:[Ae.Settings]}),y=e=>(t,n,r)=>v(e)(t,n,{...r,scope:[Ae.Synonyms]}),_=e=>(t,n)=>(0,r.createWaitablePromise)(e.transporter.write({method:o.N.Delete,path:(0,r.encode)("1/keys/%s",t)},n),(n,i)=>(0,r.createRetryablePromise)(n=>w(e)(t,i).then(n).catch(e=>{if(404!==e.status)throw e}))),b=()=>(e,t)=>{const n=(0,i.serializeQueryParameters)(t),r=(0,u.createHmac)("sha256",e).update(n).digest("hex");return Buffer.from(r+n).toString("base64")},w=e=>(t,n)=>e.transporter.read({method:o.N.Get,path:(0,r.encode)("1/keys/%s",t)},n),E=e=>t=>e.transporter.read({method:o.N.Get,path:"1/logs"},t),D=()=>e=>{const t=Buffer.from(e,"base64").toString("ascii").match(/validUntil=(\d+)/);if(null===t)throw{name:"ValidUntilNotFoundError",message:"ValidUntil not found in given secured api key."};return parseInt(t[1],10)-Math.round((new Date).getTime()/1e3)},S=e=>t=>e.transporter.read({method:o.N.Get,path:"1/clusters/mapping/top"},t),C=e=>(t,n)=>e.transporter.read({method:o.N.Get,path:(0,r.encode)("1/clusters/mapping/%s",t)},n),k=e=>t=>{const{retrieveMappings:n,...r}=t||{};return!0===n&&(r.getClusters=!0),e.transporter.read({method:o.N.Get,path:"1/clusters/mapping/pending"},r)},T=e=>(t,n={})=>{const i={transporter:e.transporter,appId:e.appId,indexName:t};return(0,r.addMethods)(i,n.methods)},x=e=>t=>e.transporter.read({method:o.N.Get,path:"1/keys"},t),A=e=>t=>e.transporter.read({method:o.N.Get,path:"1/clusters"},t),O=e=>t=>e.transporter.read({method:o.N.Get,path:"1/indexes"},t),P=e=>t=>e.transporter.read({method:o.N.Get,path:"1/clusters/mapping"},t),I=e=>(t,n,i)=>(0,r.createWaitablePromise)(e.transporter.write({method:o.N.Post,path:(0,r.encode)("1/indexes/%s/operation",t),data:{operation:"move",destination:n}},i),(n,r)=>T(e)(t,{methods:{waitTask:ke}}).waitTask(n.taskID,r)),N=e=>(t,n)=>(0,r.createWaitablePromise)(e.transporter.write({method:o.N.Post,path:"1/indexes/*/batch",data:{requests:t}},n),(t,n)=>Promise.all(Object.keys(t.taskID).map(r=>T(e)(r,{methods:{waitTask:ke}}).waitTask(t.taskID[r],n)))),M=e=>(t,n)=>e.transporter.read({method:o.N.Post,path:"1/indexes/*/objects",data:{requests:t}},n),R=e=>(t,n)=>{const r=t.map(e=>({...e,params:(0,i.serializeQueryParameters)(e.params||{})}));return e.transporter.read({method:o.N.Post,path:"1/indexes/*/queries",data:{requests:r},cacheable:!0},n)},F=e=>(t,n)=>Promise.all(t.map(t=>{const{facetName:r,facetQuery:i,...o}=t.params;return T(e)(t.indexName,{methods:{searchForFacetValues:Ee}}).searchForFacetValues(r,i,{...n,...o})})),L=e=>(t,n)=>{const r=(0,i.createMappedRequestOptions)(n);return r.queryParameters["X-Algolia-User-ID"]=t,e.transporter.write({method:o.N.Delete,path:"1/clusters/mapping"},r)},B=e=>(t,n)=>(0,r.createWaitablePromise)(e.transporter.write({method:o.N.Post,path:(0,r.encode)("1/keys/%s/restore",t)},n),(n,i)=>(0,r.createRetryablePromise)(n=>w(e)(t,i).catch(e=>{if(404!==e.status)throw e;return n()}))),j=e=>(t,n)=>e.transporter.read({method:o.N.Post,path:"1/clusters/mapping/search",data:{query:t}},n),U=e=>(t,n)=>{const i=Object.assign({},n),{queryParameters:u,...a}=n||{},l=u?{queryParameters:u}:{},s=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return(0,r.createWaitablePromise)(e.transporter.write({method:o.N.Put,path:(0,r.encode)("1/keys/%s",t),data:l},a),(n,o)=>(0,r.createRetryablePromise)(n=>w(e)(t,o).then(e=>(e=>Object.keys(i).filter(e=>-1!==s.indexOf(e)).every(t=>e[t]===i[t]))(e)?Promise.resolve():n())))},z=e=>(t,n)=>(0,r.createWaitablePromise)(e.transporter.write({method:o.N.Post,path:(0,r.encode)("1/indexes/%s/batch",e.indexName),data:{requests:t}},n),(t,n)=>ke(e)(t.taskID,n)),W=e=>t=>a({...t,shouldStop:e=>void 0===e.cursor,request:n=>e.transporter.read({method:o.N.Post,path:(0,r.encode)("1/indexes/%s/browse",e.indexName),data:n},t)}),H=e=>t=>{const n={hitsPerPage:1e3,...t};return a({...n,shouldStop:e=>e.hits.lengthDe(e)("",{...n,...t}).then(e=>({...e,hits:e.hits.map(e=>(delete e._highlightResult,e))}))})},V=e=>t=>{const n={hitsPerPage:1e3,...t};return a({...n,shouldStop:e=>e.hits.lengthSe(e)("",{...n,...t}).then(e=>({...e,hits:e.hits.map(e=>(delete e._highlightResult,e))}))})},q=e=>(t,n,i)=>{const{batchSize:o,...u}=i||{},a={taskIDs:[],objectIDs:[]},l=(r=0)=>{const i=[];let s;for(s=r;s({action:n,body:e})),u).then(e=>(a.objectIDs=a.objectIDs.concat(e.objectIDs),a.taskIDs.push(e.taskID),s++,l(s)))};return(0,r.createWaitablePromise)(l(),(t,n)=>Promise.all(t.taskIDs.map(t=>ke(e)(t,n))))},G=e=>t=>(0,r.createWaitablePromise)(e.transporter.write({method:o.N.Post,path:(0,r.encode)("1/indexes/%s/clear",e.indexName)},t),(t,n)=>ke(e)(t.taskID,n)),$=e=>t=>{const{forwardToReplicas:n,...u}=t||{},a=(0,i.createMappedRequestOptions)(u);return n&&(a.queryParameters.forwardToReplicas=1),(0,r.createWaitablePromise)(e.transporter.write({method:o.N.Post,path:(0,r.encode)("1/indexes/%s/rules/clear",e.indexName)},a),(t,n)=>ke(e)(t.taskID,n))},Y=e=>t=>{const{forwardToReplicas:n,...u}=t||{},a=(0,i.createMappedRequestOptions)(u);return n&&(a.queryParameters.forwardToReplicas=1),(0,r.createWaitablePromise)(e.transporter.write({method:o.N.Post,path:(0,r.encode)("1/indexes/%s/synonyms/clear",e.indexName)},a),(t,n)=>ke(e)(t.taskID,n))},K=e=>(t,n)=>(0,r.createWaitablePromise)(e.transporter.write({method:o.N.Post,path:(0,r.encode)("1/indexes/%s/deleteByQuery",e.indexName),data:t},n),(t,n)=>ke(e)(t.taskID,n)),X=e=>t=>(0,r.createWaitablePromise)(e.transporter.write({method:o.N.Delete,path:(0,r.encode)("1/indexes/%s",e.indexName)},t),(t,n)=>ke(e)(t.taskID,n)),Q=e=>(t,n)=>(0,r.createWaitablePromise)(J(e)([t],n).then(e=>({taskID:e.taskIDs[0]})),(t,n)=>ke(e)(t.taskID,n)),J=e=>(t,n)=>{const r=t.map(e=>({objectID:e}));return q(e)(r,xe.DeleteObject,n)},Z=e=>(t,n)=>{const{forwardToReplicas:u,...a}=n||{},l=(0,i.createMappedRequestOptions)(a);return u&&(l.queryParameters.forwardToReplicas=1),(0,r.createWaitablePromise)(e.transporter.write({method:o.N.Delete,path:(0,r.encode)("1/indexes/%s/rules/%s",e.indexName,t)},l),(t,n)=>ke(e)(t.taskID,n))},ee=e=>(t,n)=>{const{forwardToReplicas:u,...a}=n||{},l=(0,i.createMappedRequestOptions)(a);return u&&(l.queryParameters.forwardToReplicas=1),(0,r.createWaitablePromise)(e.transporter.write({method:o.N.Delete,path:(0,r.encode)("1/indexes/%s/synonyms/%s",e.indexName,t)},l),(t,n)=>ke(e)(t.taskID,n))},te=e=>t=>ae(e)(t).then(()=>!0).catch(e=>{if(404!==e.status)throw e;return!1}),ne=e=>(t,n)=>{const{query:r,paginate:i,...o}=n||{};let u=0;const a=()=>we(e)(r||"",{...o,page:u}).then(e=>{for(const[n,r]of Object.entries(e.hits))if(t(r))return{object:r,position:parseInt(n,10),page:u};if(u++,!1===i||u>=e.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return a()});return a()},re=e=>(t,n)=>e.transporter.read({method:o.N.Get,path:(0,r.encode)("1/indexes/%s/%s",e.indexName,t)},n),ie=()=>(e,t)=>{for(const[n,r]of Object.entries(e.hits))if(r.objectID===t)return parseInt(n,10);return-1},oe=e=>(t,n)=>{const{attributesToRetrieve:r,...i}=n||{},u=t.map(t=>({indexName:e.indexName,objectID:t,...r?{attributesToRetrieve:r}:{}}));return e.transporter.read({method:o.N.Post,path:"1/indexes/*/objects",data:{requests:u}},i)},ue=e=>(t,n)=>e.transporter.read({method:o.N.Get,path:(0,r.encode)("1/indexes/%s/rules/%s",e.indexName,t)},n),ae=e=>t=>e.transporter.read({method:o.N.Get,path:(0,r.encode)("1/indexes/%s/settings",e.indexName),data:{getVersion:2}},t),le=e=>(t,n)=>e.transporter.read({method:o.N.Get,path:(0,r.encode)("1/indexes/%s/synonyms/%s",e.indexName,t)},n),se=e=>(t,n)=>e.transporter.read({method:o.N.Get,path:(0,r.encode)("1/indexes/%s/task/%s",e.indexName,t.toString())},n),ce=e=>(t,n)=>(0,r.createWaitablePromise)(fe(e)([t],n).then(e=>({objectID:e.objectIDs[0],taskID:e.taskIDs[0]})),(t,n)=>ke(e)(t.taskID,n)),fe=e=>(t,n)=>{const{createIfNotExists:r,...i}=n||{},o=r?xe.PartialUpdateObject:xe.PartialUpdateObjectNoCreate;return q(e)(t,o,i)},de=e=>(t,n)=>{const{safe:i,autoGenerateObjectIDIfNotExist:u,batchSize:a,...l}=n||{},s=(t,n,i,u)=>(0,r.createWaitablePromise)(e.transporter.write({method:o.N.Post,path:(0,r.encode)("1/indexes/%s/operation",t),data:{operation:i,destination:n}},u),(t,n)=>ke(e)(t.taskID,n)),c=Math.random().toString(36).substring(7),f=`${e.indexName}_tmp_${c}`,d=me({appId:e.appId,transporter:e.transporter,indexName:f});let p=[];const h=s(e.indexName,f,"copy",{...l,scope:["settings","synonyms","rules"]});p.push(h);const v=(i?h.wait(l):h).then(()=>{const e=d(t,{...l,autoGenerateObjectIDIfNotExist:u,batchSize:a});return p.push(e),i?e.wait(l):e}).then(()=>{const t=s(f,e.indexName,"move",l);return p.push(t),i?t.wait(l):t}).then(()=>Promise.all(p)).then(([e,t,n])=>({objectIDs:t.objectIDs,taskIDs:[e.taskID,...t.taskIDs,n.taskID]}));return(0,r.createWaitablePromise)(v,(e,t)=>Promise.all(p.map(e=>e.wait(t))))},pe=e=>(t,n)=>ye(e)(t,{...n,clearExistingRules:!0}),he=e=>(t,n)=>be(e)(t,{...n,replaceExistingSynonyms:!0}),ve=e=>(t,n)=>(0,r.createWaitablePromise)(me(e)([t],n).then(e=>({objectID:e.objectIDs[0],taskID:e.taskIDs[0]})),(t,n)=>ke(e)(t.taskID,n)),me=e=>(t,n)=>{const{autoGenerateObjectIDIfNotExist:i,...o}=n||{},u=i?xe.AddObject:xe.UpdateObject;if(u===xe.UpdateObject)for(const e of t)if(void 0===e.objectID)return(0,r.createWaitablePromise)(Promise.reject({name:"MissingObjectIDError",message:"All objects must have an unique objectID (like a primary key) to be valid. Algolia is also able to generate objectIDs automatically but *it's not recommended*. To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option."}));return q(e)(t,u,o)},ge=e=>(t,n)=>ye(e)([t],n),ye=e=>(t,n)=>{const{forwardToReplicas:u,clearExistingRules:a,...l}=n||{},s=(0,i.createMappedRequestOptions)(l);return u&&(s.queryParameters.forwardToReplicas=1),a&&(s.queryParameters.clearExistingRules=1),(0,r.createWaitablePromise)(e.transporter.write({method:o.N.Post,path:(0,r.encode)("1/indexes/%s/rules/batch",e.indexName),data:t},s),(t,n)=>ke(e)(t.taskID,n))},_e=e=>(t,n)=>be(e)([t],n),be=e=>(t,n)=>{const{forwardToReplicas:u,replaceExistingSynonyms:a,...l}=n||{},s=(0,i.createMappedRequestOptions)(l);return u&&(s.queryParameters.forwardToReplicas=1),a&&(s.queryParameters.replaceExistingSynonyms=1),(0,r.createWaitablePromise)(e.transporter.write({method:o.N.Post,path:(0,r.encode)("1/indexes/%s/synonyms/batch",e.indexName),data:t},s),(t,n)=>ke(e)(t.taskID,n))},we=e=>(t,n)=>e.transporter.read({method:o.N.Post,path:(0,r.encode)("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},n),Ee=e=>(t,n,i)=>e.transporter.read({method:o.N.Post,path:(0,r.encode)("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:n},cacheable:!0},i),De=e=>(t,n)=>e.transporter.read({method:o.N.Post,path:(0,r.encode)("1/indexes/%s/rules/search",e.indexName),data:{query:t}},n),Se=e=>(t,n)=>e.transporter.read({method:o.N.Post,path:(0,r.encode)("1/indexes/%s/synonyms/search",e.indexName),data:{query:t}},n),Ce=e=>(t,n)=>{const{forwardToReplicas:u,...a}=n||{},l=(0,i.createMappedRequestOptions)(a);return u&&(l.queryParameters.forwardToReplicas=1),(0,r.createWaitablePromise)(e.transporter.write({method:o.N.Put,path:(0,r.encode)("1/indexes/%s/settings",e.indexName),data:t},l),(t,n)=>ke(e)(t.taskID,n))},ke=e=>(t,n)=>(0,r.createRetryablePromise)(r=>se(e)(t,n).then(e=>"published"!==e.status?r():void 0)),Te={AddObject:"addObject",Analytics:"analytics",Browser:"browse",DeleteIndex:"deleteIndex",DeleteObject:"deleteObject",EditSettings:"editSettings",ListIndexes:"listIndexes",Logs:"logs",Recommendation:"recommendation",Search:"search",SeeUnretrievableAttributes:"seeUnretrievableAttributes",Settings:"settings",Usage:"usage"},xe={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject"},Ae={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},Oe={None:"none",StopIfEnoughMatches:"stopIfEnoughMatches"},Pe={Synonym:"synonym",OneWaySynonym:"oneWaySynonym",AltCorrection1:"altCorrection1",AltCorrection2:"altCorrection2",Placeholder:"placeholder"}},8045:(e,t,n)=>{"use strict";function r(){return{debug:(e,t)=>Promise.resolve(),info:(e,t)=>Promise.resolve(),error:(e,t)=>Promise.resolve()}}n.r(t),n.d(t,{LogLevelEnum:()=>i,createNullLogger:()=>r});const i={Debug:1,Info:2,Error:3}},5541:(e,t,n)=>{"use strict";n.d(t,{N:()=>r});const r={Delete:"DELETE",Get:"GET",Post:"POST",Put:"PUT"}},9178:(e,t,n)=>{"use strict";n.r(t),n.d(t,{createNodeHttpRequester:()=>u});var r=n(8605),i=n(7211),o=n(8835);function u(){const e={keepAlive:!0},t=new r.Agent(e),n=new i.Agent(e);return{send:e=>new Promise(u=>{const a=(0,o.parse)(e.url),l=null===a.query?a.pathname:`${a.pathname}?${a.query}`,s={agent:"https:"===a.protocol?n:t,hostname:a.hostname,path:l,method:e.method,headers:e.headers,...void 0!==a.port?{port:a.port||""}:{}},c=("https:"===a.protocol?i:r).request(s,e=>{let t="";e.on("data",e=>t+=e),e.on("end",()=>{clearTimeout(d),clearTimeout(p),u({status:e.statusCode||0,content:t,isTimedOut:!1})})}),f=(e,t)=>setTimeout(()=>{c.abort(),u({status:0,content:t,isTimedOut:!0})},1e3*e),d=f(e.connectTimeout,"Connection timeout");let p;c.on("error",e=>{clearTimeout(d),clearTimeout(p),u({status:0,content:e.message,isTimedOut:!1})}),c.once("response",()=>{clearTimeout(d),p=f(e.responseTimeout,"Socket timeout")}),void 0!==e.data&&c.write(e.data),c.end()}),destroy:()=>(t.destroy(),n.destroy(),Promise.resolve())}}},7858:(e,t,n)=>{"use strict";n.r(t),n.d(t,{CallEnum:()=>o,HostStatusEnum:()=>u,createApiError:()=>E,createDeserializationError:()=>D,createMappedRequestOptions:()=>i,createRetryError:()=>S,createStatefulHost:()=>a,createStatelessHost:()=>c,createTransporter:()=>d,createUserAgent:()=>p,deserializeFailure:()=>v,deserializeSuccess:()=>h,isStatefulHostTimeouted:()=>s,isStatefulHostUp:()=>l,serializeData:()=>y,serializeHeaders:()=>_,serializeQueryParameters:()=>g,serializeUrl:()=>m,stackFrameWithoutCredentials:()=>w,stackTraceWithoutCredentials:()=>b});var r=n(5541);function i(e,t){const n=e||{},r=n.data||{};return Object.keys(n).forEach(e=>{-1===["timeout","headers","queryParameters","data","cacheable"].indexOf(e)&&(r[e]=n[e])}),{data:Object.entries(r).length>0?r:void 0,timeout:n.timeout||t,headers:n.headers||{},queryParameters:n.queryParameters||{},cacheable:n.cacheable}}const o={Read:1,Write:2,Any:3},u={Up:1,Down:2,Timeouted:3};function a(e,t=u.Up){return{...e,status:t,lastUpdate:Date.now()}}function l(e){return e.status===u.Up||Date.now()-e.lastUpdate>12e4}function s(e){return e.status===u.Timeouted&&Date.now()-e.lastUpdate<=12e4}function c(e){return{protocol:e.protocol||"https",url:e.url,accept:e.accept||o.Any}}function f(e,t,n,i){const o=[],f=y(n,i),d=_(e,i),p=n.method,g=n.method!==r.N.Get?{}:{...n.data,...i.data},E={"x-algolia-agent":e.userAgent.value,...e.queryParameters,...g,...i.queryParameters};let D=0;const C=(t,r)=>{const l=t.pop();if(void 0===l)throw S(b(o));const s={data:f,headers:d,method:p,url:m(l,n.path,E),connectTimeout:r(D,e.timeouts.connect),responseTimeout:r(D,i.timeout)},c=e=>{const n={request:s,response:e,host:l,triesLeft:t.length};return o.push(n),n},g={onSucess:e=>h(e),onRetry(n){const i=c(n);return n.isTimedOut&&D++,Promise.all([e.logger.info("Retryable failure",w(i)),e.hostsCache.set(l,a(l,n.isTimedOut?u.Timeouted:u.Down))]).then(()=>C(t,r))},onFail(e){throw c(e),v(e,b(o))}};return e.requester.send(s).then(e=>((e,t)=>(e=>{const t=e.status;return e.isTimedOut||(({isTimedOut:e,status:t})=>!e&&0==~~t)(e)||2!=~~(t/100)&&4!=~~(t/100)})(e)?t.onRetry(e):(({status:e})=>2==~~(e/100))(e)?t.onSucess(e):t.onFail(e))(e,g))};return function(e,t){return Promise.all(t.map(t=>e.get(t,()=>Promise.resolve(a(t))))).then(e=>{const n=e.filter(e=>l(e)),r=e.filter(e=>s(e)),i=[...n,...r];return{getTimeout:(e,t)=>(0===r.length&&0===e?1:r.length+3+e)*t,statelessHosts:i.length>0?i.map(e=>c(e)):t}})}(e.hostsCache,t).then(e=>C([...e.statelessHosts].reverse(),e.getTimeout))}function d(e){const{hostsCache:t,logger:n,requester:r,requestsCache:u,responsesCache:a,timeouts:l,userAgent:s,hosts:d,queryParameters:p,headers:h}=e,v={hostsCache:t,logger:n,requester:r,requestsCache:u,responsesCache:a,timeouts:l,userAgent:s,headers:h,queryParameters:p,hosts:d.map(e=>c(e)),read(e,t){const n=i(t,v.timeouts.read),r=()=>f(v,v.hosts.filter(e=>0!=(e.accept&o.Read)),e,n);if(!0!==(void 0!==n.cacheable?n.cacheable:e.cacheable))return r();const u={request:e,mappedRequestOptions:n,transporter:{queryParameters:v.queryParameters,headers:v.headers}};return v.responsesCache.get(u,()=>v.requestsCache.get(u,()=>v.requestsCache.set(u,r()).then(e=>Promise.all([v.requestsCache.delete(u),e]),e=>Promise.all([v.requestsCache.delete(u),Promise.reject(e)])).then(([e,t])=>t)),{miss:e=>v.responsesCache.set(u,e)})},write:(e,t)=>f(v,v.hosts.filter(e=>0!=(e.accept&o.Write)),e,i(t,v.timeouts.write))};return v}function p(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const n=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(n)&&(t.value=`${t.value}${n}`),t}};return t}function h(e){try{return JSON.parse(e.content)}catch(t){throw D(t.message,e)}}function v({content:e,status:t},n){let r=e;try{r=JSON.parse(e).message}catch(e){}return E(r,t,n)}function m(e,t,n){const r=g(n);let i=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return r.length&&(i+="?"+r),i}function g(e){return Object.keys(e).map(t=>{return function(e,...t){let n=0;return e.replace(/%s/g,()=>encodeURIComponent(t[n++]))}("%s=%s",t,(n=e[t],"[object Object]"===Object.prototype.toString.call(n)||"[object Array]"===Object.prototype.toString.call(n)?JSON.stringify(e[t]):e[t]));var n}).join("&")}function y(e,t){if(e.method===r.N.Get||void 0===e.data&&void 0===t.data)return;const n=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(n)}function _(e,t){const n={...e.headers,...t.headers},r={};return Object.keys(n).forEach(e=>{const t=n[e];r[e.toLowerCase()]=t}),r}function b(e){return e.map(e=>w(e))}function w(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function E(e,t,n){return{name:"ApiError",message:e,status:t,transporterStackTrace:n}}function D(e,t){return{name:"DeserializationError",message:e,response:t}}function S(e){return{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:e}}},8774:(e,t,n)=>{"use strict";var r=n(469),i=n(6712),o=n(2223),u=n(1757),a=n(103),l=n(6586),s=n(8045),c=n(9178),f=n(7858);function d(e,t,n){const d={appId:e,apiKey:t,timeouts:{connect:2,read:5,write:30},requester:c.createNodeHttpRequester(),logger:s.createNullLogger(),responsesCache:r.createNullCache(),requestsCache:r.createNullCache(),hostsCache:i.createInMemoryCache(),userAgent:f.createUserAgent(u.version).add({segment:"Node.js",version:process.versions.node})};return l.createSearchClient({...d,...n,methods:{search:l.multipleQueries,searchForFacetValues:l.multipleSearchForFacetValues,multipleBatch:l.multipleBatch,multipleGetObjects:l.multipleGetObjects,multipleQueries:l.multipleQueries,copyIndex:l.copyIndex,copySettings:l.copySettings,copyRules:l.copyRules,copySynonyms:l.copySynonyms,moveIndex:l.moveIndex,listIndices:l.listIndices,getLogs:l.getLogs,listClusters:l.listClusters,multipleSearchForFacetValues:l.multipleSearchForFacetValues,getApiKey:l.getApiKey,addApiKey:l.addApiKey,listApiKeys:l.listApiKeys,updateApiKey:l.updateApiKey,deleteApiKey:l.deleteApiKey,restoreApiKey:l.restoreApiKey,assignUserID:l.assignUserID,assignUserIDs:l.assignUserIDs,getUserID:l.getUserID,searchUserIDs:l.searchUserIDs,listUserIDs:l.listUserIDs,getTopUserIDs:l.getTopUserIDs,removeUserID:l.removeUserID,hasPendingMappings:l.hasPendingMappings,generateSecuredApiKey:l.generateSecuredApiKey,getSecuredApiKeyRemainingValidity:l.getSecuredApiKeyRemainingValidity,destroy:u.destroy,initIndex:e=>t=>l.initIndex(e)(t,{methods:{batch:l.batch,delete:l.deleteIndex,getObject:l.getObject,getObjects:l.getObjects,saveObject:l.saveObject,saveObjects:l.saveObjects,search:l.search,searchForFacetValues:l.searchForFacetValues,waitTask:l.waitTask,setSettings:l.setSettings,getSettings:l.getSettings,partialUpdateObject:l.partialUpdateObject,partialUpdateObjects:l.partialUpdateObjects,deleteObject:l.deleteObject,deleteObjects:l.deleteObjects,deleteBy:l.deleteBy,clearObjects:l.clearObjects,browseObjects:l.browseObjects,getObjectPosition:l.getObjectPosition,findObject:l.findObject,exists:l.exists,saveSynonym:l.saveSynonym,saveSynonyms:l.saveSynonyms,getSynonym:l.getSynonym,searchSynonyms:l.searchSynonyms,browseSynonyms:l.browseSynonyms,deleteSynonym:l.deleteSynonym,clearSynonyms:l.clearSynonyms,replaceAllObjects:l.replaceAllObjects,replaceAllSynonyms:l.replaceAllSynonyms,searchRules:l.searchRules,getRule:l.getRule,deleteRule:l.deleteRule,saveRule:l.saveRule,saveRules:l.saveRules,replaceAllRules:l.replaceAllRules,browseRules:l.browseRules,clearRules:l.clearRules}}),initAnalytics:()=>e=>o.createAnalyticsClient({...d,...e,methods:{addABTest:o.addABTest,getABTest:o.getABTest,getABTests:o.getABTests,stopABTest:o.stopABTest,deleteABTest:o.deleteABTest}}),initRecommendation:()=>e=>a.createRecommendationClient({...d,...e,methods:{getPersonalizationStrategy:a.getPersonalizationStrategy,setPersonalizationStrategy:a.setPersonalizationStrategy}})}})}d.version=u.version,e.exports=d},4410:(e,t,n)=>{const r=n(8774);e.exports=r,e.exports.default=r},7589:e=>{"use strict";const t=e.exports;e.exports.default=t;const n="[",r="]",i="",o=";",u="Apple_Terminal"===process.env.TERM_PROGRAM;t.cursorTo=(e,t)=>{if("number"!=typeof e)throw new TypeError("The `x` argument is required");return"number"!=typeof t?n+(e+1)+"G":n+(t+1)+";"+(e+1)+"H"},t.cursorMove=(e,t)=>{if("number"!=typeof e)throw new TypeError("The `x` argument is required");let r="";return e<0?r+=n+-e+"D":e>0&&(r+=n+e+"C"),t<0?r+=n+-t+"A":t>0&&(r+=n+t+"B"),r},t.cursorUp=(e=1)=>n+e+"A",t.cursorDown=(e=1)=>n+e+"B",t.cursorForward=(e=1)=>n+e+"C",t.cursorBackward=(e=1)=>n+e+"D",t.cursorLeft="",t.cursorSavePosition=u?"7":"",t.cursorRestorePosition=u?"8":"",t.cursorGetPosition="",t.cursorNextLine="",t.cursorPrevLine="",t.cursorHide="[?25l",t.cursorShow="[?25h",t.eraseLines=e=>{let n="";for(let r=0;r[r,"8",o,o,t,i,e,r,"8",o,o,i].join(""),t.image=(e,t={})=>{let n=r+"1337;File=inline=1";return t.width&&(n+=";width="+t.width),t.height&&(n+=";height="+t.height),!1===t.preserveAspectRatio&&(n+=";preserveAspectRatio=0"),n+":"+e.toString("base64")+i},t.iTerm={setCwd:(e=process.cwd())=>`${r}50;CurrentDir=${e}${i}`,annotation:(e,t={})=>{let n=r+"1337;";const o=void 0!==t.x,u=void 0!==t.y;if((o||u)&&(!o||!u||void 0===t.length))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replace(/\|/g,""),n+=t.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",t.length>0?n+=(o?[e,t.length,t.x,t.y]:[t.length,e]).join("|"):n+=e,n+i}}},5378:e=>{"use strict";e.exports=e=>{e=Object.assign({onlyFirst:!1},e);const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e.onlyFirst?void 0:"g")}},1337:e=>{"use strict";e.exports=({onlyFirst:e=!1}={})=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}},8483:(e,t,n)=>{"use strict";e=n.nmd(e);const r=(e,t)=>(...n)=>`[${e(...n)+t}m`,i=(e,t)=>(...n)=>{const r=e(...n);return`[${38+t};5;${r}m`},o=(e,t)=>(...n)=>{const r=e(...n);return`[${38+t};2;${r[0]};${r[1]};${r[2]}m`},u=e=>e,a=(e,t,n)=>[e,t,n],l=(e,t,n)=>{Object.defineProperty(e,t,{get:()=>{const r=n();return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0}),r},enumerable:!0,configurable:!0})};let s;const c=(e,t,r,i)=>{void 0===s&&(s=n(2744));const o=i?10:0,u={};for(const[n,i]of Object.entries(s)){const a="ansi16"===n?"ansi":n;n===t?u[a]=e(r,o):"object"==typeof i&&(u[a]=e(i[t],o))}return u};Object.defineProperty(e,"exports",{enumerable:!0,get:function(){const e=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.gray=t.color.blackBright,t.bgColor.bgGray=t.bgColor.bgBlackBright,t.color.grey=t.color.blackBright,t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(const[n,r]of Object.entries(t)){for(const[n,i]of Object.entries(r))t[n]={open:`[${i[0]}m`,close:`[${i[1]}m`},r[n]=t[n],e.set(i[0],i[1]);Object.defineProperty(t,n,{value:r,enumerable:!1})}return Object.defineProperty(t,"codes",{value:e,enumerable:!1}),t.color.close="",t.bgColor.close="",l(t.color,"ansi",()=>c(r,"ansi16",u,!1)),l(t.color,"ansi256",()=>c(i,"ansi256",u,!1)),l(t.color,"ansi16m",()=>c(o,"rgb",a,!1)),l(t.bgColor,"ansi",()=>c(r,"ansi16",u,!0)),l(t.bgColor,"ansi256",()=>c(i,"ansi256",u,!0)),l(t.bgColor,"ansi16m",()=>c(o,"rgb",a,!0)),t}})},5640:e=>{"use strict";e.exports=e=>e&&e.exact?new RegExp("^[\ud800-\udbff][\udc00-\udfff]$"):new RegExp("[\ud800-\udbff][\udc00-\udfff]","g")},409:e=>{"use strict";e.exports=e=>e&&e.exact?new RegExp("^[\ud800-\udbff][\udc00-\udfff]$"):new RegExp("[\ud800-\udbff][\udc00-\udfff]","g")},2633:e=>{"use strict";e.exports=(e,{include:t,exclude:n}={})=>{const r=e=>{const r=t=>"string"==typeof t?e===t:t.test(e);return t?t.some(r):!n||!n.some(r)};for(const[t,n]of(e=>{const t=new Set;do{for(const n of Reflect.ownKeys(e))t.add([e,n])}while((e=Reflect.getPrototypeOf(e))&&e!==Object.prototype);return t})(e.constructor.prototype)){if("constructor"===n||!r(n))continue;const i=Reflect.getOwnPropertyDescriptor(t,n);i&&"function"==typeof i.value&&(e[n]=e[n].bind(e))}return e}},5882:(e,t,n)=>{"use strict";const r=n(8483),{stdout:i,stderr:o}=n(9428),{stringReplaceAll:u,stringEncaseCRLFWithFirstIndex:a}=n(3327),l=["ansi","ansi","ansi256","ansi16m"],s=Object.create(null);class c{constructor(e){return f(e)}}const f=e=>{const t={};return((e,t={})=>{if(t.level>3||t.level<0)throw new Error("The `level` option should be an integer from 0 to 3");const n=i?i.level:0;e.level=void 0===t.level?n:t.level})(t,e),t.template=(...e)=>_(t.template,...e),Object.setPrototypeOf(t,d.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=c,t.template};function d(e){return f(e)}for(const[e,t]of Object.entries(r))s[e]={get(){const n=m(this,v(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:n}),n}};s.visible={get(){const e=m(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};const p=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const e of p)s[e]={get(){const{level:t}=this;return function(...n){const i=v(r.color[l[t]][e](...n),r.color.close,this._styler);return m(this,i,this._isEmpty)}}};for(const e of p){s["bg"+e[0].toUpperCase()+e.slice(1)]={get(){const{level:t}=this;return function(...n){const i=v(r.bgColor[l[t]][e](...n),r.bgColor.close,this._styler);return m(this,i,this._isEmpty)}}}}const h=Object.defineProperties(()=>{},{...s,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),v=(e,t,n)=>{let r,i;return void 0===n?(r=e,i=t):(r=n.openAll+e,i=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:n}},m=(e,t,n)=>{const r=(...e)=>g(r,1===e.length?""+e[0]:e.join(" "));return r.__proto__=h,r._generator=e,r._styler=t,r._isEmpty=n,r},g=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let n=e._styler;if(void 0===n)return t;const{openAll:r,closeAll:i}=n;if(-1!==t.indexOf(""))for(;void 0!==n;)t=u(t,n.close,n.open),n=n.parent;const o=t.indexOf("\n");return-1!==o&&(t=a(t,i,r,o)),r+t+i};let y;const _=(e,...t)=>{const[r]=t;if(!Array.isArray(r))return t.join(" ");const i=t.slice(1),o=[r.raw[0]];for(let e=1;e{"use strict";const t=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,n=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,r=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,i=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|([^\\])/gi,o=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function u(e){const t="u"===e[0],n="{"===e[1];return t&&!n&&5===e.length||"x"===e[0]&&3===e.length?String.fromCharCode(parseInt(e.slice(1),16)):t&&n?String.fromCodePoint(parseInt(e.slice(2,-1),16)):o.get(e)||e}function a(e,t){const n=[],o=t.trim().split(/\s*,\s*/g);let a;for(const t of o){const o=Number(t);if(Number.isNaN(o)){if(!(a=t.match(r)))throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`);n.push(a[2].replace(i,(e,t,n)=>t?u(t):n))}else n.push(o)}return n}function l(e){n.lastIndex=0;const t=[];let r;for(;null!==(r=n.exec(e));){const e=r[1];if(r[2]){const n=a(e,r[2]);t.push([e].concat(n))}else t.push([e])}return t}function s(e,t){const n={};for(const e of t)for(const t of e.styles)n[t[0]]=e.inverse?null:t.slice(1);let r=e;for(const[e,t]of Object.entries(n))if(Array.isArray(t)){if(!(e in r))throw new Error("Unknown Chalk style: "+e);r=t.length>0?r[e](...t):r[e]}return r}e.exports=(e,n)=>{const r=[],i=[];let o=[];if(n.replace(t,(t,n,a,c,f,d)=>{if(n)o.push(u(n));else if(c){const t=o.join("");o=[],i.push(0===r.length?t:s(e,r)(t)),r.push({inverse:a,styles:l(c)})}else if(f){if(0===r.length)throw new Error("Found extraneous } in Chalk template literal");i.push(s(e,r)(o.join(""))),o=[],r.pop()}else o.push(d)}),i.push(o.join("")),r.length>0){const e=`Chalk template literal is missing ${r.length} closing bracket${1===r.length?"":"s"} (\`}\`)`;throw new Error(e)}return i.join("")}},3327:e=>{"use strict";e.exports={stringReplaceAll:(e,t,n)=>{let r=e.indexOf(t);if(-1===r)return e;const i=t.length;let o=0,u="";do{u+=e.substr(o,r-o)+t+n,o=r+i,r=e.indexOf(t,o)}while(-1!==r);return u+=e.substr(o),u},stringEncaseCRLFWithFirstIndex:(e,t,n,r)=>{let i=0,o="";do{const u="\r"===e[r-1];o+=e.substr(i,(u?r-1:r)-i)+t+(u?"\r\n":"\n")+n,i=r+1,r=e.indexOf("\n",i)}while(-1!==r);return o+=e.substr(i),o}}},1525:(e,t,n)=>{"use strict";const r=n(8483),{stdout:i,stderr:o}=n(9428),{stringReplaceAll:u,stringEncaseCRLFWithFirstIndex:a}=n(6539),{isArray:l}=Array,s=["ansi","ansi","ansi256","ansi16m"],c=Object.create(null);class f{constructor(e){return d(e)}}const d=e=>{const t={};return((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const n=i?i.level:0;e.level=void 0===t.level?n:t.level})(t,e),t.template=(...e)=>b(t.template,...e),Object.setPrototypeOf(t,p.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=f,t.template};function p(e){return d(e)}for(const[e,t]of Object.entries(r))c[e]={get(){const n=g(this,m(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:n}),n}};c.visible={get(){const e=g(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};const h=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const e of h)c[e]={get(){const{level:t}=this;return function(...n){const i=m(r.color[s[t]][e](...n),r.color.close,this._styler);return g(this,i,this._isEmpty)}}};for(const e of h){c["bg"+e[0].toUpperCase()+e.slice(1)]={get(){const{level:t}=this;return function(...n){const i=m(r.bgColor[s[t]][e](...n),r.bgColor.close,this._styler);return g(this,i,this._isEmpty)}}}}const v=Object.defineProperties(()=>{},{...c,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),m=(e,t,n)=>{let r,i;return void 0===n?(r=e,i=t):(r=n.openAll+e,i=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:n}},g=(e,t,n)=>{const r=(...e)=>l(e[0])&&l(e[0].raw)?y(r,b(r,...e)):y(r,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(r,v),r._generator=e,r._styler=t,r._isEmpty=n,r},y=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let n=e._styler;if(void 0===n)return t;const{openAll:r,closeAll:i}=n;if(-1!==t.indexOf(""))for(;void 0!==n;)t=u(t,n.close,n.open),n=n.parent;const o=t.indexOf("\n");return-1!==o&&(t=a(t,i,r,o)),r+t+i};let _;const b=(e,...t)=>{const[r]=t;if(!l(r)||!l(r.raw))return t.join(" ");const i=t.slice(1),o=[r.raw[0]];for(let e=1;e{"use strict";const t=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,n=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,r=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,i=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,o=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function u(e){const t="u"===e[0],n="{"===e[1];return t&&!n&&5===e.length||"x"===e[0]&&3===e.length?String.fromCharCode(parseInt(e.slice(1),16)):t&&n?String.fromCodePoint(parseInt(e.slice(2,-1),16)):o.get(e)||e}function a(e,t){const n=[],o=t.trim().split(/\s*,\s*/g);let a;for(const t of o){const o=Number(t);if(Number.isNaN(o)){if(!(a=t.match(r)))throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`);n.push(a[2].replace(i,(e,t,n)=>t?u(t):n))}else n.push(o)}return n}function l(e){n.lastIndex=0;const t=[];let r;for(;null!==(r=n.exec(e));){const e=r[1];if(r[2]){const n=a(e,r[2]);t.push([e].concat(n))}else t.push([e])}return t}function s(e,t){const n={};for(const e of t)for(const t of e.styles)n[t[0]]=e.inverse?null:t.slice(1);let r=e;for(const[e,t]of Object.entries(n))if(Array.isArray(t)){if(!(e in r))throw new Error("Unknown Chalk style: "+e);r=t.length>0?r[e](...t):r[e]}return r}e.exports=(e,n)=>{const r=[],i=[];let o=[];if(n.replace(t,(t,n,a,c,f,d)=>{if(n)o.push(u(n));else if(c){const t=o.join("");o=[],i.push(0===r.length?t:s(e,r)(t)),r.push({inverse:a,styles:l(c)})}else if(f){if(0===r.length)throw new Error("Found extraneous } in Chalk template literal");i.push(s(e,r)(o.join(""))),o=[],r.pop()}else o.push(d)}),i.push(o.join("")),r.length>0){const e=`Chalk template literal is missing ${r.length} closing bracket${1===r.length?"":"s"} (\`}\`)`;throw new Error(e)}return i.join("")}},6539:e=>{"use strict";e.exports={stringReplaceAll:(e,t,n)=>{let r=e.indexOf(t);if(-1===r)return e;const i=t.length;let o=0,u="";do{u+=e.substr(o,r-o)+t+n,o=r+i,r=e.indexOf(t,o)}while(-1!==r);return u+=e.substr(o),u},stringEncaseCRLFWithFirstIndex:(e,t,n,r)=>{let i=0,o="";do{const u="\r"===e[r-1];o+=e.substr(i,(u?r-1:r)-i)+t+(u?"\r\n":"\n")+n,i=r+1,r=e.indexOf("\n",i)}while(-1!==r);return o+=e.substr(i),o}}},5864:(e,t,n)=>{"use strict";var r=n(5832),i=process.env;function o(e){return"string"==typeof e?!!i[e]:Object.keys(e).every((function(t){return i[t]===e[t]}))}Object.defineProperty(t,"_vendors",{value:r.map((function(e){return e.constant}))}),t.name=null,t.isPR=null,r.forEach((function(e){var n=(Array.isArray(e.env)?e.env:[e.env]).every((function(e){return o(e)}));if(t[e.constant]=n,n)switch(t.name=e.name,typeof e.pr){case"string":t.isPR=!!i[e.pr];break;case"object":"env"in e.pr?t.isPR=e.pr.env in i&&i[e.pr.env]!==e.pr.ne:"any"in e.pr?t.isPR=e.pr.any.some((function(e){return!!i[e]})):t.isPR=o(e.pr);break;default:t.isPR=null}})),t.isCI=!!(i.CI||i.CONTINUOUS_INTEGRATION||i.BUILD_NUMBER||i.RUN_ID||t.name)},5832:e=>{"use strict";e.exports=JSON.parse('[{"name":"AppVeyor","constant":"APPVEYOR","env":"APPVEYOR","pr":"APPVEYOR_PULL_REQUEST_NUMBER"},{"name":"Azure Pipelines","constant":"AZURE_PIPELINES","env":"SYSTEM_TEAMFOUNDATIONCOLLECTIONURI","pr":"SYSTEM_PULLREQUEST_PULLREQUESTID"},{"name":"Bamboo","constant":"BAMBOO","env":"bamboo_planKey"},{"name":"Bitbucket Pipelines","constant":"BITBUCKET","env":"BITBUCKET_COMMIT","pr":"BITBUCKET_PR_ID"},{"name":"Bitrise","constant":"BITRISE","env":"BITRISE_IO","pr":"BITRISE_PULL_REQUEST"},{"name":"Buddy","constant":"BUDDY","env":"BUDDY_WORKSPACE_ID","pr":"BUDDY_EXECUTION_PULL_REQUEST_ID"},{"name":"Buildkite","constant":"BUILDKITE","env":"BUILDKITE","pr":{"env":"BUILDKITE_PULL_REQUEST","ne":"false"}},{"name":"CircleCI","constant":"CIRCLE","env":"CIRCLECI","pr":"CIRCLE_PULL_REQUEST"},{"name":"Cirrus CI","constant":"CIRRUS","env":"CIRRUS_CI","pr":"CIRRUS_PR"},{"name":"AWS CodeBuild","constant":"CODEBUILD","env":"CODEBUILD_BUILD_ARN"},{"name":"Codeship","constant":"CODESHIP","env":{"CI_NAME":"codeship"}},{"name":"Drone","constant":"DRONE","env":"DRONE","pr":{"DRONE_BUILD_EVENT":"pull_request"}},{"name":"dsari","constant":"DSARI","env":"DSARI"},{"name":"GitLab CI","constant":"GITLAB","env":"GITLAB_CI"},{"name":"GoCD","constant":"GOCD","env":"GO_PIPELINE_LABEL"},{"name":"Hudson","constant":"HUDSON","env":"HUDSON_URL"},{"name":"Jenkins","constant":"JENKINS","env":["JENKINS_URL","BUILD_ID"],"pr":{"any":["ghprbPullId","CHANGE_ID"]}},{"name":"Magnum CI","constant":"MAGNUM","env":"MAGNUM"},{"name":"Netlify CI","constant":"NETLIFY","env":"NETLIFY_BUILD_BASE","pr":{"env":"PULL_REQUEST","ne":"false"}},{"name":"Sail CI","constant":"SAIL","env":"SAILCI","pr":"SAIL_PULL_REQUEST_NUMBER"},{"name":"Semaphore","constant":"SEMAPHORE","env":"SEMAPHORE","pr":"PULL_REQUEST_NUMBER"},{"name":"Shippable","constant":"SHIPPABLE","env":"SHIPPABLE","pr":{"IS_PULL_REQUEST":"true"}},{"name":"Solano CI","constant":"SOLANO","env":"TDDIUM","pr":"TDDIUM_PR_ID"},{"name":"Strider CD","constant":"STRIDER","env":"STRIDER"},{"name":"TaskCluster","constant":"TASKCLUSTER","env":["TASK_ID","RUN_ID"]},{"name":"TeamCity","constant":"TEAMCITY","env":"TEAMCITY_VERSION"},{"name":"Travis CI","constant":"TRAVIS","env":"TRAVIS","pr":{"env":"TRAVIS_PULL_REQUEST","ne":"false"}}]')},4163:e=>{"use strict";e.exports=JSON.parse('{"single":{"topLeft":"┌","topRight":"┐","bottomRight":"┘","bottomLeft":"└","vertical":"│","horizontal":"─"},"double":{"topLeft":"╔","topRight":"╗","bottomRight":"╝","bottomLeft":"╚","vertical":"║","horizontal":"═"},"round":{"topLeft":"╭","topRight":"╮","bottomRight":"╯","bottomLeft":"╰","vertical":"│","horizontal":"─"},"bold":{"topLeft":"┏","topRight":"┓","bottomRight":"┛","bottomLeft":"┗","vertical":"┃","horizontal":"━"},"singleDouble":{"topLeft":"╓","topRight":"╖","bottomRight":"╜","bottomLeft":"╙","vertical":"║","horizontal":"─"},"doubleSingle":{"topLeft":"╒","topRight":"╕","bottomRight":"╛","bottomLeft":"╘","vertical":"│","horizontal":"═"},"classic":{"topLeft":"+","topRight":"+","bottomRight":"+","bottomLeft":"+","vertical":"|","horizontal":"-"}}')},4097:(e,t,n)=>{"use strict";const r=n(4163);e.exports=r,e.exports.default=r},1696:(e,t,n)=>{"use strict";const r=n(3390);let i=!1;t.show=(e=process.stderr)=>{e.isTTY&&(i=!1,e.write("[?25h"))},t.hide=(e=process.stderr)=>{e.isTTY&&(r(),i=!0,e.write("[?25l"))},t.toggle=(e,n)=>{void 0!==e&&(i=e),i?t.show(n):t.hide(n)}},5301:(e,t,n)=>{"use strict";const r=n(1566),i=n(5043);function o(e,t,n){if(" "===e.charAt(t))return t;for(let r=1;r<=3;r++)if(n){if(" "===e.charAt(t+r))return t+r}else if(" "===e.charAt(t-r))return t-r;return t}e.exports=(e,t,n)=>{n={position:"end",preferTruncationOnSpace:!1,...n};const{position:u,space:a,preferTruncationOnSpace:l}=n;let s="…",c=1;if("string"!=typeof e)throw new TypeError("Expected `input` to be a string, got "+typeof e);if("number"!=typeof t)throw new TypeError("Expected `columns` to be a number, got "+typeof t);if(t<1)return"";if(1===t)return s;const f=i(e);if(f<=t)return e;if("start"===u){if(l){const n=o(e,f-t+1,!0);return s+r(e,n,f).trim()}return!0===a&&(s+=" ",c=2),s+r(e,f-t+c,f)}if("middle"===u){!0===a&&(s=" "+s+" ",c=3);const n=Math.floor(t/2);if(l){const i=o(e,n),u=o(e,f-(t-n)+1,!0);return r(e,0,i)+s+r(e,u,f).trim()}return r(e,0,n)+s+r(e,f-(t-n)+c,f)}if("end"===u){if(l){const n=o(e,t-1);return r(e,0,n)+s}return!0===a&&(s=" "+s,c=2),r(e,0,t-c)+s}throw new Error("Expected `options.position` to be either `start`, `middle` or `end`, got "+u)}},9908:(e,t,n)=>{"use strict";const r=n(3287);e.exports=(e,t,n)=>{if("string"!=typeof e)throw new TypeError("Source code is missing.");if(!t||t<1)throw new TypeError("Line number must start from `1`.");if(!(t>(e=r(e).split(/\r?\n/)).length))return((e,t)=>{const n=[],r=e+t;for(let i=e-t;i<=r;i++)n.push(i);return n})(t,(n={around:3,...n}).around).filter(t=>void 0!==e[t-1]).map(t=>({line:t,value:e[t-1]}))}},5311:(e,t,n)=>{const r=n(3300),i={};for(const e of Object.keys(r))i[r[e]]=e;const o={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};e.exports=o;for(const e of Object.keys(o)){if(!("channels"in o[e]))throw new Error("missing channels property: "+e);if(!("labels"in o[e]))throw new Error("missing channel labels property: "+e);if(o[e].labels.length!==o[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=o[e];delete o[e].channels,delete o[e].labels,Object.defineProperty(o[e],"channels",{value:t}),Object.defineProperty(o[e],"labels",{value:n})}o.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),o=Math.max(t,n,r),u=o-i;let a,l;o===i?a=0:t===o?a=(n-r)/u:n===o?a=2+(r-t)/u:r===o&&(a=4+(t-n)/u),a=Math.min(60*a,360),a<0&&(a+=360);const s=(i+o)/2;return l=o===i?0:s<=.5?u/(o+i):u/(2-o-i),[a,100*l,100*s]},o.rgb.hsv=function(e){let t,n,r,i,o;const u=e[0]/255,a=e[1]/255,l=e[2]/255,s=Math.max(u,a,l),c=s-Math.min(u,a,l),f=function(e){return(s-e)/6/c+.5};return 0===c?(i=0,o=0):(o=c/s,t=f(u),n=f(a),r=f(l),u===s?i=r-n:a===s?i=1/3+t-r:l===s&&(i=2/3+n-t),i<0?i+=1:i>1&&(i-=1)),[360*i,100*o,100*s]},o.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const i=o.rgb.hsl(e)[0],u=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[i,100*u,100*r]},o.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r);return[100*((1-t-i)/(1-i)||0),100*((1-n-i)/(1-i)||0),100*((1-r-i)/(1-i)||0),100*i]},o.rgb.keyword=function(e){const t=i[e];if(t)return t;let n,o=1/0;for(const t of Object.keys(r)){const i=r[t],l=(a=i,((u=e)[0]-a[0])**2+(u[1]-a[1])**2+(u[2]-a[2])**2);l.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;return[100*(.4124*t+.3576*n+.1805*r),100*(.2126*t+.7152*n+.0722*r),100*(.0193*t+.1192*n+.9505*r)]},o.rgb.lab=function(e){const t=o.rgb.xyz(e);let n=t[0],r=t[1],i=t[2];n/=95.047,r/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;return[116*r-16,500*(n-r),200*(r-i)]},o.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let i,o,u;if(0===n)return u=255*r,[u,u,u];i=r<.5?r*(1+n):r+n-r*n;const a=2*r-i,l=[0,0,0];for(let e=0;e<3;e++)o=t+1/3*-(e-1),o<0&&o++,o>1&&o--,u=6*o<1?a+6*(i-a)*o:2*o<1?i:3*o<2?a+(i-a)*(2/3-o)*6:a,l[e]=255*u;return l},o.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,i=n;const o=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=o<=1?o:2-o;return[t,100*(0===r?2*i/(o+i):2*n/(r+n)),100*((r+n)/2)]},o.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const i=Math.floor(t)%6,o=t-Math.floor(t),u=255*r*(1-n),a=255*r*(1-n*o),l=255*r*(1-n*(1-o));switch(r*=255,i){case 0:return[r,l,u];case 1:return[a,r,u];case 2:return[u,r,l];case 3:return[u,a,r];case 4:return[l,u,r];case 5:return[r,u,a]}},o.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01);let o,u;u=(2-n)*r;const a=(2-n)*i;return o=n*i,o/=a<=1?a:2-a,o=o||0,u/=2,[t,100*o,100*u]},o.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const i=n+r;let o;i>1&&(n/=i,r/=i);const u=Math.floor(6*t),a=1-r;o=6*t-u,0!=(1&u)&&(o=1-o);const l=n+o*(a-n);let s,c,f;switch(u){default:case 6:case 0:s=a,c=l,f=n;break;case 1:s=l,c=a,f=n;break;case 2:s=n,c=a,f=l;break;case 3:s=n,c=l,f=a;break;case 4:s=l,c=n,f=a;break;case 5:s=a,c=n,f=l}return[255*s,255*c,255*f]},o.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},o.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let i,o,u;return i=3.2406*t+-1.5372*n+-.4986*r,o=-.9689*t+1.8758*n+.0415*r,u=.0557*t+-.204*n+1.057*r,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,u=u>.0031308?1.055*u**(1/2.4)-.055:12.92*u,i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),u=Math.min(Math.max(0,u),1),[255*i,255*o,255*u]},o.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;return[116*n-16,500*(t-n),200*(n-r)]},o.lab.xyz=function(e){let t,n,r;n=(e[0]+16)/116,t=e[1]/500+n,r=n-e[2]/200;const i=n**3,o=t**3,u=r**3;return n=i>.008856?i:(n-16/116)/7.787,t=o>.008856?o:(t-16/116)/7.787,r=u>.008856?u:(r-16/116)/7.787,t*=95.047,n*=100,r*=108.883,[t,n,r]},o.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let i;i=360*Math.atan2(r,n)/2/Math.PI,i<0&&(i+=360);return[t,Math.sqrt(n*n+r*r),i]},o.lch.lab=function(e){const t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},o.rgb.ansi16=function(e,t=null){const[n,r,i]=e;let u=null===t?o.rgb.hsv(e)[2]:t;if(u=Math.round(u/50),0===u)return 30;let a=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return 2===u&&(a+=60),a},o.hsv.ansi16=function(e){return o.rgb.ansi16(o.hsv.rgb(e),e[2])},o.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];if(t===n&&n===r)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;return 16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},o.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},o.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;e-=16;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},o.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},o.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];3===t[0].length&&(n=n.split("").map(e=>e+e).join(""));const r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},o.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),o=Math.min(Math.min(t,n),r),u=i-o;let a,l;return a=u<1?o/(1-u):0,l=u<=0?0:i===t?(n-r)/u%6:i===n?2+(r-t)/u:4+(t-n)/u,l/=6,l%=1,[360*l,100*u,100*a]},o.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],100*r,100*i]},o.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},o.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(0===n)return[255*r,255*r,255*r];const i=[0,0,0],o=t%1*6,u=o%1,a=1-u;let l=0;switch(Math.floor(o)){case 0:i[0]=1,i[1]=u,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=u;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=u,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return l=(1-n)*r,[255*(n*i[0]+l),255*(n*i[1]+l),255*(n*i[2]+l)]},o.hcg.hsv=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);let r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},o.hcg.hsl=function(e){const t=e[1]/100,n=e[2]/100*(1-t)+.5*t;let r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},o.hcg.hwb=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},o.hwb.hcg=function(e){const t=e[1]/100,n=1-e[2]/100,r=n-t;let i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},o.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},o.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},o.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},o.gray.hsl=function(e){return[0,0,e[0]]},o.gray.hsv=o.gray.hsl,o.gray.hwb=function(e){return[0,100,e[0]]},o.gray.cmyk=function(e){return[0,0,0,e[0]]},o.gray.lab=function(e){return[e[0],0,0]},o.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},o.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},2744:(e,t,n)=>{const r=n(5311),i=n(8577),o={};Object.keys(r).forEach(e=>{o[e]={},Object.defineProperty(o[e],"channels",{value:r[e].channels}),Object.defineProperty(o[e],"labels",{value:r[e].labels});const t=i(e);Object.keys(t).forEach(n=>{const r=t[n];o[e][n]=function(e){const t=function(...t){const n=t[0];if(null==n)return n;n.length>1&&(t=n);const r=e(t);if("object"==typeof r)for(let e=r.length,t=0;t1&&(t=n),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(r)})}),e.exports=o},8577:(e,t,n)=>{const r=n(5311);function i(e){const t=function(){const e={},t=Object.keys(r);for(let n=t.length,r=0;r{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},3287:e=>{"use strict";e.exports=(e,t)=>e.replace(/^\t+/gm,e=>" ".repeat(e.length*(t||2)))},1013:e=>{"use strict";e.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}},8759:e=>{"use strict";const t=/[|\\{}()[\]^$+*?.-]/g;e.exports=e=>{if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(t,"\\$&")}},2918:e=>{"use strict";e.exports=(e,t=process.argv)=>{const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),i=t.indexOf("--");return-1!==r&&(-1===i||r{"use strict";e.exports=(e,t=1,n)=>{if(n={indent:" ",includeEmptyLines:!1,...n},"string"!=typeof e)throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if("number"!=typeof t)throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if("string"!=typeof n.indent)throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n.indent}\``);if(0===t)return e;const r=n.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(r,n.indent.repeat(t))}},2738:(e,t,n)=>{"use strict";e.exports=n(5864).isCI},7347:e=>{"use strict";const t=e=>!Number.isNaN(e)&&(e>=4352&&(e<=4447||9001===e||9002===e||11904<=e&&e<=12871&&12351!==e||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141));e.exports=t,e.exports.default=t},464:function(e,t,n){var r; +/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */e=n.nmd(e),function(){var i="Expected a function",o="__lodash_placeholder__",u=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],a="[object Arguments]",l="[object Array]",s="[object Boolean]",c="[object Date]",f="[object Error]",d="[object Function]",p="[object GeneratorFunction]",h="[object Map]",v="[object Number]",m="[object Object]",g="[object RegExp]",y="[object Set]",_="[object String]",b="[object Symbol]",w="[object WeakMap]",E="[object ArrayBuffer]",D="[object DataView]",S="[object Float32Array]",C="[object Float64Array]",k="[object Int8Array]",T="[object Int16Array]",x="[object Int32Array]",A="[object Uint8Array]",O="[object Uint16Array]",P="[object Uint32Array]",I=/\b__p \+= '';/g,N=/\b(__p \+=) '' \+/g,M=/(__e\(.*?\)|\b__t\)) \+\n'';/g,R=/&(?:amp|lt|gt|quot|#39);/g,F=/[&<>"']/g,L=RegExp(R.source),B=RegExp(F.source),j=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,z=/<%=([\s\S]+?)%>/g,W=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,H=/^\w*$/,V=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,q=/[\\^$.*+?()[\]{}|]/g,G=RegExp(q.source),$=/^\s+|\s+$/g,Y=/^\s+/,K=/\s+$/,X=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Q=/\{\n\/\* \[wrapped with (.+)\] \*/,J=/,? & /,Z=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ee=/\\(\\)?/g,te=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ne=/\w*$/,re=/^[-+]0x[0-9a-f]+$/i,ie=/^0b[01]+$/i,oe=/^\[object .+?Constructor\]$/,ue=/^0o[0-7]+$/i,ae=/^(?:0|[1-9]\d*)$/,le=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,se=/($^)/,ce=/['\n\r\u2028\u2029\\]/g,fe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pe="[\\ud800-\\udfff]",he="["+de+"]",ve="["+fe+"]",me="\\d+",ge="[\\u2700-\\u27bf]",ye="[a-z\\xdf-\\xf6\\xf8-\\xff]",_e="[^\\ud800-\\udfff"+de+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",be="\\ud83c[\\udffb-\\udfff]",we="[^\\ud800-\\udfff]",Ee="(?:\\ud83c[\\udde6-\\uddff]){2}",De="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Ce="(?:"+ye+"|"+_e+")",ke="(?:"+Se+"|"+_e+")",Te="(?:"+ve+"|"+be+")"+"?",xe="[\\ufe0e\\ufe0f]?"+Te+("(?:\\u200d(?:"+[we,Ee,De].join("|")+")[\\ufe0e\\ufe0f]?"+Te+")*"),Ae="(?:"+[ge,Ee,De].join("|")+")"+xe,Oe="(?:"+[we+ve+"?",ve,Ee,De,pe].join("|")+")",Pe=RegExp("['’]","g"),Ie=RegExp(ve,"g"),Ne=RegExp(be+"(?="+be+")|"+Oe+xe,"g"),Me=RegExp([Se+"?"+ye+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[he,Se,"$"].join("|")+")",ke+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[he,Se+Ce,"$"].join("|")+")",Se+"?"+Ce+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Se+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",me,Ae].join("|"),"g"),Re=RegExp("[\\u200d\\ud800-\\udfff"+fe+"\\ufe0e\\ufe0f]"),Fe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Le=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Be=-1,je={};je[S]=je[C]=je[k]=je[T]=je[x]=je[A]=je["[object Uint8ClampedArray]"]=je[O]=je[P]=!0,je[a]=je[l]=je[E]=je[s]=je[D]=je[c]=je[f]=je[d]=je[h]=je[v]=je[m]=je[g]=je[y]=je[_]=je[w]=!1;var Ue={};Ue[a]=Ue[l]=Ue[E]=Ue[D]=Ue[s]=Ue[c]=Ue[S]=Ue[C]=Ue[k]=Ue[T]=Ue[x]=Ue[h]=Ue[v]=Ue[m]=Ue[g]=Ue[y]=Ue[_]=Ue[b]=Ue[A]=Ue["[object Uint8ClampedArray]"]=Ue[O]=Ue[P]=!0,Ue[f]=Ue[d]=Ue[w]=!1;var ze={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},We=parseFloat,He=parseInt,Ve="object"==typeof global&&global&&global.Object===Object&&global,qe="object"==typeof self&&self&&self.Object===Object&&self,Ge=Ve||qe||Function("return this")(),$e=t&&!t.nodeType&&t,Ye=$e&&e&&!e.nodeType&&e,Ke=Ye&&Ye.exports===$e,Xe=Ke&&Ve.process,Qe=function(){try{var e=Ye&&Ye.require&&Ye.require("util").types;return e||Xe&&Xe.binding&&Xe.binding("util")}catch(e){}}(),Je=Qe&&Qe.isArrayBuffer,Ze=Qe&&Qe.isDate,et=Qe&&Qe.isMap,tt=Qe&&Qe.isRegExp,nt=Qe&&Qe.isSet,rt=Qe&&Qe.isTypedArray;function it(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function ot(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i-1}function ft(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function Nt(e,t){for(var n=e.length;n--&&bt(t,e[n],0)>-1;);return n}function Mt(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var Rt=Ct({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Ft=Ct({"&":"&","<":"<",">":">",'"':""","'":"'"});function Lt(e){return"\\"+ze[e]}function Bt(e){return Re.test(e)}function jt(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Ut(e,t){return function(n){return e(t(n))}}function zt(e,t){for(var n=-1,r=e.length,i=0,u=[];++n",""":'"',"'":"'"});var $t=function e(t){var n,r=(t=null==t?Ge:$t.defaults(Ge.Object(),t,$t.pick(Ge,Le))).Array,fe=t.Date,de=t.Error,pe=t.Function,he=t.Math,ve=t.Object,me=t.RegExp,ge=t.String,ye=t.TypeError,_e=r.prototype,be=pe.prototype,we=ve.prototype,Ee=t["__core-js_shared__"],De=be.toString,Se=we.hasOwnProperty,Ce=0,ke=(n=/[^.]+$/.exec(Ee&&Ee.keys&&Ee.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Te=we.toString,xe=De.call(ve),Ae=Ge._,Oe=me("^"+De.call(Se).replace(q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ne=Ke?t.Buffer:void 0,Re=t.Symbol,ze=t.Uint8Array,Ve=Ne?Ne.allocUnsafe:void 0,qe=Ut(ve.getPrototypeOf,ve),$e=ve.create,Ye=we.propertyIsEnumerable,Xe=_e.splice,Qe=Re?Re.isConcatSpreadable:void 0,gt=Re?Re.iterator:void 0,Ct=Re?Re.toStringTag:void 0,Yt=function(){try{var e=Zi(ve,"defineProperty");return e({},"",{}),e}catch(e){}}(),Kt=t.clearTimeout!==Ge.clearTimeout&&t.clearTimeout,Xt=fe&&fe.now!==Ge.Date.now&&fe.now,Qt=t.setTimeout!==Ge.setTimeout&&t.setTimeout,Jt=he.ceil,Zt=he.floor,en=ve.getOwnPropertySymbols,tn=Ne?Ne.isBuffer:void 0,nn=t.isFinite,rn=_e.join,on=Ut(ve.keys,ve),un=he.max,an=he.min,ln=fe.now,sn=t.parseInt,cn=he.random,fn=_e.reverse,dn=Zi(t,"DataView"),pn=Zi(t,"Map"),hn=Zi(t,"Promise"),vn=Zi(t,"Set"),mn=Zi(t,"WeakMap"),gn=Zi(ve,"create"),yn=mn&&new mn,_n={},bn=To(dn),wn=To(pn),En=To(hn),Dn=To(vn),Sn=To(mn),Cn=Re?Re.prototype:void 0,kn=Cn?Cn.valueOf:void 0,Tn=Cn?Cn.toString:void 0;function xn(e){if(Vu(e)&&!Nu(e)&&!(e instanceof In)){if(e instanceof Pn)return e;if(Se.call(e,"__wrapped__"))return xo(e)}return new Pn(e)}var An=function(){function e(){}return function(t){if(!Hu(t))return{};if($e)return $e(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function On(){}function Pn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function In(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Nn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function Xn(e,t,n,r,i,o){var u,l=1&t,f=2&t,w=4&t;if(n&&(u=i?n(e,r,i,o):n(e)),void 0!==u)return u;if(!Hu(e))return e;var I=Nu(e);if(I){if(u=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Se.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return gi(e,u)}else{var N=no(e),M=N==d||N==p;if(Lu(e))return fi(e,l);if(N==m||N==a||M&&!i){if(u=f||M?{}:io(e),!l)return f?function(e,t){return yi(e,to(e),t)}(e,function(e,t){return e&&yi(t,wa(t),e)}(u,e)):function(e,t){return yi(e,eo(e),t)}(e,Gn(u,e))}else{if(!Ue[N])return i?e:{};u=function(e,t,n){var r=e.constructor;switch(t){case E:return di(e);case s:case c:return new r(+e);case D:return function(e,t){var n=t?di(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case S:case C:case k:case T:case x:case A:case"[object Uint8ClampedArray]":case O:case P:return pi(e,n);case h:return new r;case v:case _:return new r(e);case g:return function(e){var t=new e.constructor(e.source,ne.exec(e));return t.lastIndex=e.lastIndex,t}(e);case y:return new r;case b:return i=e,kn?ve(kn.call(i)):{}}var i}(e,N,l)}}o||(o=new Ln);var R=o.get(e);if(R)return R;o.set(e,u),Ku(e)?e.forEach((function(r){u.add(Xn(r,t,n,r,e,o))})):qu(e)&&e.forEach((function(r,i){u.set(i,Xn(r,t,n,i,e,o))}));var F=I?void 0:(w?f?Gi:qi:f?wa:ba)(e);return ut(F||e,(function(r,i){F&&(r=e[i=r]),Hn(u,i,Xn(r,t,n,i,e,o))})),u}function Qn(e,t,n){var r=n.length;if(null==e)return!r;for(e=ve(e);r--;){var i=n[r],o=t[i],u=e[i];if(void 0===u&&!(i in e)||!o(u))return!1}return!0}function Jn(e,t,n){if("function"!=typeof e)throw new ye(i);return bo((function(){e.apply(void 0,n)}),t)}function Zn(e,t,n,r){var i=-1,o=ct,u=!0,a=e.length,l=[],s=t.length;if(!a)return l;n&&(t=dt(t,At(n))),r?(o=ft,u=!1):t.length>=200&&(o=Pt,u=!1,t=new Fn(t));e:for(;++i-1},Mn.prototype.set=function(e,t){var n=this.__data__,r=Vn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Rn.prototype.clear=function(){this.size=0,this.__data__={hash:new Nn,map:new(pn||Mn),string:new Nn}},Rn.prototype.delete=function(e){var t=Qi(this,e).delete(e);return this.size-=t?1:0,t},Rn.prototype.get=function(e){return Qi(this,e).get(e)},Rn.prototype.has=function(e){return Qi(this,e).has(e)},Rn.prototype.set=function(e,t){var n=Qi(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Fn.prototype.add=Fn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Fn.prototype.has=function(e){return this.__data__.has(e)},Ln.prototype.clear=function(){this.__data__=new Mn,this.size=0},Ln.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Ln.prototype.get=function(e){return this.__data__.get(e)},Ln.prototype.has=function(e){return this.__data__.has(e)},Ln.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Mn){var r=n.__data__;if(!pn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Rn(r)}return n.set(e,t),this.size=n.size,this};var er=wi(lr),tr=wi(sr,!0);function nr(e,t){var n=!0;return er(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function rr(e,t,n){for(var r=-1,i=e.length;++r0&&n(a)?t>1?or(a,t-1,n,r,i):pt(i,a):r||(i[i.length]=a)}return i}var ur=Ei(),ar=Ei(!0);function lr(e,t){return e&&ur(e,t,ba)}function sr(e,t){return e&&ar(e,t,ba)}function cr(e,t){return st(t,(function(t){return Uu(e[t])}))}function fr(e,t){for(var n=0,r=(t=ai(t,e)).length;null!=e&&nt}function vr(e,t){return null!=e&&Se.call(e,t)}function mr(e,t){return null!=e&&t in ve(e)}function gr(e,t,n){for(var i=n?ft:ct,o=e[0].length,u=e.length,a=u,l=r(u),s=1/0,c=[];a--;){var f=e[a];a&&t&&(f=dt(f,At(t))),s=an(f.length,s),l[a]=!n&&(t||o>=120&&f.length>=120)?new Fn(a&&f):void 0}f=e[0];var d=-1,p=l[0];e:for(;++d=a)return l;var s=n[r];return l*("desc"==s?-1:1)}}return e.index-t.index}(e,t,n)}))}function Nr(e,t,n){for(var r=-1,i=t.length,o={};++r-1;)a!==e&&Xe.call(a,l,1),Xe.call(e,l,1);return e}function Rr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;uo(i)?Xe.call(e,i,1):Zr(e,i)}}return e}function Fr(e,t){return e+Zt(cn()*(t-e+1))}function Lr(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Zt(t/2))&&(e+=e)}while(t);return n}function Br(e,t){return wo(vo(e,t,Ga),e+"")}function jr(e){return jn(Aa(e))}function Ur(e,t){var n=Aa(e);return So(n,Kn(t,0,n.length))}function zr(e,t,n,r){if(!Hu(e))return e;for(var i=-1,o=(t=ai(t,e)).length,u=o-1,a=e;null!=a&&++io?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var u=r(o);++i>>1,u=e[o];null!==u&&!Qu(u)&&(n?u<=t:u=200){var s=t?null:Li(e);if(s)return Wt(s);u=!1,i=Pt,l=new Fn}else l=t?[]:a;e:for(;++r=r?e:qr(e,t,n)}var ci=Kt||function(e){return Ge.clearTimeout(e)};function fi(e,t){if(t)return e.slice();var n=e.length,r=Ve?Ve(n):new e.constructor(n);return e.copy(r),r}function di(e){var t=new e.constructor(e.byteLength);return new ze(t).set(new ze(e)),t}function pi(e,t){var n=t?di(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function hi(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=e==e,o=Qu(e),u=void 0!==t,a=null===t,l=t==t,s=Qu(t);if(!a&&!s&&!o&&e>t||o&&u&&l&&!a&&!s||r&&u&&l||!n&&l||!i)return 1;if(!r&&!o&&!s&&e1?n[i-1]:void 0,u=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,u&&ao(n[0],n[1],u)&&(o=i<3?void 0:o,i=1),t=ve(t);++r-1?i[o?t[u]:u]:void 0}}function Ti(e){return Vi((function(t){var n=t.length,r=n,o=Pn.prototype.thru;for(e&&t.reverse();r--;){var u=t[r];if("function"!=typeof u)throw new ye(i);if(o&&!a&&"wrapper"==Yi(u))var a=new Pn([],!0)}for(r=a?r:n;++r1&&_.reverse(),f&&sa))return!1;var s=o.get(e),c=o.get(t);if(s&&c)return s==t&&c==e;var f=-1,d=!0,p=2&n?new Fn:void 0;for(o.set(e,t),o.set(t,e);++f-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(X,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return ut(u,(function(n){var r="_."+n[0];t&n[1]&&!ct(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(Q);return t?t[1].split(J):[]}(r),n)))}function Do(e){var t=0,n=0;return function(){var r=ln(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function So(e,t){var n=-1,r=e.length,i=r-1;for(t=void 0===t?r:t;++n1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Yo(e,n)}));function tu(e){var t=xn(e);return t.__chain__=!0,t}function nu(e,t){return t(e)}var ru=Vi((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,i=function(t){return Yn(t,e)};return!(t>1||this.__actions__.length)&&r instanceof In&&uo(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:nu,args:[i],thisArg:void 0}),new Pn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(void 0),e}))):this.thru(i)}));var iu=_i((function(e,t,n){Se.call(e,n)?++e[n]:$n(e,n,1)}));var ou=ki(Io),uu=ki(No);function au(e,t){return(Nu(e)?ut:er)(e,Xi(t,3))}function lu(e,t){return(Nu(e)?at:tr)(e,Xi(t,3))}var su=_i((function(e,t,n){Se.call(e,n)?e[n].push(t):$n(e,n,[t])}));var cu=Br((function(e,t,n){var i=-1,o="function"==typeof t,u=Ru(e)?r(e.length):[];return er(e,(function(e){u[++i]=o?it(t,e,n):yr(e,t,n)})),u})),fu=_i((function(e,t,n){$n(e,n,t)}));function du(e,t){return(Nu(e)?dt:Tr)(e,Xi(t,3))}var pu=_i((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var hu=Br((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ao(e,t[0],t[1])?t=[]:n>2&&ao(t[0],t[1],t[2])&&(t=[t[0]]),Ir(e,or(t,1),[])})),vu=Xt||function(){return Ge.Date.now()};function mu(e,t,n){return t=n?void 0:t,ji(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function gu(e,t){var n;if("function"!=typeof t)throw new ye(i);return e=ra(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var yu=Br((function(e,t,n){var r=1;if(n.length){var i=zt(n,Ki(yu));r|=32}return ji(e,r,t,n,i)})),_u=Br((function(e,t,n){var r=3;if(n.length){var i=zt(n,Ki(_u));r|=32}return ji(t,r,e,n,i)}));function bu(e,t,n){var r,o,u,a,l,s,c=0,f=!1,d=!1,p=!0;if("function"!=typeof e)throw new ye(i);function h(t){var n=r,i=o;return r=o=void 0,c=t,a=e.apply(i,n)}function v(e){return c=e,l=bo(g,t),f?h(e):a}function m(e){var n=e-s;return void 0===s||n>=t||n<0||d&&e-c>=u}function g(){var e=vu();if(m(e))return y(e);l=bo(g,function(e){var n=t-(e-s);return d?an(n,u-(e-c)):n}(e))}function y(e){return l=void 0,p&&r?h(e):(r=o=void 0,a)}function _(){var e=vu(),n=m(e);if(r=arguments,o=this,s=e,n){if(void 0===l)return v(s);if(d)return ci(l),l=bo(g,t),h(s)}return void 0===l&&(l=bo(g,t)),a}return t=oa(t)||0,Hu(n)&&(f=!!n.leading,u=(d="maxWait"in n)?un(oa(n.maxWait)||0,t):u,p="trailing"in n?!!n.trailing:p),_.cancel=function(){void 0!==l&&ci(l),c=0,r=s=o=l=void 0},_.flush=function(){return void 0===l?a:y(vu())},_}var wu=Br((function(e,t){return Jn(e,1,t)})),Eu=Br((function(e,t,n){return Jn(e,oa(t)||0,n)}));function Du(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ye(i);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var u=e.apply(this,r);return n.cache=o.set(i,u)||o,u};return n.cache=new(Du.Cache||Rn),n}function Su(e){if("function"!=typeof e)throw new ye(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Du.Cache=Rn;var Cu=li((function(e,t){var n=(t=1==t.length&&Nu(t[0])?dt(t[0],At(Xi())):dt(or(t,1),At(Xi()))).length;return Br((function(r){for(var i=-1,o=an(r.length,n);++i=t})),Iu=_r(function(){return arguments}())?_r:function(e){return Vu(e)&&Se.call(e,"callee")&&!Ye.call(e,"callee")},Nu=r.isArray,Mu=Je?At(Je):function(e){return Vu(e)&&pr(e)==E};function Ru(e){return null!=e&&Wu(e.length)&&!Uu(e)}function Fu(e){return Vu(e)&&Ru(e)}var Lu=tn||ol,Bu=Ze?At(Ze):function(e){return Vu(e)&&pr(e)==c};function ju(e){if(!Vu(e))return!1;var t=pr(e);return t==f||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!$u(e)}function Uu(e){if(!Hu(e))return!1;var t=pr(e);return t==d||t==p||"[object AsyncFunction]"==t||"[object Proxy]"==t}function zu(e){return"number"==typeof e&&e==ra(e)}function Wu(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Hu(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Vu(e){return null!=e&&"object"==typeof e}var qu=et?At(et):function(e){return Vu(e)&&no(e)==h};function Gu(e){return"number"==typeof e||Vu(e)&&pr(e)==v}function $u(e){if(!Vu(e)||pr(e)!=m)return!1;var t=qe(e);if(null===t)return!0;var n=Se.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&De.call(n)==xe}var Yu=tt?At(tt):function(e){return Vu(e)&&pr(e)==g};var Ku=nt?At(nt):function(e){return Vu(e)&&no(e)==y};function Xu(e){return"string"==typeof e||!Nu(e)&&Vu(e)&&pr(e)==_}function Qu(e){return"symbol"==typeof e||Vu(e)&&pr(e)==b}var Ju=rt?At(rt):function(e){return Vu(e)&&Wu(e.length)&&!!je[pr(e)]};var Zu=Mi(kr),ea=Mi((function(e,t){return e<=t}));function ta(e){if(!e)return[];if(Ru(e))return Xu(e)?qt(e):gi(e);if(gt&&e[gt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[gt]());var t=no(e);return(t==h?jt:t==y?Wt:Aa)(e)}function na(e){return e?(e=oa(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ra(e){var t=na(e),n=t%1;return t==t?n?t-n:t:0}function ia(e){return e?Kn(ra(e),0,4294967295):0}function oa(e){if("number"==typeof e)return e;if(Qu(e))return NaN;if(Hu(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Hu(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace($,"");var n=ie.test(e);return n||ue.test(e)?He(e.slice(2),n?2:8):re.test(e)?NaN:+e}function ua(e){return yi(e,wa(e))}function aa(e){return null==e?"":Qr(e)}var la=bi((function(e,t){if(fo(t)||Ru(t))yi(t,ba(t),e);else for(var n in t)Se.call(t,n)&&Hn(e,n,t[n])})),sa=bi((function(e,t){yi(t,wa(t),e)})),ca=bi((function(e,t,n,r){yi(t,wa(t),e,r)})),fa=bi((function(e,t,n,r){yi(t,ba(t),e,r)})),da=Vi(Yn);var pa=Br((function(e,t){e=ve(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&ao(t[0],t[1],i)&&(r=1);++n1),t})),yi(e,Gi(e),n),r&&(n=Xn(n,7,Wi));for(var i=t.length;i--;)Zr(n,t[i]);return n}));var Ca=Vi((function(e,t){return null==e?{}:function(e,t){return Nr(e,t,(function(t,n){return ma(e,n)}))}(e,t)}));function ka(e,t){if(null==e)return{};var n=dt(Gi(e),(function(e){return[e]}));return t=Xi(t),Nr(e,n,(function(e,n){return t(e,n[0])}))}var Ta=Bi(ba),xa=Bi(wa);function Aa(e){return null==e?[]:Ot(e,ba(e))}var Oa=Si((function(e,t,n){return t=t.toLowerCase(),e+(n?Pa(t):t)}));function Pa(e){return ja(aa(e).toLowerCase())}function Ia(e){return(e=aa(e))&&e.replace(le,Rt).replace(Ie,"")}var Na=Si((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Ma=Si((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Ra=Di("toLowerCase");var Fa=Si((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var La=Si((function(e,t,n){return e+(n?" ":"")+ja(t)}));var Ba=Si((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),ja=Di("toUpperCase");function Ua(e,t,n){return e=aa(e),void 0===(t=n?void 0:t)?function(e){return Fe.test(e)}(e)?function(e){return e.match(Me)||[]}(e):function(e){return e.match(Z)||[]}(e):e.match(t)||[]}var za=Br((function(e,t){try{return it(e,void 0,t)}catch(e){return ju(e)?e:new de(e)}})),Wa=Vi((function(e,t){return ut(t,(function(t){t=ko(t),$n(e,t,yu(e[t],e))})),e}));function Ha(e){return function(){return e}}var Va=Ti(),qa=Ti(!0);function Ga(e){return e}function $a(e){return Dr("function"==typeof e?e:Xn(e,1))}var Ya=Br((function(e,t){return function(n){return yr(n,e,t)}})),Ka=Br((function(e,t){return function(n){return yr(e,n,t)}}));function Xa(e,t,n){var r=ba(t),i=cr(t,r);null!=n||Hu(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=cr(t,ba(t)));var o=!(Hu(n)&&"chain"in n&&!n.chain),u=Uu(e);return ut(i,(function(n){var r=t[n];e[n]=r,u&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=gi(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,pt([this.value()],arguments))})})),e}function Qa(){}var Ja=Pi(dt),Za=Pi(lt),el=Pi(mt);function tl(e){return lo(e)?St(ko(e)):function(e){return function(t){return fr(t,e)}}(e)}var nl=Ni(),rl=Ni(!0);function il(){return[]}function ol(){return!1}var ul=Oi((function(e,t){return e+t}),0),al=Fi("ceil"),ll=Oi((function(e,t){return e/t}),1),sl=Fi("floor");var cl,fl=Oi((function(e,t){return e*t}),1),dl=Fi("round"),pl=Oi((function(e,t){return e-t}),0);return xn.after=function(e,t){if("function"!=typeof t)throw new ye(i);return e=ra(e),function(){if(--e<1)return t.apply(this,arguments)}},xn.ary=mu,xn.assign=la,xn.assignIn=sa,xn.assignInWith=ca,xn.assignWith=fa,xn.at=da,xn.before=gu,xn.bind=yu,xn.bindAll=Wa,xn.bindKey=_u,xn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Nu(e)?e:[e]},xn.chain=tu,xn.chunk=function(e,t,n){t=(n?ao(e,t,n):void 0===t)?1:un(ra(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,u=0,a=r(Jt(i/t));oi?0:i+n),(r=void 0===r||r>i?i:ra(r))<0&&(r+=i),r=n>r?0:ia(r);n>>0)?(e=aa(e))&&("string"==typeof t||null!=t&&!Yu(t))&&!(t=Qr(t))&&Bt(e)?si(qt(e),0,n):e.split(t,n):[]},xn.spread=function(e,t){if("function"!=typeof e)throw new ye(i);return t=null==t?0:un(ra(t),0),Br((function(n){var r=n[t],i=si(n,0,t);return r&&pt(i,r),it(e,this,i)}))},xn.tail=function(e){var t=null==e?0:e.length;return t?qr(e,1,t):[]},xn.take=function(e,t,n){return e&&e.length?qr(e,0,(t=n||void 0===t?1:ra(t))<0?0:t):[]},xn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?qr(e,(t=r-(t=n||void 0===t?1:ra(t)))<0?0:t,r):[]},xn.takeRightWhile=function(e,t){return e&&e.length?ti(e,Xi(t,3),!1,!0):[]},xn.takeWhile=function(e,t){return e&&e.length?ti(e,Xi(t,3)):[]},xn.tap=function(e,t){return t(e),e},xn.throttle=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new ye(i);return Hu(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),bu(e,t,{leading:r,maxWait:t,trailing:o})},xn.thru=nu,xn.toArray=ta,xn.toPairs=Ta,xn.toPairsIn=xa,xn.toPath=function(e){return Nu(e)?dt(e,ko):Qu(e)?[e]:gi(Co(aa(e)))},xn.toPlainObject=ua,xn.transform=function(e,t,n){var r=Nu(e),i=r||Lu(e)||Ju(e);if(t=Xi(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Hu(e)&&Uu(o)?An(qe(e)):{}}return(i?ut:lr)(e,(function(e,r,i){return t(n,e,r,i)})),n},xn.unary=function(e){return mu(e,1)},xn.union=Vo,xn.unionBy=qo,xn.unionWith=Go,xn.uniq=function(e){return e&&e.length?Jr(e):[]},xn.uniqBy=function(e,t){return e&&e.length?Jr(e,Xi(t,2)):[]},xn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Jr(e,void 0,t):[]},xn.unset=function(e,t){return null==e||Zr(e,t)},xn.unzip=$o,xn.unzipWith=Yo,xn.update=function(e,t,n){return null==e?e:ei(e,t,ui(n))},xn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:ei(e,t,ui(n),r)},xn.values=Aa,xn.valuesIn=function(e){return null==e?[]:Ot(e,wa(e))},xn.without=Ko,xn.words=Ua,xn.wrap=function(e,t){return ku(ui(t),e)},xn.xor=Xo,xn.xorBy=Qo,xn.xorWith=Jo,xn.zip=Zo,xn.zipObject=function(e,t){return ii(e||[],t||[],Hn)},xn.zipObjectDeep=function(e,t){return ii(e||[],t||[],zr)},xn.zipWith=eu,xn.entries=Ta,xn.entriesIn=xa,xn.extend=sa,xn.extendWith=ca,Xa(xn,xn),xn.add=ul,xn.attempt=za,xn.camelCase=Oa,xn.capitalize=Pa,xn.ceil=al,xn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=oa(n))==n?n:0),void 0!==t&&(t=(t=oa(t))==t?t:0),Kn(oa(e),t,n)},xn.clone=function(e){return Xn(e,4)},xn.cloneDeep=function(e){return Xn(e,5)},xn.cloneDeepWith=function(e,t){return Xn(e,5,t="function"==typeof t?t:void 0)},xn.cloneWith=function(e,t){return Xn(e,4,t="function"==typeof t?t:void 0)},xn.conformsTo=function(e,t){return null==t||Qn(e,t,ba(t))},xn.deburr=Ia,xn.defaultTo=function(e,t){return null==e||e!=e?t:e},xn.divide=ll,xn.endsWith=function(e,t,n){e=aa(e),t=Qr(t);var r=e.length,i=n=void 0===n?r:Kn(ra(n),0,r);return(n-=t.length)>=0&&e.slice(n,i)==t},xn.eq=Au,xn.escape=function(e){return(e=aa(e))&&B.test(e)?e.replace(F,Ft):e},xn.escapeRegExp=function(e){return(e=aa(e))&&G.test(e)?e.replace(q,"\\$&"):e},xn.every=function(e,t,n){var r=Nu(e)?lt:nr;return n&&ao(e,t,n)&&(t=void 0),r(e,Xi(t,3))},xn.find=ou,xn.findIndex=Io,xn.findKey=function(e,t){return yt(e,Xi(t,3),lr)},xn.findLast=uu,xn.findLastIndex=No,xn.findLastKey=function(e,t){return yt(e,Xi(t,3),sr)},xn.floor=sl,xn.forEach=au,xn.forEachRight=lu,xn.forIn=function(e,t){return null==e?e:ur(e,Xi(t,3),wa)},xn.forInRight=function(e,t){return null==e?e:ar(e,Xi(t,3),wa)},xn.forOwn=function(e,t){return e&&lr(e,Xi(t,3))},xn.forOwnRight=function(e,t){return e&&sr(e,Xi(t,3))},xn.get=va,xn.gt=Ou,xn.gte=Pu,xn.has=function(e,t){return null!=e&&ro(e,t,vr)},xn.hasIn=ma,xn.head=Ro,xn.identity=Ga,xn.includes=function(e,t,n,r){e=Ru(e)?e:Aa(e),n=n&&!r?ra(n):0;var i=e.length;return n<0&&(n=un(i+n,0)),Xu(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&bt(e,t,n)>-1},xn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:ra(n);return i<0&&(i=un(r+i,0)),bt(e,t,i)},xn.inRange=function(e,t,n){return t=na(t),void 0===n?(n=t,t=0):n=na(n),function(e,t,n){return e>=an(t,n)&&e=-9007199254740991&&e<=9007199254740991},xn.isSet=Ku,xn.isString=Xu,xn.isSymbol=Qu,xn.isTypedArray=Ju,xn.isUndefined=function(e){return void 0===e},xn.isWeakMap=function(e){return Vu(e)&&no(e)==w},xn.isWeakSet=function(e){return Vu(e)&&"[object WeakSet]"==pr(e)},xn.join=function(e,t){return null==e?"":rn.call(e,t)},xn.kebabCase=Na,xn.last=jo,xn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=ra(n))<0?un(r+i,0):an(i,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):_t(e,Et,i,!0)},xn.lowerCase=Ma,xn.lowerFirst=Ra,xn.lt=Zu,xn.lte=ea,xn.max=function(e){return e&&e.length?rr(e,Ga,hr):void 0},xn.maxBy=function(e,t){return e&&e.length?rr(e,Xi(t,2),hr):void 0},xn.mean=function(e){return Dt(e,Ga)},xn.meanBy=function(e,t){return Dt(e,Xi(t,2))},xn.min=function(e){return e&&e.length?rr(e,Ga,kr):void 0},xn.minBy=function(e,t){return e&&e.length?rr(e,Xi(t,2),kr):void 0},xn.stubArray=il,xn.stubFalse=ol,xn.stubObject=function(){return{}},xn.stubString=function(){return""},xn.stubTrue=function(){return!0},xn.multiply=fl,xn.nth=function(e,t){return e&&e.length?Pr(e,ra(t)):void 0},xn.noConflict=function(){return Ge._===this&&(Ge._=Ae),this},xn.noop=Qa,xn.now=vu,xn.pad=function(e,t,n){e=aa(e);var r=(t=ra(t))?Vt(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Ii(Zt(i),n)+e+Ii(Jt(i),n)},xn.padEnd=function(e,t,n){e=aa(e);var r=(t=ra(t))?Vt(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var i=cn();return an(e+i*(t-e+We("1e-"+((i+"").length-1))),t)}return Fr(e,t)},xn.reduce=function(e,t,n){var r=Nu(e)?ht:kt,i=arguments.length<3;return r(e,Xi(t,4),n,i,er)},xn.reduceRight=function(e,t,n){var r=Nu(e)?vt:kt,i=arguments.length<3;return r(e,Xi(t,4),n,i,tr)},xn.repeat=function(e,t,n){return t=(n?ao(e,t,n):void 0===t)?1:ra(t),Lr(aa(e),t)},xn.replace=function(){var e=arguments,t=aa(e[0]);return e.length<3?t:t.replace(e[1],e[2])},xn.result=function(e,t,n){var r=-1,i=(t=ai(t,e)).length;for(i||(i=1,e=void 0);++r9007199254740991)return[];var n=4294967295,r=an(e,4294967295);e-=4294967295;for(var i=xt(r,t=Xi(t));++n=o)return e;var a=n-Vt(r);if(a<1)return r;var l=u?si(u,0,a).join(""):e.slice(0,a);if(void 0===i)return l+r;if(u&&(a+=l.length-a),Yu(i)){if(e.slice(a).search(i)){var s,c=l;for(i.global||(i=me(i.source,aa(ne.exec(i))+"g")),i.lastIndex=0;s=i.exec(c);)var f=s.index;l=l.slice(0,void 0===f?a:f)}}else if(e.indexOf(Qr(i),a)!=a){var d=l.lastIndexOf(i);d>-1&&(l=l.slice(0,d))}return l+r},xn.unescape=function(e){return(e=aa(e))&&L.test(e)?e.replace(R,Gt):e},xn.uniqueId=function(e){var t=++Ce;return aa(e)+t},xn.upperCase=Ba,xn.upperFirst=ja,xn.each=au,xn.eachRight=lu,xn.first=Ro,Xa(xn,(cl={},lr(xn,(function(e,t){Se.call(xn.prototype,t)||(cl[t]=e)})),cl),{chain:!1}),xn.VERSION="4.17.20",ut(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){xn[e].placeholder=xn})),ut(["drop","take"],(function(e,t){In.prototype[e]=function(n){n=void 0===n?1:un(ra(n),0);var r=this.__filtered__&&!t?new In(this):this.clone();return r.__filtered__?r.__takeCount__=an(n,r.__takeCount__):r.__views__.push({size:an(n,4294967295),type:e+(r.__dir__<0?"Right":"")}),r},In.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),ut(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;In.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Xi(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),ut(["head","last"],(function(e,t){var n="take"+(t?"Right":"");In.prototype[e]=function(){return this[n](1).value()[0]}})),ut(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");In.prototype[e]=function(){return this.__filtered__?new In(this):this[n](1)}})),In.prototype.compact=function(){return this.filter(Ga)},In.prototype.find=function(e){return this.filter(e).head()},In.prototype.findLast=function(e){return this.reverse().find(e)},In.prototype.invokeMap=Br((function(e,t){return"function"==typeof e?new In(this):this.map((function(n){return yr(n,e,t)}))})),In.prototype.reject=function(e){return this.filter(Su(Xi(e)))},In.prototype.slice=function(e,t){e=ra(e);var n=this;return n.__filtered__&&(e>0||t<0)?new In(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=ra(t))<0?n.dropRight(-t):n.take(t-e)),n)},In.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},In.prototype.toArray=function(){return this.take(4294967295)},lr(In.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=xn[r?"take"+("last"==t?"Right":""):t],o=r||/^find/.test(t);i&&(xn.prototype[t]=function(){var t=this.__wrapped__,u=r?[1]:arguments,a=t instanceof In,l=u[0],s=a||Nu(t),c=function(e){var t=i.apply(xn,pt([e],u));return r&&f?t[0]:t};s&&n&&"function"==typeof l&&1!=l.length&&(a=s=!1);var f=this.__chain__,d=!!this.__actions__.length,p=o&&!f,h=a&&!d;if(!o&&s){t=h?t:new In(this);var v=e.apply(t,u);return v.__actions__.push({func:nu,args:[c],thisArg:void 0}),new Pn(v,f)}return p&&h?e.apply(this,u):(v=this.thru(c),p?r?v.value()[0]:v.value():v)})})),ut(["pop","push","shift","sort","splice","unshift"],(function(e){var t=_e[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);xn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Nu(i)?i:[],e)}return this[n]((function(n){return t.apply(Nu(n)?n:[],e)}))}})),lr(In.prototype,(function(e,t){var n=xn[t];if(n){var r=n.name+"";Se.call(_n,r)||(_n[r]=[]),_n[r].push({name:t,func:n})}})),_n[xi(void 0,2).name]=[{name:"wrapper",func:void 0}],In.prototype.clone=function(){var e=new In(this.__wrapped__);return e.__actions__=gi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=gi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=gi(this.__views__),e},In.prototype.reverse=function(){if(this.__filtered__){var e=new In(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},In.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Nu(e),r=t<0,i=n?e.length:0,o=function(e,t,n){var r=-1,i=n.length;for(;++r=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},xn.prototype.plant=function(e){for(var t,n=this;n instanceof On;){var r=xo(n);r.__index__=0,r.__values__=void 0,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t},xn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof In){var t=e;return this.__actions__.length&&(t=new In(this)),(t=t.reverse()).__actions__.push({func:nu,args:[Ho],thisArg:void 0}),new Pn(t,this.__chain__)}return this.thru(Ho)},xn.prototype.toJSON=xn.prototype.valueOf=xn.prototype.value=function(){return ni(this.__wrapped__,this.__actions__)},xn.prototype.first=xn.prototype.head,gt&&(xn.prototype[gt]=function(){return this}),xn}();Ge._=$t,void 0===(r=function(){return $t}.call(t,n,t,e))||(e.exports=r)}.call(this)},1573:e=>{"use strict";const t=(e,t)=>{for(const n of Reflect.ownKeys(t))Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n));return e};e.exports=t,e.exports.default=t},9381:e=>{"use strict"; +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,o){for(var u,a,l=i(e),s=1;s{"use strict";const r=n(1573),i=new WeakMap,o=(e,t={})=>{if("function"!=typeof e)throw new TypeError("Expected a function");let n,o=!1,u=0;const a=e.displayName||e.name||"",l=function(...r){if(i.set(l,++u),o){if(!0===t.throw)throw new Error(`Function \`${a}\` can only be called once`);return n}return o=!0,n=e.apply(this,r),e=null,n};return r(l,e),i.set(l,u),l};e.exports=o,e.exports.default=o,e.exports.callCount=e=>{if(!i.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return i.get(e)}},8070:(e,t,n)=>{"use strict";const r=n(2413),i=["assert","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"];let o={};e.exports=e=>{const t=new r.PassThrough,n=new r.PassThrough;t.write=t=>e("stdout",t),n.write=t=>e("stderr",t);const u=new console.Console(t,n);for(const e of i)o[e]=console[e],console[e]=u[e];return()=>{for(const e of i)console[e]=o[e];o={}}}},5187:e=>{window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=20)}([function(e,t,n){"use strict";e.exports=n(12)},function(e,t,n){"use strict"; +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function u(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,l=u(e),s=1;s=t||n<0||f&&e-s>=o}function w(){var e=h();if(b(e))return E(e);a=setTimeout(w,function(e){var n=t-(e-l);return f?p(n,o-(e-s)):n}(e))}function E(e){return a=void 0,m&&r?y(e):(r=i=void 0,u)}function D(){var e=h(),n=b(e);if(r=arguments,i=this,l=e,n){if(void 0===a)return _(l);if(f)return a=setTimeout(w,t),y(l)}return void 0===a&&(a=setTimeout(w,t)),u}return t=g(t)||0,v(n)&&(c=!!n.leading,o=(f="maxWait"in n)?d(g(n.maxWait)||0,t):o,m="trailing"in n?!!n.trailing:m),D.cancel=function(){void 0!==a&&clearTimeout(a),s=0,r=l=i=a=void 0},D.flush=function(){return void 0===a?u:E(h())},D}(e,t,{leading:r,maxWait:t,trailing:i})}}).call(this,n(4))},function(e,t,n){(function(n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i;t=e.exports=p,i="object"===(void 0===n?"undefined":r(n))&&n.env&&n.env.NODE_DEBUG&&/\bsemver\b/i.test(n.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var o=Number.MAX_SAFE_INTEGER||9007199254740991,u=t.re=[],a=t.src=[],l=t.tokens={},s=0;function c(e){l[e]=s++}c("NUMERICIDENTIFIER"),a[l.NUMERICIDENTIFIER]="0|[1-9]\\d*",c("NUMERICIDENTIFIERLOOSE"),a[l.NUMERICIDENTIFIERLOOSE]="[0-9]+",c("NONNUMERICIDENTIFIER"),a[l.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*",c("MAINVERSION"),a[l.MAINVERSION]="("+a[l.NUMERICIDENTIFIER]+")\\.("+a[l.NUMERICIDENTIFIER]+")\\.("+a[l.NUMERICIDENTIFIER]+")",c("MAINVERSIONLOOSE"),a[l.MAINVERSIONLOOSE]="("+a[l.NUMERICIDENTIFIERLOOSE]+")\\.("+a[l.NUMERICIDENTIFIERLOOSE]+")\\.("+a[l.NUMERICIDENTIFIERLOOSE]+")",c("PRERELEASEIDENTIFIER"),a[l.PRERELEASEIDENTIFIER]="(?:"+a[l.NUMERICIDENTIFIER]+"|"+a[l.NONNUMERICIDENTIFIER]+")",c("PRERELEASEIDENTIFIERLOOSE"),a[l.PRERELEASEIDENTIFIERLOOSE]="(?:"+a[l.NUMERICIDENTIFIERLOOSE]+"|"+a[l.NONNUMERICIDENTIFIER]+")",c("PRERELEASE"),a[l.PRERELEASE]="(?:-("+a[l.PRERELEASEIDENTIFIER]+"(?:\\."+a[l.PRERELEASEIDENTIFIER]+")*))",c("PRERELEASELOOSE"),a[l.PRERELEASELOOSE]="(?:-?("+a[l.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+a[l.PRERELEASEIDENTIFIERLOOSE]+")*))",c("BUILDIDENTIFIER"),a[l.BUILDIDENTIFIER]="[0-9A-Za-z-]+",c("BUILD"),a[l.BUILD]="(?:\\+("+a[l.BUILDIDENTIFIER]+"(?:\\."+a[l.BUILDIDENTIFIER]+")*))",c("FULL"),c("FULLPLAIN"),a[l.FULLPLAIN]="v?"+a[l.MAINVERSION]+a[l.PRERELEASE]+"?"+a[l.BUILD]+"?",a[l.FULL]="^"+a[l.FULLPLAIN]+"$",c("LOOSEPLAIN"),a[l.LOOSEPLAIN]="[v=\\s]*"+a[l.MAINVERSIONLOOSE]+a[l.PRERELEASELOOSE]+"?"+a[l.BUILD]+"?",c("LOOSE"),a[l.LOOSE]="^"+a[l.LOOSEPLAIN]+"$",c("GTLT"),a[l.GTLT]="((?:<|>)?=?)",c("XRANGEIDENTIFIERLOOSE"),a[l.XRANGEIDENTIFIERLOOSE]=a[l.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",c("XRANGEIDENTIFIER"),a[l.XRANGEIDENTIFIER]=a[l.NUMERICIDENTIFIER]+"|x|X|\\*",c("XRANGEPLAIN"),a[l.XRANGEPLAIN]="[v=\\s]*("+a[l.XRANGEIDENTIFIER]+")(?:\\.("+a[l.XRANGEIDENTIFIER]+")(?:\\.("+a[l.XRANGEIDENTIFIER]+")(?:"+a[l.PRERELEASE]+")?"+a[l.BUILD]+"?)?)?",c("XRANGEPLAINLOOSE"),a[l.XRANGEPLAINLOOSE]="[v=\\s]*("+a[l.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+a[l.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+a[l.XRANGEIDENTIFIERLOOSE]+")(?:"+a[l.PRERELEASELOOSE]+")?"+a[l.BUILD]+"?)?)?",c("XRANGE"),a[l.XRANGE]="^"+a[l.GTLT]+"\\s*"+a[l.XRANGEPLAIN]+"$",c("XRANGELOOSE"),a[l.XRANGELOOSE]="^"+a[l.GTLT]+"\\s*"+a[l.XRANGEPLAINLOOSE]+"$",c("COERCE"),a[l.COERCE]="(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])",c("COERCERTL"),u[l.COERCERTL]=new RegExp(a[l.COERCE],"g"),c("LONETILDE"),a[l.LONETILDE]="(?:~>?)",c("TILDETRIM"),a[l.TILDETRIM]="(\\s*)"+a[l.LONETILDE]+"\\s+",u[l.TILDETRIM]=new RegExp(a[l.TILDETRIM],"g"),c("TILDE"),a[l.TILDE]="^"+a[l.LONETILDE]+a[l.XRANGEPLAIN]+"$",c("TILDELOOSE"),a[l.TILDELOOSE]="^"+a[l.LONETILDE]+a[l.XRANGEPLAINLOOSE]+"$",c("LONECARET"),a[l.LONECARET]="(?:\\^)",c("CARETTRIM"),a[l.CARETTRIM]="(\\s*)"+a[l.LONECARET]+"\\s+",u[l.CARETTRIM]=new RegExp(a[l.CARETTRIM],"g"),c("CARET"),a[l.CARET]="^"+a[l.LONECARET]+a[l.XRANGEPLAIN]+"$",c("CARETLOOSE"),a[l.CARETLOOSE]="^"+a[l.LONECARET]+a[l.XRANGEPLAINLOOSE]+"$",c("COMPARATORLOOSE"),a[l.COMPARATORLOOSE]="^"+a[l.GTLT]+"\\s*("+a[l.LOOSEPLAIN]+")$|^$",c("COMPARATOR"),a[l.COMPARATOR]="^"+a[l.GTLT]+"\\s*("+a[l.FULLPLAIN]+")$|^$",c("COMPARATORTRIM"),a[l.COMPARATORTRIM]="(\\s*)"+a[l.GTLT]+"\\s*("+a[l.LOOSEPLAIN]+"|"+a[l.XRANGEPLAIN]+")",u[l.COMPARATORTRIM]=new RegExp(a[l.COMPARATORTRIM],"g"),c("HYPHENRANGE"),a[l.HYPHENRANGE]="^\\s*("+a[l.XRANGEPLAIN]+")\\s+-\\s+("+a[l.XRANGEPLAIN]+")\\s*$",c("HYPHENRANGELOOSE"),a[l.HYPHENRANGELOOSE]="^\\s*("+a[l.XRANGEPLAINLOOSE]+")\\s+-\\s+("+a[l.XRANGEPLAINLOOSE]+")\\s*$",c("STAR"),a[l.STAR]="(<|>)?=?\\s*\\*";for(var f=0;f256)return null;if(!(t.loose?u[l.LOOSE]:u[l.FULL]).test(e))return null;try{return new p(e,t)}catch(e){return null}}function p(e,t){if(t&&"object"===r(t)||(t={loose:!!t,includePrerelease:!1}),e instanceof p){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof p))return new p(e,t);i("SemVer",e,t),this.options=t,this.loose=!!t.loose;var n=e.trim().match(t.loose?u[l.LOOSE]:u[l.FULL]);if(!n)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,n,r){"string"==typeof n&&(r=n,n=void 0);try{return new p(e,n).inc(t,r).version}catch(e){return null}},t.diff=function(e,t){if(_(e,t))return null;var n=d(e),r=d(t),i="";if(n.prerelease.length||r.prerelease.length){i="pre";var o="prerelease"}for(var u in n)if(("major"===u||"minor"===u||"patch"===u)&&n[u]!==r[u])return i+u;return o},t.compareIdentifiers=v;var h=/^[0-9]+$/;function v(e,t){var n=h.test(e),r=h.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e0}function y(e,t,n){return m(e,t,n)<0}function _(e,t,n){return 0===m(e,t,n)}function b(e,t,n){return 0!==m(e,t,n)}function w(e,t,n){return m(e,t,n)>=0}function E(e,t,n){return m(e,t,n)<=0}function D(e,t,n,i){switch(t){case"===":return"object"===r(e)&&(e=e.version),"object"===r(n)&&(n=n.version),e===n;case"!==":return"object"===r(e)&&(e=e.version),"object"===r(n)&&(n=n.version),e!==n;case"":case"=":case"==":return _(e,n,i);case"!=":return b(e,n,i);case">":return g(e,n,i);case">=":return w(e,n,i);case"<":return y(e,n,i);case"<=":return E(e,n,i);default:throw new TypeError("Invalid operator: "+t)}}function S(e,t){if(t&&"object"===r(t)||(t={loose:!!t,includePrerelease:!1}),e instanceof S){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof S))return new S(e,t);i("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===C?this.value="":this.value=this.operator+this.semver.version,i("comp",this)}t.rcompareIdentifiers=function(e,t){return v(t,e)},t.major=function(e,t){return new p(e,t).major},t.minor=function(e,t){return new p(e,t).minor},t.patch=function(e,t){return new p(e,t).patch},t.compare=m,t.compareLoose=function(e,t){return m(e,t,!0)},t.compareBuild=function(e,t,n){var r=new p(e,n),i=new p(t,n);return r.compare(i)||r.compareBuild(i)},t.rcompare=function(e,t,n){return m(t,e,n)},t.sort=function(e,n){return e.sort((function(e,r){return t.compareBuild(e,r,n)}))},t.rsort=function(e,n){return e.sort((function(e,r){return t.compareBuild(r,e,n)}))},t.gt=g,t.lt=y,t.eq=_,t.neq=b,t.gte=w,t.lte=E,t.cmp=D,t.Comparator=S;var C={};function k(e,t){if(t&&"object"===r(t)||(t={loose:!!t,includePrerelease:!1}),e instanceof k)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new k(e.raw,t);if(e instanceof S)return new k(e.value,t);if(!(this instanceof k))return new k(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function T(e,t){for(var n=!0,r=e.slice(),i=r.pop();n&&r.length;)n=r.every((function(e){return i.intersects(e,t)})),i=r.pop();return n}function x(e){return!e||"x"===e.toLowerCase()||"*"===e}function A(e,t,n,r,i,o,u,a,l,s,c,f,d){return((t=x(n)?"":x(r)?">="+n+".0.0":x(i)?">="+n+"."+r+".0":">="+t)+" "+(a=x(l)?"":x(s)?"<"+(+l+1)+".0.0":x(c)?"<"+l+"."+(+s+1)+".0":f?"<="+l+"."+s+"."+c+"-"+f:"<="+a)).trim()}function O(e,t,n){for(var r=0;r0){var o=e[r].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch)return!0}return!1}return!0}function P(e,t,n){try{t=new k(t,n)}catch(e){return!1}return t.test(e)}function I(e,t,n,r){var i,o,u,a,l;switch(e=new p(e,r),t=new k(t,r),n){case">":i=g,o=E,u=y,a=">",l=">=";break;case"<":i=y,o=w,u=g,a="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(P(e,t,r))return!1;for(var s=0;s=0.0.0")),f=f||e,d=d||e,i(e.semver,f.semver,r)?f=e:u(e.semver,d.semver,r)&&(d=e)})),f.operator===a||f.operator===l)return!1;if((!d.operator||d.operator===a)&&o(e,d.semver))return!1;if(d.operator===l&&u(e,d.semver))return!1}return!0}S.prototype.parse=function(e){var t=this.options.loose?u[l.COMPARATORLOOSE]:u[l.COMPARATOR],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new p(n[2],this.options.loose):this.semver=C},S.prototype.toString=function(){return this.value},S.prototype.test=function(e){if(i("Comparator.test",e,this.options.loose),this.semver===C||e===C)return!0;if("string"==typeof e)try{e=new p(e,this.options)}catch(e){return!1}return D(e,this.operator,this.semver,this.options)},S.prototype.intersects=function(e,t){if(!(e instanceof S))throw new TypeError("a Comparator is required");var n;if(t&&"object"===r(t)||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||(n=new k(e.value,t),P(this.value,n,t));if(""===e.operator)return""===e.value||(n=new k(this.value,t),P(e.semver,n,t));var i=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),u=this.semver.version===e.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),l=D(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),s=D(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return i||o||u&&a||l||s},t.Range=k,k.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},k.prototype.toString=function(){return this.range},k.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var n=t?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];e=e.replace(n,A),i("hyphen replace",e),e=e.replace(u[l.COMPARATORTRIM],"$1$2$3"),i("comparator trim",e,u[l.COMPARATORTRIM]),e=(e=(e=e.replace(u[l.TILDETRIM],"$1~")).replace(u[l.CARETTRIM],"$1^")).split(/\s+/).join(" ");var r=t?u[l.COMPARATORLOOSE]:u[l.COMPARATOR],o=e.split(" ").map((function(e){return function(e,t){return i("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){i("caret",e,t);var n=t.loose?u[l.CARETLOOSE]:u[l.CARET];return e.replace(n,(function(t,n,r,o,u){var a;return i("caret",e,t,n,r,o,u),x(n)?a="":x(r)?a=">="+n+".0.0 <"+(+n+1)+".0.0":x(o)?a="0"===n?">="+n+"."+r+".0 <"+n+"."+(+r+1)+".0":">="+n+"."+r+".0 <"+(+n+1)+".0.0":u?(i("replaceCaret pr",u),a="0"===n?"0"===r?">="+n+"."+r+"."+o+"-"+u+" <"+n+"."+r+"."+(+o+1):">="+n+"."+r+"."+o+"-"+u+" <"+n+"."+(+r+1)+".0":">="+n+"."+r+"."+o+"-"+u+" <"+(+n+1)+".0.0"):(i("no pr"),a="0"===n?"0"===r?">="+n+"."+r+"."+o+" <"+n+"."+r+"."+(+o+1):">="+n+"."+r+"."+o+" <"+n+"."+(+r+1)+".0":">="+n+"."+r+"."+o+" <"+(+n+1)+".0.0"),i("caret return",a),a}))}(e,t)})).join(" ")}(e,t),i("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var n=t.loose?u[l.TILDELOOSE]:u[l.TILDE];return e.replace(n,(function(t,n,r,o,u){var a;return i("tilde",e,t,n,r,o,u),x(n)?a="":x(r)?a=">="+n+".0.0 <"+(+n+1)+".0.0":x(o)?a=">="+n+"."+r+".0 <"+n+"."+(+r+1)+".0":u?(i("replaceTilde pr",u),a=">="+n+"."+r+"."+o+"-"+u+" <"+n+"."+(+r+1)+".0"):a=">="+n+"."+r+"."+o+" <"+n+"."+(+r+1)+".0",i("tilde return",a),a}))}(e,t)})).join(" ")}(e,t),i("tildes",e),e=function(e,t){return i("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var n=t.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return e.replace(n,(function(n,r,o,u,a,l){i("xRange",e,n,r,o,u,a,l);var s=x(o),c=s||x(u),f=c||x(a),d=f;return"="===r&&d&&(r=""),l=t.includePrerelease?"-0":"",s?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(c&&(u=0),a=0,">"===r?(r=">=",c?(o=+o+1,u=0,a=0):(u=+u+1,a=0)):"<="===r&&(r="<",c?o=+o+1:u=+u+1),n=r+o+"."+u+"."+a+l):c?n=">="+o+".0.0"+l+" <"+(+o+1)+".0.0"+l:f&&(n=">="+o+"."+u+".0"+l+" <"+o+"."+(+u+1)+".0"+l),i("xRange return",n),n}))}(e,t)})).join(" ")}(e,t),i("xrange",e),e=function(e,t){return i("replaceStars",e,t),e.trim().replace(u[l.STAR],"")}(e,t),i("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(o=o.filter((function(e){return!!e.match(r)}))),o.map((function(e){return new S(e,this.options)}),this)},k.prototype.intersects=function(e,t){if(!(e instanceof k))throw new TypeError("a Range is required");return this.set.some((function(n){return T(n,t)&&e.set.some((function(e){return T(e,t)&&n.every((function(n){return e.every((function(e){return n.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new k(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},k.prototype.test=function(e){if(!e)return!1;if("string"==typeof e)try{e=new p(e,this.options)}catch(e){return!1}for(var t=0;t":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!g(n,t)||(n=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}));return n&&e.test(n)?n:null},t.validRange=function(e,t){try{return new k(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,n){return I(e,t,"<",n)},t.gtr=function(e,t,n){return I(e,t,">",n)},t.outside=I,t.prerelease=function(e,t){var n=d(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new k(e,n),t=new k(t,n),e.intersects(t)},t.coerce=function(e,t){if(e instanceof p)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;var n=null;if((t=t||{}).rtl){for(var r;(r=u[l.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),u[l.COERCERTL].lastIndex=r.index+r[1].length+r[2].length;u[l.COERCERTL].lastIndex=-1}else n=e.match(u[l.COERCE]);return null===n?null:d(n[2]+"."+(n[3]||"0")+"."+(n[4]||"0"),t)}}).call(this,n(5))},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"===("undefined"==typeof window?"undefined":n(window))&&(r=window)}e.exports=r},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(e){r=u}}();var l,s=[],c=!1,f=-1;function d(){c&&l&&(c=!1,l.length?s=l.concat(s):f=-1,s.length&&p())}function p(){if(!c){var e=a(d);c=!0;for(var t=s.length;t;){for(l=s,s=[];++f1)for(var n=1;nthis[u])return w(this,this[h].get(e)),!1;var o=this[h].get(e).value;return this[f]&&(this[d]||this[f](e,o.value)),o.now=r,o.maxAge=n,o.value=t,this[a]+=i-o.length,o.length=i,this.get(e),b(this),!0}var s=new E(e,t,i,r,n);return s.length>this[u]?(this[f]&&this[f](e,t),!1):(this[a]+=s.length,this[p].unshift(s),this[h].set(e,this[p].head),b(this),!0)}},{key:"has",value:function(e){if(!this[h].has(e))return!1;var t=this[h].get(e).value;return!_(this,t)}},{key:"get",value:function(e){return y(this,e,!0)}},{key:"peek",value:function(e){return y(this,e,!1)}},{key:"pop",value:function(){var e=this[p].tail;return e?(w(this,e),e.value):null}},{key:"del",value:function(e){w(this,this[h].get(e))}},{key:"load",value:function(e){this.reset();for(var t=Date.now(),n=e.length-1;n>=0;n--){var r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{var o=i-t;o>0&&this.set(r.k,r.v,o)}}}},{key:"prune",value:function(){var e=this;this[h].forEach((function(t,n){return y(e,n,!1)}))}},{key:"max",set:function(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[u]=e||1/0,b(this)},get:function(){return this[u]}},{key:"allowStale",set:function(e){this[s]=!!e},get:function(){return this[s]}},{key:"maxAge",set:function(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[c]=e,b(this)},get:function(){return this[c]}},{key:"lengthCalculator",set:function(e){var t=this;"function"!=typeof e&&(e=m),e!==this[l]&&(this[l]=e,this[a]=0,this[p].forEach((function(e){e.length=t[l](e.value,e.key),t[a]+=e.length}))),b(this)},get:function(){return this[l]}},{key:"length",get:function(){return this[a]}},{key:"itemCount",get:function(){return this[p].length}}])&&i(t.prototype,n),e}(),y=function(e,t,n){var r=e[h].get(t);if(r){var i=r.value;if(_(e,i)){if(w(e,r),!e[s])return}else n&&(e[v]&&(r.value.now=Date.now()),e[p].unshiftNode(r));return i.value}},_=function(e,t){if(!t||!t.maxAge&&!e[c])return!1;var n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[c]&&n>e[c]},b=function(e){if(e[a]>e[u])for(var t=e[p].tail;e[a]>e[u]&&null!==t;){var n=t.prev;w(e,t),t=n}},w=function(e,t){if(t){var n=t.value;e[f]&&e[f](n.key,n.value),e[a]-=n.length,e[h].delete(n.key),e[p].removeNode(t)}},E=function e(t,n,i,o,u){r(this,e),this.key=t,this.value=n,this.length=i,this.now=o,this.maxAge=u||0},D=function(e,t,n,r){var i=n.value;_(e,i)&&(w(e,n),e[s]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};e.exports=g},function(e,t,n){(function(t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=function(){if("undefined"==typeof document||!document.addEventListener)return null;var r,i,o,u={};return u.copy=function(){var e=!1,t=null,n=!1;function r(){e=!1,t=null,n&&window.getSelection().removeAllRanges(),n=!1}return document.addEventListener("copy",(function(n){if(e){for(var r in t)n.clipboardData.setData(r,t[r]);n.preventDefault()}})),function(i){return new Promise((function(o,u){e=!0,"string"==typeof i?t={"text/plain":i}:i instanceof Node?t={"text/html":(new XMLSerializer).serializeToString(i)}:i instanceof Object?t=i:u("Invalid data type. Must be string, DOM node, or an object mapping MIME types to strings."),function e(t){try{if(document.execCommand("copy"))r(),o();else{if(t)throw r(),new Error("Unable to copy. Perhaps it's not available in your browser?");!function(){var e=document.getSelection();if(!document.queryCommandEnabled("copy")&&e.isCollapsed){var t=document.createRange();t.selectNodeContents(document.body),e.removeAllRanges(),e.addRange(t),n=!0}}(),e(!0)}}catch(e){r(),u(e)}}(!1)}))}}(),u.paste=(o=!1,document.addEventListener("paste",(function(e){if(o){o=!1,e.preventDefault();var t=r;r=null,t(e.clipboardData.getData(i))}})),function(e){return new Promise((function(t,n){o=!0,r=t,i=e||"text/plain";try{document.execCommand("paste")||(o=!1,n(new Error("Unable to paste. Pasting only works in Internet Explorer at the moment.")))}catch(e){o=!1,n(new Error(e))}}))}),"undefined"==typeof ClipboardEvent&&void 0!==window.clipboardData&&void 0!==window.clipboardData.setData&&( +/*! promise-polyfill 2.0.1 */ +function(r){function i(e,t){return function(){e.apply(t,arguments)}}function o(e){if("object"!=n(this))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],f(e,i(a,this),i(l,this))}function u(e){var t=this;return null===this._state?void this._deferreds.push(e):void d((function(){var n=t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void e.reject(t)}e.resolve(r)}else(t._state?e.resolve:e.reject)(t._value)}))}function a(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==n(e)||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void f(i(t,e),i(a,this),i(l,this))}this._state=!0,this._value=e,s.call(this)}catch(e){l.call(this,e)}}function l(e){this._state=!1,this._value=e,s.call(this)}function s(){for(var e=0,t=this._deferreds.length;t>e;e++)u.call(this,this._deferreds[e]);this._deferreds=null}function c(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function f(e,t,n){var r=!1;try{e((function(e){r||(r=!0,t(e))}),(function(e){r||(r=!0,n(e))}))}catch(e){if(r)return;r=!0,n(e)}}var d=o.immediateFn||"function"==typeof t&&t||function(e){setTimeout(e,1)},p=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};o.prototype.catch=function(e){return this.then(null,e)},o.prototype.then=function(e,t){var n=this;return new o((function(r,i){u.call(n,new c(e,t,r,i))}))},o.all=function(){var e=Array.prototype.slice.call(1===arguments.length&&p(arguments[0])?arguments[0]:arguments);return new o((function(t,r){function i(u,a){try{if(a&&("object"==n(a)||"function"==typeof a)){var l=a.then;if("function"==typeof l)return void l.call(a,(function(e){i(u,e)}),r)}e[u]=a,0==--o&&t(e)}catch(e){r(e)}}if(0===e.length)return t([]);for(var o=e.length,u=0;ur;r++)e[r].then(t,n)}))},e.exports?e.exports=o:r.Promise||(r.Promise=o)}(this),u.copy=function(e){return new Promise((function(t,n){if("string"!=typeof e&&!("text/plain"in e))throw new Error("You must provide a text/plain type.");var r="string"==typeof e?e:e["text/plain"];window.clipboardData.setData("Text",r)?t():n(new Error("Copying was rejected."))}))},u.paste=function(){return new Promise((function(e,t){var n=window.clipboardData.getData("Text");n?e(n):t(new Error("Pasting was rejected."))}))}),u}()}).call(this,n(13).setImmediate)},function(e,t,n){"use strict";e.exports=n(15)},function(e,t,n){"use strict";n.r(t),t.default=":root {\n /**\n * IMPORTANT: When new theme variables are added below– also add them to SettingsContext updateThemeVariables()\n */\n\n /* Light theme */\n --light-color-attribute-name: #ef6632;\n --light-color-attribute-name-not-editable: #23272f;\n --light-color-attribute-name-inverted: rgba(255, 255, 255, 0.7);\n --light-color-attribute-value: #1a1aa6;\n --light-color-attribute-value-inverted: #ffffff;\n --light-color-attribute-editable-value: #1a1aa6;\n --light-color-background: #ffffff;\n --light-color-background-hover: rgba(0, 136, 250, 0.1);\n --light-color-background-inactive: #e5e5e5;\n --light-color-background-invalid: #fff0f0;\n --light-color-background-selected: #0088fa;\n --light-color-button-background: #ffffff;\n --light-color-button-background-focus: #ededed;\n --light-color-button: #5f6673;\n --light-color-button-disabled: #cfd1d5;\n --light-color-button-active: #0088fa;\n --light-color-button-focus: #23272f;\n --light-color-button-hover: #23272f;\n --light-color-border: #eeeeee;\n --light-color-commit-did-not-render-fill: #cfd1d5;\n --light-color-commit-did-not-render-fill-text: #000000;\n --light-color-commit-did-not-render-pattern: #cfd1d5;\n --light-color-commit-did-not-render-pattern-text: #333333;\n --light-color-commit-gradient-0: #37afa9;\n --light-color-commit-gradient-1: #63b19e;\n --light-color-commit-gradient-2: #80b393;\n --light-color-commit-gradient-3: #97b488;\n --light-color-commit-gradient-4: #abb67d;\n --light-color-commit-gradient-5: #beb771;\n --light-color-commit-gradient-6: #cfb965;\n --light-color-commit-gradient-7: #dfba57;\n --light-color-commit-gradient-8: #efbb49;\n --light-color-commit-gradient-9: #febc38;\n --light-color-commit-gradient-text: #000000;\n --light-color-component-name: #6a51b2;\n --light-color-component-name-inverted: #ffffff;\n --light-color-component-badge-background: rgba(0, 0, 0, 0.1);\n --light-color-component-badge-background-inverted: rgba(255, 255, 255, 0.25);\n --light-color-component-badge-count: #777d88;\n --light-color-component-badge-count-inverted: rgba(255, 255, 255, 0.7);\n --light-color-context-background: rgba(0,0,0,.9);\n --light-color-context-background-hover: rgba(255, 255, 255, 0.1);\n --light-color-context-background-selected: #178fb9;\n --light-color-context-border: #3d424a;\n --light-color-context-text: #ffffff;\n --light-color-context-text-selected: #ffffff;\n --light-color-dim: #777d88;\n --light-color-dimmer: #cfd1d5;\n --light-color-dimmest: #eff0f1;\n --light-color-error-background: hsl(0, 100%, 97%);\n --light-color-error-border: hsl(0, 100%, 92%);\n --light-color-error-text: #ff0000;\n --light-color-expand-collapse-toggle: #777d88;\n --light-color-link: #0000ff;\n --light-color-modal-background: rgba(255, 255, 255, 0.75);\n --light-color-record-active: #fc3a4b;\n --light-color-record-hover: #3578e5;\n --light-color-record-inactive: #0088fa;\n --light-color-scroll-thumb: #c2c2c2;\n --light-color-scroll-track: #fafafa;\n --light-color-search-match: yellow;\n --light-color-search-match-current: #f7923b;\n --light-color-selected-tree-highlight-active: rgba(0, 136, 250, 0.1);\n --light-color-selected-tree-highlight-inactive: rgba(0, 0, 0, 0.05);\n --light-color-shadow: rgba(0, 0, 0, 0.25);\n --light-color-tab-selected-border: #0088fa;\n --light-color-text: #000000;\n --light-color-text-invalid: #ff0000;\n --light-color-text-selected: #ffffff;\n --light-color-toggle-background-invalid: #fc3a4b;\n --light-color-toggle-background-on: #0088fa;\n --light-color-toggle-background-off: #cfd1d5;\n --light-color-toggle-text: #ffffff;\n --light-color-tooltip-background: rgba(0, 0, 0, 0.9);\n --light-color-tooltip-text: #ffffff;\n\n /* Dark theme */\n --dark-color-attribute-name: #9d87d2;\n --dark-color-attribute-name-not-editable: #ededed;\n --dark-color-attribute-name-inverted: #282828;\n --dark-color-attribute-value: #cedae0;\n --dark-color-attribute-value-inverted: #ffffff;\n --dark-color-attribute-editable-value: yellow;\n --dark-color-background: #282c34;\n --dark-color-background-hover: rgba(255, 255, 255, 0.1);\n --dark-color-background-inactive: #3d424a;\n --dark-color-background-invalid: #5c0000;\n --dark-color-background-selected: #178fb9;\n --dark-color-button-background: #282c34;\n --dark-color-button-background-focus: #3d424a;\n --dark-color-button: #afb3b9;\n --dark-color-button-active: #61dafb;\n --dark-color-button-disabled: #4f5766;\n --dark-color-button-focus: #a2e9fc;\n --dark-color-button-hover: #ededed;\n --dark-color-border: #3d424a;\n --dark-color-commit-did-not-render-fill: #777d88;\n --dark-color-commit-did-not-render-fill-text: #000000;\n --dark-color-commit-did-not-render-pattern: #666c77;\n --dark-color-commit-did-not-render-pattern-text: #ffffff;\n --dark-color-commit-gradient-0: #37afa9;\n --dark-color-commit-gradient-1: #63b19e;\n --dark-color-commit-gradient-2: #80b393;\n --dark-color-commit-gradient-3: #97b488;\n --dark-color-commit-gradient-4: #abb67d;\n --dark-color-commit-gradient-5: #beb771;\n --dark-color-commit-gradient-6: #cfb965;\n --dark-color-commit-gradient-7: #dfba57;\n --dark-color-commit-gradient-8: #efbb49;\n --dark-color-commit-gradient-9: #febc38;\n --dark-color-commit-gradient-text: #000000;\n --dark-color-component-name: #61dafb;\n --dark-color-component-name-inverted: #282828;\n --dark-color-component-badge-background: rgba(255, 255, 255, 0.25);\n --dark-color-component-badge-background-inverted: rgba(0, 0, 0, 0.25);\n --dark-color-component-badge-count: #8f949d;\n --dark-color-component-badge-count-inverted: rgba(255, 255, 255, 0.7);\n --dark-color-context-background: rgba(255,255,255,.9);\n --dark-color-context-background-hover: rgba(0, 136, 250, 0.1);\n --dark-color-context-background-selected: #0088fa;\n --dark-color-context-border: #eeeeee;\n --dark-color-context-text: #000000;\n --dark-color-context-text-selected: #ffffff;\n --dark-color-dim: #8f949d;\n --dark-color-dimmer: #777d88;\n --dark-color-dimmest: #4f5766;\n --dark-color-error-background: #200;\n --dark-color-error-border: #900;\n --dark-color-error-text: #f55;\n --dark-color-expand-collapse-toggle: #8f949d;\n --dark-color-link: #61dafb;\n --dark-color-modal-background: rgba(0, 0, 0, 0.75);\n --dark-color-record-active: #fc3a4b;\n --dark-color-record-hover: #a2e9fc;\n --dark-color-record-inactive: #61dafb;\n --dark-color-scroll-thumb: #afb3b9;\n --dark-color-scroll-track: #313640;\n --dark-color-search-match: yellow;\n --dark-color-search-match-current: #f7923b;\n --dark-color-selected-tree-highlight-active: rgba(23, 143, 185, 0.15);\n --dark-color-selected-tree-highlight-inactive: rgba(255, 255, 255, 0.05);\n --dark-color-shadow: rgba(0, 0, 0, 0.5);\n --dark-color-tab-selected-border: #178fb9;\n --dark-color-text: #ffffff;\n --dark-color-text-invalid: #ff8080;\n --dark-color-text-selected: #ffffff;\n --dark-color-toggle-background-invalid: #fc3a4b;\n --dark-color-toggle-background-on: #178fb9;\n --dark-color-toggle-background-off: #777d88;\n --dark-color-toggle-text: #ffffff;\n --dark-color-tooltip-background: rgba(255, 255, 255, 0.9);\n --dark-color-tooltip-text: #000000;\n\n /* Font smoothing */\n --light-font-smoothing: auto;\n --dark-font-smoothing: antialiased;\n --font-smoothing: auto;\n\n /* Compact density */\n --compact-font-size-monospace-small: 9px;\n --compact-font-size-monospace-normal: 11px;\n --compact-font-size-monospace-large: 15px;\n --compact-font-size-sans-small: 10px;\n --compact-font-size-sans-normal: 12px;\n --compact-font-size-sans-large: 14px;\n --compact-line-height-data: 18px;\n --compact-root-font-size: 16px;\n\n /* Comfortable density */\n --comfortable-font-size-monospace-small: 10px;\n --comfortable-font-size-monospace-normal: 13px;\n --comfortable-font-size-monospace-large: 17px;\n --comfortable-font-size-sans-small: 12px;\n --comfortable-font-size-sans-normal: 14px;\n --comfortable-font-size-sans-large: 16px;\n --comfortable-line-height-data: 22px;\n --comfortable-root-font-size: 20px;\n\n /* GitHub.com system fonts */\n --font-family-monospace: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo,\n Courier, monospace;\n --font-family-sans: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica,\n Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;\n\n /* Constant values shared between JS and CSS */\n --interaction-commit-size: 10px;\n --interaction-label-width: 200px;\n}\n"},function(e,t,n){"use strict";function r(e){var t=this;if(t instanceof r||(t=new r),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var n=0,i=arguments.length;n1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},r.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},r.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},r.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},r.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(tthis.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&ithis.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)n.push(o.value);return n},r.prototype.splice=function(e,t){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,r=this.head;null!==r&&n=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(14),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(4))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,i,o,u,a,l=1,s={},c=!1,f=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){h(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(u="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(u)&&h(+t.data.slice(u.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),r=function(t){e.postMessage(u+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){o.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(i=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(h,0,e)},d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;nv;v++)if(-1!==(h=g(p,c,v))){m=v,c=h;break e}c=-1}}e:{if(p=f,void 0!==(h=d().get(s.primitive)))for(v=0;vc-p?null:f.slice(p,c-1))){if(c=0,null!==r){for(;cc;r--)i=a.pop()}for(r=f.length-c-1;1<=r;r--)c=[],i.push({id:null,isStateEditable:!1,name:_(f[r-1].functionName),value:void 0,subHooks:c}),a.push(i),i=c;r=f}c="Context"===(f=s.primitive)||"DebugValue"===f?null:u++,i.push({id:c,isStateEditable:"Reducer"===f||"State"===f,name:f,value:s.value,subHooks:[]})}return function e(t,n){for(var r=[],i=0;i-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var n=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=n.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(n=r?n.replace(r[0],""):n).split(/\s+/).slice(1),o=this.extractLocation(r?r[1]:i.pop()),u=i.join(" ")||void 0,a=["eval",""].indexOf(o[0])>-1?void 0:o[0];return new e({functionName:u,fileName:a,lineNumber:o[1],columnNumber:o[2],source:t})}),this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter((function(e){return!e.match(r)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new e({functionName:t});var n=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(n),i=r&&r[1]?r[1]:void 0,o=this.extractLocation(t.replace(n,""));return new e({functionName:i,fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:t})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(t){for(var n=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],o=2,u=r.length;o/,"$2").replace(/\([^)]*\)/g,"")||void 0;o.match(/\(([^)]*)\)/)&&(n=o.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var a=void 0===n||"[arguments not available]"===n?void 0:n.split(",");return new e({functionName:u,args:a,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:t})}),this)}}})?r.apply(t,i):r)||(e.exports=o)}()},function(e,t,n){var r,i,o;!function(n,u){"use strict";i=[],void 0===(o="function"==typeof(r=function(){function e(e){return e.charAt(0).toUpperCase()+e.substring(1)}function t(e){return function(){return this[e]}}var n=["isConstructor","isEval","isNative","isToplevel"],r=["columnNumber","lineNumber"],i=["fileName","functionName","source"],o=n.concat(r,i,["args"]);function u(t){if(t)for(var n=0;n1?n-1:0),i=1;i=0&&n.splice(r,1)}}}])&&r(t.prototype,n),e}(),o=n(2),u=n.n(o);try{var a=n(9).default,l=function(e){var t=new RegExp("".concat(e,": ([0-9]+)")),n=a.match(t);return parseInt(n[1],10)};l("comfortable-line-height-data"),l("compact-line-height-data")}catch(e){}function s(e){try{return sessionStorage.getItem(e)}catch(e){return null}}function c(e){try{sessionStorage.removeItem(e)}catch(e){}}function f(e,t){try{return sessionStorage.setItem(e,t)}catch(e){}}var d=function(e,t){return e===t},p=n(1),h=n.n(p);function v(e){return e.ownerDocument?e.ownerDocument.defaultView:null}function m(e){var t=v(e);return t?t.frameElement:null}function g(e){var t=b(e);return y([e.getBoundingClientRect(),{top:t.borderTop,left:t.borderLeft,bottom:t.borderBottom,right:t.borderRight,width:0,height:0}])}function y(e){return e.reduce((function(e,t){return null==e?t:{top:e.top+t.top,left:e.left+t.left,width:e.width,height:e.height,bottom:e.bottom+t.bottom,right:e.right+t.right}}))}function _(e,t){var n=m(e);if(n&&n!==t){for(var r=[e.getBoundingClientRect()],i=n,o=!1;i;){var u=g(i);if(r.push(u),i=m(i),o)break;i&&v(i)===t&&(o=!0)}return y(r)}return e.getBoundingClientRect()}function b(e){var t=window.getComputedStyle(e);return{borderLeft:parseInt(t.borderLeftWidth,10),borderRight:parseInt(t.borderRightWidth,10),borderTop:parseInt(t.borderTopWidth,10),borderBottom:parseInt(t.borderBottomWidth,10),marginLeft:parseInt(t.marginLeft,10),marginRight:parseInt(t.marginRight,10),marginTop:parseInt(t.marginTop,10),marginBottom:parseInt(t.marginBottom,10),paddingLeft:parseInt(t.paddingLeft,10),paddingRight:parseInt(t.paddingRight,10),paddingTop:parseInt(t.paddingTop,10),paddingBottom:parseInt(t.paddingBottom,10)}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nt.left+t.width&&(u=t.left+t.width-o-5),{style:{top:r+="px",left:u+="px"}}}(e,t,{width:n.width,height:n.height});h()(this.tip.style,r.style)}}]),e}(),T=function(){function e(){E(this,e);var t=window.__REACT_DEVTOOLS_TARGET_WINDOW__||window;this.window=t;var n=window.__REACT_DEVTOOLS_TARGET_WINDOW__||window;this.tipBoundsWindow=n;var r=t.document;this.container=r.createElement("div"),this.container.style.zIndex="10000000",this.tip=new k(r,this.container),this.rects=[],r.body.appendChild(this.container)}return S(e,[{key:"remove",value:function(){this.tip.remove(),this.rects.forEach((function(e){e.remove()})),this.rects.length=0,this.container.parentNode&&this.container.parentNode.removeChild(this.container)}},{key:"inspect",value:function(e,t){for(var n=this,r=e.filter((function(e){return e.nodeType===Node.ELEMENT_NODE}));this.rects.length>r.length;)this.rects.pop().remove();if(0!==r.length){for(;this.rects.length=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return u=e.done,e},e:function(e){a=!0,o=e},f:function(){try{u||null==n.return||n.return()}finally{if(a)throw o}}}}(u.rendererInterfaces.values());try{for(s.s();!(a=s.n()).done;){var c=a.value,f=c.getFiberIDForNative(o,!0);if(null!==f){l=c.getDisplayNameForFiberID(f,!0);break}}}catch(e){s.e(e)}finally{s.f()}l&&(t+=" (in "+l+")")}}this.tip.updateText(t,i.right-i.left,i.bottom-i.top);var d=_(this.tipBoundsWindow.document.documentElement,this.window);this.tip.updatePosition({top:i.top,left:i.left,height:i.bottom-i.top,width:i.right-i.left},{top:d.top+this.tipBoundsWindow.scrollY,left:d.left+this.tipBoundsWindow.scrollX,height:this.tipBoundsWindow.innerHeight,width:this.tipBoundsWindow.innerWidth})}}}]),e}();function x(e,t,n){h()(n.style,{borderTopWidth:e[t+"Top"]+"px",borderLeftWidth:e[t+"Left"]+"px",borderRightWidth:e[t+"Right"]+"px",borderBottomWidth:e[t+"Bottom"]+"px",borderStyle:"solid"})}var A={background:"rgba(120, 170, 210, 0.7)",padding:"rgba(77, 200, 0, 0.3)",margin:"rgba(255, 155, 0, 0.3)",border:"rgba(255, 200, 50, 0.3)"},O=null,P=null;function I(){O=null,null!==P&&(P.remove(),P=null)}function N(e,t,n){null!=window.document&&(null!==O&&clearTimeout(O),null!=e&&(null===P&&(P=new T),P.inspect(e,t),n&&(O=setTimeout(I,2e3))))}var M=new Set,R=["#37afa9","#63b19e","#80b393","#97b488","#abb67d","#beb771","#cfb965","#dfba57","#efbb49","#febc38"],F=null;function L(e){return(L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var B="object"===("undefined"==typeof performance?"undefined":L(performance))&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()},j=new Map,U=null,z=!1,W=null;function H(e){z&&(e.forEach((function(e){var t=j.get(e),n=B(),r=null!=t?t.lastMeasuredAt:0,i=null!=t?t.rect:null;(null===i||r+2505&&void 0!==arguments[5]?arguments[5]:0,a=me(e);switch(a){case"html_element":return t.push(r),{inspectable:!1,preview_short:_e(e,!1),preview_long:_e(e,!0),name:e.tagName,type:a};case"function":return t.push(r),{inspectable:!1,preview_short:_e(e,!1),preview_long:_e(e,!0),name:"function"!=typeof e.name&&e.name?e.name:"function",type:a};case"string":return e.length<=500?e:e.slice(0,500)+"...";case"bigint":case"symbol":return t.push(r),{inspectable:!1,preview_short:_e(e,!1),preview_long:_e(e,!0),name:e.toString(),type:a};case"react_element":return t.push(r),{inspectable:!1,preview_short:_e(e,!1),preview_long:_e(e,!0),name:ge(e)||"Unknown",type:a};case"array_buffer":case"data_view":return t.push(r),{inspectable:!1,preview_short:_e(e,!1),preview_long:_e(e,!0),name:"data_view"===a?"DataView":"ArrayBuffer",size:e.byteLength,type:a};case"array":return o=i(r),u>=2&&!o?Z(a,!0,e,t,r):e.map((function(e,a){return ee(e,t,n,r.concat([a]),i,o?1:u+1)}));case"html_all_collection":case"typed_array":case"iterator":if(o=i(r),u>=2&&!o)return Z(a,!0,e,t,r);var l={unserializable:!0,type:a,readonly:!0,size:"typed_array"===a?e.length:void 0,preview_short:_e(e,!1),preview_long:_e(e,!0),name:e.constructor&&"Object"!==e.constructor.name?e.constructor.name:""};return Q(e[Symbol.iterator])&&Array.from(e).forEach((function(e,a){return l[a]=ee(e,t,n,r.concat([a]),i,o?1:u+1)})),n.push(r),l;case"opaque_iterator":return t.push(r),{inspectable:!1,preview_short:_e(e,!1),preview_long:_e(e,!0),name:e[Symbol.toStringTag],type:a};case"date":case"regexp":return t.push(r),{inspectable:!1,preview_short:_e(e,!1),preview_long:_e(e,!0),name:e.toString(),type:a};case"object":if(o=i(r),u>=2&&!o)return Z(a,!0,e,t,r);var s={};return ae(e).forEach((function(a){var l=a.toString();s[l]=ee(e[a],t,n,r.concat([l]),i,o?1:u+1)})),s;case"infinity":case"nan":case"undefined":return t.push(r),{type:a};default:return e}}function te(e){return(te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ne(e){return function(e){if(Array.isArray(e))return re(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return re(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?re(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function re(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nt.toString()?1:t.toString()>e.toString()?-1:0}function ae(e){for(var t=[],n=e,r=function(){var e=[].concat(ne(Object.keys(n)),ne(Object.getOwnPropertySymbols(n))),r=Object.getOwnPropertyDescriptors(n);e.forEach((function(e){r[e].enumerable&&t.push(e)})),n=Object.getPrototypeOf(n)};null!=n;)r();return t}function le(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Anonymous",n=ie.get(e);if(null!=n)return n;var r=t;return"string"==typeof e.displayName?r=e.displayName:"string"==typeof e.name&&""!==e.name&&(r=e.name),ie.set(e,r),r}var se=0;function ce(){return++se}function fe(e){var t=oe.get(e);if(void 0!==t)return t;for(var n=new Array(e.length),r=0;r1&&void 0!==arguments[1]?arguments[1]:50;return e.length>t?e.substr(0,t)+"…":e}function _e(e,t){if(null!=e&&hasOwnProperty.call(e,J.type))return t?e[J.preview_long]:e[J.preview_short];switch(me(e)){case"html_element":return"<".concat(ye(e.tagName.toLowerCase())," />");case"function":return ye("ƒ ".concat("function"==typeof e.name?"":e.name,"() {}"));case"string":return'"'.concat(e,'"');case"bigint":return ye(e.toString()+"n");case"regexp":case"symbol":return ye(e.toString());case"react_element":return"<".concat(ye(ge(e)||"Unknown")," />");case"array_buffer":return"ArrayBuffer(".concat(e.byteLength,")");case"data_view":return"DataView(".concat(e.buffer.byteLength,")");case"array":if(t){for(var n="",r=0;r0&&(n+=", "),!((n+=_e(e[r],!1)).length>50));r++);return"[".concat(ye(n),"]")}var i=hasOwnProperty.call(e,J.size)?e[J.size]:e.length;return"Array(".concat(i,")");case"typed_array":var o="".concat(e.constructor.name,"(").concat(e.length,")");if(t){for(var u="",a=0;a0&&(u+=", "),!((u+=e[a]).length>50));a++);return"".concat(o," [").concat(ye(u),"]")}return o;case"iterator":var l=e.constructor.name;if(t){for(var s=Array.from(e),c="",f=0;f0&&(c+=", "),Array.isArray(d)){var p=_e(d[0],!0),h=_e(d[1],!1);c+="".concat(p," => ").concat(h)}else c+=_e(d,!1);if(c.length>50)break}return"".concat(l,"(").concat(e.size,") {").concat(ye(c),"}")}return"".concat(l,"(").concat(e.size,")");case"opaque_iterator":return e[Symbol.toStringTag];case"date":return e.toString();case"object":if(t){for(var v=ae(e).sort(ue),m="",g=0;g0&&(m+=", "),(m+="".concat(y.toString(),": ").concat(_e(e[y],!1))).length>50)break}return"{".concat(ye(m),"}")}return"{…}";case"boolean":case"number":case"infinity":case"nan":case"null":case"undefined":return e;default:try{return ye(""+e)}catch(e){return"unserializable"}}}var be=n(7);function we(e){return(we="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function De(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:[];if(null!==e){var r=[],i=[],o=ee(e,r,i,n,t);return{data:o,cleaned:r,unserializable:i}}return null}function ke(e){var t,n,r=(t=e,n=new Set,JSON.stringify(t,(function(e,t){if("object"===we(t)&&null!==t){if(n.has(t))return;n.add(t)}return"bigint"==typeof t?t.toString()+"n":t}))),i=void 0===r?"undefined":r,o=window.__REACT_DEVTOOLS_GLOBAL_HOOK__.clipboardCopyText;"function"==typeof o?o(i).catch((function(e){})):Object(be.copy)(i)}function Te(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t[n],i=Array.isArray(e)?e.slice():De({},e);return n+1===t.length?Array.isArray(i)?i.splice(r,1):delete i[r]:i[r]=Te(e[r],t,n+1),i}function xe(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=t[r],o=Array.isArray(e)?e.slice():De({},e);if(r+1===t.length){var u=n[r];o[u]=o[i],Array.isArray(o)?o.splice(i,1):delete o[i]}else o[i]=xe(e[i],t,n,r+1);return o}function Ae(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(r>=t.length)return n;var i=t[r],o=Array.isArray(e)?e.slice():De({},e);return o[i]=Ae(e[i],t,n,r+1),o}var Oe=n(8);function Pe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ie(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return u=e.done,e},e:function(e){a=!0,o=e},f:function(){try{u||null==n.return||n.return()}finally{if(a)throw o}}}}function Le(e,t){if(e){if("string"==typeof e)return Be(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Be(e,t):void 0}}function Be(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0){var a=o(e);if(null!=a){var l,s=Fe(Y);try{for(s.s();!(l=s.n()).done;)if(l.value.test(a))return!0}catch(e){s.e(e)}finally{s.f()}}}if(null!=t&&K.size>0){var c,f=t.fileName,d=Fe(K);try{for(d.s();!(c=d.n()).done;)if(c.value.test(f))return!0}catch(e){d.e(e)}finally{d.f()}}return!1}function te(e){var t=e.type;switch(e.tag){case v:case S:return 1;case h:case C:return 5;case _:return 6;case b:return 11;case E:return 7;case w:case D:case y:return 9;case k:case x:return 8;case A:return 12;case O:return 13;default:switch(u(t)){case 60111:case"Symbol(react.concurrent_mode)":case"Symbol(react.async_mode)":return 9;case 60109:case"Symbol(react.provider)":return 2;case 60110:case"Symbol(react.context)":return 2;case 60108:case"Symbol(react.strict_mode)":return 9;case 60114:case"Symbol(react.profiler)":return 10;default:return 9}}}function ne(e){if(oe.has(e))return e;var t=e.alternate;return null!=t&&oe.has(t)?t:(oe.add(e),e)}null!=window.__REACT_DEVTOOLS_COMPONENT_FILTERS__?Z(window.__REACT_DEVTOOLS_COMPONENT_FILTERS__):Z([{type:1,value:7,isEnabled:!0}]);var re=new Map,ie=new Map,oe=new Set,ue=new Map,ae=new Map,le=-1;function se(e){if(!re.has(e)){var t=ce();re.set(e,t),ie.set(t,e)}return re.get(e)}function me(e){switch(te(e)){case 1:if(null!==dt){var t=se(ne(e)),n=ye(e);null!==n&&dt.set(t,n)}}}var ge={};function ye(e){switch(te(e)){case 1:var t=e.stateNode,n=ge,r=ge;return null!=t&&(t.constructor&&null!=t.constructor.contextType?r=t.context:(n=t.context)&&0===Object.keys(n).length&&(n=ge)),[n,r];default:return null}}function _e(e){switch(te(e)){case 1:if(null!==dt){var t=se(ne(e)),n=dt.has(t)?dt.get(t):null,r=ye(e);if(null==n||null==r)return null;var i=Re(n,2),o=i[0],u=i[1],a=Re(r,2),l=a[0],s=a[1];if(l!==ge)return we(o,l);if(s!==ge)return u!==s}}return null}function be(e,t){if(null==e||null==t)return!1;if(t.hasOwnProperty("baseState")&&t.hasOwnProperty("memoizedState")&&t.hasOwnProperty("next")&&t.hasOwnProperty("queue"))for(;null!==t;){if(t.memoizedState!==e.memoizedState)return!0;t=t.next,e=e.next}return!1}function we(e,t){if(null==e||null==t)return null;if(t.hasOwnProperty("baseState")&&t.hasOwnProperty("memoizedState")&&t.hasOwnProperty("next")&&t.hasOwnProperty("queue"))return null;var n,r=[],i=Fe(new Set([].concat(Me(Object.keys(e)),Me(Object.keys(t)))));try{for(i.s();!(n=i.n()).done;){var o=n.value;e[o]!==t[o]&&r.push(o)}}catch(e){i.e(e)}finally{i.f()}return r}function Ee(e,t){switch(t.tag){case v:case h:case m:case k:case x:return(Ue(t)&d)===d;default:return e.memoizedProps!==t.memoizedProps||e.memoizedState!==t.memoizedState||e.ref!==t.ref}}var De=[],Se=[],Pe=[],Ne=[],Le=new Map,Be=0,je=null;function ze(e){De.push(e)}function Ve(n){if(0!==De.length||0!==Se.length||0!==Pe.length||null!==je||vt){var r=Se.length+Pe.length+(null===je?0:1),i=new Array(3+Be+(r>0?2+r:0)+De.length),o=0;if(i[o++]=t,i[o++]=le,i[o++]=Be,Le.forEach((function(e,t){i[o++]=t.length;for(var n=fe(t),r=0;r0){i[o++]=2,i[o++]=r;for(var u=Se.length-1;u>=0;u--)i[o++]=Se[u];for(var a=0;a0?n.forEach((function(t){e.emit("operations",t)})):(null!==Dt&&(kt=!0),e.getFiberRoots(t).forEach((function(e){Ot(le=se(ne(e.current)),e.current),vt&&null!=e.memoizedInteractions&&(st={changeDescriptions:gt?new Map:null,durations:[],commitTime:We()-mt,interactions:Array.from(e.memoizedInteractions).map((function(e){return Ie(Ie({},e),{},{timestamp:e.timestamp-mt})})),maxActualDuration:0,priorityLevel:null}),$e(e.current,null,!1,!1),Ve(),le=-1})))},getBestMatchForTrackedPath:function(){if(null===Dt)return null;if(null===St)return null;for(var e=St;null!==e&&ee(e);)e=e.return;return null===e?null:{id:se(ne(e)),isFullMatch:Ct===Dt.length-1}},getDisplayNameForFiberID:function(e){var t=ie.get(e);return null!=t?o(t):null},getFiberIDForNative:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=n.findFiberByHostInstance(e);if(null!=r){if(t)for(;null!==r&&ee(r);)r=r.return;return se(ne(r))}return null},getInstanceAndStyle:function(e){var t=null,n=null,r=et(e);return null!==r&&(t=r.stateNode,null!==r.memoizedProps&&(n=r.memoizedProps.style)),{instance:t,style:n}},getOwnersList:function(e){var t=et(e);if(null==t)return null;var n=t._debugOwner,r=[{displayName:o(t)||"Anonymous",id:e,type:te(t)}];if(n)for(var i=n;null!==i;)r.unshift({displayName:o(i)||"Anonymous",id:se(ne(i)),type:te(i)}),i=i._debugOwner||null;return r},getPathForElement:function(e){var t=ie.get(e);if(null==t)return null;for(var n=[];null!==t;)n.push(It(t)),t=t.return;return n.reverse(),n},getProfilingData:function(){var e=[];if(null===yt)throw Error("getProfilingData() called before any profiling data was recorded");return yt.forEach((function(t,n){var r=[],i=[],o=new Map,u=new Map,a=null!==ft&&ft.get(n)||"Unknown";null!=pt&&pt.forEach((function(e,t){null!=ht&&ht.get(t)===n&&i.push([t,e])})),t.forEach((function(e,t){var n=e.changeDescriptions,i=e.durations,a=e.interactions,l=e.maxActualDuration,s=e.priorityLevel,c=e.commitTime,f=[];a.forEach((function(e){o.has(e.id)||o.set(e.id,e),f.push(e.id);var n=u.get(e.id);null!=n?n.push(t):u.set(e.id,[t])}));for(var d=[],p=[],h=0;h1?At.set(n,r-1):At.delete(n),xt.delete(e)}(le),Ge(r,!1))}else Ot(le,r),$e(r,null,!1,!1);if(vt&&o){var l=yt.get(le);null!=l?l.push(st):yt.set(le,[st])}Ve(),Q&&e.emit("traceUpdates",J),le=-1},handleCommitFiberUnmount:function(e){Ge(e,!1)},inspectElement:function(e,t){if(ot(e)){if(null!=t){ut(t);var n=null;return"hooks"===t[0]&&(n="hooks"),{id:e,type:"hydrated-path",path:t,value:Ce(de(nt,t),at(null,n),t)}}return{id:e,type:"no-change"}}if(rt=!1,null!==nt&&nt.id===e||(it={}),null===(nt=tt(e)))return{id:e,type:"not-found"};null!=t&&ut(t),function(e){var t=e.hooks,n=e.id,i=e.props,o=ie.get(n);if(null!=o){var u=o.elementType,a=o.stateNode,l=o.tag,s=o.type;switch(l){case v:case S:case C:r.$r=a;break;case h:r.$r={hooks:t,props:i,type:s};break;case _:r.$r={props:i,type:s.render};break;case k:case x:r.$r={props:i,type:null!=u&&null!=u.type?u.type:s};break;default:r.$r=null}}else console.warn('Could not find Fiber with id "'.concat(n,'"'))}(nt);var i=Ie({},nt);return i.context=Ce(i.context,at("context",null)),i.hooks=Ce(i.hooks,at("hooks","hooks")),i.props=Ce(i.props,at("props",null)),i.state=Ce(i.state,at("state",null)),{id:e,type:"full-data",value:i}},logElementToConsole:function(e){var t=ot(e)?nt:tt(e);if(null!==t){var n="function"==typeof console.groupCollapsed;n&&console.groupCollapsed("[Click to expand] %c<".concat(t.displayName||"Component"," />"),"color: var(--dom-tag-name-color); font-weight: normal;"),null!==t.props&&console.log("Props:",t.props),null!==t.state&&console.log("State:",t.state),null!==t.hooks&&console.log("Hooks:",t.hooks);var r=Je(e);null!==r&&console.log("Nodes:",r),null!==t.source&&console.log("Location:",t.source),(window.chrome||/firefox/i.test(navigator.userAgent))&&console.log("Right-click any value to save it as a global variable for further inspection."),n&&console.groupEnd()}else console.warn('Could not find Fiber with id "'.concat(e,'"'))},prepareViewAttributeSource:function(e,t){ot(e)&&(window.$attribute=de(nt,t))},prepareViewElementSource:function(e){var t=ie.get(e);if(null!=t){var n=t.elementType,i=t.tag,o=t.type;switch(i){case v:case S:case C:case h:r.$type=o;break;case _:r.$type=o.render;break;case k:case x:r.$type=null!=n&&null!=n.type?n.type:o;break;default:r.$type=null}}else console.warn('Could not find Fiber with id "'.concat(e,'"'))},overrideSuspense:function(e,t){if("function"!=typeof H||"function"!=typeof V)throw new Error("Expected overrideSuspense() to not get called for earlier React versions.");t?(wt.add(e),1===wt.size&&H(Et)):(wt.delete(e),0===wt.size&&H(bt));var n=ie.get(e);null!=n&&V(n)},overrideValueAtPath:function(e,t,n,r,i){var o=et(t);if(null!==o){var u=o.stateNode;switch(e){case"context":switch(r=r.slice(1),o.tag){case v:0===r.length?u.context=i:ve(u.context,r,i),u.forceUpdate()}break;case"hooks":"function"==typeof L&&L(o,n,r,i);break;case"props":switch(o.tag){case v:o.pendingProps=Ae(u.props,r,i),u.forceUpdate();break;default:"function"==typeof U&&U(o,r,i)}break;case"state":switch(o.tag){case v:ve(u.state,r,i),u.forceUpdate()}}}},renamePath:function(e,t,n,r,i){var o=et(t);if(null!==o){var u=o.stateNode;switch(e){case"context":switch(r=r.slice(1),i=i.slice(1),o.tag){case v:0===r.length||he(u.context,r,i),u.forceUpdate()}break;case"hooks":"function"==typeof j&&j(o,n,r,i);break;case"props":null===u?"function"==typeof W&&W(o,r,i):(o.pendingProps=xe(u.props,r,i),u.forceUpdate());break;case"state":he(u.state,r,i),u.forceUpdate()}}},renderer:n,setTraceUpdatesEnabled:function(e){Q=e},setTrackedPath:Tt,startProfiling:_t,stopProfiling:function(){vt=!1,gt=!1},storeAsGlobal:function(e,t,n){if(ot(e)){var r=de(nt,t),i="$reactTemp".concat(n);window[i]=r,console.log(i),console.log(r)}},updateComponentFilters:function(n){if(vt)throw Error("Cannot modify filter preferences while profiling");e.getFiberRoots(t).forEach((function(e){le=se(ne(e.current)),Ye(e.current),Ge(e.current,!1),le=-1})),Z(n),At.clear(),e.getFiberRoots(t).forEach((function(e){Ot(le=se(ne(e.current)),e.current),$e(e.current,null,!1,!1),Ve(),le=-1}))}}}function qe(e){return(qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ge(e,t,n){if(void 0===ze)try{throw Error()}catch(e){var r=e.stack.trim().match(/\n( *(at )?)/);ze=r&&r[1]||""}return"\n"+ze+e}var $e=!1;function Ye(e,t,n){if(!e||$e)return"";var r,i=Error.prepareStackTrace;Error.prepareStackTrace=void 0,$e=!0;var o=n.current;n.current=null;try{if(t){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),"object"===("undefined"==typeof Reflect?"undefined":qe(Reflect))&&Reflect.construct){try{Reflect.construct(u,[])}catch(e){r=e}Reflect.construct(e,[],u)}else{try{u.call()}catch(e){r=e}e.call(u.prototype)}}else{try{throw Error()}catch(e){r=e}e()}}catch(e){if(e&&r&&"string"==typeof e.stack){for(var a=e.stack.split("\n"),l=r.stack.split("\n"),s=a.length-1,c=l.length-1;s>=1&&c>=0&&a[s]!==l[c];)c--;for(;s>=1&&c>=0;s--,c--)if(a[s]!==l[c]){if(1!==s||1!==c)do{if(s--,--c<0||a[s]!==l[c])return"\n"+a[s].replace(" at new "," at ")}while(s>=1&&c>=0);break}}}finally{$e=!1,Error.prepareStackTrace=i,n.current=o}var f=e?e.displayName||e.name:"";return f?Ge(f):""}function Ke(e,t,n,r){return Ye(e,!1,r)}function Xe(e,t,n){var r=e.HostComponent,i=e.LazyComponent,o=e.SuspenseComponent,u=e.SuspenseListComponent,a=e.FunctionComponent,l=e.IndeterminateComponent,s=e.SimpleMemoComponent,c=e.ForwardRef,f=e.Block,d=e.ClassComponent;switch(t.tag){case r:return Ge(t.type);case i:return Ge("Lazy");case o:return Ge("Suspense");case u:return Ge("SuspenseList");case a:case l:case s:return Ke(t.type,0,0,n);case c:return Ke(t.type.render,0,0,n);case f:return Ke(t.type._render,0,0,n);case d:return function(e,t,n,r){return Ye(e,!0,r)}(t.type,0,0,n);default:return""}}function Qe(e,t,n){try{var r="",i=t;do{r+=Xe(e,i,n),i=i.return}while(i);return r}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}function Je(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ze(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ze(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return u=e.done,e},e:function(e){a=!0,o=e},f:function(){try{u||null==n.return||n.return()}finally{if(a)throw o}}}}function Ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?r[r.length-1]:null,u=null!==o&&(tt.test(o)||nt.test(o));if(!u){var a,l=Je(rt.values());try{for(l.s();!(a=l.n()).done;){var s=a.value,c=s.currentDispatcherRef,f=s.getCurrentFiber,d=s.workTagMap,p=f();if(null!=p){var h=Qe(d,p,c);""!==h&&r.push(h);break}}}catch(e){l.e(e)}finally{l.f()}}}catch(e){}t.apply(void 0,r)};n.__REACT_DEVTOOLS_ORIGINAL_METHOD__=t,it[e]=n}catch(e){}}))}}function ft(e){return(ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function dt(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:d,n=void 0,r=[],i=void 0,o=!1,u=function(e,n){return t(e,r[n])},a=function(){for(var t=arguments.length,a=Array(t),l=0;le.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?t-1:0),r=1;r0?"development":"production";var t=Function.prototype.toString;if(e.Mount&&e.Mount._renderNewRootComponent){var n=t.call(e.Mount._renderNewRootComponent);return 0!==n.indexOf("function")?"production":-1!==n.indexOf("storedMeasure")?"development":-1!==n.indexOf("should be a pure function")?-1!==n.indexOf("NODE_ENV")||-1!==n.indexOf("development")||-1!==n.indexOf("true")?"development":-1!==n.indexOf("nextElement")||-1!==n.indexOf("nextComponent")?"unminified":"development":-1!==n.indexOf("nextElement")||-1!==n.indexOf("nextComponent")?"unminified":"outdated"}}catch(e){}return"production"}(r);try{var l=!1!==window.__REACT_DEVTOOLS_APPEND_COMPONENT_STACK__,s=!0===window.__REACT_DEVTOOLS_BREAK_ON_CONSOLE_ERRORS__;(l||s)&&(lt(r),ct({appendComponentStack:l,breakOnConsoleErrors:s}))}catch(e){}var c=e.__REACT_DEVTOOLS_ATTACH__;if("function"==typeof c){var f=c(a,i,r,e);a.rendererInterfaces.set(i,f)}return a.emit("renderer",{id:i,renderer:r,reactBuildType:o}),i},on:function(e,t){o[e]||(o[e]=[]),o[e].push(t)},off:function(e,t){if(o[e]){var n=o[e].indexOf(t);-1!==n&&o[e].splice(n,1),o[e].length||delete o[e]}},sub:function(e,t){return a.on(e,t),function(){return a.off(e,t)}},supportsFiber:!0,checkDCE:function(e){try{Function.prototype.toString.call(e).indexOf("^_^")>-1&&(n=!0,setTimeout((function(){throw new Error("React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://reactjs.org/link/perf-use-production-build")})))}catch(e){}},onCommitFiberUnmount:function(e,t){var n=i.get(e);null!=n&&n.handleCommitFiberUnmount(t)},onCommitFiberRoot:function(e,t,n){var r=a.getFiberRoots(e),o=t.current,u=r.has(t),l=null==o.memoizedState||null==o.memoizedState.element;u||l?u&&l&&r.delete(t):r.add(t);var s=i.get(e);null!=s&&s.handleCommitFiberRoot(t,n)}};Object.defineProperty(e,"__REACT_DEVTOOLS_GLOBAL_HOOK__",{configurable:!1,enumerable:!1,get:function(){return a}})}(window);var $t=window.__REACT_DEVTOOLS_GLOBAL_HOOK__,Yt=[{type:1,value:7,isEnabled:!0}];function Kt(e){if(null!=$t){var t=e||{},n=t.host,r=void 0===n?"localhost":n,i=t.nativeStyleEditorValidAttributes,o=t.useHttps,u=void 0!==o&&o,a=t.port,l=void 0===a?8097:a,s=t.websocket,c=t.resolveRNStyle,f=void 0===c?null:c,d=t.isAppActive,p=u?"wss":"ws",h=null;if((void 0===d?function(){return!0}:d)()){var v=null,m=[],g=p+"://"+r+":"+l,y=s||new window.WebSocket(g);y.onclose=function(){null!==v&&v.emit("shutdown"),_()},y.onerror=function(){_()},y.onmessage=function(e){var t;try{if("string"!=typeof e.data)throw Error();t=JSON.parse(e.data)}catch(t){return void console.error("[React DevTools] Failed to parse JSON: "+e.data)}m.forEach((function(e){try{e(t)}catch(e){throw console.log("[React DevTools] Error calling listener",t),console.log("error:",e),e}}))},y.onopen=function(){(v=new xt({listen:function(e){return m.push(e),function(){var t=m.indexOf(e);t>=0&&m.splice(t,1)}},send:function(e,t,n){y.readyState===y.OPEN?y.send(JSON.stringify({event:e,payload:t})):(null!==v&&v.shutdown(),_())}})).addListener("inspectElement",(function(t){var n=t.id,r=t.rendererID,i=e.rendererInterfaces[r];if(null!=i){var o=i.findNativeNodesForFiberID(n);null!=o&&null!=o[0]&&e.emit("showNativeHighlight",o[0])}})),v.addListener("updateComponentFilters",(function(e){Yt=e})),null==window.__REACT_DEVTOOLS_COMPONENT_FILTERS__&&v.send("overrideComponentFilters",Yt);var e=new yt(v);if(e.addListener("shutdown",(function(){$t.emit("shutdown")})),function(e,t,n){if(null==e)return function(){};var r=[e.sub("renderer-attached",(function(e){var n=e.id,r=(e.renderer,e.rendererInterface);t.setRendererInterface(n,r),r.flushInitialOperations()})),e.sub("unsupported-renderer-version",(function(e){t.onUnsupportedRenderer(e)})),e.sub("operations",t.onHookOperations),e.sub("traceUpdates",t.onTraceUpdates)],i=function(t,r){var i=e.rendererInterfaces.get(t);null==i&&("function"==typeof r.findFiberByHostInstance?i=Ve(e,t,r,n):r.ComponentTree&&(i=function(e,t,n,r){var i,o=new Map,u=new WeakMap,a=new WeakMap,l=null;function s(e){if("object"!==Rt(e)||null===e)throw new Error("Invalid internal instance: "+e);if(!u.has(e)){var t=ce();u.set(e,t),o.set(t,e)}return u.get(e)}function c(e,t){if(e.length!==t.length)return!1;for(var n=0;n0?f[f.length-1]:0),f.push(i),a.set(n,s(r._topLevelWrapper));try{var o=e.apply(this,t);return f.pop(),o}catch(e){throw f=[],e}finally{if(0===f.length){var u=a.get(n);if(void 0===u)throw new Error("Expected to find root ID.");w(u)}}},performUpdateIfNecessary:function(e,t){var n=t[0];if(9===Lt(n))return e.apply(this,t);var r=s(n);f.push(r);var i=Bt(n);try{var o=e.apply(this,t),u=Bt(n);return c(i,u)||h(0,r,u),f.pop(),o}catch(e){throw f=[],e}finally{if(0===f.length){var l=a.get(n);if(void 0===l)throw new Error("Expected to find root ID.");w(l)}}},receiveComponent:function(e,t){var n=t[0];if(9===Lt(n))return e.apply(this,t);var r=s(n);f.push(r);var i=Bt(n);try{var o=e.apply(this,t),u=Bt(n);return c(i,u)||h(0,r,u),f.pop(),o}catch(e){throw f=[],e}finally{if(0===f.length){var l=a.get(n);if(void 0===l)throw new Error("Expected to find root ID.");w(l)}}},unmountComponent:function(e,t){var n=t[0];if(9===Lt(n))return e.apply(this,t);var r=s(n);f.push(r);try{var i=e.apply(this,t);return f.pop(),function(e,t){y.push(t),o.delete(t)}(0,r),i}catch(e){throw f=[],e}finally{if(0===f.length){var u=a.get(n);if(void 0===u)throw new Error("Expected to find root ID.");w(u)}}}}));var m=[],g=new Map,y=[],_=0,b=null;function w(n){if(0!==m.length||0!==y.length||null!==b){var r=y.length+(null===b?0:1),i=new Array(3+_+(r>0?2+r:0)+m.length),o=0;if(i[o++]=t,i[o++]=n,i[o++]=_,g.forEach((function(e,t){i[o++]=t.length;for(var n=fe(t),r=0;r0){i[o++]=2,i[o++]=r;for(var u=0;u"),"color: var(--dom-tag-name-color); font-weight: normal;"),null!==t.props&&console.log("Props:",t.props),null!==t.state&&console.log("State:",t.state),null!==t.context&&console.log("Context:",t.context);var r=i(e);null!==r&&console.log("Node:",r),(window.chrome||/firefox/i.test(navigator.userAgent))&&console.log("Right-click any value to save it as a global variable for further inspection."),n&&console.groupEnd()}else console.warn('Could not find element with id "'.concat(e,'"'))},overrideSuspense:function(){throw new Error("overrideSuspense not supported by this renderer")},overrideValueAtPath:function(e,t,n,r,i){var u=o.get(t);if(null!=u){var a=u._instance;if(null!=a)switch(e){case"context":ve(a.context,r,i),Pt(a);break;case"hooks":throw new Error("Hooks not supported by this renderer");case"props":var l=u._currentElement;u._currentElement=Nt(Nt({},l),{},{props:Ae(l.props,r,i)}),Pt(a);break;case"state":ve(a.state,r,i),Pt(a)}}},renamePath:function(e,t,n,r,i){var u=o.get(t);if(null!=u){var a=u._instance;if(null!=a)switch(e){case"context":he(a.context,r,i),Pt(a);break;case"hooks":throw new Error("Hooks not supported by this renderer");case"props":var l=u._currentElement;u._currentElement=Nt(Nt({},l),{},{props:xe(l.props,r,i)}),Pt(a);break;case"state":he(a.state,r,i),Pt(a)}}},prepareViewAttributeSource:function(e,t){var n=T(e);null!==n&&(window.$attribute=de(n,t))},prepareViewElementSource:function(e){var t=o.get(e);if(null!=t){var n=t._currentElement;null!=n?r.$type=n.type:console.warn('Could not find element with id "'.concat(e,'"'))}else console.warn('Could not find instance with id "'.concat(e,'"'))},renderer:n,setTraceUpdatesEnabled:function(e){},setTrackedPath:function(e){},startProfiling:function(){},stopProfiling:function(){},storeAsGlobal:function(e,t,n){var r=T(e);if(null!==r){var i=de(r,t),o="$reactTemp".concat(n);window[o]=i,console.log(o),console.log(i)}},updateComponentFilters:function(e){}}}(e,t,r,n)),null!=i&&e.rendererInterfaces.set(t,i)),null!=i?e.emit("renderer-attached",{id:t,renderer:r,rendererInterface:i}):e.emit("unsupported-renderer-version",t)};e.renderers.forEach((function(e,t){i(t,e)})),r.push(e.sub("renderer",(function(e){var t=e.id,n=e.renderer;i(t,n)}))),e.emit("react-devtools",t),e.reactDevtoolsAgent=t;var o=function(){r.forEach((function(e){return e()})),e.rendererInterfaces.forEach((function(e){e.cleanup()})),e.reactDevtoolsAgent=null};t.addListener("shutdown",o),r.push((function(){t.removeListener("shutdown",o)}))}($t,e,window),null!=f||null!=$t.resolveRNStyle)Wt(v,e,f||$t.resolveRNStyle,i||$t.nativeStyleEditorValidAttributes||null);else{var t,n,r=function(){null!==v&&Wt(v,e,t,n)};$t.hasOwnProperty("resolveRNStyle")||Object.defineProperty($t,"resolveRNStyle",{enumerable:!1,get:function(){return t},set:function(e){t=e,r()}}),$t.hasOwnProperty("nativeStyleEditorValidAttributes")||Object.defineProperty($t,"nativeStyleEditorValidAttributes",{enumerable:!1,get:function(){return n},set:function(e){n=e,r()}})}}}else _()}function _(){null===h&&(h=setTimeout((function(){return Kt(e)}),2e3))}}}])},6099:(e,t,n)=>{"use strict"; +/** @license React v16.13.1 + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var r=n(9381),i="function"==typeof Symbol&&Symbol.for,o=i?Symbol.for("react.element"):60103,u=i?Symbol.for("react.portal"):60106,a=i?Symbol.for("react.fragment"):60107,l=i?Symbol.for("react.strict_mode"):60108,s=i?Symbol.for("react.profiler"):60114,c=i?Symbol.for("react.provider"):60109,f=i?Symbol.for("react.context"):60110,d=i?Symbol.for("react.forward_ref"):60112,p=i?Symbol.for("react.suspense"):60113,h=i?Symbol.for("react.memo"):60115,v=i?Symbol.for("react.lazy"):60116,m="function"==typeof Symbol&&Symbol.iterator;function g(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nO.length&&O.push(e)}function N(e,t,n){return null==e?0:function e(t,n,r,i){var a=typeof t;"undefined"!==a&&"boolean"!==a||(t=null);var l=!1;if(null===t)l=!0;else switch(a){case"string":case"number":l=!0;break;case"object":switch(t.$$typeof){case o:case u:l=!0}}if(l)return r(i,t,""===n?"."+M(t,0):n),1;if(l=0,n=""===n?".":n+":",Array.isArray(t))for(var s=0;s{"use strict";e.exports=n(6099)},3390:(e,t,n)=>{"use strict";const r=n(834),i=n(6458);e.exports=r(()=>{i(()=>{process.stderr.write("[?25h")},{alwaysLast:!0})})},706:(e,t)=>{"use strict"; +/** @license React v0.18.0 + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var n,r,i,o,u;if(Object.defineProperty(t,"__esModule",{value:!0}),"undefined"==typeof window||"function"!=typeof MessageChannel){var a=null,l=null,s=function(){if(null!==a)try{var e=t.unstable_now();a(!0,e),a=null}catch(e){throw setTimeout(s,0),e}},c=Date.now();t.unstable_now=function(){return Date.now()-c},n=function(e){null!==a?setTimeout(n,0,e):(a=e,setTimeout(s,0))},r=function(e,t){l=setTimeout(e,t)},i=function(){clearTimeout(l)},o=function(){return!1},u=t.unstable_forceFrameRate=function(){}}else{var f=window.performance,d=window.Date,p=window.setTimeout,h=window.clearTimeout;if("undefined"!=typeof console){var v=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof v&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof f&&"function"==typeof f.now)t.unstable_now=function(){return f.now()};else{var m=d.now();t.unstable_now=function(){return d.now()-m}}var g=!1,y=null,_=-1,b=5,w=0;o=function(){return t.unstable_now()>=w},u=function(){},t.unstable_forceFrameRate=function(e){0>e||125T(u,n))void 0!==l&&0>T(l,u)?(e[r]=l,e[a]=n,r=a):(e[r]=u,e[o]=n,r=o);else{if(!(void 0!==l&&0>T(l,n)))break e;e[r]=l,e[a]=n,r=a}}}return t}return null}function T(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var x=[],A=[],O=1,P=null,I=3,N=!1,M=!1,R=!1;function F(e){for(var t=C(A);null!==t;){if(null===t.callback)k(A);else{if(!(t.startTime<=e))break;k(A),t.sortIndex=t.expirationTime,S(x,t)}t=C(A)}}function L(e){if(R=!1,F(e),!M)if(null!==C(x))M=!0,n(B);else{var t=C(A);null!==t&&r(L,t.startTime-e)}}function B(e,n){M=!1,R&&(R=!1,i()),N=!0;var u=I;try{for(F(n),P=C(x);null!==P&&(!(P.expirationTime>n)||e&&!o());){var a=P.callback;if(null!==a){P.callback=null,I=P.priorityLevel;var l=a(P.expirationTime<=n);n=t.unstable_now(),"function"==typeof l?P.callback=l:P===C(x)&&k(x),F(n)}else k(x);P=C(x)}if(null!==P)var s=!0;else{var c=C(A);null!==c&&r(L,c.startTime-n),s=!1}return s}finally{P=null,I=u,N=!1}}function j(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var U=u;t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=I;I=e;try{return t()}finally{I=n}},t.unstable_next=function(e){switch(I){case 1:case 2:case 3:var t=3;break;default:t=I}var n=I;I=t;try{return e()}finally{I=n}},t.unstable_scheduleCallback=function(e,o,u){var a=t.unstable_now();if("object"==typeof u&&null!==u){var l=u.delay;l="number"==typeof l&&0a?(e.sortIndex=l,S(A,e),null===C(x)&&e===C(A)&&(R?i():R=!0,r(L,l-a))):(e.sortIndex=u,S(x,e),M||N||(M=!0,n(B))),e},t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_wrapCallback=function(e){var t=I;return function(){var n=I;I=t;try{return e.apply(this,arguments)}finally{I=n}}},t.unstable_getCurrentPriorityLevel=function(){return I},t.unstable_shouldYield=function(){var e=t.unstable_now();F(e);var n=C(x);return n!==P&&null!==P&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime{"use strict";e.exports=n(706)},6458:(e,t,n)=>{var r,i=n(2357),o=n(8082),u=n(8614);function a(){c&&(c=!1,o.forEach((function(e){try{process.removeListener(e,s[e])}catch(e){}})),process.emit=h,process.reallyExit=d,r.count-=1)}function l(e,t,n){r.emitted[e]||(r.emitted[e]=!0,r.emit(e,t,n))}"function"!=typeof u&&(u=u.EventEmitter),process.__signal_exit_emitter__?r=process.__signal_exit_emitter__:((r=process.__signal_exit_emitter__=new u).count=0,r.emitted={}),r.infinite||(r.setMaxListeners(1/0),r.infinite=!0),e.exports=function(e,t){i.equal(typeof e,"function","a callback must be provided for exit handler"),!1===c&&f();var n="exit";t&&t.alwaysLast&&(n="afterexit");return r.on(n,e),function(){r.removeListener(n,e),0===r.listeners("exit").length&&0===r.listeners("afterexit").length&&a()}},e.exports.unload=a;var s={};o.forEach((function(e){s[e]=function(){process.listeners(e).length===r.count&&(a(),l("exit",null,e),l("afterexit",null,e),process.kill(process.pid,e))}})),e.exports.signals=function(){return o},e.exports.load=f;var c=!1;function f(){c||(c=!0,r.count+=1,o=o.filter((function(e){try{return process.on(e,s[e]),!0}catch(e){return!1}})),process.emit=v,process.reallyExit=p)}var d=process.reallyExit;function p(e){process.exitCode=e||0,l("exit",process.exitCode,null),l("afterexit",process.exitCode,null),d.call(process,process.exitCode)}var h=process.emit;function v(e,t){if("exit"===e){void 0!==t&&(process.exitCode=t);var n=h.apply(this,arguments);return l("exit",process.exitCode,null),l("afterexit",process.exitCode,null),n}return h.apply(this,arguments)}},8082:e=>{e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],"win32"!==process.platform&&e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")},1566:(e,t,n)=>{"use strict";const r=n(7347),i=n(409),o=n(8483),u=["","›"],a=e=>`${u[0]}[${e}m`,l=(e,t,n)=>{let r=[];e=[...e];for(let n of e){const i=n;n.match(";")&&(n=n.split(";")[0][0]+"0");const u=o.codes.get(parseInt(n,10));if(u){const n=e.indexOf(u.toString());n>=0?e.splice(n,1):r.push(a(t?u:i))}else{if(t){r.push(a(0));break}r.push(a(i))}}if(t&&(r=r.filter((e,t)=>r.indexOf(e)===t),void 0!==n)){const e=a(o.codes.get(parseInt(n,10)));r=r.reduce((t,n)=>n===e?[n,...t]:[...t,n],[])}return r.join("")};e.exports=(e,t,n)=>{const o=[...e.normalize()],a=[];n="number"==typeof n?n:o.length;let s,c=!1,f=0,d="";for(const[p,h]of o.entries()){let o=!1;if(u.includes(h)){const t=/\d[^m]*/.exec(e.slice(p,p+18));s=t&&t.length>0?t[0]:void 0,ft&&f<=n)d+=h;else if(f!==t||c||void 0===s){if(f>=n){d+=l(a,!0,s);break}}else d=l(a)}return d}},9796:(e,t,n)=>{"use strict";const r=n(8759),i=[].concat(n(2282).builtinModules,"bootstrap_node","node").map(e=>new RegExp(`(?:\\(${e}\\.js:\\d+:\\d+\\)$|^\\s*at ${e}\\.js:\\d+:\\d+$)`));i.push(/\(internal\/[^:]+:\d+:\d+\)$/,/\s*at internal\/[^:]+:\d+:\d+$/,/\/\.node-spawn-wrap-\w+-\w+\/node:\d+:\d+\)?$/);class o{constructor(e){"internals"in(e={ignoredPackages:[],...e})==!1&&(e.internals=o.nodeInternals()),"cwd"in e==!1&&(e.cwd=process.cwd()),this._cwd=e.cwd.replace(/\\/g,"/"),this._internals=[].concat(e.internals,function(e){if(0===e.length)return[];const t=e.map(e=>r(e));return new RegExp(`[/\\\\]node_modules[/\\\\](?:${t.join("|")})[/\\\\][^:]+:\\d+:\\d+`)}(e.ignoredPackages)),this._wrapCallSite=e.wrapCallSite||!1}static nodeInternals(){return[...i]}clean(e,t=0){t=" ".repeat(t),Array.isArray(e)||(e=e.split("\n")),!/^\s*at /.test(e[0])&&/^\s*at /.test(e[1])&&(e=e.slice(1));let n=!1,r=null;const i=[];return e.forEach(e=>{if(e=e.replace(/\\/g,"/"),this._internals.some(t=>t.test(e)))return;const t=/^\s*at /.test(e);n?e=e.trimEnd().replace(/^(\s+)at /,"$1"):(e=e.trim(),t&&(e=e.slice(3))),(e=e.replace(this._cwd+"/",""))&&(t?(r&&(i.push(r),r=null),i.push(e)):(n=!0,r=e))}),i.map(e=>`${t}${e}\n`).join("")}captureString(e,t=this.captureString){"function"==typeof e&&(t=e,e=1/0);const{stackTraceLimit:n}=Error;e&&(Error.stackTraceLimit=e);const r={};Error.captureStackTrace(r,t);const{stack:i}=r;return Error.stackTraceLimit=n,this.clean(i)}capture(e,t=this.capture){"function"==typeof e&&(t=e,e=1/0);const{prepareStackTrace:n,stackTraceLimit:r}=Error;Error.prepareStackTrace=(e,t)=>this._wrapCallSite?t.map(this._wrapCallSite):t,e&&(Error.stackTraceLimit=e);const i={};Error.captureStackTrace(i,t);const{stack:o}=i;return Object.assign(Error,{prepareStackTrace:n,stackTraceLimit:r}),o}at(e=this.at){const[t]=this.capture(1,e);if(!t)return{};const n={line:t.getLineNumber(),column:t.getColumnNumber()};let r;u(n,t.getFileName(),this._cwd),t.isConstructor()&&(n.constructor=!0),t.isEval()&&(n.evalOrigin=t.getEvalOrigin()),t.isNative()&&(n.native=!0);try{r=t.getTypeName()}catch(e){}r&&"Object"!==r&&"[object Object]"!==r&&(n.type=r);const i=t.getFunctionName();i&&(n.function=i);const o=t.getMethodName();return o&&i!==o&&(n.method=o),n}parseLine(e){const t=e&&e.match(a);if(!t)return null;const n="new"===t[1];let r=t[2];const i=t[3],o=t[4],s=Number(t[5]),c=Number(t[6]);let f=t[7];const d=t[8],p=t[9],h="native"===t[10],v=")"===t[11];let m;const g={};if(d&&(g.line=Number(d)),p&&(g.column=Number(p)),v&&f){let e=0;for(let t=f.length-1;t>0;t--)if(")"===f.charAt(t))e++;else if("("===f.charAt(t)&&" "===f.charAt(t-1)&&(e--,-1===e&&" "===f.charAt(t-1))){const e=f.slice(0,t-1),n=f.slice(t+1);f=n,r+=" ("+e;break}}if(r){const e=r.match(l);e&&(r=e[1],m=e[2])}return u(g,f,this._cwd),n&&(g.constructor=!0),i&&(g.evalOrigin=i,g.evalLine=s,g.evalColumn=c,g.evalFile=o&&o.replace(/\\/g,"/")),h&&(g.native=!0),r&&(g.function=r),m&&r!==m&&(g.method=m),g}}function u(e,t,n){t&&((t=t.replace(/\\/g,"/")).startsWith(n+"/")&&(t=t.slice(n.length+1)),e.file=t)}const a=new RegExp("^(?:\\s*at )?(?:(new) )?(?:(.*?) \\()?(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?(?:(.+?):(\\d+):(\\d+)|(native))(\\)?)$"),l=/^(.*?) \[as (.*?)\]$/;e.exports=o},3262:(e,t,n)=>{"use strict";const r=n(7402),i=n(5640),o=e=>r(e).replace(i()," ").length;e.exports=o,e.exports.default=o},5043:(e,t,n)=>{"use strict";const r=n(7915),i=n(7347),o=n(1013),u=e=>{if("string"!=typeof(e=e.replace(o()," "))||0===e.length)return 0;e=r(e);let t=0;for(let n=0;n=127&&r<=159||(r>=768&&r<=879||(r>65535&&n++,t+=i(r)?2:1))}return t};e.exports=u,e.exports.default=u},7402:(e,t,n)=>{"use strict";const r=n(5378),i=e=>"string"==typeof e?e.replace(r(),""):e;e.exports=i,e.exports.default=i},7915:(e,t,n)=>{"use strict";const r=n(1337);e.exports=e=>"string"==typeof e?e.replace(r(),""):e},9428:(e,t,n)=>{"use strict";const r=n(2087),i=n(3867),o=n(2918),{env:u}=process;let a;function l(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function s(e,t){if(0===a)return 0;if(o("color=16m")||o("color=full")||o("color=truecolor"))return 3;if(o("color=256"))return 2;if(e&&!t&&void 0===a)return 0;const n=a||0;if("dumb"===u.TERM)return n;if("win32"===process.platform){const e=r.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in u)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in u)||"codeship"===u.CI_NAME?1:n;if("TEAMCITY_VERSION"in u)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(u.TEAMCITY_VERSION)?1:0;if("GITHUB_ACTIONS"in u)return 1;if("truecolor"===u.COLORTERM)return 3;if("TERM_PROGRAM"in u){const e=parseInt((u.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(u.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(u.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(u.TERM)||"COLORTERM"in u?1:n}o("no-color")||o("no-colors")||o("color=false")||o("color=never")?a=0:(o("color")||o("colors")||o("color=true")||o("color=always"))&&(a=1),"FORCE_COLOR"in u&&(a="true"===u.FORCE_COLOR?1:"false"===u.FORCE_COLOR?0:0===u.FORCE_COLOR.length?1:Math.min(parseInt(u.FORCE_COLOR,10),3)),e.exports={supportsColor:function(e){return l(s(e,e&&e.isTTY))},stdout:l(s(!0,i.isatty(1))),stderr:l(s(!0,i.isatty(2)))}},8949:(e,t,n)=>{"use strict";const r=n(5043),i=e=>{let t=0;for(const n of e.split("\n"))t=Math.max(t,r(n));return t};e.exports=i,e.exports.default=i},4332:(e,t,n)=>{"use strict";const r=n(5043),i=n(7915),o=n(8483),u=new Set(["","›"]),a=e=>`${u.values().next().value}[${e}m`,l=(e,t,n)=>{const o=[...t];let a=!1,l=r(i(e[e.length-1]));for(const[t,i]of o.entries()){const s=r(i);if(l+s<=n?e[e.length-1]+=i:(e.push(i),l=0),u.has(i))a=!0;else if(a&&"m"===i){a=!1;continue}a||(l+=s,l===n&&t0&&e.length>1&&(e[e.length-2]+=e.pop())},s=e=>{const t=e.split(" ");let n=t.length;for(;n>0&&!(r(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")},c=(e,t,n={})=>{if(!1!==n.trim&&""===e.trim())return"";let i,c="",f="";const d=(e=>e.split(" ").map(e=>r(e)))(e);let p=[""];for(const[i,o]of e.split(" ").entries()){!1!==n.trim&&(p[p.length-1]=p[p.length-1].trimLeft());let e=r(p[p.length-1]);if(0!==i&&(e>=t&&(!1===n.wordWrap||!1===n.trim)&&(p.push(""),e=0),(e>0||!1===n.trim)&&(p[p.length-1]+=" ",e++)),n.hard&&d[i]>t){const n=t-e,r=1+Math.floor((d[i]-n-1)/t);Math.floor((d[i]-1)/t)t&&e>0&&d[i]>0){if(!1===n.wordWrap&&et&&!1===n.wordWrap?l(p,o,t):p[p.length-1]+=o}}!1!==n.trim&&(p=p.map(s)),c=p.join("\n");for(const[e,t]of[...c].entries()){if(f+=t,u.has(t)){const t=parseFloat(/\d[^m]*/.exec(c.slice(e,e+4)));i=39===t?null:t}const n=o.codes.get(Number(i));i&&n&&("\n"===c[e+1]?f+=a(n):"\n"===t&&(f+=a(i)))}return f};e.exports=(e,t,n)=>String(e).normalize().replace(/\r\n/g,"\n").split("\n").map(e=>c(e,t,n)).join("\n")},3354:function(module,exports){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,wrapper;wrapper=function(Module,cb){var Module;"function"==typeof Module&&(cb=Module,Module={}),Module.onRuntimeInitialized=function(e,t){return function(){e&&e.apply(this,arguments);try{Module.ccall("nbind_init")}catch(e){return void t(e)}t(null,{bind:Module._nbind_value,reflect:Module.NBind.reflect,queryType:Module.NBind.queryType,toggleLightGC:Module.toggleLightGC,lib:Module})}}(Module.onRuntimeInitialized,cb),Module||(Module=(void 0!==Module?Module:null)||{});var moduleOverrides={};for(var key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var ENVIRONMENT_IS_WEB=!1,ENVIRONMENT_IS_WORKER=!1,ENVIRONMENT_IS_NODE=!1,ENVIRONMENT_IS_SHELL=!1,nodeFS,nodePath;if(Module.ENVIRONMENT)if("WEB"===Module.ENVIRONMENT)ENVIRONMENT_IS_WEB=!0;else if("WORKER"===Module.ENVIRONMENT)ENVIRONMENT_IS_WORKER=!0;else if("NODE"===Module.ENVIRONMENT)ENVIRONMENT_IS_NODE=!0;else{if("SHELL"!==Module.ENVIRONMENT)throw new Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.");ENVIRONMENT_IS_SHELL=!0}else ENVIRONMENT_IS_WEB="object"==typeof window,ENVIRONMENT_IS_WORKER="function"==typeof importScripts,ENVIRONMENT_IS_NODE="object"==typeof process&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER,ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE)Module.print||(Module.print=console.log),Module.printErr||(Module.printErr=console.warn),Module.read=function(e,t){nodeFS||(nodeFS={}("")),nodePath||(nodePath={}("")),e=nodePath.normalize(e);var n=nodeFS.readFileSync(e);return t?n:n.toString()},Module.readBinary=function(e){var t=Module.read(e,!0);return t.buffer||(t=new Uint8Array(t)),assert(t.buffer),t},Module.load=function(e){globalEval(read(e))},Module.thisProgram||(process.argv.length>1?Module.thisProgram=process.argv[1].replace(/\\/g,"/"):Module.thisProgram="unknown-program"),Module.arguments=process.argv.slice(2),module.exports=Module,Module.inspect=function(){return"[Emscripten Module object]"};else if(ENVIRONMENT_IS_SHELL)Module.print||(Module.print=print),"undefined"!=typeof printErr&&(Module.printErr=printErr),"undefined"!=typeof read?Module.read=read:Module.read=function(){throw"no read() available"},Module.readBinary=function(e){if("function"==typeof readbuffer)return new Uint8Array(readbuffer(e));var t=read(e,"binary");return assert("object"==typeof t),t},"undefined"!=typeof scriptArgs?Module.arguments=scriptArgs:void 0!==arguments&&(Module.arguments=arguments),"function"==typeof quit&&(Module.quit=function(e,t){quit(e)});else{if(!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER)throw"Unknown runtime environment. Where are we?";if(Module.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},ENVIRONMENT_IS_WORKER&&(Module.readBinary=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),Module.readAsync=function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)},void 0!==arguments&&(Module.arguments=arguments),"undefined"!=typeof console)Module.print||(Module.print=function(e){console.log(e)}),Module.printErr||(Module.printErr=function(e){console.warn(e)});else{var TRY_USE_DUMP=!1;Module.print||(Module.print=TRY_USE_DUMP&&"undefined"!=typeof dump?function(e){dump(e)}:function(e){})}ENVIRONMENT_IS_WORKER&&(Module.load=importScripts),void 0===Module.setWindowTitle&&(Module.setWindowTitle=function(e){document.title=e})}function globalEval(e){eval.call(null,e)}for(var key in!Module.load&&Module.read&&(Module.load=function(e){globalEval(Module.read(e))}),Module.print||(Module.print=function(){}),Module.printErr||(Module.printErr=Module.print),Module.arguments||(Module.arguments=[]),Module.thisProgram||(Module.thisProgram="./this.program"),Module.quit||(Module.quit=function(e,t){throw t}),Module.print=Module.print,Module.printErr=Module.printErr,Module.preRun=[],Module.postRun=[],moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);moduleOverrides=void 0;var Runtime={setTempRet0:function(e){return tempRet0=e,e},getTempRet0:function(){return tempRet0},stackSave:function(){return STACKTOP},stackRestore:function(e){STACKTOP=e},getNativeTypeSize:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:if("*"===e[e.length-1])return Runtime.QUANTUM_SIZE;if("i"===e[0]){var t=parseInt(e.substr(1));return assert(t%8==0),t/8}return 0}},getNativeFieldSize:function(e){return Math.max(Runtime.getNativeTypeSize(e),Runtime.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(e,t){return"double"===t||"i64"===t?7&e&&(assert(4==(7&e)),e+=4):assert(0==(3&e)),e},getAlignSize:function(e,t,n){return n||"i64"!=e&&"double"!=e?e?Math.min(t||(e?Runtime.getNativeFieldSize(e):0),Runtime.QUANTUM_SIZE):Math.min(t,8):8},dynCall:function(e,t,n){return n&&n.length?Module["dynCall_"+e].apply(null,[t].concat(n)):Module["dynCall_"+e].call(null,t)},functionPointers:[],addFunction:function(e){for(var t=0;t>2],n=-16&(t+e+15|0);return HEAP32[DYNAMICTOP_PTR>>2]=n,n>=TOTAL_MEMORY&&!enlargeMemory()?(HEAP32[DYNAMICTOP_PTR>>2]=t,0):t},alignMemory:function(e,t){return e=Math.ceil(e/(t||16))*(t||16)},makeBigInt:function(e,t,n){return n?+(e>>>0)+4294967296*+(t>>>0):+(e>>>0)+4294967296*+(0|t)},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module.Runtime=Runtime;var ABORT=0,EXITSTATUS=0,cwrap,ccall;function assert(e,t){e||abort("Assertion failed: "+t)}function getCFunc(ident){var func=Module["_"+ident];if(!func)try{func=eval("_"+ident)}catch(e){}return assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)"),func}function setValue(e,t,n,r){switch("*"===(n=n||"i8").charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":HEAP8[e>>0]=t;break;case"i16":HEAP16[e>>1]=t;break;case"i32":HEAP32[e>>2]=t;break;case"i64":tempI64=[t>>>0,(tempDouble=t,+Math_abs(tempDouble)>=1?tempDouble>0?(0|Math_min(+Math_floor(tempDouble/4294967296),4294967295))>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[e>>2]=tempI64[0],HEAP32[e+4>>2]=tempI64[1];break;case"float":HEAPF32[e>>2]=t;break;case"double":HEAPF64[e>>3]=t;break;default:abort("invalid type for setValue: "+n)}}function getValue(e,t,n){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return HEAP8[e>>0];case"i16":return HEAP16[e>>1];case"i32":case"i64":return HEAP32[e>>2];case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];default:abort("invalid type for setValue: "+t)}return null}!function(){var JSfuncs={stackSave:function(){Runtime.stackSave()},stackRestore:function(){Runtime.stackRestore()},arrayToC:function(e){var t=Runtime.stackAlloc(e.length);return writeArrayToMemory(e,t),t},stringToC:function(e){var t=0;if(null!=e&&0!==e){var n=1+(e.length<<2);stringToUTF8(e,t=Runtime.stackAlloc(n),n)}return t}},toC={string:JSfuncs.stringToC,array:JSfuncs.arrayToC};ccall=function(e,t,n,r,i){var o=getCFunc(e),u=[],a=0;if(r)for(var l=0;l>2]=0;for(l=u+o;r>0]=0;return u}if("i8"===a)return e.subarray||e.slice?HEAPU8.set(e,u):HEAPU8.set(new Uint8Array(e),u),u;for(var s,c,f,d=0;d>0],(0!=n||t)&&(i++,!t||i!=t););t||(t=i);var o="";if(r<128){for(var u;t>0;)u=String.fromCharCode.apply(String,HEAPU8.subarray(e,e+Math.min(t,1024))),o=o?o+u:u,e+=1024,t-=1024;return o}return Module.UTF8ToString(e)}function AsciiToString(e){for(var t="";;){var n=HEAP8[e++>>0];if(!n)return t;t+=String.fromCharCode(n)}}function stringToAscii(e,t){return writeAsciiToMemory(e,t,!1)}Module.ALLOC_NORMAL=ALLOC_NORMAL,Module.ALLOC_STACK=ALLOC_STACK,Module.ALLOC_STATIC=ALLOC_STATIC,Module.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module.ALLOC_NONE=ALLOC_NONE,Module.allocate=allocate,Module.getMemory=getMemory,Module.Pointer_stringify=Pointer_stringify,Module.AsciiToString=AsciiToString,Module.stringToAscii=stringToAscii;var UTF8Decoder="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function UTF8ArrayToString(e,t){for(var n=t;e[n];)++n;if(n-t>16&&e.subarray&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,n));for(var r,i,o,u,a,l="";;){if(!(r=e[t++]))return l;if(128&r)if(i=63&e[t++],192!=(224&r))if(o=63&e[t++],224==(240&r)?r=(15&r)<<12|i<<6|o:(u=63&e[t++],240==(248&r)?r=(7&r)<<18|i<<12|o<<6|u:(a=63&e[t++],r=248==(252&r)?(3&r)<<24|i<<18|o<<12|u<<6|a:(1&r)<<30|i<<24|o<<18|u<<12|a<<6|63&e[t++])),r<65536)l+=String.fromCharCode(r);else{var s=r-65536;l+=String.fromCharCode(55296|s>>10,56320|1023&s)}else l+=String.fromCharCode((31&r)<<6|i);else l+=String.fromCharCode(r)}}function UTF8ToString(e){return UTF8ArrayToString(HEAPU8,e)}function stringToUTF8Array(e,t,n,r){if(!(r>0))return 0;for(var i=n,o=n+r-1,u=0;u=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++u)),a<=127){if(n>=o)break;t[n++]=a}else if(a<=2047){if(n+1>=o)break;t[n++]=192|a>>6,t[n++]=128|63&a}else if(a<=65535){if(n+2>=o)break;t[n++]=224|a>>12,t[n++]=128|a>>6&63,t[n++]=128|63&a}else if(a<=2097151){if(n+3>=o)break;t[n++]=240|a>>18,t[n++]=128|a>>12&63,t[n++]=128|a>>6&63,t[n++]=128|63&a}else if(a<=67108863){if(n+4>=o)break;t[n++]=248|a>>24,t[n++]=128|a>>18&63,t[n++]=128|a>>12&63,t[n++]=128|a>>6&63,t[n++]=128|63&a}else{if(n+5>=o)break;t[n++]=252|a>>30,t[n++]=128|a>>24&63,t[n++]=128|a>>18&63,t[n++]=128|a>>12&63,t[n++]=128|a>>6&63,t[n++]=128|63&a}}return t[n]=0,n-i}function stringToUTF8(e,t,n){return stringToUTF8Array(e,HEAPU8,t,n)}function lengthBytesUTF8(e){for(var t=0,n=0;n=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++n)),r<=127?++t:t+=r<=2047?2:r<=65535?3:r<=2097151?4:r<=67108863?5:6}return t}Module.UTF8ArrayToString=UTF8ArrayToString,Module.UTF8ToString=UTF8ToString,Module.stringToUTF8Array=stringToUTF8Array,Module.stringToUTF8=stringToUTF8,Module.lengthBytesUTF8=lengthBytesUTF8;var UTF16Decoder="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,HEAP,buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,STATIC_BASE,STATICTOP,staticSealed,STACK_BASE,STACKTOP,STACK_MAX,DYNAMIC_BASE,DYNAMICTOP_PTR;function demangle(e){var t=Module.___cxa_demangle||Module.__cxa_demangle;if(t){try{var n=e.substr(1),r=lengthBytesUTF8(n)+1,i=_malloc(r);stringToUTF8(n,i,r);var o=_malloc(4),u=t(i,0,0,o);if(0===getValue(o,"i32")&&u)return Pointer_stringify(u)}catch(e){}finally{i&&_free(i),o&&_free(o),u&&_free(u)}return e}return Runtime.warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),e}function demangleAll(e){return e.replace(/__Z[\w\d_]+/g,(function(e){var t=demangle(e);return e===t?e:e+" ["+t+"]"}))}function jsStackTrace(){var e=new Error;if(!e.stack){try{throw new Error(0)}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}function stackTrace(){var e=jsStackTrace();return Module.extraStackTrace&&(e+="\n"+Module.extraStackTrace()),demangleAll(e)}function updateGlobalBufferViews(){Module.HEAP8=HEAP8=new Int8Array(buffer),Module.HEAP16=HEAP16=new Int16Array(buffer),Module.HEAP32=HEAP32=new Int32Array(buffer),Module.HEAPU8=HEAPU8=new Uint8Array(buffer),Module.HEAPU16=HEAPU16=new Uint16Array(buffer),Module.HEAPU32=HEAPU32=new Uint32Array(buffer),Module.HEAPF32=HEAPF32=new Float32Array(buffer),Module.HEAPF64=HEAPF64=new Float64Array(buffer)}function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+TOTAL_MEMORY+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}function enlargeMemory(){abortOnCannotGrowMemory()}Module.stackTrace=stackTrace,STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0,staticSealed=!1;var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||134217728;function getTotalMemory(){return TOTAL_MEMORY}if(TOTAL_MEMORY0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?Module.dynCall_v(n):Module.dynCall_vi(n,t.arg):n(void 0===t.arg?null:t.arg)}else t()}}Module.HEAP=HEAP,Module.buffer=buffer,Module.HEAP8=HEAP8,Module.HEAP16=HEAP16,Module.HEAP32=HEAP32,Module.HEAPU8=HEAPU8,Module.HEAPU16=HEAPU16,Module.HEAPU32=HEAPU32,Module.HEAPF32=HEAPF32,Module.HEAPF64=HEAPF64;var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1,runtimeExited=!1;function preRun(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__),runtimeExited=!0}function postRun(){if(Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPreMain(e){__ATMAIN__.unshift(e)}function addOnExit(e){__ATEXIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}function intArrayFromString(e,t,n){var r=n>0?n:lengthBytesUTF8(e)+1,i=new Array(r),o=stringToUTF8Array(e,i,0,i.length);return t&&(i.length=o),i}function intArrayToString(e){for(var t=[],n=0;n255&&(r&=255),t.push(String.fromCharCode(r))}return t.join("")}function writeStringToMemory(e,t,n){var r,i;Runtime.warnOnce("writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!"),n&&(i=t+lengthBytesUTF8(e),r=HEAP8[i]),stringToUTF8(e,t,1/0),n&&(HEAP8[i]=r)}function writeArrayToMemory(e,t){HEAP8.set(e,t)}function writeAsciiToMemory(e,t,n){for(var r=0;r>0]=e.charCodeAt(r);n||(HEAP8[t>>0]=0)}if(Module.addOnPreRun=addOnPreRun,Module.addOnInit=addOnInit,Module.addOnPreMain=addOnPreMain,Module.addOnExit=addOnExit,Module.addOnPostRun=addOnPostRun,Module.intArrayFromString=intArrayFromString,Module.intArrayToString=intArrayToString,Module.writeStringToMemory=writeStringToMemory,Module.writeArrayToMemory=writeArrayToMemory,Module.writeAsciiToMemory=writeAsciiToMemory,Math.imul&&-5===Math.imul(4294967295,5)||(Math.imul=function(e,t){var n=65535&e,r=65535&t;return n*r+((e>>>16)*r+n*(t>>>16)<<16)|0}),Math.imul=Math.imul,!Math.fround){var froundBuffer=new Float32Array(1);Math.fround=function(e){return froundBuffer[0]=e,froundBuffer[0]}}Math.fround=Math.fround,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.clz32=Math.clz32,Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Math.trunc=Math.trunc;var Math_abs=Math.abs,Math_cos=Math.cos,Math_sin=Math.sin,Math_tan=Math.tan,Math_acos=Math.acos,Math_asin=Math.asin,Math_atan=Math.atan,Math_atan2=Math.atan2,Math_exp=Math.exp,Math_log=Math.log,Math_sqrt=Math.sqrt,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_pow=Math.pow,Math_imul=Math.imul,Math_fround=Math.fround,Math_round=Math.round,Math_min=Math.min,Math_clz32=Math.clz32,Math_trunc=Math.trunc,runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(e){return e}function addRunDependency(e){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}}Module.addRunDependency=addRunDependency,Module.removeRunDependency=removeRunDependency,Module.preloadedImages={},Module.preloadedAudios={};var ASM_CONSTS=[function(e,t,n,r,i,o,u,a){return _nbind.callbackSignatureList[e].apply(this,arguments)}];function _emscripten_asm_const_iiiiiiii(e,t,n,r,i,o,u,a){return ASM_CONSTS[e](t,n,r,i,o,u,a)}function _emscripten_asm_const_iiiii(e,t,n,r,i){return ASM_CONSTS[e](t,n,r,i)}function _emscripten_asm_const_iiidddddd(e,t,n,r,i,o,u,a,l){return ASM_CONSTS[e](t,n,r,i,o,u,a,l)}function _emscripten_asm_const_iiididi(e,t,n,r,i,o,u){return ASM_CONSTS[e](t,n,r,i,o,u)}function _emscripten_asm_const_iiii(e,t,n,r){return ASM_CONSTS[e](t,n,r)}function _emscripten_asm_const_iiiid(e,t,n,r,i){return ASM_CONSTS[e](t,n,r,i)}function _emscripten_asm_const_iiiiii(e,t,n,r,i,o){return ASM_CONSTS[e](t,n,r,i,o)}STATIC_BASE=Runtime.GLOBAL_BASE,STATICTOP=STATIC_BASE+12800,__ATINIT__.push({func:function(){__GLOBAL__sub_I_Yoga_cpp()}},{func:function(){__GLOBAL__sub_I_nbind_cc()}},{func:function(){__GLOBAL__sub_I_common_cc()}},{func:function(){__GLOBAL__sub_I_Binding_cc()}}),allocate([0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,192,127,0,0,192,127,0,0,192,127,3,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,3,0,0,0,0,0,192,127,3,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,192,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,192,127,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,0,128,191,0,0,128,191,0,0,192,127,0,0,0,0,0,0,0,0,0,0,128,63,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,3,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,190,12,0,0,200,12,0,0,208,12,0,0,216,12,0,0,230,12,0,0,242,12,0,0,1,0,0,0,3,0,0,0,0,0,0,0,2,0,0,0,0,0,192,127,3,0,0,0,180,45,0,0,181,45,0,0,182,45,0,0,181,45,0,0,182,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,1,0,0,0,4,0,0,0,183,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,184,45,0,0,185,45,0,0,181,45,0,0,181,45,0,0,182,45,0,0,186,45,0,0,185,45,0,0,148,4,0,0,3,0,0,0,187,45,0,0,164,4,0,0,188,45,0,0,2,0,0,0,189,45,0,0,164,4,0,0,188,45,0,0,185,45,0,0,164,4,0,0,185,45,0,0,164,4,0,0,188,45,0,0,181,45,0,0,182,45,0,0,181,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,5,0,0,0,6,0,0,0,1,0,0,0,7,0,0,0,183,45,0,0,182,45,0,0,181,45,0,0,190,45,0,0,190,45,0,0,182,45,0,0,182,45,0,0,185,45,0,0,181,45,0,0,185,45,0,0,182,45,0,0,181,45,0,0,185,45,0,0,182,45,0,0,185,45,0,0,48,5,0,0,3,0,0,0,56,5,0,0,1,0,0,0,189,45,0,0,185,45,0,0,164,4,0,0,76,5,0,0,2,0,0,0,191,45,0,0,186,45,0,0,182,45,0,0,185,45,0,0,192,45,0,0,185,45,0,0,182,45,0,0,186,45,0,0,185,45,0,0,76,5,0,0,76,5,0,0,136,5,0,0,182,45,0,0,181,45,0,0,2,0,0,0,190,45,0,0,136,5,0,0,56,19,0,0,156,5,0,0,2,0,0,0,184,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,8,0,0,0,9,0,0,0,1,0,0,0,10,0,0,0,204,5,0,0,181,45,0,0,181,45,0,0,2,0,0,0,180,45,0,0,204,5,0,0,2,0,0,0,195,45,0,0,236,5,0,0,97,19,0,0,198,45,0,0,211,45,0,0,212,45,0,0,213,45,0,0,214,45,0,0,215,45,0,0,188,45,0,0,182,45,0,0,216,45,0,0,217,45,0,0,218,45,0,0,219,45,0,0,192,45,0,0,181,45,0,0,0,0,0,0,185,45,0,0,110,19,0,0,186,45,0,0,115,19,0,0,221,45,0,0,120,19,0,0,148,4,0,0,132,19,0,0,96,6,0,0,145,19,0,0,222,45,0,0,164,19,0,0,223,45,0,0,173,19,0,0,0,0,0,0,3,0,0,0,104,6,0,0,1,0,0,0,187,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,11,0,0,0,12,0,0,0,1,0,0,0,13,0,0,0,185,45,0,0,224,45,0,0,164,6,0,0,188,45,0,0,172,6,0,0,180,6,0,0,2,0,0,0,188,6,0,0,7,0,0,0,224,45,0,0,7,0,0,0,164,6,0,0,1,0,0,0,213,45,0,0,185,45,0,0,224,45,0,0,172,6,0,0,185,45,0,0,224,45,0,0,164,6,0,0,185,45,0,0,224,45,0,0,211,45,0,0,211,45,0,0,222,45,0,0,211,45,0,0,224,45,0,0,222,45,0,0,211,45,0,0,224,45,0,0,172,6,0,0,222,45,0,0,211,45,0,0,224,45,0,0,188,45,0,0,222,45,0,0,211,45,0,0,40,7,0,0,188,45,0,0,2,0,0,0,224,45,0,0,185,45,0,0,188,45,0,0,188,45,0,0,188,45,0,0,188,45,0,0,222,45,0,0,224,45,0,0,148,4,0,0,185,45,0,0,148,4,0,0,148,4,0,0,148,4,0,0,148,4,0,0,148,4,0,0,185,45,0,0,164,6,0,0,148,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,14,0,0,0,15,0,0,0,1,0,0,0,16,0,0,0,148,7,0,0,2,0,0,0,225,45,0,0,183,45,0,0,188,45,0,0,168,7,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,234,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,148,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,9,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,2,0,0,0,242,45,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,111,117,108,100,32,110,111,116,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,32,102,111,114,32,110,111,100,101,0,67,97,110,110,111,116,32,114,101,115,101,116,32,97,32,110,111,100,101,32,119,104,105,99,104,32,115,116,105,108,108,32,104,97,115,32,99,104,105,108,100,114,101,110,32,97,116,116,97,99,104,101,100,0,67,97,110,110,111,116,32,114,101,115,101,116,32,97,32,110,111,100,101,32,115,116,105,108,108,32,97,116,116,97,99,104,101,100,32,116,111,32,97,32,112,97,114,101,110,116,0,67,111,117,108,100,32,110,111,116,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,32,102,111,114,32,99,111,110,102,105,103,0,67,97,110,110,111,116,32,115,101,116,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,58,32,78,111,100,101,115,32,119,105,116,104,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,32,99,97,110,110,111,116,32,104,97,118,101,32,99,104,105,108,100,114,101,110,46,0,67,104,105,108,100,32,97,108,114,101,97,100,121,32,104,97,115,32,97,32,112,97,114,101,110,116,44,32,105,116,32,109,117,115,116,32,98,101,32,114,101,109,111,118,101,100,32,102,105,114,115,116,46,0,67,97,110,110,111,116,32,97,100,100,32,99,104,105,108,100,58,32,78,111,100,101,115,32,119,105,116,104,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,32,99,97,110,110,111,116,32,104,97,118,101,32,99,104,105,108,100,114,101,110,46,0,79,110,108,121,32,108,101,97,102,32,110,111,100,101,115,32,119,105,116,104,32,99,117,115,116,111,109,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,115,104,111,117,108,100,32,109,97,110,117,97,108,108,121,32,109,97,114,107,32,116,104,101,109,115,101,108,118,101,115,32,97,115,32,100,105,114,116,121,0,67,97,110,110,111,116,32,103,101,116,32,108,97,121,111,117,116,32,112,114,111,112,101,114,116,105,101,115,32,111,102,32,109,117,108,116,105,45,101,100,103,101,32,115,104,111,114,116,104,97,110,100,115,0,37,115,37,100,46,123,91,115,107,105,112,112,101,100,93,32,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,97,119,58,32,37,102,32,97,104,58,32,37,102,32,61,62,32,100,58,32,40,37,102,44,32,37,102,41,32,37,115,10,0,37,115,37,100,46,123,37,115,0,42,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,97,119,58,32,37,102,32,97,104,58,32,37,102,32,37,115,10,0,37,115,37,100,46,125,37,115,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,100,58,32,40,37,102,44,32,37,102,41,32,37,115,10,0,79,117,116,32,111,102,32,99,97,99,104,101,32,101,110,116,114,105,101,115,33,10,0,83,99,97,108,101,32,102,97,99,116,111,114,32,115,104,111,117,108,100,32,110,111,116,32,98,101,32,108,101,115,115,32,116,104,97,110,32,122,101,114,111,0,105,110,105,116,105,97,108,0,37,115,10,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,85,78,68,69,70,73,78,69,68,0,69,88,65,67,84,76,89,0,65,84,95,77,79,83,84,0,76,65,89,95,85,78,68,69,70,73,78,69,68,0,76,65,89,95,69,88,65,67,84,76,89,0,76,65,89,95,65,84,95,77,79,83,84,0,97,118,97,105,108,97,98,108,101,87,105,100,116,104,32,105,115,32,105,110,100,101,102,105,110,105,116,101,32,115,111,32,119,105,100,116,104,77,101,97,115,117,114,101,77,111,100,101,32,109,117,115,116,32,98,101,32,89,71,77,101,97,115,117,114,101,77,111,100,101,85,110,100,101,102,105,110,101,100,0,97,118,97,105,108,97,98,108,101,72,101,105,103,104,116,32,105,115,32,105,110,100,101,102,105,110,105,116,101,32,115,111,32,104,101,105,103,104,116,77,101,97,115,117,114,101,77,111,100,101,32,109,117,115,116,32,98,101,32,89,71,77,101,97,115,117,114,101,77,111,100,101,85,110,100,101,102,105,110,101,100,0,102,108,101,120,0,115,116,114,101,116,99,104,0,109,117,108,116,105,108,105,110,101,45,115,116,114,101,116,99,104,0,69,120,112,101,99,116,101,100,32,110,111,100,101,32,116,111,32,104,97,118,101,32,99,117,115,116,111,109,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,0,109,101,97,115,117,114,101,0,69,120,112,101,99,116,32,99,117,115,116,111,109,32,98,97,115,101,108,105,110,101,32,102,117,110,99,116,105,111,110,32,116,111,32,110,111,116,32,114,101,116,117,114,110,32,78,97,78,0,97,98,115,45,109,101,97,115,117,114,101,0,97,98,115,45,108,97,121,111,117,116,0,78,111,100,101,0,99,114,101,97,116,101,68,101,102,97,117,108,116,0,99,114,101,97,116,101,87,105,116,104,67,111,110,102,105,103,0,100,101,115,116,114,111,121,0,114,101,115,101,116,0,99,111,112,121,83,116,121,108,101,0,115,101,116,80,111,115,105,116,105,111,110,84,121,112,101,0,115,101,116,80,111,115,105,116,105,111,110,0,115,101,116,80,111,115,105,116,105,111,110,80,101,114,99,101,110,116,0,115,101,116,65,108,105,103,110,67,111,110,116,101,110,116,0,115,101,116,65,108,105,103,110,73,116,101,109,115,0,115,101,116,65,108,105,103,110,83,101,108,102,0,115,101,116,70,108,101,120,68,105,114,101,99,116,105,111,110,0,115,101,116,70,108,101,120,87,114,97,112,0,115,101,116,74,117,115,116,105,102,121,67,111,110,116,101,110,116,0,115,101,116,77,97,114,103,105,110,0,115,101,116,77,97,114,103,105,110,80,101,114,99,101,110,116,0,115,101,116,77,97,114,103,105,110,65,117,116,111,0,115,101,116,79,118,101,114,102,108,111,119,0,115,101,116,68,105,115,112,108,97,121,0,115,101,116,70,108,101,120,0,115,101,116,70,108,101,120,66,97,115,105,115,0,115,101,116,70,108,101,120,66,97,115,105,115,80,101,114,99,101,110,116,0,115,101,116,70,108,101,120,71,114,111,119,0,115,101,116,70,108,101,120,83,104,114,105,110,107,0,115,101,116,87,105,100,116,104,0,115,101,116,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,87,105,100,116,104,65,117,116,111,0,115,101,116,72,101,105,103,104,116,0,115,101,116,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,72,101,105,103,104,116,65,117,116,111,0,115,101,116,77,105,110,87,105,100,116,104,0,115,101,116,77,105,110,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,77,105,110,72,101,105,103,104,116,0,115,101,116,77,105,110,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,77,97,120,87,105,100,116,104,0,115,101,116,77,97,120,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,77,97,120,72,101,105,103,104,116,0,115,101,116,77,97,120,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,65,115,112,101,99,116,82,97,116,105,111,0,115,101,116,66,111,114,100,101,114,0,115,101,116,80,97,100,100,105,110,103,0,115,101,116,80,97,100,100,105,110,103,80,101,114,99,101,110,116,0,103,101,116,80,111,115,105,116,105,111,110,84,121,112,101,0,103,101,116,80,111,115,105,116,105,111,110,0,103,101,116,65,108,105,103,110,67,111,110,116,101,110,116,0,103,101,116,65,108,105,103,110,73,116,101,109,115,0,103,101,116,65,108,105,103,110,83,101,108,102,0,103,101,116,70,108,101,120,68,105,114,101,99,116,105,111,110,0,103,101,116,70,108,101,120,87,114,97,112,0,103,101,116,74,117,115,116,105,102,121,67,111,110,116,101,110,116,0,103,101,116,77,97,114,103,105,110,0,103,101,116,70,108,101,120,66,97,115,105,115,0,103,101,116,70,108,101,120,71,114,111,119,0,103,101,116,70,108,101,120,83,104,114,105,110,107,0,103,101,116,87,105,100,116,104,0,103,101,116,72,101,105,103,104,116,0,103,101,116,77,105,110,87,105,100,116,104,0,103,101,116,77,105,110,72,101,105,103,104,116,0,103,101,116,77,97,120,87,105,100,116,104,0,103,101,116,77,97,120,72,101,105,103,104,116,0,103,101,116,65,115,112,101,99,116,82,97,116,105,111,0,103,101,116,66,111,114,100,101,114,0,103,101,116,79,118,101,114,102,108,111,119,0,103,101,116,68,105,115,112,108,97,121,0,103,101,116,80,97,100,100,105,110,103,0,105,110,115,101,114,116,67,104,105,108,100,0,114,101,109,111,118,101,67,104,105,108,100,0,103,101,116,67,104,105,108,100,67,111,117,110,116,0,103,101,116,80,97,114,101,110,116,0,103,101,116,67,104,105,108,100,0,115,101,116,77,101,97,115,117,114,101,70,117,110,99,0,117,110,115,101,116,77,101,97,115,117,114,101,70,117,110,99,0,109,97,114,107,68,105,114,116,121,0,105,115,68,105,114,116,121,0,99,97,108,99,117,108,97,116,101,76,97,121,111,117,116,0,103,101,116,67,111,109,112,117,116,101,100,76,101,102,116,0,103,101,116,67,111,109,112,117,116,101,100,82,105,103,104,116,0,103,101,116,67,111,109,112,117,116,101,100,84,111,112,0,103,101,116,67,111,109,112,117,116,101,100,66,111,116,116,111,109,0,103,101,116,67,111,109,112,117,116,101,100,87,105,100,116,104,0,103,101,116,67,111,109,112,117,116,101,100,72,101,105,103,104,116,0,103,101,116,67,111,109,112,117,116,101,100,76,97,121,111,117,116,0,103,101,116,67,111,109,112,117,116,101,100,77,97,114,103,105,110,0,103,101,116,67,111,109,112,117,116,101,100,66,111,114,100,101,114,0,103,101,116,67,111,109,112,117,116,101,100,80,97,100,100,105,110,103,0,67,111,110,102,105,103,0,99,114,101,97,116,101,0,115,101,116,69,120,112,101,114,105,109,101,110,116,97,108,70,101,97,116,117,114,101,69,110,97,98,108,101,100,0,115,101,116,80,111,105,110,116,83,99,97,108,101,70,97,99,116,111,114,0,105,115,69,120,112,101,114,105,109,101,110,116,97,108,70,101,97,116,117,114,101,69,110,97,98,108,101,100,0,86,97,108,117,101,0,76,97,121,111,117,116,0,83,105,122,101,0,103,101,116,73,110,115,116,97,110,99,101,67,111,117,110,116,0,73,110,116,54,52,0,1,1,1,2,2,4,4,4,4,8,8,4,8,118,111,105,100,0,98,111,111,108,0,115,116,100,58,58,115,116,114,105,110,103,0,99,98,70,117,110,99,116,105,111,110,32,38,0,99,111,110,115,116,32,99,98,70,117,110,99,116,105,111,110,32,38,0,69,120,116,101,114,110,97,108,0,66,117,102,102,101,114,0,78,66,105,110,100,73,68,0,78,66,105,110,100,0,98,105,110,100,95,118,97,108,117,101,0,114,101,102,108,101,99,116,0,113,117,101,114,121,84,121,112,101,0,108,97,108,108,111,99,0,108,114,101,115,101,116,0,123,114,101,116,117,114,110,40,95,110,98,105,110,100,46,99,97,108,108,98,97,99,107,83,105,103,110,97,116,117,114,101,76,105,115,116,91,36,48,93,46,97,112,112,108,121,40,116,104,105,115,44,97,114,103,117,109,101,110,116,115,41,41,59,125,0,95,110,98,105,110,100,95,110,101,119,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,46,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE);var tempDoublePtr=STATICTOP;function _atexit(e,t){__ATEXIT__.unshift({func:e,arg:t})}function ___cxa_atexit(){return _atexit.apply(null,arguments)}function _abort(){Module.abort()}function __ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj(){Module.printErr("missing function: _ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj"),abort(-1)}function __decorate(e,t,n,r){var i,o=arguments.length,u=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(u=(o<3?i(u):o>3?i(t,n,u):i(t,n))||u);return o>3&&u&&Object.defineProperty(t,n,u),u}function _defineHidden(e){return function(t,n){Object.defineProperty(t,n,{configurable:!1,enumerable:!1,value:e,writable:!0})}}STATICTOP+=16;var _nbind={};function __nbind_free_external(e){_nbind.externalList[e].dereference(e)}function __nbind_reference_external(e){_nbind.externalList[e].reference()}function _llvm_stackrestore(e){var t=_llvm_stacksave,n=t.LLVM_SAVEDSTACKS[e];t.LLVM_SAVEDSTACKS.splice(e,1),Runtime.stackRestore(n)}function __nbind_register_pool(e,t,n,r){_nbind.Pool.pageSize=e,_nbind.Pool.usedPtr=t/4,_nbind.Pool.rootPtr=n,_nbind.Pool.pagePtr=r/4,HEAP32[t/4]=16909060,1==HEAP8[t]&&(_nbind.bigEndian=!0),HEAP32[t/4]=0,_nbind.makeTypeKindTbl=((i={})[1024]=_nbind.PrimitiveType,i[64]=_nbind.Int64Type,i[2048]=_nbind.BindClass,i[3072]=_nbind.BindClassPtr,i[4096]=_nbind.SharedClassPtr,i[5120]=_nbind.ArrayType,i[6144]=_nbind.ArrayType,i[7168]=_nbind.CStringType,i[9216]=_nbind.CallbackType,i[10240]=_nbind.BindType,i),_nbind.makeTypeNameTbl={Buffer:_nbind.BufferType,External:_nbind.ExternalType,Int64:_nbind.Int64Type,_nbind_new:_nbind.CreateValueType,bool:_nbind.BooleanType,"cbFunction &":_nbind.CallbackType,"const cbFunction &":_nbind.CallbackType,"const std::string &":_nbind.StringType,"std::string":_nbind.StringType},Module.toggleLightGC=_nbind.toggleLightGC,_nbind.callUpcast=Module.dynCall_ii;var i,o=_nbind.makeType(_nbind.constructType,{flags:2048,id:0,name:""});o.proto=Module,_nbind.BindClass.list.push(o)}function _emscripten_set_main_loop_timing(e,t){if(Browser.mainLoop.timingMode=e,Browser.mainLoop.timingValue=t,!Browser.mainLoop.func)return 1;if(0==e)Browser.mainLoop.scheduler=function(){var e=0|Math.max(0,Browser.mainLoop.tickStartTime+t-_emscripten_get_now());setTimeout(Browser.mainLoop.runner,e)},Browser.mainLoop.method="timeout";else if(1==e)Browser.mainLoop.scheduler=function(){Browser.requestAnimationFrame(Browser.mainLoop.runner)},Browser.mainLoop.method="rAF";else if(2==e){if(!window.setImmediate){var n=[];window.addEventListener("message",(function(e){e.source===window&&"setimmediate"===e.data&&(e.stopPropagation(),n.shift()())}),!0),window.setImmediate=function(e){n.push(e),ENVIRONMENT_IS_WORKER?(void 0===Module.setImmediates&&(Module.setImmediates=[]),Module.setImmediates.push(e),window.postMessage({target:"setimmediate"})):window.postMessage("setimmediate","*")}}Browser.mainLoop.scheduler=function(){window.setImmediate(Browser.mainLoop.runner)},Browser.mainLoop.method="immediate"}return 0}function _emscripten_get_now(){abort()}function _emscripten_set_main_loop(e,t,n,r,i){var o;Module.noExitRuntime=!0,assert(!Browser.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Browser.mainLoop.func=e,Browser.mainLoop.arg=r,o=void 0!==r?function(){Module.dynCall_vi(e,r)}:function(){Module.dynCall_v(e)};var u=Browser.mainLoop.currentlyRunningMainloop;if(Browser.mainLoop.runner=function(){if(!ABORT)if(Browser.mainLoop.queue.length>0){var e=Date.now(),t=Browser.mainLoop.queue.shift();if(t.func(t.arg),Browser.mainLoop.remainingBlockers){var n=Browser.mainLoop.remainingBlockers,r=n%1==0?n-1:Math.floor(n);t.counted?Browser.mainLoop.remainingBlockers=r:(r+=.5,Browser.mainLoop.remainingBlockers=(8*n+r)/9)}if(console.log('main loop blocker "'+t.name+'" took '+(Date.now()-e)+" ms"),Browser.mainLoop.updateStatus(),u1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0?Browser.mainLoop.scheduler():(0==Browser.mainLoop.timingMode&&(Browser.mainLoop.tickStartTime=_emscripten_get_now()),"timeout"===Browser.mainLoop.method&&Module.ctx&&(Module.printErr("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"),Browser.mainLoop.method=""),Browser.mainLoop.runIter(o),u0?_emscripten_set_main_loop_timing(0,1e3/t):_emscripten_set_main_loop_timing(1,1),Browser.mainLoop.scheduler()),n)throw"SimulateInfiniteLoop"}var Browser={mainLoop:{scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){Browser.mainLoop.scheduler=null,Browser.mainLoop.currentlyRunningMainloop++},resume:function(){Browser.mainLoop.currentlyRunningMainloop++;var e=Browser.mainLoop.timingMode,t=Browser.mainLoop.timingValue,n=Browser.mainLoop.func;Browser.mainLoop.func=null,_emscripten_set_main_loop(n,0,!1,Browser.mainLoop.arg,!0),_emscripten_set_main_loop_timing(e,t),Browser.mainLoop.scheduler()},updateStatus:function(){if(Module.setStatus){var e=Module.statusMessage||"Please wait...",t=Browser.mainLoop.remainingBlockers,n=Browser.mainLoop.expectedBlockers;t?t=6;){var u=r>>i-6&63;i-=6,n+=t[u]}return 2==i?(n+=t[(3&r)<<4],n+="=="):4==i&&(n+=t[(15&r)<<2],n+="="),n}(e),o(s))},s.src=l,Browser.safeSetTimeout((function(){o(s)}),1e4)}};Module.preloadPlugins.push(t);var n=Module.canvas;n&&(n.requestPointerLock=n.requestPointerLock||n.mozRequestPointerLock||n.webkitRequestPointerLock||n.msRequestPointerLock||function(){},n.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},n.exitPointerLock=n.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",r,!1),document.addEventListener("mozpointerlockchange",r,!1),document.addEventListener("webkitpointerlockchange",r,!1),document.addEventListener("mspointerlockchange",r,!1),Module.elementPointerLock&&n.addEventListener("click",(function(e){!Browser.pointerLock&&Module.canvas.requestPointerLock&&(Module.canvas.requestPointerLock(),e.preventDefault())}),!1))}function r(){Browser.pointerLock=document.pointerLockElement===Module.canvas||document.mozPointerLockElement===Module.canvas||document.webkitPointerLockElement===Module.canvas||document.msPointerLockElement===Module.canvas}},createContext:function(e,t,n,r){if(t&&Module.ctx&&e==Module.canvas)return Module.ctx;var i,o;if(t){var u={antialias:!1,alpha:!1};if(r)for(var a in r)u[a]=r[a];(o=GL.createContext(e,u))&&(i=GL.getContext(o).GLctx)}else i=e.getContext("2d");return i?(n&&(t||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),Module.ctx=i,t&&GL.makeContextCurrent(o),Module.useWebGL=t,Browser.moduleContextCreatedCallbacks.forEach((function(e){e()})),Browser.init()),i):null},destroyContext:function(e,t,n){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(e,t,n){Browser.lockPointer=e,Browser.resizeCanvas=t,Browser.vrDevice=n,void 0===Browser.lockPointer&&(Browser.lockPointer=!0),void 0===Browser.resizeCanvas&&(Browser.resizeCanvas=!1),void 0===Browser.vrDevice&&(Browser.vrDevice=null);var r=Module.canvas;function i(){Browser.isFullscreen=!1;var e=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(r.exitFullscreen=document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){},r.exitFullscreen=r.exitFullscreen.bind(document),Browser.lockPointer&&r.requestPointerLock(),Browser.isFullscreen=!0,Browser.resizeCanvas&&Browser.setFullscreenCanvasSize()):(e.parentNode.insertBefore(r,e),e.parentNode.removeChild(e),Browser.resizeCanvas&&Browser.setWindowedCanvasSize()),Module.onFullScreen&&Module.onFullScreen(Browser.isFullscreen),Module.onFullscreen&&Module.onFullscreen(Browser.isFullscreen),Browser.updateCanvasDimensions(r)}Browser.fullscreenHandlersInstalled||(Browser.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",i,!1),document.addEventListener("mozfullscreenchange",i,!1),document.addEventListener("webkitfullscreenchange",i,!1),document.addEventListener("MSFullscreenChange",i,!1));var o=document.createElement("div");r.parentNode.insertBefore(o,r),o.appendChild(r),o.requestFullscreen=o.requestFullscreen||o.mozRequestFullScreen||o.msRequestFullscreen||(o.webkitRequestFullscreen?function(){o.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}:null)||(o.webkitRequestFullScreen?function(){o.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),n?o.requestFullscreen({vrDisplay:n}):o.requestFullscreen()},requestFullScreen:function(e,t,n){return Module.printErr("Browser.requestFullScreen() is deprecated. Please call Browser.requestFullscreen instead."),Browser.requestFullScreen=function(e,t,n){return Browser.requestFullscreen(e,t,n)},Browser.requestFullscreen(e,t,n)},nextRAF:0,fakeRequestAnimationFrame:function(e){var t=Date.now();if(0===Browser.nextRAF)Browser.nextRAF=t+1e3/60;else for(;t+2>=Browser.nextRAF;)Browser.nextRAF+=1e3/60;var n=Math.max(Browser.nextRAF-t,0);setTimeout(e,n)},requestAnimationFrame:function(e){"undefined"==typeof window?Browser.fakeRequestAnimationFrame(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||Browser.fakeRequestAnimationFrame),window.requestAnimationFrame(e))},safeCallback:function(e){return function(){if(!ABORT)return e.apply(null,arguments)}},allowAsyncCallbacks:!0,queuedAsyncCallbacks:[],pauseAsyncCallbacks:function(){Browser.allowAsyncCallbacks=!1},resumeAsyncCallbacks:function(){if(Browser.allowAsyncCallbacks=!0,Browser.queuedAsyncCallbacks.length>0){var e=Browser.queuedAsyncCallbacks;Browser.queuedAsyncCallbacks=[],e.forEach((function(e){e()}))}},safeRequestAnimationFrame:function(e){return Browser.requestAnimationFrame((function(){ABORT||(Browser.allowAsyncCallbacks?e():Browser.queuedAsyncCallbacks.push(e))}))},safeSetTimeout:function(e,t){return Module.noExitRuntime=!0,setTimeout((function(){ABORT||(Browser.allowAsyncCallbacks?e():Browser.queuedAsyncCallbacks.push(e))}),t)},safeSetInterval:function(e,t){return Module.noExitRuntime=!0,setInterval((function(){ABORT||Browser.allowAsyncCallbacks&&e()}),t)},getMimetype:function(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]},getUserMedia:function(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:function(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY:function(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta:function(e){var t=0;switch(e.type){case"DOMMouseScroll":t=e.detail;break;case"mousewheel":t=e.wheelDelta;break;case"wheel":t=e.deltaY;break;default:throw"unrecognized mouse wheel event: "+e.type}return t},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(e){if(Browser.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?Browser.mouseMovementX=Browser.mouseMovementY=0:(Browser.mouseMovementX=Browser.getMovementX(e),Browser.mouseMovementY=Browser.getMovementY(e)),"undefined"!=typeof SDL?(Browser.mouseX=SDL.mouseX+Browser.mouseMovementX,Browser.mouseY=SDL.mouseY+Browser.mouseMovementY):(Browser.mouseX+=Browser.mouseMovementX,Browser.mouseY+=Browser.mouseMovementY);else{var t=Module.canvas.getBoundingClientRect(),n=Module.canvas.width,r=Module.canvas.height,i=void 0!==window.scrollX?window.scrollX:window.pageXOffset,o=void 0!==window.scrollY?window.scrollY:window.pageYOffset;if("touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var u=e.touch;if(void 0===u)return;var a=u.pageX-(i+t.left),l=u.pageY-(o+t.top),s={x:a*=n/t.width,y:l*=r/t.height};if("touchstart"===e.type)Browser.lastTouches[u.identifier]=s,Browser.touches[u.identifier]=s;else if("touchend"===e.type||"touchmove"===e.type){var c=Browser.touches[u.identifier];c||(c=s),Browser.lastTouches[u.identifier]=c,Browser.touches[u.identifier]=s}return}var f=e.pageX-(i+t.left),d=e.pageY-(o+t.top);f*=n/t.width,d*=r/t.height,Browser.mouseMovementX=f-Browser.mouseX,Browser.mouseMovementY=d-Browser.mouseY,Browser.mouseX=f,Browser.mouseY=d}},asyncLoad:function(e,t,n,r){var i=r?"":getUniqueRunDependency("al "+e);Module.readAsync(e,(function(n){assert(n,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(n)),i&&removeRunDependency(i)}),(function(t){if(!n)throw'Loading data file "'+e+'" failed.';n()})),i&&addRunDependency(i)},resizeListeners:[],updateResizeListeners:function(){var e=Module.canvas;Browser.resizeListeners.forEach((function(t){t(e.width,e.height)}))},setCanvasSize:function(e,t,n){var r=Module.canvas;Browser.updateCanvasDimensions(r,e,t),n||Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if("undefined"!=typeof SDL){var e=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];e|=8388608,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=e}Browser.updateResizeListeners()},setWindowedCanvasSize:function(){if("undefined"!=typeof SDL){var e=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];e&=-8388609,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=e}Browser.updateResizeListeners()},updateCanvasDimensions:function(e,t,n){t&&n?(e.widthNative=t,e.heightNative=n):(t=e.widthNative,n=e.heightNative);var r=t,i=n;if(Module.forcedAspectRatio&&Module.forcedAspectRatio>0&&(r/i>2]},getStr:function(){return Pointer_stringify(SYSCALLS.get())},get64:function(){var e=SYSCALLS.get(),t=SYSCALLS.get();return assert(e>=0?0===t:-1===t),e},getZero:function(){assert(0===SYSCALLS.get())}};function ___syscall6(e,t){SYSCALLS.varargs=t;try{var n=SYSCALLS.getStreamFromFD();return FS.close(n),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall54(e,t){SYSCALLS.varargs=t;try{return 0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function _typeModule(e){var t=[[0,1,"X"],[1,1,"const X"],[128,1,"X *"],[256,1,"X &"],[384,1,"X &&"],[512,1,"std::shared_ptr"],[640,1,"std::unique_ptr"],[5120,1,"std::vector"],[6144,2,"std::array"],[9216,-1,"std::function"]];function n(e,t,n,r,i,o){if(1==t){var u=896&r;128!=u&&256!=u&&384!=u||(e="X const")}return(o?n.replace("X",e).replace("Y",i):e.replace("X",n).replace("Y",i)).replace(/([*&]) (?=[*&])/g,"$1")}function r(e,t){var n=t.flags,r=896&n,i=15360&n;return t.name||1024!=i||(1==t.ptrSize?t.name=(16&n?"":(8&n?"un":"")+"signed ")+"char":t.name=(8&n?"u":"")+(32&n?"float":"int")+8*t.ptrSize+"_t"),8!=t.ptrSize||32&n||(i=64),2048==i&&(512==r||640==r?i=4096:r&&(i=3072)),e(i,t)}var i={Type:function(){function e(e){this.id=e.id,this.name=e.name,this.flags=e.flags,this.spec=e}return e.prototype.toString=function(){return this.name},e}(),getComplexType:function e(i,o,u,a,l,s,c,f){void 0===s&&(s="X"),void 0===f&&(f=1);var d=u(i);if(d)return d;var p,h=a(i),v=h.placeholderFlag,m=t[v];c&&m&&(s=n(c[2],c[0],s,m[0],"?",!0)),0==v&&(p="Unbound"),v>=10&&(p="Corrupt"),f>20&&(p="Deeply nested"),p&&function(e,t,n,r,i){throw new Error(e+" type "+n.replace("X",t+"?")+(r?" with flag "+r:"")+" in "+i)}(p,i,s,v,l||"?");var g,y=e(h.paramList[0],o,u,a,l,s,m,f+1),_={flags:m[0],id:i,name:"",paramList:[y]},b=[],w="?";switch(h.placeholderFlag){case 1:g=y.spec;break;case 2:if(1024==(15360&y.flags)&&1==y.spec.ptrSize){_.flags=7168;break}case 3:case 6:case 5:g=y.spec,y.flags;break;case 8:w=""+h.paramList[1],_.paramList.push(h.paramList[1]);break;case 9:for(var E=0,D=h.paramList[1];E>2]=e),e}function _llvm_stacksave(){var e=_llvm_stacksave;return e.LLVM_SAVEDSTACKS||(e.LLVM_SAVEDSTACKS=[]),e.LLVM_SAVEDSTACKS.push(Runtime.stackSave()),e.LLVM_SAVEDSTACKS.length-1}function ___syscall140(e,t){SYSCALLS.varargs=t;try{var n=SYSCALLS.getStreamFromFD(),r=(SYSCALLS.get(),SYSCALLS.get()),i=SYSCALLS.get(),o=SYSCALLS.get(),u=r;return FS.llseek(n,u,o),HEAP32[i>>2]=n.position,n.getdents&&0===u&&0===o&&(n.getdents=null),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall146(e,t){SYSCALLS.varargs=t;try{var n=SYSCALLS.get(),r=SYSCALLS.get(),i=SYSCALLS.get(),o=0;___syscall146.buffer||(___syscall146.buffers=[null,[],[]],___syscall146.printChar=function(e,t){var n=___syscall146.buffers[e];assert(n),0===t||10===t?((1===e?Module.print:Module.printErr)(UTF8ArrayToString(n,0)),n.length=0):n.push(t)});for(var u=0;u>2],l=HEAP32[r+(8*u+4)>>2],s=0;se.pageSize/2||t>e.pageSize-n?_nbind.typeNameTbl.NBind.proto.lalloc(t):(HEAPU32[e.usedPtr]=n+t,e.rootPtr+n)},e.lreset=function(t,n){HEAPU32[e.pagePtr]?_nbind.typeNameTbl.NBind.proto.lreset(t,n):HEAPU32[e.usedPtr]=t},e}();function constructType(e,t){var n=new(10240==e?_nbind.makeTypeNameTbl[t.name]||_nbind.BindType:_nbind.makeTypeKindTbl[e])(t);return typeIdTbl[t.id]=n,_nbind.typeNameTbl[t.name]=n,n}function getType(e){return typeIdTbl[e]}function queryType(e){var t=HEAPU8[e],n=_nbind.structureList[t][1];e/=4,n<0&&(++e,n=HEAPU32[e]+1);var r=Array.prototype.slice.call(HEAPU32.subarray(e+1,e+1+n));return 9==t&&(r=[r[0],r.slice(1)]),{paramList:r,placeholderFlag:t}}function getTypes(e,t){return e.map((function(e){return"number"==typeof e?_nbind.getComplexType(e,constructType,getType,queryType,t):_nbind.typeNameTbl[e]}))}function readTypeIdList(e,t){return Array.prototype.slice.call(HEAPU32,e/4,e/4+t)}function readAsciiString(e){for(var t=e;HEAPU8[t++];);return String.fromCharCode.apply("",HEAPU8.subarray(e,t-1))}function readPolicyList(e){var t={};if(e)for(;;){var n=HEAPU32[e/4];if(!n)break;t[readAsciiString(n)]=!0,e+=4}return t}function getDynCall(e,t){var n={float32_t:"d",float64_t:"d",int64_t:"d",uint64_t:"d",void:"v"},r=e.map((function(e){return n[e.name]||"i"})).join(""),i=Module["dynCall_"+r];if(!i)throw new Error("dynCall_"+r+" not found for "+t+"("+e.map((function(e){return e.name})).join(", ")+")");return i}function addMethod(e,t,n,r){var i=e[t];e.hasOwnProperty(t)&&i?((i.arity||0===i.arity)&&(i=_nbind.makeOverloader(i,i.arity),e[t]=i),i.addMethod(n,r)):(n.arity=r,e[t]=n)}function throwError(e){throw new Error(e)}_nbind.Pool=Pool,_nbind.constructType=constructType,_nbind.getType=getType,_nbind.queryType=queryType,_nbind.getTypes=getTypes,_nbind.readTypeIdList=readTypeIdList,_nbind.readAsciiString=readAsciiString,_nbind.readPolicyList=readPolicyList,_nbind.getDynCall=getDynCall,_nbind.addMethod=addMethod,_nbind.throwError=throwError,_nbind.bigEndian=!1,_a=_typeModule(_typeModule),_nbind.Type=_a.Type,_nbind.makeType=_a.makeType,_nbind.getComplexType=_a.getComplexType,_nbind.structureList=_a.structureList;var BindType=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.heap=HEAPU32,t.ptrSize=4,t}return __extends(t,e),t.prototype.needsWireRead=function(e){return!!this.wireRead||!!this.makeWireRead},t.prototype.needsWireWrite=function(e){return!!this.wireWrite||!!this.makeWireWrite},t}(_nbind.Type);_nbind.BindType=BindType;var PrimitiveType=function(e){function t(t){var n=e.call(this,t)||this,r=32&t.flags?{32:HEAPF32,64:HEAPF64}:8&t.flags?{8:HEAPU8,16:HEAPU16,32:HEAPU32}:{8:HEAP8,16:HEAP16,32:HEAP32};return n.heap=r[8*t.ptrSize],n.ptrSize=t.ptrSize,n}return __extends(t,e),t.prototype.needsWireWrite=function(e){return!!e&&!!e.Strict},t.prototype.makeWireWrite=function(e,t){return t&&t.Strict&&function(e){if("number"==typeof e)return e;throw new Error("Type mismatch")}},t}(BindType);function pushCString(e,t){if(null==e){if(t&&t.Nullable)return 0;throw new Error("Type mismatch")}if(t&&t.Strict){if("string"!=typeof e)throw new Error("Type mismatch")}else e=e.toString();var n=Module.lengthBytesUTF8(e)+1,r=_nbind.Pool.lalloc(n);return Module.stringToUTF8Array(e,HEAPU8,r,n),r}function popCString(e){return 0===e?null:Module.Pointer_stringify(e)}_nbind.PrimitiveType=PrimitiveType,_nbind.pushCString=pushCString,_nbind.popCString=popCString;var CStringType=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.wireRead=popCString,t.wireWrite=pushCString,t.readResources=[_nbind.resources.pool],t.writeResources=[_nbind.resources.pool],t}return __extends(t,e),t.prototype.makeWireWrite=function(e,t){return function(e){return pushCString(e,t)}},t}(BindType);_nbind.CStringType=CStringType;var BooleanType=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.wireRead=function(e){return!!e},t}return __extends(t,e),t.prototype.needsWireWrite=function(e){return!!e&&!!e.Strict},t.prototype.makeWireRead=function(e){return"!!("+e+")"},t.prototype.makeWireWrite=function(e,t){return t&&t.Strict&&function(e){if("boolean"==typeof e)return e;throw new Error("Type mismatch")}||e},t}(BindType);_nbind.BooleanType=BooleanType;var Wrapper=function(){function e(){}return e.prototype.persist=function(){this.__nbindState|=1},e}();function makeBound(e,t){var n=function(e){function n(t,r,i,o){var u=e.call(this)||this;if(!(u instanceof n))return new(Function.prototype.bind.apply(n,Array.prototype.concat.apply([null],arguments)));var a=r,l=i,s=o;if(t!==_nbind.ptrMarker){var c=u.__nbindConstructor.apply(u,arguments);a=4608,s=HEAPU32[c/4],l=HEAPU32[c/4+1]}var f={configurable:!0,enumerable:!1,value:null,writable:!1},d={__nbindFlags:a,__nbindPtr:l};s&&(d.__nbindShared=s,_nbind.mark(u));for(var p=0,h=Object.keys(d);p>=1;var n=_nbind.valueList[e];return _nbind.valueList[e]=firstFreeValue,firstFreeValue=e,n}if(t)return _nbind.popShared(e,t);throw new Error("Invalid value slot "+e)}_nbind.pushValue=pushValue,_nbind.popValue=popValue;var valueBase=0x10000000000000000;function push64(e){return"number"==typeof e?e:4096*pushValue(e)+valueBase}function pop64(e){return e=3?Buffer.from(o):new Buffer(o)).copy(r):getBuffer(r).set(o)}}_nbind.BufferType=BufferType,_nbind.commitBuffer=commitBuffer;var dirtyList=[],gcTimer=0;function sweep(){for(var e=0,t=dirtyList;e>2]=DYNAMIC_BASE,staticSealed=!0,Module.asmGlobalArg={Math,Int8Array,Int16Array,Int32Array,Uint8Array,Uint16Array,Uint32Array,Float32Array,Float64Array,NaN:NaN,Infinity:1/0},Module.asmLibraryArg={abort,assert,enlargeMemory,getTotalMemory,abortOnCannotGrowMemory,invoke_viiiii,invoke_vif,invoke_vid,invoke_fiff,invoke_vi,invoke_vii,invoke_ii,invoke_viddi,invoke_vidd,invoke_iiii,invoke_diii,invoke_di,invoke_iid,invoke_iii,invoke_viiddi,invoke_viiiiii,invoke_dii,invoke_i,invoke_iiiiii,invoke_viiid,invoke_viififi,invoke_viii,invoke_v,invoke_viid,invoke_idd,invoke_viiii,_emscripten_asm_const_iiiii,_emscripten_asm_const_iiidddddd,_emscripten_asm_const_iiiid,__nbind_reference_external,_emscripten_asm_const_iiiiiiii,_removeAccessorPrefix,_typeModule,__nbind_register_pool,__decorate,_llvm_stackrestore,___cxa_atexit,__extends,__nbind_get_value_object,__ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj,_emscripten_set_main_loop_timing,__nbind_register_primitive,__nbind_register_type,_emscripten_memcpy_big,__nbind_register_function,___setErrNo,__nbind_register_class,__nbind_finish,_abort,_nbind_value,_llvm_stacksave,___syscall54,_defineHidden,_emscripten_set_main_loop,_emscripten_get_now,__nbind_register_callback_signature,_emscripten_asm_const_iiiiii,__nbind_free_external,_emscripten_asm_const_iiii,_emscripten_asm_const_iiididi,___syscall6,_atexit,___syscall140,___syscall146,DYNAMICTOP_PTR,tempDoublePtr,ABORT,STACKTOP,STACK_MAX,cttz_i8,___dso_handle};var asm=function(e,t,n){"use asm";var r=new e.Int8Array(n);var i=new e.Int16Array(n);var o=new e.Int32Array(n);var u=new e.Uint8Array(n);var a=new e.Uint16Array(n);var l=new e.Uint32Array(n);var s=new e.Float32Array(n);var c=new e.Float64Array(n);var f=t.DYNAMICTOP_PTR|0;var d=t.tempDoublePtr|0;var p=t.ABORT|0;var h=t.STACKTOP|0;var v=t.STACK_MAX|0;var m=t.cttz_i8|0;var g=t.___dso_handle|0;var y=0;var _=0;var b=0;var w=0;var E=e.NaN,D=e.Infinity;var S=0,C=0,k=0,T=0,x=0.0;var A=0;var O=e.Math.floor;var P=e.Math.abs;var I=e.Math.sqrt;var N=e.Math.pow;var M=e.Math.cos;var R=e.Math.sin;var F=e.Math.tan;var L=e.Math.acos;var B=e.Math.asin;var j=e.Math.atan;var U=e.Math.atan2;var z=e.Math.exp;var W=e.Math.log;var H=e.Math.ceil;var V=e.Math.imul;var q=e.Math.min;var G=e.Math.max;var $=e.Math.clz32;var Y=e.Math.fround;var K=t.abort;var X=t.assert;var Q=t.enlargeMemory;var J=t.getTotalMemory;var Z=t.abortOnCannotGrowMemory;var ee=t.invoke_viiiii;var te=t.invoke_vif;var ne=t.invoke_vid;var re=t.invoke_fiff;var ie=t.invoke_vi;var oe=t.invoke_vii;var ue=t.invoke_ii;var ae=t.invoke_viddi;var le=t.invoke_vidd;var se=t.invoke_iiii;var ce=t.invoke_diii;var fe=t.invoke_di;var de=t.invoke_iid;var pe=t.invoke_iii;var he=t.invoke_viiddi;var ve=t.invoke_viiiiii;var me=t.invoke_dii;var ge=t.invoke_i;var ye=t.invoke_iiiiii;var _e=t.invoke_viiid;var be=t.invoke_viififi;var we=t.invoke_viii;var Ee=t.invoke_v;var De=t.invoke_viid;var Se=t.invoke_idd;var Ce=t.invoke_viiii;var ke=t._emscripten_asm_const_iiiii;var Te=t._emscripten_asm_const_iiidddddd;var xe=t._emscripten_asm_const_iiiid;var Ae=t.__nbind_reference_external;var Oe=t._emscripten_asm_const_iiiiiiii;var Pe=t._removeAccessorPrefix;var Ie=t._typeModule;var Ne=t.__nbind_register_pool;var Me=t.__decorate;var Re=t._llvm_stackrestore;var Fe=t.___cxa_atexit;var Le=t.__extends;var Be=t.__nbind_get_value_object;var je=t.__ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj;var Ue=t._emscripten_set_main_loop_timing;var ze=t.__nbind_register_primitive;var We=t.__nbind_register_type;var He=t._emscripten_memcpy_big;var Ve=t.__nbind_register_function;var qe=t.___setErrNo;var Ge=t.__nbind_register_class;var $e=t.__nbind_finish;var Ye=t._abort;var Ke=t._nbind_value;var Xe=t._llvm_stacksave;var Qe=t.___syscall54;var Je=t._defineHidden;var Ze=t._emscripten_set_main_loop;var et=t._emscripten_get_now;var tt=t.__nbind_register_callback_signature;var nt=t._emscripten_asm_const_iiiiii;var rt=t.__nbind_free_external;var it=t._emscripten_asm_const_iiii;var ot=t._emscripten_asm_const_iiididi;var ut=t.___syscall6;var at=t._atexit;var lt=t.___syscall140;var st=t.___syscall146;var ct=Y(0);const ft=Y(0);function dt(e){e=e|0;var t=0;t=h;h=h+e|0;h=h+15&-16;return t|0}function pt(){return h|0}function ht(e){e=e|0;h=e}function vt(e,t){e=e|0;t=t|0;h=e;v=t}function mt(e,t){e=e|0;t=t|0;if(!y){y=e;_=t}}function gt(e){e=e|0;A=e}function yt(){return A|0}function _t(){var e=0,t=0;ix(8104,8,400)|0;ix(8504,408,540)|0;e=9044;t=e+44|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));r[9088]=0;r[9089]=1;o[2273]=0;o[2274]=948;o[2275]=948;Fe(17,8104,g|0)|0;return}function bt(e){e=e|0;qt(e+948|0);return}function wt(e){e=Y(e);return((Ii(e)|0)&2147483647)>>>0>2139095040|0}function Et(e,t,n){e=e|0;t=t|0;n=n|0;e:do{if(!(o[e+(t<<3)+4>>2]|0)){if((t|2|0)==3?o[e+60>>2]|0:0){e=e+56|0;break}switch(t|0){case 0:case 2:case 4:case 5:{if(o[e+52>>2]|0){e=e+48|0;break e}break}default:{}}if(!(o[e+68>>2]|0)){e=(t|1|0)==5?948:n;break}else{e=e+64|0;break}}else e=e+(t<<3)|0}while(0);return e|0}function Dt(e){e=e|0;var t=0;t=qk(1e3)|0;St(e,(t|0)!=0,2456);o[2276]=(o[2276]|0)+1;ix(t|0,8104,1e3)|0;if(r[e+2>>0]|0){o[t+4>>2]=2;o[t+12>>2]=4}o[t+976>>2]=e;return t|0}function St(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0;i=h;h=h+16|0;r=i;if(!t){o[r>>2]=n;Lr(e,5,3197,r)}h=i;return}function Ct(){return Dt(956)|0}function kt(e){e=e|0;var t=0;t=$T(1e3)|0;Tt(t,e);St(o[e+976>>2]|0,1,2456);o[2276]=(o[2276]|0)+1;o[t+944>>2]=0;return t|0}function Tt(e,t){e=e|0;t=t|0;var n=0;ix(e|0,t|0,948)|0;Ur(e+948|0,t+948|0);n=e+960|0;e=t+960|0;t=n+40|0;do{o[n>>2]=o[e>>2];n=n+4|0;e=e+4|0}while((n|0)<(t|0));return}function xt(e){e=e|0;var t=0,n=0,r=0,i=0;t=e+944|0;n=o[t>>2]|0;if(n|0){At(n+948|0,e)|0;o[t>>2]=0}n=Ot(e)|0;if(n|0){t=0;do{o[(Pt(e,t)|0)+944>>2]=0;t=t+1|0}while((t|0)!=(n|0))}n=e+948|0;r=o[n>>2]|0;i=e+952|0;t=o[i>>2]|0;if((t|0)!=(r|0))o[i>>2]=t+(~((t+-4-r|0)>>>2)<<2);It(n);Gk(e);o[2276]=(o[2276]|0)+-1;return}function At(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0;r=o[e>>2]|0;l=e+4|0;n=o[l>>2]|0;u=n;e:do{if((r|0)==(n|0)){i=r;a=4}else{e=r;while(1){if((o[e>>2]|0)==(t|0)){i=e;a=4;break e}e=e+4|0;if((e|0)==(n|0)){e=0;break}}}}while(0);if((a|0)==4)if((i|0)!=(n|0)){r=i+4|0;e=u-r|0;t=e>>2;if(t){sx(i|0,r|0,e|0)|0;n=o[l>>2]|0}e=i+(t<<2)|0;if((n|0)==(e|0))e=1;else{o[l>>2]=n+(~((n+-4-e|0)>>>2)<<2);e=1}}else e=0;return e|0}function Ot(e){e=e|0;return(o[e+952>>2]|0)-(o[e+948>>2]|0)>>2|0}function Pt(e,t){e=e|0;t=t|0;var n=0;n=o[e+948>>2]|0;if((o[e+952>>2]|0)-n>>2>>>0>t>>>0)e=o[n+(t<<2)>>2]|0;else e=0;return e|0}function It(e){e=e|0;var t=0,n=0,r=0,i=0;r=h;h=h+32|0;t=r;i=o[e>>2]|0;n=(o[e+4>>2]|0)-i|0;if(((o[e+8>>2]|0)-i|0)>>>0>n>>>0){i=n>>2;Ni(t,i,i,e+8|0);Mi(e,t);Ri(t)}h=r;return}function Nt(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0;c=Ot(e)|0;do{if(c|0){if((o[(Pt(e,0)|0)+944>>2]|0)==(e|0)){if(!(At(e+948|0,t)|0))break;ix(t+400|0,8504,540)|0;o[t+944>>2]=0;Vt(e);break}a=o[(o[e+976>>2]|0)+12>>2]|0;l=e+948|0;s=(a|0)==0;n=0;u=0;do{r=o[(o[l>>2]|0)+(u<<2)>>2]|0;if((r|0)==(t|0))Vt(e);else{i=kt(r)|0;o[(o[l>>2]|0)+(n<<2)>>2]=i;o[i+944>>2]=e;if(!s)RA[a&15](r,i,e,n);n=n+1|0}u=u+1|0}while((u|0)!=(c|0));if(n>>>0>>0){s=e+948|0;l=e+952|0;a=n;n=o[l>>2]|0;do{u=(o[s>>2]|0)+(a<<2)|0;r=u+4|0;i=n-r|0;t=i>>2;if(!t)i=n;else{sx(u|0,r|0,i|0)|0;n=o[l>>2]|0;i=n}r=u+(t<<2)|0;if((i|0)!=(r|0)){n=i+(~((i+-4-r|0)>>>2)<<2)|0;o[l>>2]=n}a=a+1|0}while((a|0)!=(c|0))}}}while(0);return}function Mt(e){e=e|0;var t=0,n=0,i=0,u=0;Rt(e,(Ot(e)|0)==0,2491);Rt(e,(o[e+944>>2]|0)==0,2545);t=e+948|0;n=o[t>>2]|0;i=e+952|0;u=o[i>>2]|0;if((u|0)!=(n|0))o[i>>2]=u+(~((u+-4-n|0)>>>2)<<2);It(t);t=e+976|0;n=o[t>>2]|0;ix(e|0,8104,1e3)|0;if(r[n+2>>0]|0){o[e+4>>2]=2;o[e+12>>2]=4}o[t>>2]=n;return}function Rt(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0;i=h;h=h+16|0;r=i;if(!t){o[r>>2]=n;Cr(e,5,3197,r)}h=i;return}function Ft(){return o[2276]|0}function Lt(){var e=0;e=qk(20)|0;Bt((e|0)!=0,2592);o[2277]=(o[2277]|0)+1;o[e>>2]=o[239];o[e+4>>2]=o[240];o[e+8>>2]=o[241];o[e+12>>2]=o[242];o[e+16>>2]=o[243];return e|0}function Bt(e,t){e=e|0;t=t|0;var n=0,r=0;r=h;h=h+16|0;n=r;if(!e){o[n>>2]=t;Cr(0,5,3197,n)}h=r;return}function jt(e){e=e|0;Gk(e);o[2277]=(o[2277]|0)+-1;return}function Ut(e,t){e=e|0;t=t|0;var n=0;if(!t){n=0;t=0}else{Rt(e,(Ot(e)|0)==0,2629);n=1}o[e+964>>2]=t;o[e+988>>2]=n;return}function zt(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;u=r+8|0;i=r+4|0;a=r;o[i>>2]=t;Rt(e,(o[t+944>>2]|0)==0,2709);Rt(e,(o[e+964>>2]|0)==0,2763);Wt(e);t=e+948|0;o[a>>2]=(o[t>>2]|0)+(n<<2);o[u>>2]=o[a>>2];Ht(t,u,i)|0;o[(o[i>>2]|0)+944>>2]=e;Vt(e);h=r;return}function Wt(e){e=e|0;var t=0,n=0,r=0,i=0,u=0,a=0,l=0;n=Ot(e)|0;if(n|0?(o[(Pt(e,0)|0)+944>>2]|0)!=(e|0):0){r=o[(o[e+976>>2]|0)+12>>2]|0;i=e+948|0;u=(r|0)==0;t=0;do{a=o[(o[i>>2]|0)+(t<<2)>>2]|0;l=kt(a)|0;o[(o[i>>2]|0)+(t<<2)>>2]=l;o[l+944>>2]=e;if(!u)RA[r&15](a,l,e,t);t=t+1|0}while((t|0)!=(n|0))}return}function Ht(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,v=0,m=0,g=0,y=0,_=0;y=h;h=h+64|0;d=y+52|0;l=y+48|0;p=y+28|0;v=y+24|0;m=y+20|0;g=y;r=o[e>>2]|0;u=r;t=r+((o[t>>2]|0)-u>>2<<2)|0;r=e+4|0;i=o[r>>2]|0;a=e+8|0;do{if(i>>>0<(o[a>>2]|0)>>>0){if((t|0)==(i|0)){o[t>>2]=o[n>>2];o[r>>2]=(o[r>>2]|0)+4;break}Fi(e,t,i,t+4|0);if(t>>>0<=n>>>0)n=(o[r>>2]|0)>>>0>n>>>0?n+4|0:n;o[t>>2]=o[n>>2]}else{r=(i-u>>2)+1|0;i=Hr(e)|0;if(i>>>0>>0)UT(e);f=o[e>>2]|0;c=(o[a>>2]|0)-f|0;u=c>>1;Ni(g,c>>2>>>0>>1>>>0?u>>>0>>0?r:u:i,t-f>>2,e+8|0);f=g+8|0;r=o[f>>2]|0;u=g+12|0;c=o[u>>2]|0;a=c;s=r;do{if((r|0)==(c|0)){c=g+4|0;r=o[c>>2]|0;_=o[g>>2]|0;i=_;if(r>>>0<=_>>>0){r=a-i>>1;r=(r|0)==0?1:r;Ni(p,r,r>>>2,o[g+16>>2]|0);o[v>>2]=o[c>>2];o[m>>2]=o[f>>2];o[l>>2]=o[v>>2];o[d>>2]=o[m>>2];Bi(p,l,d);r=o[g>>2]|0;o[g>>2]=o[p>>2];o[p>>2]=r;r=p+4|0;_=o[c>>2]|0;o[c>>2]=o[r>>2];o[r>>2]=_;r=p+8|0;_=o[f>>2]|0;o[f>>2]=o[r>>2];o[r>>2]=_;r=p+12|0;_=o[u>>2]|0;o[u>>2]=o[r>>2];o[r>>2]=_;Ri(p);r=o[f>>2]|0;break}u=r;a=((u-i>>2)+1|0)/-2|0;l=r+(a<<2)|0;i=s-u|0;u=i>>2;if(u){sx(l|0,r|0,i|0)|0;r=o[c>>2]|0}_=l+(u<<2)|0;o[f>>2]=_;o[c>>2]=r+(a<<2);r=_}}while(0);o[r>>2]=o[n>>2];o[f>>2]=(o[f>>2]|0)+4;t=Li(e,g,t)|0;Ri(g)}}while(0);h=y;return t|0}function Vt(e){e=e|0;var t=0;do{t=e+984|0;if(r[t>>0]|0)break;r[t>>0]=1;s[e+504>>2]=Y(E);e=o[e+944>>2]|0}while((e|0)!=0);return}function qt(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-4-r|0)>>>2)<<2);KT(n)}return}function Gt(e){e=e|0;return o[e+944>>2]|0}function $t(e){e=e|0;Rt(e,(o[e+964>>2]|0)!=0,2832);Vt(e);return}function Yt(e){e=e|0;return(r[e+984>>0]|0)!=0|0}function Kt(e,t){e=e|0;t=t|0;if(iT(e,t,400)|0){ix(e|0,t|0,400)|0;Vt(e)}return}function Xt(e){e=e|0;var t=ft;t=Y(s[e+44>>2]);e=wt(t)|0;return Y(e?Y(0.0):t)}function Qt(e){e=e|0;var t=ft;t=Y(s[e+48>>2]);if(wt(t)|0)t=r[(o[e+976>>2]|0)+2>>0]|0?Y(1.0):Y(0.0);return Y(t)}function Jt(e,t){e=e|0;t=t|0;o[e+980>>2]=t;return}function Zt(e){e=e|0;return o[e+980>>2]|0}function en(e,t){e=e|0;t=t|0;var n=0;n=e+4|0;if((o[n>>2]|0)!=(t|0)){o[n>>2]=t;Vt(e)}return}function tn(e){e=e|0;return o[e+4>>2]|0}function nn(e,t){e=e|0;t=t|0;var n=0;n=e+8|0;if((o[n>>2]|0)!=(t|0)){o[n>>2]=t;Vt(e)}return}function rn(e){e=e|0;return o[e+8>>2]|0}function on(e,t){e=e|0;t=t|0;var n=0;n=e+12|0;if((o[n>>2]|0)!=(t|0)){o[n>>2]=t;Vt(e)}return}function un(e){e=e|0;return o[e+12>>2]|0}function an(e,t){e=e|0;t=t|0;var n=0;n=e+16|0;if((o[n>>2]|0)!=(t|0)){o[n>>2]=t;Vt(e)}return}function ln(e){e=e|0;return o[e+16>>2]|0}function sn(e,t){e=e|0;t=t|0;var n=0;n=e+20|0;if((o[n>>2]|0)!=(t|0)){o[n>>2]=t;Vt(e)}return}function cn(e){e=e|0;return o[e+20>>2]|0}function fn(e,t){e=e|0;t=t|0;var n=0;n=e+24|0;if((o[n>>2]|0)!=(t|0)){o[n>>2]=t;Vt(e)}return}function dn(e){e=e|0;return o[e+24>>2]|0}function pn(e,t){e=e|0;t=t|0;var n=0;n=e+28|0;if((o[n>>2]|0)!=(t|0)){o[n>>2]=t;Vt(e)}return}function hn(e){e=e|0;return o[e+28>>2]|0}function vn(e,t){e=e|0;t=t|0;var n=0;n=e+32|0;if((o[n>>2]|0)!=(t|0)){o[n>>2]=t;Vt(e)}return}function mn(e){e=e|0;return o[e+32>>2]|0}function gn(e,t){e=e|0;t=t|0;var n=0;n=e+36|0;if((o[n>>2]|0)!=(t|0)){o[n>>2]=t;Vt(e)}return}function yn(e){e=e|0;return o[e+36>>2]|0}function _n(e,t){e=e|0;t=Y(t);var n=0;n=e+40|0;if(Y(s[n>>2])!=t){s[n>>2]=t;Vt(e)}return}function bn(e,t){e=e|0;t=Y(t);var n=0;n=e+44|0;if(Y(s[n>>2])!=t){s[n>>2]=t;Vt(e)}return}function wn(e,t){e=e|0;t=Y(t);var n=0;n=e+48|0;if(Y(s[n>>2])!=t){s[n>>2]=t;Vt(e)}return}function En(e,t){e=e|0;t=Y(t);var n=0,r=0,i=0,u=0;u=wt(t)|0;n=(u^1)&1;r=e+52|0;i=e+56|0;if(!(u|Y(s[r>>2])==t?(o[i>>2]|0)==(n|0):0)){s[r>>2]=t;o[i>>2]=n;Vt(e)}return}function Dn(e,t){e=e|0;t=Y(t);var n=0,r=0;r=e+52|0;n=e+56|0;if(!(!(Y(s[r>>2])!=t)?(o[n>>2]|0)==2:0)){s[r>>2]=t;r=wt(t)|0;o[n>>2]=r?3:2;Vt(e)}return}function Sn(e,t){e=e|0;t=t|0;var n=0,r=0;r=t+52|0;n=o[r+4>>2]|0;t=e;o[t>>2]=o[r>>2];o[t+4>>2]=n;return}function Cn(e,t,n){e=e|0;t=t|0;n=Y(n);var r=0,i=0,u=0;u=wt(n)|0;r=(u^1)&1;i=e+132+(t<<3)|0;t=e+132+(t<<3)+4|0;if(!(u|Y(s[i>>2])==n?(o[t>>2]|0)==(r|0):0)){s[i>>2]=n;o[t>>2]=r;Vt(e)}return}function kn(e,t,n){e=e|0;t=t|0;n=Y(n);var r=0,i=0,u=0;u=wt(n)|0;r=u?0:2;i=e+132+(t<<3)|0;t=e+132+(t<<3)+4|0;if(!(u|Y(s[i>>2])==n?(o[t>>2]|0)==(r|0):0)){s[i>>2]=n;o[t>>2]=r;Vt(e)}return}function Tn(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=t+132+(n<<3)|0;t=o[r+4>>2]|0;n=e;o[n>>2]=o[r>>2];o[n+4>>2]=t;return}function xn(e,t,n){e=e|0;t=t|0;n=Y(n);var r=0,i=0,u=0;u=wt(n)|0;r=(u^1)&1;i=e+60+(t<<3)|0;t=e+60+(t<<3)+4|0;if(!(u|Y(s[i>>2])==n?(o[t>>2]|0)==(r|0):0)){s[i>>2]=n;o[t>>2]=r;Vt(e)}return}function An(e,t,n){e=e|0;t=t|0;n=Y(n);var r=0,i=0,u=0;u=wt(n)|0;r=u?0:2;i=e+60+(t<<3)|0;t=e+60+(t<<3)+4|0;if(!(u|Y(s[i>>2])==n?(o[t>>2]|0)==(r|0):0)){s[i>>2]=n;o[t>>2]=r;Vt(e)}return}function On(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=t+60+(n<<3)|0;t=o[r+4>>2]|0;n=e;o[n>>2]=o[r>>2];o[n+4>>2]=t;return}function Pn(e,t){e=e|0;t=t|0;var n=0;n=e+60+(t<<3)+4|0;if((o[n>>2]|0)!=3){s[e+60+(t<<3)>>2]=Y(E);o[n>>2]=3;Vt(e)}return}function In(e,t,n){e=e|0;t=t|0;n=Y(n);var r=0,i=0,u=0;u=wt(n)|0;r=(u^1)&1;i=e+204+(t<<3)|0;t=e+204+(t<<3)+4|0;if(!(u|Y(s[i>>2])==n?(o[t>>2]|0)==(r|0):0)){s[i>>2]=n;o[t>>2]=r;Vt(e)}return}function Nn(e,t,n){e=e|0;t=t|0;n=Y(n);var r=0,i=0,u=0;u=wt(n)|0;r=u?0:2;i=e+204+(t<<3)|0;t=e+204+(t<<3)+4|0;if(!(u|Y(s[i>>2])==n?(o[t>>2]|0)==(r|0):0)){s[i>>2]=n;o[t>>2]=r;Vt(e)}return}function Mn(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=t+204+(n<<3)|0;t=o[r+4>>2]|0;n=e;o[n>>2]=o[r>>2];o[n+4>>2]=t;return}function Rn(e,t,n){e=e|0;t=t|0;n=Y(n);var r=0,i=0,u=0;u=wt(n)|0;r=(u^1)&1;i=e+276+(t<<3)|0;t=e+276+(t<<3)+4|0;if(!(u|Y(s[i>>2])==n?(o[t>>2]|0)==(r|0):0)){s[i>>2]=n;o[t>>2]=r;Vt(e)}return}function Fn(e,t){e=e|0;t=t|0;return Y(s[e+276+(t<<3)>>2])}function Ln(e,t){e=e|0;t=Y(t);var n=0,r=0,i=0,u=0;u=wt(t)|0;n=(u^1)&1;r=e+348|0;i=e+352|0;if(!(u|Y(s[r>>2])==t?(o[i>>2]|0)==(n|0):0)){s[r>>2]=t;o[i>>2]=n;Vt(e)}return}function Bn(e,t){e=e|0;t=Y(t);var n=0,r=0;r=e+348|0;n=e+352|0;if(!(!(Y(s[r>>2])!=t)?(o[n>>2]|0)==2:0)){s[r>>2]=t;r=wt(t)|0;o[n>>2]=r?3:2;Vt(e)}return}function jn(e){e=e|0;var t=0;t=e+352|0;if((o[t>>2]|0)!=3){s[e+348>>2]=Y(E);o[t>>2]=3;Vt(e)}return}function Un(e,t){e=e|0;t=t|0;var n=0,r=0;r=t+348|0;n=o[r+4>>2]|0;t=e;o[t>>2]=o[r>>2];o[t+4>>2]=n;return}function zn(e,t){e=e|0;t=Y(t);var n=0,r=0,i=0,u=0;u=wt(t)|0;n=(u^1)&1;r=e+356|0;i=e+360|0;if(!(u|Y(s[r>>2])==t?(o[i>>2]|0)==(n|0):0)){s[r>>2]=t;o[i>>2]=n;Vt(e)}return}function Wn(e,t){e=e|0;t=Y(t);var n=0,r=0;r=e+356|0;n=e+360|0;if(!(!(Y(s[r>>2])!=t)?(o[n>>2]|0)==2:0)){s[r>>2]=t;r=wt(t)|0;o[n>>2]=r?3:2;Vt(e)}return}function Hn(e){e=e|0;var t=0;t=e+360|0;if((o[t>>2]|0)!=3){s[e+356>>2]=Y(E);o[t>>2]=3;Vt(e)}return}function Vn(e,t){e=e|0;t=t|0;var n=0,r=0;r=t+356|0;n=o[r+4>>2]|0;t=e;o[t>>2]=o[r>>2];o[t+4>>2]=n;return}function qn(e,t){e=e|0;t=Y(t);var n=0,r=0,i=0,u=0;u=wt(t)|0;n=(u^1)&1;r=e+364|0;i=e+368|0;if(!(u|Y(s[r>>2])==t?(o[i>>2]|0)==(n|0):0)){s[r>>2]=t;o[i>>2]=n;Vt(e)}return}function Gn(e,t){e=e|0;t=Y(t);var n=0,r=0,i=0,u=0;u=wt(t)|0;n=u?0:2;r=e+364|0;i=e+368|0;if(!(u|Y(s[r>>2])==t?(o[i>>2]|0)==(n|0):0)){s[r>>2]=t;o[i>>2]=n;Vt(e)}return}function $n(e,t){e=e|0;t=t|0;var n=0,r=0;r=t+364|0;n=o[r+4>>2]|0;t=e;o[t>>2]=o[r>>2];o[t+4>>2]=n;return}function Yn(e,t){e=e|0;t=Y(t);var n=0,r=0,i=0,u=0;u=wt(t)|0;n=(u^1)&1;r=e+372|0;i=e+376|0;if(!(u|Y(s[r>>2])==t?(o[i>>2]|0)==(n|0):0)){s[r>>2]=t;o[i>>2]=n;Vt(e)}return}function Kn(e,t){e=e|0;t=Y(t);var n=0,r=0,i=0,u=0;u=wt(t)|0;n=u?0:2;r=e+372|0;i=e+376|0;if(!(u|Y(s[r>>2])==t?(o[i>>2]|0)==(n|0):0)){s[r>>2]=t;o[i>>2]=n;Vt(e)}return}function Xn(e,t){e=e|0;t=t|0;var n=0,r=0;r=t+372|0;n=o[r+4>>2]|0;t=e;o[t>>2]=o[r>>2];o[t+4>>2]=n;return}function Qn(e,t){e=e|0;t=Y(t);var n=0,r=0,i=0,u=0;u=wt(t)|0;n=(u^1)&1;r=e+380|0;i=e+384|0;if(!(u|Y(s[r>>2])==t?(o[i>>2]|0)==(n|0):0)){s[r>>2]=t;o[i>>2]=n;Vt(e)}return}function Jn(e,t){e=e|0;t=Y(t);var n=0,r=0,i=0,u=0;u=wt(t)|0;n=u?0:2;r=e+380|0;i=e+384|0;if(!(u|Y(s[r>>2])==t?(o[i>>2]|0)==(n|0):0)){s[r>>2]=t;o[i>>2]=n;Vt(e)}return}function Zn(e,t){e=e|0;t=t|0;var n=0,r=0;r=t+380|0;n=o[r+4>>2]|0;t=e;o[t>>2]=o[r>>2];o[t+4>>2]=n;return}function er(e,t){e=e|0;t=Y(t);var n=0,r=0,i=0,u=0;u=wt(t)|0;n=(u^1)&1;r=e+388|0;i=e+392|0;if(!(u|Y(s[r>>2])==t?(o[i>>2]|0)==(n|0):0)){s[r>>2]=t;o[i>>2]=n;Vt(e)}return}function tr(e,t){e=e|0;t=Y(t);var n=0,r=0,i=0,u=0;u=wt(t)|0;n=u?0:2;r=e+388|0;i=e+392|0;if(!(u|Y(s[r>>2])==t?(o[i>>2]|0)==(n|0):0)){s[r>>2]=t;o[i>>2]=n;Vt(e)}return}function nr(e,t){e=e|0;t=t|0;var n=0,r=0;r=t+388|0;n=o[r+4>>2]|0;t=e;o[t>>2]=o[r>>2];o[t+4>>2]=n;return}function rr(e,t){e=e|0;t=Y(t);var n=0;n=e+396|0;if(Y(s[n>>2])!=t){s[n>>2]=t;Vt(e)}return}function ir(e){e=e|0;return Y(s[e+396>>2])}function or(e){e=e|0;return Y(s[e+400>>2])}function ur(e){e=e|0;return Y(s[e+404>>2])}function ar(e){e=e|0;return Y(s[e+408>>2])}function lr(e){e=e|0;return Y(s[e+412>>2])}function sr(e){e=e|0;return Y(s[e+416>>2])}function cr(e){e=e|0;return Y(s[e+420>>2])}function fr(e,t){e=e|0;t=t|0;Rt(e,(t|0)<6,2918);switch(t|0){case 0:{t=(o[e+496>>2]|0)==2?5:4;break}case 2:{t=(o[e+496>>2]|0)==2?4:5;break}default:{}}return Y(s[e+424+(t<<2)>>2])}function dr(e,t){e=e|0;t=t|0;Rt(e,(t|0)<6,2918);switch(t|0){case 0:{t=(o[e+496>>2]|0)==2?5:4;break}case 2:{t=(o[e+496>>2]|0)==2?4:5;break}default:{}}return Y(s[e+448+(t<<2)>>2])}function pr(e,t){e=e|0;t=t|0;Rt(e,(t|0)<6,2918);switch(t|0){case 0:{t=(o[e+496>>2]|0)==2?5:4;break}case 2:{t=(o[e+496>>2]|0)==2?4:5;break}default:{}}return Y(s[e+472+(t<<2)>>2])}function hr(e,t){e=e|0;t=t|0;var n=0,r=ft;n=o[e+4>>2]|0;if((n|0)==(o[t+4>>2]|0)){if(!n)e=1;else{r=Y(s[e>>2]);e=Y(P(Y(r-Y(s[t>>2]))))>2]=0;o[i+4>>2]=0;o[i+8>>2]=0;je(i|0,e|0,t|0,0);Cr(e,3,(r[i+11>>0]|0)<0?o[i>>2]|0:i,n);XT(i);h=n;return}function yr(e,t,n,r){e=Y(e);t=Y(t);n=n|0;r=r|0;var i=ft;e=Y(e*t);i=Y(LT(e,Y(1.0)));do{if(!(vr(i,Y(0.0))|0)){e=Y(e-i);if(vr(i,Y(1.0))|0){e=Y(e+Y(1.0));break}if(n){e=Y(e+Y(1.0));break}if(!r){if(i>Y(.5))i=Y(1.0);else{r=vr(i,Y(.5))|0;i=r?Y(1.0):Y(0.0)}e=Y(e+i)}}else e=Y(e-i)}while(0);return Y(e/t)}function _r(e,t,n,r,i,o,u,a,l,c,f,d,p){e=e|0;t=Y(t);n=n|0;r=Y(r);i=i|0;o=Y(o);u=u|0;a=Y(a);l=Y(l);c=Y(c);f=Y(f);d=Y(d);p=p|0;var h=0,v=ft,m=ft,g=ft,y=ft,_=ft,b=ft;if(l>2]),v!=Y(0.0)):0){g=Y(yr(t,v,0,0));y=Y(yr(r,v,0,0));m=Y(yr(o,v,0,0));v=Y(yr(a,v,0,0))}else{m=o;g=t;v=a;y=r}if((i|0)==(e|0))h=vr(m,g)|0;else h=0;if((u|0)==(n|0))p=vr(v,y)|0;else p=0;if((!h?(_=Y(t-f),!(br(e,_,l)|0)):0)?!(wr(e,_,i,l)|0):0)h=Er(e,_,i,o,l)|0;else h=1;if((!p?(b=Y(r-d),!(br(n,b,c)|0)):0)?!(wr(n,b,u,c)|0):0)p=Er(n,b,u,a,c)|0;else p=1;p=h&p}return p|0}function br(e,t,n){e=e|0;t=Y(t);n=Y(n);if((e|0)==1)e=vr(t,n)|0;else e=0;return e|0}function wr(e,t,n,r){e=e|0;t=Y(t);n=n|0;r=Y(r);if((e|0)==2&(n|0)==0){if(!(t>=r))e=vr(t,r)|0;else e=1}else e=0;return e|0}function Er(e,t,n,r,i){e=e|0;t=Y(t);n=n|0;r=Y(r);i=Y(i);if((e|0)==2&(n|0)==2&r>t){if(!(i<=t))e=vr(t,i)|0;else e=1}else e=0;return e|0}function Dr(e,t,n,i,u,a,l,f,d,p,v){e=e|0;t=Y(t);n=Y(n);i=i|0;u=u|0;a=a|0;l=Y(l);f=Y(f);d=d|0;p=p|0;v=v|0;var m=0,g=0,y=0,_=0,b=ft,w=ft,E=0,D=0,S=0,C=0,k=0,T=0,x=0,A=0,O=0,P=0,I=0,N=ft,M=ft,R=ft,F=0.0,L=0.0;I=h;h=h+160|0;A=I+152|0;x=I+120|0;T=I+104|0;S=I+72|0;_=I+56|0;k=I+8|0;D=I;C=(o[2279]|0)+1|0;o[2279]=C;O=e+984|0;if((r[O>>0]|0)!=0?(o[e+512>>2]|0)!=(o[2278]|0):0)E=4;else if((o[e+516>>2]|0)==(i|0))P=0;else E=4;if((E|0)==4){o[e+520>>2]=0;o[e+924>>2]=-1;o[e+928>>2]=-1;s[e+932>>2]=Y(-1.0);s[e+936>>2]=Y(-1.0);P=1}e:do{if(!(o[e+964>>2]|0)){if(d){m=e+916|0;if(!(vr(Y(s[m>>2]),t)|0)){E=21;break}if(!(vr(Y(s[e+920>>2]),n)|0)){E=21;break}if((o[e+924>>2]|0)!=(u|0)){E=21;break}m=(o[e+928>>2]|0)==(a|0)?m:0;E=22;break}y=o[e+520>>2]|0;if(!y)E=21;else{g=0;while(1){m=e+524+(g*24|0)|0;if(((vr(Y(s[m>>2]),t)|0?vr(Y(s[e+524+(g*24|0)+4>>2]),n)|0:0)?(o[e+524+(g*24|0)+8>>2]|0)==(u|0):0)?(o[e+524+(g*24|0)+12>>2]|0)==(a|0):0){E=22;break e}g=g+1|0;if(g>>>0>=y>>>0){E=21;break}}}}else{b=Y(Sr(e,2,l));w=Y(Sr(e,0,l));m=e+916|0;R=Y(s[m>>2]);M=Y(s[e+920>>2]);N=Y(s[e+932>>2]);if(!(_r(u,t,a,n,o[e+924>>2]|0,R,o[e+928>>2]|0,M,N,Y(s[e+936>>2]),b,w,v)|0)){y=o[e+520>>2]|0;if(!y)E=21;else{g=0;while(1){m=e+524+(g*24|0)|0;N=Y(s[m>>2]);M=Y(s[e+524+(g*24|0)+4>>2]);R=Y(s[e+524+(g*24|0)+16>>2]);if(_r(u,t,a,n,o[e+524+(g*24|0)+8>>2]|0,N,o[e+524+(g*24|0)+12>>2]|0,M,R,Y(s[e+524+(g*24|0)+20>>2]),b,w,v)|0){E=22;break e}g=g+1|0;if(g>>>0>=y>>>0){E=21;break}}}}else E=22}}while(0);do{if((E|0)==21){if(!(r[11697]|0)){m=0;E=31}else{m=0;E=28}}else if((E|0)==22){g=(r[11697]|0)!=0;if(!((m|0)!=0&(P^1)))if(g){E=28;break}else{E=31;break}_=m+16|0;o[e+908>>2]=o[_>>2];y=m+20|0;o[e+912>>2]=o[y>>2];if(!((r[11698]|0)==0|g^1)){o[D>>2]=kr(C)|0;o[D+4>>2]=C;Cr(e,4,2972,D);g=o[e+972>>2]|0;if(g|0)hA[g&127](e);u=Tr(u,d)|0;a=Tr(a,d)|0;L=+Y(s[_>>2]);F=+Y(s[y>>2]);o[k>>2]=u;o[k+4>>2]=a;c[k+8>>3]=+t;c[k+16>>3]=+n;c[k+24>>3]=L;c[k+32>>3]=F;o[k+40>>2]=p;Cr(e,4,2989,k)}}}while(0);if((E|0)==28){g=kr(C)|0;o[_>>2]=g;o[_+4>>2]=C;o[_+8>>2]=P?3047:11699;Cr(e,4,3038,_);g=o[e+972>>2]|0;if(g|0)hA[g&127](e);k=Tr(u,d)|0;E=Tr(a,d)|0;o[S>>2]=k;o[S+4>>2]=E;c[S+8>>3]=+t;c[S+16>>3]=+n;o[S+24>>2]=p;Cr(e,4,3049,S);E=31}if((E|0)==31){xr(e,t,n,i,u,a,l,f,d,v);if(r[11697]|0){g=o[2279]|0;k=kr(g)|0;o[T>>2]=k;o[T+4>>2]=g;o[T+8>>2]=P?3047:11699;Cr(e,4,3083,T);g=o[e+972>>2]|0;if(g|0)hA[g&127](e);k=Tr(u,d)|0;T=Tr(a,d)|0;F=+Y(s[e+908>>2]);L=+Y(s[e+912>>2]);o[x>>2]=k;o[x+4>>2]=T;c[x+8>>3]=F;c[x+16>>3]=L;o[x+24>>2]=p;Cr(e,4,3092,x)}o[e+516>>2]=i;if(!m){g=e+520|0;m=o[g>>2]|0;if((m|0)==16){if(r[11697]|0)Cr(e,4,3124,A);o[g>>2]=0;m=0}if(d)m=e+916|0;else{o[g>>2]=m+1;m=e+524+(m*24|0)|0}s[m>>2]=t;s[m+4>>2]=n;o[m+8>>2]=u;o[m+12>>2]=a;o[m+16>>2]=o[e+908>>2];o[m+20>>2]=o[e+912>>2];m=0}}if(d){o[e+416>>2]=o[e+908>>2];o[e+420>>2]=o[e+912>>2];r[e+985>>0]=1;r[O>>0]=0}o[2279]=(o[2279]|0)+-1;o[e+512>>2]=o[2278];h=I;return P|(m|0)==0|0}function Sr(e,t,n){e=e|0;t=t|0;n=Y(n);var r=ft;r=Y(Vr(e,t,n));return Y(r+Y(qr(e,t,n)))}function Cr(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0;u=h;h=h+16|0;i=u;o[i>>2]=r;if(!e)r=0;else r=o[e+976>>2]|0;Br(r,e,t,n,i);h=u;return}function kr(e){e=e|0;return(e>>>0>60?3201:3201+(60-e)|0)|0}function Tr(e,t){e=e|0;t=t|0;var n=0,r=0,i=0;i=h;h=h+32|0;n=i+12|0;r=i;o[n>>2]=o[254];o[n+4>>2]=o[255];o[n+8>>2]=o[256];o[r>>2]=o[257];o[r+4>>2]=o[258];o[r+8>>2]=o[259];if((e|0)>2)e=11699;else e=o[(t?r:n)+(e<<2)>>2]|0;h=i;return e|0}function xr(e,t,n,i,a,l,c,f,p,v){e=e|0;t=Y(t);n=Y(n);i=i|0;a=a|0;l=l|0;c=Y(c);f=Y(f);p=p|0;v=v|0;var m=0,g=0,y=0,_=0,b=ft,w=ft,E=ft,D=ft,S=ft,C=ft,k=ft,T=0,x=0,A=0,O=ft,P=ft,I=0,N=ft,M=0,R=0,F=0,L=0,B=0,j=0,U=0,z=0,W=0,H=0,V=0,q=0,G=0,$=0,K=0,X=0,Q=0,J=0,Z=ft,ee=ft,te=ft,ne=ft,re=ft,ie=0,oe=0,ue=0,ae=0,le=0,se=ft,ce=ft,fe=ft,de=ft,pe=ft,he=ft,ve=0,me=ft,ge=ft,ye=ft,_e=ft,be=ft,we=ft,Ee=0,De=0,Se=ft,Ce=ft,ke=0,Te=0,xe=0,Ae=0,Oe=ft,Pe=0,Ie=0,Ne=0,Me=0,Re=0,Fe=0,Le=0,Be=ft,je=0,Ue=0;Le=h;h=h+16|0;ie=Le+12|0;oe=Le+8|0;ue=Le+4|0;ae=Le;Rt(e,(a|0)==0|(wt(t)|0)^1,3326);Rt(e,(l|0)==0|(wt(n)|0)^1,3406);Ie=Yr(e,i)|0;o[e+496>>2]=Ie;Re=Kr(2,Ie)|0;Fe=Kr(0,Ie)|0;s[e+440>>2]=Y(Vr(e,Re,c));s[e+444>>2]=Y(qr(e,Re,c));s[e+428>>2]=Y(Vr(e,Fe,c));s[e+436>>2]=Y(qr(e,Fe,c));s[e+464>>2]=Y(Xr(e,Re));s[e+468>>2]=Y(Qr(e,Re));s[e+452>>2]=Y(Xr(e,Fe));s[e+460>>2]=Y(Qr(e,Fe));s[e+488>>2]=Y(Jr(e,Re,c));s[e+492>>2]=Y(Zr(e,Re,c));s[e+476>>2]=Y(Jr(e,Fe,c));s[e+484>>2]=Y(Zr(e,Fe,c));do{if(!(o[e+964>>2]|0)){Ne=e+948|0;Me=(o[e+952>>2]|0)-(o[Ne>>2]|0)>>2;if(!Me){ti(e,t,n,a,l,c,f);break}if(!p?ni(e,t,n,a,l,c,f)|0:0)break;Wt(e);X=e+508|0;r[X>>0]=0;Re=Kr(o[e+4>>2]|0,Ie)|0;Fe=ri(Re,Ie)|0;Pe=Gr(Re)|0;Q=o[e+8>>2]|0;Te=e+28|0;J=(o[Te>>2]|0)!=0;be=Pe?c:f;Se=Pe?f:c;Z=Y(ii(e,Re,c));ee=Y(oi(e,Re,c));b=Y(ii(e,Fe,c));we=Y(ui(e,Re,c));Ce=Y(ui(e,Fe,c));A=Pe?a:l;ke=Pe?l:a;Oe=Pe?we:Ce;S=Pe?Ce:we;_e=Y(Sr(e,2,c));D=Y(Sr(e,0,c));w=Y(Y(Nr(e+364|0,c))-Oe);E=Y(Y(Nr(e+380|0,c))-Oe);C=Y(Y(Nr(e+372|0,f))-S);k=Y(Y(Nr(e+388|0,f))-S);te=Pe?w:C;ne=Pe?E:k;_e=Y(t-_e);t=Y(_e-Oe);if(wt(t)|0)Oe=t;else Oe=Y(NT(Y(RT(t,E)),w));ge=Y(n-D);t=Y(ge-S);if(wt(t)|0)ye=t;else ye=Y(NT(Y(RT(t,k)),C));w=Pe?Oe:ye;me=Pe?ye:Oe;e:do{if((A|0)==1){i=0;g=0;while(1){m=Pt(e,g)|0;if(!i){if(Y(li(m))>Y(0.0)?Y(si(m))>Y(0.0):0)i=m;else i=0}else if(ai(m)|0){_=0;break e}g=g+1|0;if(g>>>0>=Me>>>0){_=i;break}}}else _=0}while(0);T=_+500|0;x=_+504|0;i=0;m=0;t=Y(0.0);y=0;do{g=o[(o[Ne>>2]|0)+(y<<2)>>2]|0;if((o[g+36>>2]|0)==1){ci(g);r[g+985>>0]=1;r[g+984>>0]=0}else{Pr(g);if(p)Mr(g,Yr(g,Ie)|0,w,me,Oe);do{if((o[g+24>>2]|0)!=1){if((g|0)==(_|0)){o[T>>2]=o[2278];s[x>>2]=Y(0.0);break}else{fi(e,g,Oe,a,ye,Oe,ye,l,Ie,v);break}}else{if(m|0)o[m+960>>2]=g;o[g+960>>2]=0;m=g;i=(i|0)==0?g:i}}while(0);he=Y(s[g+504>>2]);t=Y(t+Y(he+Y(Sr(g,Re,Oe))))}y=y+1|0}while((y|0)!=(Me|0));F=t>w;ve=J&((A|0)==2&F)?1:A;M=(ke|0)==1;B=M&(p^1);j=(ve|0)==1;U=(ve|0)==2;z=976+(Re<<2)|0;W=(ke|2|0)==2;$=M&(J^1);H=1040+(Fe<<2)|0;V=1040+(Re<<2)|0;q=976+(Fe<<2)|0;G=(ke|0)!=1;F=J&((A|0)!=0&F);R=e+976|0;M=M^1;t=w;I=0;L=0;he=Y(0.0);re=Y(0.0);while(1){e:do{if(I>>>0>>0){x=o[Ne>>2]|0;y=0;k=Y(0.0);C=Y(0.0);E=Y(0.0);w=Y(0.0);g=0;m=0;_=I;while(1){T=o[x+(_<<2)>>2]|0;if((o[T+36>>2]|0)!=1?(o[T+940>>2]=L,(o[T+24>>2]|0)!=1):0){D=Y(Sr(T,Re,Oe));K=o[z>>2]|0;n=Y(Nr(T+380+(K<<3)|0,be));S=Y(s[T+504>>2]);n=Y(RT(n,S));n=Y(NT(Y(Nr(T+364+(K<<3)|0,be)),n));if(J&(y|0)!=0&Y(D+Y(C+n))>t){l=y;D=k;A=_;break e}D=Y(D+n);n=Y(C+D);D=Y(k+D);if(ai(T)|0){E=Y(E+Y(li(T)));w=Y(w-Y(S*Y(si(T))))}if(m|0)o[m+960>>2]=T;o[T+960>>2]=0;y=y+1|0;m=T;g=(g|0)==0?T:g}else{D=k;n=C}_=_+1|0;if(_>>>0>>0){k=D;C=n}else{l=y;A=_;break}}}else{l=0;D=Y(0.0);E=Y(0.0);w=Y(0.0);g=0;A=I}}while(0);K=E>Y(0.0)&EY(0.0)&wne&((wt(ne)|0)^1))){if(!(r[(o[R>>2]|0)+3>>0]|0)){if(!(O==Y(0.0))?!(Y(li(e))==Y(0.0)):0){K=53;break}t=D;K=53}else K=51}else{t=ne;K=51}}else{t=te;K=51}}else K=51}while(0);if((K|0)==51){K=0;if(wt(t)|0)K=53;else{P=Y(t-D);N=t}}if((K|0)==53){K=0;if(D>2]|0;_=PY(0.0);C=Y(P/O);E=Y(0.0);D=Y(0.0);t=Y(0.0);m=g;do{n=Y(Nr(m+380+(y<<3)|0,be));w=Y(Nr(m+364+(y<<3)|0,be));w=Y(RT(n,Y(NT(w,Y(s[m+504>>2])))));if(_){n=Y(w*Y(si(m)));if(n!=Y(-0.0)?(Be=Y(w-Y(S*n)),se=Y(di(m,Re,Be,N,Oe)),Be!=se):0){E=Y(E-Y(se-w));t=Y(t+n)}}else if((T?(ce=Y(li(m)),ce!=Y(0.0)):0)?(Be=Y(w+Y(C*ce)),fe=Y(di(m,Re,Be,N,Oe)),Be!=fe):0){E=Y(E-Y(fe-w));D=Y(D-ce)}m=o[m+960>>2]|0}while((m|0)!=0);t=Y(k+t);w=Y(P+E);if(!le){S=Y(O+D);_=o[z>>2]|0;T=wY(0.0);S=Y(w/S);t=Y(0.0);do{Be=Y(Nr(g+380+(_<<3)|0,be));E=Y(Nr(g+364+(_<<3)|0,be));E=Y(RT(Be,Y(NT(E,Y(s[g+504>>2])))));if(T){Be=Y(E*Y(si(g)));w=Y(-Be);if(Be!=Y(-0.0)){Be=Y(C*w);w=Y(di(g,Re,Y(E+(x?w:Be)),N,Oe))}else w=E}else if(y?(de=Y(li(g)),de!=Y(0.0)):0)w=Y(di(g,Re,Y(E+Y(S*de)),N,Oe));else w=E;t=Y(t-Y(w-E));D=Y(Sr(g,Re,Oe));n=Y(Sr(g,Fe,Oe));w=Y(w+D);s[oe>>2]=w;o[ae>>2]=1;E=Y(s[g+396>>2]);e:do{if(wt(E)|0){m=wt(me)|0;do{if(!m){if(F|(Ir(g,Fe,me)|0|M))break;if((pi(e,g)|0)!=4)break;if((o[(hi(g,Fe)|0)+4>>2]|0)==3)break;if((o[(vi(g,Fe)|0)+4>>2]|0)==3)break;s[ie>>2]=me;o[ue>>2]=1;break e}}while(0);if(Ir(g,Fe,me)|0){m=o[g+992+(o[q>>2]<<2)>>2]|0;Be=Y(n+Y(Nr(m,me)));s[ie>>2]=Be;m=G&(o[m+4>>2]|0)==2;o[ue>>2]=((wt(Be)|0|m)^1)&1;break}else{s[ie>>2]=me;o[ue>>2]=m?0:2;break}}else{Be=Y(w-D);O=Y(Be/E);Be=Y(E*Be);o[ue>>2]=1;s[ie>>2]=Y(n+(Pe?O:Be))}}while(0);mi(g,Re,N,Oe,ae,oe);mi(g,Fe,me,Oe,ue,ie);do{if(!(Ir(g,Fe,me)|0)?(pi(e,g)|0)==4:0){if((o[(hi(g,Fe)|0)+4>>2]|0)==3){m=0;break}m=(o[(vi(g,Fe)|0)+4>>2]|0)!=3}else m=0}while(0);Be=Y(s[oe>>2]);O=Y(s[ie>>2]);je=o[ae>>2]|0;Ue=o[ue>>2]|0;Dr(g,Pe?Be:O,Pe?O:Be,Ie,Pe?je:Ue,Pe?Ue:je,Oe,ye,p&(m^1),3488,v)|0;r[X>>0]=r[X>>0]|r[g+508>>0];g=o[g+960>>2]|0}while((g|0)!=0)}else t=Y(0.0)}else t=Y(0.0);t=Y(P+t);Ue=t>0]=Ue|u[X>>0];if(U&t>Y(0.0)){m=o[z>>2]|0;if((o[e+364+(m<<3)+4>>2]|0)!=0?(pe=Y(Nr(e+364+(m<<3)|0,be)),pe>=Y(0.0)):0)w=Y(NT(Y(0.0),Y(pe-Y(N-t))));else w=Y(0.0)}else w=t;T=I>>>0>>0;if(T){_=o[Ne>>2]|0;y=I;m=0;do{g=o[_+(y<<2)>>2]|0;if(!(o[g+24>>2]|0)){m=((o[(hi(g,Re)|0)+4>>2]|0)==3&1)+m|0;m=m+((o[(vi(g,Re)|0)+4>>2]|0)==3&1)|0}y=y+1|0}while((y|0)!=(A|0));if(m){D=Y(0.0);n=Y(0.0)}else K=101}else K=101;e:do{if((K|0)==101){K=0;switch(Q|0){case 1:{m=0;D=Y(w*Y(.5));n=Y(0.0);break e}case 2:{m=0;D=w;n=Y(0.0);break e}case 3:{if(l>>>0<=1){m=0;D=Y(0.0);n=Y(0.0);break e}n=Y((l+-1|0)>>>0);m=0;D=Y(0.0);n=Y(Y(NT(w,Y(0.0)))/n);break e}case 5:{n=Y(w/Y((l+1|0)>>>0));m=0;D=n;break e}case 4:{n=Y(w/Y(l>>>0));m=0;D=Y(n*Y(.5));break e}default:{m=0;D=Y(0.0);n=Y(0.0);break e}}}}while(0);t=Y(Z+D);if(T){E=Y(w/Y(m|0));y=o[Ne>>2]|0;g=I;w=Y(0.0);do{m=o[y+(g<<2)>>2]|0;e:do{if((o[m+36>>2]|0)!=1){switch(o[m+24>>2]|0){case 1:{if(gi(m,Re)|0){if(!p)break e;Be=Y(yi(m,Re,N));Be=Y(Be+Y(Xr(e,Re)));Be=Y(Be+Y(Vr(m,Re,Oe)));s[m+400+(o[V>>2]<<2)>>2]=Be;break e}break}case 0:{Ue=(o[(hi(m,Re)|0)+4>>2]|0)==3;Be=Y(E+t);t=Ue?Be:t;if(p){Ue=m+400+(o[V>>2]<<2)|0;s[Ue>>2]=Y(t+Y(s[Ue>>2]))}Ue=(o[(vi(m,Re)|0)+4>>2]|0)==3;Be=Y(E+t);t=Ue?Be:t;if(B){Be=Y(n+Y(Sr(m,Re,Oe)));w=me;t=Y(t+Y(Be+Y(s[m+504>>2])));break e}else{t=Y(t+Y(n+Y(_i(m,Re,Oe))));w=Y(NT(w,Y(_i(m,Fe,Oe))));break e}}default:{}}if(p){Be=Y(D+Y(Xr(e,Re)));Ue=m+400+(o[V>>2]<<2)|0;s[Ue>>2]=Y(Be+Y(s[Ue>>2]))}}}while(0);g=g+1|0}while((g|0)!=(A|0))}else w=Y(0.0);n=Y(ee+t);if(W)D=Y(Y(di(e,Fe,Y(Ce+w),Se,c))-Ce);else D=me;E=Y(Y(di(e,Fe,Y(Ce+($?me:w)),Se,c))-Ce);if(T&p){g=I;do{y=o[(o[Ne>>2]|0)+(g<<2)>>2]|0;do{if((o[y+36>>2]|0)!=1){if((o[y+24>>2]|0)==1){if(gi(y,Fe)|0){Be=Y(yi(y,Fe,me));Be=Y(Be+Y(Xr(e,Fe)));Be=Y(Be+Y(Vr(y,Fe,Oe)));m=o[H>>2]|0;s[y+400+(m<<2)>>2]=Be;if(!(wt(Be)|0))break}else m=o[H>>2]|0;Be=Y(Xr(e,Fe));s[y+400+(m<<2)>>2]=Y(Be+Y(Vr(y,Fe,Oe)));break}m=pi(e,y)|0;do{if((m|0)==4){if((o[(hi(y,Fe)|0)+4>>2]|0)==3){K=139;break}if((o[(vi(y,Fe)|0)+4>>2]|0)==3){K=139;break}if(Ir(y,Fe,me)|0){t=b;break}je=o[y+908+(o[z>>2]<<2)>>2]|0;o[ie>>2]=je;t=Y(s[y+396>>2]);Ue=wt(t)|0;w=(o[d>>2]=je,Y(s[d>>2]));if(Ue)t=E;else{P=Y(Sr(y,Fe,Oe));Be=Y(w/t);t=Y(t*w);t=Y(P+(Pe?Be:t))}s[oe>>2]=t;s[ie>>2]=Y(Y(Sr(y,Re,Oe))+w);o[ue>>2]=1;o[ae>>2]=1;mi(y,Re,N,Oe,ue,ie);mi(y,Fe,me,Oe,ae,oe);t=Y(s[ie>>2]);P=Y(s[oe>>2]);Be=Pe?t:P;t=Pe?P:t;Ue=((wt(Be)|0)^1)&1;Dr(y,Be,t,Ie,Ue,((wt(t)|0)^1)&1,Oe,ye,1,3493,v)|0;t=b}else K=139}while(0);e:do{if((K|0)==139){K=0;t=Y(D-Y(_i(y,Fe,Oe)));do{if((o[(hi(y,Fe)|0)+4>>2]|0)==3){if((o[(vi(y,Fe)|0)+4>>2]|0)!=3)break;t=Y(b+Y(NT(Y(0.0),Y(t*Y(.5)))));break e}}while(0);if((o[(vi(y,Fe)|0)+4>>2]|0)==3){t=b;break}if((o[(hi(y,Fe)|0)+4>>2]|0)==3){t=Y(b+Y(NT(Y(0.0),t)));break}switch(m|0){case 1:{t=b;break e}case 2:{t=Y(b+Y(t*Y(.5)));break e}default:{t=Y(b+t);break e}}}}while(0);Be=Y(he+t);Ue=y+400+(o[H>>2]<<2)|0;s[Ue>>2]=Y(Be+Y(s[Ue>>2]))}}while(0);g=g+1|0}while((g|0)!=(A|0))}he=Y(he+E);re=Y(NT(re,n));l=L+1|0;if(A>>>0>=Me>>>0)break;else{t=N;I=A;L=l}}do{if(p){m=l>>>0>1;if(!m?!(bi(e)|0):0)break;if(!(wt(me)|0)){t=Y(me-he);e:do{switch(o[e+12>>2]|0){case 3:{b=Y(b+t);C=Y(0.0);break}case 2:{b=Y(b+Y(t*Y(.5)));C=Y(0.0);break}case 4:{if(me>he)C=Y(t/Y(l>>>0));else C=Y(0.0);break}case 7:if(me>he){b=Y(b+Y(t/Y(l<<1>>>0)));C=Y(t/Y(l>>>0));C=m?C:Y(0.0);break e}else{b=Y(b+Y(t*Y(.5)));C=Y(0.0);break e}case 6:{C=Y(t/Y(L>>>0));C=me>he&m?C:Y(0.0);break}default:C=Y(0.0)}}while(0);if(l|0){T=1040+(Fe<<2)|0;x=976+(Fe<<2)|0;_=0;g=0;while(1){e:do{if(g>>>0>>0){w=Y(0.0);E=Y(0.0);t=Y(0.0);y=g;while(1){m=o[(o[Ne>>2]|0)+(y<<2)>>2]|0;do{if((o[m+36>>2]|0)!=1?(o[m+24>>2]|0)==0:0){if((o[m+940>>2]|0)!=(_|0))break e;if(wi(m,Fe)|0){Be=Y(s[m+908+(o[x>>2]<<2)>>2]);t=Y(NT(t,Y(Be+Y(Sr(m,Fe,Oe)))))}if((pi(e,m)|0)!=5)break;pe=Y(Ei(m));pe=Y(pe+Y(Vr(m,0,Oe)));Be=Y(s[m+912>>2]);Be=Y(Y(Be+Y(Sr(m,0,Oe)))-pe);pe=Y(NT(E,pe));Be=Y(NT(w,Be));w=Be;E=pe;t=Y(NT(t,Y(pe+Be)))}}while(0);m=y+1|0;if(m>>>0>>0)y=m;else{y=m;break}}}else{E=Y(0.0);t=Y(0.0);y=g}}while(0);S=Y(C+t);n=b;b=Y(b+S);if(g>>>0>>0){D=Y(n+E);m=g;do{g=o[(o[Ne>>2]|0)+(m<<2)>>2]|0;e:do{if((o[g+36>>2]|0)!=1?(o[g+24>>2]|0)==0:0)switch(pi(e,g)|0){case 1:{Be=Y(n+Y(Vr(g,Fe,Oe)));s[g+400+(o[T>>2]<<2)>>2]=Be;break e}case 3:{Be=Y(Y(b-Y(qr(g,Fe,Oe)))-Y(s[g+908+(o[x>>2]<<2)>>2]));s[g+400+(o[T>>2]<<2)>>2]=Be;break e}case 2:{Be=Y(n+Y(Y(S-Y(s[g+908+(o[x>>2]<<2)>>2]))*Y(.5)));s[g+400+(o[T>>2]<<2)>>2]=Be;break e}case 4:{Be=Y(n+Y(Vr(g,Fe,Oe)));s[g+400+(o[T>>2]<<2)>>2]=Be;if(Ir(g,Fe,me)|0)break e;if(Pe){w=Y(s[g+908>>2]);t=Y(w+Y(Sr(g,Re,Oe)));E=S}else{E=Y(s[g+912>>2]);E=Y(E+Y(Sr(g,Fe,Oe)));t=S;w=Y(s[g+908>>2])}if(vr(t,w)|0?vr(E,Y(s[g+912>>2]))|0:0)break e;Dr(g,t,E,Ie,1,1,Oe,ye,1,3501,v)|0;break e}case 5:{s[g+404>>2]=Y(Y(D-Y(Ei(g)))+Y(yi(g,0,me)));break e}default:break e}}while(0);m=m+1|0}while((m|0)!=(y|0))}_=_+1|0;if((_|0)==(l|0))break;else g=y}}}}}while(0);s[e+908>>2]=Y(di(e,2,_e,c,c));s[e+912>>2]=Y(di(e,0,ge,f,c));if((ve|0)!=0?(Ee=o[e+32>>2]|0,De=(ve|0)==2,!(De&(Ee|0)!=2)):0){if(De&(Ee|0)==2){t=Y(we+N);t=Y(NT(Y(RT(t,Y(Di(e,Re,re,be)))),we));K=198}}else{t=Y(di(e,Re,re,be,c));K=198}if((K|0)==198)s[e+908+(o[976+(Re<<2)>>2]<<2)>>2]=t;if((ke|0)!=0?(xe=o[e+32>>2]|0,Ae=(ke|0)==2,!(Ae&(xe|0)!=2)):0){if(Ae&(xe|0)==2){t=Y(Ce+me);t=Y(NT(Y(RT(t,Y(Di(e,Fe,Y(Ce+he),Se)))),Ce));K=204}}else{t=Y(di(e,Fe,Y(Ce+he),Se,c));K=204}if((K|0)==204)s[e+908+(o[976+(Fe<<2)>>2]<<2)>>2]=t;if(p){if((o[Te>>2]|0)==2){g=976+(Fe<<2)|0;y=1040+(Fe<<2)|0;m=0;do{_=Pt(e,m)|0;if(!(o[_+24>>2]|0)){je=o[g>>2]|0;Be=Y(s[e+908+(je<<2)>>2]);Ue=_+400+(o[y>>2]<<2)|0;Be=Y(Be-Y(s[Ue>>2]));s[Ue>>2]=Y(Be-Y(s[_+908+(je<<2)>>2]))}m=m+1|0}while((m|0)!=(Me|0))}if(i|0){m=Pe?ve:a;do{Si(e,i,Oe,m,ye,Ie,v);i=o[i+960>>2]|0}while((i|0)!=0)}m=(Re|2|0)==3;g=(Fe|2|0)==3;if(m|g){i=0;do{y=o[(o[Ne>>2]|0)+(i<<2)>>2]|0;if((o[y+36>>2]|0)!=1){if(m)Ci(e,y,Re);if(g)Ci(e,y,Fe)}i=i+1|0}while((i|0)!=(Me|0))}}}else ei(e,t,n,a,l,c,f)}while(0);h=Le;return}function Ar(e,t){e=e|0;t=Y(t);var n=0;St(e,t>=Y(0.0),3147);n=t==Y(0.0);s[e+4>>2]=n?Y(0.0):t;return}function Or(e,t,n,i){e=e|0;t=Y(t);n=Y(n);i=i|0;var u=ft,a=ft,l=0,c=0,f=0;o[2278]=(o[2278]|0)+1;Pr(e);if(!(Ir(e,2,t)|0)){u=Y(Nr(e+380|0,t));if(!(u>=Y(0.0))){f=((wt(t)|0)^1)&1;u=t}else f=2}else{u=Y(Nr(o[e+992>>2]|0,t));f=1;u=Y(u+Y(Sr(e,2,t)))}if(!(Ir(e,0,n)|0)){a=Y(Nr(e+388|0,n));if(!(a>=Y(0.0))){c=((wt(n)|0)^1)&1;a=n}else c=2}else{a=Y(Nr(o[e+996>>2]|0,n));c=1;a=Y(a+Y(Sr(e,0,t)))}l=e+976|0;if(Dr(e,u,a,i,f,c,t,n,1,3189,o[l>>2]|0)|0?(Mr(e,o[e+496>>2]|0,t,n,t),Rr(e,Y(s[(o[l>>2]|0)+4>>2]),Y(0.0),Y(0.0)),r[11696]|0):0)mr(e,7);return}function Pr(e){e=e|0;var t=0,n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;a=l+24|0;u=l+16|0;r=l+8|0;i=l;n=0;do{t=e+380+(n<<3)|0;if(!((o[e+380+(n<<3)+4>>2]|0)!=0?(s=t,c=o[s+4>>2]|0,f=r,o[f>>2]=o[s>>2],o[f+4>>2]=c,f=e+364+(n<<3)|0,c=o[f+4>>2]|0,s=i,o[s>>2]=o[f>>2],o[s+4>>2]=c,o[u>>2]=o[r>>2],o[u+4>>2]=o[r+4>>2],o[a>>2]=o[i>>2],o[a+4>>2]=o[i+4>>2],hr(u,a)|0):0))t=e+348+(n<<3)|0;o[e+992+(n<<2)>>2]=t;n=n+1|0}while((n|0)!=2);h=l;return}function Ir(e,t,n){e=e|0;t=t|0;n=Y(n);var r=0;e=o[e+992+(o[976+(t<<2)>>2]<<2)>>2]|0;switch(o[e+4>>2]|0){case 0:case 3:{e=0;break}case 1:{if(Y(s[e>>2])>2])>2]|0){case 2:{t=Y(Y(Y(s[e>>2])*t)/Y(100.0));break}case 1:{t=Y(s[e>>2]);break}default:t=Y(E)}return Y(t)}function Mr(e,t,n,r,i){e=e|0;t=t|0;n=Y(n);r=Y(r);i=Y(i);var u=0,a=ft;t=o[e+944>>2]|0?t:1;u=Kr(o[e+4>>2]|0,t)|0;t=ri(u,t)|0;n=Y(Pi(e,u,n));r=Y(Pi(e,t,r));a=Y(n+Y(Vr(e,u,i)));s[e+400+(o[1040+(u<<2)>>2]<<2)>>2]=a;n=Y(n+Y(qr(e,u,i)));s[e+400+(o[1e3+(u<<2)>>2]<<2)>>2]=n;n=Y(r+Y(Vr(e,t,i)));s[e+400+(o[1040+(t<<2)>>2]<<2)>>2]=n;i=Y(r+Y(qr(e,t,i)));s[e+400+(o[1e3+(t<<2)>>2]<<2)>>2]=i;return}function Rr(e,t,n,r){e=e|0;t=Y(t);n=Y(n);r=Y(r);var i=0,u=0,a=ft,l=ft,c=0,f=0,d=ft,p=0,h=ft,v=ft,m=ft,g=ft;if(!(t==Y(0.0))){i=e+400|0;g=Y(s[i>>2]);u=e+404|0;m=Y(s[u>>2]);p=e+416|0;v=Y(s[p>>2]);f=e+420|0;a=Y(s[f>>2]);h=Y(g+n);d=Y(m+r);r=Y(h+v);l=Y(d+a);c=(o[e+988>>2]|0)==1;s[i>>2]=Y(yr(g,t,0,c));s[u>>2]=Y(yr(m,t,0,c));n=Y(LT(Y(v*t),Y(1.0)));if(vr(n,Y(0.0))|0)u=0;else u=(vr(n,Y(1.0))|0)^1;n=Y(LT(Y(a*t),Y(1.0)));if(vr(n,Y(0.0))|0)i=0;else i=(vr(n,Y(1.0))|0)^1;g=Y(yr(r,t,c&u,c&(u^1)));s[p>>2]=Y(g-Y(yr(h,t,0,c)));g=Y(yr(l,t,c&i,c&(i^1)));s[f>>2]=Y(g-Y(yr(d,t,0,c)));u=(o[e+952>>2]|0)-(o[e+948>>2]|0)>>2;if(u|0){i=0;do{Rr(Pt(e,i)|0,t,h,d);i=i+1|0}while((i|0)!=(u|0))}}return}function Fr(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;switch(n|0){case 5:case 0:{e=oT(o[489]|0,r,i)|0;break}default:e=jT(r,i)|0}return e|0}function Lr(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0;i=h;h=h+16|0;u=i;o[u>>2]=r;Br(e,0,t,n,u);h=i;return}function Br(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;e=e|0?e:956;xA[o[e+8>>2]&1](e,t,n,r,i)|0;if((n|0)==5)Ye();else return}function jr(e,t,n){e=e|0;t=t|0;n=n|0;r[e+t>>0]=n&1;return}function Ur(e,t){e=e|0;t=t|0;var n=0,r=0;o[e>>2]=0;o[e+4>>2]=0;o[e+8>>2]=0;n=t+4|0;r=(o[n>>2]|0)-(o[t>>2]|0)>>2;if(r|0){zr(e,r);Wr(e,o[t>>2]|0,o[n>>2]|0,r)}return}function zr(e,t){e=e|0;t=t|0;var n=0;if((Hr(e)|0)>>>0>>0)UT(e);if(t>>>0>1073741823)Ye();else{n=$T(t<<2)|0;o[e+4>>2]=n;o[e>>2]=n;o[e+8>>2]=n+(t<<2);return}}function Wr(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;r=e+4|0;e=n-t|0;if((e|0)>0){ix(o[r>>2]|0,t|0,e|0)|0;o[r>>2]=(o[r>>2]|0)+(e>>>2<<2)}return}function Hr(e){e=e|0;return 1073741823}function Vr(e,t,n){e=e|0;t=t|0;n=Y(n);if(Gr(t)|0?(o[e+96>>2]|0)!=0:0)e=e+92|0;else e=Et(e+60|0,o[1040+(t<<2)>>2]|0,992)|0;return Y($r(e,n))}function qr(e,t,n){e=e|0;t=t|0;n=Y(n);if(Gr(t)|0?(o[e+104>>2]|0)!=0:0)e=e+100|0;else e=Et(e+60|0,o[1e3+(t<<2)>>2]|0,992)|0;return Y($r(e,n))}function Gr(e){e=e|0;return(e|1|0)==3|0}function $r(e,t){e=e|0;t=Y(t);if((o[e+4>>2]|0)==3)t=Y(0.0);else t=Y(Nr(e,t));return Y(t)}function Yr(e,t){e=e|0;t=t|0;e=o[e>>2]|0;return((e|0)==0?(t|0)>1?t:1:e)|0}function Kr(e,t){e=e|0;t=t|0;var n=0;e:do{if((t|0)==2){switch(e|0){case 2:{e=3;break e}case 3:break;default:{n=4;break e}}e=2}else n=4}while(0);return e|0}function Xr(e,t){e=e|0;t=t|0;var n=ft;if(!((Gr(t)|0?(o[e+312>>2]|0)!=0:0)?(n=Y(s[e+308>>2]),n>=Y(0.0)):0))n=Y(NT(Y(s[(Et(e+276|0,o[1040+(t<<2)>>2]|0,992)|0)>>2]),Y(0.0)));return Y(n)}function Qr(e,t){e=e|0;t=t|0;var n=ft;if(!((Gr(t)|0?(o[e+320>>2]|0)!=0:0)?(n=Y(s[e+316>>2]),n>=Y(0.0)):0))n=Y(NT(Y(s[(Et(e+276|0,o[1e3+(t<<2)>>2]|0,992)|0)>>2]),Y(0.0)));return Y(n)}function Jr(e,t,n){e=e|0;t=t|0;n=Y(n);var r=ft;if(!((Gr(t)|0?(o[e+240>>2]|0)!=0:0)?(r=Y(Nr(e+236|0,n)),r>=Y(0.0)):0))r=Y(NT(Y(Nr(Et(e+204|0,o[1040+(t<<2)>>2]|0,992)|0,n)),Y(0.0)));return Y(r)}function Zr(e,t,n){e=e|0;t=t|0;n=Y(n);var r=ft;if(!((Gr(t)|0?(o[e+248>>2]|0)!=0:0)?(r=Y(Nr(e+244|0,n)),r>=Y(0.0)):0))r=Y(NT(Y(Nr(Et(e+204|0,o[1e3+(t<<2)>>2]|0,992)|0,n)),Y(0.0)));return Y(r)}function ei(e,t,n,r,i,u,a){e=e|0;t=Y(t);n=Y(n);r=r|0;i=i|0;u=Y(u);a=Y(a);var l=ft,c=ft,f=ft,d=ft,p=ft,v=ft,m=0,g=0,y=0;y=h;h=h+16|0;m=y;g=e+964|0;Rt(e,(o[g>>2]|0)!=0,3519);l=Y(ui(e,2,t));c=Y(ui(e,0,t));f=Y(Sr(e,2,t));d=Y(Sr(e,0,t));if(wt(t)|0)p=t;else p=Y(NT(Y(0.0),Y(Y(t-f)-l)));if(wt(n)|0)v=n;else v=Y(NT(Y(0.0),Y(Y(n-d)-c)));if((r|0)==1&(i|0)==1){s[e+908>>2]=Y(di(e,2,Y(t-f),u,u));t=Y(di(e,0,Y(n-d),a,u))}else{OA[o[g>>2]&1](m,e,p,r,v,i);p=Y(l+Y(s[m>>2]));v=Y(t-f);s[e+908>>2]=Y(di(e,2,(r|2|0)==2?p:v,u,u));v=Y(c+Y(s[m+4>>2]));t=Y(n-d);t=Y(di(e,0,(i|2|0)==2?v:t,a,u))}s[e+912>>2]=t;h=y;return}function ti(e,t,n,r,i,o,u){e=e|0;t=Y(t);n=Y(n);r=r|0;i=i|0;o=Y(o);u=Y(u);var a=ft,l=ft,c=ft,f=ft;c=Y(ui(e,2,o));a=Y(ui(e,0,o));f=Y(Sr(e,2,o));l=Y(Sr(e,0,o));t=Y(t-f);s[e+908>>2]=Y(di(e,2,(r|2|0)==2?c:t,o,o));n=Y(n-l);s[e+912>>2]=Y(di(e,0,(i|2|0)==2?a:n,u,o));return}function ni(e,t,n,r,i,o,u){e=e|0;t=Y(t);n=Y(n);r=r|0;i=i|0;o=Y(o);u=Y(u);var a=0,l=ft,c=ft;a=(r|0)==2;if((!(t<=Y(0.0)&a)?!(n<=Y(0.0)&(i|0)==2):0)?!((r|0)==1&(i|0)==1):0)e=0;else{l=Y(Sr(e,0,o));c=Y(Sr(e,2,o));a=t>2]=Y(di(e,2,a?Y(0.0):t,o,o));t=Y(n-l);a=n>2]=Y(di(e,0,a?Y(0.0):t,u,o));e=1}return e|0}function ri(e,t){e=e|0;t=t|0;if(ki(e)|0)e=Kr(2,t)|0;else e=0;return e|0}function ii(e,t,n){e=e|0;t=t|0;n=Y(n);n=Y(Jr(e,t,n));return Y(n+Y(Xr(e,t)))}function oi(e,t,n){e=e|0;t=t|0;n=Y(n);n=Y(Zr(e,t,n));return Y(n+Y(Qr(e,t)))}function ui(e,t,n){e=e|0;t=t|0;n=Y(n);var r=ft;r=Y(ii(e,t,n));return Y(r+Y(oi(e,t,n)))}function ai(e){e=e|0;if(!(o[e+24>>2]|0)){if(Y(li(e))!=Y(0.0))e=1;else e=Y(si(e))!=Y(0.0)}else e=0;return e|0}function li(e){e=e|0;var t=ft;if(o[e+944>>2]|0){t=Y(s[e+44>>2]);if(wt(t)|0){t=Y(s[e+40>>2]);e=t>Y(0.0)&((wt(t)|0)^1);return Y(e?t:Y(0.0))}}else t=Y(0.0);return Y(t)}function si(e){e=e|0;var t=ft,n=0,i=ft;do{if(o[e+944>>2]|0){t=Y(s[e+48>>2]);if(wt(t)|0){n=r[(o[e+976>>2]|0)+2>>0]|0;if(n<<24>>24==0?(i=Y(s[e+40>>2]),i>24?Y(1.0):Y(0.0)}}else t=Y(0.0)}while(0);return Y(t)}function ci(e){e=e|0;var t=0,n=0;tx(e+400|0,0,540)|0;r[e+985>>0]=1;Wt(e);n=Ot(e)|0;if(n|0){t=e+948|0;e=0;do{ci(o[(o[t>>2]|0)+(e<<2)>>2]|0);e=e+1|0}while((e|0)!=(n|0))}return}function fi(e,t,n,r,i,u,a,l,c,f){e=e|0;t=t|0;n=Y(n);r=r|0;i=Y(i);u=Y(u);a=Y(a);l=l|0;c=c|0;f=f|0;var d=0,p=ft,v=0,m=0,g=ft,y=ft,_=0,b=ft,w=0,D=ft,S=0,C=0,k=0,T=0,x=0,A=0,O=0,P=0,I=0,N=0;I=h;h=h+16|0;k=I+12|0;T=I+8|0;x=I+4|0;A=I;P=Kr(o[e+4>>2]|0,c)|0;S=Gr(P)|0;p=Y(Nr(Ti(t)|0,S?u:a));C=Ir(t,2,u)|0;O=Ir(t,0,a)|0;do{if(!(wt(p)|0)?!(wt(S?n:i)|0):0){d=t+504|0;if(!(wt(Y(s[d>>2]))|0)){if(!(xi(o[t+976>>2]|0,0)|0))break;if((o[t+500>>2]|0)==(o[2278]|0))break}s[d>>2]=Y(NT(p,Y(ui(t,P,u))))}else v=7}while(0);do{if((v|0)==7){w=S^1;if(!(w|C^1)){a=Y(Nr(o[t+992>>2]|0,u));s[t+504>>2]=Y(NT(a,Y(ui(t,2,u))));break}if(!(S|O^1)){a=Y(Nr(o[t+996>>2]|0,a));s[t+504>>2]=Y(NT(a,Y(ui(t,0,u))));break}s[k>>2]=Y(E);s[T>>2]=Y(E);o[x>>2]=0;o[A>>2]=0;b=Y(Sr(t,2,u));D=Y(Sr(t,0,u));if(C){g=Y(b+Y(Nr(o[t+992>>2]|0,u)));s[k>>2]=g;o[x>>2]=1;m=1}else{m=0;g=Y(E)}if(O){p=Y(D+Y(Nr(o[t+996>>2]|0,a)));s[T>>2]=p;o[A>>2]=1;d=1}else{d=0;p=Y(E)}v=o[e+32>>2]|0;if(!(S&(v|0)==2)){if(wt(g)|0?!(wt(n)|0):0){s[k>>2]=n;o[x>>2]=2;m=2;g=n}}else v=2;if((!((v|0)==2&w)?wt(p)|0:0)?!(wt(i)|0):0){s[T>>2]=i;o[A>>2]=2;d=2;p=i}y=Y(s[t+396>>2]);_=wt(y)|0;do{if(!_){if((m|0)==1&w){s[T>>2]=Y(Y(g-b)/y);o[A>>2]=1;d=1;v=1;break}if(S&(d|0)==1){s[k>>2]=Y(y*Y(p-D));o[x>>2]=1;d=1;v=1}else v=m}else v=m}while(0);N=wt(n)|0;m=(pi(e,t)|0)!=4;if(!(S|C|((r|0)!=1|N)|(m|(v|0)==1))?(s[k>>2]=n,o[x>>2]=1,!_):0){s[T>>2]=Y(Y(n-b)/y);o[A>>2]=1;d=1}if(!(O|w|((l|0)!=1|(wt(i)|0))|(m|(d|0)==1))?(s[T>>2]=i,o[A>>2]=1,!_):0){s[k>>2]=Y(y*Y(i-D));o[x>>2]=1}mi(t,2,u,u,x,k);mi(t,0,a,u,A,T);n=Y(s[k>>2]);i=Y(s[T>>2]);Dr(t,n,i,c,o[x>>2]|0,o[A>>2]|0,u,a,0,3565,f)|0;a=Y(s[t+908+(o[976+(P<<2)>>2]<<2)>>2]);s[t+504>>2]=Y(NT(a,Y(ui(t,P,u))))}}while(0);o[t+500>>2]=o[2278];h=I;return}function di(e,t,n,r,i){e=e|0;t=t|0;n=Y(n);r=Y(r);i=Y(i);r=Y(Di(e,t,n,r));return Y(NT(r,Y(ui(e,t,i))))}function pi(e,t){e=e|0;t=t|0;t=t+20|0;t=o[((o[t>>2]|0)==0?e+16|0:t)>>2]|0;if((t|0)==5?ki(o[e+4>>2]|0)|0:0)t=1;return t|0}function hi(e,t){e=e|0;t=t|0;if(Gr(t)|0?(o[e+96>>2]|0)!=0:0)t=4;else t=o[1040+(t<<2)>>2]|0;return e+60+(t<<3)|0}function vi(e,t){e=e|0;t=t|0;if(Gr(t)|0?(o[e+104>>2]|0)!=0:0)t=5;else t=o[1e3+(t<<2)>>2]|0;return e+60+(t<<3)|0}function mi(e,t,n,r,i,u){e=e|0;t=t|0;n=Y(n);r=Y(r);i=i|0;u=u|0;n=Y(Nr(e+380+(o[976+(t<<2)>>2]<<3)|0,n));n=Y(n+Y(Sr(e,t,r)));switch(o[i>>2]|0){case 2:case 1:{i=wt(n)|0;r=Y(s[u>>2]);s[u>>2]=i|r>2]=2;s[u>>2]=n}break}default:{}}return}function gi(e,t){e=e|0;t=t|0;e=e+132|0;if(Gr(t)|0?(o[(Et(e,4,948)|0)+4>>2]|0)!=0:0)e=1;else e=(o[(Et(e,o[1040+(t<<2)>>2]|0,948)|0)+4>>2]|0)!=0;return e|0}function yi(e,t,n){e=e|0;t=t|0;n=Y(n);var r=0,i=0;e=e+132|0;if(Gr(t)|0?(r=Et(e,4,948)|0,(o[r+4>>2]|0)!=0):0)i=4;else{r=Et(e,o[1040+(t<<2)>>2]|0,948)|0;if(!(o[r+4>>2]|0))n=Y(0.0);else i=4}if((i|0)==4)n=Y(Nr(r,n));return Y(n)}function _i(e,t,n){e=e|0;t=t|0;n=Y(n);var r=ft;r=Y(s[e+908+(o[976+(t<<2)>>2]<<2)>>2]);r=Y(r+Y(Vr(e,t,n)));return Y(r+Y(qr(e,t,n)))}function bi(e){e=e|0;var t=0,n=0,r=0;e:do{if(!(ki(o[e+4>>2]|0)|0)){if((o[e+16>>2]|0)!=5){n=Ot(e)|0;if(!n)t=0;else{t=0;while(1){r=Pt(e,t)|0;if((o[r+24>>2]|0)==0?(o[r+20>>2]|0)==5:0){t=1;break e}t=t+1|0;if(t>>>0>=n>>>0){t=0;break}}}}else t=1}else t=0}while(0);return t|0}function wi(e,t){e=e|0;t=t|0;var n=ft;n=Y(s[e+908+(o[976+(t<<2)>>2]<<2)>>2]);return n>=Y(0.0)&((wt(n)|0)^1)|0}function Ei(e){e=e|0;var t=ft,n=0,r=0,i=0,u=0,a=0,l=0,c=ft;n=o[e+968>>2]|0;if(!n){u=Ot(e)|0;do{if(u|0){n=0;i=0;while(1){r=Pt(e,i)|0;if(o[r+940>>2]|0){a=8;break}if((o[r+24>>2]|0)!=1){l=(pi(e,r)|0)==5;if(l){n=r;break}else n=(n|0)==0?r:n}i=i+1|0;if(i>>>0>=u>>>0){a=8;break}}if((a|0)==8)if(!n)break;t=Y(Ei(n));return Y(t+Y(s[n+404>>2]))}}while(0);t=Y(s[e+912>>2])}else{c=Y(s[e+908>>2]);t=Y(s[e+912>>2]);t=Y(pA[n&0](e,c,t));Rt(e,(wt(t)|0)^1,3573)}return Y(t)}function Di(e,t,n,r){e=e|0;t=t|0;n=Y(n);r=Y(r);var i=ft,o=0;if(!(ki(t)|0)){if(Gr(t)|0){t=0;o=3}else{r=Y(E);i=Y(E)}}else{t=1;o=3}if((o|0)==3){i=Y(Nr(e+364+(t<<3)|0,r));r=Y(Nr(e+380+(t<<3)|0,r))}o=r=Y(0.0)&((wt(r)|0)^1));n=o?r:n;o=i>=Y(0.0)&((wt(i)|0)^1)&n>2]|0,u)|0;m=ri(y,u)|0;g=Gr(y)|0;p=Y(Sr(t,2,n));h=Y(Sr(t,0,n));if(!(Ir(t,2,n)|0)){if(gi(t,2)|0?Ai(t,2)|0:0){l=Y(s[e+908>>2]);c=Y(Xr(e,2));c=Y(l-Y(c+Y(Qr(e,2))));l=Y(yi(t,2,n));l=Y(di(t,2,Y(c-Y(l+Y(Oi(t,2,n)))),n,n))}else l=Y(E)}else l=Y(p+Y(Nr(o[t+992>>2]|0,n)));if(!(Ir(t,0,i)|0)){if(gi(t,0)|0?Ai(t,0)|0:0){c=Y(s[e+912>>2]);b=Y(Xr(e,0));b=Y(c-Y(b+Y(Qr(e,0))));c=Y(yi(t,0,i));c=Y(di(t,0,Y(b-Y(c+Y(Oi(t,0,i)))),i,n))}else c=Y(E)}else c=Y(h+Y(Nr(o[t+996>>2]|0,i)));f=wt(l)|0;d=wt(c)|0;do{if(f^d?(v=Y(s[t+396>>2]),!(wt(v)|0)):0)if(f){l=Y(p+Y(Y(c-h)*v));break}else{b=Y(h+Y(Y(l-p)/v));c=d?b:c;break}}while(0);d=wt(l)|0;f=wt(c)|0;if(d|f){w=(d^1)&1;r=n>Y(0.0)&((r|0)!=0&d);l=g?l:r?n:l;Dr(t,l,c,u,g?w:r?2:w,d&(f^1)&1,l,c,0,3623,a)|0;l=Y(s[t+908>>2]);l=Y(l+Y(Sr(t,2,n)));c=Y(s[t+912>>2]);c=Y(c+Y(Sr(t,0,n)))}Dr(t,l,c,u,1,1,l,c,1,3635,a)|0;if(Ai(t,y)|0?!(gi(t,y)|0):0){w=o[976+(y<<2)>>2]|0;b=Y(s[e+908+(w<<2)>>2]);b=Y(b-Y(s[t+908+(w<<2)>>2]));b=Y(b-Y(Qr(e,y)));b=Y(b-Y(qr(t,y,n)));b=Y(b-Y(Oi(t,y,g?n:i)));s[t+400+(o[1040+(y<<2)>>2]<<2)>>2]=b}else _=21;do{if((_|0)==21){if(!(gi(t,y)|0)?(o[e+8>>2]|0)==1:0){w=o[976+(y<<2)>>2]|0;b=Y(s[e+908+(w<<2)>>2]);b=Y(Y(b-Y(s[t+908+(w<<2)>>2]))*Y(.5));s[t+400+(o[1040+(y<<2)>>2]<<2)>>2]=b;break}if(!(gi(t,y)|0)?(o[e+8>>2]|0)==2:0){w=o[976+(y<<2)>>2]|0;b=Y(s[e+908+(w<<2)>>2]);b=Y(b-Y(s[t+908+(w<<2)>>2]));s[t+400+(o[1040+(y<<2)>>2]<<2)>>2]=b}}}while(0);if(Ai(t,m)|0?!(gi(t,m)|0):0){w=o[976+(m<<2)>>2]|0;b=Y(s[e+908+(w<<2)>>2]);b=Y(b-Y(s[t+908+(w<<2)>>2]));b=Y(b-Y(Qr(e,m)));b=Y(b-Y(qr(t,m,n)));b=Y(b-Y(Oi(t,m,g?i:n)));s[t+400+(o[1040+(m<<2)>>2]<<2)>>2]=b}else _=30;do{if((_|0)==30?!(gi(t,m)|0):0){if((pi(e,t)|0)==2){w=o[976+(m<<2)>>2]|0;b=Y(s[e+908+(w<<2)>>2]);b=Y(Y(b-Y(s[t+908+(w<<2)>>2]))*Y(.5));s[t+400+(o[1040+(m<<2)>>2]<<2)>>2]=b;break}w=(pi(e,t)|0)==3;if(w^(o[e+28>>2]|0)==2){w=o[976+(m<<2)>>2]|0;b=Y(s[e+908+(w<<2)>>2]);b=Y(b-Y(s[t+908+(w<<2)>>2]));s[t+400+(o[1040+(m<<2)>>2]<<2)>>2]=b}}}while(0);return}function Ci(e,t,n){e=e|0;t=t|0;n=n|0;var r=ft,i=0;i=o[976+(n<<2)>>2]|0;r=Y(s[t+908+(i<<2)>>2]);r=Y(Y(s[e+908+(i<<2)>>2])-r);r=Y(r-Y(s[t+400+(o[1040+(n<<2)>>2]<<2)>>2]));s[t+400+(o[1e3+(n<<2)>>2]<<2)>>2]=r;return}function ki(e){e=e|0;return(e|1|0)==1|0}function Ti(e){e=e|0;var t=ft;switch(o[e+56>>2]|0){case 0:case 3:{t=Y(s[e+40>>2]);if(t>Y(0.0)&((wt(t)|0)^1))e=r[(o[e+976>>2]|0)+2>>0]|0?1056:992;else e=1056;break}default:e=e+52|0}return e|0}function xi(e,t){e=e|0;t=t|0;return(r[e+t>>0]|0)!=0|0}function Ai(e,t){e=e|0;t=t|0;e=e+132|0;if(Gr(t)|0?(o[(Et(e,5,948)|0)+4>>2]|0)!=0:0)e=1;else e=(o[(Et(e,o[1e3+(t<<2)>>2]|0,948)|0)+4>>2]|0)!=0;return e|0}function Oi(e,t,n){e=e|0;t=t|0;n=Y(n);var r=0,i=0;e=e+132|0;if(Gr(t)|0?(r=Et(e,5,948)|0,(o[r+4>>2]|0)!=0):0)i=4;else{r=Et(e,o[1e3+(t<<2)>>2]|0,948)|0;if(!(o[r+4>>2]|0))n=Y(0.0);else i=4}if((i|0)==4)n=Y(Nr(r,n));return Y(n)}function Pi(e,t,n){e=e|0;t=t|0;n=Y(n);if(gi(e,t)|0)n=Y(yi(e,t,n));else n=Y(-Y(Oi(e,t,n)));return Y(n)}function Ii(e){e=Y(e);return(s[d>>2]=e,o[d>>2]|0)|0}function Ni(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>1073741823)Ye();else{i=$T(t<<2)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<2)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<2);return}function Mi(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>2)<<2)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Ri(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-4-t|0)>>>2)<<2);e=o[e>>2]|0;if(e|0)KT(e);return}function Fi(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0;a=e+4|0;l=o[a>>2]|0;i=l-r|0;u=i>>2;e=t+(u<<2)|0;if(e>>>0>>0){r=l;do{o[r>>2]=o[e>>2];e=e+4|0;r=(o[a>>2]|0)+4|0;o[a>>2]=r}while(e>>>0>>0)}if(u|0)sx(l+(0-u<<2)|0,t|0,i|0)|0;return}function Li(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0;l=t+4|0;s=o[l>>2]|0;i=o[e>>2]|0;a=n;u=a-i|0;r=s+(0-(u>>2)<<2)|0;o[l>>2]=r;if((u|0)>0)ix(r|0,i|0,u|0)|0;i=e+4|0;u=t+8|0;r=(o[i>>2]|0)-a|0;if((r|0)>0){ix(o[u>>2]|0,n|0,r|0)|0;o[u>>2]=(o[u>>2]|0)+(r>>>2<<2)}a=o[e>>2]|0;o[e>>2]=o[l>>2];o[l>>2]=a;a=o[i>>2]|0;o[i>>2]=o[u>>2];o[u>>2]=a;a=e+8|0;n=t+12|0;e=o[a>>2]|0;o[a>>2]=o[n>>2];o[n>>2]=e;o[t>>2]=o[l>>2];return s|0}function Bi(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;a=o[t>>2]|0;u=o[n>>2]|0;if((a|0)!=(u|0)){i=e+8|0;n=((u+-4-a|0)>>>2)+1|0;e=a;r=o[i>>2]|0;do{o[r>>2]=o[e>>2];r=(o[i>>2]|0)+4|0;o[i>>2]=r;e=e+4|0}while((e|0)!=(u|0));o[t>>2]=a+(n<<2)}return}function ji(){_t();return}function Ui(){var e=0;e=$T(4)|0;zi(e);return e|0}function zi(e){e=e|0;o[e>>2]=Lt()|0;return}function Wi(e){e=e|0;if(e|0){Hi(e);KT(e)}return}function Hi(e){e=e|0;jt(o[e>>2]|0);return}function Vi(e,t,n){e=e|0;t=t|0;n=n|0;jr(o[e>>2]|0,t,n);return}function qi(e,t){e=e|0;t=Y(t);Ar(o[e>>2]|0,t);return}function Gi(e,t){e=e|0;t=t|0;return xi(o[e>>2]|0,t)|0}function $i(){var e=0;e=$T(8)|0;Yi(e,0);return e|0}function Yi(e,t){e=e|0;t=t|0;if(!t)t=Ct()|0;else t=Dt(o[t>>2]|0)|0;o[e>>2]=t;o[e+4>>2]=0;Jt(t,e);return}function Ki(e){e=e|0;var t=0;t=$T(8)|0;Yi(t,e);return t|0}function Xi(e){e=e|0;if(e|0){Qi(e);KT(e)}return}function Qi(e){e=e|0;var t=0;xt(o[e>>2]|0);t=e+4|0;e=o[t>>2]|0;o[t>>2]=0;if(e|0){Ji(e);KT(e)}return}function Ji(e){e=e|0;Zi(e);return}function Zi(e){e=e|0;e=o[e>>2]|0;if(e|0)rt(e|0);return}function eo(e){e=e|0;return Zt(e)|0}function to(e){e=e|0;var t=0,n=0;n=e+4|0;t=o[n>>2]|0;o[n>>2]=0;if(t|0){Ji(t);KT(t)}Mt(o[e>>2]|0);return}function no(e,t){e=e|0;t=t|0;Kt(o[e>>2]|0,o[t>>2]|0);return}function ro(e,t){e=e|0;t=t|0;fn(o[e>>2]|0,t);return}function io(e,t,n){e=e|0;t=t|0;n=+n;Cn(o[e>>2]|0,t,Y(n));return}function oo(e,t,n){e=e|0;t=t|0;n=+n;kn(o[e>>2]|0,t,Y(n));return}function uo(e,t){e=e|0;t=t|0;on(o[e>>2]|0,t);return}function ao(e,t){e=e|0;t=t|0;an(o[e>>2]|0,t);return}function lo(e,t){e=e|0;t=t|0;sn(o[e>>2]|0,t);return}function so(e,t){e=e|0;t=t|0;en(o[e>>2]|0,t);return}function co(e,t){e=e|0;t=t|0;pn(o[e>>2]|0,t);return}function fo(e,t){e=e|0;t=t|0;nn(o[e>>2]|0,t);return}function po(e,t,n){e=e|0;t=t|0;n=+n;xn(o[e>>2]|0,t,Y(n));return}function ho(e,t,n){e=e|0;t=t|0;n=+n;An(o[e>>2]|0,t,Y(n));return}function vo(e,t){e=e|0;t=t|0;Pn(o[e>>2]|0,t);return}function mo(e,t){e=e|0;t=t|0;vn(o[e>>2]|0,t);return}function go(e,t){e=e|0;t=t|0;gn(o[e>>2]|0,t);return}function yo(e,t){e=e|0;t=+t;_n(o[e>>2]|0,Y(t));return}function _o(e,t){e=e|0;t=+t;En(o[e>>2]|0,Y(t));return}function bo(e,t){e=e|0;t=+t;Dn(o[e>>2]|0,Y(t));return}function wo(e,t){e=e|0;t=+t;bn(o[e>>2]|0,Y(t));return}function Eo(e,t){e=e|0;t=+t;wn(o[e>>2]|0,Y(t));return}function Do(e,t){e=e|0;t=+t;Ln(o[e>>2]|0,Y(t));return}function So(e,t){e=e|0;t=+t;Bn(o[e>>2]|0,Y(t));return}function Co(e){e=e|0;jn(o[e>>2]|0);return}function ko(e,t){e=e|0;t=+t;zn(o[e>>2]|0,Y(t));return}function To(e,t){e=e|0;t=+t;Wn(o[e>>2]|0,Y(t));return}function xo(e){e=e|0;Hn(o[e>>2]|0);return}function Ao(e,t){e=e|0;t=+t;qn(o[e>>2]|0,Y(t));return}function Oo(e,t){e=e|0;t=+t;Gn(o[e>>2]|0,Y(t));return}function Po(e,t){e=e|0;t=+t;Yn(o[e>>2]|0,Y(t));return}function Io(e,t){e=e|0;t=+t;Kn(o[e>>2]|0,Y(t));return}function No(e,t){e=e|0;t=+t;Qn(o[e>>2]|0,Y(t));return}function Mo(e,t){e=e|0;t=+t;Jn(o[e>>2]|0,Y(t));return}function Ro(e,t){e=e|0;t=+t;er(o[e>>2]|0,Y(t));return}function Fo(e,t){e=e|0;t=+t;tr(o[e>>2]|0,Y(t));return}function Lo(e,t){e=e|0;t=+t;rr(o[e>>2]|0,Y(t));return}function Bo(e,t,n){e=e|0;t=t|0;n=+n;Rn(o[e>>2]|0,t,Y(n));return}function jo(e,t,n){e=e|0;t=t|0;n=+n;In(o[e>>2]|0,t,Y(n));return}function Uo(e,t,n){e=e|0;t=t|0;n=+n;Nn(o[e>>2]|0,t,Y(n));return}function zo(e){e=e|0;return dn(o[e>>2]|0)|0}function Wo(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0;r=h;h=h+16|0;i=r;Tn(i,o[t>>2]|0,n);Ho(e,i);h=r;return}function Ho(e,t){e=e|0;t=t|0;Vo(e,o[t+4>>2]|0,+Y(s[t>>2]));return}function Vo(e,t,n){e=e|0;t=t|0;n=+n;o[e>>2]=t;c[e+8>>3]=n;return}function qo(e){e=e|0;return un(o[e>>2]|0)|0}function Go(e){e=e|0;return ln(o[e>>2]|0)|0}function $o(e){e=e|0;return cn(o[e>>2]|0)|0}function Yo(e){e=e|0;return tn(o[e>>2]|0)|0}function Ko(e){e=e|0;return hn(o[e>>2]|0)|0}function Xo(e){e=e|0;return rn(o[e>>2]|0)|0}function Qo(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0;r=h;h=h+16|0;i=r;On(i,o[t>>2]|0,n);Ho(e,i);h=r;return}function Jo(e){e=e|0;return mn(o[e>>2]|0)|0}function Zo(e){e=e|0;return yn(o[e>>2]|0)|0}function eu(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;Sn(r,o[t>>2]|0);Ho(e,r);h=n;return}function tu(e){e=e|0;return+ +Y(Xt(o[e>>2]|0))}function nu(e){e=e|0;return+ +Y(Qt(o[e>>2]|0))}function ru(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;Un(r,o[t>>2]|0);Ho(e,r);h=n;return}function iu(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;Vn(r,o[t>>2]|0);Ho(e,r);h=n;return}function ou(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;$n(r,o[t>>2]|0);Ho(e,r);h=n;return}function uu(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;Xn(r,o[t>>2]|0);Ho(e,r);h=n;return}function au(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;Zn(r,o[t>>2]|0);Ho(e,r);h=n;return}function lu(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;nr(r,o[t>>2]|0);Ho(e,r);h=n;return}function su(e){e=e|0;return+ +Y(ir(o[e>>2]|0))}function cu(e,t){e=e|0;t=t|0;return+ +Y(Fn(o[e>>2]|0,t))}function fu(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0;r=h;h=h+16|0;i=r;Mn(i,o[t>>2]|0,n);Ho(e,i);h=r;return}function du(e,t,n){e=e|0;t=t|0;n=n|0;zt(o[e>>2]|0,o[t>>2]|0,n);return}function pu(e,t){e=e|0;t=t|0;Nt(o[e>>2]|0,o[t>>2]|0);return}function hu(e){e=e|0;return Ot(o[e>>2]|0)|0}function vu(e){e=e|0;e=Gt(o[e>>2]|0)|0;if(!e)e=0;else e=eo(e)|0;return e|0}function mu(e,t){e=e|0;t=t|0;e=Pt(o[e>>2]|0,t)|0;if(!e)e=0;else e=eo(e)|0;return e|0}function gu(e,t){e=e|0;t=t|0;var n=0,r=0;r=$T(4)|0;yu(r,t);n=e+4|0;t=o[n>>2]|0;o[n>>2]=r;if(t|0){Ji(t);KT(t)}Ut(o[e>>2]|0,1);return}function yu(e,t){e=e|0;t=t|0;Bu(e,t);return}function _u(e,t,n,r,i,o){e=e|0;t=t|0;n=Y(n);r=r|0;i=Y(i);o=o|0;var u=0,a=0;u=h;h=h+16|0;a=u;bu(a,Zt(t)|0,+n,r,+i,o);s[e>>2]=Y(+c[a>>3]);s[e+4>>2]=Y(+c[a+8>>3]);h=u;return}function bu(e,t,n,r,i,u){e=e|0;t=t|0;n=+n;r=r|0;i=+i;u=u|0;var a=0,l=0,s=0,f=0,d=0;a=h;h=h+32|0;d=a+8|0;f=a+20|0;s=a;l=a+16|0;c[d>>3]=n;o[f>>2]=r;c[s>>3]=i;o[l>>2]=u;wu(e,o[t+4>>2]|0,d,f,s,l);h=a;return}function wu(e,t,n,r,i,u){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;u=u|0;var a=0,l=0;a=h;h=h+16|0;l=a;Dk(l);t=Eu(t)|0;Du(e,t,+c[n>>3],o[r>>2]|0,+c[i>>3],o[u>>2]|0);Ck(l);h=a;return}function Eu(e){e=e|0;return o[e>>2]|0}function Du(e,t,n,r,i,o){e=e|0;t=t|0;n=+n;r=r|0;i=+i;o=o|0;var u=0;u=Cu(Su()|0)|0;n=+ku(n);r=Tu(r)|0;i=+ku(i);xu(e,ot(0,u|0,t|0,+n,r|0,+i,Tu(o)|0)|0);return}function Su(){var e=0;if(!(r[7608]|0)){Ru(9120);e=7608;o[e>>2]=1;o[e+4>>2]=0}return 9120}function Cu(e){e=e|0;return o[e+8>>2]|0}function ku(e){e=+e;return+ +Mu(e)}function Tu(e){e=e|0;return Nu(e)|0}function xu(e,t){e=e|0;t=t|0;var n=0,r=0,i=0;i=h;h=h+32|0;n=i;r=t;if(!(r&1)){o[e>>2]=o[t>>2];o[e+4>>2]=o[t+4>>2];o[e+8>>2]=o[t+8>>2];o[e+12>>2]=o[t+12>>2]}else{Au(n,0);Be(r|0,n|0)|0;Ou(e,n);Pu(n)}h=i;return}function Au(e,t){e=e|0;t=t|0;Iu(e,t);o[e+8>>2]=0;r[e+24>>0]=0;return}function Ou(e,t){e=e|0;t=t|0;t=t+8|0;o[e>>2]=o[t>>2];o[e+4>>2]=o[t+4>>2];o[e+8>>2]=o[t+8>>2];o[e+12>>2]=o[t+12>>2];return}function Pu(e){e=e|0;r[e+24>>0]=0;return}function Iu(e,t){e=e|0;t=t|0;o[e>>2]=t;return}function Nu(e){e=e|0;return e|0}function Mu(e){e=+e;return+e}function Ru(e){e=e|0;Lu(e,Fu()|0,4);return}function Fu(){return 1064}function Lu(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;o[e+4>>2]=n;o[e+8>>2]=tt(t|0,n+1|0)|0;return}function Bu(e,t){e=e|0;t=t|0;t=o[t>>2]|0;o[e>>2]=t;Ae(t|0);return}function ju(e){e=e|0;var t=0,n=0;n=e+4|0;t=o[n>>2]|0;o[n>>2]=0;if(t|0){Ji(t);KT(t)}Ut(o[e>>2]|0,0);return}function Uu(e){e=e|0;$t(o[e>>2]|0);return}function zu(e){e=e|0;return Yt(o[e>>2]|0)|0}function Wu(e,t,n,r){e=e|0;t=+t;n=+n;r=r|0;Or(o[e>>2]|0,Y(t),Y(n),r);return}function Hu(e){e=e|0;return+ +Y(or(o[e>>2]|0))}function Vu(e){e=e|0;return+ +Y(ar(o[e>>2]|0))}function qu(e){e=e|0;return+ +Y(ur(o[e>>2]|0))}function Gu(e){e=e|0;return+ +Y(lr(o[e>>2]|0))}function $u(e){e=e|0;return+ +Y(sr(o[e>>2]|0))}function Yu(e){e=e|0;return+ +Y(cr(o[e>>2]|0))}function Ku(e,t){e=e|0;t=t|0;c[e>>3]=+Y(or(o[t>>2]|0));c[e+8>>3]=+Y(ar(o[t>>2]|0));c[e+16>>3]=+Y(ur(o[t>>2]|0));c[e+24>>3]=+Y(lr(o[t>>2]|0));c[e+32>>3]=+Y(sr(o[t>>2]|0));c[e+40>>3]=+Y(cr(o[t>>2]|0));return}function Xu(e,t){e=e|0;t=t|0;return+ +Y(fr(o[e>>2]|0,t))}function Qu(e,t){e=e|0;t=t|0;return+ +Y(dr(o[e>>2]|0,t))}function Ju(e,t){e=e|0;t=t|0;return+ +Y(pr(o[e>>2]|0,t))}function Zu(){return Ft()|0}function ea(){ta();na();ra();ia();oa();ua();return}function ta(){zb(11713,4938,1);return}function na(){tb(10448);return}function ra(){R_(10408);return}function ia(){Jy(10324);return}function oa(){qm(10096);return}function ua(){aa(9132);return}function aa(e){e=e|0;var t=0,n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,v=0,m=0,g=0,y=0,_=0,b=0,w=0,E=0,D=0,S=0,C=0,k=0,T=0,x=0,A=0,O=0,P=0,I=0,N=0,M=0,R=0,F=0,L=0,B=0,j=0,U=0,z=0,W=0,H=0,V=0,q=0,G=0,$=0,Y=0,K=0,X=0,Q=0,J=0,Z=0,ee=0,te=0,ne=0,re=0,ie=0,oe=0,ue=0,ae=0,le=0,se=0,ce=0,fe=0,de=0,pe=0,he=0,ve=0,me=0,ge=0,ye=0,_e=0,be=0,we=0,Ee=0,De=0,Se=0,Ce=0,ke=0,Te=0,xe=0,Ae=0,Oe=0,Pe=0,Ie=0;t=h;h=h+672|0;n=t+656|0;Ie=t+648|0;Pe=t+640|0;Oe=t+632|0;Ae=t+624|0;xe=t+616|0;Te=t+608|0;ke=t+600|0;Ce=t+592|0;Se=t+584|0;De=t+576|0;Ee=t+568|0;we=t+560|0;be=t+552|0;_e=t+544|0;ye=t+536|0;ge=t+528|0;me=t+520|0;ve=t+512|0;he=t+504|0;pe=t+496|0;de=t+488|0;fe=t+480|0;ce=t+472|0;se=t+464|0;le=t+456|0;ae=t+448|0;ue=t+440|0;oe=t+432|0;ie=t+424|0;re=t+416|0;ne=t+408|0;te=t+400|0;ee=t+392|0;Z=t+384|0;J=t+376|0;Q=t+368|0;X=t+360|0;K=t+352|0;Y=t+344|0;$=t+336|0;G=t+328|0;q=t+320|0;V=t+312|0;H=t+304|0;W=t+296|0;z=t+288|0;U=t+280|0;j=t+272|0;B=t+264|0;L=t+256|0;F=t+248|0;R=t+240|0;M=t+232|0;N=t+224|0;I=t+216|0;P=t+208|0;O=t+200|0;A=t+192|0;x=t+184|0;T=t+176|0;k=t+168|0;C=t+160|0;S=t+152|0;D=t+144|0;E=t+136|0;w=t+128|0;b=t+120|0;_=t+112|0;y=t+104|0;g=t+96|0;m=t+88|0;v=t+80|0;p=t+72|0;d=t+64|0;f=t+56|0;c=t+48|0;s=t+40|0;l=t+32|0;a=t+24|0;u=t+16|0;i=t+8|0;r=t;la(e,3646);sa(e,3651,2)|0;ca(e,3665,2)|0;fa(e,3682,18)|0;o[Ie>>2]=19;o[Ie+4>>2]=0;o[n>>2]=o[Ie>>2];o[n+4>>2]=o[Ie+4>>2];da(e,3690,n)|0;o[Pe>>2]=1;o[Pe+4>>2]=0;o[n>>2]=o[Pe>>2];o[n+4>>2]=o[Pe+4>>2];pa(e,3696,n)|0;o[Oe>>2]=2;o[Oe+4>>2]=0;o[n>>2]=o[Oe>>2];o[n+4>>2]=o[Oe+4>>2];ha(e,3706,n)|0;o[Ae>>2]=1;o[Ae+4>>2]=0;o[n>>2]=o[Ae>>2];o[n+4>>2]=o[Ae+4>>2];va(e,3722,n)|0;o[xe>>2]=2;o[xe+4>>2]=0;o[n>>2]=o[xe>>2];o[n+4>>2]=o[xe+4>>2];va(e,3734,n)|0;o[Te>>2]=3;o[Te+4>>2]=0;o[n>>2]=o[Te>>2];o[n+4>>2]=o[Te+4>>2];ha(e,3753,n)|0;o[ke>>2]=4;o[ke+4>>2]=0;o[n>>2]=o[ke>>2];o[n+4>>2]=o[ke+4>>2];ha(e,3769,n)|0;o[Ce>>2]=5;o[Ce+4>>2]=0;o[n>>2]=o[Ce>>2];o[n+4>>2]=o[Ce+4>>2];ha(e,3783,n)|0;o[Se>>2]=6;o[Se+4>>2]=0;o[n>>2]=o[Se>>2];o[n+4>>2]=o[Se+4>>2];ha(e,3796,n)|0;o[De>>2]=7;o[De+4>>2]=0;o[n>>2]=o[De>>2];o[n+4>>2]=o[De+4>>2];ha(e,3813,n)|0;o[Ee>>2]=8;o[Ee+4>>2]=0;o[n>>2]=o[Ee>>2];o[n+4>>2]=o[Ee+4>>2];ha(e,3825,n)|0;o[we>>2]=3;o[we+4>>2]=0;o[n>>2]=o[we>>2];o[n+4>>2]=o[we+4>>2];va(e,3843,n)|0;o[be>>2]=4;o[be+4>>2]=0;o[n>>2]=o[be>>2];o[n+4>>2]=o[be+4>>2];va(e,3853,n)|0;o[_e>>2]=9;o[_e+4>>2]=0;o[n>>2]=o[_e>>2];o[n+4>>2]=o[_e+4>>2];ha(e,3870,n)|0;o[ye>>2]=10;o[ye+4>>2]=0;o[n>>2]=o[ye>>2];o[n+4>>2]=o[ye+4>>2];ha(e,3884,n)|0;o[ge>>2]=11;o[ge+4>>2]=0;o[n>>2]=o[ge>>2];o[n+4>>2]=o[ge+4>>2];ha(e,3896,n)|0;o[me>>2]=1;o[me+4>>2]=0;o[n>>2]=o[me>>2];o[n+4>>2]=o[me+4>>2];ma(e,3907,n)|0;o[ve>>2]=2;o[ve+4>>2]=0;o[n>>2]=o[ve>>2];o[n+4>>2]=o[ve+4>>2];ma(e,3915,n)|0;o[he>>2]=3;o[he+4>>2]=0;o[n>>2]=o[he>>2];o[n+4>>2]=o[he+4>>2];ma(e,3928,n)|0;o[pe>>2]=4;o[pe+4>>2]=0;o[n>>2]=o[pe>>2];o[n+4>>2]=o[pe+4>>2];ma(e,3948,n)|0;o[de>>2]=5;o[de+4>>2]=0;o[n>>2]=o[de>>2];o[n+4>>2]=o[de+4>>2];ma(e,3960,n)|0;o[fe>>2]=6;o[fe+4>>2]=0;o[n>>2]=o[fe>>2];o[n+4>>2]=o[fe+4>>2];ma(e,3974,n)|0;o[ce>>2]=7;o[ce+4>>2]=0;o[n>>2]=o[ce>>2];o[n+4>>2]=o[ce+4>>2];ma(e,3983,n)|0;o[se>>2]=20;o[se+4>>2]=0;o[n>>2]=o[se>>2];o[n+4>>2]=o[se+4>>2];da(e,3999,n)|0;o[le>>2]=8;o[le+4>>2]=0;o[n>>2]=o[le>>2];o[n+4>>2]=o[le+4>>2];ma(e,4012,n)|0;o[ae>>2]=9;o[ae+4>>2]=0;o[n>>2]=o[ae>>2];o[n+4>>2]=o[ae+4>>2];ma(e,4022,n)|0;o[ue>>2]=21;o[ue+4>>2]=0;o[n>>2]=o[ue>>2];o[n+4>>2]=o[ue+4>>2];da(e,4039,n)|0;o[oe>>2]=10;o[oe+4>>2]=0;o[n>>2]=o[oe>>2];o[n+4>>2]=o[oe+4>>2];ma(e,4053,n)|0;o[ie>>2]=11;o[ie+4>>2]=0;o[n>>2]=o[ie>>2];o[n+4>>2]=o[ie+4>>2];ma(e,4065,n)|0;o[re>>2]=12;o[re+4>>2]=0;o[n>>2]=o[re>>2];o[n+4>>2]=o[re+4>>2];ma(e,4084,n)|0;o[ne>>2]=13;o[ne+4>>2]=0;o[n>>2]=o[ne>>2];o[n+4>>2]=o[ne+4>>2];ma(e,4097,n)|0;o[te>>2]=14;o[te+4>>2]=0;o[n>>2]=o[te>>2];o[n+4>>2]=o[te+4>>2];ma(e,4117,n)|0;o[ee>>2]=15;o[ee+4>>2]=0;o[n>>2]=o[ee>>2];o[n+4>>2]=o[ee+4>>2];ma(e,4129,n)|0;o[Z>>2]=16;o[Z+4>>2]=0;o[n>>2]=o[Z>>2];o[n+4>>2]=o[Z+4>>2];ma(e,4148,n)|0;o[J>>2]=17;o[J+4>>2]=0;o[n>>2]=o[J>>2];o[n+4>>2]=o[J+4>>2];ma(e,4161,n)|0;o[Q>>2]=18;o[Q+4>>2]=0;o[n>>2]=o[Q>>2];o[n+4>>2]=o[Q+4>>2];ma(e,4181,n)|0;o[X>>2]=5;o[X+4>>2]=0;o[n>>2]=o[X>>2];o[n+4>>2]=o[X+4>>2];va(e,4196,n)|0;o[K>>2]=6;o[K+4>>2]=0;o[n>>2]=o[K>>2];o[n+4>>2]=o[K+4>>2];va(e,4206,n)|0;o[Y>>2]=7;o[Y+4>>2]=0;o[n>>2]=o[Y>>2];o[n+4>>2]=o[Y+4>>2];va(e,4217,n)|0;o[$>>2]=3;o[$+4>>2]=0;o[n>>2]=o[$>>2];o[n+4>>2]=o[$+4>>2];ga(e,4235,n)|0;o[G>>2]=1;o[G+4>>2]=0;o[n>>2]=o[G>>2];o[n+4>>2]=o[G+4>>2];ya(e,4251,n)|0;o[q>>2]=4;o[q+4>>2]=0;o[n>>2]=o[q>>2];o[n+4>>2]=o[q+4>>2];ga(e,4263,n)|0;o[V>>2]=5;o[V+4>>2]=0;o[n>>2]=o[V>>2];o[n+4>>2]=o[V+4>>2];ga(e,4279,n)|0;o[H>>2]=6;o[H+4>>2]=0;o[n>>2]=o[H>>2];o[n+4>>2]=o[H+4>>2];ga(e,4293,n)|0;o[W>>2]=7;o[W+4>>2]=0;o[n>>2]=o[W>>2];o[n+4>>2]=o[W+4>>2];ga(e,4306,n)|0;o[z>>2]=8;o[z+4>>2]=0;o[n>>2]=o[z>>2];o[n+4>>2]=o[z+4>>2];ga(e,4323,n)|0;o[U>>2]=9;o[U+4>>2]=0;o[n>>2]=o[U>>2];o[n+4>>2]=o[U+4>>2];ga(e,4335,n)|0;o[j>>2]=2;o[j+4>>2]=0;o[n>>2]=o[j>>2];o[n+4>>2]=o[j+4>>2];ya(e,4353,n)|0;o[B>>2]=12;o[B+4>>2]=0;o[n>>2]=o[B>>2];o[n+4>>2]=o[B+4>>2];_a(e,4363,n)|0;o[L>>2]=1;o[L+4>>2]=0;o[n>>2]=o[L>>2];o[n+4>>2]=o[L+4>>2];ba(e,4376,n)|0;o[F>>2]=2;o[F+4>>2]=0;o[n>>2]=o[F>>2];o[n+4>>2]=o[F+4>>2];ba(e,4388,n)|0;o[R>>2]=13;o[R+4>>2]=0;o[n>>2]=o[R>>2];o[n+4>>2]=o[R+4>>2];_a(e,4402,n)|0;o[M>>2]=14;o[M+4>>2]=0;o[n>>2]=o[M>>2];o[n+4>>2]=o[M+4>>2];_a(e,4411,n)|0;o[N>>2]=15;o[N+4>>2]=0;o[n>>2]=o[N>>2];o[n+4>>2]=o[N+4>>2];_a(e,4421,n)|0;o[I>>2]=16;o[I+4>>2]=0;o[n>>2]=o[I>>2];o[n+4>>2]=o[I+4>>2];_a(e,4433,n)|0;o[P>>2]=17;o[P+4>>2]=0;o[n>>2]=o[P>>2];o[n+4>>2]=o[P+4>>2];_a(e,4446,n)|0;o[O>>2]=18;o[O+4>>2]=0;o[n>>2]=o[O>>2];o[n+4>>2]=o[O+4>>2];_a(e,4458,n)|0;o[A>>2]=3;o[A+4>>2]=0;o[n>>2]=o[A>>2];o[n+4>>2]=o[A+4>>2];ba(e,4471,n)|0;o[x>>2]=1;o[x+4>>2]=0;o[n>>2]=o[x>>2];o[n+4>>2]=o[x+4>>2];wa(e,4486,n)|0;o[T>>2]=10;o[T+4>>2]=0;o[n>>2]=o[T>>2];o[n+4>>2]=o[T+4>>2];ga(e,4496,n)|0;o[k>>2]=11;o[k+4>>2]=0;o[n>>2]=o[k>>2];o[n+4>>2]=o[k+4>>2];ga(e,4508,n)|0;o[C>>2]=3;o[C+4>>2]=0;o[n>>2]=o[C>>2];o[n+4>>2]=o[C+4>>2];ya(e,4519,n)|0;o[S>>2]=4;o[S+4>>2]=0;o[n>>2]=o[S>>2];o[n+4>>2]=o[S+4>>2];Ea(e,4530,n)|0;o[D>>2]=19;o[D+4>>2]=0;o[n>>2]=o[D>>2];o[n+4>>2]=o[D+4>>2];Da(e,4542,n)|0;o[E>>2]=12;o[E+4>>2]=0;o[n>>2]=o[E>>2];o[n+4>>2]=o[E+4>>2];Sa(e,4554,n)|0;o[w>>2]=13;o[w+4>>2]=0;o[n>>2]=o[w>>2];o[n+4>>2]=o[w+4>>2];Ca(e,4568,n)|0;o[b>>2]=2;o[b+4>>2]=0;o[n>>2]=o[b>>2];o[n+4>>2]=o[b+4>>2];ka(e,4578,n)|0;o[_>>2]=20;o[_+4>>2]=0;o[n>>2]=o[_>>2];o[n+4>>2]=o[_+4>>2];Ta(e,4587,n)|0;o[y>>2]=22;o[y+4>>2]=0;o[n>>2]=o[y>>2];o[n+4>>2]=o[y+4>>2];da(e,4602,n)|0;o[g>>2]=23;o[g+4>>2]=0;o[n>>2]=o[g>>2];o[n+4>>2]=o[g+4>>2];da(e,4619,n)|0;o[m>>2]=14;o[m+4>>2]=0;o[n>>2]=o[m>>2];o[n+4>>2]=o[m+4>>2];xa(e,4629,n)|0;o[v>>2]=1;o[v+4>>2]=0;o[n>>2]=o[v>>2];o[n+4>>2]=o[v+4>>2];Aa(e,4637,n)|0;o[p>>2]=4;o[p+4>>2]=0;o[n>>2]=o[p>>2];o[n+4>>2]=o[p+4>>2];ba(e,4653,n)|0;o[d>>2]=5;o[d+4>>2]=0;o[n>>2]=o[d>>2];o[n+4>>2]=o[d+4>>2];ba(e,4669,n)|0;o[f>>2]=6;o[f+4>>2]=0;o[n>>2]=o[f>>2];o[n+4>>2]=o[f+4>>2];ba(e,4686,n)|0;o[c>>2]=7;o[c+4>>2]=0;o[n>>2]=o[c>>2];o[n+4>>2]=o[c+4>>2];ba(e,4701,n)|0;o[s>>2]=8;o[s+4>>2]=0;o[n>>2]=o[s>>2];o[n+4>>2]=o[s+4>>2];ba(e,4719,n)|0;o[l>>2]=9;o[l+4>>2]=0;o[n>>2]=o[l>>2];o[n+4>>2]=o[l+4>>2];ba(e,4736,n)|0;o[a>>2]=21;o[a+4>>2]=0;o[n>>2]=o[a>>2];o[n+4>>2]=o[a+4>>2];Oa(e,4754,n)|0;o[u>>2]=2;o[u+4>>2]=0;o[n>>2]=o[u>>2];o[n+4>>2]=o[u+4>>2];wa(e,4772,n)|0;o[i>>2]=3;o[i+4>>2]=0;o[n>>2]=o[i>>2];o[n+4>>2]=o[i+4>>2];wa(e,4790,n)|0;o[r>>2]=4;o[r+4>>2]=0;o[n>>2]=o[r>>2];o[n+4>>2]=o[r+4>>2];wa(e,4808,n)|0;h=t;return}function la(e,t){e=e|0;t=t|0;var n=0;n=Mm()|0;o[e>>2]=n;Rm(n,t);cw(o[e>>2]|0);return}function sa(e,t,n){e=e|0;t=t|0;n=n|0;gm(e,Ia(t)|0,n,0);return e|0}function ca(e,t,n){e=e|0;t=t|0;n=n|0;Xv(e,Ia(t)|0,n,0);return e|0}function fa(e,t,n){e=e|0;t=t|0;n=n|0;Nv(e,Ia(t)|0,n,0);return e|0}function da(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];hv(e,t,i);h=r;return e|0}function pa(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Gh(e,t,i);h=r;return e|0}function ha(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Th(e,t,i);h=r;return e|0}function va(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];lh(e,t,i);h=r;return e|0}function ma(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Hp(e,t,i);h=r;return e|0}function ga(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Sp(e,t,i);h=r;return e|0}function ya(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];op(e,t,i);h=r;return e|0}function _a(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Cd(e,t,i);h=r;return e|0}function ba(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];ud(e,t,i);h=r;return e|0}function wa(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];zf(e,t,i);h=r;return e|0}function Ea(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Ef(e,t,i);h=r;return e|0}function Da(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Zc(e,t,i);h=r;return e|0}function Sa(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Nc(e,t,i);h=r;return e|0}function Ca(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];hc(e,t,i);h=r;return e|0}function ka(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];qs(e,t,i);h=r;return e|0}function Ta(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];ws(e,t,i);h=r;return e|0}function xa(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];ts(e,t,i);h=r;return e|0}function Aa(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Ol(e,t,i);h=r;return e|0}function Oa(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Pa(e,t,i);h=r;return e|0}function Pa(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Na(e,n,i,1);h=r;return}function Ia(e){e=e|0;return e|0}function Na(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=Ma()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=Ra(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,Fa(u,r)|0,r);h=i;return}function Ma(){var e=0,t=0;if(!(r[7616]|0)){Ya(9136);Fe(24,9136,g|0)|0;t=7616;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(9136)|0)){e=9136;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Ya(9136)}return 9136}function Ra(e){e=e|0;return 0}function Fa(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=Ma()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];Wa(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{Ha(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function La(e,t,n,r,i,u){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;u=u|0;var a=0,l=0,s=0,c=0,f=0,d=0,p=0,v=0;a=h;h=h+32|0;p=a+24|0;d=a+20|0;s=a+16|0;f=a+12|0;c=a+8|0;l=a+4|0;v=a;o[d>>2]=t;o[s>>2]=n;o[f>>2]=r;o[c>>2]=i;o[l>>2]=u;u=e+28|0;o[v>>2]=o[u>>2];o[p>>2]=o[v>>2];Ba(e+24|0,p,d,f,c,s,l)|0;o[u>>2]=o[o[u>>2]>>2];h=a;return}function Ba(e,t,n,r,i,u,a){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;u=u|0;a=a|0;e=ja(t)|0;t=$T(24)|0;Ua(t+4|0,o[n>>2]|0,o[r>>2]|0,o[i>>2]|0,o[u>>2]|0,o[a>>2]|0);o[t>>2]=o[e>>2];o[e>>2]=t;return t|0}function ja(e){e=e|0;return o[e>>2]|0}function Ua(e,t,n,r,i,u){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;u=u|0;o[e>>2]=t;o[e+4>>2]=n;o[e+8>>2]=r;o[e+12>>2]=i;o[e+16>>2]=u;return}function za(e,t){e=e|0;t=t|0;return t|e|0}function Wa(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function Ha(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=Va(e)|0;if(u>>>0>>0)UT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;qa(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];Wa(u,r,n);o[s>>2]=(o[s>>2]|0)+12;Ga(e,l);$a(l);h=c;return}}function Va(e){e=e|0;return 357913941}function qa(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=$T(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function Ga(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function $a(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)KT(e);return}function Ya(e){e=e|0;Ja(e);return}function Ka(e){e=e|0;Qa(e+24|0);return}function Xa(e){e=e|0;return o[e>>2]|0}function Qa(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KT(n)}return}function Ja(e){e=e|0;var t=0;t=Za()|0;nl(e,2,3,t,el()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Za(){return 9228}function el(){return 1140}function tl(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0;n=h;h=h+16|0;r=n+8|0;i=n;u=rl(e)|0;e=o[u+4>>2]|0;o[i>>2]=o[u>>2];o[i+4>>2]=e;o[r>>2]=o[i>>2];o[r+4>>2]=o[i+4>>2];t=il(t,r)|0;h=n;return t|0}function nl(e,t,n,r,i,u){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;u=u|0;o[e>>2]=t;o[e+4>>2]=n;o[e+8>>2]=r;o[e+12>>2]=i;o[e+16>>2]=u;return}function rl(e){e=e|0;return(o[(Ma()|0)+24>>2]|0)+(e*12|0)|0}function il(e,t){e=e|0;t=t|0;var n=0,r=0,i=0;i=h;h=h+48|0;r=i;n=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)n=o[(o[e>>2]|0)+n>>2]|0;vA[n&31](r,e);r=ol(r)|0;h=i;return r|0}function ol(e){e=e|0;var t=0,n=0,r=0,i=0;i=h;h=h+32|0;t=i+12|0;n=i;r=al(ul()|0)|0;if(!r)e=dl(e)|0;else{ll(t,r);sl(n,t);cl(e,n);e=fl(t)|0}h=i;return e|0}function ul(){var e=0;if(!(r[7632]|0)){Dl(9184);Fe(25,9184,g|0)|0;e=7632;o[e>>2]=1;o[e+4>>2]=0}return 9184}function al(e){e=e|0;return o[e+36>>2]|0}function ll(e,t){e=e|0;t=t|0;o[e>>2]=t;o[e+4>>2]=e;o[e+8>>2]=0;return}function sl(e,t){e=e|0;t=t|0;o[e>>2]=o[t>>2];o[e+4>>2]=o[t+4>>2];o[e+8>>2]=0;return}function cl(e,t){e=e|0;t=t|0;gl(t,e,e+8|0,e+16|0,e+24|0,e+32|0,e+40|0)|0;return}function fl(e){e=e|0;return o[(o[e+4>>2]|0)+8>>2]|0}function dl(e){e=e|0;var t=0,n=0,r=0,i=0,u=0,a=0,l=0,s=0;s=h;h=h+16|0;n=s+4|0;r=s;i=UD(8)|0;u=i;a=$T(48)|0;l=a;t=l+48|0;do{o[l>>2]=o[e>>2];l=l+4|0;e=e+4|0}while((l|0)<(t|0));t=u+4|0;o[t>>2]=a;l=$T(8)|0;a=o[t>>2]|0;o[r>>2]=0;o[n>>2]=o[r>>2];pl(l,a,n);o[i>>2]=l;h=s;return u|0}function pl(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;n=$T(16)|0;o[n+4>>2]=0;o[n+8>>2]=0;o[n>>2]=1092;o[n+12>>2]=t;o[e+4>>2]=n;return}function hl(e){e=e|0;zT(e);KT(e);return}function vl(e){e=e|0;e=o[e+12>>2]|0;if(e|0)KT(e);return}function ml(e){e=e|0;KT(e);return}function gl(e,t,n,r,i,u,a){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;u=u|0;a=a|0;u=yl(o[e>>2]|0,t,n,r,i,u,a)|0;a=e+4|0;o[(o[a>>2]|0)+8>>2]=u;return o[(o[a>>2]|0)+8>>2]|0}function yl(e,t,n,r,i,o,u){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;o=o|0;u=u|0;var a=0,l=0;a=h;h=h+16|0;l=a;Dk(l);e=Eu(e)|0;u=_l(e,+c[t>>3],+c[n>>3],+c[r>>3],+c[i>>3],+c[o>>3],+c[u>>3])|0;Ck(l);h=a;return u|0}function _l(e,t,n,r,i,o,u){e=e|0;t=+t;n=+n;r=+r;i=+i;o=+o;u=+u;var a=0;a=Cu(bl()|0)|0;t=+ku(t);n=+ku(n);r=+ku(r);i=+ku(i);o=+ku(o);return Te(0,a|0,e|0,+t,+n,+r,+i,+o,+ +ku(u))|0}function bl(){var e=0;if(!(r[7624]|0)){wl(9172);e=7624;o[e>>2]=1;o[e+4>>2]=0}return 9172}function wl(e){e=e|0;Lu(e,El()|0,6);return}function El(){return 1112}function Dl(e){e=e|0;Al(e);return}function Sl(e){e=e|0;Cl(e+24|0);kl(e+16|0);return}function Cl(e){e=e|0;xl(e);return}function kl(e){e=e|0;Tl(e);return}function Tl(e){e=e|0;var t=0,n=0;t=o[e>>2]|0;if(t|0)do{n=t;t=o[t>>2]|0;KT(n)}while((t|0)!=0);o[e>>2]=0;return}function xl(e){e=e|0;var t=0,n=0;t=o[e>>2]|0;if(t|0)do{n=t;t=o[t>>2]|0;KT(n)}while((t|0)!=0);o[e>>2]=0;return}function Al(e){e=e|0;var t=0;o[e+16>>2]=0;o[e+20>>2]=0;t=e+24|0;o[t>>2]=0;o[e+28>>2]=t;o[e+36>>2]=0;r[e+40>>0]=0;r[e+41>>0]=0;return}function Ol(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Pl(e,n,i,0);h=r;return}function Pl(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=Il()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=Nl(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,Ml(u,r)|0,r);h=i;return}function Il(){var e=0,t=0;if(!(r[7640]|0)){zl(9232);Fe(26,9232,g|0)|0;t=7640;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(9232)|0)){e=9232;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));zl(9232)}return 9232}function Nl(e){e=e|0;return 0}function Ml(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=Il()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];Rl(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{Fl(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function Rl(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function Fl(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=Ll(e)|0;if(u>>>0>>0)UT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;Bl(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];Rl(u,r,n);o[s>>2]=(o[s>>2]|0)+12;jl(e,l);Ul(l);h=c;return}}function Ll(e){e=e|0;return 357913941}function Bl(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=$T(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function jl(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Ul(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)KT(e);return}function zl(e){e=e|0;Vl(e);return}function Wl(e){e=e|0;Hl(e+24|0);return}function Hl(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KT(n)}return}function Vl(e){e=e|0;var t=0;t=Za()|0;nl(e,2,1,t,ql()|0,3);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function ql(){return 1144}function Gl(e,t,n,r,i){e=e|0;t=t|0;n=+n;r=+r;i=i|0;var u=0,a=0,l=0,s=0;u=h;h=h+16|0;a=u+8|0;l=u;s=$l(e)|0;e=o[s+4>>2]|0;o[l>>2]=o[s>>2];o[l+4>>2]=e;o[a>>2]=o[l>>2];o[a+4>>2]=o[l+4>>2];Yl(t,a,n,r,i);h=u;return}function $l(e){e=e|0;return(o[(Il()|0)+24>>2]|0)+(e*12|0)|0}function Yl(e,t,n,r,i){e=e|0;t=t|0;n=+n;r=+r;i=i|0;var u=0,a=0,l=0,s=0,c=0;c=h;h=h+16|0;a=c+2|0;l=c+1|0;s=c;u=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)u=o[(o[e>>2]|0)+u>>2]|0;Kl(a,n);n=+Xl(a,n);Kl(l,r);r=+Xl(l,r);Ql(s,i);s=Jl(s,i)|0;gA[u&1](e,n,r,s);h=c;return}function Kl(e,t){e=e|0;t=+t;return}function Xl(e,t){e=e|0;t=+t;return+ +es(t)}function Ql(e,t){e=e|0;t=t|0;return}function Jl(e,t){e=e|0;t=t|0;return Zl(t)|0}function Zl(e){e=e|0;return e|0}function es(e){e=+e;return+e}function ts(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];ns(e,n,i,1);h=r;return}function ns(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=rs()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=is(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,os(u,r)|0,r);h=i;return}function rs(){var e=0,t=0;if(!(r[7648]|0)){ds(9268);Fe(27,9268,g|0)|0;t=7648;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(9268)|0)){e=9268;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));ds(9268)}return 9268}function is(e){e=e|0;return 0}function os(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=rs()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];us(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{as(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function us(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function as(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=ls(e)|0;if(u>>>0>>0)UT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;ss(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];us(u,r,n);o[s>>2]=(o[s>>2]|0)+12;cs(e,l);fs(l);h=c;return}}function ls(e){e=e|0;return 357913941}function ss(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=$T(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function cs(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function fs(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)KT(e);return}function ds(e){e=e|0;vs(e);return}function ps(e){e=e|0;hs(e+24|0);return}function hs(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KT(n)}return}function vs(e){e=e|0;var t=0;t=Za()|0;nl(e,2,4,t,ms()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function ms(){return 1160}function gs(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0;n=h;h=h+16|0;r=n+8|0;i=n;u=ys(e)|0;e=o[u+4>>2]|0;o[i>>2]=o[u>>2];o[i+4>>2]=e;o[r>>2]=o[i>>2];o[r+4>>2]=o[i+4>>2];t=_s(t,r)|0;h=n;return t|0}function ys(e){e=e|0;return(o[(rs()|0)+24>>2]|0)+(e*12|0)|0}function _s(e,t){e=e|0;t=t|0;var n=0;n=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)n=o[(o[e>>2]|0)+n>>2]|0;return bs(mA[n&31](e)|0)|0}function bs(e){e=e|0;return e&1|0}function ws(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Es(e,n,i,0);h=r;return}function Es(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=Ds()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=Ss(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,Cs(u,r)|0,r);h=i;return}function Ds(){var e=0,t=0;if(!(r[7656]|0)){Is(9304);Fe(28,9304,g|0)|0;t=7656;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(9304)|0)){e=9304;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Is(9304)}return 9304}function Ss(e){e=e|0;return 0}function Cs(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=Ds()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];ks(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{Ts(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function ks(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function Ts(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=xs(e)|0;if(u>>>0>>0)UT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;As(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];ks(u,r,n);o[s>>2]=(o[s>>2]|0)+12;Os(e,l);Ps(l);h=c;return}}function xs(e){e=e|0;return 357913941}function As(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=$T(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function Os(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Ps(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)KT(e);return}function Is(e){e=e|0;Rs(e);return}function Ns(e){e=e|0;Ms(e+24|0);return}function Ms(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KT(n)}return}function Rs(e){e=e|0;var t=0;t=Za()|0;nl(e,2,5,t,Fs()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Fs(){return 1164}function Ls(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=Bs(e)|0;e=o[a+4>>2]|0;o[u>>2]=o[a>>2];o[u+4>>2]=e;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];js(t,i,n);h=r;return}function Bs(e){e=e|0;return(o[(Ds()|0)+24>>2]|0)+(e*12|0)|0}function js(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0;u=h;h=h+16|0;i=u;r=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=o[(o[e>>2]|0)+r>>2]|0;Us(i,n);n=zs(i,n)|0;vA[r&31](e,n);Ws(i);h=u;return}function Us(e,t){e=e|0;t=t|0;Hs(e,t);return}function zs(e,t){e=e|0;t=t|0;return e|0}function Ws(e){e=e|0;Ji(e);return}function Hs(e,t){e=e|0;t=t|0;Vs(e,t);return}function Vs(e,t){e=e|0;t=t|0;o[e>>2]=t;return}function qs(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Gs(e,n,i,0);h=r;return}function Gs(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=$s()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=Ys(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,Ks(u,r)|0,r);h=i;return}function $s(){var e=0,t=0;if(!(r[7664]|0)){nc(9340);Fe(29,9340,g|0)|0;t=7664;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(9340)|0)){e=9340;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));nc(9340)}return 9340}function Ys(e){e=e|0;return 0}function Ks(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=$s()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];Xs(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{Qs(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function Xs(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function Qs(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=Js(e)|0;if(u>>>0>>0)UT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;Zs(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];Xs(u,r,n);o[s>>2]=(o[s>>2]|0)+12;ec(e,l);tc(l);h=c;return}}function Js(e){e=e|0;return 357913941}function Zs(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=$T(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function ec(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function tc(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)KT(e);return}function nc(e){e=e|0;oc(e);return}function rc(e){e=e|0;ic(e+24|0);return}function ic(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KT(n)}return}function oc(e){e=e|0;var t=0;t=Za()|0;nl(e,2,4,t,uc()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function uc(){return 1180}function ac(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=lc(e)|0;e=o[a+4>>2]|0;o[u>>2]=o[a>>2];o[u+4>>2]=e;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];n=sc(t,i,n)|0;h=r;return n|0}function lc(e){e=e|0;return(o[($s()|0)+24>>2]|0)+(e*12|0)|0}function sc(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0;u=h;h=h+16|0;i=u;r=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=o[(o[e>>2]|0)+r>>2]|0;cc(i,n);i=fc(i,n)|0;i=dc(DA[r&15](e,i)|0)|0;h=u;return i|0}function cc(e,t){e=e|0;t=t|0;return}function fc(e,t){e=e|0;t=t|0;return pc(t)|0}function dc(e){e=e|0;return e|0}function pc(e){e=e|0;return e|0}function hc(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];vc(e,n,i,0);h=r;return}function vc(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=mc()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=gc(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,yc(u,r)|0,r);h=i;return}function mc(){var e=0,t=0;if(!(r[7672]|0)){Cc(9376);Fe(30,9376,g|0)|0;t=7672;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(9376)|0)){e=9376;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Cc(9376)}return 9376}function gc(e){e=e|0;return 0}function yc(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=mc()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];_c(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{bc(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function _c(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function bc(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=wc(e)|0;if(u>>>0>>0)UT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;Ec(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];_c(u,r,n);o[s>>2]=(o[s>>2]|0)+12;Dc(e,l);Sc(l);h=c;return}}function wc(e){e=e|0;return 357913941}function Ec(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=$T(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function Dc(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Sc(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)KT(e);return}function Cc(e){e=e|0;xc(e);return}function kc(e){e=e|0;Tc(e+24|0);return}function Tc(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KT(n)}return}function xc(e){e=e|0;var t=0;t=Za()|0;nl(e,2,5,t,Ac()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Ac(){return 1196}function Oc(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0;n=h;h=h+16|0;r=n+8|0;i=n;u=Pc(e)|0;e=o[u+4>>2]|0;o[i>>2]=o[u>>2];o[i+4>>2]=e;o[r>>2]=o[i>>2];o[r+4>>2]=o[i+4>>2];t=Ic(t,r)|0;h=n;return t|0}function Pc(e){e=e|0;return(o[(mc()|0)+24>>2]|0)+(e*12|0)|0}function Ic(e,t){e=e|0;t=t|0;var n=0;n=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)n=o[(o[e>>2]|0)+n>>2]|0;return dc(mA[n&31](e)|0)|0}function Nc(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Mc(e,n,i,1);h=r;return}function Mc(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=Rc()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=Fc(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,Lc(u,r)|0,r);h=i;return}function Rc(){var e=0,t=0;if(!(r[7680]|0)){Vc(9412);Fe(31,9412,g|0)|0;t=7680;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(9412)|0)){e=9412;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Vc(9412)}return 9412}function Fc(e){e=e|0;return 0}function Lc(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=Rc()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];Bc(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{jc(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function Bc(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function jc(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=Uc(e)|0;if(u>>>0>>0)UT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;zc(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];Bc(u,r,n);o[s>>2]=(o[s>>2]|0)+12;Wc(e,l);Hc(l);h=c;return}}function Uc(e){e=e|0;return 357913941}function zc(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=$T(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function Wc(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Hc(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)KT(e);return}function Vc(e){e=e|0;$c(e);return}function qc(e){e=e|0;Gc(e+24|0);return}function Gc(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KT(n)}return}function $c(e){e=e|0;var t=0;t=Za()|0;nl(e,2,6,t,Yc()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Yc(){return 1200}function Kc(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0;n=h;h=h+16|0;r=n+8|0;i=n;u=Xc(e)|0;e=o[u+4>>2]|0;o[i>>2]=o[u>>2];o[i+4>>2]=e;o[r>>2]=o[i>>2];o[r+4>>2]=o[i+4>>2];t=Qc(t,r)|0;h=n;return t|0}function Xc(e){e=e|0;return(o[(Rc()|0)+24>>2]|0)+(e*12|0)|0}function Qc(e,t){e=e|0;t=t|0;var n=0;n=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)n=o[(o[e>>2]|0)+n>>2]|0;return Jc(mA[n&31](e)|0)|0}function Jc(e){e=e|0;return e|0}function Zc(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];ef(e,n,i,0);h=r;return}function ef(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=tf()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=nf(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,rf(u,r)|0,r);h=i;return}function tf(){var e=0,t=0;if(!(r[7688]|0)){ff(9448);Fe(32,9448,g|0)|0;t=7688;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(9448)|0)){e=9448;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));ff(9448)}return 9448}function nf(e){e=e|0;return 0}function rf(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=tf()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];of(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{uf(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function of(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function uf(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=af(e)|0;if(u>>>0>>0)UT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;lf(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];of(u,r,n);o[s>>2]=(o[s>>2]|0)+12;sf(e,l);cf(l);h=c;return}}function af(e){e=e|0;return 357913941}function lf(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=$T(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function sf(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function cf(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)KT(e);return}function ff(e){e=e|0;hf(e);return}function df(e){e=e|0;pf(e+24|0);return}function pf(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KT(n)}return}function hf(e){e=e|0;var t=0;t=Za()|0;nl(e,2,6,t,vf()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function vf(){return 1204}function mf(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=gf(e)|0;e=o[a+4>>2]|0;o[u>>2]=o[a>>2];o[u+4>>2]=e;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];yf(t,i,n);h=r;return}function gf(e){e=e|0;return(o[(tf()|0)+24>>2]|0)+(e*12|0)|0}function yf(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0;u=h;h=h+16|0;i=u;r=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=o[(o[e>>2]|0)+r>>2]|0;_f(i,n);i=bf(i,n)|0;vA[r&31](e,i);h=u;return}function _f(e,t){e=e|0;t=t|0;return}function bf(e,t){e=e|0;t=t|0;return wf(t)|0}function wf(e){e=e|0;return e|0}function Ef(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Df(e,n,i,0);h=r;return}function Df(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=Sf()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=Cf(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,kf(u,r)|0,r);h=i;return}function Sf(){var e=0,t=0;if(!(r[7696]|0)){Nf(9484);Fe(33,9484,g|0)|0;t=7696;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(9484)|0)){e=9484;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Nf(9484)}return 9484}function Cf(e){e=e|0;return 0}function kf(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=Sf()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];Tf(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{xf(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function Tf(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function xf(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=Af(e)|0;if(u>>>0>>0)UT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;Of(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];Tf(u,r,n);o[s>>2]=(o[s>>2]|0)+12;Pf(e,l);If(l);h=c;return}}function Af(e){e=e|0;return 357913941}function Of(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=$T(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function Pf(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function If(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)KT(e);return}function Nf(e){e=e|0;Ff(e);return}function Mf(e){e=e|0;Rf(e+24|0);return}function Rf(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KT(n)}return}function Ff(e){e=e|0;var t=0;t=Za()|0;nl(e,2,1,t,Lf()|0,2);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Lf(){return 1212}function Bf(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0;i=h;h=h+16|0;u=i+8|0;a=i;l=jf(e)|0;e=o[l+4>>2]|0;o[a>>2]=o[l>>2];o[a+4>>2]=e;o[u>>2]=o[a>>2];o[u+4>>2]=o[a+4>>2];Uf(t,u,n,r);h=i;return}function jf(e){e=e|0;return(o[(Sf()|0)+24>>2]|0)+(e*12|0)|0}function Uf(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0;l=h;h=h+16|0;u=l+1|0;a=l;i=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)i=o[(o[e>>2]|0)+i>>2]|0;_f(u,n);u=bf(u,n)|0;cc(a,r);a=fc(a,r)|0;PA[i&15](e,u,a);h=l;return}function zf(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Wf(e,n,i,1);h=r;return}function Wf(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=Hf()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=Vf(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,qf(u,r)|0,r);h=i;return}function Hf(){var e=0,t=0;if(!(r[7704]|0)){Jf(9520);Fe(34,9520,g|0)|0;t=7704;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(9520)|0)){e=9520;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Jf(9520)}return 9520}function Vf(e){e=e|0;return 0}function qf(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=Hf()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];Gf(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{$f(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function Gf(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function $f(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=Yf(e)|0;if(u>>>0>>0)UT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;Kf(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];Gf(u,r,n);o[s>>2]=(o[s>>2]|0)+12;Xf(e,l);Qf(l);h=c;return}}function Yf(e){e=e|0;return 357913941}function Kf(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=$T(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function Xf(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Qf(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)KT(e);return}function Jf(e){e=e|0;td(e);return}function Zf(e){e=e|0;ed(e+24|0);return}function ed(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KT(n)}return}function td(e){e=e|0;var t=0;t=Za()|0;nl(e,2,1,t,nd()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function nd(){return 1224}function rd(e,t,n){e=e|0;t=t|0;n=n|0;var r=0.0,i=0,u=0,a=0,l=0;i=h;h=h+16|0;u=i+8|0;a=i;l=id(e)|0;e=o[l+4>>2]|0;o[a>>2]=o[l>>2];o[a+4>>2]=e;o[u>>2]=o[a>>2];o[u+4>>2]=o[a+4>>2];r=+od(t,u,n);h=i;return+r}function id(e){e=e|0;return(o[(Hf()|0)+24>>2]|0)+(e*12|0)|0}function od(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0.0;u=h;h=h+16|0;i=u;r=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=o[(o[e>>2]|0)+r>>2]|0;Ql(i,n);i=Jl(i,n)|0;a=+Mu(+kA[r&7](e,i));h=u;return+a}function ud(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];ad(e,n,i,1);h=r;return}function ad(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=ld()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=sd(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,cd(u,r)|0,r);h=i;return}function ld(){var e=0,t=0;if(!(r[7712]|0)){gd(9556);Fe(35,9556,g|0)|0;t=7712;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(9556)|0)){e=9556;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));gd(9556)}return 9556}function sd(e){e=e|0;return 0}function cd(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=ld()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];fd(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{dd(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function fd(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function dd(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=pd(e)|0;if(u>>>0>>0)UT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;hd(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];fd(u,r,n);o[s>>2]=(o[s>>2]|0)+12;vd(e,l);md(l);h=c;return}}function pd(e){e=e|0;return 357913941}function hd(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=$T(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function vd(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function md(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)KT(e);return}function gd(e){e=e|0;bd(e);return}function yd(e){e=e|0;_d(e+24|0);return}function _d(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KT(n)}return}function bd(e){e=e|0;var t=0;t=Za()|0;nl(e,2,5,t,wd()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function wd(){return 1232}function Ed(e,t){e=e|0;t=t|0;var n=0.0,r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=Dd(e)|0;e=o[a+4>>2]|0;o[u>>2]=o[a>>2];o[u+4>>2]=e;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];n=+Sd(t,i);h=r;return+n}function Dd(e){e=e|0;return(o[(ld()|0)+24>>2]|0)+(e*12|0)|0}function Sd(e,t){e=e|0;t=t|0;var n=0;n=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)n=o[(o[e>>2]|0)+n>>2]|0;return+ +Mu(+wA[n&15](e))}function Cd(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];kd(e,n,i,1);h=r;return}function kd(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=Td()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=xd(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,Ad(u,r)|0,r);h=i;return}function Td(){var e=0,t=0;if(!(r[7720]|0)){Fd(9592);Fe(36,9592,g|0)|0;t=7720;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(9592)|0)){e=9592;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Fd(9592)}return 9592}function xd(e){e=e|0;return 0}function Ad(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=Td()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];Od(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{Pd(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function Od(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function Pd(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=Id(e)|0;if(u>>>0>>0)UT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;Nd(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];Od(u,r,n);o[s>>2]=(o[s>>2]|0)+12;Md(e,l);Rd(l);h=c;return}}function Id(e){e=e|0;return 357913941}function Nd(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=$T(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function Md(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Rd(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)KT(e);return}function Fd(e){e=e|0;jd(e);return}function Ld(e){e=e|0;Bd(e+24|0);return}function Bd(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KT(n)}return}function jd(e){e=e|0;var t=0;t=Za()|0;nl(e,2,7,t,Ud()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Ud(){return 1276}function zd(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0;n=h;h=h+16|0;r=n+8|0;i=n;u=Wd(e)|0;e=o[u+4>>2]|0;o[i>>2]=o[u>>2];o[i+4>>2]=e;o[r>>2]=o[i>>2];o[r+4>>2]=o[i+4>>2];t=Hd(t,r)|0;h=n;return t|0}function Wd(e){e=e|0;return(o[(Td()|0)+24>>2]|0)+(e*12|0)|0}function Hd(e,t){e=e|0;t=t|0;var n=0,r=0,i=0;i=h;h=h+16|0;r=i;n=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)n=o[(o[e>>2]|0)+n>>2]|0;vA[n&31](r,e);r=Vd(r)|0;h=i;return r|0}function Vd(e){e=e|0;var t=0,n=0,r=0,i=0;i=h;h=h+32|0;t=i+12|0;n=i;r=al(qd()|0)|0;if(!r)e=$d(e)|0;else{ll(t,r);sl(n,t);Gd(e,n);e=fl(t)|0}h=i;return e|0}function qd(){var e=0;if(!(r[7736]|0)){ip(9640);Fe(25,9640,g|0)|0;e=7736;o[e>>2]=1;o[e+4>>2]=0}return 9640}function Gd(e,t){e=e|0;t=t|0;Jd(t,e,e+8|0)|0;return}function $d(e){e=e|0;var t=0,n=0,r=0,i=0,u=0,a=0,l=0;n=h;h=h+16|0;i=n+4|0;a=n;r=UD(8)|0;t=r;l=$T(16)|0;o[l>>2]=o[e>>2];o[l+4>>2]=o[e+4>>2];o[l+8>>2]=o[e+8>>2];o[l+12>>2]=o[e+12>>2];u=t+4|0;o[u>>2]=l;e=$T(8)|0;u=o[u>>2]|0;o[a>>2]=0;o[i>>2]=o[a>>2];Yd(e,u,i);o[r>>2]=e;h=n;return t|0}function Yd(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;n=$T(16)|0;o[n+4>>2]=0;o[n+8>>2]=0;o[n>>2]=1244;o[n+12>>2]=t;o[e+4>>2]=n;return}function Kd(e){e=e|0;zT(e);KT(e);return}function Xd(e){e=e|0;e=o[e+12>>2]|0;if(e|0)KT(e);return}function Qd(e){e=e|0;KT(e);return}function Jd(e,t,n){e=e|0;t=t|0;n=n|0;t=Zd(o[e>>2]|0,t,n)|0;n=e+4|0;o[(o[n>>2]|0)+8>>2]=t;return o[(o[n>>2]|0)+8>>2]|0}function Zd(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0;r=h;h=h+16|0;i=r;Dk(i);e=Eu(e)|0;n=ep(e,o[t>>2]|0,+c[n>>3])|0;Ck(i);h=r;return n|0}function ep(e,t,n){e=e|0;t=t|0;n=+n;var r=0;r=Cu(tp()|0)|0;t=Tu(t)|0;return xe(0,r|0,e|0,t|0,+ +ku(n))|0}function tp(){var e=0;if(!(r[7728]|0)){np(9628);e=7728;o[e>>2]=1;o[e+4>>2]=0}return 9628}function np(e){e=e|0;Lu(e,rp()|0,2);return}function rp(){return 1264}function ip(e){e=e|0;Al(e);return}function op(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];up(e,n,i,1);h=r;return}function up(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=ap()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=lp(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,sp(u,r)|0,r);h=i;return}function ap(){var e=0,t=0;if(!(r[7744]|0)){mp(9684);Fe(37,9684,g|0)|0;t=7744;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(9684)|0)){e=9684;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));mp(9684)}return 9684}function lp(e){e=e|0;return 0}function sp(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=ap()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];cp(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{fp(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function cp(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function fp(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=dp(e)|0;if(u>>>0>>0)UT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;pp(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];cp(u,r,n);o[s>>2]=(o[s>>2]|0)+12;hp(e,l);vp(l);h=c;return}}function dp(e){e=e|0;return 357913941}function pp(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=$T(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function hp(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function vp(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)KT(e);return}function mp(e){e=e|0;_p(e);return}function gp(e){e=e|0;yp(e+24|0);return}function yp(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KT(n)}return}function _p(e){e=e|0;var t=0;t=Za()|0;nl(e,2,5,t,bp()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function bp(){return 1280}function wp(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=Ep(e)|0;e=o[a+4>>2]|0;o[u>>2]=o[a>>2];o[u+4>>2]=e;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];n=Dp(t,i,n)|0;h=r;return n|0}function Ep(e){e=e|0;return(o[(ap()|0)+24>>2]|0)+(e*12|0)|0}function Dp(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;a=h;h=h+32|0;i=a;u=a+16|0;r=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=o[(o[e>>2]|0)+r>>2]|0;Ql(u,n);u=Jl(u,n)|0;PA[r&15](i,e,u);u=Vd(i)|0;h=a;return u|0}function Sp(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Cp(e,n,i,1);h=r;return}function Cp(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=kp()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=Tp(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,xp(u,r)|0,r);h=i;return}function kp(){var e=0,t=0;if(!(r[7752]|0)){Rp(9720);Fe(38,9720,g|0)|0;t=7752;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(9720)|0)){e=9720;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Rp(9720)}return 9720}function Tp(e){e=e|0;return 0}function xp(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=kp()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];Ap(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{Op(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function Ap(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function Op(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=Pp(e)|0;if(u>>>0>>0)UT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;Ip(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];Ap(u,r,n);o[s>>2]=(o[s>>2]|0)+12;Np(e,l);Mp(l);h=c;return}}function Pp(e){e=e|0;return 357913941}function Ip(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=$T(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function Np(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Mp(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)KT(e);return}function Rp(e){e=e|0;Bp(e);return}function Fp(e){e=e|0;Lp(e+24|0);return}function Lp(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KT(n)}return}function Bp(e){e=e|0;var t=0;t=Za()|0;nl(e,2,8,t,jp()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function jp(){return 1288}function Up(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0;n=h;h=h+16|0;r=n+8|0;i=n;u=zp(e)|0;e=o[u+4>>2]|0;o[i>>2]=o[u>>2];o[i+4>>2]=e;o[r>>2]=o[i>>2];o[r+4>>2]=o[i+4>>2];t=Wp(t,r)|0;h=n;return t|0}function zp(e){e=e|0;return(o[(kp()|0)+24>>2]|0)+(e*12|0)|0}function Wp(e,t){e=e|0;t=t|0;var n=0;n=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)n=o[(o[e>>2]|0)+n>>2]|0;return Nu(mA[n&31](e)|0)|0}function Hp(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Vp(e,n,i,0);h=r;return}function Vp(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=qp()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=Gp(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,$p(u,r)|0,r);h=i;return}function qp(){var e=0,t=0;if(!(r[7760]|0)){eh(9756);Fe(39,9756,g|0)|0;t=7760;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(9756)|0)){e=9756;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));eh(9756)}return 9756}function Gp(e){e=e|0;return 0}function $p(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=qp()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];Yp(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{Kp(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function Yp(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function Kp(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=Xp(e)|0;if(u>>>0>>0)UT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;Qp(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];Yp(u,r,n);o[s>>2]=(o[s>>2]|0)+12;Jp(e,l);Zp(l);h=c;return}}function Xp(e){e=e|0;return 357913941}function Qp(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=$T(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function Jp(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Zp(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)KT(e);return}function eh(e){e=e|0;rh(e);return}function th(e){e=e|0;nh(e+24|0);return}function nh(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KT(n)}return}function rh(e){e=e|0;var t=0;t=Za()|0;nl(e,2,8,t,ih()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function ih(){return 1292}function oh(e,t,n){e=e|0;t=t|0;n=+n;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=uh(e)|0;e=o[a+4>>2]|0;o[u>>2]=o[a>>2];o[u+4>>2]=e;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];ah(t,i,n);h=r;return}function uh(e){e=e|0;return(o[(qp()|0)+24>>2]|0)+(e*12|0)|0}function ah(e,t,n){e=e|0;t=t|0;n=+n;var r=0,i=0,u=0;u=h;h=h+16|0;i=u;r=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=o[(o[e>>2]|0)+r>>2]|0;Kl(i,n);n=+Xl(i,n);dA[r&31](e,n);h=u;return}function lh(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];sh(e,n,i,0);h=r;return}function sh(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=ch()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=fh(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,dh(u,r)|0,r);h=i;return}function ch(){var e=0,t=0;if(!(r[7768]|0)){_h(9792);Fe(40,9792,g|0)|0;t=7768;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(9792)|0)){e=9792;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));_h(9792)}return 9792}function fh(e){e=e|0;return 0}function dh(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=ch()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];ph(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{hh(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function ph(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function hh(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=vh(e)|0;if(u>>>0>>0)UT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;mh(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];ph(u,r,n);o[s>>2]=(o[s>>2]|0)+12;gh(e,l);yh(l);h=c;return}}function vh(e){e=e|0;return 357913941}function mh(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=$T(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function gh(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function yh(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)KT(e);return}function _h(e){e=e|0;Eh(e);return}function bh(e){e=e|0;wh(e+24|0);return}function wh(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KT(n)}return}function Eh(e){e=e|0;var t=0;t=Za()|0;nl(e,2,1,t,Dh()|0,2);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Dh(){return 1300}function Sh(e,t,n,r){e=e|0;t=t|0;n=n|0;r=+r;var i=0,u=0,a=0,l=0;i=h;h=h+16|0;u=i+8|0;a=i;l=Ch(e)|0;e=o[l+4>>2]|0;o[a>>2]=o[l>>2];o[a+4>>2]=e;o[u>>2]=o[a>>2];o[u+4>>2]=o[a+4>>2];kh(t,u,n,r);h=i;return}function Ch(e){e=e|0;return(o[(ch()|0)+24>>2]|0)+(e*12|0)|0}function kh(e,t,n,r){e=e|0;t=t|0;n=n|0;r=+r;var i=0,u=0,a=0,l=0;l=h;h=h+16|0;u=l+1|0;a=l;i=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)i=o[(o[e>>2]|0)+i>>2]|0;Ql(u,n);u=Jl(u,n)|0;Kl(a,r);r=+Xl(a,r);NA[i&15](e,u,r);h=l;return}function Th(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];xh(e,n,i,0);h=r;return}function xh(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=Ah()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=Oh(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,Ph(u,r)|0,r);h=i;return}function Ah(){var e=0,t=0;if(!(r[7776]|0)){Bh(9828);Fe(41,9828,g|0)|0;t=7776;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(9828)|0)){e=9828;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Bh(9828)}return 9828}function Oh(e){e=e|0;return 0}function Ph(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=Ah()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];Ih(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{Nh(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function Ih(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function Nh(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=Mh(e)|0;if(u>>>0>>0)UT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;Rh(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];Ih(u,r,n);o[s>>2]=(o[s>>2]|0)+12;Fh(e,l);Lh(l);h=c;return}}function Mh(e){e=e|0;return 357913941}function Rh(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=$T(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function Fh(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Lh(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)KT(e);return}function Bh(e){e=e|0;zh(e);return}function jh(e){e=e|0;Uh(e+24|0);return}function Uh(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KT(n)}return}function zh(e){e=e|0;var t=0;t=Za()|0;nl(e,2,7,t,Wh()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Wh(){return 1312}function Hh(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=Vh(e)|0;e=o[a+4>>2]|0;o[u>>2]=o[a>>2];o[u+4>>2]=e;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];qh(t,i,n);h=r;return}function Vh(e){e=e|0;return(o[(Ah()|0)+24>>2]|0)+(e*12|0)|0}function qh(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0;u=h;h=h+16|0;i=u;r=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=o[(o[e>>2]|0)+r>>2]|0;Ql(i,n);i=Jl(i,n)|0;vA[r&31](e,i);h=u;return}function Gh(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];$h(e,n,i,0);h=r;return}function $h(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=Yh()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=Kh(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,Xh(u,r)|0,r);h=i;return}function Yh(){var e=0,t=0;if(!(r[7784]|0)){rv(9864);Fe(42,9864,g|0)|0;t=7784;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(9864)|0)){e=9864;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));rv(9864)}return 9864}function Kh(e){e=e|0;return 0}function Xh(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=Yh()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];Qh(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{Jh(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function Qh(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function Jh(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=Zh(e)|0;if(u>>>0>>0)UT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;ev(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];Qh(u,r,n);o[s>>2]=(o[s>>2]|0)+12;tv(e,l);nv(l);h=c;return}}function Zh(e){e=e|0;return 357913941}function ev(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=$T(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function tv(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function nv(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)KT(e);return}function rv(e){e=e|0;uv(e);return}function iv(e){e=e|0;ov(e+24|0);return}function ov(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KT(n)}return}function uv(e){e=e|0;var t=0;t=Za()|0;nl(e,2,8,t,av()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function av(){return 1320}function lv(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=sv(e)|0;e=o[a+4>>2]|0;o[u>>2]=o[a>>2];o[u+4>>2]=e;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];cv(t,i,n);h=r;return}function sv(e){e=e|0;return(o[(Yh()|0)+24>>2]|0)+(e*12|0)|0}function cv(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0;u=h;h=h+16|0;i=u;r=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=o[(o[e>>2]|0)+r>>2]|0;fv(i,n);i=dv(i,n)|0;vA[r&31](e,i);h=u;return}function fv(e,t){e=e|0;t=t|0;return}function dv(e,t){e=e|0;t=t|0;return pv(t)|0}function pv(e){e=e|0;return e|0}function hv(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];vv(e,n,i,0);h=r;return}function vv(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=mv()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=gv(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,yv(u,r)|0,r);h=i;return}function mv(){var e=0,t=0;if(!(r[7792]|0)){Cv(9900);Fe(43,9900,g|0)|0;t=7792;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(9900)|0)){e=9900;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Cv(9900)}return 9900}function gv(e){e=e|0;return 0}function yv(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=mv()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];_v(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{bv(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function _v(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function bv(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=wv(e)|0;if(u>>>0>>0)UT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;Ev(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];_v(u,r,n);o[s>>2]=(o[s>>2]|0)+12;Dv(e,l);Sv(l);h=c;return}}function wv(e){e=e|0;return 357913941}function Ev(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=$T(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function Dv(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Sv(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)KT(e);return}function Cv(e){e=e|0;xv(e);return}function kv(e){e=e|0;Tv(e+24|0);return}function Tv(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KT(n)}return}function xv(e){e=e|0;var t=0;t=Za()|0;nl(e,2,22,t,Av()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Av(){return 1344}function Ov(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0;n=h;h=h+16|0;r=n+8|0;i=n;u=Pv(e)|0;e=o[u+4>>2]|0;o[i>>2]=o[u>>2];o[i+4>>2]=e;o[r>>2]=o[i>>2];o[r+4>>2]=o[i+4>>2];Iv(t,r);h=n;return}function Pv(e){e=e|0;return(o[(mv()|0)+24>>2]|0)+(e*12|0)|0}function Iv(e,t){e=e|0;t=t|0;var n=0;n=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)n=o[(o[e>>2]|0)+n>>2]|0;hA[n&127](e);return}function Nv(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0;u=o[e>>2]|0;i=Mv()|0;e=Rv(n)|0;La(u,t,i,e,Fv(n,r)|0,r);return}function Mv(){var e=0,t=0;if(!(r[7800]|0)){Hv(9936);Fe(44,9936,g|0)|0;t=7800;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(9936)|0)){e=9936;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Hv(9936)}return 9936}function Rv(e){e=e|0;return e|0}function Fv(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;u=l+4|0;o[i>>2]=e;s=Mv()|0;a=s+24|0;t=za(t,4)|0;o[u>>2]=t;n=s+28|0;r=o[n>>2]|0;if(r>>>0<(o[s+32>>2]|0)>>>0){Lv(r,e,t);t=(o[n>>2]|0)+8|0;o[n>>2]=t}else{Bv(a,i,u);t=o[n>>2]|0}h=l;return(t-(o[a>>2]|0)>>3)+-1|0}function Lv(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;o[e+4>>2]=n;return}function Bv(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;u=e+4|0;a=((o[u>>2]|0)-(o[e>>2]|0)>>3)+1|0;r=jv(e)|0;if(r>>>0>>0)UT(e);else{s=o[e>>2]|0;f=(o[e+8>>2]|0)-s|0;c=f>>2;Uv(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(o[u>>2]|0)-s>>3,e+8|0);a=i+8|0;Lv(o[a>>2]|0,o[t>>2]|0,o[n>>2]|0);o[a>>2]=(o[a>>2]|0)+8;zv(e,i);Wv(i);h=l;return}}function jv(e){e=e|0;return 536870911}function Uv(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>536870911)Ye();else{i=$T(t<<3)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<3)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<3);return}function zv(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>3)<<3)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Wv(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=o[e>>2]|0;if(e|0)KT(e);return}function Hv(e){e=e|0;Gv(e);return}function Vv(e){e=e|0;qv(e+24|0);return}function qv(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KT(n)}return}function Gv(e){e=e|0;var t=0;t=Za()|0;nl(e,1,23,t,vf()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function $v(e,t){e=e|0;t=t|0;Kv(o[(Yv(e)|0)>>2]|0,t);return}function Yv(e){e=e|0;return(o[(Mv()|0)+24>>2]|0)+(e<<3)|0}function Kv(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;_f(r,t);t=bf(r,t)|0;hA[e&127](t);h=n;return}function Xv(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0;u=o[e>>2]|0;i=Qv()|0;e=Jv(n)|0;La(u,t,i,e,Zv(n,r)|0,r);return}function Qv(){var e=0,t=0;if(!(r[7808]|0)){um(9972);Fe(45,9972,g|0)|0;t=7808;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(9972)|0)){e=9972;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));um(9972)}return 9972}function Jv(e){e=e|0;return e|0}function Zv(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;u=l+4|0;o[i>>2]=e;s=Qv()|0;a=s+24|0;t=za(t,4)|0;o[u>>2]=t;n=s+28|0;r=o[n>>2]|0;if(r>>>0<(o[s+32>>2]|0)>>>0){em(r,e,t);t=(o[n>>2]|0)+8|0;o[n>>2]=t}else{tm(a,i,u);t=o[n>>2]|0}h=l;return(t-(o[a>>2]|0)>>3)+-1|0}function em(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;o[e+4>>2]=n;return}function tm(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;u=e+4|0;a=((o[u>>2]|0)-(o[e>>2]|0)>>3)+1|0;r=nm(e)|0;if(r>>>0>>0)UT(e);else{s=o[e>>2]|0;f=(o[e+8>>2]|0)-s|0;c=f>>2;rm(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(o[u>>2]|0)-s>>3,e+8|0);a=i+8|0;em(o[a>>2]|0,o[t>>2]|0,o[n>>2]|0);o[a>>2]=(o[a>>2]|0)+8;im(e,i);om(i);h=l;return}}function nm(e){e=e|0;return 536870911}function rm(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>536870911)Ye();else{i=$T(t<<3)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<3)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<3);return}function im(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>3)<<3)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function om(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=o[e>>2]|0;if(e|0)KT(e);return}function um(e){e=e|0;sm(e);return}function am(e){e=e|0;lm(e+24|0);return}function lm(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KT(n)}return}function sm(e){e=e|0;var t=0;t=Za()|0;nl(e,1,9,t,cm()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function cm(){return 1348}function fm(e,t){e=e|0;t=t|0;return pm(o[(dm(e)|0)>>2]|0,t)|0}function dm(e){e=e|0;return(o[(Qv()|0)+24>>2]|0)+(e<<3)|0}function pm(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;hm(r,t);t=vm(r,t)|0;t=dc(mA[e&31](t)|0)|0;h=n;return t|0}function hm(e,t){e=e|0;t=t|0;return}function vm(e,t){e=e|0;t=t|0;return mm(t)|0}function mm(e){e=e|0;return e|0}function gm(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0;u=o[e>>2]|0;i=ym()|0;e=_m(n)|0;La(u,t,i,e,bm(n,r)|0,r);return}function ym(){var e=0,t=0;if(!(r[7816]|0)){Tm(10008);Fe(46,10008,g|0)|0;t=7816;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(10008)|0)){e=10008;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Tm(10008)}return 10008}function _m(e){e=e|0;return e|0}function bm(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;u=l+4|0;o[i>>2]=e;s=ym()|0;a=s+24|0;t=za(t,4)|0;o[u>>2]=t;n=s+28|0;r=o[n>>2]|0;if(r>>>0<(o[s+32>>2]|0)>>>0){wm(r,e,t);t=(o[n>>2]|0)+8|0;o[n>>2]=t}else{Em(a,i,u);t=o[n>>2]|0}h=l;return(t-(o[a>>2]|0)>>3)+-1|0}function wm(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;o[e+4>>2]=n;return}function Em(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;u=e+4|0;a=((o[u>>2]|0)-(o[e>>2]|0)>>3)+1|0;r=Dm(e)|0;if(r>>>0>>0)UT(e);else{s=o[e>>2]|0;f=(o[e+8>>2]|0)-s|0;c=f>>2;Sm(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(o[u>>2]|0)-s>>3,e+8|0);a=i+8|0;wm(o[a>>2]|0,o[t>>2]|0,o[n>>2]|0);o[a>>2]=(o[a>>2]|0)+8;Cm(e,i);km(i);h=l;return}}function Dm(e){e=e|0;return 536870911}function Sm(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>536870911)Ye();else{i=$T(t<<3)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<3)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<3);return}function Cm(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>3)<<3)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function km(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=o[e>>2]|0;if(e|0)KT(e);return}function Tm(e){e=e|0;Om(e);return}function xm(e){e=e|0;Am(e+24|0);return}function Am(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KT(n)}return}function Om(e){e=e|0;var t=0;t=Za()|0;nl(e,1,15,t,Ac()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Pm(e){e=e|0;return Nm(o[(Im(e)|0)>>2]|0)|0}function Im(e){e=e|0;return(o[(ym()|0)+24>>2]|0)+(e<<3)|0}function Nm(e){e=e|0;return dc(TA[e&7]()|0)|0}function Mm(){var e=0;if(!(r[7832]|0)){Vm(10052);Fe(25,10052,g|0)|0;e=7832;o[e>>2]=1;o[e+4>>2]=0}return 10052}function Rm(e,t){e=e|0;t=t|0;o[e>>2]=Fm()|0;o[e+4>>2]=Lm()|0;o[e+12>>2]=t;o[e+8>>2]=Bm()|0;o[e+32>>2]=2;return}function Fm(){return 11709}function Lm(){return 1188}function Bm(){return Wm()|0}function jm(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;if((Um(r,896)|0)==512){if(n|0){zm(n);KT(n)}}else if(t|0){Qi(t);KT(t)}return}function Um(e,t){e=e|0;t=t|0;return t&e|0}function zm(e){e=e|0;e=o[e+4>>2]|0;if(e|0)qT(e);return}function Wm(){var e=0;if(!(r[7824]|0)){o[2511]=Hm()|0;o[2512]=0;e=7824;o[e>>2]=1;o[e+4>>2]=0}return 10044}function Hm(){return 0}function Vm(e){e=e|0;Al(e);return}function qm(e){e=e|0;var t=0,n=0,r=0,i=0,u=0;t=h;h=h+32|0;n=t+24|0;u=t+16|0;i=t+8|0;r=t;Gm(e,4827);$m(e,4834,3)|0;Ym(e,3682,47)|0;o[u>>2]=9;o[u+4>>2]=0;o[n>>2]=o[u>>2];o[n+4>>2]=o[u+4>>2];Km(e,4841,n)|0;o[i>>2]=1;o[i+4>>2]=0;o[n>>2]=o[i>>2];o[n+4>>2]=o[i+4>>2];Xm(e,4871,n)|0;o[r>>2]=10;o[r+4>>2]=0;o[n>>2]=o[r>>2];o[n+4>>2]=o[r+4>>2];Qm(e,4891,n)|0;h=t;return}function Gm(e,t){e=e|0;t=t|0;var n=0;n=Vy()|0;o[e>>2]=n;qy(n,t);cw(o[e>>2]|0);return}function $m(e,t,n){e=e|0;t=t|0;n=n|0;Cy(e,Ia(t)|0,n,0);return e|0}function Ym(e,t,n){e=e|0;t=t|0;n=n|0;ay(e,Ia(t)|0,n,0);return e|0}function Km(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];jg(e,t,i);h=r;return e|0}function Xm(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];gg(e,t,i);h=r;return e|0}function Qm(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Jm(e,t,i);h=r;return e|0}function Jm(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Zm(e,n,i,1);h=r;return}function Zm(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=eg()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=tg(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,ng(u,r)|0,r);h=i;return}function eg(){var e=0,t=0;if(!(r[7840]|0)){sg(10100);Fe(48,10100,g|0)|0;t=7840;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(10100)|0)){e=10100;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));sg(10100)}return 10100}function tg(e){e=e|0;return 0}function ng(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=eg()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];rg(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{ig(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function rg(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function ig(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=og(e)|0;if(u>>>0>>0)UT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;ug(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];rg(u,r,n);o[s>>2]=(o[s>>2]|0)+12;ag(e,l);lg(l);h=c;return}}function og(e){e=e|0;return 357913941}function ug(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=$T(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function ag(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function lg(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)KT(e);return}function sg(e){e=e|0;dg(e);return}function cg(e){e=e|0;fg(e+24|0);return}function fg(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KT(n)}return}function dg(e){e=e|0;var t=0;t=Za()|0;nl(e,2,6,t,pg()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function pg(){return 1364}function hg(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=vg(e)|0;e=o[a+4>>2]|0;o[u>>2]=o[a>>2];o[u+4>>2]=e;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];n=mg(t,i,n)|0;h=r;return n|0}function vg(e){e=e|0;return(o[(eg()|0)+24>>2]|0)+(e*12|0)|0}function mg(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0;u=h;h=h+16|0;i=u;r=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=o[(o[e>>2]|0)+r>>2]|0;Ql(i,n);i=Jl(i,n)|0;i=bs(DA[r&15](e,i)|0)|0;h=u;return i|0}function gg(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];yg(e,n,i,0);h=r;return}function yg(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=_g()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=bg(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,wg(u,r)|0,r);h=i;return}function _g(){var e=0,t=0;if(!(r[7848]|0)){xg(10136);Fe(49,10136,g|0)|0;t=7848;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(10136)|0)){e=10136;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));xg(10136)}return 10136}function bg(e){e=e|0;return 0}function wg(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=_g()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];Eg(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{Dg(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function Eg(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function Dg(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=Sg(e)|0;if(u>>>0>>0)UT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;Cg(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];Eg(u,r,n);o[s>>2]=(o[s>>2]|0)+12;kg(e,l);Tg(l);h=c;return}}function Sg(e){e=e|0;return 357913941}function Cg(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=$T(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function kg(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Tg(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)KT(e);return}function xg(e){e=e|0;Pg(e);return}function Ag(e){e=e|0;Og(e+24|0);return}function Og(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KT(n)}return}function Pg(e){e=e|0;var t=0;t=Za()|0;nl(e,2,9,t,Ig()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Ig(){return 1372}function Ng(e,t,n){e=e|0;t=t|0;n=+n;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=Mg(e)|0;e=o[a+4>>2]|0;o[u>>2]=o[a>>2];o[u+4>>2]=e;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Rg(t,i,n);h=r;return}function Mg(e){e=e|0;return(o[(_g()|0)+24>>2]|0)+(e*12|0)|0}function Rg(e,t,n){e=e|0;t=t|0;n=+n;var r=0,i=0,u=0,a=ft;u=h;h=h+16|0;i=u;r=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=o[(o[e>>2]|0)+r>>2]|0;Fg(i,n);a=Y(Lg(i,n));fA[r&1](e,a);h=u;return}function Fg(e,t){e=e|0;t=+t;return}function Lg(e,t){e=e|0;t=+t;return Y(Bg(t))}function Bg(e){e=+e;return Y(e)}function jg(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Ug(e,n,i,0);h=r;return}function Ug(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=zg()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=Wg(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,Hg(u,r)|0,r);h=i;return}function zg(){var e=0,t=0;if(!(r[7856]|0)){Xg(10172);Fe(50,10172,g|0)|0;t=7856;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(10172)|0)){e=10172;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Xg(10172)}return 10172}function Wg(e){e=e|0;return 0}function Hg(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=zg()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];Vg(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{qg(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function Vg(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function qg(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=Gg(e)|0;if(u>>>0>>0)UT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;$g(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];Vg(u,r,n);o[s>>2]=(o[s>>2]|0)+12;Yg(e,l);Kg(l);h=c;return}}function Gg(e){e=e|0;return 357913941}function $g(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=$T(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function Yg(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Kg(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)KT(e);return}function Xg(e){e=e|0;Zg(e);return}function Qg(e){e=e|0;Jg(e+24|0);return}function Jg(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);KT(n)}return}function Zg(e){e=e|0;var t=0;t=Za()|0;nl(e,2,3,t,ey()|0,2);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function ey(){return 1380}function ty(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0;i=h;h=h+16|0;u=i+8|0;a=i;l=ny(e)|0;e=o[l+4>>2]|0;o[a>>2]=o[l>>2];o[a+4>>2]=e;o[u>>2]=o[a>>2];o[u+4>>2]=o[a+4>>2];ry(t,u,n,r);h=i;return}function ny(e){e=e|0;return(o[(zg()|0)+24>>2]|0)+(e*12|0)|0}function ry(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0;l=h;h=h+16|0;u=l+1|0;a=l;i=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)i=o[(o[e>>2]|0)+i>>2]|0;Ql(u,n);u=Jl(u,n)|0;iy(a,r);a=oy(a,r)|0;PA[i&15](e,u,a);h=l;return}function iy(e,t){e=e|0;t=t|0;return}function oy(e,t){e=e|0;t=t|0;return uy(t)|0}function uy(e){e=e|0;return(e|0)!=0|0}function ay(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0;u=o[e>>2]|0;i=ly()|0;e=sy(n)|0;La(u,t,i,e,cy(n,r)|0,r);return}function ly(){var e=0,t=0;if(!(r[7864]|0)){gy(10208);Fe(51,10208,g|0)|0;t=7864;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(10208)|0)){e=10208;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));gy(10208)}return 10208}function sy(e){e=e|0;return e|0}function cy(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;u=l+4|0;o[i>>2]=e;s=ly()|0;a=s+24|0;t=za(t,4)|0;o[u>>2]=t;n=s+28|0;r=o[n>>2]|0;if(r>>>0<(o[s+32>>2]|0)>>>0){fy(r,e,t);t=(o[n>>2]|0)+8|0;o[n>>2]=t}else{dy(a,i,u);t=o[n>>2]|0}h=l;return(t-(o[a>>2]|0)>>3)+-1|0}function fy(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;o[e+4>>2]=n;return}function dy(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;u=e+4|0;a=((o[u>>2]|0)-(o[e>>2]|0)>>3)+1|0;r=py(e)|0;if(r>>>0>>0)UT(e);else{s=o[e>>2]|0;f=(o[e+8>>2]|0)-s|0;c=f>>2;hy(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(o[u>>2]|0)-s>>3,e+8|0);a=i+8|0;fy(o[a>>2]|0,o[t>>2]|0,o[n>>2]|0);o[a>>2]=(o[a>>2]|0)+8;vy(e,i);my(i);h=l;return}}function py(e){e=e|0;return 536870911}function hy(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>536870911)Ye();else{i=$T(t<<3)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<3)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<3);return}function vy(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>3)<<3)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function my(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=o[e>>2]|0;if(e|0)KT(e);return}function gy(e){e=e|0;by(e);return}function yy(e){e=e|0;_y(e+24|0);return}function _y(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KT(n)}return}function by(e){e=e|0;var t=0;t=Za()|0;nl(e,1,24,t,wy()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function wy(){return 1392}function Ey(e,t){e=e|0;t=t|0;Sy(o[(Dy(e)|0)>>2]|0,t);return}function Dy(e){e=e|0;return(o[(ly()|0)+24>>2]|0)+(e<<3)|0}function Sy(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;hm(r,t);t=vm(r,t)|0;hA[e&127](t);h=n;return}function Cy(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0;u=o[e>>2]|0;i=ky()|0;e=Ty(n)|0;La(u,t,i,e,xy(n,r)|0,r);return}function ky(){var e=0,t=0;if(!(r[7872]|0)){Ry(10244);Fe(52,10244,g|0)|0;t=7872;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(10244)|0)){e=10244;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Ry(10244)}return 10244}function Ty(e){e=e|0;return e|0}function xy(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;u=l+4|0;o[i>>2]=e;s=ky()|0;a=s+24|0;t=za(t,4)|0;o[u>>2]=t;n=s+28|0;r=o[n>>2]|0;if(r>>>0<(o[s+32>>2]|0)>>>0){Ay(r,e,t);t=(o[n>>2]|0)+8|0;o[n>>2]=t}else{Oy(a,i,u);t=o[n>>2]|0}h=l;return(t-(o[a>>2]|0)>>3)+-1|0}function Ay(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;o[e+4>>2]=n;return}function Oy(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;u=e+4|0;a=((o[u>>2]|0)-(o[e>>2]|0)>>3)+1|0;r=Py(e)|0;if(r>>>0>>0)UT(e);else{s=o[e>>2]|0;f=(o[e+8>>2]|0)-s|0;c=f>>2;Iy(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(o[u>>2]|0)-s>>3,e+8|0);a=i+8|0;Ay(o[a>>2]|0,o[t>>2]|0,o[n>>2]|0);o[a>>2]=(o[a>>2]|0)+8;Ny(e,i);My(i);h=l;return}}function Py(e){e=e|0;return 536870911}function Iy(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>536870911)Ye();else{i=$T(t<<3)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<3)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<3);return}function Ny(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>3)<<3)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function My(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=o[e>>2]|0;if(e|0)KT(e);return}function Ry(e){e=e|0;By(e);return}function Fy(e){e=e|0;Ly(e+24|0);return}function Ly(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KT(n)}return}function By(e){e=e|0;var t=0;t=Za()|0;nl(e,1,16,t,jy()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function jy(){return 1400}function Uy(e){e=e|0;return Wy(o[(zy(e)|0)>>2]|0)|0}function zy(e){e=e|0;return(o[(ky()|0)+24>>2]|0)+(e<<3)|0}function Wy(e){e=e|0;return Hy(TA[e&7]()|0)|0}function Hy(e){e=e|0;return e|0}function Vy(){var e=0;if(!(r[7880]|0)){Qy(10280);Fe(25,10280,g|0)|0;e=7880;o[e>>2]=1;o[e+4>>2]=0}return 10280}function qy(e,t){e=e|0;t=t|0;o[e>>2]=Gy()|0;o[e+4>>2]=$y()|0;o[e+12>>2]=t;o[e+8>>2]=Yy()|0;o[e+32>>2]=4;return}function Gy(){return 11711}function $y(){return 1356}function Yy(){return Wm()|0}function Ky(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;if((Um(r,896)|0)==512){if(n|0){Xy(n);KT(n)}}else if(t|0){Hi(t);KT(t)}return}function Xy(e){e=e|0;e=o[e+4>>2]|0;if(e|0)qT(e);return}function Qy(e){e=e|0;Al(e);return}function Jy(e){e=e|0;Zy(e,4920);e_(e)|0;t_(e)|0;return}function Zy(e,t){e=e|0;t=t|0;var n=0;n=qd()|0;o[e>>2]=n;T_(n,t);cw(o[e>>2]|0);return}function e_(e){e=e|0;var t=0;t=o[e>>2]|0;r_(t,v_()|0);return e|0}function t_(e){e=e|0;var t=0;t=o[e>>2]|0;r_(t,n_()|0);return e|0}function n_(){var e=0;if(!(r[7888]|0)){i_(10328);Fe(53,10328,g|0)|0;e=7888;o[e>>2]=1;o[e+4>>2]=0}if(!(Xa(10328)|0))i_(10328);return 10328}function r_(e,t){e=e|0;t=t|0;La(e,0,t,0,0,0);return}function i_(e){e=e|0;a_(e);s_(e,10);return}function o_(e){e=e|0;u_(e+24|0);return}function u_(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KT(n)}return}function a_(e){e=e|0;var t=0;t=Za()|0;nl(e,5,1,t,d_()|0,2);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function l_(e,t,n){e=e|0;t=t|0;n=+n;c_(e,t,n);return}function s_(e,t){e=e|0;t=t|0;o[e+20>>2]=t;return}function c_(e,t,n){e=e|0;t=t|0;n=+n;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;u=r+8|0;l=r+13|0;i=r;a=r+12|0;Ql(l,t);o[u>>2]=Jl(l,t)|0;Kl(a,n);c[i>>3]=+Xl(a,n);f_(e,u,i);h=r;return}function f_(e,t,n){e=e|0;t=t|0;n=n|0;Vo(e+8|0,o[t>>2]|0,+c[n>>3]);r[e+24>>0]=1;return}function d_(){return 1404}function p_(e,t){e=e|0;t=+t;return h_(e,t)|0}function h_(e,t){e=e|0;t=+t;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;r=h;h=h+16|0;u=r+4|0;a=r+8|0;l=r;i=UD(8)|0;n=i;s=$T(16)|0;Ql(u,e);e=Jl(u,e)|0;Kl(a,t);Vo(s,e,+Xl(a,t));a=n+4|0;o[a>>2]=s;e=$T(8)|0;a=o[a>>2]|0;o[l>>2]=0;o[u>>2]=o[l>>2];Yd(e,a,u);o[i>>2]=e;h=r;return n|0}function v_(){var e=0;if(!(r[7896]|0)){m_(10364);Fe(54,10364,g|0)|0;e=7896;o[e>>2]=1;o[e+4>>2]=0}if(!(Xa(10364)|0))m_(10364);return 10364}function m_(e){e=e|0;__(e);s_(e,55);return}function g_(e){e=e|0;y_(e+24|0);return}function y_(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KT(n)}return}function __(e){e=e|0;var t=0;t=Za()|0;nl(e,5,4,t,S_()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function b_(e){e=e|0;w_(e);return}function w_(e){e=e|0;E_(e);return}function E_(e){e=e|0;D_(e+8|0);r[e+24>>0]=1;return}function D_(e){e=e|0;o[e>>2]=0;c[e+8>>3]=0.0;return}function S_(){return 1424}function C_(){return k_()|0}function k_(){var e=0,t=0,n=0,r=0,i=0,u=0,a=0;t=h;h=h+16|0;i=t+4|0;a=t;n=UD(8)|0;e=n;r=$T(16)|0;D_(r);u=e+4|0;o[u>>2]=r;r=$T(8)|0;u=o[u>>2]|0;o[a>>2]=0;o[i>>2]=o[a>>2];Yd(r,u,i);o[n>>2]=r;h=t;return e|0}function T_(e,t){e=e|0;t=t|0;o[e>>2]=x_()|0;o[e+4>>2]=A_()|0;o[e+12>>2]=t;o[e+8>>2]=O_()|0;o[e+32>>2]=5;return}function x_(){return 11710}function A_(){return 1416}function O_(){return N_()|0}function P_(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;if((Um(r,896)|0)==512){if(n|0){I_(n);KT(n)}}else if(t|0)KT(t);return}function I_(e){e=e|0;e=o[e+4>>2]|0;if(e|0)qT(e);return}function N_(){var e=0;if(!(r[7904]|0)){o[2600]=M_()|0;o[2601]=0;e=7904;o[e>>2]=1;o[e+4>>2]=0}return 10400}function M_(){return o[357]|0}function R_(e){e=e|0;F_(e,4926);L_(e)|0;return}function F_(e,t){e=e|0;t=t|0;var n=0;n=ul()|0;o[e>>2]=n;K_(n,t);cw(o[e>>2]|0);return}function L_(e){e=e|0;var t=0;t=o[e>>2]|0;r_(t,B_()|0);return e|0}function B_(){var e=0;if(!(r[7912]|0)){j_(10412);Fe(56,10412,g|0)|0;e=7912;o[e>>2]=1;o[e+4>>2]=0}if(!(Xa(10412)|0))j_(10412);return 10412}function j_(e){e=e|0;W_(e);s_(e,57);return}function U_(e){e=e|0;z_(e+24|0);return}function z_(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KT(n)}return}function W_(e){e=e|0;var t=0;t=Za()|0;nl(e,5,5,t,G_()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function H_(e){e=e|0;V_(e);return}function V_(e){e=e|0;q_(e);return}function q_(e){e=e|0;var t=0,n=0;t=e+8|0;n=t+48|0;do{o[t>>2]=0;t=t+4|0}while((t|0)<(n|0));r[e+56>>0]=1;return}function G_(){return 1432}function $_(){return Y_()|0}function Y_(){var e=0,t=0,n=0,r=0,i=0,u=0,a=0,l=0;a=h;h=h+16|0;e=a+4|0;t=a;n=UD(8)|0;r=n;i=$T(48)|0;u=i;l=u+48|0;do{o[u>>2]=0;u=u+4|0}while((u|0)<(l|0));u=r+4|0;o[u>>2]=i;l=$T(8)|0;u=o[u>>2]|0;o[t>>2]=0;o[e>>2]=o[t>>2];pl(l,u,e);o[n>>2]=l;h=a;return r|0}function K_(e,t){e=e|0;t=t|0;o[e>>2]=X_()|0;o[e+4>>2]=Q_()|0;o[e+12>>2]=t;o[e+8>>2]=J_()|0;o[e+32>>2]=6;return}function X_(){return 11704}function Q_(){return 1436}function J_(){return N_()|0}function Z_(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;if((Um(r,896)|0)==512){if(n|0){eb(n);KT(n)}}else if(t|0)KT(t);return}function eb(e){e=e|0;e=o[e+4>>2]|0;if(e|0)qT(e);return}function tb(e){e=e|0;nb(e,4933);rb(e)|0;ib(e)|0;return}function nb(e,t){e=e|0;t=t|0;var n=0;n=Nb()|0;o[e>>2]=n;Mb(n,t);cw(o[e>>2]|0);return}function rb(e){e=e|0;var t=0;t=o[e>>2]|0;r_(t,wb()|0);return e|0}function ib(e){e=e|0;var t=0;t=o[e>>2]|0;r_(t,ob()|0);return e|0}function ob(){var e=0;if(!(r[7920]|0)){ub(10452);Fe(58,10452,g|0)|0;e=7920;o[e>>2]=1;o[e+4>>2]=0}if(!(Xa(10452)|0))ub(10452);return 10452}function ub(e){e=e|0;sb(e);s_(e,1);return}function ab(e){e=e|0;lb(e+24|0);return}function lb(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KT(n)}return}function sb(e){e=e|0;var t=0;t=Za()|0;nl(e,5,1,t,hb()|0,2);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function cb(e,t,n){e=e|0;t=+t;n=+n;fb(e,t,n);return}function fb(e,t,n){e=e|0;t=+t;n=+n;var r=0,i=0,o=0,u=0,a=0;r=h;h=h+32|0;o=r+8|0;a=r+17|0;i=r;u=r+16|0;Kl(a,t);c[o>>3]=+Xl(a,t);Kl(u,n);c[i>>3]=+Xl(u,n);db(e,o,i);h=r;return}function db(e,t,n){e=e|0;t=t|0;n=n|0;pb(e+8|0,+c[t>>3],+c[n>>3]);r[e+24>>0]=1;return}function pb(e,t,n){e=e|0;t=+t;n=+n;c[e>>3]=t;c[e+8>>3]=n;return}function hb(){return 1472}function vb(e,t){e=+e;t=+t;return mb(e,t)|0}function mb(e,t){e=+e;t=+t;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;r=h;h=h+16|0;a=r+4|0;l=r+8|0;s=r;i=UD(8)|0;n=i;u=$T(16)|0;Kl(a,e);e=+Xl(a,e);Kl(l,t);pb(u,e,+Xl(l,t));l=n+4|0;o[l>>2]=u;u=$T(8)|0;l=o[l>>2]|0;o[s>>2]=0;o[a>>2]=o[s>>2];gb(u,l,a);o[i>>2]=u;h=r;return n|0}function gb(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;n=$T(16)|0;o[n+4>>2]=0;o[n+8>>2]=0;o[n>>2]=1452;o[n+12>>2]=t;o[e+4>>2]=n;return}function yb(e){e=e|0;zT(e);KT(e);return}function _b(e){e=e|0;e=o[e+12>>2]|0;if(e|0)KT(e);return}function bb(e){e=e|0;KT(e);return}function wb(){var e=0;if(!(r[7928]|0)){Eb(10488);Fe(59,10488,g|0)|0;e=7928;o[e>>2]=1;o[e+4>>2]=0}if(!(Xa(10488)|0))Eb(10488);return 10488}function Eb(e){e=e|0;Cb(e);s_(e,60);return}function Db(e){e=e|0;Sb(e+24|0);return}function Sb(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KT(n)}return}function Cb(e){e=e|0;var t=0;t=Za()|0;nl(e,5,6,t,Ob()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function kb(e){e=e|0;Tb(e);return}function Tb(e){e=e|0;xb(e);return}function xb(e){e=e|0;Ab(e+8|0);r[e+24>>0]=1;return}function Ab(e){e=e|0;o[e>>2]=0;o[e+4>>2]=0;o[e+8>>2]=0;o[e+12>>2]=0;return}function Ob(){return 1492}function Pb(){return Ib()|0}function Ib(){var e=0,t=0,n=0,r=0,i=0,u=0,a=0;t=h;h=h+16|0;i=t+4|0;a=t;n=UD(8)|0;e=n;r=$T(16)|0;Ab(r);u=e+4|0;o[u>>2]=r;r=$T(8)|0;u=o[u>>2]|0;o[a>>2]=0;o[i>>2]=o[a>>2];gb(r,u,i);o[n>>2]=r;h=t;return e|0}function Nb(){var e=0;if(!(r[7936]|0)){Ub(10524);Fe(25,10524,g|0)|0;e=7936;o[e>>2]=1;o[e+4>>2]=0}return 10524}function Mb(e,t){e=e|0;t=t|0;o[e>>2]=Rb()|0;o[e+4>>2]=Fb()|0;o[e+12>>2]=t;o[e+8>>2]=Lb()|0;o[e+32>>2]=7;return}function Rb(){return 11700}function Fb(){return 1484}function Lb(){return N_()|0}function Bb(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;if((Um(r,896)|0)==512){if(n|0){jb(n);KT(n)}}else if(t|0)KT(t);return}function jb(e){e=e|0;e=o[e+4>>2]|0;if(e|0)qT(e);return}function Ub(e){e=e|0;Al(e);return}function zb(e,t,n){e=e|0;t=t|0;n=n|0;e=Ia(t)|0;t=Wb(n)|0;n=Hb(n,0)|0;xw(e,t,n,Vb()|0,0);return}function Wb(e){e=e|0;return e|0}function Hb(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;u=l+4|0;o[i>>2]=e;s=Vb()|0;a=s+24|0;t=za(t,4)|0;o[u>>2]=t;n=s+28|0;r=o[n>>2]|0;if(r>>>0<(o[s+32>>2]|0)>>>0){Jb(r,e,t);t=(o[n>>2]|0)+8|0;o[n>>2]=t}else{Zb(a,i,u);t=o[n>>2]|0}h=l;return(t-(o[a>>2]|0)>>3)+-1|0}function Vb(){var e=0,t=0;if(!(r[7944]|0)){qb(10568);Fe(61,10568,g|0)|0;t=7944;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(10568)|0)){e=10568;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));qb(10568)}return 10568}function qb(e){e=e|0;Yb(e);return}function Gb(e){e=e|0;$b(e+24|0);return}function $b(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KT(n)}return}function Yb(e){e=e|0;var t=0;t=Za()|0;nl(e,1,17,t,Yc()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Kb(e){e=e|0;return Qb(o[(Xb(e)|0)>>2]|0)|0}function Xb(e){e=e|0;return(o[(Vb()|0)+24>>2]|0)+(e<<3)|0}function Qb(e){e=e|0;return Jc(TA[e&7]()|0)|0}function Jb(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;o[e+4>>2]=n;return}function Zb(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;u=e+4|0;a=((o[u>>2]|0)-(o[e>>2]|0)>>3)+1|0;r=ew(e)|0;if(r>>>0>>0)UT(e);else{s=o[e>>2]|0;f=(o[e+8>>2]|0)-s|0;c=f>>2;tw(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(o[u>>2]|0)-s>>3,e+8|0);a=i+8|0;Jb(o[a>>2]|0,o[t>>2]|0,o[n>>2]|0);o[a>>2]=(o[a>>2]|0)+8;nw(e,i);rw(i);h=l;return}}function ew(e){e=e|0;return 536870911}function tw(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>536870911)Ye();else{i=$T(t<<3)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<3)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<3);return}function nw(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>3)<<3)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function rw(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=o[e>>2]|0;if(e|0)KT(e);return}function iw(){ow();return}function ow(){uw(10604);return}function uw(e){e=e|0;aw(e,4955);return}function aw(e,t){e=e|0;t=t|0;var n=0;n=lw()|0;o[e>>2]=n;sw(n,t);cw(o[e>>2]|0);return}function lw(){var e=0;if(!(r[7952]|0)){bw(10612);Fe(25,10612,g|0)|0;e=7952;o[e>>2]=1;o[e+4>>2]=0}return 10612}function sw(e,t){e=e|0;t=t|0;o[e>>2]=vw()|0;o[e+4>>2]=mw()|0;o[e+12>>2]=t;o[e+8>>2]=gw()|0;o[e+32>>2]=8;return}function cw(e){e=e|0;var t=0,n=0;t=h;h=h+16|0;n=t;fw()|0;o[n>>2]=e;dw(10608,n);h=t;return}function fw(){if(!(r[11714]|0)){o[2652]=0;Fe(62,10608,g|0)|0;r[11714]=1}return 10608}function dw(e,t){e=e|0;t=t|0;var n=0;n=$T(8)|0;o[n+4>>2]=o[t>>2];o[n>>2]=o[e>>2];o[e>>2]=n;return}function pw(e){e=e|0;hw(e);return}function hw(e){e=e|0;var t=0,n=0;t=o[e>>2]|0;if(t|0)do{n=t;t=o[t>>2]|0;KT(n)}while((t|0)!=0);o[e>>2]=0;return}function vw(){return 11715}function mw(){return 1496}function gw(){return Wm()|0}function yw(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;if((Um(r,896)|0)==512){if(n|0){_w(n);KT(n)}}else if(t|0)KT(t);return}function _w(e){e=e|0;e=o[e+4>>2]|0;if(e|0)qT(e);return}function bw(e){e=e|0;Al(e);return}function ww(e,t){e=e|0;t=t|0;var n=0,r=0;fw()|0;n=o[2652]|0;e:do{if(n|0){while(1){r=o[n+4>>2]|0;if(r|0?(rT(Ew(r)|0,e)|0)==0:0)break;n=o[n>>2]|0;if(!n)break e}Dw(r,t)}}while(0);return}function Ew(e){e=e|0;return o[e+12>>2]|0}function Dw(e,t){e=e|0;t=t|0;var n=0;e=e+36|0;n=o[e>>2]|0;if(n|0){Ji(n);KT(n)}n=$T(4)|0;yu(n,t);o[e>>2]=n;return}function Sw(){if(!(r[11716]|0)){o[2664]=0;Fe(63,10656,g|0)|0;r[11716]=1}return 10656}function Cw(){var e=0;if(!(r[11717]|0)){kw();o[2665]=1504;r[11717]=1;e=1504}else e=o[2665]|0;return e|0}function kw(){if(!(r[11740]|0)){r[11718]=za(za(8,0)|0,0)|0;r[11719]=za(za(0,0)|0,0)|0;r[11720]=za(za(0,16)|0,0)|0;r[11721]=za(za(8,0)|0,0)|0;r[11722]=za(za(0,0)|0,0)|0;r[11723]=za(za(8,0)|0,0)|0;r[11724]=za(za(0,0)|0,0)|0;r[11725]=za(za(8,0)|0,0)|0;r[11726]=za(za(0,0)|0,0)|0;r[11727]=za(za(8,0)|0,0)|0;r[11728]=za(za(0,0)|0,0)|0;r[11729]=za(za(0,0)|0,32)|0;r[11730]=za(za(0,0)|0,32)|0;r[11740]=1}return}function Tw(){return 1572}function xw(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;var u=0,a=0,l=0,s=0,c=0,f=0;u=h;h=h+32|0;f=u+16|0;c=u+12|0;s=u+8|0;l=u+4|0;a=u;o[f>>2]=e;o[c>>2]=t;o[s>>2]=n;o[l>>2]=r;o[a>>2]=i;Sw()|0;Aw(10656,f,c,s,l,a);h=u;return}function Aw(e,t,n,r,i,u){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;u=u|0;var a=0;a=$T(24)|0;Ua(a+4|0,o[t>>2]|0,o[n>>2]|0,o[r>>2]|0,o[i>>2]|0,o[u>>2]|0);o[a>>2]=o[e>>2];o[e>>2]=a;return}function Ow(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,v=0,m=0,g=0,y=0,_=0,b=0;b=h;h=h+32|0;m=b+20|0;g=b+8|0;y=b+4|0;_=b;t=o[t>>2]|0;if(t|0){v=m+4|0;s=m+8|0;c=g+4|0;f=g+8|0;d=g+8|0;p=m+8|0;do{a=t+4|0;l=Pw(a)|0;if(l|0){i=Iw(l)|0;o[m>>2]=0;o[v>>2]=0;o[s>>2]=0;r=(Nw(l)|0)+1|0;Mw(m,r);if(r|0)while(1){r=r+-1|0;gk(g,o[i>>2]|0);u=o[v>>2]|0;if(u>>>0<(o[p>>2]|0)>>>0){o[u>>2]=o[g>>2];o[v>>2]=(o[v>>2]|0)+4}else Rw(m,g);if(!r)break;else i=i+4|0}r=Fw(l)|0;o[g>>2]=0;o[c>>2]=0;o[f>>2]=0;e:do{if(o[r>>2]|0){i=0;u=0;while(1){if((i|0)==(u|0))Lw(g,r);else{o[i>>2]=o[r>>2];o[c>>2]=(o[c>>2]|0)+4}r=r+4|0;if(!(o[r>>2]|0))break e;i=o[c>>2]|0;u=o[d>>2]|0}}}while(0);o[y>>2]=Bw(a)|0;o[_>>2]=Xa(l)|0;jw(n,e,y,_,m,g);Uw(g);zw(m)}t=o[t>>2]|0}while((t|0)!=0)}h=b;return}function Pw(e){e=e|0;return o[e+12>>2]|0}function Iw(e){e=e|0;return o[e+12>>2]|0}function Nw(e){e=e|0;return o[e+16>>2]|0}function Mw(e,t){e=e|0;t=t|0;var n=0,r=0,i=0;i=h;h=h+32|0;n=i;r=o[e>>2]|0;if((o[e+8>>2]|0)-r>>2>>>0>>0){bE(n,t,(o[e+4>>2]|0)-r>>2,e+8|0);wE(e,n);EE(n)}h=i;return}function Rw(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0;a=h;h=h+32|0;n=a;r=e+4|0;i=((o[r>>2]|0)-(o[e>>2]|0)>>2)+1|0;u=mE(e)|0;if(u>>>0>>0)UT(e);else{l=o[e>>2]|0;c=(o[e+8>>2]|0)-l|0;s=c>>1;bE(n,c>>2>>>0>>1>>>0?s>>>0>>0?i:s:u,(o[r>>2]|0)-l>>2,e+8|0);u=n+8|0;o[o[u>>2]>>2]=o[t>>2];o[u>>2]=(o[u>>2]|0)+4;wE(e,n);EE(n);h=a;return}}function Fw(e){e=e|0;return o[e+8>>2]|0}function Lw(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0;a=h;h=h+32|0;n=a;r=e+4|0;i=((o[r>>2]|0)-(o[e>>2]|0)>>2)+1|0;u=pE(e)|0;if(u>>>0>>0)UT(e);else{l=o[e>>2]|0;c=(o[e+8>>2]|0)-l|0;s=c>>1;gE(n,c>>2>>>0>>1>>>0?s>>>0>>0?i:s:u,(o[r>>2]|0)-l>>2,e+8|0);u=n+8|0;o[o[u>>2]>>2]=o[t>>2];o[u>>2]=(o[u>>2]|0)+4;yE(e,n);_E(n);h=a;return}}function Bw(e){e=e|0;return o[e>>2]|0}function jw(e,t,n,r,i,o){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;o=o|0;Ww(e,t,n,r,i,o);return}function Uw(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-4-r|0)>>>2)<<2);KT(n)}return}function zw(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-4-r|0)>>>2)<<2);KT(n)}return}function Ww(e,t,n,r,i,u){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;u=u|0;var a=0,l=0,s=0,c=0,f=0,d=0;a=h;h=h+48|0;f=a+40|0;l=a+32|0;d=a+24|0;s=a+12|0;c=a;Dk(l);e=Eu(e)|0;o[d>>2]=o[t>>2];n=o[n>>2]|0;r=o[r>>2]|0;Hw(s,i);Vw(c,u);o[f>>2]=o[d>>2];qw(e,f,n,r,s,c);Uw(c);zw(s);Ck(l);h=a;return}function Hw(e,t){e=e|0;t=t|0;var n=0,r=0;o[e>>2]=0;o[e+4>>2]=0;o[e+8>>2]=0;n=t+4|0;r=(o[n>>2]|0)-(o[t>>2]|0)>>2;if(r|0){hE(e,r);vE(e,o[t>>2]|0,o[n>>2]|0,r)}return}function Vw(e,t){e=e|0;t=t|0;var n=0,r=0;o[e>>2]=0;o[e+4>>2]=0;o[e+8>>2]=0;n=t+4|0;r=(o[n>>2]|0)-(o[t>>2]|0)>>2;if(r|0){fE(e,r);dE(e,o[t>>2]|0,o[n>>2]|0,r)}return}function qw(e,t,n,r,i,u){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;u=u|0;var a=0,l=0,s=0,c=0,f=0,d=0;a=h;h=h+32|0;f=a+28|0;d=a+24|0;l=a+12|0;s=a;c=Cu(Gw()|0)|0;o[d>>2]=o[t>>2];o[f>>2]=o[d>>2];t=$w(f)|0;n=Yw(n)|0;r=Kw(r)|0;o[l>>2]=o[i>>2];f=i+4|0;o[l+4>>2]=o[f>>2];d=i+8|0;o[l+8>>2]=o[d>>2];o[d>>2]=0;o[f>>2]=0;o[i>>2]=0;i=Xw(l)|0;o[s>>2]=o[u>>2];f=u+4|0;o[s+4>>2]=o[f>>2];d=u+8|0;o[s+8>>2]=o[d>>2];o[d>>2]=0;o[f>>2]=0;o[u>>2]=0;Oe(0,c|0,e|0,t|0,n|0,r|0,i|0,Qw(s)|0)|0;Uw(s);zw(l);h=a;return}function Gw(){var e=0;if(!(r[7968]|0)){sE(10708);e=7968;o[e>>2]=1;o[e+4>>2]=0}return 10708}function $w(e){e=e|0;return tE(e)|0}function Yw(e){e=e|0;return Zw(e)|0}function Kw(e){e=e|0;return Jc(e)|0}function Xw(e){e=e|0;return eE(e)|0}function Qw(e){e=e|0;return Jw(e)|0}function Jw(e){e=e|0;var t=0,n=0,r=0;r=(o[e+4>>2]|0)-(o[e>>2]|0)|0;n=r>>2;r=UD(r+4|0)|0;o[r>>2]=n;if(n|0){t=0;do{o[r+4+(t<<2)>>2]=Zw(o[(o[e>>2]|0)+(t<<2)>>2]|0)|0;t=t+1|0}while((t|0)!=(n|0))}return r|0}function Zw(e){e=e|0;return e|0}function eE(e){e=e|0;var t=0,n=0,r=0;r=(o[e+4>>2]|0)-(o[e>>2]|0)|0;n=r>>2;r=UD(r+4|0)|0;o[r>>2]=n;if(n|0){t=0;do{o[r+4+(t<<2)>>2]=tE((o[e>>2]|0)+(t<<2)|0)|0;t=t+1|0}while((t|0)!=(n|0))}return r|0}function tE(e){e=e|0;var t=0,n=0,r=0,i=0;i=h;h=h+32|0;t=i+12|0;n=i;r=al(nE()|0)|0;if(!r)e=rE(e)|0;else{ll(t,r);sl(n,t);bk(e,n);e=fl(t)|0}h=i;return e|0}function nE(){var e=0;if(!(r[7960]|0)){lE(10664);Fe(25,10664,g|0)|0;e=7960;o[e>>2]=1;o[e+4>>2]=0}return 10664}function rE(e){e=e|0;var t=0,n=0,r=0,i=0,u=0,a=0,l=0;n=h;h=h+16|0;i=n+4|0;a=n;r=UD(8)|0;t=r;l=$T(4)|0;o[l>>2]=o[e>>2];u=t+4|0;o[u>>2]=l;e=$T(8)|0;u=o[u>>2]|0;o[a>>2]=0;o[i>>2]=o[a>>2];iE(e,u,i);o[r>>2]=e;h=n;return t|0}function iE(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;n=$T(16)|0;o[n+4>>2]=0;o[n+8>>2]=0;o[n>>2]=1656;o[n+12>>2]=t;o[e+4>>2]=n;return}function oE(e){e=e|0;zT(e);KT(e);return}function uE(e){e=e|0;e=o[e+12>>2]|0;if(e|0)KT(e);return}function aE(e){e=e|0;KT(e);return}function lE(e){e=e|0;Al(e);return}function sE(e){e=e|0;Lu(e,cE()|0,5);return}function cE(){return 1676}function fE(e,t){e=e|0;t=t|0;var n=0;if((pE(e)|0)>>>0>>0)UT(e);if(t>>>0>1073741823)Ye();else{n=$T(t<<2)|0;o[e+4>>2]=n;o[e>>2]=n;o[e+8>>2]=n+(t<<2);return}}function dE(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;r=e+4|0;e=n-t|0;if((e|0)>0){ix(o[r>>2]|0,t|0,e|0)|0;o[r>>2]=(o[r>>2]|0)+(e>>>2<<2)}return}function pE(e){e=e|0;return 1073741823}function hE(e,t){e=e|0;t=t|0;var n=0;if((mE(e)|0)>>>0>>0)UT(e);if(t>>>0>1073741823)Ye();else{n=$T(t<<2)|0;o[e+4>>2]=n;o[e>>2]=n;o[e+8>>2]=n+(t<<2);return}}function vE(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;r=e+4|0;e=n-t|0;if((e|0)>0){ix(o[r>>2]|0,t|0,e|0)|0;o[r>>2]=(o[r>>2]|0)+(e>>>2<<2)}return}function mE(e){e=e|0;return 1073741823}function gE(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>1073741823)Ye();else{i=$T(t<<2)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<2)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<2);return}function yE(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>2)<<2)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function _E(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-4-t|0)>>>2)<<2);e=o[e>>2]|0;if(e|0)KT(e);return}function bE(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>1073741823)Ye();else{i=$T(t<<2)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<2)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<2);return}function wE(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>2)<<2)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function EE(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-4-t|0)>>>2)<<2);e=o[e>>2]|0;if(e|0)KT(e);return}function DE(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;var u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,v=0,m=0,g=0;g=h;h=h+32|0;f=g+20|0;d=g+12|0;c=g+16|0;p=g+4|0;v=g;m=g+8|0;l=Cw()|0;u=o[l>>2]|0;a=o[u>>2]|0;if(a|0){s=o[l+8>>2]|0;l=o[l+4>>2]|0;while(1){gk(f,a);SE(e,f,l,s);u=u+4|0;a=o[u>>2]|0;if(!a)break;else{s=s+1|0;l=l+1|0}}}u=Tw()|0;a=o[u>>2]|0;if(a|0)do{gk(f,a);o[d>>2]=o[u+4>>2];CE(t,f,d);u=u+8|0;a=o[u>>2]|0}while((a|0)!=0);u=o[(fw()|0)>>2]|0;if(u|0)do{t=o[u+4>>2]|0;gk(f,o[(kE(t)|0)>>2]|0);o[d>>2]=Ew(t)|0;TE(n,f,d);u=o[u>>2]|0}while((u|0)!=0);gk(c,0);u=Sw()|0;o[f>>2]=o[c>>2];Ow(f,u,i);u=o[(fw()|0)>>2]|0;if(u|0){e=f+4|0;t=f+8|0;n=f+8|0;do{s=o[u+4>>2]|0;gk(d,o[(kE(s)|0)>>2]|0);AE(p,xE(s)|0);a=o[p>>2]|0;if(a|0){o[f>>2]=0;o[e>>2]=0;o[t>>2]=0;do{gk(v,o[(kE(o[a+4>>2]|0)|0)>>2]|0);l=o[e>>2]|0;if(l>>>0<(o[n>>2]|0)>>>0){o[l>>2]=o[v>>2];o[e>>2]=(o[e>>2]|0)+4}else Rw(f,v);a=o[a>>2]|0}while((a|0)!=0);OE(r,d,f);zw(f)}o[m>>2]=o[d>>2];c=PE(s)|0;o[f>>2]=o[m>>2];Ow(f,c,i);kl(p);u=o[u>>2]|0}while((u|0)!=0)}h=g;return}function SE(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;qE(e,t,n,r);return}function CE(e,t,n){e=e|0;t=t|0;n=n|0;VE(e,t,n);return}function kE(e){e=e|0;return e|0}function TE(e,t,n){e=e|0;t=t|0;n=n|0;jE(e,t,n);return}function xE(e){e=e|0;return e+16|0}function AE(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;u=h;h=h+16|0;i=u+8|0;n=u;o[e>>2]=0;r=o[t>>2]|0;o[i>>2]=r;o[n>>2]=e;n=LE(n)|0;if(r|0){r=$T(12)|0;a=(BE(i)|0)+4|0;e=o[a+4>>2]|0;t=r+4|0;o[t>>2]=o[a>>2];o[t+4>>2]=e;t=o[o[i>>2]>>2]|0;o[i>>2]=t;if(!t)e=r;else{t=r;while(1){e=$T(12)|0;s=(BE(i)|0)+4|0;l=o[s+4>>2]|0;a=e+4|0;o[a>>2]=o[s>>2];o[a+4>>2]=l;o[t>>2]=e;a=o[o[i>>2]>>2]|0;o[i>>2]=a;if(!a)break;else t=e}}o[e>>2]=o[n>>2];o[n>>2]=r}h=u;return}function OE(e,t,n){e=e|0;t=t|0;n=n|0;IE(e,t,n);return}function PE(e){e=e|0;return e+24|0}function IE(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+32|0;a=r+24|0;i=r+16|0;l=r+12|0;u=r;Dk(i);e=Eu(e)|0;o[l>>2]=o[t>>2];Hw(u,n);o[a>>2]=o[l>>2];NE(e,a,u);zw(u);Ck(i);h=r;return}function NE(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+32|0;a=r+16|0;l=r+12|0;i=r;u=Cu(ME()|0)|0;o[l>>2]=o[t>>2];o[a>>2]=o[l>>2];t=$w(a)|0;o[i>>2]=o[n>>2];a=n+4|0;o[i+4>>2]=o[a>>2];l=n+8|0;o[i+8>>2]=o[l>>2];o[l>>2]=0;o[a>>2]=0;o[n>>2]=0;ke(0,u|0,e|0,t|0,Xw(i)|0)|0;zw(i);h=r;return}function ME(){var e=0;if(!(r[7976]|0)){RE(10720);e=7976;o[e>>2]=1;o[e+4>>2]=0}return 10720}function RE(e){e=e|0;Lu(e,FE()|0,2);return}function FE(){return 1732}function LE(e){e=e|0;return o[e>>2]|0}function BE(e){e=e|0;return o[e>>2]|0}function jE(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+32|0;u=r+16|0;i=r+8|0;a=r;Dk(i);e=Eu(e)|0;o[a>>2]=o[t>>2];n=o[n>>2]|0;o[u>>2]=o[a>>2];UE(e,u,n);Ck(i);h=r;return}function UE(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;u=r+4|0;a=r;i=Cu(zE()|0)|0;o[a>>2]=o[t>>2];o[u>>2]=o[a>>2];t=$w(u)|0;ke(0,i|0,e|0,t|0,Yw(n)|0)|0;h=r;return}function zE(){var e=0;if(!(r[7984]|0)){WE(10732);e=7984;o[e>>2]=1;o[e+4>>2]=0}return 10732}function WE(e){e=e|0;Lu(e,HE()|0,2);return}function HE(){return 1744}function VE(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+32|0;u=r+16|0;i=r+8|0;a=r;Dk(i);e=Eu(e)|0;o[a>>2]=o[t>>2];n=o[n>>2]|0;o[u>>2]=o[a>>2];UE(e,u,n);Ck(i);h=r;return}function qE(e,t,n,i){e=e|0;t=t|0;n=n|0;i=i|0;var u=0,a=0,l=0,s=0;u=h;h=h+32|0;l=u+16|0;a=u+8|0;s=u;Dk(a);e=Eu(e)|0;o[s>>2]=o[t>>2];n=r[n>>0]|0;i=r[i>>0]|0;o[l>>2]=o[s>>2];GE(e,l,n,i);Ck(a);h=u;return}function GE(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0;i=h;h=h+16|0;a=i+4|0;l=i;u=Cu($E()|0)|0;o[l>>2]=o[t>>2];o[a>>2]=o[l>>2];t=$w(a)|0;n=YE(n)|0;nt(0,u|0,e|0,t|0,n|0,YE(r)|0)|0;h=i;return}function $E(){var e=0;if(!(r[7992]|0)){XE(10744);e=7992;o[e>>2]=1;o[e+4>>2]=0}return 10744}function YE(e){e=e|0;return KE(e)|0}function KE(e){e=e|0;return e&255|0}function XE(e){e=e|0;Lu(e,QE()|0,3);return}function QE(){return 1756}function JE(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,v=0;v=h;h=h+32|0;s=v+8|0;c=v+4|0;f=v+20|0;d=v;Vs(e,0);i=_k(t)|0;o[s>>2]=0;p=s+4|0;o[p>>2]=0;o[s+8>>2]=0;switch(i<<24>>24){case 0:{r[f>>0]=0;ZE(c,n,f);eD(e,c)|0;Zi(c);break}case 8:{p=yk(t)|0;r[f>>0]=8;gk(d,o[p+4>>2]|0);tD(c,n,f,d,p+8|0);eD(e,c)|0;Zi(c);break}case 9:{a=yk(t)|0;t=o[a+4>>2]|0;if(t|0){l=s+8|0;u=a+12|0;while(1){t=t+-1|0;gk(c,o[u>>2]|0);i=o[p>>2]|0;if(i>>>0<(o[l>>2]|0)>>>0){o[i>>2]=o[c>>2];o[p>>2]=(o[p>>2]|0)+4}else Rw(s,c);if(!t)break;else u=u+4|0}}r[f>>0]=9;gk(d,o[a+8>>2]|0);nD(c,n,f,d,s);eD(e,c)|0;Zi(c);break}default:{p=yk(t)|0;r[f>>0]=i;gk(d,o[p+4>>2]|0);rD(c,n,f,d);eD(e,c)|0;Zi(c)}}zw(s);h=v;return}function ZE(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,o=0;i=h;h=h+16|0;o=i;Dk(o);t=Eu(t)|0;gD(e,t,r[n>>0]|0);Ck(o);h=i;return}function eD(e,t){e=e|0;t=t|0;var n=0;n=o[e>>2]|0;if(n|0)rt(n|0);o[e>>2]=o[t>>2];o[t>>2]=0;return e|0}function tD(e,t,n,i,u){e=e|0;t=t|0;n=n|0;i=i|0;u=u|0;var a=0,l=0,s=0,c=0;a=h;h=h+32|0;s=a+16|0;l=a+8|0;c=a;Dk(l);t=Eu(t)|0;n=r[n>>0]|0;o[c>>2]=o[i>>2];u=o[u>>2]|0;o[s>>2]=o[c>>2];pD(e,t,n,s,u);Ck(l);h=a;return}function nD(e,t,n,i,u){e=e|0;t=t|0;n=n|0;i=i|0;u=u|0;var a=0,l=0,s=0,c=0,f=0;a=h;h=h+32|0;c=a+24|0;l=a+16|0;f=a+12|0;s=a;Dk(l);t=Eu(t)|0;n=r[n>>0]|0;o[f>>2]=o[i>>2];Hw(s,u);o[c>>2]=o[f>>2];sD(e,t,n,c,s);zw(s);Ck(l);h=a;return}function rD(e,t,n,i){e=e|0;t=t|0;n=n|0;i=i|0;var u=0,a=0,l=0,s=0;u=h;h=h+32|0;l=u+16|0;a=u+8|0;s=u;Dk(a);t=Eu(t)|0;n=r[n>>0]|0;o[s>>2]=o[i>>2];o[l>>2]=o[s>>2];iD(e,t,n,l);Ck(a);h=u;return}function iD(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0;i=h;h=h+16|0;u=i+4|0;l=i;a=Cu(oD()|0)|0;n=YE(n)|0;o[l>>2]=o[r>>2];o[u>>2]=o[l>>2];uD(e,ke(0,a|0,t|0,n|0,$w(u)|0)|0);h=i;return}function oD(){var e=0;if(!(r[8e3]|0)){aD(10756);e=8e3;o[e>>2]=1;o[e+4>>2]=0}return 10756}function uD(e,t){e=e|0;t=t|0;Vs(e,t);return}function aD(e){e=e|0;Lu(e,lD()|0,2);return}function lD(){return 1772}function sD(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;var u=0,a=0,l=0,s=0,c=0;u=h;h=h+32|0;s=u+16|0;c=u+12|0;a=u;l=Cu(cD()|0)|0;n=YE(n)|0;o[c>>2]=o[r>>2];o[s>>2]=o[c>>2];r=$w(s)|0;o[a>>2]=o[i>>2];s=i+4|0;o[a+4>>2]=o[s>>2];c=i+8|0;o[a+8>>2]=o[c>>2];o[c>>2]=0;o[s>>2]=0;o[i>>2]=0;uD(e,nt(0,l|0,t|0,n|0,r|0,Xw(a)|0)|0);zw(a);h=u;return}function cD(){var e=0;if(!(r[8008]|0)){fD(10768);e=8008;o[e>>2]=1;o[e+4>>2]=0}return 10768}function fD(e){e=e|0;Lu(e,dD()|0,3);return}function dD(){return 1784}function pD(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;var u=0,a=0,l=0,s=0;u=h;h=h+16|0;l=u+4|0;s=u;a=Cu(hD()|0)|0;n=YE(n)|0;o[s>>2]=o[r>>2];o[l>>2]=o[s>>2];r=$w(l)|0;uD(e,nt(0,a|0,t|0,n|0,r|0,Kw(i)|0)|0);h=u;return}function hD(){var e=0;if(!(r[8016]|0)){vD(10780);e=8016;o[e>>2]=1;o[e+4>>2]=0}return 10780}function vD(e){e=e|0;Lu(e,mD()|0,3);return}function mD(){return 1800}function gD(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=Cu(yD()|0)|0;uD(e,it(0,r|0,t|0,YE(n)|0)|0);return}function yD(){var e=0;if(!(r[8024]|0)){_D(10792);e=8024;o[e>>2]=1;o[e+4>>2]=0}return 10792}function _D(e){e=e|0;Lu(e,bD()|0,1);return}function bD(){return 1816}function wD(){ED();DD();SD();return}function ED(){o[2702]=YT(65536)|0;return}function DD(){$D(10856);return}function SD(){CD(10816);return}function CD(e){e=e|0;kD(e,5044);TD(e)|0;return}function kD(e,t){e=e|0;t=t|0;var n=0;n=nE()|0;o[e>>2]=n;zD(n,t);cw(o[e>>2]|0);return}function TD(e){e=e|0;var t=0;t=o[e>>2]|0;r_(t,xD()|0);return e|0}function xD(){var e=0;if(!(r[8032]|0)){AD(10820);Fe(64,10820,g|0)|0;e=8032;o[e>>2]=1;o[e+4>>2]=0}if(!(Xa(10820)|0))AD(10820);return 10820}function AD(e){e=e|0;ID(e);s_(e,25);return}function OD(e){e=e|0;PD(e+24|0);return}function PD(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KT(n)}return}function ID(e){e=e|0;var t=0;t=Za()|0;nl(e,5,18,t,LD()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function ND(e,t){e=e|0;t=t|0;MD(e,t);return}function MD(e,t){e=e|0;t=t|0;var n=0,r=0,i=0;n=h;h=h+16|0;r=n;i=n+4|0;cc(i,t);o[r>>2]=fc(i,t)|0;RD(e,r);h=n;return}function RD(e,t){e=e|0;t=t|0;FD(e+4|0,o[t>>2]|0);r[e+8>>0]=1;return}function FD(e,t){e=e|0;t=t|0;o[e>>2]=t;return}function LD(){return 1824}function BD(e){e=e|0;return jD(e)|0}function jD(e){e=e|0;var t=0,n=0,r=0,i=0,u=0,a=0,l=0;n=h;h=h+16|0;i=n+4|0;a=n;r=UD(8)|0;t=r;l=$T(4)|0;cc(i,e);FD(l,fc(i,e)|0);u=t+4|0;o[u>>2]=l;e=$T(8)|0;u=o[u>>2]|0;o[a>>2]=0;o[i>>2]=o[a>>2];iE(e,u,i);o[r>>2]=e;h=n;return t|0}function UD(e){e=e|0;var t=0,n=0;e=e+7&-8;if(e>>>0<=32768?(t=o[2701]|0,e>>>0<=(65536-t|0)>>>0):0){n=(o[2702]|0)+t|0;o[2701]=t+e;e=n}else{e=YT(e+8|0)|0;o[e>>2]=o[2703];o[2703]=e;e=e+8|0}return e|0}function zD(e,t){e=e|0;t=t|0;o[e>>2]=WD()|0;o[e+4>>2]=HD()|0;o[e+12>>2]=t;o[e+8>>2]=VD()|0;o[e+32>>2]=9;return}function WD(){return 11744}function HD(){return 1832}function VD(){return N_()|0}function qD(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;if((Um(r,896)|0)==512){if(n|0){GD(n);KT(n)}}else if(t|0)KT(t);return}function GD(e){e=e|0;e=o[e+4>>2]|0;if(e|0)qT(e);return}function $D(e){e=e|0;YD(e,5052);KD(e)|0;XD(e,5058,26)|0;QD(e,5069,1)|0;JD(e,5077,10)|0;ZD(e,5087,19)|0;tS(e,5094,27)|0;return}function YD(e,t){e=e|0;t=t|0;var n=0;n=sk()|0;o[e>>2]=n;ck(n,t);cw(o[e>>2]|0);return}function KD(e){e=e|0;var t=0;t=o[e>>2]|0;r_(t,YC()|0);return e|0}function XD(e,t,n){e=e|0;t=t|0;n=n|0;TC(e,Ia(t)|0,n,0);return e|0}function QD(e,t,n){e=e|0;t=t|0;n=n|0;sC(e,Ia(t)|0,n,0);return e|0}function JD(e,t,n){e=e|0;t=t|0;n=n|0;BS(e,Ia(t)|0,n,0);return e|0}function ZD(e,t,n){e=e|0;t=t|0;n=n|0;bS(e,Ia(t)|0,n,0);return e|0}function eS(e,t){e=e|0;t=t|0;var n=0,r=0;e:while(1){n=o[2703]|0;while(1){if((n|0)==(t|0))break e;r=o[n>>2]|0;o[2703]=r;if(!n)n=r;else break}KT(n)}o[2701]=e;return}function tS(e,t,n){e=e|0;t=t|0;n=n|0;nS(e,Ia(t)|0,n,0);return e|0}function nS(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0;u=o[e>>2]|0;i=rS()|0;e=iS(n)|0;La(u,t,i,e,oS(n,r)|0,r);return}function rS(){var e=0,t=0;if(!(r[8040]|0)){dS(10860);Fe(65,10860,g|0)|0;t=8040;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(10860)|0)){e=10860;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));dS(10860)}return 10860}function iS(e){e=e|0;return e|0}function oS(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;u=l+4|0;o[i>>2]=e;s=rS()|0;a=s+24|0;t=za(t,4)|0;o[u>>2]=t;n=s+28|0;r=o[n>>2]|0;if(r>>>0<(o[s+32>>2]|0)>>>0){uS(r,e,t);t=(o[n>>2]|0)+8|0;o[n>>2]=t}else{aS(a,i,u);t=o[n>>2]|0}h=l;return(t-(o[a>>2]|0)>>3)+-1|0}function uS(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;o[e+4>>2]=n;return}function aS(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;u=e+4|0;a=((o[u>>2]|0)-(o[e>>2]|0)>>3)+1|0;r=lS(e)|0;if(r>>>0>>0)UT(e);else{s=o[e>>2]|0;f=(o[e+8>>2]|0)-s|0;c=f>>2;sS(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(o[u>>2]|0)-s>>3,e+8|0);a=i+8|0;uS(o[a>>2]|0,o[t>>2]|0,o[n>>2]|0);o[a>>2]=(o[a>>2]|0)+8;cS(e,i);fS(i);h=l;return}}function lS(e){e=e|0;return 536870911}function sS(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>536870911)Ye();else{i=$T(t<<3)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<3)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<3);return}function cS(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>3)<<3)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function fS(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=o[e>>2]|0;if(e|0)KT(e);return}function dS(e){e=e|0;vS(e);return}function pS(e){e=e|0;hS(e+24|0);return}function hS(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KT(n)}return}function vS(e){e=e|0;var t=0;t=Za()|0;nl(e,1,11,t,mS()|0,2);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function mS(){return 1840}function gS(e,t,n){e=e|0;t=t|0;n=n|0;_S(o[(yS(e)|0)>>2]|0,t,n);return}function yS(e){e=e|0;return(o[(rS()|0)+24>>2]|0)+(e<<3)|0}function _S(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0;r=h;h=h+16|0;o=r+1|0;i=r;cc(o,t);t=fc(o,t)|0;cc(i,n);n=fc(i,n)|0;vA[e&31](t,n);h=r;return}function bS(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0;u=o[e>>2]|0;i=wS()|0;e=ES(n)|0;La(u,t,i,e,DS(n,r)|0,r);return}function wS(){var e=0,t=0;if(!(r[8048]|0)){OS(10896);Fe(66,10896,g|0)|0;t=8048;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(10896)|0)){e=10896;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));OS(10896)}return 10896}function ES(e){e=e|0;return e|0}function DS(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;u=l+4|0;o[i>>2]=e;s=wS()|0;a=s+24|0;t=za(t,4)|0;o[u>>2]=t;n=s+28|0;r=o[n>>2]|0;if(r>>>0<(o[s+32>>2]|0)>>>0){SS(r,e,t);t=(o[n>>2]|0)+8|0;o[n>>2]=t}else{CS(a,i,u);t=o[n>>2]|0}h=l;return(t-(o[a>>2]|0)>>3)+-1|0}function SS(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;o[e+4>>2]=n;return}function CS(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;u=e+4|0;a=((o[u>>2]|0)-(o[e>>2]|0)>>3)+1|0;r=kS(e)|0;if(r>>>0>>0)UT(e);else{s=o[e>>2]|0;f=(o[e+8>>2]|0)-s|0;c=f>>2;TS(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(o[u>>2]|0)-s>>3,e+8|0);a=i+8|0;SS(o[a>>2]|0,o[t>>2]|0,o[n>>2]|0);o[a>>2]=(o[a>>2]|0)+8;xS(e,i);AS(i);h=l;return}}function kS(e){e=e|0;return 536870911}function TS(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>536870911)Ye();else{i=$T(t<<3)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<3)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<3);return}function xS(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>3)<<3)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function AS(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=o[e>>2]|0;if(e|0)KT(e);return}function OS(e){e=e|0;NS(e);return}function PS(e){e=e|0;IS(e+24|0);return}function IS(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KT(n)}return}function NS(e){e=e|0;var t=0;t=Za()|0;nl(e,1,11,t,MS()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function MS(){return 1852}function RS(e,t){e=e|0;t=t|0;return LS(o[(FS(e)|0)>>2]|0,t)|0}function FS(e){e=e|0;return(o[(wS()|0)+24>>2]|0)+(e<<3)|0}function LS(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;cc(r,t);t=fc(r,t)|0;t=Jc(mA[e&31](t)|0)|0;h=n;return t|0}function BS(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0;u=o[e>>2]|0;i=jS()|0;e=US(n)|0;La(u,t,i,e,zS(n,r)|0,r);return}function jS(){var e=0,t=0;if(!(r[8056]|0)){YS(10932);Fe(67,10932,g|0)|0;t=8056;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(10932)|0)){e=10932;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));YS(10932)}return 10932}function US(e){e=e|0;return e|0}function zS(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;u=l+4|0;o[i>>2]=e;s=jS()|0;a=s+24|0;t=za(t,4)|0;o[u>>2]=t;n=s+28|0;r=o[n>>2]|0;if(r>>>0<(o[s+32>>2]|0)>>>0){WS(r,e,t);t=(o[n>>2]|0)+8|0;o[n>>2]=t}else{HS(a,i,u);t=o[n>>2]|0}h=l;return(t-(o[a>>2]|0)>>3)+-1|0}function WS(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;o[e+4>>2]=n;return}function HS(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;u=e+4|0;a=((o[u>>2]|0)-(o[e>>2]|0)>>3)+1|0;r=VS(e)|0;if(r>>>0>>0)UT(e);else{s=o[e>>2]|0;f=(o[e+8>>2]|0)-s|0;c=f>>2;qS(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(o[u>>2]|0)-s>>3,e+8|0);a=i+8|0;WS(o[a>>2]|0,o[t>>2]|0,o[n>>2]|0);o[a>>2]=(o[a>>2]|0)+8;GS(e,i);$S(i);h=l;return}}function VS(e){e=e|0;return 536870911}function qS(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>536870911)Ye();else{i=$T(t<<3)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<3)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<3);return}function GS(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>3)<<3)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function $S(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=o[e>>2]|0;if(e|0)KT(e);return}function YS(e){e=e|0;QS(e);return}function KS(e){e=e|0;XS(e+24|0);return}function XS(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KT(n)}return}function QS(e){e=e|0;var t=0;t=Za()|0;nl(e,1,7,t,JS()|0,2);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function JS(){return 1860}function ZS(e,t,n){e=e|0;t=t|0;n=n|0;return tC(o[(eC(e)|0)>>2]|0,t,n)|0}function eC(e){e=e|0;return(o[(jS()|0)+24>>2]|0)+(e<<3)|0}function tC(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0;r=h;h=h+32|0;a=r+12|0;u=r+8|0;l=r;s=r+16|0;i=r+4|0;nC(s,t);rC(l,s,t);Us(i,n);n=zs(i,n)|0;o[a>>2]=o[l>>2];PA[e&15](u,a,n);n=iC(u)|0;Zi(u);Ws(i);h=r;return n|0}function nC(e,t){e=e|0;t=t|0;return}function rC(e,t,n){e=e|0;t=t|0;n=n|0;oC(e,n);return}function iC(e){e=e|0;return Eu(e)|0}function oC(e,t){e=e|0;t=t|0;var n=0,r=0,i=0;i=h;h=h+16|0;n=i;r=t;if(!(r&1))o[e>>2]=o[t>>2];else{uC(n,0);Be(r|0,n|0)|0;aC(e,n);lC(n)}h=i;return}function uC(e,t){e=e|0;t=t|0;Iu(e,t);o[e+4>>2]=0;r[e+8>>0]=0;return}function aC(e,t){e=e|0;t=t|0;o[e>>2]=o[t+4>>2];return}function lC(e){e=e|0;r[e+8>>0]=0;return}function sC(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0;u=o[e>>2]|0;i=cC()|0;e=fC(n)|0;La(u,t,i,e,dC(n,r)|0,r);return}function cC(){var e=0,t=0;if(!(r[8064]|0)){_C(10968);Fe(68,10968,g|0)|0;t=8064;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(10968)|0)){e=10968;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));_C(10968)}return 10968}function fC(e){e=e|0;return e|0}function dC(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;u=l+4|0;o[i>>2]=e;s=cC()|0;a=s+24|0;t=za(t,4)|0;o[u>>2]=t;n=s+28|0;r=o[n>>2]|0;if(r>>>0<(o[s+32>>2]|0)>>>0){pC(r,e,t);t=(o[n>>2]|0)+8|0;o[n>>2]=t}else{hC(a,i,u);t=o[n>>2]|0}h=l;return(t-(o[a>>2]|0)>>3)+-1|0}function pC(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;o[e+4>>2]=n;return}function hC(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;u=e+4|0;a=((o[u>>2]|0)-(o[e>>2]|0)>>3)+1|0;r=vC(e)|0;if(r>>>0>>0)UT(e);else{s=o[e>>2]|0;f=(o[e+8>>2]|0)-s|0;c=f>>2;mC(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(o[u>>2]|0)-s>>3,e+8|0);a=i+8|0;pC(o[a>>2]|0,o[t>>2]|0,o[n>>2]|0);o[a>>2]=(o[a>>2]|0)+8;gC(e,i);yC(i);h=l;return}}function vC(e){e=e|0;return 536870911}function mC(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>536870911)Ye();else{i=$T(t<<3)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<3)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<3);return}function gC(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>3)<<3)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function yC(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=o[e>>2]|0;if(e|0)KT(e);return}function _C(e){e=e|0;EC(e);return}function bC(e){e=e|0;wC(e+24|0);return}function wC(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KT(n)}return}function EC(e){e=e|0;var t=0;t=Za()|0;nl(e,1,1,t,DC()|0,5);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function DC(){return 1872}function SC(e,t,n,r,i,u){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;u=u|0;kC(o[(CC(e)|0)>>2]|0,t,n,r,i,u);return}function CC(e){e=e|0;return(o[(cC()|0)+24>>2]|0)+(e<<3)|0}function kC(e,t,n,r,i,o){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;o=o|0;var u=0,a=0,l=0,s=0,c=0,f=0;u=h;h=h+32|0;a=u+16|0;l=u+12|0;s=u+8|0;c=u+4|0;f=u;Us(a,t);t=zs(a,t)|0;Us(l,n);n=zs(l,n)|0;Us(s,r);r=zs(s,r)|0;Us(c,i);i=zs(c,i)|0;Us(f,o);o=zs(f,o)|0;cA[e&1](t,n,r,i,o);Ws(f);Ws(c);Ws(s);Ws(l);Ws(a);h=u;return}function TC(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0;u=o[e>>2]|0;i=xC()|0;e=AC(n)|0;La(u,t,i,e,OC(n,r)|0,r);return}function xC(){var e=0,t=0;if(!(r[8072]|0)){LC(11004);Fe(69,11004,g|0)|0;t=8072;o[t>>2]=1;o[t+4>>2]=0}if(!(Xa(11004)|0)){e=11004;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));LC(11004)}return 11004}function AC(e){e=e|0;return e|0}function OC(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;u=l+4|0;o[i>>2]=e;s=xC()|0;a=s+24|0;t=za(t,4)|0;o[u>>2]=t;n=s+28|0;r=o[n>>2]|0;if(r>>>0<(o[s+32>>2]|0)>>>0){PC(r,e,t);t=(o[n>>2]|0)+8|0;o[n>>2]=t}else{IC(a,i,u);t=o[n>>2]|0}h=l;return(t-(o[a>>2]|0)>>3)+-1|0}function PC(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;o[e+4>>2]=n;return}function IC(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;u=e+4|0;a=((o[u>>2]|0)-(o[e>>2]|0)>>3)+1|0;r=NC(e)|0;if(r>>>0>>0)UT(e);else{s=o[e>>2]|0;f=(o[e+8>>2]|0)-s|0;c=f>>2;MC(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(o[u>>2]|0)-s>>3,e+8|0);a=i+8|0;PC(o[a>>2]|0,o[t>>2]|0,o[n>>2]|0);o[a>>2]=(o[a>>2]|0)+8;RC(e,i);FC(i);h=l;return}}function NC(e){e=e|0;return 536870911}function MC(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>536870911)Ye();else{i=$T(t<<3)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<3)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<3);return}function RC(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>3)<<3)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function FC(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=o[e>>2]|0;if(e|0)KT(e);return}function LC(e){e=e|0;UC(e);return}function BC(e){e=e|0;jC(e+24|0);return}function jC(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KT(n)}return}function UC(e){e=e|0;var t=0;t=Za()|0;nl(e,1,12,t,zC()|0,2);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function zC(){return 1896}function WC(e,t,n){e=e|0;t=t|0;n=n|0;VC(o[(HC(e)|0)>>2]|0,t,n);return}function HC(e){e=e|0;return(o[(xC()|0)+24>>2]|0)+(e<<3)|0}function VC(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0;r=h;h=h+16|0;o=r+4|0;i=r;qC(o,t);t=GC(o,t)|0;Us(i,n);n=zs(i,n)|0;vA[e&31](t,n);Ws(i);h=r;return}function qC(e,t){e=e|0;t=t|0;return}function GC(e,t){e=e|0;t=t|0;return $C(t)|0}function $C(e){e=e|0;return e|0}function YC(){var e=0;if(!(r[8080]|0)){KC(11040);Fe(70,11040,g|0)|0;e=8080;o[e>>2]=1;o[e+4>>2]=0}if(!(Xa(11040)|0))KC(11040);return 11040}function KC(e){e=e|0;JC(e);s_(e,71);return}function XC(e){e=e|0;QC(e+24|0);return}function QC(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);KT(n)}return}function JC(e){e=e|0;var t=0;t=Za()|0;nl(e,5,7,t,nk()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function ZC(e){e=e|0;ek(e);return}function ek(e){e=e|0;tk(e);return}function tk(e){e=e|0;r[e+8>>0]=1;return}function nk(){return 1936}function rk(){return ik()|0}function ik(){var e=0,t=0,n=0,r=0,i=0,u=0,a=0;t=h;h=h+16|0;i=t+4|0;a=t;n=UD(8)|0;e=n;u=e+4|0;o[u>>2]=$T(1)|0;r=$T(8)|0;u=o[u>>2]|0;o[a>>2]=0;o[i>>2]=o[a>>2];ok(r,u,i);o[n>>2]=r;h=t;return e|0}function ok(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;n=$T(16)|0;o[n+4>>2]=0;o[n+8>>2]=0;o[n>>2]=1916;o[n+12>>2]=t;o[e+4>>2]=n;return}function uk(e){e=e|0;zT(e);KT(e);return}function ak(e){e=e|0;e=o[e+12>>2]|0;if(e|0)KT(e);return}function lk(e){e=e|0;KT(e);return}function sk(){var e=0;if(!(r[8088]|0)){mk(11076);Fe(25,11076,g|0)|0;e=8088;o[e>>2]=1;o[e+4>>2]=0}return 11076}function ck(e,t){e=e|0;t=t|0;o[e>>2]=fk()|0;o[e+4>>2]=dk()|0;o[e+12>>2]=t;o[e+8>>2]=pk()|0;o[e+32>>2]=10;return}function fk(){return 11745}function dk(){return 1940}function pk(){return Wm()|0}function hk(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;if((Um(r,896)|0)==512){if(n|0){vk(n);KT(n)}}else if(t|0)KT(t);return}function vk(e){e=e|0;e=o[e+4>>2]|0;if(e|0)qT(e);return}function mk(e){e=e|0;Al(e);return}function gk(e,t){e=e|0;t=t|0;o[e>>2]=t;return}function yk(e){e=e|0;return o[e>>2]|0}function _k(e){e=e|0;return r[o[e>>2]>>0]|0}function bk(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;o[r>>2]=o[e>>2];wk(t,r)|0;h=n;return}function wk(e,t){e=e|0;t=t|0;var n=0;n=Ek(o[e>>2]|0,t)|0;t=e+4|0;o[(o[t>>2]|0)+8>>2]=n;return o[(o[t>>2]|0)+8>>2]|0}function Ek(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;Dk(r);e=Eu(e)|0;t=Sk(e,o[t>>2]|0)|0;Ck(r);h=n;return t|0}function Dk(e){e=e|0;o[e>>2]=o[2701];o[e+4>>2]=o[2703];return}function Sk(e,t){e=e|0;t=t|0;var n=0;n=Cu(kk()|0)|0;return it(0,n|0,e|0,Kw(t)|0)|0}function Ck(e){e=e|0;eS(o[e>>2]|0,o[e+4>>2]|0);return}function kk(){var e=0;if(!(r[8096]|0)){Tk(11120);e=8096;o[e>>2]=1;o[e+4>>2]=0}return 11120}function Tk(e){e=e|0;Lu(e,xk()|0,1);return}function xk(){return 1948}function Ak(){Ok();return}function Ok(){var e=0,t=0,n=0,i=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,v=0,m=0,g=0,y=0,_=0;y=h;h=h+16|0;p=y+4|0;v=y;Ne(65536,10804,o[2702]|0,10812);n=Cw()|0;t=o[n>>2]|0;e=o[t>>2]|0;if(e|0){i=o[n+8>>2]|0;n=o[n+4>>2]|0;while(1){ze(e|0,u[n>>0]|0|0,r[i>>0]|0);t=t+4|0;e=o[t>>2]|0;if(!e)break;else{i=i+1|0;n=n+1|0}}}e=Tw()|0;t=o[e>>2]|0;if(t|0)do{We(t|0,o[e+4>>2]|0);e=e+8|0;t=o[e>>2]|0}while((t|0)!=0);We(Pk()|0,5167);d=fw()|0;e=o[d>>2]|0;e:do{if(e|0){do{Ik(o[e+4>>2]|0);e=o[e>>2]|0}while((e|0)!=0);e=o[d>>2]|0;if(e|0){f=d;do{while(1){a=e;e=o[e>>2]|0;a=o[a+4>>2]|0;if(!(Nk(a)|0))break;o[v>>2]=f;o[p>>2]=o[v>>2];Mk(d,p)|0;if(!e)break e}Rk(a);f=o[f>>2]|0;t=Fk(a)|0;l=Xe()|0;s=h;h=h+((1*(t<<2)|0)+15&-16)|0;c=h;h=h+((1*(t<<2)|0)+15&-16)|0;t=o[(xE(a)|0)>>2]|0;if(t|0){n=s;i=c;while(1){o[n>>2]=o[(kE(o[t+4>>2]|0)|0)>>2];o[i>>2]=o[t+8>>2];t=o[t>>2]|0;if(!t)break;else{n=n+4|0;i=i+4|0}}}_=kE(a)|0;t=Lk(a)|0;n=Fk(a)|0;i=Bk(a)|0;Ge(_|0,t|0,s|0,c|0,n|0,i|0,Ew(a)|0);Re(l|0)}while((e|0)!=0)}}}while(0);e=o[(Sw()|0)>>2]|0;if(e|0)do{_=e+4|0;d=Pw(_)|0;a=Fw(d)|0;l=Iw(d)|0;s=(Nw(d)|0)+1|0;c=jk(d)|0;f=Uk(_)|0;d=Xa(d)|0;p=Bw(_)|0;v=zk(_)|0;Ve(0,a|0,l|0,s|0,c|0,f|0,d|0,p|0,v|0,Wk(_)|0);e=o[e>>2]|0}while((e|0)!=0);e=o[(fw()|0)>>2]|0;e:do{if(e|0){t:while(1){t=o[e+4>>2]|0;if(t|0?(m=o[(kE(t)|0)>>2]|0,g=o[(PE(t)|0)>>2]|0,g|0):0){n=g;do{t=n+4|0;i=Pw(t)|0;n:do{if(i|0)switch(Xa(i)|0){case 0:break t;case 4:case 3:case 2:{c=Fw(i)|0;f=Iw(i)|0;d=(Nw(i)|0)+1|0;p=jk(i)|0;v=Xa(i)|0;_=Bw(t)|0;Ve(m|0,c|0,f|0,d|0,p|0,0,v|0,_|0,zk(t)|0,Wk(t)|0);break n}case 1:{s=Fw(i)|0;c=Iw(i)|0;f=(Nw(i)|0)+1|0;d=jk(i)|0;p=Uk(t)|0;v=Xa(i)|0;_=Bw(t)|0;Ve(m|0,s|0,c|0,f|0,d|0,p|0,v|0,_|0,zk(t)|0,Wk(t)|0);break n}case 5:{d=Fw(i)|0;p=Iw(i)|0;v=(Nw(i)|0)+1|0;_=jk(i)|0;Ve(m|0,d|0,p|0,v|0,_|0,Hk(i)|0,Xa(i)|0,0,0,0);break n}default:break n}}while(0);n=o[n>>2]|0}while((n|0)!=0)}e=o[e>>2]|0;if(!e)break e}Ye()}}while(0);$e();h=y;return}function Pk(){return 11703}function Ik(e){e=e|0;r[e+40>>0]=0;return}function Nk(e){e=e|0;return(r[e+40>>0]|0)!=0|0}function Mk(e,t){e=e|0;t=t|0;t=Vk(t)|0;e=o[t>>2]|0;o[t>>2]=o[e>>2];KT(e);return o[t>>2]|0}function Rk(e){e=e|0;r[e+40>>0]=1;return}function Fk(e){e=e|0;return o[e+20>>2]|0}function Lk(e){e=e|0;return o[e+8>>2]|0}function Bk(e){e=e|0;return o[e+32>>2]|0}function jk(e){e=e|0;return o[e+4>>2]|0}function Uk(e){e=e|0;return o[e+4>>2]|0}function zk(e){e=e|0;return o[e+8>>2]|0}function Wk(e){e=e|0;return o[e+16>>2]|0}function Hk(e){e=e|0;return o[e+20>>2]|0}function Vk(e){e=e|0;return o[e>>2]|0}function qk(e){e=e|0;var t=0,n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,v=0,m=0,g=0,y=0,_=0,b=0,w=0,E=0,D=0;D=h;h=h+16|0;p=D;do{if(e>>>0<245){c=e>>>0<11?16:e+11&-8;e=c>>>3;d=o[2783]|0;n=d>>>e;if(n&3|0){t=(n&1^1)+e|0;e=11172+(t<<1<<2)|0;n=e+8|0;r=o[n>>2]|0;i=r+8|0;u=o[i>>2]|0;if((e|0)==(u|0))o[2783]=d&~(1<>2]=e;o[n>>2]=u}E=t<<3;o[r+4>>2]=E|3;E=r+E+4|0;o[E>>2]=o[E>>2]|1;E=i;h=D;return E|0}f=o[2785]|0;if(c>>>0>f>>>0){if(n|0){t=2<>>12&16;t=t>>>a;n=t>>>5&8;t=t>>>n;i=t>>>2&4;t=t>>>i;e=t>>>1&2;t=t>>>e;r=t>>>1&1;r=(n|a|i|e|r)+(t>>>r)|0;t=11172+(r<<1<<2)|0;e=t+8|0;i=o[e>>2]|0;a=i+8|0;n=o[a>>2]|0;if((t|0)==(n|0)){e=d&~(1<>2]=t;o[e>>2]=n;e=d}u=(r<<3)-c|0;o[i+4>>2]=c|3;r=i+c|0;o[r+4>>2]=u|1;o[r+u>>2]=u;if(f|0){i=o[2788]|0;t=f>>>3;n=11172+(t<<1<<2)|0;t=1<>2]|0}o[e>>2]=i;o[t+12>>2]=i;o[i+8>>2]=t;o[i+12>>2]=n}o[2785]=u;o[2788]=r;E=a;h=D;return E|0}l=o[2784]|0;if(l){n=(l&0-l)+-1|0;a=n>>>12&16;n=n>>>a;u=n>>>5&8;n=n>>>u;s=n>>>2&4;n=n>>>s;r=n>>>1&2;n=n>>>r;e=n>>>1&1;e=o[11436+((u|a|s|r|e)+(n>>>e)<<2)>>2]|0;n=(o[e+4>>2]&-8)-c|0;r=o[e+16+(((o[e+16>>2]|0)==0&1)<<2)>>2]|0;if(!r){s=e;u=n}else{do{a=(o[r+4>>2]&-8)-c|0;s=a>>>0>>0;n=s?a:n;e=s?r:e;r=o[r+16+(((o[r+16>>2]|0)==0&1)<<2)>>2]|0}while((r|0)!=0);s=e;u=n}a=s+c|0;if(s>>>0>>0){i=o[s+24>>2]|0;t=o[s+12>>2]|0;do{if((t|0)==(s|0)){e=s+20|0;t=o[e>>2]|0;if(!t){e=s+16|0;t=o[e>>2]|0;if(!t){n=0;break}}while(1){n=t+20|0;r=o[n>>2]|0;if(r|0){t=r;e=n;continue}n=t+16|0;r=o[n>>2]|0;if(!r)break;else{t=r;e=n}}o[e>>2]=0;n=t}else{n=o[s+8>>2]|0;o[n+12>>2]=t;o[t+8>>2]=n;n=t}}while(0);do{if(i|0){t=o[s+28>>2]|0;e=11436+(t<<2)|0;if((s|0)==(o[e>>2]|0)){o[e>>2]=n;if(!n){o[2784]=l&~(1<>2]|0)!=(s|0)&1)<<2)>>2]=n;if(!n)break}o[n+24>>2]=i;t=o[s+16>>2]|0;if(t|0){o[n+16>>2]=t;o[t+24>>2]=n}t=o[s+20>>2]|0;if(t|0){o[n+20>>2]=t;o[t+24>>2]=n}}}while(0);if(u>>>0<16){E=u+c|0;o[s+4>>2]=E|3;E=s+E+4|0;o[E>>2]=o[E>>2]|1}else{o[s+4>>2]=c|3;o[a+4>>2]=u|1;o[a+u>>2]=u;if(f|0){r=o[2788]|0;t=f>>>3;n=11172+(t<<1<<2)|0;t=1<>2]|0}o[e>>2]=r;o[t+12>>2]=r;o[r+8>>2]=t;o[r+12>>2]=n}o[2785]=u;o[2788]=a}E=s+8|0;h=D;return E|0}else d=c}else d=c}else d=c}else if(e>>>0<=4294967231){e=e+11|0;c=e&-8;s=o[2784]|0;if(s){r=0-c|0;e=e>>>8;if(e){if(c>>>0>16777215)l=31;else{d=(e+1048320|0)>>>16&8;w=e<>>16&4;w=w<>>16&2;l=14-(f|d|l)+(w<>>15)|0;l=c>>>(l+7|0)&1|l<<1}}else l=0;n=o[11436+(l<<2)>>2]|0;e:do{if(!n){n=0;e=0;w=57}else{e=0;a=c<<((l|0)==31?0:25-(l>>>1)|0);u=0;while(1){i=(o[n+4>>2]&-8)-c|0;if(i>>>0>>0)if(!i){e=n;r=0;i=n;w=61;break e}else{e=n;r=i}i=o[n+20>>2]|0;n=o[n+16+(a>>>31<<2)>>2]|0;u=(i|0)==0|(i|0)==(n|0)?u:i;i=(n|0)==0;if(i){n=u;w=57;break}else a=a<<((i^1)&1)}}}while(0);if((w|0)==57){if((n|0)==0&(e|0)==0){e=2<>>12&16;d=d>>>a;u=d>>>5&8;d=d>>>u;l=d>>>2&4;d=d>>>l;f=d>>>1&2;d=d>>>f;n=d>>>1&1;e=0;n=o[11436+((u|a|l|f|n)+(d>>>n)<<2)>>2]|0}if(!n){l=e;a=r}else{i=n;w=61}}if((w|0)==61)while(1){w=0;n=(o[i+4>>2]&-8)-c|0;d=n>>>0>>0;n=d?n:r;e=d?i:e;i=o[i+16+(((o[i+16>>2]|0)==0&1)<<2)>>2]|0;if(!i){l=e;a=n;break}else{r=n;w=61}}if((l|0)!=0?a>>>0<((o[2785]|0)-c|0)>>>0:0){u=l+c|0;if(l>>>0>=u>>>0){E=0;h=D;return E|0}i=o[l+24>>2]|0;t=o[l+12>>2]|0;do{if((t|0)==(l|0)){e=l+20|0;t=o[e>>2]|0;if(!t){e=l+16|0;t=o[e>>2]|0;if(!t){t=0;break}}while(1){n=t+20|0;r=o[n>>2]|0;if(r|0){t=r;e=n;continue}n=t+16|0;r=o[n>>2]|0;if(!r)break;else{t=r;e=n}}o[e>>2]=0}else{E=o[l+8>>2]|0;o[E+12>>2]=t;o[t+8>>2]=E}}while(0);do{if(i){e=o[l+28>>2]|0;n=11436+(e<<2)|0;if((l|0)==(o[n>>2]|0)){o[n>>2]=t;if(!t){r=s&~(1<>2]|0)!=(l|0)&1)<<2)>>2]=t;if(!t){r=s;break}}o[t+24>>2]=i;e=o[l+16>>2]|0;if(e|0){o[t+16>>2]=e;o[e+24>>2]=t}e=o[l+20>>2]|0;if(e){o[t+20>>2]=e;o[e+24>>2]=t;r=s}else r=s}else r=s}while(0);do{if(a>>>0>=16){o[l+4>>2]=c|3;o[u+4>>2]=a|1;o[u+a>>2]=a;t=a>>>3;if(a>>>0<256){n=11172+(t<<1<<2)|0;e=o[2783]|0;t=1<>2]|0}o[e>>2]=u;o[t+12>>2]=u;o[u+8>>2]=t;o[u+12>>2]=n;break}t=a>>>8;if(t){if(a>>>0>16777215)t=31;else{w=(t+1048320|0)>>>16&8;E=t<>>16&4;E=E<>>16&2;t=14-(b|w|t)+(E<>>15)|0;t=a>>>(t+7|0)&1|t<<1}}else t=0;n=11436+(t<<2)|0;o[u+28>>2]=t;e=u+16|0;o[e+4>>2]=0;o[e>>2]=0;e=1<>2]=u;o[u+24>>2]=n;o[u+12>>2]=u;o[u+8>>2]=u;break}e=a<<((t|0)==31?0:25-(t>>>1)|0);n=o[n>>2]|0;while(1){if((o[n+4>>2]&-8|0)==(a|0)){w=97;break}r=n+16+(e>>>31<<2)|0;t=o[r>>2]|0;if(!t){w=96;break}else{e=e<<1;n=t}}if((w|0)==96){o[r>>2]=u;o[u+24>>2]=n;o[u+12>>2]=u;o[u+8>>2]=u;break}else if((w|0)==97){w=n+8|0;E=o[w>>2]|0;o[E+12>>2]=u;o[w>>2]=u;o[u+8>>2]=E;o[u+12>>2]=n;o[u+24>>2]=0;break}}else{E=a+c|0;o[l+4>>2]=E|3;E=l+E+4|0;o[E>>2]=o[E>>2]|1}}while(0);E=l+8|0;h=D;return E|0}else d=c}else d=c}else d=-1}while(0);n=o[2785]|0;if(n>>>0>=d>>>0){t=n-d|0;e=o[2788]|0;if(t>>>0>15){E=e+d|0;o[2788]=E;o[2785]=t;o[E+4>>2]=t|1;o[E+t>>2]=t;o[e+4>>2]=d|3}else{o[2785]=0;o[2788]=0;o[e+4>>2]=n|3;E=e+n+4|0;o[E>>2]=o[E>>2]|1}E=e+8|0;h=D;return E|0}a=o[2786]|0;if(a>>>0>d>>>0){b=a-d|0;o[2786]=b;E=o[2789]|0;w=E+d|0;o[2789]=w;o[w+4>>2]=b|1;o[E+4>>2]=d|3;E=E+8|0;h=D;return E|0}if(!(o[2901]|0)){o[2903]=4096;o[2902]=4096;o[2904]=-1;o[2905]=-1;o[2906]=0;o[2894]=0;e=p&-16^1431655768;o[p>>2]=e;o[2901]=e;e=4096}else e=o[2903]|0;l=d+48|0;s=d+47|0;u=e+s|0;i=0-e|0;c=u&i;if(c>>>0<=d>>>0){E=0;h=D;return E|0}e=o[2893]|0;if(e|0?(f=o[2891]|0,p=f+c|0,p>>>0<=f>>>0|p>>>0>e>>>0):0){E=0;h=D;return E|0}e:do{if(!(o[2894]&4)){n=o[2789]|0;t:do{if(n){r=11580;while(1){e=o[r>>2]|0;if(e>>>0<=n>>>0?(g=r+4|0,(e+(o[g>>2]|0)|0)>>>0>n>>>0):0)break;e=o[r+8>>2]|0;if(!e){w=118;break t}else r=e}t=u-a&i;if(t>>>0<2147483647){e=lx(t|0)|0;if((e|0)==((o[r>>2]|0)+(o[g>>2]|0)|0)){if((e|0)!=(-1|0)){a=t;u=e;w=135;break e}}else{r=e;w=126}}else t=0}else w=118}while(0);do{if((w|0)==118){n=lx(0)|0;if((n|0)!=(-1|0)?(t=n,v=o[2902]|0,m=v+-1|0,t=((m&t|0)==0?0:(m+t&0-v)-t|0)+c|0,v=o[2891]|0,m=t+v|0,t>>>0>d>>>0&t>>>0<2147483647):0){g=o[2893]|0;if(g|0?m>>>0<=v>>>0|m>>>0>g>>>0:0){t=0;break}e=lx(t|0)|0;if((e|0)==(n|0)){a=t;u=n;w=135;break e}else{r=e;w=126}}else t=0}}while(0);do{if((w|0)==126){n=0-t|0;if(!(l>>>0>t>>>0&(t>>>0<2147483647&(r|0)!=(-1|0))))if((r|0)==(-1|0)){t=0;break}else{a=t;u=r;w=135;break e}e=o[2903]|0;e=s-t+e&0-e;if(e>>>0>=2147483647){a=t;u=r;w=135;break e}if((lx(e|0)|0)==(-1|0)){lx(n|0)|0;t=0;break}else{a=e+t|0;u=r;w=135;break e}}}while(0);o[2894]=o[2894]|4;w=133}else{t=0;w=133}}while(0);if(((w|0)==133?c>>>0<2147483647:0)?(b=lx(c|0)|0,g=lx(0)|0,y=g-b|0,_=y>>>0>(d+40|0)>>>0,!((b|0)==(-1|0)|_^1|b>>>0>>0&((b|0)!=(-1|0)&(g|0)!=(-1|0))^1)):0){a=_?y:t;u=b;w=135}if((w|0)==135){t=(o[2891]|0)+a|0;o[2891]=t;if(t>>>0>(o[2892]|0)>>>0)o[2892]=t;s=o[2789]|0;do{if(s){t=11580;while(1){e=o[t>>2]|0;n=t+4|0;r=o[n>>2]|0;if((u|0)==(e+r|0)){w=145;break}i=o[t+8>>2]|0;if(!i)break;else t=i}if(((w|0)==145?(o[t+12>>2]&8|0)==0:0)?s>>>0>>0&s>>>0>=e>>>0:0){o[n>>2]=r+a;E=s+8|0;E=(E&7|0)==0?0:0-E&7;w=s+E|0;E=(o[2786]|0)+(a-E)|0;o[2789]=w;o[2786]=E;o[w+4>>2]=E|1;o[w+E+4>>2]=40;o[2790]=o[2905];break}if(u>>>0<(o[2787]|0)>>>0)o[2787]=u;n=u+a|0;t=11580;while(1){if((o[t>>2]|0)==(n|0)){w=153;break}e=o[t+8>>2]|0;if(!e)break;else t=e}if((w|0)==153?(o[t+12>>2]&8|0)==0:0){o[t>>2]=u;f=t+4|0;o[f>>2]=(o[f>>2]|0)+a;f=u+8|0;f=u+((f&7|0)==0?0:0-f&7)|0;t=n+8|0;t=n+((t&7|0)==0?0:0-t&7)|0;c=f+d|0;l=t-f-d|0;o[f+4>>2]=d|3;do{if((t|0)!=(s|0)){if((t|0)==(o[2788]|0)){E=(o[2785]|0)+l|0;o[2785]=E;o[2788]=c;o[c+4>>2]=E|1;o[c+E>>2]=E;break}e=o[t+4>>2]|0;if((e&3|0)==1){a=e&-8;r=e>>>3;e:do{if(e>>>0<256){e=o[t+8>>2]|0;n=o[t+12>>2]|0;if((n|0)==(e|0)){o[2783]=o[2783]&~(1<>2]=n;o[n+8>>2]=e;break}}else{u=o[t+24>>2]|0;e=o[t+12>>2]|0;do{if((e|0)==(t|0)){r=t+16|0;n=r+4|0;e=o[n>>2]|0;if(!e){e=o[r>>2]|0;if(!e){e=0;break}else n=r}while(1){r=e+20|0;i=o[r>>2]|0;if(i|0){e=i;n=r;continue}r=e+16|0;i=o[r>>2]|0;if(!i)break;else{e=i;n=r}}o[n>>2]=0}else{E=o[t+8>>2]|0;o[E+12>>2]=e;o[e+8>>2]=E}}while(0);if(!u)break;n=o[t+28>>2]|0;r=11436+(n<<2)|0;do{if((t|0)!=(o[r>>2]|0)){o[u+16+(((o[u+16>>2]|0)!=(t|0)&1)<<2)>>2]=e;if(!e)break e}else{o[r>>2]=e;if(e|0)break;o[2784]=o[2784]&~(1<>2]=u;n=t+16|0;r=o[n>>2]|0;if(r|0){o[e+16>>2]=r;o[r+24>>2]=e}n=o[n+4>>2]|0;if(!n)break;o[e+20>>2]=n;o[n+24>>2]=e}}while(0);t=t+a|0;i=a+l|0}else i=l;t=t+4|0;o[t>>2]=o[t>>2]&-2;o[c+4>>2]=i|1;o[c+i>>2]=i;t=i>>>3;if(i>>>0<256){n=11172+(t<<1<<2)|0;e=o[2783]|0;t=1<>2]|0}o[e>>2]=c;o[t+12>>2]=c;o[c+8>>2]=t;o[c+12>>2]=n;break}t=i>>>8;do{if(!t)t=0;else{if(i>>>0>16777215){t=31;break}w=(t+1048320|0)>>>16&8;E=t<>>16&4;E=E<>>16&2;t=14-(b|w|t)+(E<>>15)|0;t=i>>>(t+7|0)&1|t<<1}}while(0);r=11436+(t<<2)|0;o[c+28>>2]=t;e=c+16|0;o[e+4>>2]=0;o[e>>2]=0;e=o[2784]|0;n=1<>2]=c;o[c+24>>2]=r;o[c+12>>2]=c;o[c+8>>2]=c;break}e=i<<((t|0)==31?0:25-(t>>>1)|0);n=o[r>>2]|0;while(1){if((o[n+4>>2]&-8|0)==(i|0)){w=194;break}r=n+16+(e>>>31<<2)|0;t=o[r>>2]|0;if(!t){w=193;break}else{e=e<<1;n=t}}if((w|0)==193){o[r>>2]=c;o[c+24>>2]=n;o[c+12>>2]=c;o[c+8>>2]=c;break}else if((w|0)==194){w=n+8|0;E=o[w>>2]|0;o[E+12>>2]=c;o[w>>2]=c;o[c+8>>2]=E;o[c+12>>2]=n;o[c+24>>2]=0;break}}else{E=(o[2786]|0)+l|0;o[2786]=E;o[2789]=c;o[c+4>>2]=E|1}}while(0);E=f+8|0;h=D;return E|0}t=11580;while(1){e=o[t>>2]|0;if(e>>>0<=s>>>0?(E=e+(o[t+4>>2]|0)|0,E>>>0>s>>>0):0)break;t=o[t+8>>2]|0}i=E+-47|0;e=i+8|0;e=i+((e&7|0)==0?0:0-e&7)|0;i=s+16|0;e=e>>>0>>0?s:e;t=e+8|0;n=u+8|0;n=(n&7|0)==0?0:0-n&7;w=u+n|0;n=a+-40-n|0;o[2789]=w;o[2786]=n;o[w+4>>2]=n|1;o[w+n+4>>2]=40;o[2790]=o[2905];n=e+4|0;o[n>>2]=27;o[t>>2]=o[2895];o[t+4>>2]=o[2896];o[t+8>>2]=o[2897];o[t+12>>2]=o[2898];o[2895]=u;o[2896]=a;o[2898]=0;o[2897]=t;t=e+24|0;do{w=t;t=t+4|0;o[t>>2]=7}while((w+8|0)>>>0>>0);if((e|0)!=(s|0)){u=e-s|0;o[n>>2]=o[n>>2]&-2;o[s+4>>2]=u|1;o[e>>2]=u;t=u>>>3;if(u>>>0<256){n=11172+(t<<1<<2)|0;e=o[2783]|0;t=1<>2]|0}o[e>>2]=s;o[t+12>>2]=s;o[s+8>>2]=t;o[s+12>>2]=n;break}t=u>>>8;if(t){if(u>>>0>16777215)n=31;else{w=(t+1048320|0)>>>16&8;E=t<>>16&4;E=E<>>16&2;n=14-(b|w|n)+(E<>>15)|0;n=u>>>(n+7|0)&1|n<<1}}else n=0;r=11436+(n<<2)|0;o[s+28>>2]=n;o[s+20>>2]=0;o[i>>2]=0;t=o[2784]|0;e=1<>2]=s;o[s+24>>2]=r;o[s+12>>2]=s;o[s+8>>2]=s;break}e=u<<((n|0)==31?0:25-(n>>>1)|0);n=o[r>>2]|0;while(1){if((o[n+4>>2]&-8|0)==(u|0)){w=216;break}r=n+16+(e>>>31<<2)|0;t=o[r>>2]|0;if(!t){w=215;break}else{e=e<<1;n=t}}if((w|0)==215){o[r>>2]=s;o[s+24>>2]=n;o[s+12>>2]=s;o[s+8>>2]=s;break}else if((w|0)==216){w=n+8|0;E=o[w>>2]|0;o[E+12>>2]=s;o[w>>2]=s;o[s+8>>2]=E;o[s+12>>2]=n;o[s+24>>2]=0;break}}}else{E=o[2787]|0;if((E|0)==0|u>>>0>>0)o[2787]=u;o[2895]=u;o[2896]=a;o[2898]=0;o[2792]=o[2901];o[2791]=-1;t=0;do{E=11172+(t<<1<<2)|0;o[E+12>>2]=E;o[E+8>>2]=E;t=t+1|0}while((t|0)!=32);E=u+8|0;E=(E&7|0)==0?0:0-E&7;w=u+E|0;E=a+-40-E|0;o[2789]=w;o[2786]=E;o[w+4>>2]=E|1;o[w+E+4>>2]=40;o[2790]=o[2905]}}while(0);t=o[2786]|0;if(t>>>0>d>>>0){b=t-d|0;o[2786]=b;E=o[2789]|0;w=E+d|0;o[2789]=w;o[w+4>>2]=b|1;o[E+4>>2]=d|3;E=E+8|0;h=D;return E|0}}o[(Jk()|0)>>2]=12;E=0;h=D;return E|0}function Gk(e){e=e|0;var t=0,n=0,r=0,i=0,u=0,a=0,l=0,s=0;if(!e)return;n=e+-8|0;i=o[2787]|0;e=o[e+-4>>2]|0;t=e&-8;s=n+t|0;do{if(!(e&1)){r=o[n>>2]|0;if(!(e&3))return;a=n+(0-r)|0;u=r+t|0;if(a>>>0>>0)return;if((a|0)==(o[2788]|0)){e=s+4|0;t=o[e>>2]|0;if((t&3|0)!=3){l=a;t=u;break}o[2785]=u;o[e>>2]=t&-2;o[a+4>>2]=u|1;o[a+u>>2]=u;return}n=r>>>3;if(r>>>0<256){e=o[a+8>>2]|0;t=o[a+12>>2]|0;if((t|0)==(e|0)){o[2783]=o[2783]&~(1<>2]=t;o[t+8>>2]=e;l=a;t=u;break}}i=o[a+24>>2]|0;e=o[a+12>>2]|0;do{if((e|0)==(a|0)){n=a+16|0;t=n+4|0;e=o[t>>2]|0;if(!e){e=o[n>>2]|0;if(!e){e=0;break}else t=n}while(1){n=e+20|0;r=o[n>>2]|0;if(r|0){e=r;t=n;continue}n=e+16|0;r=o[n>>2]|0;if(!r)break;else{e=r;t=n}}o[t>>2]=0}else{l=o[a+8>>2]|0;o[l+12>>2]=e;o[e+8>>2]=l}}while(0);if(i){t=o[a+28>>2]|0;n=11436+(t<<2)|0;if((a|0)==(o[n>>2]|0)){o[n>>2]=e;if(!e){o[2784]=o[2784]&~(1<>2]|0)!=(a|0)&1)<<2)>>2]=e;if(!e){l=a;t=u;break}}o[e+24>>2]=i;t=a+16|0;n=o[t>>2]|0;if(n|0){o[e+16>>2]=n;o[n+24>>2]=e}t=o[t+4>>2]|0;if(t){o[e+20>>2]=t;o[t+24>>2]=e;l=a;t=u}else{l=a;t=u}}else{l=a;t=u}}else{l=n;a=n}}while(0);if(a>>>0>=s>>>0)return;e=s+4|0;r=o[e>>2]|0;if(!(r&1))return;if(!(r&2)){e=o[2788]|0;if((s|0)==(o[2789]|0)){s=(o[2786]|0)+t|0;o[2786]=s;o[2789]=l;o[l+4>>2]=s|1;if((l|0)!=(e|0))return;o[2788]=0;o[2785]=0;return}if((s|0)==(e|0)){s=(o[2785]|0)+t|0;o[2785]=s;o[2788]=a;o[l+4>>2]=s|1;o[a+s>>2]=s;return}i=(r&-8)+t|0;n=r>>>3;do{if(r>>>0<256){t=o[s+8>>2]|0;e=o[s+12>>2]|0;if((e|0)==(t|0)){o[2783]=o[2783]&~(1<>2]=e;o[e+8>>2]=t;break}}else{u=o[s+24>>2]|0;e=o[s+12>>2]|0;do{if((e|0)==(s|0)){n=s+16|0;t=n+4|0;e=o[t>>2]|0;if(!e){e=o[n>>2]|0;if(!e){n=0;break}else t=n}while(1){n=e+20|0;r=o[n>>2]|0;if(r|0){e=r;t=n;continue}n=e+16|0;r=o[n>>2]|0;if(!r)break;else{e=r;t=n}}o[t>>2]=0;n=e}else{n=o[s+8>>2]|0;o[n+12>>2]=e;o[e+8>>2]=n;n=e}}while(0);if(u|0){e=o[s+28>>2]|0;t=11436+(e<<2)|0;if((s|0)==(o[t>>2]|0)){o[t>>2]=n;if(!n){o[2784]=o[2784]&~(1<>2]|0)!=(s|0)&1)<<2)>>2]=n;if(!n)break}o[n+24>>2]=u;e=s+16|0;t=o[e>>2]|0;if(t|0){o[n+16>>2]=t;o[t+24>>2]=n}e=o[e+4>>2]|0;if(e|0){o[n+20>>2]=e;o[e+24>>2]=n}}}}while(0);o[l+4>>2]=i|1;o[a+i>>2]=i;if((l|0)==(o[2788]|0)){o[2785]=i;return}}else{o[e>>2]=r&-2;o[l+4>>2]=t|1;o[a+t>>2]=t;i=t}e=i>>>3;if(i>>>0<256){n=11172+(e<<1<<2)|0;t=o[2783]|0;e=1<>2]|0}o[t>>2]=l;o[e+12>>2]=l;o[l+8>>2]=e;o[l+12>>2]=n;return}e=i>>>8;if(e){if(i>>>0>16777215)e=31;else{a=(e+1048320|0)>>>16&8;s=e<>>16&4;s=s<>>16&2;e=14-(u|a|e)+(s<>>15)|0;e=i>>>(e+7|0)&1|e<<1}}else e=0;r=11436+(e<<2)|0;o[l+28>>2]=e;o[l+20>>2]=0;o[l+16>>2]=0;t=o[2784]|0;n=1<>>1)|0);n=o[r>>2]|0;while(1){if((o[n+4>>2]&-8|0)==(i|0)){e=73;break}r=n+16+(t>>>31<<2)|0;e=o[r>>2]|0;if(!e){e=72;break}else{t=t<<1;n=e}}if((e|0)==72){o[r>>2]=l;o[l+24>>2]=n;o[l+12>>2]=l;o[l+8>>2]=l;break}else if((e|0)==73){a=n+8|0;s=o[a>>2]|0;o[s+12>>2]=l;o[a>>2]=l;o[l+8>>2]=s;o[l+12>>2]=n;o[l+24>>2]=0;break}}else{o[2784]=t|n;o[r>>2]=l;o[l+24>>2]=r;o[l+12>>2]=l;o[l+8>>2]=l}}while(0);s=(o[2791]|0)+-1|0;o[2791]=s;if(!s)e=11588;else return;while(1){e=o[e>>2]|0;if(!e)break;else e=e+8|0}o[2791]=-1;return}function $k(){return 11628}function Yk(e){e=e|0;var t=0,n=0;t=h;h=h+16|0;n=t;o[n>>2]=tT(o[e+60>>2]|0)|0;e=Qk(ut(6,n|0)|0)|0;h=t;return e|0}function Kk(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,v=0;d=h;h=h+48|0;c=d+16|0;u=d;i=d+32|0;l=e+28|0;r=o[l>>2]|0;o[i>>2]=r;s=e+20|0;r=(o[s>>2]|0)-r|0;o[i+4>>2]=r;o[i+8>>2]=t;o[i+12>>2]=n;r=r+n|0;a=e+60|0;o[u>>2]=o[a>>2];o[u+4>>2]=i;o[u+8>>2]=2;u=Qk(st(146,u|0)|0)|0;e:do{if((r|0)!=(u|0)){t=2;while(1){if((u|0)<0)break;r=r-u|0;v=o[i+4>>2]|0;p=u>>>0>v>>>0;i=p?i+8|0:i;t=(p<<31>>31)+t|0;v=u-(p?v:0)|0;o[i>>2]=(o[i>>2]|0)+v;p=i+4|0;o[p>>2]=(o[p>>2]|0)-v;o[c>>2]=o[a>>2];o[c+4>>2]=i;o[c+8>>2]=t;u=Qk(st(146,c|0)|0)|0;if((r|0)==(u|0)){f=3;break e}}o[e+16>>2]=0;o[l>>2]=0;o[s>>2]=0;o[e>>2]=o[e>>2]|32;if((t|0)==2)n=0;else n=n-(o[i+4>>2]|0)|0}else f=3}while(0);if((f|0)==3){v=o[e+44>>2]|0;o[e+16>>2]=v+(o[e+48>>2]|0);o[l>>2]=v;o[s>>2]=v}h=d;return n|0}function Xk(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0;i=h;h=h+32|0;u=i;r=i+20|0;o[u>>2]=o[e+60>>2];o[u+4>>2]=0;o[u+8>>2]=t;o[u+12>>2]=r;o[u+16>>2]=n;if((Qk(lt(140,u|0)|0)|0)<0){o[r>>2]=-1;e=-1}else e=o[r>>2]|0;h=i;return e|0}function Qk(e){e=e|0;if(e>>>0>4294963200){o[(Jk()|0)>>2]=0-e;e=-1}return e|0}function Jk(){return(Zk()|0)+64|0}function Zk(){return eT()|0}function eT(){return 2084}function tT(e){e=e|0;return e|0}function nT(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,u=0;u=h;h=h+32|0;i=u;o[e+36>>2]=1;if((o[e>>2]&64|0)==0?(o[i>>2]=o[e+60>>2],o[i+4>>2]=21523,o[i+8>>2]=u+16,Qe(54,i|0)|0):0)r[e+75>>0]=-1;i=Kk(e,t,n)|0;h=u;return i|0}function rT(e,t){e=e|0;t=t|0;var n=0,i=0;n=r[e>>0]|0;i=r[t>>0]|0;if(n<<24>>24==0?1:n<<24>>24!=i<<24>>24)e=i;else{do{e=e+1|0;t=t+1|0;n=r[e>>0]|0;i=r[t>>0]|0}while(!(n<<24>>24==0?1:n<<24>>24!=i<<24>>24));e=i}return(n&255)-(e&255)|0}function iT(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,o=0;e:do{if(!n)e=0;else{while(1){i=r[e>>0]|0;o=r[t>>0]|0;if(i<<24>>24!=o<<24>>24)break;n=n+-1|0;if(!n){e=0;break e}else{e=e+1|0;t=t+1|0}}e=(i&255)-(o&255)|0}}while(0);return e|0}function oT(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,v=0,m=0,g=0,y=0;y=h;h=h+224|0;d=y+120|0;p=y+80|0;m=y;g=y+136|0;i=p;u=i+40|0;do{o[i>>2]=0;i=i+4|0}while((i|0)<(u|0));o[d>>2]=o[n>>2];if((uT(0,t,d,m,p)|0)<0)n=-1;else{if((o[e+76>>2]|0)>-1)v=aT(e)|0;else v=0;n=o[e>>2]|0;f=n&32;if((r[e+74>>0]|0)<1)o[e>>2]=n&-33;i=e+48|0;if(!(o[i>>2]|0)){u=e+44|0;a=o[u>>2]|0;o[u>>2]=g;l=e+28|0;o[l>>2]=g;s=e+20|0;o[s>>2]=g;o[i>>2]=80;c=e+16|0;o[c>>2]=g+80;n=uT(e,t,d,m,p)|0;if(a){_A[o[e+36>>2]&7](e,0,0)|0;n=(o[s>>2]|0)==0?-1:n;o[u>>2]=a;o[i>>2]=0;o[c>>2]=0;o[l>>2]=0;o[s>>2]=0}}else n=uT(e,t,d,m,p)|0;i=o[e>>2]|0;o[e>>2]=i|f;if(v|0)lT(e);n=(i&32|0)==0?n:-1}h=y;return n|0}function uT(e,t,n,u,a){e=e|0;t=t|0;n=n|0;u=u|0;a=a|0;var l=0,s=0,f=0,d=0,p=0,v=0,m=0,g=0,y=0,_=0,b=0,w=0,E=0,D=0,S=0,C=0,k=0,T=0,x=0,O=0,P=0,I=0,N=0;N=h;h=h+64|0;x=N+16|0;O=N;k=N+24|0;P=N+8|0;I=N+20|0;o[x>>2]=t;D=(e|0)!=0;S=k+40|0;C=S;k=k+39|0;T=P+4|0;s=0;l=0;v=0;e:while(1){do{if((l|0)>-1)if((s|0)>(2147483647-l|0)){o[(Jk()|0)>>2]=75;l=-1;break}else{l=s+l|0;break}}while(0);s=r[t>>0]|0;if(!(s<<24>>24)){E=87;break}else f=t;t:while(1){switch(s<<24>>24){case 37:{s=f;E=9;break t}case 0:{s=f;break t}default:{}}w=f+1|0;o[x>>2]=w;s=r[w>>0]|0;f=w}t:do{if((E|0)==9)while(1){E=0;if((r[f+1>>0]|0)!=37)break t;s=s+1|0;f=f+2|0;o[x>>2]=f;if((r[f>>0]|0)==37)E=9;else break}}while(0);s=s-t|0;if(D)sT(e,t,s);if(s|0){t=f;continue}d=f+1|0;s=(r[d>>0]|0)+-48|0;if(s>>>0<10){w=(r[f+2>>0]|0)==36;b=w?s:-1;v=w?1:v;d=w?f+3|0:d}else b=-1;o[x>>2]=d;s=r[d>>0]|0;f=(s<<24>>24)+-32|0;t:do{if(f>>>0<32){p=0;m=s;while(1){s=1<>2]=d;s=r[d>>0]|0;f=(s<<24>>24)+-32|0;if(f>>>0>=32)break;else m=s}}else p=0}while(0);if(s<<24>>24==42){f=d+1|0;s=(r[f>>0]|0)+-48|0;if(s>>>0<10?(r[d+2>>0]|0)==36:0){o[a+(s<<2)>>2]=10;s=o[u+((r[f>>0]|0)+-48<<3)>>2]|0;v=1;d=d+3|0}else{if(v|0){l=-1;break}if(D){v=(o[n>>2]|0)+(4-1)&~(4-1);s=o[v>>2]|0;o[n>>2]=v+4;v=0;d=f}else{s=0;v=0;d=f}}o[x>>2]=d;w=(s|0)<0;s=w?0-s|0:s;p=w?p|8192:p}else{s=cT(x)|0;if((s|0)<0){l=-1;break}d=o[x>>2]|0}do{if((r[d>>0]|0)==46){if((r[d+1>>0]|0)!=42){o[x>>2]=d+1;f=cT(x)|0;d=o[x>>2]|0;break}m=d+2|0;f=(r[m>>0]|0)+-48|0;if(f>>>0<10?(r[d+3>>0]|0)==36:0){o[a+(f<<2)>>2]=10;f=o[u+((r[m>>0]|0)+-48<<3)>>2]|0;d=d+4|0;o[x>>2]=d;break}if(v|0){l=-1;break e}if(D){w=(o[n>>2]|0)+(4-1)&~(4-1);f=o[w>>2]|0;o[n>>2]=w+4}else f=0;o[x>>2]=m;d=m}else f=-1}while(0);_=0;while(1){if(((r[d>>0]|0)+-65|0)>>>0>57){l=-1;break e}w=d+1|0;o[x>>2]=w;m=r[(r[d>>0]|0)+-65+(5178+(_*58|0))>>0]|0;g=m&255;if((g+-1|0)>>>0<8){_=g;d=w}else break}if(!(m<<24>>24)){l=-1;break}y=(b|0)>-1;do{if(m<<24>>24==19){if(y){l=-1;break e}else E=49}else{if(y){o[a+(b<<2)>>2]=g;y=u+(b<<3)|0;b=o[y+4>>2]|0;E=O;o[E>>2]=o[y>>2];o[E+4>>2]=b;E=49;break}if(!D){l=0;break e}fT(O,g,n)}}while(0);if((E|0)==49?(E=0,!D):0){s=0;t=w;continue}d=r[d>>0]|0;d=(_|0)!=0&(d&15|0)==3?d&-33:d;y=p&-65537;b=(p&8192|0)==0?p:y;t:do{switch(d|0){case 110:switch((_&255)<<24>>24){case 0:{o[o[O>>2]>>2]=l;s=0;t=w;continue e}case 1:{o[o[O>>2]>>2]=l;s=0;t=w;continue e}case 2:{s=o[O>>2]|0;o[s>>2]=l;o[s+4>>2]=((l|0)<0)<<31>>31;s=0;t=w;continue e}case 3:{i[o[O>>2]>>1]=l;s=0;t=w;continue e}case 4:{r[o[O>>2]>>0]=l;s=0;t=w;continue e}case 6:{o[o[O>>2]>>2]=l;s=0;t=w;continue e}case 7:{s=o[O>>2]|0;o[s>>2]=l;o[s+4>>2]=((l|0)<0)<<31>>31;s=0;t=w;continue e}default:{s=0;t=w;continue e}}case 112:{d=120;f=f>>>0>8?f:8;t=b|8;E=61;break}case 88:case 120:{t=b;E=61;break}case 111:{d=O;t=o[d>>2]|0;d=o[d+4>>2]|0;g=pT(t,d,S)|0;y=C-g|0;p=0;m=5642;f=(b&8|0)==0|(f|0)>(y|0)?f:y+1|0;y=b;E=67;break}case 105:case 100:{d=O;t=o[d>>2]|0;d=o[d+4>>2]|0;if((d|0)<0){t=ZT(0,0,t|0,d|0)|0;d=A;p=O;o[p>>2]=t;o[p+4>>2]=d;p=1;m=5642;E=66;break t}else{p=(b&2049|0)!=0&1;m=(b&2048|0)==0?(b&1|0)==0?5642:5644:5643;E=66;break t}}case 117:{d=O;p=0;m=5642;t=o[d>>2]|0;d=o[d+4>>2]|0;E=66;break}case 99:{r[k>>0]=o[O>>2];t=k;p=0;m=5642;g=S;d=1;f=y;break}case 109:{d=vT(o[(Jk()|0)>>2]|0)|0;E=71;break}case 115:{d=o[O>>2]|0;d=d|0?d:5652;E=71;break}case 67:{o[P>>2]=o[O>>2];o[T>>2]=0;o[O>>2]=P;g=-1;d=P;E=75;break}case 83:{t=o[O>>2]|0;if(!f){gT(e,32,s,0,b);t=0;E=84}else{g=f;d=t;E=75}break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{s=_T(e,+c[O>>3],s,f,b,d)|0;t=w;continue e}default:{p=0;m=5642;g=S;d=f;f=b}}}while(0);t:do{if((E|0)==61){b=O;_=o[b>>2]|0;b=o[b+4>>2]|0;g=dT(_,b,S,d&32)|0;m=(t&8|0)==0|(_|0)==0&(b|0)==0;p=m?0:2;m=m?5642:5642+(d>>4)|0;y=t;t=_;d=b;E=67}else if((E|0)==66){g=hT(t,d,S)|0;y=b;E=67}else if((E|0)==71){E=0;b=mT(d,0,f)|0;_=(b|0)==0;t=d;p=0;m=5642;g=_?d+f|0:b;d=_?f:b-d|0;f=y}else if((E|0)==75){E=0;m=d;t=0;f=0;while(1){p=o[m>>2]|0;if(!p)break;f=yT(I,p)|0;if((f|0)<0|f>>>0>(g-t|0)>>>0)break;t=f+t|0;if(g>>>0>t>>>0)m=m+4|0;else break}if((f|0)<0){l=-1;break e}gT(e,32,s,t,b);if(!t){t=0;E=84}else{p=0;while(1){f=o[d>>2]|0;if(!f){E=84;break t}f=yT(I,f)|0;p=f+p|0;if((p|0)>(t|0)){E=84;break t}sT(e,I,f);if(p>>>0>=t>>>0){E=84;break}else d=d+4|0}}}}while(0);if((E|0)==67){E=0;d=(t|0)!=0|(d|0)!=0;b=(f|0)!=0|d;d=((d^1)&1)+(C-g)|0;t=b?g:S;g=S;d=b?(f|0)>(d|0)?f:d:f;f=(f|0)>-1?y&-65537:y}else if((E|0)==84){E=0;gT(e,32,s,t,b^8192);s=(s|0)>(t|0)?s:t;t=w;continue}_=g-t|0;y=(d|0)<(_|0)?_:d;b=y+p|0;s=(s|0)<(b|0)?b:s;gT(e,32,s,b,f);sT(e,m,p);gT(e,48,s,b,f^65536);gT(e,48,y,_,0);sT(e,t,_);gT(e,32,s,b,f^8192);t=w}e:do{if((E|0)==87)if(!e)if(!v)l=0;else{l=1;while(1){t=o[a+(l<<2)>>2]|0;if(!t)break;fT(u+(l<<3)|0,t,n);l=l+1|0;if((l|0)>=10){l=1;break e}}while(1){if(o[a+(l<<2)>>2]|0){l=-1;break e}l=l+1|0;if((l|0)>=10){l=1;break}}}}while(0);h=N;return l|0}function aT(e){e=e|0;return 0}function lT(e){e=e|0;return}function sT(e,t,n){e=e|0;t=t|0;n=n|0;if(!(o[e>>2]&32))PT(t,n,e)|0;return}function cT(e){e=e|0;var t=0,n=0,i=0;n=o[e>>2]|0;i=(r[n>>0]|0)+-48|0;if(i>>>0<10){t=0;do{t=i+(t*10|0)|0;n=n+1|0;o[e>>2]=n;i=(r[n>>0]|0)+-48|0}while(i>>>0<10)}else t=0;return t|0}function fT(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0.0;e:do{if(t>>>0<=20)do{switch(t|0){case 9:{r=(o[n>>2]|0)+(4-1)&~(4-1);t=o[r>>2]|0;o[n>>2]=r+4;o[e>>2]=t;break e}case 10:{r=(o[n>>2]|0)+(4-1)&~(4-1);t=o[r>>2]|0;o[n>>2]=r+4;r=e;o[r>>2]=t;o[r+4>>2]=((t|0)<0)<<31>>31;break e}case 11:{r=(o[n>>2]|0)+(4-1)&~(4-1);t=o[r>>2]|0;o[n>>2]=r+4;r=e;o[r>>2]=t;o[r+4>>2]=0;break e}case 12:{r=(o[n>>2]|0)+(8-1)&~(8-1);t=r;i=o[t>>2]|0;t=o[t+4>>2]|0;o[n>>2]=r+8;r=e;o[r>>2]=i;o[r+4>>2]=t;break e}case 13:{i=(o[n>>2]|0)+(4-1)&~(4-1);r=o[i>>2]|0;o[n>>2]=i+4;r=(r&65535)<<16>>16;i=e;o[i>>2]=r;o[i+4>>2]=((r|0)<0)<<31>>31;break e}case 14:{i=(o[n>>2]|0)+(4-1)&~(4-1);r=o[i>>2]|0;o[n>>2]=i+4;i=e;o[i>>2]=r&65535;o[i+4>>2]=0;break e}case 15:{i=(o[n>>2]|0)+(4-1)&~(4-1);r=o[i>>2]|0;o[n>>2]=i+4;r=(r&255)<<24>>24;i=e;o[i>>2]=r;o[i+4>>2]=((r|0)<0)<<31>>31;break e}case 16:{i=(o[n>>2]|0)+(4-1)&~(4-1);r=o[i>>2]|0;o[n>>2]=i+4;i=e;o[i>>2]=r&255;o[i+4>>2]=0;break e}case 17:{i=(o[n>>2]|0)+(8-1)&~(8-1);u=+c[i>>3];o[n>>2]=i+8;c[e>>3]=u;break e}case 18:{i=(o[n>>2]|0)+(8-1)&~(8-1);u=+c[i>>3];o[n>>2]=i+8;c[e>>3]=u;break e}default:break e}}while(0)}while(0);return}function dT(e,t,n,i){e=e|0;t=t|0;n=n|0;i=i|0;if(!((e|0)==0&(t|0)==0))do{n=n+-1|0;r[n>>0]=u[5694+(e&15)>>0]|0|i;e=rx(e|0,t|0,4)|0;t=A}while(!((e|0)==0&(t|0)==0));return n|0}function pT(e,t,n){e=e|0;t=t|0;n=n|0;if(!((e|0)==0&(t|0)==0))do{n=n+-1|0;r[n>>0]=e&7|48;e=rx(e|0,t|0,3)|0;t=A}while(!((e|0)==0&(t|0)==0));return n|0}function hT(e,t,n){e=e|0;t=t|0;n=n|0;var i=0;if(t>>>0>0|(t|0)==0&e>>>0>4294967295){while(1){i=cx(e|0,t|0,10,0)|0;n=n+-1|0;r[n>>0]=i&255|48;i=e;e=ax(e|0,t|0,10,0)|0;if(!(t>>>0>9|(t|0)==9&i>>>0>4294967295))break;else t=A}t=e}else t=e;if(t)while(1){n=n+-1|0;r[n>>0]=(t>>>0)%10|0|48;if(t>>>0<10)break;else t=(t>>>0)/10|0}return n|0}function vT(e){e=e|0;return kT(e,o[(CT()|0)+188>>2]|0)|0}function mT(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,u=0,a=0,l=0;a=t&255;i=(n|0)!=0;e:do{if(i&(e&3|0)!=0){u=t&255;while(1){if((r[e>>0]|0)==u<<24>>24){l=6;break e}e=e+1|0;n=n+-1|0;i=(n|0)!=0;if(!(i&(e&3|0)!=0)){l=5;break}}}else l=5}while(0);if((l|0)==5)if(i)l=6;else n=0;e:do{if((l|0)==6){u=t&255;if((r[e>>0]|0)!=u<<24>>24){i=V(a,16843009)|0;t:do{if(n>>>0>3)while(1){a=o[e>>2]^i;if((a&-2139062144^-2139062144)&a+-16843009|0)break;e=e+4|0;n=n+-4|0;if(n>>>0<=3){l=11;break t}}else l=11}while(0);if((l|0)==11)if(!n){n=0;break}while(1){if((r[e>>0]|0)==u<<24>>24)break e;e=e+1|0;n=n+-1|0;if(!n){n=0;break}}}}}while(0);return(n|0?e:0)|0}function gT(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;var o=0,u=0;u=h;h=h+256|0;o=u;if((n|0)>(r|0)&(i&73728|0)==0){i=n-r|0;tx(o|0,t|0,(i>>>0<256?i:256)|0)|0;if(i>>>0>255){t=n-r|0;do{sT(e,o,256);i=i+-256|0}while(i>>>0>255);i=t&255}sT(e,o,i)}h=u;return}function yT(e,t){e=e|0;t=t|0;if(!e)e=0;else e=DT(e,t,0)|0;return e|0}function _T(e,t,n,i,a,l){e=e|0;t=+t;n=n|0;i=i|0;a=a|0;l=l|0;var s=0,c=0,f=0,d=0,p=0,v=0,m=0,g=0.0,y=0,_=0,b=0,w=0,E=0,D=0,S=0,C=0,k=0,T=0,x=0,O=0,P=0,I=0,N=0;N=h;h=h+560|0;f=N+8|0;b=N;I=N+524|0;P=I;d=N+512|0;o[b>>2]=0;O=d+12|0;bT(t)|0;if((A|0)<0){t=-t;T=1;k=5659}else{T=(a&2049|0)!=0&1;k=(a&2048|0)==0?(a&1|0)==0?5660:5665:5662}bT(t)|0;x=A&2146435072;do{if(x>>>0<2146435072|(x|0)==2146435072&0<0){g=+wT(t,b)*2.0;s=g!=0.0;if(s)o[b>>2]=(o[b>>2]|0)+-1;E=l|32;if((E|0)==97){y=l&32;m=(y|0)==0?k:k+9|0;v=T|2;s=12-i|0;do{if(!(i>>>0>11|(s|0)==0)){t=8.0;do{s=s+-1|0;t=t*16.0}while((s|0)!=0);if((r[m>>0]|0)==45){t=-(t+(-g-t));break}else{t=g+t-t;break}}else t=g}while(0);c=o[b>>2]|0;s=(c|0)<0?0-c|0:c;s=hT(s,((s|0)<0)<<31>>31,O)|0;if((s|0)==(O|0)){s=d+11|0;r[s>>0]=48}r[s+-1>>0]=(c>>31&2)+43;p=s+-2|0;r[p>>0]=l+15;d=(i|0)<1;f=(a&8|0)==0;s=I;do{x=~~t;c=s+1|0;r[s>>0]=u[5694+x>>0]|y;t=(t-+(x|0))*16.0;if((c-P|0)==1?!(f&(d&t==0.0)):0){r[c>>0]=46;s=s+2|0}else s=c}while(t!=0.0);x=s-P|0;P=O-p|0;O=(i|0)!=0&(x+-2|0)<(i|0)?i+2|0:x;s=P+v+O|0;gT(e,32,n,s,a);sT(e,m,v);gT(e,48,n,s,a^65536);sT(e,I,x);gT(e,48,O-x|0,0,0);sT(e,p,P);gT(e,32,n,s,a^8192);break}c=(i|0)<0?6:i;if(s){s=(o[b>>2]|0)+-28|0;o[b>>2]=s;t=g*268435456.0}else{t=g;s=o[b>>2]|0}x=(s|0)<0?f:f+288|0;f=x;do{S=~~t>>>0;o[f>>2]=S;f=f+4|0;t=(t-+(S>>>0))*1.0e9}while(t!=0.0);if((s|0)>0){d=x;v=f;while(1){p=(s|0)<29?s:29;s=v+-4|0;if(s>>>0>=d>>>0){f=0;do{D=nx(o[s>>2]|0,0,p|0)|0;D=ex(D|0,A|0,f|0,0)|0;S=A;w=cx(D|0,S|0,1e9,0)|0;o[s>>2]=w;f=ax(D|0,S|0,1e9,0)|0;s=s+-4|0}while(s>>>0>=d>>>0);if(f){d=d+-4|0;o[d>>2]=f}}f=v;while(1){if(f>>>0<=d>>>0)break;s=f+-4|0;if(!(o[s>>2]|0))f=s;else break}s=(o[b>>2]|0)-p|0;o[b>>2]=s;if((s|0)>0)v=f;else break}}else d=x;if((s|0)<0){i=((c+25|0)/9|0)+1|0;_=(E|0)==102;do{y=0-s|0;y=(y|0)<9?y:9;if(d>>>0>>0){p=(1<>>y;m=0;s=d;do{S=o[s>>2]|0;o[s>>2]=(S>>>y)+m;m=V(S&p,v)|0;s=s+4|0}while(s>>>0>>0);s=(o[d>>2]|0)==0?d+4|0:d;if(!m){d=s;s=f}else{o[f>>2]=m;d=s;s=f+4|0}}else{d=(o[d>>2]|0)==0?d+4|0:d;s=f}f=_?x:d;f=(s-f>>2|0)>(i|0)?f+(i<<2)|0:s;s=(o[b>>2]|0)+y|0;o[b>>2]=s}while((s|0)<0);s=d;i=f}else{s=d;i=f}S=x;if(s>>>0>>0){f=(S-s>>2)*9|0;p=o[s>>2]|0;if(p>>>0>=10){d=10;do{d=d*10|0;f=f+1|0}while(p>>>0>=d>>>0)}}else f=0;_=(E|0)==103;w=(c|0)!=0;d=c-((E|0)!=102?f:0)+((w&_)<<31>>31)|0;if((d|0)<(((i-S>>2)*9|0)+-9|0)){d=d+9216|0;y=x+4+(((d|0)/9|0)+-1024<<2)|0;d=((d|0)%9|0)+1|0;if((d|0)<9){p=10;do{p=p*10|0;d=d+1|0}while((d|0)!=9)}else p=10;v=o[y>>2]|0;m=(v>>>0)%(p>>>0)|0;d=(y+4|0)==(i|0);if(!(d&(m|0)==0)){g=(((v>>>0)/(p>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;D=(p|0)/2|0;t=m>>>0>>0?.5:d&(m|0)==(D|0)?1.0:1.5;if(T){D=(r[k>>0]|0)==45;t=D?-t:t;g=D?-g:g}d=v-m|0;o[y>>2]=d;if(g+t!=g){D=d+p|0;o[y>>2]=D;if(D>>>0>999999999){f=y;while(1){d=f+-4|0;o[f>>2]=0;if(d>>>0>>0){s=s+-4|0;o[s>>2]=0}D=(o[d>>2]|0)+1|0;o[d>>2]=D;if(D>>>0>999999999)f=d;else break}}else d=y;f=(S-s>>2)*9|0;v=o[s>>2]|0;if(v>>>0>=10){p=10;do{p=p*10|0;f=f+1|0}while(v>>>0>=p>>>0)}}else d=y}else d=y;d=d+4|0;d=i>>>0>d>>>0?d:i;D=s}else{d=i;D=s}E=d;while(1){if(E>>>0<=D>>>0){b=0;break}s=E+-4|0;if(!(o[s>>2]|0))E=s;else{b=1;break}}i=0-f|0;do{if(_){s=((w^1)&1)+c|0;if((s|0)>(f|0)&(f|0)>-5){p=l+-1|0;c=s+-1-f|0}else{p=l+-2|0;c=s+-1|0}s=a&8;if(!s){if(b?(C=o[E+-4>>2]|0,(C|0)!=0):0){if(!((C>>>0)%10|0)){d=0;s=10;do{s=s*10|0;d=d+1|0}while(!((C>>>0)%(s>>>0)|0|0))}else d=0}else d=9;s=((E-S>>2)*9|0)+-9|0;if((p|32|0)==102){y=s-d|0;y=(y|0)>0?y:0;c=(c|0)<(y|0)?c:y;y=0;break}else{y=s+f-d|0;y=(y|0)>0?y:0;c=(c|0)<(y|0)?c:y;y=0;break}}else y=s}else{p=l;y=a&8}}while(0);_=c|y;v=(_|0)!=0&1;m=(p|32|0)==102;if(m){w=0;s=(f|0)>0?f:0}else{s=(f|0)<0?i:f;s=hT(s,((s|0)<0)<<31>>31,O)|0;d=O;if((d-s|0)<2)do{s=s+-1|0;r[s>>0]=48}while((d-s|0)<2);r[s+-1>>0]=(f>>31&2)+43;s=s+-2|0;r[s>>0]=p;w=s;s=d-s|0}s=T+1+c+v+s|0;gT(e,32,n,s,a);sT(e,k,T);gT(e,48,n,s,a^65536);if(m){p=D>>>0>x>>>0?x:D;y=I+9|0;v=y;m=I+8|0;d=p;do{f=hT(o[d>>2]|0,0,y)|0;if((d|0)==(p|0)){if((f|0)==(y|0)){r[m>>0]=48;f=m}}else if(f>>>0>I>>>0){tx(I|0,48,f-P|0)|0;do{f=f+-1|0}while(f>>>0>I>>>0)}sT(e,f,v-f|0);d=d+4|0}while(d>>>0<=x>>>0);if(_|0)sT(e,5710,1);if(d>>>0>>0&(c|0)>0)while(1){f=hT(o[d>>2]|0,0,y)|0;if(f>>>0>I>>>0){tx(I|0,48,f-P|0)|0;do{f=f+-1|0}while(f>>>0>I>>>0)}sT(e,f,(c|0)<9?c:9);d=d+4|0;f=c+-9|0;if(!(d>>>0>>0&(c|0)>9)){c=f;break}else c=f}gT(e,48,c+9|0,9,0)}else{_=b?E:D+4|0;if((c|0)>-1){b=I+9|0;y=(y|0)==0;i=b;v=0-P|0;m=I+8|0;p=D;do{f=hT(o[p>>2]|0,0,b)|0;if((f|0)==(b|0)){r[m>>0]=48;f=m}do{if((p|0)==(D|0)){d=f+1|0;sT(e,f,1);if(y&(c|0)<1){f=d;break}sT(e,5710,1);f=d}else{if(f>>>0<=I>>>0)break;tx(I|0,48,f+v|0)|0;do{f=f+-1|0}while(f>>>0>I>>>0)}}while(0);P=i-f|0;sT(e,f,(c|0)>(P|0)?P:c);c=c-P|0;p=p+4|0}while(p>>>0<_>>>0&(c|0)>-1)}gT(e,48,c+18|0,18,0);sT(e,w,O-w|0)}gT(e,32,n,s,a^8192)}else{I=(l&32|0)!=0;s=T+3|0;gT(e,32,n,s,a&-65537);sT(e,k,T);sT(e,t!=t|0.0!=0.0?I?5686:5690:I?5678:5682,3);gT(e,32,n,s,a^8192)}}while(0);h=N;return((s|0)<(n|0)?n:s)|0}function bT(e){e=+e;var t=0;c[d>>3]=e;t=o[d>>2]|0;A=o[d+4>>2]|0;return t|0}function wT(e,t){e=+e;t=t|0;return+ +ET(e,t)}function ET(e,t){e=+e;t=t|0;var n=0,r=0,i=0;c[d>>3]=e;n=o[d>>2]|0;r=o[d+4>>2]|0;i=rx(n|0,r|0,52)|0;switch(i&2047){case 0:{if(e!=0.0){e=+ET(e*18446744073709551616.0,t);n=(o[t>>2]|0)+-64|0}else n=0;o[t>>2]=n;break}case 2047:break;default:{o[t>>2]=(i&2047)+-1022;o[d>>2]=n;o[d+4>>2]=r&-2146435073|1071644672;e=+c[d>>3]}}return+e}function DT(e,t,n){e=e|0;t=t|0;n=n|0;do{if(e){if(t>>>0<128){r[e>>0]=t;e=1;break}if(!(o[o[(ST()|0)+188>>2]>>2]|0))if((t&-128|0)==57216){r[e>>0]=t;e=1;break}else{o[(Jk()|0)>>2]=84;e=-1;break}if(t>>>0<2048){r[e>>0]=t>>>6|192;r[e+1>>0]=t&63|128;e=2;break}if(t>>>0<55296|(t&-8192|0)==57344){r[e>>0]=t>>>12|224;r[e+1>>0]=t>>>6&63|128;r[e+2>>0]=t&63|128;e=3;break}if((t+-65536|0)>>>0<1048576){r[e>>0]=t>>>18|240;r[e+1>>0]=t>>>12&63|128;r[e+2>>0]=t>>>6&63|128;r[e+3>>0]=t&63|128;e=4;break}else{o[(Jk()|0)>>2]=84;e=-1;break}}else e=1}while(0);return e|0}function ST(){return eT()|0}function CT(){return eT()|0}function kT(e,t){e=e|0;t=t|0;var n=0,i=0;i=0;while(1){if((u[5712+i>>0]|0)==(e|0)){e=2;break}n=i+1|0;if((n|0)==87){n=5800;i=87;e=5;break}else i=n}if((e|0)==2)if(!i)n=5800;else{n=5800;e=5}if((e|0)==5)while(1){do{e=n;n=n+1|0}while((r[e>>0]|0)!=0);i=i+-1|0;if(!i)break;else e=5}return TT(n,o[t+20>>2]|0)|0}function TT(e,t){e=e|0;t=t|0;return xT(e,t)|0}function xT(e,t){e=e|0;t=t|0;if(!t)t=0;else t=AT(o[t>>2]|0,o[t+4>>2]|0,e)|0;return(t|0?t:e)|0}function AT(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,h=0;h=(o[e>>2]|0)+1794895138|0;a=OT(o[e+8>>2]|0,h)|0;i=OT(o[e+12>>2]|0,h)|0;u=OT(o[e+16>>2]|0,h)|0;e:do{if((a>>>0>>2>>>0?(p=t-(a<<2)|0,i>>>0

>>0&u>>>0

>>0&u>>>0

>>0):0)?((u|i)&3|0)==0:0){p=i>>>2;d=u>>>2;f=0;while(1){s=a>>>1;c=f+s|0;l=c<<1;u=l+p|0;i=OT(o[e+(u<<2)>>2]|0,h)|0;u=OT(o[e+(u+1<<2)>>2]|0,h)|0;if(!(u>>>0>>0&i>>>0<(t-u|0)>>>0)){i=0;break e}if(r[e+(u+i)>>0]|0){i=0;break e}i=rT(n,e+u|0)|0;if(!i)break;i=(i|0)<0;if((a|0)==1){i=0;break e}else{f=i?f:c;a=i?s:a-s|0}}i=l+d|0;u=OT(o[e+(i<<2)>>2]|0,h)|0;i=OT(o[e+(i+1<<2)>>2]|0,h)|0;if(i>>>0>>0&u>>>0<(t-i|0)>>>0)i=(r[e+(i+u)>>0]|0)==0?e+i|0:0;else i=0}else i=0}while(0);return i|0}function OT(e,t){e=e|0;t=t|0;var n=0;n=fx(e|0)|0;return((t|0)==0?e:n)|0}function MT(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,u=0,a=0,l=0,s=0;i=n+16|0;u=o[i>>2]|0;if(!u){if(!(IT(n)|0)){u=o[i>>2]|0;a=5}else i=0}else a=5;e:do{if((a|0)==5){s=n+20|0;l=o[s>>2]|0;i=l;if((u-l|0)>>>0>>0){i=yA[o[n+36>>2]&7](n,e,t)|0;break}t:do{if((r[n+75>>0]|0)>-1){l=t;while(1){if(!l){a=0;u=e;break t}u=l+-1|0;if((r[e+u>>0]|0)==10)break;else l=u}i=yA[o[n+36>>2]&7](n,e,l)|0;if(i>>>0>>0)break e;a=l;u=e+l|0;t=t-l|0;i=o[s>>2]|0}else{a=0;u=e}}while(0);ix(i|0,u|0,t|0)|0;o[s>>2]=(o[s>>2]|0)+t;i=a+t|0}}while(0);return i|0}function IT(e){e=e|0;var t=0,n=0;t=e+74|0;n=r[t>>0]|0;r[t>>0]=n+255|n;t=o[e>>2]|0;if(!(t&8)){o[e+8>>2]=0;o[e+4>>2]=0;n=o[e+44>>2]|0;o[e+28>>2]=n;o[e+20>>2]=n;o[e+16>>2]=n+(o[e+48>>2]|0);e=0}else{o[e>>2]=t|32;e=-1}return e|0}function RT(e,t){e=Y(e);t=Y(t);var n=0,r=0;n=NT(e)|0;do{if((n&2147483647)>>>0<=2139095040){r=NT(t)|0;if((r&2147483647)>>>0<=2139095040)if((r^n|0)<0){e=(n|0)<0?t:e;break}else{e=e>2]=e,o[d>>2]|0)|0}function PT(e,t){e=Y(e);t=Y(t);var n=0,r=0;n=FT(e)|0;do{if((n&2147483647)>>>0<=2139095040){r=FT(t)|0;if((r&2147483647)>>>0<=2139095040)if((r^n|0)<0){e=(n|0)<0?e:t;break}else{e=e>2]=e,o[d>>2]|0)|0}function LT(e,t){e=Y(e);t=Y(t);var n=0,r=0,i=0,u=0,a=0,l=0,c=0,f=0;u=(s[d>>2]=e,o[d>>2]|0);l=(s[d>>2]=t,o[d>>2]|0);n=u>>>23&255;a=l>>>23&255;c=u&-2147483648;i=l<<1;e:do{if((i|0)!=0?!((n|0)==255|((BT(t)|0)&2147483647)>>>0>2139095040):0){r=u<<1;if(r>>>0<=i>>>0){t=Y(e*Y(0.0));return Y((r|0)==(i|0)?t:e)}if(!n){n=u<<9;if((n|0)>-1){r=n;n=0;do{n=n+-1|0;r=r<<1}while((r|0)>-1)}else n=0;r=u<<1-n}else r=u&8388607|8388608;if(!a){u=l<<9;if((u|0)>-1){i=0;do{i=i+-1|0;u=u<<1}while((u|0)>-1)}else i=0;a=i;l=l<<1-i}else l=l&8388607|8388608;i=r-l|0;u=(i|0)>-1;t:do{if((n|0)>(a|0)){while(1){if(u)if(!i)break;else r=i;r=r<<1;n=n+-1|0;i=r-l|0;u=(i|0)>-1;if((n|0)<=(a|0))break t}t=Y(e*Y(0.0));break e}}while(0);if(u)if(!i){t=Y(e*Y(0.0));break}else r=i;if(r>>>0<8388608)do{r=r<<1;n=n+-1|0}while(r>>>0<8388608);if((n|0)>0)n=r+-8388608|n<<23;else n=r>>>(1-n|0);t=(o[d>>2]=n|c,Y(s[d>>2]))}else f=3}while(0);if((f|0)==3){t=Y(e*t);t=Y(t/t)}return Y(t)}function BT(e){e=Y(e);return(s[d>>2]=e,o[d>>2]|0)|0}function UT(e,t){e=e|0;t=t|0;return oT(o[582]|0,e,t)|0}function jT(e){e=e|0;Ye()}function zT(e){e=e|0;return}function WT(e,t){e=e|0;t=t|0;return 0}function HT(e){e=e|0;if((VT(e+4|0)|0)==-1){hA[o[(o[e>>2]|0)+8>>2]&127](e);e=1}else e=0;return e|0}function VT(e){e=e|0;var t=0;t=o[e>>2]|0;o[e>>2]=t+-1;return t+-1|0}function $T(e){e=e|0;if(HT(e)|0)GT(e);return}function GT(e){e=e|0;var t=0;t=e+8|0;if(!((o[t>>2]|0)!=0?(VT(t)|0)!=-1:0))hA[o[(o[e>>2]|0)+16>>2]&127](e);return}function qT(e){e=e|0;var t=0;t=(e|0)==0?1:e;while(1){e=$S(t)|0;if(e|0)break;e=JT()|0;if(!e){e=0;break}IA[e&0]()}return e|0}function YT(e){e=e|0;return qT(e)|0}function XT(e){e=e|0;GS(e);return}function KT(e){e=e|0;if((r[e+11>>0]|0)<0)XT(o[e>>2]|0);return}function JT(){var e=0;e=o[2923]|0;o[2923]=e+0;return e|0}function QT(){}function ZT(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;r=t-r-(n>>>0>e>>>0|0)>>>0;return(A=r,e-n>>>0|0)|0}function ex(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;n=e+n>>>0;return(A=t+r+(n>>>0>>0|0)>>>0,n|0)|0}function tx(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,u=0,a=0,l=0;a=e+n|0;t=t&255;if((n|0)>=67){while(e&3){r[e>>0]=t;e=e+1|0}i=a&-4|0;u=i-64|0;l=t|t<<8|t<<16|t<<24;while((e|0)<=(u|0)){o[e>>2]=l;o[e+4>>2]=l;o[e+8>>2]=l;o[e+12>>2]=l;o[e+16>>2]=l;o[e+20>>2]=l;o[e+24>>2]=l;o[e+28>>2]=l;o[e+32>>2]=l;o[e+36>>2]=l;o[e+40>>2]=l;o[e+44>>2]=l;o[e+48>>2]=l;o[e+52>>2]=l;o[e+56>>2]=l;o[e+60>>2]=l;e=e+64|0}while((e|0)<(i|0)){o[e>>2]=l;e=e+4|0}}while((e|0)<(a|0)){r[e>>0]=t;e=e+1|0}return a-n|0}function nx(e,t,n){e=e|0;t=t|0;n=n|0;if((n|0)<32){A=t<>>32-n;return e<>>n;return e>>>n|(t&(1<>>n-32|0}function ix(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,u=0,a=0;if((n|0)>=8192)return He(e|0,t|0,n|0)|0;a=e|0;u=e+n|0;if((e&3)==(t&3)){while(e&3){if(!n)return a|0;r[e>>0]=r[t>>0]|0;e=e+1|0;t=t+1|0;n=n-1|0}n=u&-4|0;i=n-64|0;while((e|0)<=(i|0)){o[e>>2]=o[t>>2];o[e+4>>2]=o[t+4>>2];o[e+8>>2]=o[t+8>>2];o[e+12>>2]=o[t+12>>2];o[e+16>>2]=o[t+16>>2];o[e+20>>2]=o[t+20>>2];o[e+24>>2]=o[t+24>>2];o[e+28>>2]=o[t+28>>2];o[e+32>>2]=o[t+32>>2];o[e+36>>2]=o[t+36>>2];o[e+40>>2]=o[t+40>>2];o[e+44>>2]=o[t+44>>2];o[e+48>>2]=o[t+48>>2];o[e+52>>2]=o[t+52>>2];o[e+56>>2]=o[t+56>>2];o[e+60>>2]=o[t+60>>2];e=e+64|0;t=t+64|0}while((e|0)<(n|0)){o[e>>2]=o[t>>2];e=e+4|0;t=t+4|0}}else{n=u-4|0;while((e|0)<(n|0)){r[e>>0]=r[t>>0]|0;r[e+1>>0]=r[t+1>>0]|0;r[e+2>>0]=r[t+2>>0]|0;r[e+3>>0]=r[t+3>>0]|0;e=e+4|0;t=t+4|0}}while((e|0)<(u|0)){r[e>>0]=r[t>>0]|0;e=e+1|0;t=t+1|0}return a|0}function ox(e){e=e|0;var t=0;t=r[m+(e&255)>>0]|0;if((t|0)<8)return t|0;t=r[m+(e>>8&255)>>0]|0;if((t|0)<8)return t+8|0;t=r[m+(e>>16&255)>>0]|0;if((t|0)<8)return t+16|0;return(r[m+(e>>>24)>>0]|0)+24|0}function ux(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;var u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,h=0,v=0;f=e;s=t;c=s;a=n;p=r;l=p;if(!c){u=(i|0)!=0;if(!l){if(u){o[i>>2]=(f>>>0)%(a>>>0);o[i+4>>2]=0}p=0;i=(f>>>0)/(a>>>0)>>>0;return(A=p,i)|0}else{if(!u){p=0;i=0;return(A=p,i)|0}o[i>>2]=e|0;o[i+4>>2]=t&0;p=0;i=0;return(A=p,i)|0}}u=(l|0)==0;do{if(a){if(!u){u=(q(l|0)|0)-(q(c|0)|0)|0;if(u>>>0<=31){d=u+1|0;l=31-u|0;t=u-31>>31;a=d;e=f>>>(d>>>0)&t|c<>>(d>>>0)&t;u=0;l=f<>2]=e|0;o[i+4>>2]=s|t&0;p=0;i=0;return(A=p,i)|0}u=a-1|0;if(u&a|0){l=(q(a|0)|0)+33-(q(c|0)|0)|0;v=64-l|0;d=32-l|0;s=d>>31;h=l-32|0;t=h>>31;a=l;e=d-1>>31&c>>>(h>>>0)|(c<>>(l>>>0))&t;t=t&c>>>(l>>>0);u=f<>>(h>>>0))&s|f<>31;break}if(i|0){o[i>>2]=u&f;o[i+4>>2]=0}if((a|0)==1){h=s|t&0;v=e|0|0;return(A=h,v)|0}else{v=ox(a|0)|0;h=c>>>(v>>>0)|0;v=c<<32-v|f>>>(v>>>0)|0;return(A=h,v)|0}}else{if(u){if(i|0){o[i>>2]=(c>>>0)%(a>>>0);o[i+4>>2]=0}h=0;v=(c>>>0)/(a>>>0)>>>0;return(A=h,v)|0}if(!f){if(i|0){o[i>>2]=0;o[i+4>>2]=(c>>>0)%(l>>>0)}h=0;v=(c>>>0)/(l>>>0)>>>0;return(A=h,v)|0}u=l-1|0;if(!(u&l)){if(i|0){o[i>>2]=e|0;o[i+4>>2]=u&c|t&0}h=0;v=c>>>((ox(l|0)|0)>>>0);return(A=h,v)|0}u=(q(l|0)|0)-(q(c|0)|0)|0;if(u>>>0<=30){t=u+1|0;l=31-u|0;a=t;e=c<>>(t>>>0);t=c>>>(t>>>0);u=0;l=f<>2]=e|0;o[i+4>>2]=s|t&0;h=0;v=0;return(A=h,v)|0}}while(0);if(!a){c=l;s=0;l=0}else{d=n|0|0;f=p|r&0;c=ex(d|0,f|0,-1,-1)|0;n=A;s=l;l=0;do{r=s;s=u>>>31|s<<1;u=l|u<<1;r=e<<1|r>>>31|0;p=e>>>31|t<<1|0;ZT(c|0,n|0,r|0,p|0)|0;v=A;h=v>>31|((v|0)<0?-1:0)<<1;l=h&1;e=ZT(r|0,p|0,h&d|0,(((v|0)<0?-1:0)>>31|((v|0)<0?-1:0)<<1)&f|0)|0;t=A;a=a-1|0}while((a|0)!=0);c=s;s=0}a=0;if(i|0){o[i>>2]=e;o[i+4>>2]=t}h=(u|0)>>>31|(c|a)<<1|(a<<1|u>>>31)&0|s;v=(u<<1|0>>>31)&-2|l;return(A=h,v)|0}function ax(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;return ux(e,t,n,r,0)|0}function lx(e){e=e|0;var t=0,n=0;n=e+15&-16|0;t=o[f>>2]|0;e=t+n|0;if((n|0)>0&(e|0)<(t|0)|(e|0)<0){Z()|0;$e(12);return-1}o[f>>2]=e;if((e|0)>(Q()|0)?(J()|0)==0:0){o[f>>2]=t;$e(12);return-1}return t|0}function sx(e,t,n){e=e|0;t=t|0;n=n|0;var i=0;if((t|0)<(e|0)&(e|0)<(t+n|0)){i=e;t=t+n|0;e=e+n|0;while((n|0)>0){e=e-1|0;t=t-1|0;n=n-1|0;r[e>>0]=r[t>>0]|0}e=i}else ix(e,t,n)|0;return e|0}function cx(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0;u=h;h=h+16|0;i=u|0;ux(e,t,n,r,i)|0;h=u;return(A=o[i+4>>2]|0,o[i>>2]|0)|0}function fx(e){e=e|0;return(e&255)<<24|(e>>8&255)<<16|(e>>16&255)<<8|e>>>24|0}function dx(e,t,n,r,i,o){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;o=o|0;cA[e&1](t|0,n|0,r|0,i|0,o|0)}function px(e,t,n){e=e|0;t=t|0;n=Y(n);fA[e&1](t|0,Y(n))}function hx(e,t,n){e=e|0;t=t|0;n=+n;dA[e&31](t|0,+n)}function vx(e,t,n,r){e=e|0;t=t|0;n=Y(n);r=Y(r);return Y(pA[e&0](t|0,Y(n),Y(r)))}function mx(e,t){e=e|0;t=t|0;hA[e&127](t|0)}function gx(e,t,n){e=e|0;t=t|0;n=n|0;vA[e&31](t|0,n|0)}function _x(e,t){e=e|0;t=t|0;return mA[e&31](t|0)|0}function yx(e,t,n,r,i){e=e|0;t=t|0;n=+n;r=+r;i=i|0;gA[e&1](t|0,+n,+r,i|0)}function bx(e,t,n,r){e=e|0;t=t|0;n=+n;r=+r;_A[e&1](t|0,+n,+r)}function wx(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;return yA[e&7](t|0,n|0,r|0)|0}function Ex(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;return+bA[e&1](t|0,n|0,r|0)}function Dx(e,t){e=e|0;t=t|0;return+wA[e&15](t|0)}function Cx(e,t,n){e=e|0;t=t|0;n=+n;return EA[e&1](t|0,+n)|0}function kx(e,t,n){e=e|0;t=t|0;n=n|0;return DA[e&15](t|0,n|0)|0}function Sx(e,t,n,r,i,o){e=e|0;t=t|0;n=n|0;r=+r;i=+i;o=o|0;CA[e&1](t|0,n|0,+r,+i,o|0)}function Tx(e,t,n,r,i,o,u){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;o=o|0;u=u|0;kA[e&1](t|0,n|0,r|0,i|0,o|0,u|0)}function xx(e,t,n){e=e|0;t=t|0;n=n|0;return+SA[e&7](t|0,n|0)}function Ax(e){e=e|0;return TA[e&7]()|0}function Ox(e,t,n,r,i,o){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;o=o|0;return xA[e&1](t|0,n|0,r|0,i|0,o|0)|0}function Mx(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=+i;AA[e&1](t|0,n|0,r|0,+i)}function Ix(e,t,n,r,i,o,u){e=e|0;t=t|0;n=n|0;r=Y(r);i=i|0;o=Y(o);u=u|0;OA[e&1](t|0,n|0,Y(r),i|0,Y(o),u|0)}function Rx(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;MA[e&15](t|0,n|0,r|0)}function Nx(e){e=e|0;IA[e&0]()}function Px(e,t,n,r){e=e|0;t=t|0;n=n|0;r=+r;RA[e&15](t|0,n|0,+r)}function Fx(e,t,n){e=e|0;t=+t;n=+n;return NA[e&1](+t,+n)|0}function Lx(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;PA[e&15](t|0,n|0,r|0,i|0)}function Bx(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;X(0)}function Ux(e,t){e=e|0;t=Y(t);X(1)}function jx(e,t){e=e|0;t=+t;X(2)}function zx(e,t,n){e=e|0;t=Y(t);n=Y(n);X(3);return ft}function Wx(e){e=e|0;X(4)}function Hx(e,t){e=e|0;t=t|0;X(5)}function Vx(e){e=e|0;X(6);return 0}function $x(e,t,n,r){e=e|0;t=+t;n=+n;r=r|0;X(7)}function Gx(e,t,n){e=e|0;t=+t;n=+n;X(8)}function qx(e,t,n){e=e|0;t=t|0;n=n|0;X(9);return 0}function Yx(e,t,n){e=e|0;t=t|0;n=n|0;X(10);return 0.0}function Xx(e){e=e|0;X(11);return 0.0}function Kx(e,t){e=e|0;t=+t;X(12);return 0}function Jx(e,t){e=e|0;t=t|0;X(13);return 0}function Qx(e,t,n,r,i){e=e|0;t=t|0;n=+n;r=+r;i=i|0;X(14)}function Zx(e,t,n,r,i,o){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;o=o|0;X(15)}function eA(e,t){e=e|0;t=t|0;X(16);return 0.0}function tA(){X(17);return 0}function nA(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;X(18);return 0}function rA(e,t,n,r){e=e|0;t=t|0;n=n|0;r=+r;X(19)}function iA(e,t,n,r,i,o){e=e|0;t=t|0;n=Y(n);r=r|0;i=Y(i);o=o|0;X(20)}function oA(e,t,n){e=e|0;t=t|0;n=n|0;X(21)}function uA(){X(22)}function aA(e,t,n){e=e|0;t=t|0;n=+n;X(23)}function lA(e,t){e=+e;t=+t;X(24);return 0}function sA(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;X(25)}var cA=[Bx,DE];var fA=[Ux,$i];var dA=[jx,_o,yo,bo,wo,Eo,Do,Co,So,To,Ao,Oo,Mo,Io,Ro,No,Po,Fo,Lo,jx,jx,jx,jx,jx,jx,jx,jx,jx,jx,jx,jx,jx];var pA=[zx];var hA=[Wx,zT,hl,vl,ml,Xd,Kd,Jd,_b,yb,bb,oE,uE,aE,uS,aS,lS,bt,Ki,to,ko,xo,Uu,ju,Xa,Cl,Wl,ps,Rs,rc,Sc,$c,df,Nf,Zf,_d,Ld,gp,Fp,th,bh,Uh,iv,Sv,Vv,am,xm,Wi,cg,Ag,Jg,__,F_,oy,gy,by,jy,Hy,ab,Db,Sb,Gb,pw,kl,OD,pC,MC,XC,bk,Bk,Kk,Zk,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx];var vA=[Hx,no,ro,uo,ao,lo,so,co,fo,vo,mo,go,eu,ru,iu,ou,uu,au,lu,pu,gu,Xu,Ov,qv,E_,RD,ww,eC,Hx,Hx,Hx,Hx];var mA=[Vx,YS,Xi,zo,$o,Go,qo,Yo,Xo,Ko,Qo,Zo,hu,vu,zu,Mm,j_,Xb,BD,jD,Vx,Vx,Vx,Vx,Vx,Vx,Vx,Vx,Vx,Vx,Vx,Vx];var gA=[$x,Wu];var _A=[Gx,cb];var yA=[qx,XS,KS,nT,ac,wp,hg,ZC];var bA=[Yx,rd];var wA=[Xx,tu,nu,su,Hu,Vu,$u,Gu,qu,Yu,Xx,Xx,Xx,Xx,Xx,Xx];var EA=[Kx,py];var DA=[Jx,WT,mu,tl,gs,Oc,Xc,zd,jp,fm,Gi,PC,Jx,Jx,Jx,Jx];var CA=[Qx,Gl];var kA=[Zx,Ck];var SA=[eA,cu,Ku,Ju,Qu,Ed,eA,eA];var TA=[tA,Zu,qi,ji,ky,qy,Mb,rS];var xA=[nA,Fr];var AA=[rA,Ch];var OA=[iA,yu];var MA=[oA,Wo,Jo,fu,du,Ls,mf,Hh,lv,Vi,QE,gC,Wk,oA,oA,oA];var IA=[uA];var RA=[aA,io,oo,po,ho,Bo,Uo,jo,oh,Rg,ly,aA,aA,aA,aA,aA];var NA=[lA,vb];var PA=[sA,Bf,Um,t_,X_,My,Zy,Bb,_w,$D,hS,sA,sA,sA,sA,sA];return{_llvm_bswap_i32:fx,dynCall_idd:Fx,dynCall_i:Ax,_i64Subtract:ZT,___udivdi3:ax,dynCall_vif:px,setThrew:mt,dynCall_viii:Rx,_bitshift64Lshr:rx,_bitshift64Shl:nx,dynCall_vi:mx,dynCall_viiddi:Sx,dynCall_diii:Ex,dynCall_iii:kx,_memset:tx,_sbrk:lx,_memcpy:ix,__GLOBAL__sub_I_Yoga_cpp:Ui,dynCall_vii:gx,___uremdi3:cx,dynCall_vid:hx,stackAlloc:dt,_nbind_init:AS,getTempRet0:_t,dynCall_di:Dx,dynCall_iid:Cx,setTempRet0:gt,_i64Add:ex,dynCall_fiff:vx,dynCall_iiii:wx,_emscripten_get_global_libc:qS,dynCall_viid:Px,dynCall_viiid:Mx,dynCall_viififi:Ix,dynCall_ii:_x,__GLOBAL__sub_I_Binding_cc:wD,dynCall_viiii:Lx,dynCall_iiiiii:Ox,stackSave:pt,dynCall_viiiii:dx,__GLOBAL__sub_I_nbind_cc:ea,dynCall_vidd:bx,_free:GS,runPostSets:QT,dynCall_viiiiii:Tx,establishStackSpace:vt,_memmove:sx,stackRestore:ht,_malloc:$S,__GLOBAL__sub_I_common_cc:iw,dynCall_viddi:yx,dynCall_dii:xx,dynCall_v:Nx}}(Module.asmGlobalArg,Module.asmLibraryArg,buffer),_llvm_bswap_i32=Module._llvm_bswap_i32=asm._llvm_bswap_i32,getTempRet0=Module.getTempRet0=asm.getTempRet0,___udivdi3=Module.___udivdi3=asm.___udivdi3,setThrew=Module.setThrew=asm.setThrew,_bitshift64Lshr=Module._bitshift64Lshr=asm._bitshift64Lshr,_bitshift64Shl=Module._bitshift64Shl=asm._bitshift64Shl,_memset=Module._memset=asm._memset,_sbrk=Module._sbrk=asm._sbrk,_memcpy=Module._memcpy=asm._memcpy,stackAlloc=Module.stackAlloc=asm.stackAlloc,___uremdi3=Module.___uremdi3=asm.___uremdi3,_nbind_init=Module._nbind_init=asm._nbind_init,_i64Subtract=Module._i64Subtract=asm._i64Subtract,setTempRet0=Module.setTempRet0=asm.setTempRet0,_i64Add=Module._i64Add=asm._i64Add,_emscripten_get_global_libc=Module._emscripten_get_global_libc=asm._emscripten_get_global_libc,__GLOBAL__sub_I_Yoga_cpp=Module.__GLOBAL__sub_I_Yoga_cpp=asm.__GLOBAL__sub_I_Yoga_cpp,__GLOBAL__sub_I_Binding_cc=Module.__GLOBAL__sub_I_Binding_cc=asm.__GLOBAL__sub_I_Binding_cc,stackSave=Module.stackSave=asm.stackSave,__GLOBAL__sub_I_nbind_cc=Module.__GLOBAL__sub_I_nbind_cc=asm.__GLOBAL__sub_I_nbind_cc,_free=Module._free=asm._free,runPostSets=Module.runPostSets=asm.runPostSets,establishStackSpace=Module.establishStackSpace=asm.establishStackSpace,_memmove=Module._memmove=asm._memmove,stackRestore=Module.stackRestore=asm.stackRestore,_malloc=Module._malloc=asm._malloc,__GLOBAL__sub_I_common_cc=Module.__GLOBAL__sub_I_common_cc=asm.__GLOBAL__sub_I_common_cc,dynCall_viiiii=Module.dynCall_viiiii=asm.dynCall_viiiii,dynCall_vif=Module.dynCall_vif=asm.dynCall_vif,dynCall_vid=Module.dynCall_vid=asm.dynCall_vid,dynCall_fiff=Module.dynCall_fiff=asm.dynCall_fiff,dynCall_vi=Module.dynCall_vi=asm.dynCall_vi,dynCall_vii=Module.dynCall_vii=asm.dynCall_vii,dynCall_ii=Module.dynCall_ii=asm.dynCall_ii,dynCall_viddi=Module.dynCall_viddi=asm.dynCall_viddi,dynCall_vidd=Module.dynCall_vidd=asm.dynCall_vidd,dynCall_iiii=Module.dynCall_iiii=asm.dynCall_iiii,dynCall_diii=Module.dynCall_diii=asm.dynCall_diii,dynCall_di=Module.dynCall_di=asm.dynCall_di,dynCall_iid=Module.dynCall_iid=asm.dynCall_iid,dynCall_iii=Module.dynCall_iii=asm.dynCall_iii,dynCall_viiddi=Module.dynCall_viiddi=asm.dynCall_viiddi,dynCall_viiiiii=Module.dynCall_viiiiii=asm.dynCall_viiiiii,dynCall_dii=Module.dynCall_dii=asm.dynCall_dii,dynCall_i=Module.dynCall_i=asm.dynCall_i,dynCall_iiiiii=Module.dynCall_iiiiii=asm.dynCall_iiiiii,dynCall_viiid=Module.dynCall_viiid=asm.dynCall_viiid,dynCall_viififi=Module.dynCall_viififi=asm.dynCall_viififi,dynCall_viii=Module.dynCall_viii=asm.dynCall_viii,dynCall_v=Module.dynCall_v=asm.dynCall_v,dynCall_viid=Module.dynCall_viid=asm.dynCall_viid,dynCall_idd=Module.dynCall_idd=asm.dynCall_idd,dynCall_viiii=Module.dynCall_viiii=asm.dynCall_viiii,initialStackTop;function ExitStatus(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}Runtime.stackAlloc=Module.stackAlloc,Runtime.stackSave=Module.stackSave,Runtime.stackRestore=Module.stackRestore,Runtime.establishStackSpace=Module.establishStackSpace,Runtime.setTempRet0=Module.setTempRet0,Runtime.getTempRet0=Module.getTempRet0,Module.asm=asm,ExitStatus.prototype=new Error,ExitStatus.prototype.constructor=ExitStatus;var preloadStartTime=null,calledMain=!1;function run(e){function t(){Module.calledRun||(Module.calledRun=!0,ABORT||(ensureInitRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),Module._main&&shouldRunNow&&Module.callMain(e),postRun()))}e=e||Module.arguments,null===preloadStartTime&&(preloadStartTime=Date.now()),runDependencies>0||(preRun(),runDependencies>0||Module.calledRun||(Module.setStatus?(Module.setStatus("Running..."),setTimeout((function(){setTimeout((function(){Module.setStatus("")}),1),t()}),1)):t()))}function exit(e,t){t&&Module.noExitRuntime||(Module.noExitRuntime||(ABORT=!0,EXITSTATUS=e,STACKTOP=initialStackTop,exitRuntime(),Module.onExit&&Module.onExit(e)),ENVIRONMENT_IS_NODE&&process.exit(e),Module.quit(e,new ExitStatus(e)))}dependenciesFulfilled=function e(){Module.calledRun||run(),Module.calledRun||(dependenciesFulfilled=e)},Module.callMain=Module.callMain=function(e){e=e||[],ensureInitRuntime();var t=e.length+1;function n(){for(var e=0;e<3;e++)r.push(0)}var r=[allocate(intArrayFromString(Module.thisProgram),"i8",ALLOC_NORMAL)];n();for(var i=0;i0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run()},void 0===(__WEBPACK_AMD_DEFINE_RESULT__=function(){return wrapper}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__=[]))||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)},3019:e=>{"use strict";e.exports={ALIGN_COUNT:8,ALIGN_AUTO:0,ALIGN_FLEX_START:1,ALIGN_CENTER:2,ALIGN_FLEX_END:3,ALIGN_STRETCH:4,ALIGN_BASELINE:5,ALIGN_SPACE_BETWEEN:6,ALIGN_SPACE_AROUND:7,DIMENSION_COUNT:2,DIMENSION_WIDTH:0,DIMENSION_HEIGHT:1,DIRECTION_COUNT:3,DIRECTION_INHERIT:0,DIRECTION_LTR:1,DIRECTION_RTL:2,DISPLAY_COUNT:2,DISPLAY_FLEX:0,DISPLAY_NONE:1,EDGE_COUNT:9,EDGE_LEFT:0,EDGE_TOP:1,EDGE_RIGHT:2,EDGE_BOTTOM:3,EDGE_START:4,EDGE_END:5,EDGE_HORIZONTAL:6,EDGE_VERTICAL:7,EDGE_ALL:8,EXPERIMENTAL_FEATURE_COUNT:1,EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS:0,FLEX_DIRECTION_COUNT:4,FLEX_DIRECTION_COLUMN:0,FLEX_DIRECTION_COLUMN_REVERSE:1,FLEX_DIRECTION_ROW:2,FLEX_DIRECTION_ROW_REVERSE:3,JUSTIFY_COUNT:6,JUSTIFY_FLEX_START:0,JUSTIFY_CENTER:1,JUSTIFY_FLEX_END:2,JUSTIFY_SPACE_BETWEEN:3,JUSTIFY_SPACE_AROUND:4,JUSTIFY_SPACE_EVENLY:5,LOG_LEVEL_COUNT:6,LOG_LEVEL_ERROR:0,LOG_LEVEL_WARN:1,LOG_LEVEL_INFO:2,LOG_LEVEL_DEBUG:3,LOG_LEVEL_VERBOSE:4,LOG_LEVEL_FATAL:5,MEASURE_MODE_COUNT:3,MEASURE_MODE_UNDEFINED:0,MEASURE_MODE_EXACTLY:1,MEASURE_MODE_AT_MOST:2,NODE_TYPE_COUNT:2,NODE_TYPE_DEFAULT:0,NODE_TYPE_TEXT:1,OVERFLOW_COUNT:3,OVERFLOW_VISIBLE:0,OVERFLOW_HIDDEN:1,OVERFLOW_SCROLL:2,POSITION_TYPE_COUNT:2,POSITION_TYPE_RELATIVE:0,POSITION_TYPE_ABSOLUTE:1,PRINT_OPTIONS_COUNT:3,PRINT_OPTIONS_LAYOUT:1,PRINT_OPTIONS_STYLE:2,PRINT_OPTIONS_CHILDREN:4,UNIT_COUNT:4,UNIT_UNDEFINED:0,UNIT_POINT:1,UNIT_PERCENT:2,UNIT_AUTO:3,WRAP_COUNT:3,WRAP_NO_WRAP:0,WRAP_WRAP:1,WRAP_WRAP_REVERSE:2}},6401:(e,t,n)=>{"use strict";var r=n(7180),i=n(3354),o=!1,u=null;if(i({},(function(e,t){if(!o){if(o=!0,e)throw e;u=t}})),!o)throw new Error("Failed to load the yoga module - it needed to be loaded synchronously, but didn't");e.exports=r(u.bind,u.lib)},7180:(e,t,n)=>{"use strict";var r=Object.assign||function(e){for(var t=1;t"}}]),e}(),s=function(){function e(t,n){u(this,e),this.width=t,this.height=n}return i(e,null,[{key:"fromJS",value:function(t){return new e(t.width,t.height)}}]),i(e,[{key:"fromJS",value:function(e){e(this.width,this.height)}},{key:"toString",value:function(){return""}}]),e}(),c=function(){function e(t,n){u(this,e),this.unit=t,this.value=n}return i(e,[{key:"fromJS",value:function(e){e(this.unit,this.value)}},{key:"toString",value:function(){switch(this.unit){case a.UNIT_POINT:return String(this.value);case a.UNIT_PERCENT:return this.value+"%";case a.UNIT_AUTO:return"auto";default:return this.value+"?"}}},{key:"valueOf",value:function(){return this.value}}]),e}();e.exports=function(e,t){function n(e,t,n){var r=e[t];e[t]=function(){for(var e=arguments.length,t=Array(e),i=0;i1?t-1:0),i=1;i1&&void 0!==arguments[1]?arguments[1]:NaN,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:NaN,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.DIRECTION_LTR;return e.call(this,t,n,r)})),r({Config:t.Config,Node:t.Node,Layout:e("Layout",l),Size:e("Size",s),Value:e("Value",c),getInstanceCount:function(){return t.getInstanceCount.apply(t,arguments)}},a)}},2357:e=>{"use strict";e.exports=require("assert")},6417:e=>{"use strict";e.exports=require("crypto")},8614:e=>{"use strict";e.exports=require("events")},5747:e=>{"use strict";e.exports=require("fs")},8605:e=>{"use strict";e.exports=require("http")},7211:e=>{"use strict";e.exports=require("https")},2282:e=>{"use strict";e.exports=require("module")},1631:e=>{"use strict";e.exports=require("net")},2087:e=>{"use strict";e.exports=require("os")},2413:e=>{"use strict";e.exports=require("stream")},4016:e=>{"use strict";e.exports=require("tls")},3867:e=>{"use strict";e.exports=require("tty")},8835:e=>{"use strict";e.exports=require("url")},8761:e=>{"use strict";e.exports=require("zlib")}},__webpack_module_cache__={};function __webpack_require__(e){if(__webpack_module_cache__[e])return __webpack_module_cache__[e].exports;var t=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(t.exports,t,t.exports,__webpack_require__),t.loaded=!0,t.exports}return __webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),__webpack_require__(4952)})(); +return plugin; +} +}; \ No newline at end of file diff --git a/.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs b/.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs new file mode 100644 index 00000000..4caa809a --- /dev/null +++ b/.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs @@ -0,0 +1,29 @@ +/* eslint-disable */ +module.exports = { +name: "@yarnpkg/plugin-workspace-tools", +factory: function (require) { +var plugin;plugin=(()=>{"use strict";var e={997:(e,t,n)=>{n.r(t),n.d(t,{default:()=>R});function o(e,t,n,o){var r,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,o);else for(var i=e.length-1;i>=0;i--)(r=e[i])&&(s=(a<3?r(s):a>3?r(t,n,s):r(t,n))||s);return a>3&&s&&Object.defineProperty(t,n,s),s}const r=require("@yarnpkg/cli"),a=require("@yarnpkg/core"),s=require("clipanion"),i=require("yup");class l extends r.BaseCommand{constructor(){super(...arguments),this.workspaces=[],this.json=!1,this.production=!1,this.all=!1}async execute(){const e=await a.Configuration.find(this.context.cwd,this.context.plugins),{project:t,workspace:n}=await a.Project.find(e,this.context.cwd),o=await a.Cache.find(e);let s;if(this.all)s=new Set(t.workspaces);else if(0===this.workspaces.length){if(!n)throw new r.WorkspaceRequiredError(t.cwd,this.context.cwd);s=new Set([n])}else s=new Set(this.workspaces.map(e=>t.getWorkspaceByIdent(a.structUtils.parseIdent(e))));for(const e of s)for(const n of a.Manifest.hardDependencies)for(const o of e.manifest.getForScope(n).values()){const e=t.tryWorkspaceByDescriptor(o);null!==e&&s.add(e)}for(const e of t.workspaces)s.has(e)?this.production&&e.manifest.devDependencies.clear():(e.manifest.dependencies.clear(),e.manifest.devDependencies.clear(),e.manifest.peerDependencies.clear(),e.manifest.scripts.clear());return(await a.StreamReport.start({configuration:e,json:this.json,stdout:this.context.stdout,includeLogs:!0},async e=>{await t.install({cache:o,report:e,persistProject:!1})})).exitCode()}}l.usage=s.Command.Usage({category:"Workspace-related commands",description:"install a single workspace and its dependencies",details:"\n This command will run an install as if the specified workspaces (and all other workspaces they depend on) were the only ones in the project. If no workspaces are explicitly listed, the active one will be assumed.\n\n Note that this command is only very moderately useful when using zero-installs, since the cache will contain all the packages anyway - meaning that the only difference between a full install and a focused install would just be a few extra lines in the `.pnp.js` file, at the cost of introducing an extra complexity.\n\n If the `-A,--all` flag is set, the entire project will be installed. Combine with `--production` to replicate the old `yarn install --production`.\n "}),l.schema=i.object().shape({all:i.bool(),workspaces:i.array().when("all",{is:!0,then:i.array().max(0,"Cannot specify workspaces when using the --all flag"),otherwise:i.array()})}),o([s.Command.Rest()],l.prototype,"workspaces",void 0),o([s.Command.Boolean("--json",{description:"Format the output as an NDJSON stream"})],l.prototype,"json",void 0),o([s.Command.Boolean("--production",{description:"Only install regular dependencies by omitting dev dependencies"})],l.prototype,"production",void 0),o([s.Command.Boolean("-A,--all",{description:"Install the entire project"})],l.prototype,"all",void 0),o([s.Command.Path("workspaces","focus")],l.prototype,"execute",null);var u=n(401),p=n.n(u);const c=require("os");var d=n(578),f=n.n(d);const h=(e,t)=>{const n=[];for(const o of e.workspacesCwds){const e=t.workspacesByCwd.get(o);e&&n.push(e,...h(e,t))}return n},g=(e,t)=>{const n=new Set,o=e=>{const r=new Map([...e.manifest.dependencies,...e.manifest.devDependencies]);for(const e of r.values()){const r=t.tryWorkspaceByDescriptor(e);null===r||n.has(r)||(n.add(r),o(r))}};return o(e),n};class A extends r.BaseCommand{constructor(){super(...arguments),this.args=[],this.allLegacy=!1,this.recursive=!1,this.verbose=!1,this.parallel=!1,this.interlaced=!1,this.topological=!1,this.topologicalDev=!1,this.include=[],this.exclude=[],this.publicOnly=!1}async execute(){var e;const t=await a.Configuration.find(this.context.cwd,this.context.plugins),{project:n,workspace:o}=await a.Project.find(t,this.context.cwd),i=null!==(e=this.all)&&void 0!==e?e:this.allLegacy;if(!i&&!o)throw new r.WorkspaceRequiredError(n.cwd,this.context.cwd);const l=this.cli.process([this.commandName,...this.args]),u=1===l.path.length&&"run"===l.path[0]&&void 0!==l.scriptName?l.scriptName:null;if(0===l.path.length)throw new s.UsageError("Invalid subcommand name for iteration - use the 'run' keyword if you wish to execute a script");const d=i?n.topLevelWorkspace:o,A=this.recursive?[d,...g(d,n)]:[d,...h(d,n)],R=[];for(const e of A)(!u||e.manifest.scripts.has(u)||u.includes(":"))&&(u===process.env.npm_lifecycle_event&&e.cwd===o.cwd||this.include.length>0&&!p().isMatch(a.structUtils.stringifyIdent(e.locator),this.include)||this.exclude.length>0&&p().isMatch(a.structUtils.stringifyIdent(e.locator),this.exclude)||this.publicOnly&&!0===e.manifest.private||R.push(e));let m=this.interlaced;this.parallel||(m=!0);const _=new Map,E=new Set,C=this.parallel?Math.max(1,(0,c.cpus)().length/2):1,b=f()(this.jobs||C);let v=0,x=null,w=!1;const S=await a.StreamReport.start({configuration:t,stdout:this.context.stdout},async e=>{const o=async(n,{commandIndex:o})=>{if(w)return-1;!this.parallel&&this.verbose&&o>1&&e.reportSeparator();const r=function(e,{configuration:t,commandIndex:n,verbose:o}){if(!o)return null;const r=a.structUtils.convertToIdent(e.locator),s=`[${a.structUtils.stringifyIdent(r)}]:`,i=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],l=i[n%i.length];return a.formatUtils.pretty(t,s,l)}(n,{configuration:t,verbose:this.verbose,commandIndex:o}),[s,i]=y(e,{prefix:r,interlaced:m}),[l,u]=y(e,{prefix:r,interlaced:m});try{const t=await this.cli.run([this.commandName,...this.args],{cwd:n.cwd,stdout:s,stderr:l})||0;s.end(),l.end();const o=await i,a=await u;return this.verbose&&o&&a&&e.reportInfo(null,`${r} Process exited without output (exit code ${t})`),130===t&&(w=!0,x=t),t}catch(e){throw s.end(),l.end(),await i,await u,e}};for(const e of R)_.set(e.anchoredLocator.locatorHash,e);for(;_.size>0&&!e.hasErrors();){const r=[];for(const[e,t]of _){if(E.has(t.anchoredDescriptor.descriptorHash))continue;let a=!0;if(this.topological||this.topologicalDev){const e=this.topologicalDev?new Map([...t.manifest.dependencies,...t.manifest.devDependencies]):t.manifest.dependencies;for(const t of e.values()){const e=n.tryWorkspaceByDescriptor(t);if(a=null===e||!_.has(e.anchoredLocator.locatorHash),!a)break}}if(a&&(E.add(t.anchoredDescriptor.descriptorHash),r.push(b(async()=>{const n=await o(t,{commandIndex:++v});return _.delete(e),E.delete(t.anchoredDescriptor.descriptorHash),n})),!this.parallel))break}if(0===r.length){const n=Array.from(_.values()).map(e=>a.structUtils.prettyLocator(t,e.anchoredLocator)).join(", ");return void e.reportError(a.MessageName.CYCLIC_DEPENDENCIES,`Dependency cycle detected (${n})`)}const s=(await Promise.all(r)).find(e=>0!==e);null===x&&(x=void 0!==s?1:x),(this.topological||this.topologicalDev)&&void 0!==s&&e.reportError(a.MessageName.UNNAMED,"The command failed for workspaces that are depended upon by other workspaces; can't satisfy the dependency graph")}});return null!==x?x:S.exitCode()}}function y(e,{prefix:t,interlaced:n}){const o=e.createStreamReporter(t),r=new a.miscUtils.DefaultStream;r.pipe(o,{end:!1}),r.on("finish",()=>{o.end()});const s=new Promise(e=>{o.on("finish",()=>{e(r.active)})});if(n)return[r,s];const i=new a.miscUtils.BufferStream;return i.pipe(r,{end:!1}),i.on("finish",()=>{r.end()}),[i,s]}A.schema=i.object().shape({jobs:i.number().min(2),parallel:i.boolean().when("jobs",{is:e=>e>1,then:i.boolean().oneOf([!0],"--parallel must be set when using --jobs"),otherwise:i.boolean()})}),A.usage=s.Command.Usage({category:"Workspace-related commands",description:"run a command on all workspaces",details:"\n This command will run a given sub-command on current and all its descendant workspaces. Various flags can alter the exact behavior of the command:\n\n - If `-p,--parallel` is set, the commands will be ran in parallel; they'll by default be limited to a number of parallel tasks roughly equal to half your core number, but that can be overridden via `-j,--jobs`.\n\n - If `-p,--parallel` and `-i,--interlaced` are both set, Yarn will print the lines from the output as it receives them. If `-i,--interlaced` wasn't set, it would instead buffer the output from each process and print the resulting buffers only after their source processes have exited.\n\n - If `-t,--topological` is set, Yarn will only run the command after all workspaces that it depends on through the `dependencies` field have successfully finished executing. If `--topological-dev` is set, both the `dependencies` and `devDependencies` fields will be considered when figuring out the wait points.\n\n - If `-A,--all` is set, Yarn will run the command on all the workspaces of a project. By default yarn runs the command only on current and all its descendant workspaces.\n\n - If `-R,--recursive` is set, Yarn will find workspaces to run the command on by recursively evaluating `dependencies` and `devDependencies` fields, instead of looking at the `workspaces` fields.\n\n - The command may apply to only some workspaces through the use of `--include` which acts as a whitelist. The `--exclude` flag will do the opposite and will be a list of packages that mustn't execute the script. Both flags accept glob patterns (if valid Idents and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.\n\n Adding the `-v,--verbose` flag will cause Yarn to print more information; in particular the name of the workspace that generated the output will be printed at the front of each line.\n\n If the command is `run` and the script being run does not exist the child workspace will be skipped without error.\n ",examples:[["Publish current and all descendant packages","yarn workspaces foreach npm publish --tolerate-republish"],["Run build script on current and all descendant packages","yarn workspaces foreach run build"],["Run build script on current and all descendant packages in parallel, building dependent packages first","yarn workspaces foreach -pt run build"]]}),o([s.Command.String()],A.prototype,"commandName",void 0),o([s.Command.Proxy()],A.prototype,"args",void 0),o([s.Command.Boolean("-a",{hidden:!0})],A.prototype,"allLegacy",void 0),o([s.Command.Boolean("-R,--recursive",{description:"Find packages via dependencies/devDependencies instead of using the workspaces field"})],A.prototype,"recursive",void 0),o([s.Command.Boolean("-A,--all",{description:"Run the command on all workspaces of a project"})],A.prototype,"all",void 0),o([s.Command.Boolean("-v,--verbose",{description:"Prefix each output line with the name of the originating workspace"})],A.prototype,"verbose",void 0),o([s.Command.Boolean("-p,--parallel",{description:"Run the commands in parallel"})],A.prototype,"parallel",void 0),o([s.Command.Boolean("-i,--interlaced",{description:"Print the output of commands in real-time instead of buffering it"})],A.prototype,"interlaced",void 0),o([s.Command.String("-j,--jobs",{description:"The maximum number of parallel tasks that the execution will be limited to"})],A.prototype,"jobs",void 0),o([s.Command.Boolean("-t,--topological",{description:"Run the command after all workspaces it depends on (regular) have finished"})],A.prototype,"topological",void 0),o([s.Command.Boolean("--topological-dev",{description:"Run the command after all workspaces it depends on (regular + dev) have finished"})],A.prototype,"topologicalDev",void 0),o([s.Command.Array("--include",{description:"An array of glob pattern idents; only matching workspaces will be traversed"})],A.prototype,"include",void 0),o([s.Command.Array("--exclude",{description:"An array of glob pattern idents; matching workspaces won't be traversed"})],A.prototype,"exclude",void 0),o([s.Command.Boolean("--no-private",{description:"Avoid running the command on private workspaces"})],A.prototype,"publicOnly",void 0),o([s.Command.Path("workspaces","foreach")],A.prototype,"execute",null);const R={commands:[l,A]}},235:(e,t,n)=>{const o=n(900),r=n(617),a=n(495),s=n(425),i=(e,t={})=>{let n=[];if(Array.isArray(e))for(let o of e){let e=i.create(o,t);Array.isArray(e)?n.push(...e):n.push(e)}else n=[].concat(i.create(e,t));return t&&!0===t.expand&&!0===t.nodupes&&(n=[...new Set(n)]),n};i.parse=(e,t={})=>s(e,t),i.stringify=(e,t={})=>o("string"==typeof e?i.parse(e,t):e,t),i.compile=(e,t={})=>("string"==typeof e&&(e=i.parse(e,t)),r(e,t)),i.expand=(e,t={})=>{"string"==typeof e&&(e=i.parse(e,t));let n=a(e,t);return!0===t.noempty&&(n=n.filter(Boolean)),!0===t.nodupes&&(n=[...new Set(n)]),n},i.create=(e,t={})=>""===e||e.length<3?[e]:!0!==t.expand?i.compile(e,t):i.expand(e,t),e.exports=i},617:(e,t,n)=>{const o=n(169),r=n(542);e.exports=(e,t={})=>{let n=(e,a={})=>{let s=r.isInvalidBrace(a),i=!0===e.invalid&&!0===t.escapeInvalid,l=!0===s||!0===i,u=!0===t.escapeInvalid?"\\":"",p="";if(!0===e.isOpen)return u+e.value;if(!0===e.isClose)return u+e.value;if("open"===e.type)return l?u+e.value:"(";if("close"===e.type)return l?u+e.value:")";if("comma"===e.type)return"comma"===e.prev.type?"":l?e.value:"|";if(e.value)return e.value;if(e.nodes&&e.ranges>0){let n=r.reduce(e.nodes),a=o(...n,{...t,wrap:!1,toRegex:!0});if(0!==a.length)return n.length>1&&a.length>1?`(${a})`:a}if(e.nodes)for(let t of e.nodes)p+=n(t,e);return p};return n(e)}},384:e=>{e.exports={MAX_LENGTH:65536,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"}},495:(e,t,n)=>{const o=n(169),r=n(900),a=n(542),s=(e="",t="",n=!1)=>{let o=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return n?a.flatten(t).map(e=>`{${e}}`):t;for(let r of e)if(Array.isArray(r))for(let e of r)o.push(s(e,t,n));else for(let e of t)!0===n&&"string"==typeof e&&(e=`{${e}}`),o.push(Array.isArray(e)?s(r,e,n):r+e);return a.flatten(o)};e.exports=(e,t={})=>{let n=void 0===t.rangeLimit?1e3:t.rangeLimit,i=(e,l={})=>{e.queue=[];let u=l,p=l.queue;for(;"brace"!==u.type&&"root"!==u.type&&u.parent;)u=u.parent,p=u.queue;if(e.invalid||e.dollar)return void p.push(s(p.pop(),r(e,t)));if("brace"===e.type&&!0!==e.invalid&&2===e.nodes.length)return void p.push(s(p.pop(),["{}"]));if(e.nodes&&e.ranges>0){let i=a.reduce(e.nodes);if(a.exceedsLimit(...i,t.step,n))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let l=o(...i,t);return 0===l.length&&(l=r(e,t)),p.push(s(p.pop(),l)),void(e.nodes=[])}let c=a.encloseBrace(e),d=e.queue,f=e;for(;"brace"!==f.type&&"root"!==f.type&&f.parent;)f=f.parent,d=f.queue;for(let t=0;t{const o=n(900),{MAX_LENGTH:r,CHAR_BACKSLASH:a,CHAR_BACKTICK:s,CHAR_COMMA:i,CHAR_DOT:l,CHAR_LEFT_PARENTHESES:u,CHAR_RIGHT_PARENTHESES:p,CHAR_LEFT_CURLY_BRACE:c,CHAR_RIGHT_CURLY_BRACE:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_RIGHT_SQUARE_BRACKET:h,CHAR_DOUBLE_QUOTE:g,CHAR_SINGLE_QUOTE:A,CHAR_NO_BREAK_SPACE:y,CHAR_ZERO_WIDTH_NOBREAK_SPACE:R}=n(384);e.exports=(e,t={})=>{if("string"!=typeof e)throw new TypeError("Expected a string");let n=t||{},m="number"==typeof n.maxLength?Math.min(r,n.maxLength):r;if(e.length>m)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${m})`);let _,E={type:"root",input:e,nodes:[]},C=[E],b=E,v=E,x=0,w=e.length,S=0,H=0;const T=()=>e[S++],k=e=>{if("text"===e.type&&"dot"===v.type&&(v.type="text"),!v||"text"!==v.type||"text"!==e.type)return b.nodes.push(e),e.parent=b,e.prev=v,v=e,e;v.value+=e.value};for(k({type:"bos"});S0){if(b.ranges>0){b.ranges=0;let e=b.nodes.shift();b.nodes=[e,{type:"text",value:o(b)}]}k({type:"comma",value:_}),b.commas++}else if(_===l&&H>0&&0===b.commas){let e=b.nodes;if(0===H||0===e.length){k({type:"text",value:_});continue}if("dot"===v.type){if(b.range=[],v.value+=_,v.type="range",3!==b.nodes.length&&5!==b.nodes.length){b.invalid=!0,b.ranges=0,v.type="text";continue}b.ranges++,b.args=[];continue}if("range"===v.type){e.pop();let t=e[e.length-1];t.value+=v.value+_,v=t,b.ranges--;continue}k({type:"dot",value:_})}else k({type:"text",value:_});else{if("brace"!==b.type){k({type:"text",value:_});continue}let e="close";b=C.pop(),b.close=!0,k({type:e,value:_}),H--,b=C[C.length-1]}else{H++;let e=v.value&&"$"===v.value.slice(-1)||!0===b.dollar;b=k({type:"brace",open:!0,close:!1,dollar:e,depth:H,commas:0,ranges:0,nodes:[]}),C.push(b),k({type:"open",value:_})}else{let e,n=_;for(!0!==t.keepQuotes&&(_="");S{e.nodes||("open"===e.type&&(e.isOpen=!0),"close"===e.type&&(e.isClose=!0),e.nodes||(e.type="text"),e.invalid=!0)});let e=C[C.length-1],t=e.nodes.indexOf(b);e.nodes.splice(t,1,...b.nodes)}}while(C.length>0);return k({type:"eos"}),E}},900:(e,t,n)=>{const o=n(542);e.exports=(e,t={})=>{let n=(e,r={})=>{let a=t.escapeInvalid&&o.isInvalidBrace(r),s=!0===e.invalid&&!0===t.escapeInvalid,i="";if(e.value)return(a||s)&&o.isOpenOrClose(e)?"\\"+e.value:e.value;if(e.value)return e.value;if(e.nodes)for(let t of e.nodes)i+=n(t);return i};return n(e)}},542:(e,t)=>{t.isInteger=e=>"number"==typeof e?Number.isInteger(e):"string"==typeof e&&""!==e.trim()&&Number.isInteger(Number(e)),t.find=(e,t)=>e.nodes.find(e=>e.type===t),t.exceedsLimit=(e,n,o=1,r)=>!1!==r&&(!(!t.isInteger(e)||!t.isInteger(n))&&(Number(n)-Number(e))/Number(o)>=r),t.escapeNode=(e,t=0,n)=>{let o=e.nodes[t];o&&(n&&o.type===n||"open"===o.type||"close"===o.type)&&!0!==o.escaped&&(o.value="\\"+o.value,o.escaped=!0)},t.encloseBrace=e=>"brace"===e.type&&(e.commas>>0+e.ranges>>0==0&&(e.invalid=!0,!0)),t.isInvalidBrace=e=>"brace"===e.type&&(!(!0!==e.invalid&&!e.dollar)||(e.commas>>0+e.ranges>>0==0||!0!==e.open||!0!==e.close)&&(e.invalid=!0,!0)),t.isOpenOrClose=e=>"open"===e.type||"close"===e.type||(!0===e.open||!0===e.close),t.reduce=e=>e.reduce((e,t)=>("text"===t.type&&e.push(t.value),"range"===t.type&&(t.type="text"),e),[]),t.flatten=(...e)=>{const t=[],n=e=>{for(let o=0;o{ +/*! + * fill-range + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Licensed under the MIT License. + */ +const o=n(669),r=n(615),a=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),s=e=>"number"==typeof e||"string"==typeof e&&""!==e,i=e=>Number.isInteger(+e),l=e=>{let t=""+e,n=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return!1;for(;"0"===t[++n];);return n>0},u=(e,t,n)=>{if(t>0){let n="-"===e[0]?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return!1===n?String(e):e},p=(e,t)=>{let n="-"===e[0]?"-":"";for(n&&(e=e.slice(1),t--);e.length{if(n)return r(e,t,{wrap:!1,...o});let a=String.fromCharCode(e);return e===t?a:`[${a}-${String.fromCharCode(t)}]`},d=(e,t,n)=>{if(Array.isArray(e)){let t=!0===n.wrap,o=n.capture?"":"?:";return t?`(${o}${e.join("|")})`:e.join("|")}return r(e,t,n)},f=(...e)=>new RangeError("Invalid range arguments: "+o.inspect(...e)),h=(e,t,n)=>{if(!0===n.strictRanges)throw f([e,t]);return[]},g=(e,t,n=1,o={})=>{let r=Number(e),a=Number(t);if(!Number.isInteger(r)||!Number.isInteger(a)){if(!0===o.strictRanges)throw f([e,t]);return[]}0===r&&(r=0),0===a&&(a=0);let s=r>a,i=String(e),h=String(t),g=String(n);n=Math.max(Math.abs(n),1);let A=l(i)||l(h)||l(g),y=A?Math.max(i.length,h.length,g.length):0,R=!1===A&&!1===((e,t,n)=>"string"==typeof e||"string"==typeof t||!0===n.stringify)(e,t,o),m=o.transform||(e=>t=>!0===e?Number(t):String(t))(R);if(o.toRegex&&1===n)return c(p(e,y),p(t,y),!0,o);let _={negatives:[],positives:[]},E=[],C=0;for(;s?r>=a:r<=a;)!0===o.toRegex&&n>1?_[(b=r)<0?"negatives":"positives"].push(Math.abs(b)):E.push(u(m(r,C),y,R)),r=s?r-n:r+n,C++;var b;return!0===o.toRegex?n>1?((e,t)=>{e.negatives.sort((e,t)=>et?1:0),e.positives.sort((e,t)=>et?1:0);let n,o=t.capture?"":"?:",r="",a="";return e.positives.length&&(r=e.positives.join("|")),e.negatives.length&&(a=`-(${o}${e.negatives.join("|")})`),n=r&&a?`${r}|${a}`:r||a,t.wrap?`(${o}${n})`:n})(_,o):d(E,null,{wrap:!1,...o}):E},A=(e,t,n,o={})=>{if(null==t&&s(e))return[e];if(!s(e)||!s(t))return h(e,t,o);if("function"==typeof n)return A(e,t,1,{transform:n});if(a(n))return A(e,t,0,n);let r={...o};return!0===r.capture&&(r.wrap=!0),n=n||r.step||1,i(n)?i(e)&&i(t)?g(e,t,n,r):((e,t,n=1,o={})=>{if(!i(e)&&e.length>1||!i(t)&&t.length>1)return h(e,t,o);let r=o.transform||(e=>String.fromCharCode(e)),a=(""+e).charCodeAt(0),s=(""+t).charCodeAt(0),l=a>s,u=Math.min(a,s),p=Math.max(a,s);if(o.toRegex&&1===n)return c(u,p,!1,o);let f=[],g=0;for(;l?a>=s:a<=s;)f.push(r(a,g)),a=l?a-n:a+n,g++;return!0===o.toRegex?d(f,null,{wrap:!1,options:o}):f})(e,t,Math.max(Math.abs(n),1),r):null==n||a(n)?A(e,t,1,n):((e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]})(n,r)};e.exports=A},761:e=>{ +/*! + * is-number + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Released under the MIT License. + */ +e.exports=function(e){return"number"==typeof e?e-e==0:"string"==typeof e&&""!==e.trim()&&(Number.isFinite?Number.isFinite(+e):isFinite(+e))}},401:(e,t,n)=>{const o=n(669),r=n(235),a=n(722),s=n(598),i=e=>"string"==typeof e&&(""===e||"./"===e),l=(e,t,n)=>{t=[].concat(t),e=[].concat(e);let o=new Set,r=new Set,s=new Set,i=0,l=e=>{s.add(e.output),n&&n.onResult&&n.onResult(e)};for(let s=0;s!o.has(e));if(n&&0===u.length){if(!0===n.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(!0===n.nonull||!0===n.nullglob)return n.unescape?t.map(e=>e.replace(/\\/g,"")):t}return u};l.match=l,l.matcher=(e,t)=>a(e,t),l.any=l.isMatch=(e,t,n)=>a(t,n)(e),l.not=(e,t,n={})=>{t=[].concat(t).map(String);let o=new Set,r=[],a=l(e,t,{...n,onResult:e=>{n.onResult&&n.onResult(e),r.push(e.output)}});for(let e of r)a.includes(e)||o.add(e);return[...o]},l.contains=(e,t,n)=>{if("string"!=typeof e)throw new TypeError(`Expected a string: "${o.inspect(e)}"`);if(Array.isArray(t))return t.some(t=>l.contains(e,t,n));if("string"==typeof t){if(i(e)||i(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return l.isMatch(e,t,{...n,contains:!0})},l.matchKeys=(e,t,n)=>{if(!s.isObject(e))throw new TypeError("Expected the first argument to be an object");let o=l(Object.keys(e),t,n),r={};for(let t of o)r[t]=e[t];return r},l.some=(e,t,n)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=a(String(e),n);if(o.some(e=>t(e)))return!0}return!1},l.every=(e,t,n)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=a(String(e),n);if(!o.every(e=>t(e)))return!1}return!0},l.all=(e,t,n)=>{if("string"!=typeof e)throw new TypeError(`Expected a string: "${o.inspect(e)}"`);return[].concat(t).every(t=>a(t,n)(e))},l.capture=(e,t,n)=>{let o=s.isWindows(n),r=a.makeRe(String(e),{...n,capture:!0}).exec(o?s.toPosixSlashes(t):t);if(r)return r.slice(1).map(e=>void 0===e?"":e)},l.makeRe=(...e)=>a.makeRe(...e),l.scan=(...e)=>a.scan(...e),l.parse=(e,t)=>{let n=[];for(let o of[].concat(e||[]))for(let e of r(String(o),t))n.push(a.parse(e,t));return n},l.braces=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return t&&!0===t.nobrace||!/\{.*\}/.test(e)?[e]:r(e,t)},l.braceExpand=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return l.braces(e,{...t,expand:!0})},e.exports=l},578:(e,t,n)=>{const o=n(550),r=e=>{if(e<1)throw new TypeError("Expected `concurrency` to be a number from 1 and up");const t=[];let n=0;const r=()=>{n--,t.length>0&&t.shift()()},a=(e,t,...a)=>{n++;const s=o(e,...a);t(s),s.then(r,r)},s=(o,...r)=>new Promise(s=>((o,r,...s)=>{nn},pendingCount:{get:()=>t.length}}),s};e.exports=r,e.exports.default=r},550:e=>{e.exports=(e,...t)=>new Promise(n=>{n(e(...t))})},722:(e,t,n)=>{e.exports=n(828)},86:(e,t,n)=>{const o=n(622),r={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:"[^/]",END_ANCHOR:"(?:\\/|$)",DOTS_SLASH:"\\.{1,2}(?:\\/|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|\\/)\\.{1,2}(?:\\/|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:\\/|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:\\/|$))",QMARK_NO_DOT:"[^.\\/]",STAR:"[^/]*?",START_ANCHOR:"(?:^|\\/)"},a={...r,SLASH_LITERAL:"[\\\\/]",QMARK:"[^\\\\/]",STAR:"[^\\\\/]*?",DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)"};e.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:o.sep,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?a:r}},974:(e,t,n)=>{const o=n(86),r=n(598),{MAX_LENGTH:a,POSIX_REGEX_SOURCE:s,REGEX_NON_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_BACKREF:l,REPLACEMENTS:u}=o,p=(e,t)=>{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();const n=`[${e.join("-")}]`;try{new RegExp(n)}catch(t){return e.map(e=>r.escapeRegex(e)).join("..")}return n},c=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");e=u[e]||e;const n={...t},d="number"==typeof n.maxLength?Math.min(a,n.maxLength):a;let f=e.length;if(f>d)throw new SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${d}`);const h={type:"bos",value:"",output:n.prepend||""},g=[h],A=n.capture?"":"?:",y=r.isWindows(t),R=o.globChars(y),m=o.extglobChars(R),{DOT_LITERAL:_,PLUS_LITERAL:E,SLASH_LITERAL:C,ONE_CHAR:b,DOTS_SLASH:v,NO_DOT:x,NO_DOT_SLASH:w,NO_DOTS_SLASH:S,QMARK:H,QMARK_NO_DOT:T,STAR:k,START_ANCHOR:L}=R,O=e=>`(${A}(?:(?!${L}${e.dot?v:_}).)*?)`,$=n.dot?"":x,N=n.dot?H:T;let I=!0===n.bash?O(n):k;n.capture&&(I=`(${I})`),"boolean"==typeof n.noext&&(n.noextglob=n.noext);const B={input:e,index:-1,start:0,dot:!0===n.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:g};e=r.removePrefix(e,B),f=e.length;const M=[],P=[],D=[];let U,G=h;const j=()=>B.index===f-1,K=B.peek=(t=1)=>e[B.index+t],F=B.advance=()=>e[++B.index],W=()=>e.slice(B.index+1),Q=(e="",t=0)=>{B.consumed+=e,B.index+=t},X=e=>{B.output+=null!=e.output?e.output:e.value,Q(e.value)},q=()=>{let e=1;for(;"!"===K()&&("("!==K(2)||"?"===K(3));)F(),B.start++,e++;return e%2!=0&&(B.negated=!0,B.start++,!0)},Z=e=>{B[e]++,D.push(e)},Y=e=>{B[e]--,D.pop()},z=e=>{if("globstar"===G.type){const t=B.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||M.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(B.output=B.output.slice(0,-G.output.length),G.type="star",G.value="*",G.output=I,B.output+=G.output)}if(M.length&&"paren"!==e.type&&!m[e.value]&&(M[M.length-1].inner+=e.value),(e.value||e.output)&&X(e),G&&"text"===G.type&&"text"===e.type)return G.value+=e.value,void(G.output=(G.output||"")+e.value);e.prev=G,g.push(e),G=e},V=(e,t)=>{const o={...m[t],conditions:1,inner:""};o.prev=G,o.parens=B.parens,o.output=B.output;const r=(n.capture?"(":"")+o.open;Z("parens"),z({type:e,value:t,output:B.output?"":b}),z({type:"paren",extglob:!0,value:F(),output:r}),M.push(o)},J=e=>{let t=e.close+(n.capture?")":"");if("negate"===e.type){let o=I;e.inner&&e.inner.length>1&&e.inner.includes("/")&&(o=O(n)),(o!==I||j()||/^\)+$/.test(W()))&&(t=e.close=")$))"+o),"bos"===e.prev.type&&j()&&(B.negatedExtglob=!0)}z({type:"paren",extglob:!0,value:U,output:t}),Y("parens")};if(!1!==n.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let o=!1,a=e.replace(l,(e,t,n,r,a,s)=>"\\"===r?(o=!0,e):"?"===r?t?t+r+(a?H.repeat(a.length):""):0===s?N+(a?H.repeat(a.length):""):H.repeat(n.length):"."===r?_.repeat(n.length):"*"===r?t?t+r+(a?I:""):I:t?e:"\\"+e);return!0===o&&(a=!0===n.unescape?a.replace(/\\/g,""):a.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),a===e&&!0===n.contains?(B.output=e,B):(B.output=r.wrapOutput(a,B,t),B)}for(;!j();){if(U=F(),"\0"===U)continue;if("\\"===U){const e=K();if("/"===e&&!0!==n.bash)continue;if("."===e||";"===e)continue;if(!e){U+="\\",z({type:"text",value:U});continue}const t=/^\\+/.exec(W());let o=0;if(t&&t[0].length>2&&(o=t[0].length,B.index+=o,o%2!=0&&(U+="\\")),!0===n.unescape?U=F()||"":U+=F()||"",0===B.brackets){z({type:"text",value:U});continue}}if(B.brackets>0&&("]"!==U||"["===G.value||"[^"===G.value)){if(!1!==n.posix&&":"===U){const e=G.value.slice(1);if(e.includes("[")&&(G.posix=!0,e.includes(":"))){const e=G.value.lastIndexOf("["),t=G.value.slice(0,e),n=G.value.slice(e+2),o=s[n];if(o){G.value=t+o,B.backtrack=!0,F(),h.output||1!==g.indexOf(G)||(h.output=b);continue}}}("["===U&&":"!==K()||"-"===U&&"]"===K())&&(U="\\"+U),"]"!==U||"["!==G.value&&"[^"!==G.value||(U="\\"+U),!0===n.posix&&"!"===U&&"["===G.value&&(U="^"),G.value+=U,X({value:U});continue}if(1===B.quotes&&'"'!==U){U=r.escapeRegex(U),G.value+=U,X({value:U});continue}if('"'===U){B.quotes=1===B.quotes?0:1,!0===n.keepQuotes&&z({type:"text",value:U});continue}if("("===U){Z("parens"),z({type:"paren",value:U});continue}if(")"===U){if(0===B.parens&&!0===n.strictBrackets)throw new SyntaxError(c("opening","("));const e=M[M.length-1];if(e&&B.parens===e.parens+1){J(M.pop());continue}z({type:"paren",value:U,output:B.parens?")":"\\)"}),Y("parens");continue}if("["===U){if(!0!==n.nobracket&&W().includes("]"))Z("brackets");else{if(!0!==n.nobracket&&!0===n.strictBrackets)throw new SyntaxError(c("closing","]"));U="\\"+U}z({type:"bracket",value:U});continue}if("]"===U){if(!0===n.nobracket||G&&"bracket"===G.type&&1===G.value.length){z({type:"text",value:U,output:"\\"+U});continue}if(0===B.brackets){if(!0===n.strictBrackets)throw new SyntaxError(c("opening","["));z({type:"text",value:U,output:"\\"+U});continue}Y("brackets");const e=G.value.slice(1);if(!0===G.posix||"^"!==e[0]||e.includes("/")||(U="/"+U),G.value+=U,X({value:U}),!1===n.literalBrackets||r.hasRegexChars(e))continue;const t=r.escapeRegex(G.value);if(B.output=B.output.slice(0,-G.value.length),!0===n.literalBrackets){B.output+=t,G.value=t;continue}G.value=`(${A}${t}|${G.value})`,B.output+=G.value;continue}if("{"===U&&!0!==n.nobrace){Z("braces");const e={type:"brace",value:U,output:"(",outputIndex:B.output.length,tokensIndex:B.tokens.length};P.push(e),z(e);continue}if("}"===U){const e=P[P.length-1];if(!0===n.nobrace||!e){z({type:"text",value:U,output:U});continue}let t=")";if(!0===e.dots){const e=g.slice(),o=[];for(let t=e.length-1;t>=0&&(g.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&o.unshift(e[t].value);t=p(o,n),B.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const n=B.output.slice(0,e.outputIndex),o=B.tokens.slice(e.tokensIndex);e.value=e.output="\\{",U=t="\\}",B.output=n;for(const e of o)B.output+=e.output||e.value}z({type:"brace",value:U,output:t}),Y("braces"),P.pop();continue}if("|"===U){M.length>0&&M[M.length-1].conditions++,z({type:"text",value:U});continue}if(","===U){let e=U;const t=P[P.length-1];t&&"braces"===D[D.length-1]&&(t.comma=!0,e="|"),z({type:"comma",value:U,output:e});continue}if("/"===U){if("dot"===G.type&&B.index===B.start+1){B.start=B.index+1,B.consumed="",B.output="",g.pop(),G=h;continue}z({type:"slash",value:U,output:C});continue}if("."===U){if(B.braces>0&&"dot"===G.type){"."===G.value&&(G.output=_);const e=P[P.length-1];G.type="dots",G.output+=U,G.value+=U,e.dots=!0;continue}if(B.braces+B.parens===0&&"bos"!==G.type&&"slash"!==G.type){z({type:"text",value:U,output:_});continue}z({type:"dot",value:U,output:_});continue}if("?"===U){if(!(G&&"("===G.value)&&!0!==n.noextglob&&"("===K()&&"?"!==K(2)){V("qmark",U);continue}if(G&&"paren"===G.type){const e=K();let t=U;if("<"===e&&!r.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===G.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(W()))&&(t="\\"+U),z({type:"text",value:U,output:t});continue}if(!0!==n.dot&&("slash"===G.type||"bos"===G.type)){z({type:"qmark",value:U,output:T});continue}z({type:"qmark",value:U,output:H});continue}if("!"===U){if(!0!==n.noextglob&&"("===K()&&("?"!==K(2)||!/[!=<:]/.test(K(3)))){V("negate",U);continue}if(!0!==n.nonegate&&0===B.index){q();continue}}if("+"===U){if(!0!==n.noextglob&&"("===K()&&"?"!==K(2)){V("plus",U);continue}if(G&&"("===G.value||!1===n.regex){z({type:"plus",value:U,output:E});continue}if(G&&("bracket"===G.type||"paren"===G.type||"brace"===G.type)||B.parens>0){z({type:"plus",value:U});continue}z({type:"plus",value:E});continue}if("@"===U){if(!0!==n.noextglob&&"("===K()&&"?"!==K(2)){z({type:"at",extglob:!0,value:U,output:""});continue}z({type:"text",value:U});continue}if("*"!==U){"$"!==U&&"^"!==U||(U="\\"+U);const e=i.exec(W());e&&(U+=e[0],B.index+=e[0].length),z({type:"text",value:U});continue}if(G&&("globstar"===G.type||!0===G.star)){G.type="star",G.star=!0,G.value+=U,G.output=I,B.backtrack=!0,B.globstar=!0,Q(U);continue}let t=W();if(!0!==n.noextglob&&/^\([^?]/.test(t)){V("star",U);continue}if("star"===G.type){if(!0===n.noglobstar){Q(U);continue}const o=G.prev,r=o.prev,a="slash"===o.type||"bos"===o.type,s=r&&("star"===r.type||"globstar"===r.type);if(!0===n.bash&&(!a||t[0]&&"/"!==t[0])){z({type:"star",value:U,output:""});continue}const i=B.braces>0&&("comma"===o.type||"brace"===o.type),l=M.length&&("pipe"===o.type||"paren"===o.type);if(!a&&"paren"!==o.type&&!i&&!l){z({type:"star",value:U,output:""});continue}for(;"/**"===t.slice(0,3);){const n=e[B.index+4];if(n&&"/"!==n)break;t=t.slice(3),Q("/**",3)}if("bos"===o.type&&j()){G.type="globstar",G.value+=U,G.output=O(n),B.output=G.output,B.globstar=!0,Q(U);continue}if("slash"===o.type&&"bos"!==o.prev.type&&!s&&j()){B.output=B.output.slice(0,-(o.output+G.output).length),o.output="(?:"+o.output,G.type="globstar",G.output=O(n)+(n.strictSlashes?")":"|$)"),G.value+=U,B.globstar=!0,B.output+=o.output+G.output,Q(U);continue}if("slash"===o.type&&"bos"!==o.prev.type&&"/"===t[0]){const e=void 0!==t[1]?"|$":"";B.output=B.output.slice(0,-(o.output+G.output).length),o.output="(?:"+o.output,G.type="globstar",G.output=`${O(n)}${C}|${C}${e})`,G.value+=U,B.output+=o.output+G.output,B.globstar=!0,Q(U+F()),z({type:"slash",value:"/",output:""});continue}if("bos"===o.type&&"/"===t[0]){G.type="globstar",G.value+=U,G.output=`(?:^|${C}|${O(n)}${C})`,B.output=G.output,B.globstar=!0,Q(U+F()),z({type:"slash",value:"/",output:""});continue}B.output=B.output.slice(0,-G.output.length),G.type="globstar",G.output=O(n),G.value+=U,B.output+=G.output,B.globstar=!0,Q(U);continue}const o={type:"star",value:U,output:I};!0!==n.bash?!G||"bracket"!==G.type&&"paren"!==G.type||!0!==n.regex?(B.index!==B.start&&"slash"!==G.type&&"dot"!==G.type||("dot"===G.type?(B.output+=w,G.output+=w):!0===n.dot?(B.output+=S,G.output+=S):(B.output+=$,G.output+=$),"*"!==K()&&(B.output+=b,G.output+=b)),z(o)):(o.output=U,z(o)):(o.output=".*?","bos"!==G.type&&"slash"!==G.type||(o.output=$+o.output),z(o))}for(;B.brackets>0;){if(!0===n.strictBrackets)throw new SyntaxError(c("closing","]"));B.output=r.escapeLast(B.output,"["),Y("brackets")}for(;B.parens>0;){if(!0===n.strictBrackets)throw new SyntaxError(c("closing",")"));B.output=r.escapeLast(B.output,"("),Y("parens")}for(;B.braces>0;){if(!0===n.strictBrackets)throw new SyntaxError(c("closing","}"));B.output=r.escapeLast(B.output,"{"),Y("braces")}if(!0===n.strictSlashes||"star"!==G.type&&"bracket"!==G.type||z({type:"maybe_slash",value:"",output:C+"?"}),!0===B.backtrack){B.output="";for(const e of B.tokens)B.output+=null!=e.output?e.output:e.value,e.suffix&&(B.output+=e.suffix)}return B};d.fastpaths=(e,t)=>{const n={...t},s="number"==typeof n.maxLength?Math.min(a,n.maxLength):a,i=e.length;if(i>s)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${s}`);e=u[e]||e;const l=r.isWindows(t),{DOT_LITERAL:p,SLASH_LITERAL:c,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:h,NO_DOTS:g,NO_DOTS_SLASH:A,STAR:y,START_ANCHOR:R}=o.globChars(l),m=n.dot?g:h,_=n.dot?A:h,E=n.capture?"":"?:";let C=!0===n.bash?".*?":y;n.capture&&(C=`(${C})`);const b=e=>!0===e.noglobstar?C:`(${E}(?:(?!${R}${e.dot?f:p}).)*?)`,v=e=>{switch(e){case"*":return`${m}${d}${C}`;case".*":return`${p}${d}${C}`;case"*.*":return`${m}${C}${p}${d}${C}`;case"*/*":return`${m}${C}${c}${d}${_}${C}`;case"**":return m+b(n);case"**/*":return`(?:${m}${b(n)}${c})?${_}${d}${C}`;case"**/*.*":return`(?:${m}${b(n)}${c})?${_}${C}${p}${d}${C}`;case"**/.*":return`(?:${m}${b(n)}${c})?${p}${d}${C}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const n=v(t[1]);if(!n)return;return n+p+t[2]}}},x=r.removePrefix(e,{negated:!1,prefix:""});let w=v(x);return w&&!0!==n.strictSlashes&&(w+=c+"?"),w},e.exports=d},828:(e,t,n)=>{const o=n(622),r=n(321),a=n(974),s=n(598),i=n(86),l=(e,t,n=!1)=>{if(Array.isArray(e)){const o=e.map(e=>l(e,t,n));return e=>{for(const t of o){const n=t(e);if(n)return n}return!1}}const o=(r=e)&&"object"==typeof r&&!Array.isArray(r)&&e.tokens&&e.input;var r;if(""===e||"string"!=typeof e&&!o)throw new TypeError("Expected pattern to be a non-empty string");const a=t||{},i=s.isWindows(t),u=o?l.compileRe(e,t):l.makeRe(e,t,!1,!0),p=u.state;delete u.state;let c=()=>!1;if(a.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};c=l(a.ignore,e,n)}const d=(n,o=!1)=>{const{isMatch:r,match:s,output:d}=l.test(n,u,t,{glob:e,posix:i}),f={glob:e,state:p,regex:u,posix:i,input:n,output:d,match:s,isMatch:r};return"function"==typeof a.onResult&&a.onResult(f),!1===r?(f.isMatch=!1,!!o&&f):c(n)?("function"==typeof a.onIgnore&&a.onIgnore(f),f.isMatch=!1,!!o&&f):("function"==typeof a.onMatch&&a.onMatch(f),!o||f)};return n&&(d.state=p),d};l.test=(e,t,n,{glob:o,posix:r}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const a=n||{},i=a.format||(r?s.toPosixSlashes:null);let u=e===o,p=u&&i?i(e):e;return!1===u&&(p=i?i(e):e,u=p===o),!1!==u&&!0!==a.capture||(u=!0===a.matchBase||!0===a.basename?l.matchBase(e,t,n,r):t.exec(p)),{isMatch:Boolean(u),match:u,output:p}},l.matchBase=(e,t,n,r=s.isWindows(n))=>(t instanceof RegExp?t:l.makeRe(t,n)).test(o.basename(e)),l.isMatch=(e,t,n)=>l(t,n)(e),l.parse=(e,t)=>Array.isArray(e)?e.map(e=>l.parse(e,t)):a(e,{...t,fastpaths:!1}),l.scan=(e,t)=>r(e,t),l.compileRe=(e,t,n=!1,o=!1)=>{if(!0===n)return e.output;const r=t||{},a=r.contains?"":"^",s=r.contains?"":"$";let i=`${a}(?:${e.output})${s}`;e&&!0===e.negated&&(i=`^(?!${i}).*$`);const u=l.toRegex(i,t);return!0===o&&(u.state=e),u},l.makeRe=(e,t,n=!1,o=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");const r=t||{};let s,i={negated:!1,fastpaths:!0},u="";return e.startsWith("./")&&(e=e.slice(2),u=i.prefix="./"),!1===r.fastpaths||"."!==e[0]&&"*"!==e[0]||(s=a.fastpaths(e,t)),void 0===s?(i=a(e,t),i.prefix=u+(i.prefix||"")):i.output=s,l.compileRe(i,t,n,o)},l.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},l.constants=i,e.exports=l},321:(e,t,n)=>{const o=n(598),{CHAR_ASTERISK:r,CHAR_AT:a,CHAR_BACKWARD_SLASH:s,CHAR_COMMA:i,CHAR_DOT:l,CHAR_EXCLAMATION_MARK:u,CHAR_FORWARD_SLASH:p,CHAR_LEFT_CURLY_BRACE:c,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:h,CHAR_QUESTION_MARK:g,CHAR_RIGHT_CURLY_BRACE:A,CHAR_RIGHT_PARENTHESES:y,CHAR_RIGHT_SQUARE_BRACKET:R}=n(86),m=e=>e===p||e===s,_=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};e.exports=(e,t)=>{const n=t||{},E=e.length-1,C=!0===n.parts||!0===n.scanToEnd,b=[],v=[],x=[];let w,S,H=e,T=-1,k=0,L=0,O=!1,$=!1,N=!1,I=!1,B=!1,M=!1,P=!1,D=!1,U=!1,G=0,j={value:"",depth:0,isGlob:!1};const K=()=>T>=E,F=()=>(w=S,H.charCodeAt(++T));for(;T0&&(Q=H.slice(0,k),H=H.slice(k),L-=k),W&&!0===N&&L>0?(W=H.slice(0,L),X=H.slice(L)):!0===N?(W="",X=H):W=H,W&&""!==W&&"/"!==W&&W!==H&&m(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),!0===n.unescape&&(X&&(X=o.removeBackslashes(X)),W&&!0===P&&(W=o.removeBackslashes(W)));const q={prefix:Q,input:e,start:k,base:W,glob:X,isBrace:O,isBracket:$,isGlob:N,isExtglob:I,isGlobstar:B,negated:D};if(!0===n.tokens&&(q.maxDepth=0,m(S)||v.push(j),q.tokens=v),!0===n.parts||!0===n.tokens){let t;for(let o=0;o{const o=n(622),r="win32"===process.platform,{REGEX_BACKSLASH:a,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:l}=n(86);t.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),t.hasRegexChars=e=>i.test(e),t.isRegexChar=e=>1===e.length&&t.hasRegexChars(e),t.escapeRegex=e=>e.replace(l,"\\$1"),t.toPosixSlashes=e=>e.replace(a,"/"),t.removeBackslashes=e=>e.replace(s,e=>"\\"===e?"":e),t.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},t.isWindows=e=>e&&"boolean"==typeof e.windows?e.windows:!0===r||"\\"===o.sep,t.escapeLast=(e,n,o)=>{const r=e.lastIndexOf(n,o);return-1===r?e:"\\"===e[r-1]?t.escapeLast(e,n,r-1):`${e.slice(0,r)}\\${e.slice(r)}`},t.removePrefix=(e,t={})=>{let n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},t.wrapOutput=(e,t={},n={})=>{let o=`${n.contains?"":"^"}(?:${e})${n.contains?"":"$"}`;return!0===t.negated&&(o=`(?:^(?!${o}).*$)`),o}},615:(e,t,n)=>{ +/*! + * to-regex-range + * + * Copyright (c) 2015-present, Jon Schlinkert. + * Released under the MIT License. + */ +const o=n(761),r=(e,t,n)=>{if(!1===o(e))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===t||e===t)return String(e);if(!1===o(t))throw new TypeError("toRegexRange: expected the second argument to be a number.");let a={relaxZeros:!0,...n};"boolean"==typeof a.strictZeros&&(a.relaxZeros=!1===a.strictZeros);let l=e+":"+t+"="+String(a.relaxZeros)+String(a.shorthand)+String(a.capture)+String(a.wrap);if(r.cache.hasOwnProperty(l))return r.cache[l].result;let u=Math.min(e,t),p=Math.max(e,t);if(1===Math.abs(u-p)){let n=e+"|"+t;return a.capture?`(${n})`:!1===a.wrap?n:`(?:${n})`}let c=h(e)||h(t),d={min:e,max:t,a:u,b:p},f=[],g=[];if(c&&(d.isPadded=c,d.maxLen=String(d.max).length),u<0){g=s(p<0?Math.abs(p):1,Math.abs(u),d,a),u=d.a=0}return p>=0&&(f=s(u,p,d,a)),d.negatives=g,d.positives=f,d.result=function(e,t,n){let o=i(e,t,"-",!1,n)||[],r=i(t,e,"",!1,n)||[],a=i(e,t,"-?",!0,n)||[];return o.concat(a).concat(r).join("|")}(g,f,a),!0===a.capture?d.result=`(${d.result})`:!1!==a.wrap&&f.length+g.length>1&&(d.result=`(?:${d.result})`),r.cache[l]=d,d.result};function a(e,t,n){if(e===t)return{pattern:e,count:[],digits:0};let o=function(e,t){let n=[];for(let o=0;o1&&r.count.pop(),r.count.push(l.count[0]),r.string=r.pattern+d(r.count),u=t+1)}return i}function i(e,t,n,o,r){let a=[];for(let r of e){let{string:e}=r;o||u(t,"string",e)||a.push(n+e),o&&u(t,"string",e)&&a.push(n+e)}return a}function l(e,t){return e>t?1:t>e?-1:0}function u(e,t,n){return e.some(e=>e[t]===n)}function p(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function c(e,t){return e-e%Math.pow(10,t)}function d(e){let[t=0,n=""]=e;return n||t>1?`{${t+(n?","+n:"")}}`:""}function f(e,t,n){return`[${e}${t-e==1?"":"-"}${t}]`}function h(e){return/^-?(0+)\d/.test(e)}function g(e,t,n){if(!t.isPadded)return e;let o=Math.abs(t.maxLen-String(e).length),r=!1!==n.relaxZeros;switch(o){case 0:return"";case 1:return r?"0?":"0";case 2:return r?"0{0,2}":"00";default:return r?`0{0,${o}}`:`0{${o}}`}}r.cache={},r.clearCache=()=>r.cache={},e.exports=r},622:e=>{e.exports=require("path")},669:e=>{e.exports=require("util")}},t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={exports:{}};return e[o](r,r.exports,n),r.exports}return n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(997)})(); +return plugin; +} +}; \ No newline at end of file diff --git a/.yarnrc.yml b/.yarnrc.yml index 1c929b2d..a084307a 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -1 +1,13 @@ +enableTelemetry: false + +plugins: + - path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs + spec: "@yarnpkg/plugin-workspace-tools" + - path: .yarn/plugins/@yarnpkg/plugin-version.cjs + spec: "@yarnpkg/plugin-version" + - path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs + spec: "@yarnpkg/plugin-interactive-tools" + +preferInteractive: true + yarnPath: .yarn/releases/yarn-2.4.1.cjs diff --git a/bin/protoc-gen-ts_proto_yarn_2 b/bin/protoc-gen-ts_proto_yarn_2 new file mode 100755 index 00000000..3da85de6 --- /dev/null +++ b/bin/protoc-gen-ts_proto_yarn_2 @@ -0,0 +1,2 @@ +#!/usr/bin/env -S yarn node +require('ts-proto/build/plugin') diff --git a/cosmos-sdk-0.43 b/cosmos-sdk-0.43 new file mode 160000 index 00000000..8cfa2c26 --- /dev/null +++ b/cosmos-sdk-0.43 @@ -0,0 +1 @@ +Subproject commit 8cfa2c26738276d895caf9eb98b3f70616218e17 diff --git a/package.json b/package.json new file mode 100644 index 00000000..cc64dd27 --- /dev/null +++ b/package.json @@ -0,0 +1,43 @@ +{ + "name": "cosmjs-types", + "description": "JS and TS types relating to Protocol Buffers used by Cosmos-SDK and other related projects", + "contributors": [ + "Will Clark " + ], + "license": "Apache-2.0", + "repository": { + "type": "git", + "url": "https://github.com/confio/cosmjs-types" + }, + "publishConfig": { + "access": "public" + }, + "files": [ + "confio/", + "cosmos/", + "cosmos_proto/", + "cosmwasm/", + "gogoproto/", + "google/", + "ibc/", + "tendermint/", + "*.md" + ], + "scripts": { + "format": "prettier --write --loglevel warn \"./src/**/*.ts\"", + "define-proto": "./scripts/define-proto.sh && yarn format", + "prepare": "./scripts/prepare.sh", + "build": "rm -rf ./build && tsc && yarn prepare" + }, + "devDependencies": { + "@types/long": "^4.0.1", + "@types/node": "^15.6.2", + "prettier": "^2.3.0", + "ts-proto": "^1.81.1", + "typescript": "~4.0" + }, + "dependencies": { + "long": "^4.0.0", + "protobufjs": "~6.10.2" + } +} diff --git a/scripts/define-proto-cosmos-sdk.sh b/scripts/define-proto-cosmos-sdk.sh new file mode 100755 index 00000000..47b7bad5 --- /dev/null +++ b/scripts/define-proto-cosmos-sdk.sh @@ -0,0 +1,75 @@ +#!/bin/bash +set -o errexit -o nounset -o pipefail +command -v shellcheck >/dev/null && shellcheck "$0" + +OUT_DIR="./src" +COSMOS_SDK_DIR="./cosmos-sdk-0.43/proto" +COSMOS_SDK_THIRD_PARTY_DIR="./cosmos-sdk-0.43/third_party/proto" + +PLUGIN_PATH="$(realpath ./bin)/protoc-gen-ts_proto_yarn_2" + +mkdir -p "$OUT_DIR" + +protoc \ + --plugin="$PLUGIN_PATH" \ + --ts_proto_yarn_2_out="$OUT_DIR" \ + --proto_path="$COSMOS_SDK_DIR" \ + --proto_path="$COSMOS_SDK_THIRD_PARTY_DIR" \ + --ts_proto_yarn_2_opt="esModuleInterop=true,forceLong=long,useOptionals=true" \ + "$COSMOS_SDK_DIR/cosmos/auth/v1beta1/auth.proto" \ + "$COSMOS_SDK_DIR/cosmos/auth/v1beta1/genesis.proto" \ + "$COSMOS_SDK_DIR/cosmos/auth/v1beta1/query.proto" \ + "$COSMOS_SDK_DIR/cosmos/bank/v1beta1/bank.proto" \ + "$COSMOS_SDK_DIR/cosmos/bank/v1beta1/genesis.proto" \ + "$COSMOS_SDK_DIR/cosmos/bank/v1beta1/query.proto" \ + "$COSMOS_SDK_DIR/cosmos/bank/v1beta1/tx.proto" \ + "$COSMOS_SDK_DIR/cosmos/base/abci/v1beta1/abci.proto" \ + "$COSMOS_SDK_DIR/cosmos/base/kv/v1beta1/kv.proto" \ + "$COSMOS_SDK_DIR/cosmos/base/query/v1beta1/pagination.proto" \ + "$COSMOS_SDK_DIR/cosmos/base/reflection/v1beta1/reflection.proto" \ + "$COSMOS_SDK_DIR/cosmos/base/snapshots/v1beta1/snapshot.proto" \ + "$COSMOS_SDK_DIR/cosmos/base/store/v1beta1/commit_info.proto" \ + "$COSMOS_SDK_DIR/cosmos/base/store/v1beta1/snapshot.proto" \ + "$COSMOS_SDK_DIR/cosmos/base/tendermint/v1beta1/query.proto" \ + "$COSMOS_SDK_DIR/cosmos/base/v1beta1/coin.proto" \ + "$COSMOS_SDK_DIR/cosmos/capability/v1beta1/capability.proto" \ + "$COSMOS_SDK_DIR/cosmos/capability/v1beta1/genesis.proto" \ + "$COSMOS_SDK_DIR/cosmos/crisis/v1beta1/genesis.proto" \ + "$COSMOS_SDK_DIR/cosmos/crisis/v1beta1/tx.proto" \ + "$COSMOS_SDK_DIR/cosmos/crypto/ed25519/keys.proto" \ + "$COSMOS_SDK_DIR/cosmos/crypto/multisig/keys.proto" \ + "$COSMOS_SDK_DIR/cosmos/crypto/multisig/v1beta1/multisig.proto" \ + "$COSMOS_SDK_DIR/cosmos/crypto/secp256k1/keys.proto" \ + "$COSMOS_SDK_DIR/cosmos/distribution/v1beta1/distribution.proto" \ + "$COSMOS_SDK_DIR/cosmos/distribution/v1beta1/genesis.proto" \ + "$COSMOS_SDK_DIR/cosmos/distribution/v1beta1/query.proto" \ + "$COSMOS_SDK_DIR/cosmos/distribution/v1beta1/tx.proto" \ + "$COSMOS_SDK_DIR/cosmos/evidence/v1beta1/evidence.proto" \ + "$COSMOS_SDK_DIR/cosmos/evidence/v1beta1/genesis.proto" \ + "$COSMOS_SDK_DIR/cosmos/evidence/v1beta1/query.proto" \ + "$COSMOS_SDK_DIR/cosmos/evidence/v1beta1/tx.proto" \ + "$COSMOS_SDK_DIR/cosmos/genutil/v1beta1/genesis.proto" \ + "$COSMOS_SDK_DIR/cosmos/gov/v1beta1/genesis.proto" \ + "$COSMOS_SDK_DIR/cosmos/gov/v1beta1/gov.proto" \ + "$COSMOS_SDK_DIR/cosmos/gov/v1beta1/query.proto" \ + "$COSMOS_SDK_DIR/cosmos/gov/v1beta1/tx.proto" \ + "$COSMOS_SDK_DIR/cosmos/mint/v1beta1/genesis.proto" \ + "$COSMOS_SDK_DIR/cosmos/mint/v1beta1/mint.proto" \ + "$COSMOS_SDK_DIR/cosmos/mint/v1beta1/query.proto" \ + "$COSMOS_SDK_DIR/cosmos/params/v1beta1/params.proto" \ + "$COSMOS_SDK_DIR/cosmos/params/v1beta1/query.proto" \ + "$COSMOS_SDK_DIR/cosmos/slashing/v1beta1/genesis.proto" \ + "$COSMOS_SDK_DIR/cosmos/slashing/v1beta1/query.proto" \ + "$COSMOS_SDK_DIR/cosmos/slashing/v1beta1/slashing.proto" \ + "$COSMOS_SDK_DIR/cosmos/slashing/v1beta1/tx.proto" \ + "$COSMOS_SDK_DIR/cosmos/staking/v1beta1/genesis.proto" \ + "$COSMOS_SDK_DIR/cosmos/staking/v1beta1/query.proto" \ + "$COSMOS_SDK_DIR/cosmos/staking/v1beta1/staking.proto" \ + "$COSMOS_SDK_DIR/cosmos/staking/v1beta1/tx.proto" \ + "$COSMOS_SDK_DIR/cosmos/tx/signing/v1beta1/signing.proto" \ + "$COSMOS_SDK_DIR/cosmos/tx/v1beta1/service.proto" \ + "$COSMOS_SDK_DIR/cosmos/tx/v1beta1/tx.proto" \ + "$COSMOS_SDK_DIR/cosmos/upgrade/v1beta1/query.proto" \ + "$COSMOS_SDK_DIR/cosmos/upgrade/v1beta1/upgrade.proto" \ + "$COSMOS_SDK_DIR/cosmos/vesting/v1beta1/tx.proto" \ + "$COSMOS_SDK_DIR/cosmos/vesting/v1beta1/vesting.proto" diff --git a/scripts/define-proto.sh b/scripts/define-proto.sh new file mode 100755 index 00000000..538eeca7 --- /dev/null +++ b/scripts/define-proto.sh @@ -0,0 +1,106 @@ +#!/bin/bash +set -o errexit -o nounset -o pipefail +command -v shellcheck >/dev/null && shellcheck "$0" + +OUT_DIR="./src" +WASMD_DIR="./wasmd-0.16/proto" +WASMD_THIRD_PARTY_DIR="./wasmd-0.16/third_party/proto" +CONFIO_DIR="$WASMD_THIRD_PARTY_DIR/confio/" +COSMOS_DIR="$WASMD_THIRD_PARTY_DIR/cosmos/" +IBC_DIR="$WASMD_THIRD_PARTY_DIR/ibc" + +PLUGIN_PATH="$(realpath ./bin)/protoc-gen-ts_proto_yarn_2" + +mkdir -p "$OUT_DIR" + +protoc \ + --plugin="$PLUGIN_PATH" \ + --ts_proto_yarn_2_out="$OUT_DIR" \ + --proto_path="$WASMD_DIR" \ + --proto_path="$WASMD_THIRD_PARTY_DIR" \ + --ts_proto_yarn_2_opt="esModuleInterop=true,forceLong=long,useOptionals=true" \ + "$CONFIO_DIR/proofs.proto" \ + "$COSMOS_DIR/auth/v1beta1/auth.proto" \ + "$COSMOS_DIR/auth/v1beta1/genesis.proto" \ + "$COSMOS_DIR/auth/v1beta1/query.proto" \ + "$COSMOS_DIR/bank/v1beta1/bank.proto" \ + "$COSMOS_DIR/bank/v1beta1/genesis.proto" \ + "$COSMOS_DIR/bank/v1beta1/query.proto" \ + "$COSMOS_DIR/bank/v1beta1/tx.proto" \ + "$COSMOS_DIR/base/abci/v1beta1/abci.proto" \ + "$COSMOS_DIR/base/kv/v1beta1/kv.proto" \ + "$COSMOS_DIR/base/query/v1beta1/pagination.proto" \ + "$COSMOS_DIR/base/reflection/v1beta1/reflection.proto" \ + "$COSMOS_DIR/base/snapshots/v1beta1/snapshot.proto" \ + "$COSMOS_DIR/base/store/v1beta1/commit_info.proto" \ + "$COSMOS_DIR/base/store/v1beta1/snapshot.proto" \ + "$COSMOS_DIR/base/tendermint/v1beta1/query.proto" \ + "$COSMOS_DIR/base/v1beta1/coin.proto" \ + "$COSMOS_DIR/capability/v1beta1/capability.proto" \ + "$COSMOS_DIR/capability/v1beta1/genesis.proto" \ + "$COSMOS_DIR/crisis/v1beta1/genesis.proto" \ + "$COSMOS_DIR/crisis/v1beta1/tx.proto" \ + "$COSMOS_DIR/crypto/ed25519/keys.proto" \ + "$COSMOS_DIR/crypto/multisig/keys.proto" \ + "$COSMOS_DIR/crypto/multisig/v1beta1/multisig.proto" \ + "$COSMOS_DIR/crypto/secp256k1/keys.proto" \ + "$COSMOS_DIR/distribution/v1beta1/distribution.proto" \ + "$COSMOS_DIR/distribution/v1beta1/genesis.proto" \ + "$COSMOS_DIR/distribution/v1beta1/query.proto" \ + "$COSMOS_DIR/distribution/v1beta1/tx.proto" \ + "$COSMOS_DIR/evidence/v1beta1/evidence.proto" \ + "$COSMOS_DIR/evidence/v1beta1/genesis.proto" \ + "$COSMOS_DIR/evidence/v1beta1/query.proto" \ + "$COSMOS_DIR/evidence/v1beta1/tx.proto" \ + "$COSMOS_DIR/genutil/v1beta1/genesis.proto" \ + "$COSMOS_DIR/gov/v1beta1/genesis.proto" \ + "$COSMOS_DIR/gov/v1beta1/gov.proto" \ + "$COSMOS_DIR/gov/v1beta1/query.proto" \ + "$COSMOS_DIR/gov/v1beta1/tx.proto" \ + "$COSMOS_DIR/mint/v1beta1/genesis.proto" \ + "$COSMOS_DIR/mint/v1beta1/mint.proto" \ + "$COSMOS_DIR/mint/v1beta1/query.proto" \ + "$COSMOS_DIR/params/v1beta1/params.proto" \ + "$COSMOS_DIR/params/v1beta1/query.proto" \ + "$COSMOS_DIR/slashing/v1beta1/genesis.proto" \ + "$COSMOS_DIR/slashing/v1beta1/query.proto" \ + "$COSMOS_DIR/slashing/v1beta1/slashing.proto" \ + "$COSMOS_DIR/slashing/v1beta1/tx.proto" \ + "$COSMOS_DIR/staking/v1beta1/genesis.proto" \ + "$COSMOS_DIR/staking/v1beta1/query.proto" \ + "$COSMOS_DIR/staking/v1beta1/staking.proto" \ + "$COSMOS_DIR/staking/v1beta1/tx.proto" \ + "$COSMOS_DIR/tx/signing/v1beta1/signing.proto" \ + "$COSMOS_DIR/tx/v1beta1/service.proto" \ + "$COSMOS_DIR/tx/v1beta1/tx.proto" \ + "$COSMOS_DIR/upgrade/v1beta1/query.proto" \ + "$COSMOS_DIR/upgrade/v1beta1/upgrade.proto" \ + "$COSMOS_DIR/vesting/v1beta1/tx.proto" \ + "$COSMOS_DIR/vesting/v1beta1/vesting.proto" \ + "$IBC_DIR/applications/transfer/v1/genesis.proto" \ + "$IBC_DIR/applications/transfer/v1/query.proto" \ + "$IBC_DIR/applications/transfer/v1/transfer.proto" \ + "$IBC_DIR/applications/transfer/v1/tx.proto" \ + "$IBC_DIR/core/channel/v1/channel.proto" \ + "$IBC_DIR/core/channel/v1/genesis.proto" \ + "$IBC_DIR/core/channel/v1/query.proto" \ + "$IBC_DIR/core/channel/v1/tx.proto" \ + "$IBC_DIR/core/client/v1/client.proto" \ + "$IBC_DIR/core/client/v1/genesis.proto" \ + "$IBC_DIR/core/client/v1/query.proto" \ + "$IBC_DIR/core/client/v1/tx.proto" \ + "$IBC_DIR/lightclients/localhost/v1/localhost.proto" \ + "$IBC_DIR/lightclients/solomachine/v1/solomachine.proto" \ + "$IBC_DIR/lightclients/tendermint/v1/tendermint.proto" \ + "$IBC_DIR/core/commitment/v1/commitment.proto" \ + "$IBC_DIR/core/connection/v1/connection.proto" \ + "$IBC_DIR/core/connection/v1/genesis.proto" \ + "$IBC_DIR/core/connection/v1/query.proto" \ + "$IBC_DIR/core/connection/v1/tx.proto" \ + "$IBC_DIR/core/types/v1/genesis.proto" \ + "$WASMD_DIR/cosmwasm/wasm/v1beta1/genesis.proto" \ + "$WASMD_DIR/cosmwasm/wasm/v1beta1/ibc.proto" \ + "$WASMD_DIR/cosmwasm/wasm/v1beta1/proposal.proto" \ + "$WASMD_DIR/cosmwasm/wasm/v1beta1/query.proto" \ + "$WASMD_DIR/cosmwasm/wasm/v1beta1/tx.proto" \ + "$WASMD_DIR/cosmwasm/wasm/v1beta1/types.proto" diff --git a/scripts/prepare.sh b/scripts/prepare.sh new file mode 100755 index 00000000..a32308b6 --- /dev/null +++ b/scripts/prepare.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -o errexit -o nounset -o pipefail +command -v shellcheck >/dev/null && shellcheck "$0" + +DIRS="confio cosmos cosmos_proto cosmwasm gogoproto google ibc tendermint" + +for dir in $DIRS; do + rm -rf "$dir" + cp -R "./build/$dir" ./ +done diff --git a/src/confio/proofs.ts b/src/confio/proofs.ts new file mode 100644 index 00000000..efe7bcce --- /dev/null +++ b/src/confio/proofs.ts @@ -0,0 +1,1701 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "ics23"; + +export enum HashOp { + /** NO_HASH - NO_HASH is the default if no data passed. Note this is an illegal argument some places. */ + NO_HASH = 0, + SHA256 = 1, + SHA512 = 2, + KECCAK = 3, + RIPEMD160 = 4, + /** BITCOIN - ripemd160(sha256(x)) */ + BITCOIN = 5, + UNRECOGNIZED = -1, +} + +export function hashOpFromJSON(object: any): HashOp { + switch (object) { + case 0: + case "NO_HASH": + return HashOp.NO_HASH; + case 1: + case "SHA256": + return HashOp.SHA256; + case 2: + case "SHA512": + return HashOp.SHA512; + case 3: + case "KECCAK": + return HashOp.KECCAK; + case 4: + case "RIPEMD160": + return HashOp.RIPEMD160; + case 5: + case "BITCOIN": + return HashOp.BITCOIN; + case -1: + case "UNRECOGNIZED": + default: + return HashOp.UNRECOGNIZED; + } +} + +export function hashOpToJSON(object: HashOp): string { + switch (object) { + case HashOp.NO_HASH: + return "NO_HASH"; + case HashOp.SHA256: + return "SHA256"; + case HashOp.SHA512: + return "SHA512"; + case HashOp.KECCAK: + return "KECCAK"; + case HashOp.RIPEMD160: + return "RIPEMD160"; + case HashOp.BITCOIN: + return "BITCOIN"; + default: + return "UNKNOWN"; + } +} + +/** + * LengthOp defines how to process the key and value of the LeafOp + * to include length information. After encoding the length with the given + * algorithm, the length will be prepended to the key and value bytes. + * (Each one with it's own encoded length) + */ +export enum LengthOp { + /** NO_PREFIX - NO_PREFIX don't include any length info */ + NO_PREFIX = 0, + /** VAR_PROTO - VAR_PROTO uses protobuf (and go-amino) varint encoding of the length */ + VAR_PROTO = 1, + /** VAR_RLP - VAR_RLP uses rlp int encoding of the length */ + VAR_RLP = 2, + /** FIXED32_BIG - FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer */ + FIXED32_BIG = 3, + /** FIXED32_LITTLE - FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer */ + FIXED32_LITTLE = 4, + /** FIXED64_BIG - FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer */ + FIXED64_BIG = 5, + /** FIXED64_LITTLE - FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer */ + FIXED64_LITTLE = 6, + /** REQUIRE_32_BYTES - REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output) */ + REQUIRE_32_BYTES = 7, + /** REQUIRE_64_BYTES - REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output) */ + REQUIRE_64_BYTES = 8, + UNRECOGNIZED = -1, +} + +export function lengthOpFromJSON(object: any): LengthOp { + switch (object) { + case 0: + case "NO_PREFIX": + return LengthOp.NO_PREFIX; + case 1: + case "VAR_PROTO": + return LengthOp.VAR_PROTO; + case 2: + case "VAR_RLP": + return LengthOp.VAR_RLP; + case 3: + case "FIXED32_BIG": + return LengthOp.FIXED32_BIG; + case 4: + case "FIXED32_LITTLE": + return LengthOp.FIXED32_LITTLE; + case 5: + case "FIXED64_BIG": + return LengthOp.FIXED64_BIG; + case 6: + case "FIXED64_LITTLE": + return LengthOp.FIXED64_LITTLE; + case 7: + case "REQUIRE_32_BYTES": + return LengthOp.REQUIRE_32_BYTES; + case 8: + case "REQUIRE_64_BYTES": + return LengthOp.REQUIRE_64_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return LengthOp.UNRECOGNIZED; + } +} + +export function lengthOpToJSON(object: LengthOp): string { + switch (object) { + case LengthOp.NO_PREFIX: + return "NO_PREFIX"; + case LengthOp.VAR_PROTO: + return "VAR_PROTO"; + case LengthOp.VAR_RLP: + return "VAR_RLP"; + case LengthOp.FIXED32_BIG: + return "FIXED32_BIG"; + case LengthOp.FIXED32_LITTLE: + return "FIXED32_LITTLE"; + case LengthOp.FIXED64_BIG: + return "FIXED64_BIG"; + case LengthOp.FIXED64_LITTLE: + return "FIXED64_LITTLE"; + case LengthOp.REQUIRE_32_BYTES: + return "REQUIRE_32_BYTES"; + case LengthOp.REQUIRE_64_BYTES: + return "REQUIRE_64_BYTES"; + default: + return "UNKNOWN"; + } +} + +/** + * ExistenceProof takes a key and a value and a set of steps to perform on it. + * The result of peforming all these steps will provide a "root hash", which can + * be compared to the value in a header. + * + * Since it is computationally infeasible to produce a hash collission for any of the used + * cryptographic hash functions, if someone can provide a series of operations to transform + * a given key and value into a root hash that matches some trusted root, these key and values + * must be in the referenced merkle tree. + * + * The only possible issue is maliablity in LeafOp, such as providing extra prefix data, + * which should be controlled by a spec. Eg. with lengthOp as NONE, + * prefix = FOO, key = BAR, value = CHOICE + * and + * prefix = F, key = OOBAR, value = CHOICE + * would produce the same value. + * + * With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field + * in the ProofSpec is valuable to prevent this mutability. And why all trees should + * length-prefix the data before hashing it. + */ +export interface ExistenceProof { + key: Uint8Array; + value: Uint8Array; + leaf?: LeafOp; + path: InnerOp[]; +} + +/** + * NonExistenceProof takes a proof of two neighbors, one left of the desired key, + * one right of the desired key. If both proofs are valid AND they are neighbors, + * then there is no valid proof for the given key. + */ +export interface NonExistenceProof { + /** TODO: remove this as unnecessary??? we prove a range */ + key: Uint8Array; + left?: ExistenceProof; + right?: ExistenceProof; +} + +/** CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages */ +export interface CommitmentProof { + exist?: ExistenceProof | undefined; + nonexist?: NonExistenceProof | undefined; + batch?: BatchProof | undefined; + compressed?: CompressedBatchProof | undefined; +} + +/** + * LeafOp represents the raw key-value data we wish to prove, and + * must be flexible to represent the internal transformation from + * the original key-value pairs into the basis hash, for many existing + * merkle trees. + * + * key and value are passed in. So that the signature of this operation is: + * leafOp(key, value) -> output + * + * To process this, first prehash the keys and values if needed (ANY means no hash in this case): + * hkey = prehashKey(key) + * hvalue = prehashValue(value) + * + * Then combine the bytes, and hash it + * output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) + */ +export interface LeafOp { + hash: HashOp; + prehashKey: HashOp; + prehashValue: HashOp; + length: LengthOp; + /** + * prefix is a fixed bytes that may optionally be included at the beginning to differentiate + * a leaf node from an inner node. + */ + prefix: Uint8Array; +} + +/** + * InnerOp represents a merkle-proof step that is not a leaf. + * It represents concatenating two children and hashing them to provide the next result. + * + * The result of the previous step is passed in, so the signature of this op is: + * innerOp(child) -> output + * + * The result of applying InnerOp should be: + * output = op.hash(op.prefix || child || op.suffix) + * + * where the || operator is concatenation of binary data, + * and child is the result of hashing all the tree below this step. + * + * Any special data, like prepending child with the length, or prepending the entire operation with + * some value to differentiate from leaf nodes, should be included in prefix and suffix. + * If either of prefix or suffix is empty, we just treat it as an empty string + */ +export interface InnerOp { + hash: HashOp; + prefix: Uint8Array; + suffix: Uint8Array; +} + +/** + * ProofSpec defines what the expected parameters are for a given proof type. + * This can be stored in the client and used to validate any incoming proofs. + * + * verify(ProofSpec, Proof) -> Proof | Error + * + * As demonstrated in tests, if we don't fix the algorithm used to calculate the + * LeafHash for a given tree, there are many possible key-value pairs that can + * generate a given hash (by interpretting the preimage differently). + * We need this for proper security, requires client knows a priori what + * tree format server uses. But not in code, rather a configuration object. + */ +export interface ProofSpec { + /** + * any field in the ExistenceProof must be the same as in this spec. + * except Prefix, which is just the first bytes of prefix (spec can be longer) + */ + leafSpec?: LeafOp; + innerSpec?: InnerSpec; + /** max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) */ + maxDepth: number; + /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */ + minDepth: number; +} + +/** + * InnerSpec contains all store-specific structure info to determine if two proofs from a + * given store are neighbors. + * + * This enables: + * + * isLeftMost(spec: InnerSpec, op: InnerOp) + * isRightMost(spec: InnerSpec, op: InnerOp) + * isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) + */ +export interface InnerSpec { + /** + * Child order is the ordering of the children node, must count from 0 + * iavl tree is [0, 1] (left then right) + * merk is [0, 2, 1] (left, right, here) + */ + childOrder: number[]; + childSize: number; + minPrefixLength: number; + maxPrefixLength: number; + /** empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) */ + emptyChild: Uint8Array; + /** hash is the algorithm that must be used for each InnerOp */ + hash: HashOp; +} + +/** BatchProof is a group of multiple proof types than can be compressed */ +export interface BatchProof { + entries: BatchEntry[]; +} + +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface BatchEntry { + exist?: ExistenceProof | undefined; + nonexist?: NonExistenceProof | undefined; +} + +export interface CompressedBatchProof { + entries: CompressedBatchEntry[]; + lookupInners: InnerOp[]; +} + +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface CompressedBatchEntry { + exist?: CompressedExistenceProof | undefined; + nonexist?: CompressedNonExistenceProof | undefined; +} + +export interface CompressedExistenceProof { + key: Uint8Array; + value: Uint8Array; + leaf?: LeafOp; + /** these are indexes into the lookup_inners table in CompressedBatchProof */ + path: number[]; +} + +export interface CompressedNonExistenceProof { + /** TODO: remove this as unnecessary??? we prove a range */ + key: Uint8Array; + left?: CompressedExistenceProof; + right?: CompressedExistenceProof; +} + +const baseExistenceProof: object = {}; + +export const ExistenceProof = { + encode(message: ExistenceProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + if (message.leaf !== undefined) { + LeafOp.encode(message.leaf, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.path) { + InnerOp.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ExistenceProof { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseExistenceProof } as ExistenceProof; + message.path = []; + message.key = new Uint8Array(); + message.value = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + case 3: + message.leaf = LeafOp.decode(reader, reader.uint32()); + break; + case 4: + message.path.push(InnerOp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ExistenceProof { + const message = { ...baseExistenceProof } as ExistenceProof; + message.path = []; + message.key = new Uint8Array(); + message.value = new Uint8Array(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.leaf !== undefined && object.leaf !== null) { + message.leaf = LeafOp.fromJSON(object.leaf); + } else { + message.leaf = undefined; + } + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(InnerOp.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: ExistenceProof): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.value !== undefined && + (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + message.leaf !== undefined && (obj.leaf = message.leaf ? LeafOp.toJSON(message.leaf) : undefined); + if (message.path) { + obj.path = message.path.map((e) => (e ? InnerOp.toJSON(e) : undefined)); + } else { + obj.path = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ExistenceProof { + const message = { ...baseExistenceProof } as ExistenceProof; + message.path = []; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } else { + message.value = new Uint8Array(); + } + if (object.leaf !== undefined && object.leaf !== null) { + message.leaf = LeafOp.fromPartial(object.leaf); + } else { + message.leaf = undefined; + } + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(InnerOp.fromPartial(e)); + } + } + return message; + }, +}; + +const baseNonExistenceProof: object = {}; + +export const NonExistenceProof = { + encode(message: NonExistenceProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.left !== undefined) { + ExistenceProof.encode(message.left, writer.uint32(18).fork()).ldelim(); + } + if (message.right !== undefined) { + ExistenceProof.encode(message.right, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): NonExistenceProof { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseNonExistenceProof } as NonExistenceProof; + message.key = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.left = ExistenceProof.decode(reader, reader.uint32()); + break; + case 3: + message.right = ExistenceProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): NonExistenceProof { + const message = { ...baseNonExistenceProof } as NonExistenceProof; + message.key = new Uint8Array(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.left !== undefined && object.left !== null) { + message.left = ExistenceProof.fromJSON(object.left); + } else { + message.left = undefined; + } + if (object.right !== undefined && object.right !== null) { + message.right = ExistenceProof.fromJSON(object.right); + } else { + message.right = undefined; + } + return message; + }, + + toJSON(message: NonExistenceProof): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.left !== undefined && (obj.left = message.left ? ExistenceProof.toJSON(message.left) : undefined); + message.right !== undefined && + (obj.right = message.right ? ExistenceProof.toJSON(message.right) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): NonExistenceProof { + const message = { ...baseNonExistenceProof } as NonExistenceProof; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + if (object.left !== undefined && object.left !== null) { + message.left = ExistenceProof.fromPartial(object.left); + } else { + message.left = undefined; + } + if (object.right !== undefined && object.right !== null) { + message.right = ExistenceProof.fromPartial(object.right); + } else { + message.right = undefined; + } + return message; + }, +}; + +const baseCommitmentProof: object = {}; + +export const CommitmentProof = { + encode(message: CommitmentProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.exist !== undefined) { + ExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); + } + if (message.nonexist !== undefined) { + NonExistenceProof.encode(message.nonexist, writer.uint32(18).fork()).ldelim(); + } + if (message.batch !== undefined) { + BatchProof.encode(message.batch, writer.uint32(26).fork()).ldelim(); + } + if (message.compressed !== undefined) { + CompressedBatchProof.encode(message.compressed, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CommitmentProof { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCommitmentProof } as CommitmentProof; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exist = ExistenceProof.decode(reader, reader.uint32()); + break; + case 2: + message.nonexist = NonExistenceProof.decode(reader, reader.uint32()); + break; + case 3: + message.batch = BatchProof.decode(reader, reader.uint32()); + break; + case 4: + message.compressed = CompressedBatchProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CommitmentProof { + const message = { ...baseCommitmentProof } as CommitmentProof; + if (object.exist !== undefined && object.exist !== null) { + message.exist = ExistenceProof.fromJSON(object.exist); + } else { + message.exist = undefined; + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = NonExistenceProof.fromJSON(object.nonexist); + } else { + message.nonexist = undefined; + } + if (object.batch !== undefined && object.batch !== null) { + message.batch = BatchProof.fromJSON(object.batch); + } else { + message.batch = undefined; + } + if (object.compressed !== undefined && object.compressed !== null) { + message.compressed = CompressedBatchProof.fromJSON(object.compressed); + } else { + message.compressed = undefined; + } + return message; + }, + + toJSON(message: CommitmentProof): unknown { + const obj: any = {}; + message.exist !== undefined && + (obj.exist = message.exist ? ExistenceProof.toJSON(message.exist) : undefined); + message.nonexist !== undefined && + (obj.nonexist = message.nonexist ? NonExistenceProof.toJSON(message.nonexist) : undefined); + message.batch !== undefined && (obj.batch = message.batch ? BatchProof.toJSON(message.batch) : undefined); + message.compressed !== undefined && + (obj.compressed = message.compressed ? CompressedBatchProof.toJSON(message.compressed) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): CommitmentProof { + const message = { ...baseCommitmentProof } as CommitmentProof; + if (object.exist !== undefined && object.exist !== null) { + message.exist = ExistenceProof.fromPartial(object.exist); + } else { + message.exist = undefined; + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = NonExistenceProof.fromPartial(object.nonexist); + } else { + message.nonexist = undefined; + } + if (object.batch !== undefined && object.batch !== null) { + message.batch = BatchProof.fromPartial(object.batch); + } else { + message.batch = undefined; + } + if (object.compressed !== undefined && object.compressed !== null) { + message.compressed = CompressedBatchProof.fromPartial(object.compressed); + } else { + message.compressed = undefined; + } + return message; + }, +}; + +const baseLeafOp: object = { hash: 0, prehashKey: 0, prehashValue: 0, length: 0 }; + +export const LeafOp = { + encode(message: LeafOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.hash !== 0) { + writer.uint32(8).int32(message.hash); + } + if (message.prehashKey !== 0) { + writer.uint32(16).int32(message.prehashKey); + } + if (message.prehashValue !== 0) { + writer.uint32(24).int32(message.prehashValue); + } + if (message.length !== 0) { + writer.uint32(32).int32(message.length); + } + if (message.prefix.length !== 0) { + writer.uint32(42).bytes(message.prefix); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LeafOp { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseLeafOp } as LeafOp; + message.prefix = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.int32() as any; + break; + case 2: + message.prehashKey = reader.int32() as any; + break; + case 3: + message.prehashValue = reader.int32() as any; + break; + case 4: + message.length = reader.int32() as any; + break; + case 5: + message.prefix = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LeafOp { + const message = { ...baseLeafOp } as LeafOp; + message.prefix = new Uint8Array(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = hashOpFromJSON(object.hash); + } else { + message.hash = 0; + } + if (object.prehashKey !== undefined && object.prehashKey !== null) { + message.prehashKey = hashOpFromJSON(object.prehashKey); + } else { + message.prehashKey = 0; + } + if (object.prehashValue !== undefined && object.prehashValue !== null) { + message.prehashValue = hashOpFromJSON(object.prehashValue); + } else { + message.prehashValue = 0; + } + if (object.length !== undefined && object.length !== null) { + message.length = lengthOpFromJSON(object.length); + } else { + message.length = 0; + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = bytesFromBase64(object.prefix); + } + return message; + }, + + toJSON(message: LeafOp): unknown { + const obj: any = {}; + message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash)); + message.prehashKey !== undefined && (obj.prehashKey = hashOpToJSON(message.prehashKey)); + message.prehashValue !== undefined && (obj.prehashValue = hashOpToJSON(message.prehashValue)); + message.length !== undefined && (obj.length = lengthOpToJSON(message.length)); + message.prefix !== undefined && + (obj.prefix = base64FromBytes(message.prefix !== undefined ? message.prefix : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): LeafOp { + const message = { ...baseLeafOp } as LeafOp; + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } else { + message.hash = 0; + } + if (object.prehashKey !== undefined && object.prehashKey !== null) { + message.prehashKey = object.prehashKey; + } else { + message.prehashKey = 0; + } + if (object.prehashValue !== undefined && object.prehashValue !== null) { + message.prehashValue = object.prehashValue; + } else { + message.prehashValue = 0; + } + if (object.length !== undefined && object.length !== null) { + message.length = object.length; + } else { + message.length = 0; + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = object.prefix; + } else { + message.prefix = new Uint8Array(); + } + return message; + }, +}; + +const baseInnerOp: object = { hash: 0 }; + +export const InnerOp = { + encode(message: InnerOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.hash !== 0) { + writer.uint32(8).int32(message.hash); + } + if (message.prefix.length !== 0) { + writer.uint32(18).bytes(message.prefix); + } + if (message.suffix.length !== 0) { + writer.uint32(26).bytes(message.suffix); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InnerOp { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseInnerOp } as InnerOp; + message.prefix = new Uint8Array(); + message.suffix = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.int32() as any; + break; + case 2: + message.prefix = reader.bytes(); + break; + case 3: + message.suffix = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InnerOp { + const message = { ...baseInnerOp } as InnerOp; + message.prefix = new Uint8Array(); + message.suffix = new Uint8Array(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = hashOpFromJSON(object.hash); + } else { + message.hash = 0; + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = bytesFromBase64(object.prefix); + } + if (object.suffix !== undefined && object.suffix !== null) { + message.suffix = bytesFromBase64(object.suffix); + } + return message; + }, + + toJSON(message: InnerOp): unknown { + const obj: any = {}; + message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash)); + message.prefix !== undefined && + (obj.prefix = base64FromBytes(message.prefix !== undefined ? message.prefix : new Uint8Array())); + message.suffix !== undefined && + (obj.suffix = base64FromBytes(message.suffix !== undefined ? message.suffix : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): InnerOp { + const message = { ...baseInnerOp } as InnerOp; + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } else { + message.hash = 0; + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = object.prefix; + } else { + message.prefix = new Uint8Array(); + } + if (object.suffix !== undefined && object.suffix !== null) { + message.suffix = object.suffix; + } else { + message.suffix = new Uint8Array(); + } + return message; + }, +}; + +const baseProofSpec: object = { maxDepth: 0, minDepth: 0 }; + +export const ProofSpec = { + encode(message: ProofSpec, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.leafSpec !== undefined) { + LeafOp.encode(message.leafSpec, writer.uint32(10).fork()).ldelim(); + } + if (message.innerSpec !== undefined) { + InnerSpec.encode(message.innerSpec, writer.uint32(18).fork()).ldelim(); + } + if (message.maxDepth !== 0) { + writer.uint32(24).int32(message.maxDepth); + } + if (message.minDepth !== 0) { + writer.uint32(32).int32(message.minDepth); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ProofSpec { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseProofSpec } as ProofSpec; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.leafSpec = LeafOp.decode(reader, reader.uint32()); + break; + case 2: + message.innerSpec = InnerSpec.decode(reader, reader.uint32()); + break; + case 3: + message.maxDepth = reader.int32(); + break; + case 4: + message.minDepth = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ProofSpec { + const message = { ...baseProofSpec } as ProofSpec; + if (object.leafSpec !== undefined && object.leafSpec !== null) { + message.leafSpec = LeafOp.fromJSON(object.leafSpec); + } else { + message.leafSpec = undefined; + } + if (object.innerSpec !== undefined && object.innerSpec !== null) { + message.innerSpec = InnerSpec.fromJSON(object.innerSpec); + } else { + message.innerSpec = undefined; + } + if (object.maxDepth !== undefined && object.maxDepth !== null) { + message.maxDepth = Number(object.maxDepth); + } else { + message.maxDepth = 0; + } + if (object.minDepth !== undefined && object.minDepth !== null) { + message.minDepth = Number(object.minDepth); + } else { + message.minDepth = 0; + } + return message; + }, + + toJSON(message: ProofSpec): unknown { + const obj: any = {}; + message.leafSpec !== undefined && + (obj.leafSpec = message.leafSpec ? LeafOp.toJSON(message.leafSpec) : undefined); + message.innerSpec !== undefined && + (obj.innerSpec = message.innerSpec ? InnerSpec.toJSON(message.innerSpec) : undefined); + message.maxDepth !== undefined && (obj.maxDepth = message.maxDepth); + message.minDepth !== undefined && (obj.minDepth = message.minDepth); + return obj; + }, + + fromPartial(object: DeepPartial): ProofSpec { + const message = { ...baseProofSpec } as ProofSpec; + if (object.leafSpec !== undefined && object.leafSpec !== null) { + message.leafSpec = LeafOp.fromPartial(object.leafSpec); + } else { + message.leafSpec = undefined; + } + if (object.innerSpec !== undefined && object.innerSpec !== null) { + message.innerSpec = InnerSpec.fromPartial(object.innerSpec); + } else { + message.innerSpec = undefined; + } + if (object.maxDepth !== undefined && object.maxDepth !== null) { + message.maxDepth = object.maxDepth; + } else { + message.maxDepth = 0; + } + if (object.minDepth !== undefined && object.minDepth !== null) { + message.minDepth = object.minDepth; + } else { + message.minDepth = 0; + } + return message; + }, +}; + +const baseInnerSpec: object = { + childOrder: 0, + childSize: 0, + minPrefixLength: 0, + maxPrefixLength: 0, + hash: 0, +}; + +export const InnerSpec = { + encode(message: InnerSpec, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.childOrder) { + writer.int32(v); + } + writer.ldelim(); + if (message.childSize !== 0) { + writer.uint32(16).int32(message.childSize); + } + if (message.minPrefixLength !== 0) { + writer.uint32(24).int32(message.minPrefixLength); + } + if (message.maxPrefixLength !== 0) { + writer.uint32(32).int32(message.maxPrefixLength); + } + if (message.emptyChild.length !== 0) { + writer.uint32(42).bytes(message.emptyChild); + } + if (message.hash !== 0) { + writer.uint32(48).int32(message.hash); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InnerSpec { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseInnerSpec } as InnerSpec; + message.childOrder = []; + message.emptyChild = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.childOrder.push(reader.int32()); + } + } else { + message.childOrder.push(reader.int32()); + } + break; + case 2: + message.childSize = reader.int32(); + break; + case 3: + message.minPrefixLength = reader.int32(); + break; + case 4: + message.maxPrefixLength = reader.int32(); + break; + case 5: + message.emptyChild = reader.bytes(); + break; + case 6: + message.hash = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InnerSpec { + const message = { ...baseInnerSpec } as InnerSpec; + message.childOrder = []; + message.emptyChild = new Uint8Array(); + if (object.childOrder !== undefined && object.childOrder !== null) { + for (const e of object.childOrder) { + message.childOrder.push(Number(e)); + } + } + if (object.childSize !== undefined && object.childSize !== null) { + message.childSize = Number(object.childSize); + } else { + message.childSize = 0; + } + if (object.minPrefixLength !== undefined && object.minPrefixLength !== null) { + message.minPrefixLength = Number(object.minPrefixLength); + } else { + message.minPrefixLength = 0; + } + if (object.maxPrefixLength !== undefined && object.maxPrefixLength !== null) { + message.maxPrefixLength = Number(object.maxPrefixLength); + } else { + message.maxPrefixLength = 0; + } + if (object.emptyChild !== undefined && object.emptyChild !== null) { + message.emptyChild = bytesFromBase64(object.emptyChild); + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = hashOpFromJSON(object.hash); + } else { + message.hash = 0; + } + return message; + }, + + toJSON(message: InnerSpec): unknown { + const obj: any = {}; + if (message.childOrder) { + obj.childOrder = message.childOrder.map((e) => e); + } else { + obj.childOrder = []; + } + message.childSize !== undefined && (obj.childSize = message.childSize); + message.minPrefixLength !== undefined && (obj.minPrefixLength = message.minPrefixLength); + message.maxPrefixLength !== undefined && (obj.maxPrefixLength = message.maxPrefixLength); + message.emptyChild !== undefined && + (obj.emptyChild = base64FromBytes( + message.emptyChild !== undefined ? message.emptyChild : new Uint8Array(), + )); + message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash)); + return obj; + }, + + fromPartial(object: DeepPartial): InnerSpec { + const message = { ...baseInnerSpec } as InnerSpec; + message.childOrder = []; + if (object.childOrder !== undefined && object.childOrder !== null) { + for (const e of object.childOrder) { + message.childOrder.push(e); + } + } + if (object.childSize !== undefined && object.childSize !== null) { + message.childSize = object.childSize; + } else { + message.childSize = 0; + } + if (object.minPrefixLength !== undefined && object.minPrefixLength !== null) { + message.minPrefixLength = object.minPrefixLength; + } else { + message.minPrefixLength = 0; + } + if (object.maxPrefixLength !== undefined && object.maxPrefixLength !== null) { + message.maxPrefixLength = object.maxPrefixLength; + } else { + message.maxPrefixLength = 0; + } + if (object.emptyChild !== undefined && object.emptyChild !== null) { + message.emptyChild = object.emptyChild; + } else { + message.emptyChild = new Uint8Array(); + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } else { + message.hash = 0; + } + return message; + }, +}; + +const baseBatchProof: object = {}; + +export const BatchProof = { + encode(message: BatchProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.entries) { + BatchEntry.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BatchProof { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseBatchProof } as BatchProof; + message.entries = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.entries.push(BatchEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): BatchProof { + const message = { ...baseBatchProof } as BatchProof; + message.entries = []; + if (object.entries !== undefined && object.entries !== null) { + for (const e of object.entries) { + message.entries.push(BatchEntry.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: BatchProof): unknown { + const obj: any = {}; + if (message.entries) { + obj.entries = message.entries.map((e) => (e ? BatchEntry.toJSON(e) : undefined)); + } else { + obj.entries = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): BatchProof { + const message = { ...baseBatchProof } as BatchProof; + message.entries = []; + if (object.entries !== undefined && object.entries !== null) { + for (const e of object.entries) { + message.entries.push(BatchEntry.fromPartial(e)); + } + } + return message; + }, +}; + +const baseBatchEntry: object = {}; + +export const BatchEntry = { + encode(message: BatchEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.exist !== undefined) { + ExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); + } + if (message.nonexist !== undefined) { + NonExistenceProof.encode(message.nonexist, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BatchEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseBatchEntry } as BatchEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exist = ExistenceProof.decode(reader, reader.uint32()); + break; + case 2: + message.nonexist = NonExistenceProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): BatchEntry { + const message = { ...baseBatchEntry } as BatchEntry; + if (object.exist !== undefined && object.exist !== null) { + message.exist = ExistenceProof.fromJSON(object.exist); + } else { + message.exist = undefined; + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = NonExistenceProof.fromJSON(object.nonexist); + } else { + message.nonexist = undefined; + } + return message; + }, + + toJSON(message: BatchEntry): unknown { + const obj: any = {}; + message.exist !== undefined && + (obj.exist = message.exist ? ExistenceProof.toJSON(message.exist) : undefined); + message.nonexist !== undefined && + (obj.nonexist = message.nonexist ? NonExistenceProof.toJSON(message.nonexist) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): BatchEntry { + const message = { ...baseBatchEntry } as BatchEntry; + if (object.exist !== undefined && object.exist !== null) { + message.exist = ExistenceProof.fromPartial(object.exist); + } else { + message.exist = undefined; + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = NonExistenceProof.fromPartial(object.nonexist); + } else { + message.nonexist = undefined; + } + return message; + }, +}; + +const baseCompressedBatchProof: object = {}; + +export const CompressedBatchProof = { + encode(message: CompressedBatchProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.entries) { + CompressedBatchEntry.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.lookupInners) { + InnerOp.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CompressedBatchProof { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCompressedBatchProof } as CompressedBatchProof; + message.entries = []; + message.lookupInners = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.entries.push(CompressedBatchEntry.decode(reader, reader.uint32())); + break; + case 2: + message.lookupInners.push(InnerOp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CompressedBatchProof { + const message = { ...baseCompressedBatchProof } as CompressedBatchProof; + message.entries = []; + message.lookupInners = []; + if (object.entries !== undefined && object.entries !== null) { + for (const e of object.entries) { + message.entries.push(CompressedBatchEntry.fromJSON(e)); + } + } + if (object.lookupInners !== undefined && object.lookupInners !== null) { + for (const e of object.lookupInners) { + message.lookupInners.push(InnerOp.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: CompressedBatchProof): unknown { + const obj: any = {}; + if (message.entries) { + obj.entries = message.entries.map((e) => (e ? CompressedBatchEntry.toJSON(e) : undefined)); + } else { + obj.entries = []; + } + if (message.lookupInners) { + obj.lookupInners = message.lookupInners.map((e) => (e ? InnerOp.toJSON(e) : undefined)); + } else { + obj.lookupInners = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): CompressedBatchProof { + const message = { ...baseCompressedBatchProof } as CompressedBatchProof; + message.entries = []; + message.lookupInners = []; + if (object.entries !== undefined && object.entries !== null) { + for (const e of object.entries) { + message.entries.push(CompressedBatchEntry.fromPartial(e)); + } + } + if (object.lookupInners !== undefined && object.lookupInners !== null) { + for (const e of object.lookupInners) { + message.lookupInners.push(InnerOp.fromPartial(e)); + } + } + return message; + }, +}; + +const baseCompressedBatchEntry: object = {}; + +export const CompressedBatchEntry = { + encode(message: CompressedBatchEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.exist !== undefined) { + CompressedExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); + } + if (message.nonexist !== undefined) { + CompressedNonExistenceProof.encode(message.nonexist, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CompressedBatchEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCompressedBatchEntry } as CompressedBatchEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exist = CompressedExistenceProof.decode(reader, reader.uint32()); + break; + case 2: + message.nonexist = CompressedNonExistenceProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CompressedBatchEntry { + const message = { ...baseCompressedBatchEntry } as CompressedBatchEntry; + if (object.exist !== undefined && object.exist !== null) { + message.exist = CompressedExistenceProof.fromJSON(object.exist); + } else { + message.exist = undefined; + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = CompressedNonExistenceProof.fromJSON(object.nonexist); + } else { + message.nonexist = undefined; + } + return message; + }, + + toJSON(message: CompressedBatchEntry): unknown { + const obj: any = {}; + message.exist !== undefined && + (obj.exist = message.exist ? CompressedExistenceProof.toJSON(message.exist) : undefined); + message.nonexist !== undefined && + (obj.nonexist = message.nonexist ? CompressedNonExistenceProof.toJSON(message.nonexist) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): CompressedBatchEntry { + const message = { ...baseCompressedBatchEntry } as CompressedBatchEntry; + if (object.exist !== undefined && object.exist !== null) { + message.exist = CompressedExistenceProof.fromPartial(object.exist); + } else { + message.exist = undefined; + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = CompressedNonExistenceProof.fromPartial(object.nonexist); + } else { + message.nonexist = undefined; + } + return message; + }, +}; + +const baseCompressedExistenceProof: object = { path: 0 }; + +export const CompressedExistenceProof = { + encode(message: CompressedExistenceProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + if (message.leaf !== undefined) { + LeafOp.encode(message.leaf, writer.uint32(26).fork()).ldelim(); + } + writer.uint32(34).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CompressedExistenceProof { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCompressedExistenceProof } as CompressedExistenceProof; + message.path = []; + message.key = new Uint8Array(); + message.value = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + case 3: + message.leaf = LeafOp.decode(reader, reader.uint32()); + break; + case 4: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CompressedExistenceProof { + const message = { ...baseCompressedExistenceProof } as CompressedExistenceProof; + message.path = []; + message.key = new Uint8Array(); + message.value = new Uint8Array(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.leaf !== undefined && object.leaf !== null) { + message.leaf = LeafOp.fromJSON(object.leaf); + } else { + message.leaf = undefined; + } + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(Number(e)); + } + } + return message; + }, + + toJSON(message: CompressedExistenceProof): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.value !== undefined && + (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + message.leaf !== undefined && (obj.leaf = message.leaf ? LeafOp.toJSON(message.leaf) : undefined); + if (message.path) { + obj.path = message.path.map((e) => e); + } else { + obj.path = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): CompressedExistenceProof { + const message = { ...baseCompressedExistenceProof } as CompressedExistenceProof; + message.path = []; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } else { + message.value = new Uint8Array(); + } + if (object.leaf !== undefined && object.leaf !== null) { + message.leaf = LeafOp.fromPartial(object.leaf); + } else { + message.leaf = undefined; + } + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(e); + } + } + return message; + }, +}; + +const baseCompressedNonExistenceProof: object = {}; + +export const CompressedNonExistenceProof = { + encode(message: CompressedNonExistenceProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.left !== undefined) { + CompressedExistenceProof.encode(message.left, writer.uint32(18).fork()).ldelim(); + } + if (message.right !== undefined) { + CompressedExistenceProof.encode(message.right, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CompressedNonExistenceProof { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCompressedNonExistenceProof } as CompressedNonExistenceProof; + message.key = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.left = CompressedExistenceProof.decode(reader, reader.uint32()); + break; + case 3: + message.right = CompressedExistenceProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CompressedNonExistenceProof { + const message = { ...baseCompressedNonExistenceProof } as CompressedNonExistenceProof; + message.key = new Uint8Array(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.left !== undefined && object.left !== null) { + message.left = CompressedExistenceProof.fromJSON(object.left); + } else { + message.left = undefined; + } + if (object.right !== undefined && object.right !== null) { + message.right = CompressedExistenceProof.fromJSON(object.right); + } else { + message.right = undefined; + } + return message; + }, + + toJSON(message: CompressedNonExistenceProof): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.left !== undefined && + (obj.left = message.left ? CompressedExistenceProof.toJSON(message.left) : undefined); + message.right !== undefined && + (obj.right = message.right ? CompressedExistenceProof.toJSON(message.right) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): CompressedNonExistenceProof { + const message = { ...baseCompressedNonExistenceProof } as CompressedNonExistenceProof; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + if (object.left !== undefined && object.left !== null) { + message.left = CompressedExistenceProof.fromPartial(object.left); + } else { + message.left = undefined; + } + if (object.right !== undefined && object.right !== null) { + message.right = CompressedExistenceProof.fromPartial(object.right); + } else { + message.right = undefined; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/auth/v1beta1/auth.ts b/src/cosmos/auth/v1beta1/auth.ts new file mode 100644 index 00000000..9b7dd27e --- /dev/null +++ b/src/cosmos/auth/v1beta1/auth.ts @@ -0,0 +1,387 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Any } from "../../../google/protobuf/any"; + +export const protobufPackage = "cosmos.auth.v1beta1"; + +/** + * BaseAccount defines a base account type. It contains all the necessary fields + * for basic account functionality. Any custom account type should extend this + * type for additional functionality (e.g. vesting). + */ +export interface BaseAccount { + address: string; + pubKey?: Any; + accountNumber: Long; + sequence: Long; +} + +/** ModuleAccount defines an account for modules that holds coins on a pool. */ +export interface ModuleAccount { + baseAccount?: BaseAccount; + name: string; + permissions: string[]; +} + +/** Params defines the parameters for the auth module. */ +export interface Params { + maxMemoCharacters: Long; + txSigLimit: Long; + txSizeCostPerByte: Long; + sigVerifyCostEd25519: Long; + sigVerifyCostSecp256k1: Long; +} + +const baseBaseAccount: object = { address: "", accountNumber: Long.UZERO, sequence: Long.UZERO }; + +export const BaseAccount = { + encode(message: BaseAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.pubKey !== undefined) { + Any.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); + } + if (!message.accountNumber.isZero()) { + writer.uint32(24).uint64(message.accountNumber); + } + if (!message.sequence.isZero()) { + writer.uint32(32).uint64(message.sequence); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BaseAccount { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseBaseAccount } as BaseAccount; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.pubKey = Any.decode(reader, reader.uint32()); + break; + case 3: + message.accountNumber = reader.uint64() as Long; + break; + case 4: + message.sequence = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): BaseAccount { + const message = { ...baseBaseAccount } as BaseAccount; + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.pubKey !== undefined && object.pubKey !== null) { + message.pubKey = Any.fromJSON(object.pubKey); + } else { + message.pubKey = undefined; + } + if (object.accountNumber !== undefined && object.accountNumber !== null) { + message.accountNumber = Long.fromString(object.accountNumber); + } else { + message.accountNumber = Long.UZERO; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = Long.fromString(object.sequence); + } else { + message.sequence = Long.UZERO; + } + return message; + }, + + toJSON(message: BaseAccount): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.pubKey !== undefined && (obj.pubKey = message.pubKey ? Any.toJSON(message.pubKey) : undefined); + message.accountNumber !== undefined && + (obj.accountNumber = (message.accountNumber || Long.UZERO).toString()); + message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): BaseAccount { + const message = { ...baseBaseAccount } as BaseAccount; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.pubKey !== undefined && object.pubKey !== null) { + message.pubKey = Any.fromPartial(object.pubKey); + } else { + message.pubKey = undefined; + } + if (object.accountNumber !== undefined && object.accountNumber !== null) { + message.accountNumber = object.accountNumber as Long; + } else { + message.accountNumber = Long.UZERO; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = object.sequence as Long; + } else { + message.sequence = Long.UZERO; + } + return message; + }, +}; + +const baseModuleAccount: object = { name: "", permissions: "" }; + +export const ModuleAccount = { + encode(message: ModuleAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.baseAccount !== undefined) { + BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim(); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + for (const v of message.permissions) { + writer.uint32(26).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ModuleAccount { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseModuleAccount } as ModuleAccount; + message.permissions = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseAccount = BaseAccount.decode(reader, reader.uint32()); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.permissions.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ModuleAccount { + const message = { ...baseModuleAccount } as ModuleAccount; + message.permissions = []; + if (object.baseAccount !== undefined && object.baseAccount !== null) { + message.baseAccount = BaseAccount.fromJSON(object.baseAccount); + } else { + message.baseAccount = undefined; + } + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.permissions !== undefined && object.permissions !== null) { + for (const e of object.permissions) { + message.permissions.push(String(e)); + } + } + return message; + }, + + toJSON(message: ModuleAccount): unknown { + const obj: any = {}; + message.baseAccount !== undefined && + (obj.baseAccount = message.baseAccount ? BaseAccount.toJSON(message.baseAccount) : undefined); + message.name !== undefined && (obj.name = message.name); + if (message.permissions) { + obj.permissions = message.permissions.map((e) => e); + } else { + obj.permissions = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ModuleAccount { + const message = { ...baseModuleAccount } as ModuleAccount; + message.permissions = []; + if (object.baseAccount !== undefined && object.baseAccount !== null) { + message.baseAccount = BaseAccount.fromPartial(object.baseAccount); + } else { + message.baseAccount = undefined; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.permissions !== undefined && object.permissions !== null) { + for (const e of object.permissions) { + message.permissions.push(e); + } + } + return message; + }, +}; + +const baseParams: object = { + maxMemoCharacters: Long.UZERO, + txSigLimit: Long.UZERO, + txSizeCostPerByte: Long.UZERO, + sigVerifyCostEd25519: Long.UZERO, + sigVerifyCostSecp256k1: Long.UZERO, +}; + +export const Params = { + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.maxMemoCharacters.isZero()) { + writer.uint32(8).uint64(message.maxMemoCharacters); + } + if (!message.txSigLimit.isZero()) { + writer.uint32(16).uint64(message.txSigLimit); + } + if (!message.txSizeCostPerByte.isZero()) { + writer.uint32(24).uint64(message.txSizeCostPerByte); + } + if (!message.sigVerifyCostEd25519.isZero()) { + writer.uint32(32).uint64(message.sigVerifyCostEd25519); + } + if (!message.sigVerifyCostSecp256k1.isZero()) { + writer.uint32(40).uint64(message.sigVerifyCostSecp256k1); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseParams } as Params; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxMemoCharacters = reader.uint64() as Long; + break; + case 2: + message.txSigLimit = reader.uint64() as Long; + break; + case 3: + message.txSizeCostPerByte = reader.uint64() as Long; + break; + case 4: + message.sigVerifyCostEd25519 = reader.uint64() as Long; + break; + case 5: + message.sigVerifyCostSecp256k1 = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Params { + const message = { ...baseParams } as Params; + if (object.maxMemoCharacters !== undefined && object.maxMemoCharacters !== null) { + message.maxMemoCharacters = Long.fromString(object.maxMemoCharacters); + } else { + message.maxMemoCharacters = Long.UZERO; + } + if (object.txSigLimit !== undefined && object.txSigLimit !== null) { + message.txSigLimit = Long.fromString(object.txSigLimit); + } else { + message.txSigLimit = Long.UZERO; + } + if (object.txSizeCostPerByte !== undefined && object.txSizeCostPerByte !== null) { + message.txSizeCostPerByte = Long.fromString(object.txSizeCostPerByte); + } else { + message.txSizeCostPerByte = Long.UZERO; + } + if (object.sigVerifyCostEd25519 !== undefined && object.sigVerifyCostEd25519 !== null) { + message.sigVerifyCostEd25519 = Long.fromString(object.sigVerifyCostEd25519); + } else { + message.sigVerifyCostEd25519 = Long.UZERO; + } + if (object.sigVerifyCostSecp256k1 !== undefined && object.sigVerifyCostSecp256k1 !== null) { + message.sigVerifyCostSecp256k1 = Long.fromString(object.sigVerifyCostSecp256k1); + } else { + message.sigVerifyCostSecp256k1 = Long.UZERO; + } + return message; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + message.maxMemoCharacters !== undefined && + (obj.maxMemoCharacters = (message.maxMemoCharacters || Long.UZERO).toString()); + message.txSigLimit !== undefined && (obj.txSigLimit = (message.txSigLimit || Long.UZERO).toString()); + message.txSizeCostPerByte !== undefined && + (obj.txSizeCostPerByte = (message.txSizeCostPerByte || Long.UZERO).toString()); + message.sigVerifyCostEd25519 !== undefined && + (obj.sigVerifyCostEd25519 = (message.sigVerifyCostEd25519 || Long.UZERO).toString()); + message.sigVerifyCostSecp256k1 !== undefined && + (obj.sigVerifyCostSecp256k1 = (message.sigVerifyCostSecp256k1 || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): Params { + const message = { ...baseParams } as Params; + if (object.maxMemoCharacters !== undefined && object.maxMemoCharacters !== null) { + message.maxMemoCharacters = object.maxMemoCharacters as Long; + } else { + message.maxMemoCharacters = Long.UZERO; + } + if (object.txSigLimit !== undefined && object.txSigLimit !== null) { + message.txSigLimit = object.txSigLimit as Long; + } else { + message.txSigLimit = Long.UZERO; + } + if (object.txSizeCostPerByte !== undefined && object.txSizeCostPerByte !== null) { + message.txSizeCostPerByte = object.txSizeCostPerByte as Long; + } else { + message.txSizeCostPerByte = Long.UZERO; + } + if (object.sigVerifyCostEd25519 !== undefined && object.sigVerifyCostEd25519 !== null) { + message.sigVerifyCostEd25519 = object.sigVerifyCostEd25519 as Long; + } else { + message.sigVerifyCostEd25519 = Long.UZERO; + } + if (object.sigVerifyCostSecp256k1 !== undefined && object.sigVerifyCostSecp256k1 !== null) { + message.sigVerifyCostSecp256k1 = object.sigVerifyCostSecp256k1 as Long; + } else { + message.sigVerifyCostSecp256k1 = Long.UZERO; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/auth/v1beta1/genesis.ts b/src/cosmos/auth/v1beta1/genesis.ts new file mode 100644 index 00000000..6363c511 --- /dev/null +++ b/src/cosmos/auth/v1beta1/genesis.ts @@ -0,0 +1,110 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Params } from "../../../cosmos/auth/v1beta1/auth"; +import { Any } from "../../../google/protobuf/any"; + +export const protobufPackage = "cosmos.auth.v1beta1"; + +/** GenesisState defines the auth module's genesis state. */ +export interface GenesisState { + /** params defines all the paramaters of the module. */ + params?: Params; + /** accounts are the accounts present at genesis. */ + accounts: Any[]; +} + +const baseGenesisState: object = {}; + +export const GenesisState = { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.accounts) { + Any.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGenesisState } as GenesisState; + message.accounts = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.accounts.push(Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.accounts = []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + if (object.accounts !== undefined && object.accounts !== null) { + for (const e of object.accounts) { + message.accounts.push(Any.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + if (message.accounts) { + obj.accounts = message.accounts.map((e) => (e ? Any.toJSON(e) : undefined)); + } else { + obj.accounts = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.accounts = []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + if (object.accounts !== undefined && object.accounts !== null) { + for (const e of object.accounts) { + message.accounts.push(Any.fromPartial(e)); + } + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/auth/v1beta1/query.ts b/src/cosmos/auth/v1beta1/query.ts new file mode 100644 index 00000000..c00e49f1 --- /dev/null +++ b/src/cosmos/auth/v1beta1/query.ts @@ -0,0 +1,440 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; +import { Any } from "../../../google/protobuf/any"; +import { Params } from "../../../cosmos/auth/v1beta1/auth"; + +export const protobufPackage = "cosmos.auth.v1beta1"; + +/** QueryAccountsRequest is the request type for the Query/Accounts RPC method. */ +export interface QueryAccountsRequest { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} + +/** QueryAccountsResponse is the response type for the Query/Accounts RPC method. */ +export interface QueryAccountsResponse { + /** accounts are the existing accounts */ + accounts: Any[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} + +/** QueryAccountRequest is the request type for the Query/Account RPC method. */ +export interface QueryAccountRequest { + /** address defines the address to query for. */ + address: string; +} + +/** QueryAccountResponse is the response type for the Query/Account RPC method. */ +export interface QueryAccountResponse { + /** account defines the account of the corresponding address. */ + account?: Any; +} + +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} + +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params defines the parameters of the module. */ + params?: Params; +} + +const baseQueryAccountsRequest: object = {}; + +export const QueryAccountsRequest = { + encode(message: QueryAccountsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryAccountsRequest } as QueryAccountsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAccountsRequest { + const message = { ...baseQueryAccountsRequest } as QueryAccountsRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryAccountsRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryAccountsRequest { + const message = { ...baseQueryAccountsRequest } as QueryAccountsRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryAccountsResponse: object = {}; + +export const QueryAccountsResponse = { + encode(message: QueryAccountsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.accounts) { + Any.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryAccountsResponse } as QueryAccountsResponse; + message.accounts = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accounts.push(Any.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAccountsResponse { + const message = { ...baseQueryAccountsResponse } as QueryAccountsResponse; + message.accounts = []; + if (object.accounts !== undefined && object.accounts !== null) { + for (const e of object.accounts) { + message.accounts.push(Any.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryAccountsResponse): unknown { + const obj: any = {}; + if (message.accounts) { + obj.accounts = message.accounts.map((e) => (e ? Any.toJSON(e) : undefined)); + } else { + obj.accounts = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryAccountsResponse { + const message = { ...baseQueryAccountsResponse } as QueryAccountsResponse; + message.accounts = []; + if (object.accounts !== undefined && object.accounts !== null) { + for (const e of object.accounts) { + message.accounts.push(Any.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryAccountRequest: object = { address: "" }; + +export const QueryAccountRequest = { + encode(message: QueryAccountRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryAccountRequest } as QueryAccountRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAccountRequest { + const message = { ...baseQueryAccountRequest } as QueryAccountRequest; + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + return message; + }, + + toJSON(message: QueryAccountRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + return obj; + }, + + fromPartial(object: DeepPartial): QueryAccountRequest { + const message = { ...baseQueryAccountRequest } as QueryAccountRequest; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + return message; + }, +}; + +const baseQueryAccountResponse: object = {}; + +export const QueryAccountResponse = { + encode(message: QueryAccountResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.account !== undefined) { + Any.encode(message.account, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryAccountResponse } as QueryAccountResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAccountResponse { + const message = { ...baseQueryAccountResponse } as QueryAccountResponse; + if (object.account !== undefined && object.account !== null) { + message.account = Any.fromJSON(object.account); + } else { + message.account = undefined; + } + return message; + }, + + toJSON(message: QueryAccountResponse): unknown { + const obj: any = {}; + message.account !== undefined && + (obj.account = message.account ? Any.toJSON(message.account) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryAccountResponse { + const message = { ...baseQueryAccountResponse } as QueryAccountResponse; + if (object.account !== undefined && object.account !== null) { + message.account = Any.fromPartial(object.account); + } else { + message.account = undefined; + } + return message; + }, +}; + +const baseQueryParamsRequest: object = {}; + +export const QueryParamsRequest = { + encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + return message; + }, + + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + return message; + }, +}; + +const baseQueryParamsResponse: object = {}; + +export const QueryParamsResponse = { + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + return message; + }, + + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + return message; + }, +}; + +/** Query defines the gRPC querier service. */ +export interface Query { + /** Accounts returns all the existing accounts */ + Accounts(request: QueryAccountsRequest): Promise; + /** Account returns account details based on address. */ + Account(request: QueryAccountRequest): Promise; + /** Params queries all parameters. */ + Params(request: QueryParamsRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Accounts = this.Accounts.bind(this); + this.Account = this.Account.bind(this); + this.Params = this.Params.bind(this); + } + Accounts(request: QueryAccountsRequest): Promise { + const data = QueryAccountsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Accounts", data); + return promise.then((data) => QueryAccountsResponse.decode(new _m0.Reader(data))); + } + + Account(request: QueryAccountRequest): Promise { + const data = QueryAccountRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Account", data); + return promise.then((data) => QueryAccountResponse.decode(new _m0.Reader(data))); + } + + Params(request: QueryParamsRequest): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Params", data); + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/bank/v1beta1/bank.ts b/src/cosmos/bank/v1beta1/bank.ts new file mode 100644 index 00000000..6a25e2d5 --- /dev/null +++ b/src/cosmos/bank/v1beta1/bank.ts @@ -0,0 +1,717 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Coin } from "../../../cosmos/base/v1beta1/coin"; + +export const protobufPackage = "cosmos.bank.v1beta1"; + +/** Params defines the parameters for the bank module. */ +export interface Params { + sendEnabled: SendEnabled[]; + defaultSendEnabled: boolean; +} + +/** + * SendEnabled maps coin denom to a send_enabled status (whether a denom is + * sendable). + */ +export interface SendEnabled { + denom: string; + enabled: boolean; +} + +/** Input models transaction input. */ +export interface Input { + address: string; + coins: Coin[]; +} + +/** Output models transaction outputs. */ +export interface Output { + address: string; + coins: Coin[]; +} + +/** + * Supply represents a struct that passively keeps track of the total supply + * amounts in the network. + * This message is deprecated now that supply is indexed by denom. + * + * @deprecated + */ +export interface Supply { + total: Coin[]; +} + +/** + * DenomUnit represents a struct that describes a given + * denomination unit of the basic token. + */ +export interface DenomUnit { + /** denom represents the string name of the given denom unit (e.g uatom). */ + denom: string; + /** + * exponent represents power of 10 exponent that one must + * raise the base_denom to in order to equal the given DenomUnit's denom + * 1 denom = 1^exponent base_denom + * (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with + * exponent = 6, thus: 1 atom = 10^6 uatom). + */ + exponent: number; + /** aliases is a list of string aliases for the given denom */ + aliases: string[]; +} + +/** + * Metadata represents a struct that describes + * a basic token. + */ +export interface Metadata { + description: string; + /** denom_units represents the list of DenomUnit's for a given coin */ + denomUnits: DenomUnit[]; + /** base represents the base denom (should be the DenomUnit with exponent = 0). */ + base: string; + /** + * display indicates the suggested denom that should be + * displayed in clients. + */ + display: string; + /** name defines the name of the token (eg: Cosmos Atom) */ + name: string; + /** + * symbol is the token symbol usually shown on exchanges (eg: ATOM). This can + * be the same as the display. + */ + symbol: string; +} + +const baseParams: object = { defaultSendEnabled: false }; + +export const Params = { + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.sendEnabled) { + SendEnabled.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.defaultSendEnabled === true) { + writer.uint32(16).bool(message.defaultSendEnabled); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseParams } as Params; + message.sendEnabled = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sendEnabled.push(SendEnabled.decode(reader, reader.uint32())); + break; + case 2: + message.defaultSendEnabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Params { + const message = { ...baseParams } as Params; + message.sendEnabled = []; + if (object.sendEnabled !== undefined && object.sendEnabled !== null) { + for (const e of object.sendEnabled) { + message.sendEnabled.push(SendEnabled.fromJSON(e)); + } + } + if (object.defaultSendEnabled !== undefined && object.defaultSendEnabled !== null) { + message.defaultSendEnabled = Boolean(object.defaultSendEnabled); + } else { + message.defaultSendEnabled = false; + } + return message; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.sendEnabled) { + obj.sendEnabled = message.sendEnabled.map((e) => (e ? SendEnabled.toJSON(e) : undefined)); + } else { + obj.sendEnabled = []; + } + message.defaultSendEnabled !== undefined && (obj.defaultSendEnabled = message.defaultSendEnabled); + return obj; + }, + + fromPartial(object: DeepPartial): Params { + const message = { ...baseParams } as Params; + message.sendEnabled = []; + if (object.sendEnabled !== undefined && object.sendEnabled !== null) { + for (const e of object.sendEnabled) { + message.sendEnabled.push(SendEnabled.fromPartial(e)); + } + } + if (object.defaultSendEnabled !== undefined && object.defaultSendEnabled !== null) { + message.defaultSendEnabled = object.defaultSendEnabled; + } else { + message.defaultSendEnabled = false; + } + return message; + }, +}; + +const baseSendEnabled: object = { denom: "", enabled: false }; + +export const SendEnabled = { + encode(message: SendEnabled, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.enabled === true) { + writer.uint32(16).bool(message.enabled); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SendEnabled { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSendEnabled } as SendEnabled; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.enabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SendEnabled { + const message = { ...baseSendEnabled } as SendEnabled; + if (object.denom !== undefined && object.denom !== null) { + message.denom = String(object.denom); + } else { + message.denom = ""; + } + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = Boolean(object.enabled); + } else { + message.enabled = false; + } + return message; + }, + + toJSON(message: SendEnabled): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.enabled !== undefined && (obj.enabled = message.enabled); + return obj; + }, + + fromPartial(object: DeepPartial): SendEnabled { + const message = { ...baseSendEnabled } as SendEnabled; + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } else { + message.denom = ""; + } + if (object.enabled !== undefined && object.enabled !== null) { + message.enabled = object.enabled; + } else { + message.enabled = false; + } + return message; + }, +}; + +const baseInput: object = { address: "" }; + +export const Input = { + encode(message: Input, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Input { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseInput } as Input; + message.coins = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Input { + const message = { ...baseInput } as Input; + message.coins = []; + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.coins !== undefined && object.coins !== null) { + for (const e of object.coins) { + message.coins.push(Coin.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: Input): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.coins = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): Input { + const message = { ...baseInput } as Input; + message.coins = []; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.coins !== undefined && object.coins !== null) { + for (const e of object.coins) { + message.coins.push(Coin.fromPartial(e)); + } + } + return message; + }, +}; + +const baseOutput: object = { address: "" }; + +export const Output = { + encode(message: Output, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Output { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseOutput } as Output; + message.coins = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Output { + const message = { ...baseOutput } as Output; + message.coins = []; + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.coins !== undefined && object.coins !== null) { + for (const e of object.coins) { + message.coins.push(Coin.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: Output): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.coins = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): Output { + const message = { ...baseOutput } as Output; + message.coins = []; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.coins !== undefined && object.coins !== null) { + for (const e of object.coins) { + message.coins.push(Coin.fromPartial(e)); + } + } + return message; + }, +}; + +const baseSupply: object = {}; + +export const Supply = { + encode(message: Supply, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.total) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Supply { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSupply } as Supply; + message.total = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.total.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Supply { + const message = { ...baseSupply } as Supply; + message.total = []; + if (object.total !== undefined && object.total !== null) { + for (const e of object.total) { + message.total.push(Coin.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: Supply): unknown { + const obj: any = {}; + if (message.total) { + obj.total = message.total.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.total = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): Supply { + const message = { ...baseSupply } as Supply; + message.total = []; + if (object.total !== undefined && object.total !== null) { + for (const e of object.total) { + message.total.push(Coin.fromPartial(e)); + } + } + return message; + }, +}; + +const baseDenomUnit: object = { denom: "", exponent: 0, aliases: "" }; + +export const DenomUnit = { + encode(message: DenomUnit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.exponent !== 0) { + writer.uint32(16).uint32(message.exponent); + } + for (const v of message.aliases) { + writer.uint32(26).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DenomUnit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDenomUnit } as DenomUnit; + message.aliases = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.exponent = reader.uint32(); + break; + case 3: + message.aliases.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DenomUnit { + const message = { ...baseDenomUnit } as DenomUnit; + message.aliases = []; + if (object.denom !== undefined && object.denom !== null) { + message.denom = String(object.denom); + } else { + message.denom = ""; + } + if (object.exponent !== undefined && object.exponent !== null) { + message.exponent = Number(object.exponent); + } else { + message.exponent = 0; + } + if (object.aliases !== undefined && object.aliases !== null) { + for (const e of object.aliases) { + message.aliases.push(String(e)); + } + } + return message; + }, + + toJSON(message: DenomUnit): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.exponent !== undefined && (obj.exponent = message.exponent); + if (message.aliases) { + obj.aliases = message.aliases.map((e) => e); + } else { + obj.aliases = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): DenomUnit { + const message = { ...baseDenomUnit } as DenomUnit; + message.aliases = []; + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } else { + message.denom = ""; + } + if (object.exponent !== undefined && object.exponent !== null) { + message.exponent = object.exponent; + } else { + message.exponent = 0; + } + if (object.aliases !== undefined && object.aliases !== null) { + for (const e of object.aliases) { + message.aliases.push(e); + } + } + return message; + }, +}; + +const baseMetadata: object = { description: "", base: "", display: "", name: "", symbol: "" }; + +export const Metadata = { + encode(message: Metadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.description !== "") { + writer.uint32(10).string(message.description); + } + for (const v of message.denomUnits) { + DenomUnit.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.base !== "") { + writer.uint32(26).string(message.base); + } + if (message.display !== "") { + writer.uint32(34).string(message.display); + } + if (message.name !== "") { + writer.uint32(42).string(message.name); + } + if (message.symbol !== "") { + writer.uint32(50).string(message.symbol); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Metadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMetadata } as Metadata; + message.denomUnits = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = reader.string(); + break; + case 2: + message.denomUnits.push(DenomUnit.decode(reader, reader.uint32())); + break; + case 3: + message.base = reader.string(); + break; + case 4: + message.display = reader.string(); + break; + case 5: + message.name = reader.string(); + break; + case 6: + message.symbol = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Metadata { + const message = { ...baseMetadata } as Metadata; + message.denomUnits = []; + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.denomUnits !== undefined && object.denomUnits !== null) { + for (const e of object.denomUnits) { + message.denomUnits.push(DenomUnit.fromJSON(e)); + } + } + if (object.base !== undefined && object.base !== null) { + message.base = String(object.base); + } else { + message.base = ""; + } + if (object.display !== undefined && object.display !== null) { + message.display = String(object.display); + } else { + message.display = ""; + } + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = String(object.symbol); + } else { + message.symbol = ""; + } + return message; + }, + + toJSON(message: Metadata): unknown { + const obj: any = {}; + message.description !== undefined && (obj.description = message.description); + if (message.denomUnits) { + obj.denomUnits = message.denomUnits.map((e) => (e ? DenomUnit.toJSON(e) : undefined)); + } else { + obj.denomUnits = []; + } + message.base !== undefined && (obj.base = message.base); + message.display !== undefined && (obj.display = message.display); + message.name !== undefined && (obj.name = message.name); + message.symbol !== undefined && (obj.symbol = message.symbol); + return obj; + }, + + fromPartial(object: DeepPartial): Metadata { + const message = { ...baseMetadata } as Metadata; + message.denomUnits = []; + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.denomUnits !== undefined && object.denomUnits !== null) { + for (const e of object.denomUnits) { + message.denomUnits.push(DenomUnit.fromPartial(e)); + } + } + if (object.base !== undefined && object.base !== null) { + message.base = object.base; + } else { + message.base = ""; + } + if (object.display !== undefined && object.display !== null) { + message.display = object.display; + } else { + message.display = ""; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } else { + message.symbol = ""; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/bank/v1beta1/genesis.ts b/src/cosmos/bank/v1beta1/genesis.ts new file mode 100644 index 00000000..452821a6 --- /dev/null +++ b/src/cosmos/bank/v1beta1/genesis.ts @@ -0,0 +1,255 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Params, Metadata } from "../../../cosmos/bank/v1beta1/bank"; +import { Coin } from "../../../cosmos/base/v1beta1/coin"; + +export const protobufPackage = "cosmos.bank.v1beta1"; + +/** GenesisState defines the bank module's genesis state. */ +export interface GenesisState { + /** params defines all the paramaters of the module. */ + params?: Params; + /** balances is an array containing the balances of all the accounts. */ + balances: Balance[]; + /** + * supply represents the total supply. If it is left empty, then supply will be calculated based on the provided + * balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. + */ + supply: Coin[]; + /** denom_metadata defines the metadata of the differents coins. */ + denomMetadata: Metadata[]; +} + +/** + * Balance defines an account address and balance pair used in the bank module's + * genesis state. + */ +export interface Balance { + /** address is the address of the balance holder. */ + address: string; + /** coins defines the different coins this balance holds. */ + coins: Coin[]; +} + +const baseGenesisState: object = {}; + +export const GenesisState = { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.balances) { + Balance.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.supply) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.denomMetadata) { + Metadata.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGenesisState } as GenesisState; + message.balances = []; + message.supply = []; + message.denomMetadata = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.balances.push(Balance.decode(reader, reader.uint32())); + break; + case 3: + message.supply.push(Coin.decode(reader, reader.uint32())); + break; + case 4: + message.denomMetadata.push(Metadata.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.balances = []; + message.supply = []; + message.denomMetadata = []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + if (object.balances !== undefined && object.balances !== null) { + for (const e of object.balances) { + message.balances.push(Balance.fromJSON(e)); + } + } + if (object.supply !== undefined && object.supply !== null) { + for (const e of object.supply) { + message.supply.push(Coin.fromJSON(e)); + } + } + if (object.denomMetadata !== undefined && object.denomMetadata !== null) { + for (const e of object.denomMetadata) { + message.denomMetadata.push(Metadata.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + if (message.balances) { + obj.balances = message.balances.map((e) => (e ? Balance.toJSON(e) : undefined)); + } else { + obj.balances = []; + } + if (message.supply) { + obj.supply = message.supply.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.supply = []; + } + if (message.denomMetadata) { + obj.denomMetadata = message.denomMetadata.map((e) => (e ? Metadata.toJSON(e) : undefined)); + } else { + obj.denomMetadata = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.balances = []; + message.supply = []; + message.denomMetadata = []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + if (object.balances !== undefined && object.balances !== null) { + for (const e of object.balances) { + message.balances.push(Balance.fromPartial(e)); + } + } + if (object.supply !== undefined && object.supply !== null) { + for (const e of object.supply) { + message.supply.push(Coin.fromPartial(e)); + } + } + if (object.denomMetadata !== undefined && object.denomMetadata !== null) { + for (const e of object.denomMetadata) { + message.denomMetadata.push(Metadata.fromPartial(e)); + } + } + return message; + }, +}; + +const baseBalance: object = { address: "" }; + +export const Balance = { + encode(message: Balance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Balance { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseBalance } as Balance; + message.coins = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Balance { + const message = { ...baseBalance } as Balance; + message.coins = []; + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.coins !== undefined && object.coins !== null) { + for (const e of object.coins) { + message.coins.push(Coin.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: Balance): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + if (message.coins) { + obj.coins = message.coins.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.coins = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): Balance { + const message = { ...baseBalance } as Balance; + message.coins = []; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.coins !== undefined && object.coins !== null) { + for (const e of object.coins) { + message.coins.push(Coin.fromPartial(e)); + } + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/bank/v1beta1/query.ts b/src/cosmos/bank/v1beta1/query.ts new file mode 100644 index 00000000..0d905796 --- /dev/null +++ b/src/cosmos/bank/v1beta1/query.ts @@ -0,0 +1,1073 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; +import { Params, Metadata } from "../../../cosmos/bank/v1beta1/bank"; + +export const protobufPackage = "cosmos.bank.v1beta1"; + +/** QueryBalanceRequest is the request type for the Query/Balance RPC method. */ +export interface QueryBalanceRequest { + /** address is the address to query balances for. */ + address: string; + /** denom is the coin denom to query balances for. */ + denom: string; +} + +/** QueryBalanceResponse is the response type for the Query/Balance RPC method. */ +export interface QueryBalanceResponse { + /** balance is the balance of the coin. */ + balance?: Coin; +} + +/** QueryBalanceRequest is the request type for the Query/AllBalances RPC method. */ +export interface QueryAllBalancesRequest { + /** address is the address to query balances for. */ + address: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} + +/** + * QueryAllBalancesResponse is the response type for the Query/AllBalances RPC + * method. + */ +export interface QueryAllBalancesResponse { + /** balances is the balances of all the coins. */ + balances: Coin[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} + +/** + * QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC + * method. + */ +export interface QueryTotalSupplyRequest { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} + +/** + * QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC + * method + */ +export interface QueryTotalSupplyResponse { + /** supply is the supply of the coins */ + supply: Coin[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} + +/** QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. */ +export interface QuerySupplyOfRequest { + /** denom is the coin denom to query balances for. */ + denom: string; +} + +/** QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. */ +export interface QuerySupplyOfResponse { + /** amount is the supply of the coin. */ + amount?: Coin; +} + +/** QueryParamsRequest defines the request type for querying x/bank parameters. */ +export interface QueryParamsRequest {} + +/** QueryParamsResponse defines the response type for querying x/bank parameters. */ +export interface QueryParamsResponse { + params?: Params; +} + +/** QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. */ +export interface QueryDenomsMetadataRequest { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} + +/** + * QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC + * method. + */ +export interface QueryDenomsMetadataResponse { + /** metadata provides the client information for all the registered tokens. */ + metadatas: Metadata[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} + +/** QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. */ +export interface QueryDenomMetadataRequest { + /** denom is the coin denom to query the metadata for. */ + denom: string; +} + +/** + * QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC + * method. + */ +export interface QueryDenomMetadataResponse { + /** metadata describes and provides all the client information for the requested token. */ + metadata?: Metadata; +} + +const baseQueryBalanceRequest: object = { address: "", denom: "" }; + +export const QueryBalanceRequest = { + encode(message: QueryBalanceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalanceRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryBalanceRequest } as QueryBalanceRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryBalanceRequest { + const message = { ...baseQueryBalanceRequest } as QueryBalanceRequest; + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = String(object.denom); + } else { + message.denom = ""; + } + return message; + }, + + toJSON(message: QueryBalanceRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, + + fromPartial(object: DeepPartial): QueryBalanceRequest { + const message = { ...baseQueryBalanceRequest } as QueryBalanceRequest; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } else { + message.denom = ""; + } + return message; + }, +}; + +const baseQueryBalanceResponse: object = {}; + +export const QueryBalanceResponse = { + encode(message: QueryBalanceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.balance !== undefined) { + Coin.encode(message.balance, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalanceResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryBalanceResponse } as QueryBalanceResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balance = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryBalanceResponse { + const message = { ...baseQueryBalanceResponse } as QueryBalanceResponse; + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromJSON(object.balance); + } else { + message.balance = undefined; + } + return message; + }, + + toJSON(message: QueryBalanceResponse): unknown { + const obj: any = {}; + message.balance !== undefined && + (obj.balance = message.balance ? Coin.toJSON(message.balance) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryBalanceResponse { + const message = { ...baseQueryBalanceResponse } as QueryBalanceResponse; + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromPartial(object.balance); + } else { + message.balance = undefined; + } + return message; + }, +}; + +const baseQueryAllBalancesRequest: object = { address: "" }; + +export const QueryAllBalancesRequest = { + encode(message: QueryAllBalancesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllBalancesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryAllBalancesRequest } as QueryAllBalancesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllBalancesRequest { + const message = { ...baseQueryAllBalancesRequest } as QueryAllBalancesRequest; + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryAllBalancesRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryAllBalancesRequest { + const message = { ...baseQueryAllBalancesRequest } as QueryAllBalancesRequest; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryAllBalancesResponse: object = {}; + +export const QueryAllBalancesResponse = { + encode(message: QueryAllBalancesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.balances) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllBalancesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryAllBalancesResponse } as QueryAllBalancesResponse; + message.balances = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balances.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllBalancesResponse { + const message = { ...baseQueryAllBalancesResponse } as QueryAllBalancesResponse; + message.balances = []; + if (object.balances !== undefined && object.balances !== null) { + for (const e of object.balances) { + message.balances.push(Coin.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryAllBalancesResponse): unknown { + const obj: any = {}; + if (message.balances) { + obj.balances = message.balances.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.balances = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryAllBalancesResponse { + const message = { ...baseQueryAllBalancesResponse } as QueryAllBalancesResponse; + message.balances = []; + if (object.balances !== undefined && object.balances !== null) { + for (const e of object.balances) { + message.balances.push(Coin.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryTotalSupplyRequest: object = {}; + +export const QueryTotalSupplyRequest = { + encode(message: QueryTotalSupplyRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalSupplyRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryTotalSupplyRequest } as QueryTotalSupplyRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryTotalSupplyRequest { + const message = { ...baseQueryTotalSupplyRequest } as QueryTotalSupplyRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryTotalSupplyRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryTotalSupplyRequest { + const message = { ...baseQueryTotalSupplyRequest } as QueryTotalSupplyRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryTotalSupplyResponse: object = {}; + +export const QueryTotalSupplyResponse = { + encode(message: QueryTotalSupplyResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.supply) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalSupplyResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryTotalSupplyResponse } as QueryTotalSupplyResponse; + message.supply = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.supply.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryTotalSupplyResponse { + const message = { ...baseQueryTotalSupplyResponse } as QueryTotalSupplyResponse; + message.supply = []; + if (object.supply !== undefined && object.supply !== null) { + for (const e of object.supply) { + message.supply.push(Coin.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryTotalSupplyResponse): unknown { + const obj: any = {}; + if (message.supply) { + obj.supply = message.supply.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.supply = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryTotalSupplyResponse { + const message = { ...baseQueryTotalSupplyResponse } as QueryTotalSupplyResponse; + message.supply = []; + if (object.supply !== undefined && object.supply !== null) { + for (const e of object.supply) { + message.supply.push(Coin.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQuerySupplyOfRequest: object = { denom: "" }; + +export const QuerySupplyOfRequest = { + encode(message: QuerySupplyOfRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySupplyOfRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQuerySupplyOfRequest } as QuerySupplyOfRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QuerySupplyOfRequest { + const message = { ...baseQuerySupplyOfRequest } as QuerySupplyOfRequest; + if (object.denom !== undefined && object.denom !== null) { + message.denom = String(object.denom); + } else { + message.denom = ""; + } + return message; + }, + + toJSON(message: QuerySupplyOfRequest): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, + + fromPartial(object: DeepPartial): QuerySupplyOfRequest { + const message = { ...baseQuerySupplyOfRequest } as QuerySupplyOfRequest; + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } else { + message.denom = ""; + } + return message; + }, +}; + +const baseQuerySupplyOfResponse: object = {}; + +export const QuerySupplyOfResponse = { + encode(message: QuerySupplyOfResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySupplyOfResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQuerySupplyOfResponse } as QuerySupplyOfResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QuerySupplyOfResponse { + const message = { ...baseQuerySupplyOfResponse } as QuerySupplyOfResponse; + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromJSON(object.amount); + } else { + message.amount = undefined; + } + return message; + }, + + toJSON(message: QuerySupplyOfResponse): unknown { + const obj: any = {}; + message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QuerySupplyOfResponse { + const message = { ...baseQuerySupplyOfResponse } as QuerySupplyOfResponse; + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromPartial(object.amount); + } else { + message.amount = undefined; + } + return message; + }, +}; + +const baseQueryParamsRequest: object = {}; + +export const QueryParamsRequest = { + encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + return message; + }, + + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + return message; + }, +}; + +const baseQueryParamsResponse: object = {}; + +export const QueryParamsResponse = { + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + return message; + }, + + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + return message; + }, +}; + +const baseQueryDenomsMetadataRequest: object = {}; + +export const QueryDenomsMetadataRequest = { + encode(message: QueryDenomsMetadataRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomsMetadataRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDenomsMetadataRequest } as QueryDenomsMetadataRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDenomsMetadataRequest { + const message = { ...baseQueryDenomsMetadataRequest } as QueryDenomsMetadataRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryDenomsMetadataRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDenomsMetadataRequest { + const message = { ...baseQueryDenomsMetadataRequest } as QueryDenomsMetadataRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryDenomsMetadataResponse: object = {}; + +export const QueryDenomsMetadataResponse = { + encode(message: QueryDenomsMetadataResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.metadatas) { + Metadata.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomsMetadataResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDenomsMetadataResponse } as QueryDenomsMetadataResponse; + message.metadatas = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.metadatas.push(Metadata.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDenomsMetadataResponse { + const message = { ...baseQueryDenomsMetadataResponse } as QueryDenomsMetadataResponse; + message.metadatas = []; + if (object.metadatas !== undefined && object.metadatas !== null) { + for (const e of object.metadatas) { + message.metadatas.push(Metadata.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryDenomsMetadataResponse): unknown { + const obj: any = {}; + if (message.metadatas) { + obj.metadatas = message.metadatas.map((e) => (e ? Metadata.toJSON(e) : undefined)); + } else { + obj.metadatas = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDenomsMetadataResponse { + const message = { ...baseQueryDenomsMetadataResponse } as QueryDenomsMetadataResponse; + message.metadatas = []; + if (object.metadatas !== undefined && object.metadatas !== null) { + for (const e of object.metadatas) { + message.metadatas.push(Metadata.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryDenomMetadataRequest: object = { denom: "" }; + +export const QueryDenomMetadataRequest = { + encode(message: QueryDenomMetadataRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomMetadataRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDenomMetadataRequest } as QueryDenomMetadataRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDenomMetadataRequest { + const message = { ...baseQueryDenomMetadataRequest } as QueryDenomMetadataRequest; + if (object.denom !== undefined && object.denom !== null) { + message.denom = String(object.denom); + } else { + message.denom = ""; + } + return message; + }, + + toJSON(message: QueryDenomMetadataRequest): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDenomMetadataRequest { + const message = { ...baseQueryDenomMetadataRequest } as QueryDenomMetadataRequest; + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } else { + message.denom = ""; + } + return message; + }, +}; + +const baseQueryDenomMetadataResponse: object = {}; + +export const QueryDenomMetadataResponse = { + encode(message: QueryDenomMetadataResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.metadata !== undefined) { + Metadata.encode(message.metadata, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomMetadataResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDenomMetadataResponse } as QueryDenomMetadataResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.metadata = Metadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDenomMetadataResponse { + const message = { ...baseQueryDenomMetadataResponse } as QueryDenomMetadataResponse; + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = Metadata.fromJSON(object.metadata); + } else { + message.metadata = undefined; + } + return message; + }, + + toJSON(message: QueryDenomMetadataResponse): unknown { + const obj: any = {}; + message.metadata !== undefined && + (obj.metadata = message.metadata ? Metadata.toJSON(message.metadata) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDenomMetadataResponse { + const message = { ...baseQueryDenomMetadataResponse } as QueryDenomMetadataResponse; + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = Metadata.fromPartial(object.metadata); + } else { + message.metadata = undefined; + } + return message; + }, +}; + +/** Query defines the gRPC querier service. */ +export interface Query { + /** Balance queries the balance of a single coin for a single account. */ + Balance(request: QueryBalanceRequest): Promise; + /** AllBalances queries the balance of all coins for a single account. */ + AllBalances(request: QueryAllBalancesRequest): Promise; + /** TotalSupply queries the total supply of all coins. */ + TotalSupply(request: QueryTotalSupplyRequest): Promise; + /** SupplyOf queries the supply of a single coin. */ + SupplyOf(request: QuerySupplyOfRequest): Promise; + /** Params queries the parameters of x/bank module. */ + Params(request: QueryParamsRequest): Promise; + /** DenomsMetadata queries the client metadata of a given coin denomination. */ + DenomMetadata(request: QueryDenomMetadataRequest): Promise; + /** DenomsMetadata queries the client metadata for all registered coin denominations. */ + DenomsMetadata(request: QueryDenomsMetadataRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Balance = this.Balance.bind(this); + this.AllBalances = this.AllBalances.bind(this); + this.TotalSupply = this.TotalSupply.bind(this); + this.SupplyOf = this.SupplyOf.bind(this); + this.Params = this.Params.bind(this); + this.DenomMetadata = this.DenomMetadata.bind(this); + this.DenomsMetadata = this.DenomsMetadata.bind(this); + } + Balance(request: QueryBalanceRequest): Promise { + const data = QueryBalanceRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "Balance", data); + return promise.then((data) => QueryBalanceResponse.decode(new _m0.Reader(data))); + } + + AllBalances(request: QueryAllBalancesRequest): Promise { + const data = QueryAllBalancesRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "AllBalances", data); + return promise.then((data) => QueryAllBalancesResponse.decode(new _m0.Reader(data))); + } + + TotalSupply(request: QueryTotalSupplyRequest): Promise { + const data = QueryTotalSupplyRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "TotalSupply", data); + return promise.then((data) => QueryTotalSupplyResponse.decode(new _m0.Reader(data))); + } + + SupplyOf(request: QuerySupplyOfRequest): Promise { + const data = QuerySupplyOfRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "SupplyOf", data); + return promise.then((data) => QuerySupplyOfResponse.decode(new _m0.Reader(data))); + } + + Params(request: QueryParamsRequest): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "Params", data); + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + } + + DenomMetadata(request: QueryDenomMetadataRequest): Promise { + const data = QueryDenomMetadataRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomMetadata", data); + return promise.then((data) => QueryDenomMetadataResponse.decode(new _m0.Reader(data))); + } + + DenomsMetadata(request: QueryDenomsMetadataRequest): Promise { + const data = QueryDenomsMetadataRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomsMetadata", data); + return promise.then((data) => QueryDenomsMetadataResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/bank/v1beta1/tx.ts b/src/cosmos/bank/v1beta1/tx.ts new file mode 100644 index 00000000..3a69ee29 --- /dev/null +++ b/src/cosmos/bank/v1beta1/tx.ts @@ -0,0 +1,332 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import { Input, Output } from "../../../cosmos/bank/v1beta1/bank"; + +export const protobufPackage = "cosmos.bank.v1beta1"; + +/** MsgSend represents a message to send coins from one account to another. */ +export interface MsgSend { + fromAddress: string; + toAddress: string; + amount: Coin[]; +} + +/** MsgSendResponse defines the Msg/Send response type. */ +export interface MsgSendResponse {} + +/** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */ +export interface MsgMultiSend { + inputs: Input[]; + outputs: Output[]; +} + +/** MsgMultiSendResponse defines the Msg/MultiSend response type. */ +export interface MsgMultiSendResponse {} + +const baseMsgSend: object = { fromAddress: "", toAddress: "" }; + +export const MsgSend = { + encode(message: MsgSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.fromAddress !== "") { + writer.uint32(10).string(message.fromAddress); + } + if (message.toAddress !== "") { + writer.uint32(18).string(message.toAddress); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSend { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgSend } as MsgSend; + message.amount = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromAddress = reader.string(); + break; + case 2: + message.toAddress = reader.string(); + break; + case 3: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgSend { + const message = { ...baseMsgSend } as MsgSend; + message.amount = []; + if (object.fromAddress !== undefined && object.fromAddress !== null) { + message.fromAddress = String(object.fromAddress); + } else { + message.fromAddress = ""; + } + if (object.toAddress !== undefined && object.toAddress !== null) { + message.toAddress = String(object.toAddress); + } else { + message.toAddress = ""; + } + if (object.amount !== undefined && object.amount !== null) { + for (const e of object.amount) { + message.amount.push(Coin.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: MsgSend): unknown { + const obj: any = {}; + message.fromAddress !== undefined && (obj.fromAddress = message.fromAddress); + message.toAddress !== undefined && (obj.toAddress = message.toAddress); + if (message.amount) { + obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.amount = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): MsgSend { + const message = { ...baseMsgSend } as MsgSend; + message.amount = []; + if (object.fromAddress !== undefined && object.fromAddress !== null) { + message.fromAddress = object.fromAddress; + } else { + message.fromAddress = ""; + } + if (object.toAddress !== undefined && object.toAddress !== null) { + message.toAddress = object.toAddress; + } else { + message.toAddress = ""; + } + if (object.amount !== undefined && object.amount !== null) { + for (const e of object.amount) { + message.amount.push(Coin.fromPartial(e)); + } + } + return message; + }, +}; + +const baseMsgSendResponse: object = {}; + +export const MsgSendResponse = { + encode(_: MsgSendResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSendResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgSendResponse } as MsgSendResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgSendResponse { + const message = { ...baseMsgSendResponse } as MsgSendResponse; + return message; + }, + + toJSON(_: MsgSendResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgSendResponse { + const message = { ...baseMsgSendResponse } as MsgSendResponse; + return message; + }, +}; + +const baseMsgMultiSend: object = {}; + +export const MsgMultiSend = { + encode(message: MsgMultiSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.inputs) { + Input.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.outputs) { + Output.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgMultiSend { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgMultiSend } as MsgMultiSend; + message.inputs = []; + message.outputs = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inputs.push(Input.decode(reader, reader.uint32())); + break; + case 2: + message.outputs.push(Output.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgMultiSend { + const message = { ...baseMsgMultiSend } as MsgMultiSend; + message.inputs = []; + message.outputs = []; + if (object.inputs !== undefined && object.inputs !== null) { + for (const e of object.inputs) { + message.inputs.push(Input.fromJSON(e)); + } + } + if (object.outputs !== undefined && object.outputs !== null) { + for (const e of object.outputs) { + message.outputs.push(Output.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: MsgMultiSend): unknown { + const obj: any = {}; + if (message.inputs) { + obj.inputs = message.inputs.map((e) => (e ? Input.toJSON(e) : undefined)); + } else { + obj.inputs = []; + } + if (message.outputs) { + obj.outputs = message.outputs.map((e) => (e ? Output.toJSON(e) : undefined)); + } else { + obj.outputs = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): MsgMultiSend { + const message = { ...baseMsgMultiSend } as MsgMultiSend; + message.inputs = []; + message.outputs = []; + if (object.inputs !== undefined && object.inputs !== null) { + for (const e of object.inputs) { + message.inputs.push(Input.fromPartial(e)); + } + } + if (object.outputs !== undefined && object.outputs !== null) { + for (const e of object.outputs) { + message.outputs.push(Output.fromPartial(e)); + } + } + return message; + }, +}; + +const baseMsgMultiSendResponse: object = {}; + +export const MsgMultiSendResponse = { + encode(_: MsgMultiSendResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgMultiSendResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgMultiSendResponse } as MsgMultiSendResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgMultiSendResponse { + const message = { ...baseMsgMultiSendResponse } as MsgMultiSendResponse; + return message; + }, + + toJSON(_: MsgMultiSendResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgMultiSendResponse { + const message = { ...baseMsgMultiSendResponse } as MsgMultiSendResponse; + return message; + }, +}; + +/** Msg defines the bank Msg service. */ +export interface Msg { + /** Send defines a method for sending coins from one account to another account. */ + Send(request: MsgSend): Promise; + /** MultiSend defines a method for sending coins from some accounts to other accounts. */ + MultiSend(request: MsgMultiSend): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Send = this.Send.bind(this); + this.MultiSend = this.MultiSend.bind(this); + } + Send(request: MsgSend): Promise { + const data = MsgSend.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "Send", data); + return promise.then((data) => MsgSendResponse.decode(new _m0.Reader(data))); + } + + MultiSend(request: MsgMultiSend): Promise { + const data = MsgMultiSend.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "MultiSend", data); + return promise.then((data) => MsgMultiSendResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/base/abci/v1beta1/abci.ts b/src/cosmos/base/abci/v1beta1/abci.ts new file mode 100644 index 00000000..c3db3b05 --- /dev/null +++ b/src/cosmos/base/abci/v1beta1/abci.ts @@ -0,0 +1,1224 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Any } from "../../../../google/protobuf/any"; +import { Event } from "../../../../tendermint/abci/types"; + +export const protobufPackage = "cosmos.base.abci.v1beta1"; + +/** + * TxResponse defines a structure containing relevant tx data and metadata. The + * tags are stringified and the log is JSON decoded. + */ +export interface TxResponse { + /** The block height */ + height: Long; + /** The transaction hash. */ + txhash: string; + /** Namespace for the Code */ + codespace: string; + /** Response code. */ + code: number; + /** Result bytes, if any. */ + data: string; + /** + * The output of the application's logger (raw string). May be + * non-deterministic. + */ + rawLog: string; + /** The output of the application's logger (typed). May be non-deterministic. */ + logs: ABCIMessageLog[]; + /** Additional information. May be non-deterministic. */ + info: string; + /** Amount of gas requested for transaction. */ + gasWanted: Long; + /** Amount of gas consumed by transaction. */ + gasUsed: Long; + /** The request transaction bytes. */ + tx?: Any; + /** + * Time of the previous block. For heights > 1, it's the weighted median of + * the timestamps of the valid votes in the block.LastCommit. For height == 1, + * it's genesis time. + */ + timestamp: string; +} + +/** ABCIMessageLog defines a structure containing an indexed tx ABCI message log. */ +export interface ABCIMessageLog { + msgIndex: number; + log: string; + /** + * Events contains a slice of Event objects that were emitted during some + * execution. + */ + events: StringEvent[]; +} + +/** + * StringEvent defines en Event object wrapper where all the attributes + * contain key/value pairs that are strings instead of raw bytes. + */ +export interface StringEvent { + type: string; + attributes: Attribute[]; +} + +/** + * Attribute defines an attribute wrapper where the key and value are + * strings instead of raw bytes. + */ +export interface Attribute { + key: string; + value: string; +} + +/** GasInfo defines tx execution gas context. */ +export interface GasInfo { + /** GasWanted is the maximum units of work we allow this tx to perform. */ + gasWanted: Long; + /** GasUsed is the amount of gas actually consumed. */ + gasUsed: Long; +} + +/** Result is the union of ResponseFormat and ResponseCheckTx. */ +export interface Result { + /** + * Data is any data returned from message or handler execution. It MUST be + * length prefixed in order to separate data from multiple message executions. + */ + data: Uint8Array; + /** Log contains the log information from message or handler execution. */ + log: string; + /** + * Events contains a slice of Event objects that were emitted during message + * or handler execution. + */ + events: Event[]; +} + +/** + * SimulationResponse defines the response generated when a transaction is + * successfully simulated. + */ +export interface SimulationResponse { + gasInfo?: GasInfo; + result?: Result; +} + +/** + * MsgData defines the data returned in a Result object during message + * execution. + */ +export interface MsgData { + msgType: string; + data: Uint8Array; +} + +/** + * TxMsgData defines a list of MsgData. A transaction will have a MsgData object + * for each message. + */ +export interface TxMsgData { + data: MsgData[]; +} + +/** SearchTxsResult defines a structure for querying txs pageable */ +export interface SearchTxsResult { + /** Count of all txs */ + totalCount: Long; + /** Count of txs in current page */ + count: Long; + /** Index of current page, start from 1 */ + pageNumber: Long; + /** Count of total pages */ + pageTotal: Long; + /** Max count txs per page */ + limit: Long; + /** List of txs in current page */ + txs: TxResponse[]; +} + +const baseTxResponse: object = { + height: Long.ZERO, + txhash: "", + codespace: "", + code: 0, + data: "", + rawLog: "", + info: "", + gasWanted: Long.ZERO, + gasUsed: Long.ZERO, + timestamp: "", +}; + +export const TxResponse = { + encode(message: TxResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.height.isZero()) { + writer.uint32(8).int64(message.height); + } + if (message.txhash !== "") { + writer.uint32(18).string(message.txhash); + } + if (message.codespace !== "") { + writer.uint32(26).string(message.codespace); + } + if (message.code !== 0) { + writer.uint32(32).uint32(message.code); + } + if (message.data !== "") { + writer.uint32(42).string(message.data); + } + if (message.rawLog !== "") { + writer.uint32(50).string(message.rawLog); + } + for (const v of message.logs) { + ABCIMessageLog.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.info !== "") { + writer.uint32(66).string(message.info); + } + if (!message.gasWanted.isZero()) { + writer.uint32(72).int64(message.gasWanted); + } + if (!message.gasUsed.isZero()) { + writer.uint32(80).int64(message.gasUsed); + } + if (message.tx !== undefined) { + Any.encode(message.tx, writer.uint32(90).fork()).ldelim(); + } + if (message.timestamp !== "") { + writer.uint32(98).string(message.timestamp); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TxResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTxResponse } as TxResponse; + message.logs = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64() as Long; + break; + case 2: + message.txhash = reader.string(); + break; + case 3: + message.codespace = reader.string(); + break; + case 4: + message.code = reader.uint32(); + break; + case 5: + message.data = reader.string(); + break; + case 6: + message.rawLog = reader.string(); + break; + case 7: + message.logs.push(ABCIMessageLog.decode(reader, reader.uint32())); + break; + case 8: + message.info = reader.string(); + break; + case 9: + message.gasWanted = reader.int64() as Long; + break; + case 10: + message.gasUsed = reader.int64() as Long; + break; + case 11: + message.tx = Any.decode(reader, reader.uint32()); + break; + case 12: + message.timestamp = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TxResponse { + const message = { ...baseTxResponse } as TxResponse; + message.logs = []; + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.ZERO; + } + if (object.txhash !== undefined && object.txhash !== null) { + message.txhash = String(object.txhash); + } else { + message.txhash = ""; + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = String(object.codespace); + } else { + message.codespace = ""; + } + if (object.code !== undefined && object.code !== null) { + message.code = Number(object.code); + } else { + message.code = 0; + } + if (object.data !== undefined && object.data !== null) { + message.data = String(object.data); + } else { + message.data = ""; + } + if (object.rawLog !== undefined && object.rawLog !== null) { + message.rawLog = String(object.rawLog); + } else { + message.rawLog = ""; + } + if (object.logs !== undefined && object.logs !== null) { + for (const e of object.logs) { + message.logs.push(ABCIMessageLog.fromJSON(e)); + } + } + if (object.info !== undefined && object.info !== null) { + message.info = String(object.info); + } else { + message.info = ""; + } + if (object.gasWanted !== undefined && object.gasWanted !== null) { + message.gasWanted = Long.fromString(object.gasWanted); + } else { + message.gasWanted = Long.ZERO; + } + if (object.gasUsed !== undefined && object.gasUsed !== null) { + message.gasUsed = Long.fromString(object.gasUsed); + } else { + message.gasUsed = Long.ZERO; + } + if (object.tx !== undefined && object.tx !== null) { + message.tx = Any.fromJSON(object.tx); + } else { + message.tx = undefined; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = String(object.timestamp); + } else { + message.timestamp = ""; + } + return message; + }, + + toJSON(message: TxResponse): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.txhash !== undefined && (obj.txhash = message.txhash); + message.codespace !== undefined && (obj.codespace = message.codespace); + message.code !== undefined && (obj.code = message.code); + message.data !== undefined && (obj.data = message.data); + message.rawLog !== undefined && (obj.rawLog = message.rawLog); + if (message.logs) { + obj.logs = message.logs.map((e) => (e ? ABCIMessageLog.toJSON(e) : undefined)); + } else { + obj.logs = []; + } + message.info !== undefined && (obj.info = message.info); + message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || Long.ZERO).toString()); + message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || Long.ZERO).toString()); + message.tx !== undefined && (obj.tx = message.tx ? Any.toJSON(message.tx) : undefined); + message.timestamp !== undefined && (obj.timestamp = message.timestamp); + return obj; + }, + + fromPartial(object: DeepPartial): TxResponse { + const message = { ...baseTxResponse } as TxResponse; + message.logs = []; + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.ZERO; + } + if (object.txhash !== undefined && object.txhash !== null) { + message.txhash = object.txhash; + } else { + message.txhash = ""; + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } else { + message.codespace = ""; + } + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } else { + message.code = 0; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = ""; + } + if (object.rawLog !== undefined && object.rawLog !== null) { + message.rawLog = object.rawLog; + } else { + message.rawLog = ""; + } + if (object.logs !== undefined && object.logs !== null) { + for (const e of object.logs) { + message.logs.push(ABCIMessageLog.fromPartial(e)); + } + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } else { + message.info = ""; + } + if (object.gasWanted !== undefined && object.gasWanted !== null) { + message.gasWanted = object.gasWanted as Long; + } else { + message.gasWanted = Long.ZERO; + } + if (object.gasUsed !== undefined && object.gasUsed !== null) { + message.gasUsed = object.gasUsed as Long; + } else { + message.gasUsed = Long.ZERO; + } + if (object.tx !== undefined && object.tx !== null) { + message.tx = Any.fromPartial(object.tx); + } else { + message.tx = undefined; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = object.timestamp; + } else { + message.timestamp = ""; + } + return message; + }, +}; + +const baseABCIMessageLog: object = { msgIndex: 0, log: "" }; + +export const ABCIMessageLog = { + encode(message: ABCIMessageLog, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.msgIndex !== 0) { + writer.uint32(8).uint32(message.msgIndex); + } + if (message.log !== "") { + writer.uint32(18).string(message.log); + } + for (const v of message.events) { + StringEvent.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ABCIMessageLog { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseABCIMessageLog } as ABCIMessageLog; + message.events = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.msgIndex = reader.uint32(); + break; + case 2: + message.log = reader.string(); + break; + case 3: + message.events.push(StringEvent.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ABCIMessageLog { + const message = { ...baseABCIMessageLog } as ABCIMessageLog; + message.events = []; + if (object.msgIndex !== undefined && object.msgIndex !== null) { + message.msgIndex = Number(object.msgIndex); + } else { + message.msgIndex = 0; + } + if (object.log !== undefined && object.log !== null) { + message.log = String(object.log); + } else { + message.log = ""; + } + if (object.events !== undefined && object.events !== null) { + for (const e of object.events) { + message.events.push(StringEvent.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: ABCIMessageLog): unknown { + const obj: any = {}; + message.msgIndex !== undefined && (obj.msgIndex = message.msgIndex); + message.log !== undefined && (obj.log = message.log); + if (message.events) { + obj.events = message.events.map((e) => (e ? StringEvent.toJSON(e) : undefined)); + } else { + obj.events = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ABCIMessageLog { + const message = { ...baseABCIMessageLog } as ABCIMessageLog; + message.events = []; + if (object.msgIndex !== undefined && object.msgIndex !== null) { + message.msgIndex = object.msgIndex; + } else { + message.msgIndex = 0; + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } else { + message.log = ""; + } + if (object.events !== undefined && object.events !== null) { + for (const e of object.events) { + message.events.push(StringEvent.fromPartial(e)); + } + } + return message; + }, +}; + +const baseStringEvent: object = { type: "" }; + +export const StringEvent = { + encode(message: StringEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.type !== "") { + writer.uint32(10).string(message.type); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StringEvent { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStringEvent } as StringEvent; + message.attributes = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.attributes.push(Attribute.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StringEvent { + const message = { ...baseStringEvent } as StringEvent; + message.attributes = []; + if (object.type !== undefined && object.type !== null) { + message.type = String(object.type); + } else { + message.type = ""; + } + if (object.attributes !== undefined && object.attributes !== null) { + for (const e of object.attributes) { + message.attributes.push(Attribute.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: StringEvent): unknown { + const obj: any = {}; + message.type !== undefined && (obj.type = message.type); + if (message.attributes) { + obj.attributes = message.attributes.map((e) => (e ? Attribute.toJSON(e) : undefined)); + } else { + obj.attributes = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): StringEvent { + const message = { ...baseStringEvent } as StringEvent; + message.attributes = []; + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = ""; + } + if (object.attributes !== undefined && object.attributes !== null) { + for (const e of object.attributes) { + message.attributes.push(Attribute.fromPartial(e)); + } + } + return message; + }, +}; + +const baseAttribute: object = { key: "", value: "" }; + +export const Attribute = { + encode(message: Attribute, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Attribute { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAttribute } as Attribute; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Attribute { + const message = { ...baseAttribute } as Attribute; + if (object.key !== undefined && object.key !== null) { + message.key = String(object.key); + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = String(object.value); + } else { + message.value = ""; + } + return message; + }, + + toJSON(message: Attribute): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial(object: DeepPartial): Attribute { + const message = { ...baseAttribute } as Attribute; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } else { + message.value = ""; + } + return message; + }, +}; + +const baseGasInfo: object = { gasWanted: Long.UZERO, gasUsed: Long.UZERO }; + +export const GasInfo = { + encode(message: GasInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.gasWanted.isZero()) { + writer.uint32(8).uint64(message.gasWanted); + } + if (!message.gasUsed.isZero()) { + writer.uint32(16).uint64(message.gasUsed); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GasInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGasInfo } as GasInfo; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gasWanted = reader.uint64() as Long; + break; + case 2: + message.gasUsed = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GasInfo { + const message = { ...baseGasInfo } as GasInfo; + if (object.gasWanted !== undefined && object.gasWanted !== null) { + message.gasWanted = Long.fromString(object.gasWanted); + } else { + message.gasWanted = Long.UZERO; + } + if (object.gasUsed !== undefined && object.gasUsed !== null) { + message.gasUsed = Long.fromString(object.gasUsed); + } else { + message.gasUsed = Long.UZERO; + } + return message; + }, + + toJSON(message: GasInfo): unknown { + const obj: any = {}; + message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || Long.UZERO).toString()); + message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): GasInfo { + const message = { ...baseGasInfo } as GasInfo; + if (object.gasWanted !== undefined && object.gasWanted !== null) { + message.gasWanted = object.gasWanted as Long; + } else { + message.gasWanted = Long.UZERO; + } + if (object.gasUsed !== undefined && object.gasUsed !== null) { + message.gasUsed = object.gasUsed as Long; + } else { + message.gasUsed = Long.UZERO; + } + return message; + }, +}; + +const baseResult: object = { log: "" }; + +export const Result = { + encode(message: Result, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + if (message.log !== "") { + writer.uint32(18).string(message.log); + } + for (const v of message.events) { + Event.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Result { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseResult } as Result; + message.events = []; + message.data = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + case 2: + message.log = reader.string(); + break; + case 3: + message.events.push(Event.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Result { + const message = { ...baseResult } as Result; + message.events = []; + message.data = new Uint8Array(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.log !== undefined && object.log !== null) { + message.log = String(object.log); + } else { + message.log = ""; + } + if (object.events !== undefined && object.events !== null) { + for (const e of object.events) { + message.events.push(Event.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: Result): unknown { + const obj: any = {}; + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.log !== undefined && (obj.log = message.log); + if (message.events) { + obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)); + } else { + obj.events = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): Result { + const message = { ...baseResult } as Result; + message.events = []; + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } else { + message.log = ""; + } + if (object.events !== undefined && object.events !== null) { + for (const e of object.events) { + message.events.push(Event.fromPartial(e)); + } + } + return message; + }, +}; + +const baseSimulationResponse: object = {}; + +export const SimulationResponse = { + encode(message: SimulationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.gasInfo !== undefined) { + GasInfo.encode(message.gasInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.result !== undefined) { + Result.encode(message.result, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SimulationResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSimulationResponse } as SimulationResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gasInfo = GasInfo.decode(reader, reader.uint32()); + break; + case 2: + message.result = Result.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SimulationResponse { + const message = { ...baseSimulationResponse } as SimulationResponse; + if (object.gasInfo !== undefined && object.gasInfo !== null) { + message.gasInfo = GasInfo.fromJSON(object.gasInfo); + } else { + message.gasInfo = undefined; + } + if (object.result !== undefined && object.result !== null) { + message.result = Result.fromJSON(object.result); + } else { + message.result = undefined; + } + return message; + }, + + toJSON(message: SimulationResponse): unknown { + const obj: any = {}; + message.gasInfo !== undefined && + (obj.gasInfo = message.gasInfo ? GasInfo.toJSON(message.gasInfo) : undefined); + message.result !== undefined && (obj.result = message.result ? Result.toJSON(message.result) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): SimulationResponse { + const message = { ...baseSimulationResponse } as SimulationResponse; + if (object.gasInfo !== undefined && object.gasInfo !== null) { + message.gasInfo = GasInfo.fromPartial(object.gasInfo); + } else { + message.gasInfo = undefined; + } + if (object.result !== undefined && object.result !== null) { + message.result = Result.fromPartial(object.result); + } else { + message.result = undefined; + } + return message; + }, +}; + +const baseMsgData: object = { msgType: "" }; + +export const MsgData = { + encode(message: MsgData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.msgType !== "") { + writer.uint32(10).string(message.msgType); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgData { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgData } as MsgData; + message.data = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.msgType = reader.string(); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgData { + const message = { ...baseMsgData } as MsgData; + message.data = new Uint8Array(); + if (object.msgType !== undefined && object.msgType !== null) { + message.msgType = String(object.msgType); + } else { + message.msgType = ""; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + + toJSON(message: MsgData): unknown { + const obj: any = {}; + message.msgType !== undefined && (obj.msgType = message.msgType); + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): MsgData { + const message = { ...baseMsgData } as MsgData; + if (object.msgType !== undefined && object.msgType !== null) { + message.msgType = object.msgType; + } else { + message.msgType = ""; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + return message; + }, +}; + +const baseTxMsgData: object = {}; + +export const TxMsgData = { + encode(message: TxMsgData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.data) { + MsgData.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TxMsgData { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTxMsgData } as TxMsgData; + message.data = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data.push(MsgData.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TxMsgData { + const message = { ...baseTxMsgData } as TxMsgData; + message.data = []; + if (object.data !== undefined && object.data !== null) { + for (const e of object.data) { + message.data.push(MsgData.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: TxMsgData): unknown { + const obj: any = {}; + if (message.data) { + obj.data = message.data.map((e) => (e ? MsgData.toJSON(e) : undefined)); + } else { + obj.data = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): TxMsgData { + const message = { ...baseTxMsgData } as TxMsgData; + message.data = []; + if (object.data !== undefined && object.data !== null) { + for (const e of object.data) { + message.data.push(MsgData.fromPartial(e)); + } + } + return message; + }, +}; + +const baseSearchTxsResult: object = { + totalCount: Long.UZERO, + count: Long.UZERO, + pageNumber: Long.UZERO, + pageTotal: Long.UZERO, + limit: Long.UZERO, +}; + +export const SearchTxsResult = { + encode(message: SearchTxsResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.totalCount.isZero()) { + writer.uint32(8).uint64(message.totalCount); + } + if (!message.count.isZero()) { + writer.uint32(16).uint64(message.count); + } + if (!message.pageNumber.isZero()) { + writer.uint32(24).uint64(message.pageNumber); + } + if (!message.pageTotal.isZero()) { + writer.uint32(32).uint64(message.pageTotal); + } + if (!message.limit.isZero()) { + writer.uint32(40).uint64(message.limit); + } + for (const v of message.txs) { + TxResponse.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SearchTxsResult { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSearchTxsResult } as SearchTxsResult; + message.txs = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalCount = reader.uint64() as Long; + break; + case 2: + message.count = reader.uint64() as Long; + break; + case 3: + message.pageNumber = reader.uint64() as Long; + break; + case 4: + message.pageTotal = reader.uint64() as Long; + break; + case 5: + message.limit = reader.uint64() as Long; + break; + case 6: + message.txs.push(TxResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SearchTxsResult { + const message = { ...baseSearchTxsResult } as SearchTxsResult; + message.txs = []; + if (object.totalCount !== undefined && object.totalCount !== null) { + message.totalCount = Long.fromString(object.totalCount); + } else { + message.totalCount = Long.UZERO; + } + if (object.count !== undefined && object.count !== null) { + message.count = Long.fromString(object.count); + } else { + message.count = Long.UZERO; + } + if (object.pageNumber !== undefined && object.pageNumber !== null) { + message.pageNumber = Long.fromString(object.pageNumber); + } else { + message.pageNumber = Long.UZERO; + } + if (object.pageTotal !== undefined && object.pageTotal !== null) { + message.pageTotal = Long.fromString(object.pageTotal); + } else { + message.pageTotal = Long.UZERO; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = Long.fromString(object.limit); + } else { + message.limit = Long.UZERO; + } + if (object.txs !== undefined && object.txs !== null) { + for (const e of object.txs) { + message.txs.push(TxResponse.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: SearchTxsResult): unknown { + const obj: any = {}; + message.totalCount !== undefined && (obj.totalCount = (message.totalCount || Long.UZERO).toString()); + message.count !== undefined && (obj.count = (message.count || Long.UZERO).toString()); + message.pageNumber !== undefined && (obj.pageNumber = (message.pageNumber || Long.UZERO).toString()); + message.pageTotal !== undefined && (obj.pageTotal = (message.pageTotal || Long.UZERO).toString()); + message.limit !== undefined && (obj.limit = (message.limit || Long.UZERO).toString()); + if (message.txs) { + obj.txs = message.txs.map((e) => (e ? TxResponse.toJSON(e) : undefined)); + } else { + obj.txs = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): SearchTxsResult { + const message = { ...baseSearchTxsResult } as SearchTxsResult; + message.txs = []; + if (object.totalCount !== undefined && object.totalCount !== null) { + message.totalCount = object.totalCount as Long; + } else { + message.totalCount = Long.UZERO; + } + if (object.count !== undefined && object.count !== null) { + message.count = object.count as Long; + } else { + message.count = Long.UZERO; + } + if (object.pageNumber !== undefined && object.pageNumber !== null) { + message.pageNumber = object.pageNumber as Long; + } else { + message.pageNumber = Long.UZERO; + } + if (object.pageTotal !== undefined && object.pageTotal !== null) { + message.pageTotal = object.pageTotal as Long; + } else { + message.pageTotal = Long.UZERO; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = object.limit as Long; + } else { + message.limit = Long.UZERO; + } + if (object.txs !== undefined && object.txs !== null) { + for (const e of object.txs) { + message.txs.push(TxResponse.fromPartial(e)); + } + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/base/kv/v1beta1/kv.ts b/src/cosmos/base/kv/v1beta1/kv.ts new file mode 100644 index 00000000..b5bf2831 --- /dev/null +++ b/src/cosmos/base/kv/v1beta1/kv.ts @@ -0,0 +1,199 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.base.kv.v1beta1"; + +/** Pairs defines a repeated slice of Pair objects. */ +export interface Pairs { + pairs: Pair[]; +} + +/** Pair defines a key/value bytes tuple. */ +export interface Pair { + key: Uint8Array; + value: Uint8Array; +} + +const basePairs: object = {}; + +export const Pairs = { + encode(message: Pairs, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.pairs) { + Pair.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Pairs { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePairs } as Pairs; + message.pairs = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pairs.push(Pair.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Pairs { + const message = { ...basePairs } as Pairs; + message.pairs = []; + if (object.pairs !== undefined && object.pairs !== null) { + for (const e of object.pairs) { + message.pairs.push(Pair.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: Pairs): unknown { + const obj: any = {}; + if (message.pairs) { + obj.pairs = message.pairs.map((e) => (e ? Pair.toJSON(e) : undefined)); + } else { + obj.pairs = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): Pairs { + const message = { ...basePairs } as Pairs; + message.pairs = []; + if (object.pairs !== undefined && object.pairs !== null) { + for (const e of object.pairs) { + message.pairs.push(Pair.fromPartial(e)); + } + } + return message; + }, +}; + +const basePair: object = {}; + +export const Pair = { + encode(message: Pair, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Pair { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePair } as Pair; + message.key = new Uint8Array(); + message.value = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Pair { + const message = { ...basePair } as Pair; + message.key = new Uint8Array(); + message.value = new Uint8Array(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; + }, + + toJSON(message: Pair): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.value !== undefined && + (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): Pair { + const message = { ...basePair } as Pair; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } else { + message.value = new Uint8Array(); + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/base/query/v1beta1/pagination.ts b/src/cosmos/base/query/v1beta1/pagination.ts new file mode 100644 index 00000000..053f01b5 --- /dev/null +++ b/src/cosmos/base/query/v1beta1/pagination.ts @@ -0,0 +1,309 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.base.query.v1beta1"; + +/** + * PageRequest is to be embedded in gRPC request messages for efficient + * pagination. Ex: + * + * message SomeRequest { + * Foo some_parameter = 1; + * PageRequest pagination = 2; + * } + */ +export interface PageRequest { + /** + * key is a value returned in PageResponse.next_key to begin + * querying the next page most efficiently. Only one of offset or key + * should be set. + */ + key: Uint8Array; + /** + * offset is a numeric offset that can be used when key is unavailable. + * It is less efficient than using key. Only one of offset or key should + * be set. + */ + offset: Long; + /** + * limit is the total number of results to be returned in the result page. + * If left empty it will default to a value to be set by each app. + */ + limit: Long; + /** + * count_total is set to true to indicate that the result set should include + * a count of the total number of items available for pagination in UIs. + * count_total is only respected when offset is used. It is ignored when key + * is set. + */ + countTotal: boolean; + /** reverse is set to true indicates that, results to be returned in the descending order. */ + reverse: boolean; +} + +/** + * PageResponse is to be embedded in gRPC response messages where the + * corresponding request message has used PageRequest. + * + * message SomeResponse { + * repeated Bar results = 1; + * PageResponse page = 2; + * } + */ +export interface PageResponse { + /** + * next_key is the key to be passed to PageRequest.key to + * query the next page most efficiently + */ + nextKey: Uint8Array; + /** + * total is total number of results available if PageRequest.count_total + * was set, its value is undefined otherwise + */ + total: Long; +} + +const basePageRequest: object = { offset: Long.UZERO, limit: Long.UZERO, countTotal: false, reverse: false }; + +export const PageRequest = { + encode(message: PageRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (!message.offset.isZero()) { + writer.uint32(16).uint64(message.offset); + } + if (!message.limit.isZero()) { + writer.uint32(24).uint64(message.limit); + } + if (message.countTotal === true) { + writer.uint32(32).bool(message.countTotal); + } + if (message.reverse === true) { + writer.uint32(40).bool(message.reverse); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PageRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePageRequest } as PageRequest; + message.key = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.offset = reader.uint64() as Long; + break; + case 3: + message.limit = reader.uint64() as Long; + break; + case 4: + message.countTotal = reader.bool(); + break; + case 5: + message.reverse = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PageRequest { + const message = { ...basePageRequest } as PageRequest; + message.key = new Uint8Array(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.offset !== undefined && object.offset !== null) { + message.offset = Long.fromString(object.offset); + } else { + message.offset = Long.UZERO; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = Long.fromString(object.limit); + } else { + message.limit = Long.UZERO; + } + if (object.countTotal !== undefined && object.countTotal !== null) { + message.countTotal = Boolean(object.countTotal); + } else { + message.countTotal = false; + } + if (object.reverse !== undefined && object.reverse !== null) { + message.reverse = Boolean(object.reverse); + } else { + message.reverse = false; + } + return message; + }, + + toJSON(message: PageRequest): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.offset !== undefined && (obj.offset = (message.offset || Long.UZERO).toString()); + message.limit !== undefined && (obj.limit = (message.limit || Long.UZERO).toString()); + message.countTotal !== undefined && (obj.countTotal = message.countTotal); + message.reverse !== undefined && (obj.reverse = message.reverse); + return obj; + }, + + fromPartial(object: DeepPartial): PageRequest { + const message = { ...basePageRequest } as PageRequest; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + if (object.offset !== undefined && object.offset !== null) { + message.offset = object.offset as Long; + } else { + message.offset = Long.UZERO; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = object.limit as Long; + } else { + message.limit = Long.UZERO; + } + if (object.countTotal !== undefined && object.countTotal !== null) { + message.countTotal = object.countTotal; + } else { + message.countTotal = false; + } + if (object.reverse !== undefined && object.reverse !== null) { + message.reverse = object.reverse; + } else { + message.reverse = false; + } + return message; + }, +}; + +const basePageResponse: object = { total: Long.UZERO }; + +export const PageResponse = { + encode(message: PageResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.nextKey.length !== 0) { + writer.uint32(10).bytes(message.nextKey); + } + if (!message.total.isZero()) { + writer.uint32(16).uint64(message.total); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PageResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePageResponse } as PageResponse; + message.nextKey = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nextKey = reader.bytes(); + break; + case 2: + message.total = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PageResponse { + const message = { ...basePageResponse } as PageResponse; + message.nextKey = new Uint8Array(); + if (object.nextKey !== undefined && object.nextKey !== null) { + message.nextKey = bytesFromBase64(object.nextKey); + } + if (object.total !== undefined && object.total !== null) { + message.total = Long.fromString(object.total); + } else { + message.total = Long.UZERO; + } + return message; + }, + + toJSON(message: PageResponse): unknown { + const obj: any = {}; + message.nextKey !== undefined && + (obj.nextKey = base64FromBytes(message.nextKey !== undefined ? message.nextKey : new Uint8Array())); + message.total !== undefined && (obj.total = (message.total || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): PageResponse { + const message = { ...basePageResponse } as PageResponse; + if (object.nextKey !== undefined && object.nextKey !== null) { + message.nextKey = object.nextKey; + } else { + message.nextKey = new Uint8Array(); + } + if (object.total !== undefined && object.total !== null) { + message.total = object.total as Long; + } else { + message.total = Long.UZERO; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/base/reflection/v1beta1/reflection.ts b/src/cosmos/base/reflection/v1beta1/reflection.ts new file mode 100644 index 00000000..399cfc40 --- /dev/null +++ b/src/cosmos/base/reflection/v1beta1/reflection.ts @@ -0,0 +1,310 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.base.reflection.v1beta1"; + +/** ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC. */ +export interface ListAllInterfacesRequest {} + +/** ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. */ +export interface ListAllInterfacesResponse { + /** interface_names is an array of all the registered interfaces. */ + interfaceNames: string[]; +} + +/** + * ListImplementationsRequest is the request type of the ListImplementations + * RPC. + */ +export interface ListImplementationsRequest { + /** interface_name defines the interface to query the implementations for. */ + interfaceName: string; +} + +/** + * ListImplementationsResponse is the response type of the ListImplementations + * RPC. + */ +export interface ListImplementationsResponse { + implementationMessageNames: string[]; +} + +const baseListAllInterfacesRequest: object = {}; + +export const ListAllInterfacesRequest = { + encode(_: ListAllInterfacesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListAllInterfacesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListAllInterfacesRequest } as ListAllInterfacesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): ListAllInterfacesRequest { + const message = { ...baseListAllInterfacesRequest } as ListAllInterfacesRequest; + return message; + }, + + toJSON(_: ListAllInterfacesRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): ListAllInterfacesRequest { + const message = { ...baseListAllInterfacesRequest } as ListAllInterfacesRequest; + return message; + }, +}; + +const baseListAllInterfacesResponse: object = { interfaceNames: "" }; + +export const ListAllInterfacesResponse = { + encode(message: ListAllInterfacesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.interfaceNames) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListAllInterfacesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListAllInterfacesResponse } as ListAllInterfacesResponse; + message.interfaceNames = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.interfaceNames.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListAllInterfacesResponse { + const message = { ...baseListAllInterfacesResponse } as ListAllInterfacesResponse; + message.interfaceNames = []; + if (object.interfaceNames !== undefined && object.interfaceNames !== null) { + for (const e of object.interfaceNames) { + message.interfaceNames.push(String(e)); + } + } + return message; + }, + + toJSON(message: ListAllInterfacesResponse): unknown { + const obj: any = {}; + if (message.interfaceNames) { + obj.interfaceNames = message.interfaceNames.map((e) => e); + } else { + obj.interfaceNames = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ListAllInterfacesResponse { + const message = { ...baseListAllInterfacesResponse } as ListAllInterfacesResponse; + message.interfaceNames = []; + if (object.interfaceNames !== undefined && object.interfaceNames !== null) { + for (const e of object.interfaceNames) { + message.interfaceNames.push(e); + } + } + return message; + }, +}; + +const baseListImplementationsRequest: object = { interfaceName: "" }; + +export const ListImplementationsRequest = { + encode(message: ListImplementationsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.interfaceName !== "") { + writer.uint32(10).string(message.interfaceName); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListImplementationsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListImplementationsRequest } as ListImplementationsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.interfaceName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListImplementationsRequest { + const message = { ...baseListImplementationsRequest } as ListImplementationsRequest; + if (object.interfaceName !== undefined && object.interfaceName !== null) { + message.interfaceName = String(object.interfaceName); + } else { + message.interfaceName = ""; + } + return message; + }, + + toJSON(message: ListImplementationsRequest): unknown { + const obj: any = {}; + message.interfaceName !== undefined && (obj.interfaceName = message.interfaceName); + return obj; + }, + + fromPartial(object: DeepPartial): ListImplementationsRequest { + const message = { ...baseListImplementationsRequest } as ListImplementationsRequest; + if (object.interfaceName !== undefined && object.interfaceName !== null) { + message.interfaceName = object.interfaceName; + } else { + message.interfaceName = ""; + } + return message; + }, +}; + +const baseListImplementationsResponse: object = { implementationMessageNames: "" }; + +export const ListImplementationsResponse = { + encode(message: ListImplementationsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.implementationMessageNames) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListImplementationsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseListImplementationsResponse } as ListImplementationsResponse; + message.implementationMessageNames = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.implementationMessageNames.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ListImplementationsResponse { + const message = { ...baseListImplementationsResponse } as ListImplementationsResponse; + message.implementationMessageNames = []; + if (object.implementationMessageNames !== undefined && object.implementationMessageNames !== null) { + for (const e of object.implementationMessageNames) { + message.implementationMessageNames.push(String(e)); + } + } + return message; + }, + + toJSON(message: ListImplementationsResponse): unknown { + const obj: any = {}; + if (message.implementationMessageNames) { + obj.implementationMessageNames = message.implementationMessageNames.map((e) => e); + } else { + obj.implementationMessageNames = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ListImplementationsResponse { + const message = { ...baseListImplementationsResponse } as ListImplementationsResponse; + message.implementationMessageNames = []; + if (object.implementationMessageNames !== undefined && object.implementationMessageNames !== null) { + for (const e of object.implementationMessageNames) { + message.implementationMessageNames.push(e); + } + } + return message; + }, +}; + +/** ReflectionService defines a service for interface reflection. */ +export interface ReflectionService { + /** + * ListAllInterfaces lists all the interfaces registered in the interface + * registry. + */ + ListAllInterfaces(request: ListAllInterfacesRequest): Promise; + /** + * ListImplementations list all the concrete types that implement a given + * interface. + */ + ListImplementations(request: ListImplementationsRequest): Promise; +} + +export class ReflectionServiceClientImpl implements ReflectionService { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.ListAllInterfaces = this.ListAllInterfaces.bind(this); + this.ListImplementations = this.ListImplementations.bind(this); + } + ListAllInterfaces(request: ListAllInterfacesRequest): Promise { + const data = ListAllInterfacesRequest.encode(request).finish(); + const promise = this.rpc.request( + "cosmos.base.reflection.v1beta1.ReflectionService", + "ListAllInterfaces", + data, + ); + return promise.then((data) => ListAllInterfacesResponse.decode(new _m0.Reader(data))); + } + + ListImplementations(request: ListImplementationsRequest): Promise { + const data = ListImplementationsRequest.encode(request).finish(); + const promise = this.rpc.request( + "cosmos.base.reflection.v1beta1.ReflectionService", + "ListImplementations", + data, + ); + return promise.then((data) => ListImplementationsResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/base/snapshots/v1beta1/snapshot.ts b/src/cosmos/base/snapshots/v1beta1/snapshot.ts new file mode 100644 index 00000000..bd418b2b --- /dev/null +++ b/src/cosmos/base/snapshots/v1beta1/snapshot.ts @@ -0,0 +1,256 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.base.snapshots.v1beta1"; + +/** Snapshot contains Tendermint state sync snapshot info. */ +export interface Snapshot { + height: Long; + format: number; + chunks: number; + hash: Uint8Array; + metadata?: Metadata; +} + +/** Metadata contains SDK-specific snapshot metadata. */ +export interface Metadata { + /** SHA-256 chunk hashes */ + chunkHashes: Uint8Array[]; +} + +const baseSnapshot: object = { height: Long.UZERO, format: 0, chunks: 0 }; + +export const Snapshot = { + encode(message: Snapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.height.isZero()) { + writer.uint32(8).uint64(message.height); + } + if (message.format !== 0) { + writer.uint32(16).uint32(message.format); + } + if (message.chunks !== 0) { + writer.uint32(24).uint32(message.chunks); + } + if (message.hash.length !== 0) { + writer.uint32(34).bytes(message.hash); + } + if (message.metadata !== undefined) { + Metadata.encode(message.metadata, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Snapshot { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSnapshot } as Snapshot; + message.hash = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.uint64() as Long; + break; + case 2: + message.format = reader.uint32(); + break; + case 3: + message.chunks = reader.uint32(); + break; + case 4: + message.hash = reader.bytes(); + break; + case 5: + message.metadata = Metadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Snapshot { + const message = { ...baseSnapshot } as Snapshot; + message.hash = new Uint8Array(); + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.UZERO; + } + if (object.format !== undefined && object.format !== null) { + message.format = Number(object.format); + } else { + message.format = 0; + } + if (object.chunks !== undefined && object.chunks !== null) { + message.chunks = Number(object.chunks); + } else { + message.chunks = 0; + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = Metadata.fromJSON(object.metadata); + } else { + message.metadata = undefined; + } + return message; + }, + + toJSON(message: Snapshot): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = (message.height || Long.UZERO).toString()); + message.format !== undefined && (obj.format = message.format); + message.chunks !== undefined && (obj.chunks = message.chunks); + message.hash !== undefined && + (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + message.metadata !== undefined && + (obj.metadata = message.metadata ? Metadata.toJSON(message.metadata) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): Snapshot { + const message = { ...baseSnapshot } as Snapshot; + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.UZERO; + } + if (object.format !== undefined && object.format !== null) { + message.format = object.format; + } else { + message.format = 0; + } + if (object.chunks !== undefined && object.chunks !== null) { + message.chunks = object.chunks; + } else { + message.chunks = 0; + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } else { + message.hash = new Uint8Array(); + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = Metadata.fromPartial(object.metadata); + } else { + message.metadata = undefined; + } + return message; + }, +}; + +const baseMetadata: object = {}; + +export const Metadata = { + encode(message: Metadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.chunkHashes) { + writer.uint32(10).bytes(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Metadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMetadata } as Metadata; + message.chunkHashes = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chunkHashes.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Metadata { + const message = { ...baseMetadata } as Metadata; + message.chunkHashes = []; + if (object.chunkHashes !== undefined && object.chunkHashes !== null) { + for (const e of object.chunkHashes) { + message.chunkHashes.push(bytesFromBase64(e)); + } + } + return message; + }, + + toJSON(message: Metadata): unknown { + const obj: any = {}; + if (message.chunkHashes) { + obj.chunkHashes = message.chunkHashes.map((e) => + base64FromBytes(e !== undefined ? e : new Uint8Array()), + ); + } else { + obj.chunkHashes = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): Metadata { + const message = { ...baseMetadata } as Metadata; + message.chunkHashes = []; + if (object.chunkHashes !== undefined && object.chunkHashes !== null) { + for (const e of object.chunkHashes) { + message.chunkHashes.push(e); + } + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/base/store/v1beta1/commit_info.ts b/src/cosmos/base/store/v1beta1/commit_info.ts new file mode 100644 index 00000000..4d33ced2 --- /dev/null +++ b/src/cosmos/base/store/v1beta1/commit_info.ts @@ -0,0 +1,304 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.base.store.v1beta1"; + +/** + * CommitInfo defines commit information used by the multi-store when committing + * a version/height. + */ +export interface CommitInfo { + version: Long; + storeInfos: StoreInfo[]; +} + +/** + * StoreInfo defines store-specific commit information. It contains a reference + * between a store name and the commit ID. + */ +export interface StoreInfo { + name: string; + commitId?: CommitID; +} + +/** + * CommitID defines the committment information when a specific store is + * committed. + */ +export interface CommitID { + version: Long; + hash: Uint8Array; +} + +const baseCommitInfo: object = { version: Long.ZERO }; + +export const CommitInfo = { + encode(message: CommitInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.version.isZero()) { + writer.uint32(8).int64(message.version); + } + for (const v of message.storeInfos) { + StoreInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CommitInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCommitInfo } as CommitInfo; + message.storeInfos = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.int64() as Long; + break; + case 2: + message.storeInfos.push(StoreInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CommitInfo { + const message = { ...baseCommitInfo } as CommitInfo; + message.storeInfos = []; + if (object.version !== undefined && object.version !== null) { + message.version = Long.fromString(object.version); + } else { + message.version = Long.ZERO; + } + if (object.storeInfos !== undefined && object.storeInfos !== null) { + for (const e of object.storeInfos) { + message.storeInfos.push(StoreInfo.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: CommitInfo): unknown { + const obj: any = {}; + message.version !== undefined && (obj.version = (message.version || Long.ZERO).toString()); + if (message.storeInfos) { + obj.storeInfos = message.storeInfos.map((e) => (e ? StoreInfo.toJSON(e) : undefined)); + } else { + obj.storeInfos = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): CommitInfo { + const message = { ...baseCommitInfo } as CommitInfo; + message.storeInfos = []; + if (object.version !== undefined && object.version !== null) { + message.version = object.version as Long; + } else { + message.version = Long.ZERO; + } + if (object.storeInfos !== undefined && object.storeInfos !== null) { + for (const e of object.storeInfos) { + message.storeInfos.push(StoreInfo.fromPartial(e)); + } + } + return message; + }, +}; + +const baseStoreInfo: object = { name: "" }; + +export const StoreInfo = { + encode(message: StoreInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.commitId !== undefined) { + CommitID.encode(message.commitId, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StoreInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStoreInfo } as StoreInfo; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.commitId = CommitID.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StoreInfo { + const message = { ...baseStoreInfo } as StoreInfo; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.commitId !== undefined && object.commitId !== null) { + message.commitId = CommitID.fromJSON(object.commitId); + } else { + message.commitId = undefined; + } + return message; + }, + + toJSON(message: StoreInfo): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.commitId !== undefined && + (obj.commitId = message.commitId ? CommitID.toJSON(message.commitId) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): StoreInfo { + const message = { ...baseStoreInfo } as StoreInfo; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.commitId !== undefined && object.commitId !== null) { + message.commitId = CommitID.fromPartial(object.commitId); + } else { + message.commitId = undefined; + } + return message; + }, +}; + +const baseCommitID: object = { version: Long.ZERO }; + +export const CommitID = { + encode(message: CommitID, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.version.isZero()) { + writer.uint32(8).int64(message.version); + } + if (message.hash.length !== 0) { + writer.uint32(18).bytes(message.hash); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CommitID { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCommitID } as CommitID; + message.hash = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.int64() as Long; + break; + case 2: + message.hash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CommitID { + const message = { ...baseCommitID } as CommitID; + message.hash = new Uint8Array(); + if (object.version !== undefined && object.version !== null) { + message.version = Long.fromString(object.version); + } else { + message.version = Long.ZERO; + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + return message; + }, + + toJSON(message: CommitID): unknown { + const obj: any = {}; + message.version !== undefined && (obj.version = (message.version || Long.ZERO).toString()); + message.hash !== undefined && + (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): CommitID { + const message = { ...baseCommitID } as CommitID; + if (object.version !== undefined && object.version !== null) { + message.version = object.version as Long; + } else { + message.version = Long.ZERO; + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } else { + message.hash = new Uint8Array(); + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/base/store/v1beta1/snapshot.ts b/src/cosmos/base/store/v1beta1/snapshot.ts new file mode 100644 index 00000000..48b9c0c3 --- /dev/null +++ b/src/cosmos/base/store/v1beta1/snapshot.ts @@ -0,0 +1,308 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.base.store.v1beta1"; + +/** SnapshotItem is an item contained in a rootmulti.Store snapshot. */ +export interface SnapshotItem { + store?: SnapshotStoreItem | undefined; + iavl?: SnapshotIAVLItem | undefined; +} + +/** SnapshotStoreItem contains metadata about a snapshotted store. */ +export interface SnapshotStoreItem { + name: string; +} + +/** SnapshotIAVLItem is an exported IAVL node. */ +export interface SnapshotIAVLItem { + key: Uint8Array; + value: Uint8Array; + version: Long; + height: number; +} + +const baseSnapshotItem: object = {}; + +export const SnapshotItem = { + encode(message: SnapshotItem, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.store !== undefined) { + SnapshotStoreItem.encode(message.store, writer.uint32(10).fork()).ldelim(); + } + if (message.iavl !== undefined) { + SnapshotIAVLItem.encode(message.iavl, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SnapshotItem { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSnapshotItem } as SnapshotItem; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.store = SnapshotStoreItem.decode(reader, reader.uint32()); + break; + case 2: + message.iavl = SnapshotIAVLItem.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SnapshotItem { + const message = { ...baseSnapshotItem } as SnapshotItem; + if (object.store !== undefined && object.store !== null) { + message.store = SnapshotStoreItem.fromJSON(object.store); + } else { + message.store = undefined; + } + if (object.iavl !== undefined && object.iavl !== null) { + message.iavl = SnapshotIAVLItem.fromJSON(object.iavl); + } else { + message.iavl = undefined; + } + return message; + }, + + toJSON(message: SnapshotItem): unknown { + const obj: any = {}; + message.store !== undefined && + (obj.store = message.store ? SnapshotStoreItem.toJSON(message.store) : undefined); + message.iavl !== undefined && + (obj.iavl = message.iavl ? SnapshotIAVLItem.toJSON(message.iavl) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): SnapshotItem { + const message = { ...baseSnapshotItem } as SnapshotItem; + if (object.store !== undefined && object.store !== null) { + message.store = SnapshotStoreItem.fromPartial(object.store); + } else { + message.store = undefined; + } + if (object.iavl !== undefined && object.iavl !== null) { + message.iavl = SnapshotIAVLItem.fromPartial(object.iavl); + } else { + message.iavl = undefined; + } + return message; + }, +}; + +const baseSnapshotStoreItem: object = { name: "" }; + +export const SnapshotStoreItem = { + encode(message: SnapshotStoreItem, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SnapshotStoreItem { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSnapshotStoreItem } as SnapshotStoreItem; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SnapshotStoreItem { + const message = { ...baseSnapshotStoreItem } as SnapshotStoreItem; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + return message; + }, + + toJSON(message: SnapshotStoreItem): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + return obj; + }, + + fromPartial(object: DeepPartial): SnapshotStoreItem { + const message = { ...baseSnapshotStoreItem } as SnapshotStoreItem; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + return message; + }, +}; + +const baseSnapshotIAVLItem: object = { version: Long.ZERO, height: 0 }; + +export const SnapshotIAVLItem = { + encode(message: SnapshotIAVLItem, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + if (!message.version.isZero()) { + writer.uint32(24).int64(message.version); + } + if (message.height !== 0) { + writer.uint32(32).int32(message.height); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SnapshotIAVLItem { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSnapshotIAVLItem } as SnapshotIAVLItem; + message.key = new Uint8Array(); + message.value = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + case 3: + message.version = reader.int64() as Long; + break; + case 4: + message.height = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SnapshotIAVLItem { + const message = { ...baseSnapshotIAVLItem } as SnapshotIAVLItem; + message.key = new Uint8Array(); + message.value = new Uint8Array(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.version !== undefined && object.version !== null) { + message.version = Long.fromString(object.version); + } else { + message.version = Long.ZERO; + } + if (object.height !== undefined && object.height !== null) { + message.height = Number(object.height); + } else { + message.height = 0; + } + return message; + }, + + toJSON(message: SnapshotIAVLItem): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.value !== undefined && + (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + message.version !== undefined && (obj.version = (message.version || Long.ZERO).toString()); + message.height !== undefined && (obj.height = message.height); + return obj; + }, + + fromPartial(object: DeepPartial): SnapshotIAVLItem { + const message = { ...baseSnapshotIAVLItem } as SnapshotIAVLItem; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } else { + message.value = new Uint8Array(); + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version as Long; + } else { + message.version = Long.ZERO; + } + if (object.height !== undefined && object.height !== null) { + message.height = object.height; + } else { + message.height = 0; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/base/tendermint/v1beta1/query.ts b/src/cosmos/base/tendermint/v1beta1/query.ts new file mode 100644 index 00000000..6a8f0d0e --- /dev/null +++ b/src/cosmos/base/tendermint/v1beta1/query.ts @@ -0,0 +1,1331 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { PageRequest, PageResponse } from "../../../../cosmos/base/query/v1beta1/pagination"; +import { Any } from "../../../../google/protobuf/any"; +import { BlockID } from "../../../../tendermint/types/types"; +import { Block } from "../../../../tendermint/types/block"; +import { DefaultNodeInfo } from "../../../../tendermint/p2p/types"; + +export const protobufPackage = "cosmos.base.tendermint.v1beta1"; + +/** GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. */ +export interface GetValidatorSetByHeightRequest { + height: Long; + /** pagination defines an pagination for the request. */ + pagination?: PageRequest; +} + +/** GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. */ +export interface GetValidatorSetByHeightResponse { + blockHeight: Long; + validators: Validator[]; + /** pagination defines an pagination for the response. */ + pagination?: PageResponse; +} + +/** GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. */ +export interface GetLatestValidatorSetRequest { + /** pagination defines an pagination for the request. */ + pagination?: PageRequest; +} + +/** GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. */ +export interface GetLatestValidatorSetResponse { + blockHeight: Long; + validators: Validator[]; + /** pagination defines an pagination for the response. */ + pagination?: PageResponse; +} + +/** Validator is the type for the validator-set. */ +export interface Validator { + address: string; + pubKey?: Any; + votingPower: Long; + proposerPriority: Long; +} + +/** GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. */ +export interface GetBlockByHeightRequest { + height: Long; +} + +/** GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. */ +export interface GetBlockByHeightResponse { + blockId?: BlockID; + block?: Block; +} + +/** GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. */ +export interface GetLatestBlockRequest {} + +/** GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. */ +export interface GetLatestBlockResponse { + blockId?: BlockID; + block?: Block; +} + +/** GetSyncingRequest is the request type for the Query/GetSyncing RPC method. */ +export interface GetSyncingRequest {} + +/** GetSyncingResponse is the response type for the Query/GetSyncing RPC method. */ +export interface GetSyncingResponse { + syncing: boolean; +} + +/** GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. */ +export interface GetNodeInfoRequest {} + +/** GetNodeInfoResponse is the request type for the Query/GetNodeInfo RPC method. */ +export interface GetNodeInfoResponse { + defaultNodeInfo?: DefaultNodeInfo; + applicationVersion?: VersionInfo; +} + +/** VersionInfo is the type for the GetNodeInfoResponse message. */ +export interface VersionInfo { + name: string; + appName: string; + version: string; + gitCommit: string; + buildTags: string; + goVersion: string; + buildDeps: Module[]; +} + +/** Module is the type for VersionInfo */ +export interface Module { + /** module path */ + path: string; + /** module version */ + version: string; + /** checksum */ + sum: string; +} + +const baseGetValidatorSetByHeightRequest: object = { height: Long.ZERO }; + +export const GetValidatorSetByHeightRequest = { + encode(message: GetValidatorSetByHeightRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.height.isZero()) { + writer.uint32(8).int64(message.height); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetValidatorSetByHeightRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetValidatorSetByHeightRequest } as GetValidatorSetByHeightRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64() as Long; + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetValidatorSetByHeightRequest { + const message = { ...baseGetValidatorSetByHeightRequest } as GetValidatorSetByHeightRequest; + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.ZERO; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: GetValidatorSetByHeightRequest): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): GetValidatorSetByHeightRequest { + const message = { ...baseGetValidatorSetByHeightRequest } as GetValidatorSetByHeightRequest; + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.ZERO; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseGetValidatorSetByHeightResponse: object = { blockHeight: Long.ZERO }; + +export const GetValidatorSetByHeightResponse = { + encode(message: GetValidatorSetByHeightResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.blockHeight.isZero()) { + writer.uint32(8).int64(message.blockHeight); + } + for (const v of message.validators) { + Validator.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetValidatorSetByHeightResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetValidatorSetByHeightResponse } as GetValidatorSetByHeightResponse; + message.validators = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHeight = reader.int64() as Long; + break; + case 2: + message.validators.push(Validator.decode(reader, reader.uint32())); + break; + case 3: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetValidatorSetByHeightResponse { + const message = { ...baseGetValidatorSetByHeightResponse } as GetValidatorSetByHeightResponse; + message.validators = []; + if (object.blockHeight !== undefined && object.blockHeight !== null) { + message.blockHeight = Long.fromString(object.blockHeight); + } else { + message.blockHeight = Long.ZERO; + } + if (object.validators !== undefined && object.validators !== null) { + for (const e of object.validators) { + message.validators.push(Validator.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: GetValidatorSetByHeightResponse): unknown { + const obj: any = {}; + message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || Long.ZERO).toString()); + if (message.validators) { + obj.validators = message.validators.map((e) => (e ? Validator.toJSON(e) : undefined)); + } else { + obj.validators = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): GetValidatorSetByHeightResponse { + const message = { ...baseGetValidatorSetByHeightResponse } as GetValidatorSetByHeightResponse; + message.validators = []; + if (object.blockHeight !== undefined && object.blockHeight !== null) { + message.blockHeight = object.blockHeight as Long; + } else { + message.blockHeight = Long.ZERO; + } + if (object.validators !== undefined && object.validators !== null) { + for (const e of object.validators) { + message.validators.push(Validator.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseGetLatestValidatorSetRequest: object = {}; + +export const GetLatestValidatorSetRequest = { + encode(message: GetLatestValidatorSetRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestValidatorSetRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetLatestValidatorSetRequest } as GetLatestValidatorSetRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetLatestValidatorSetRequest { + const message = { ...baseGetLatestValidatorSetRequest } as GetLatestValidatorSetRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: GetLatestValidatorSetRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): GetLatestValidatorSetRequest { + const message = { ...baseGetLatestValidatorSetRequest } as GetLatestValidatorSetRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseGetLatestValidatorSetResponse: object = { blockHeight: Long.ZERO }; + +export const GetLatestValidatorSetResponse = { + encode(message: GetLatestValidatorSetResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.blockHeight.isZero()) { + writer.uint32(8).int64(message.blockHeight); + } + for (const v of message.validators) { + Validator.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestValidatorSetResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetLatestValidatorSetResponse } as GetLatestValidatorSetResponse; + message.validators = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHeight = reader.int64() as Long; + break; + case 2: + message.validators.push(Validator.decode(reader, reader.uint32())); + break; + case 3: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetLatestValidatorSetResponse { + const message = { ...baseGetLatestValidatorSetResponse } as GetLatestValidatorSetResponse; + message.validators = []; + if (object.blockHeight !== undefined && object.blockHeight !== null) { + message.blockHeight = Long.fromString(object.blockHeight); + } else { + message.blockHeight = Long.ZERO; + } + if (object.validators !== undefined && object.validators !== null) { + for (const e of object.validators) { + message.validators.push(Validator.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: GetLatestValidatorSetResponse): unknown { + const obj: any = {}; + message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || Long.ZERO).toString()); + if (message.validators) { + obj.validators = message.validators.map((e) => (e ? Validator.toJSON(e) : undefined)); + } else { + obj.validators = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): GetLatestValidatorSetResponse { + const message = { ...baseGetLatestValidatorSetResponse } as GetLatestValidatorSetResponse; + message.validators = []; + if (object.blockHeight !== undefined && object.blockHeight !== null) { + message.blockHeight = object.blockHeight as Long; + } else { + message.blockHeight = Long.ZERO; + } + if (object.validators !== undefined && object.validators !== null) { + for (const e of object.validators) { + message.validators.push(Validator.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseValidator: object = { address: "", votingPower: Long.ZERO, proposerPriority: Long.ZERO }; + +export const Validator = { + encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.pubKey !== undefined) { + Any.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); + } + if (!message.votingPower.isZero()) { + writer.uint32(24).int64(message.votingPower); + } + if (!message.proposerPriority.isZero()) { + writer.uint32(32).int64(message.proposerPriority); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Validator { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseValidator } as Validator; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.pubKey = Any.decode(reader, reader.uint32()); + break; + case 3: + message.votingPower = reader.int64() as Long; + break; + case 4: + message.proposerPriority = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Validator { + const message = { ...baseValidator } as Validator; + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.pubKey !== undefined && object.pubKey !== null) { + message.pubKey = Any.fromJSON(object.pubKey); + } else { + message.pubKey = undefined; + } + if (object.votingPower !== undefined && object.votingPower !== null) { + message.votingPower = Long.fromString(object.votingPower); + } else { + message.votingPower = Long.ZERO; + } + if (object.proposerPriority !== undefined && object.proposerPriority !== null) { + message.proposerPriority = Long.fromString(object.proposerPriority); + } else { + message.proposerPriority = Long.ZERO; + } + return message; + }, + + toJSON(message: Validator): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.pubKey !== undefined && (obj.pubKey = message.pubKey ? Any.toJSON(message.pubKey) : undefined); + message.votingPower !== undefined && (obj.votingPower = (message.votingPower || Long.ZERO).toString()); + message.proposerPriority !== undefined && + (obj.proposerPriority = (message.proposerPriority || Long.ZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): Validator { + const message = { ...baseValidator } as Validator; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.pubKey !== undefined && object.pubKey !== null) { + message.pubKey = Any.fromPartial(object.pubKey); + } else { + message.pubKey = undefined; + } + if (object.votingPower !== undefined && object.votingPower !== null) { + message.votingPower = object.votingPower as Long; + } else { + message.votingPower = Long.ZERO; + } + if (object.proposerPriority !== undefined && object.proposerPriority !== null) { + message.proposerPriority = object.proposerPriority as Long; + } else { + message.proposerPriority = Long.ZERO; + } + return message; + }, +}; + +const baseGetBlockByHeightRequest: object = { height: Long.ZERO }; + +export const GetBlockByHeightRequest = { + encode(message: GetBlockByHeightRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.height.isZero()) { + writer.uint32(8).int64(message.height); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetBlockByHeightRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetBlockByHeightRequest } as GetBlockByHeightRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetBlockByHeightRequest { + const message = { ...baseGetBlockByHeightRequest } as GetBlockByHeightRequest; + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.ZERO; + } + return message; + }, + + toJSON(message: GetBlockByHeightRequest): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): GetBlockByHeightRequest { + const message = { ...baseGetBlockByHeightRequest } as GetBlockByHeightRequest; + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.ZERO; + } + return message; + }, +}; + +const baseGetBlockByHeightResponse: object = {}; + +export const GetBlockByHeightResponse = { + encode(message: GetBlockByHeightResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); + } + if (message.block !== undefined) { + Block.encode(message.block, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetBlockByHeightResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetBlockByHeightResponse } as GetBlockByHeightResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockId = BlockID.decode(reader, reader.uint32()); + break; + case 2: + message.block = Block.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetBlockByHeightResponse { + const message = { ...baseGetBlockByHeightResponse } as GetBlockByHeightResponse; + if (object.blockId !== undefined && object.blockId !== null) { + message.blockId = BlockID.fromJSON(object.blockId); + } else { + message.blockId = undefined; + } + if (object.block !== undefined && object.block !== null) { + message.block = Block.fromJSON(object.block); + } else { + message.block = undefined; + } + return message; + }, + + toJSON(message: GetBlockByHeightResponse): unknown { + const obj: any = {}; + message.blockId !== undefined && + (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); + message.block !== undefined && (obj.block = message.block ? Block.toJSON(message.block) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): GetBlockByHeightResponse { + const message = { ...baseGetBlockByHeightResponse } as GetBlockByHeightResponse; + if (object.blockId !== undefined && object.blockId !== null) { + message.blockId = BlockID.fromPartial(object.blockId); + } else { + message.blockId = undefined; + } + if (object.block !== undefined && object.block !== null) { + message.block = Block.fromPartial(object.block); + } else { + message.block = undefined; + } + return message; + }, +}; + +const baseGetLatestBlockRequest: object = {}; + +export const GetLatestBlockRequest = { + encode(_: GetLatestBlockRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestBlockRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetLatestBlockRequest } as GetLatestBlockRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): GetLatestBlockRequest { + const message = { ...baseGetLatestBlockRequest } as GetLatestBlockRequest; + return message; + }, + + toJSON(_: GetLatestBlockRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): GetLatestBlockRequest { + const message = { ...baseGetLatestBlockRequest } as GetLatestBlockRequest; + return message; + }, +}; + +const baseGetLatestBlockResponse: object = {}; + +export const GetLatestBlockResponse = { + encode(message: GetLatestBlockResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); + } + if (message.block !== undefined) { + Block.encode(message.block, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestBlockResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetLatestBlockResponse } as GetLatestBlockResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockId = BlockID.decode(reader, reader.uint32()); + break; + case 2: + message.block = Block.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetLatestBlockResponse { + const message = { ...baseGetLatestBlockResponse } as GetLatestBlockResponse; + if (object.blockId !== undefined && object.blockId !== null) { + message.blockId = BlockID.fromJSON(object.blockId); + } else { + message.blockId = undefined; + } + if (object.block !== undefined && object.block !== null) { + message.block = Block.fromJSON(object.block); + } else { + message.block = undefined; + } + return message; + }, + + toJSON(message: GetLatestBlockResponse): unknown { + const obj: any = {}; + message.blockId !== undefined && + (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); + message.block !== undefined && (obj.block = message.block ? Block.toJSON(message.block) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): GetLatestBlockResponse { + const message = { ...baseGetLatestBlockResponse } as GetLatestBlockResponse; + if (object.blockId !== undefined && object.blockId !== null) { + message.blockId = BlockID.fromPartial(object.blockId); + } else { + message.blockId = undefined; + } + if (object.block !== undefined && object.block !== null) { + message.block = Block.fromPartial(object.block); + } else { + message.block = undefined; + } + return message; + }, +}; + +const baseGetSyncingRequest: object = {}; + +export const GetSyncingRequest = { + encode(_: GetSyncingRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetSyncingRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetSyncingRequest } as GetSyncingRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): GetSyncingRequest { + const message = { ...baseGetSyncingRequest } as GetSyncingRequest; + return message; + }, + + toJSON(_: GetSyncingRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): GetSyncingRequest { + const message = { ...baseGetSyncingRequest } as GetSyncingRequest; + return message; + }, +}; + +const baseGetSyncingResponse: object = { syncing: false }; + +export const GetSyncingResponse = { + encode(message: GetSyncingResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.syncing === true) { + writer.uint32(8).bool(message.syncing); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetSyncingResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetSyncingResponse } as GetSyncingResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.syncing = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetSyncingResponse { + const message = { ...baseGetSyncingResponse } as GetSyncingResponse; + if (object.syncing !== undefined && object.syncing !== null) { + message.syncing = Boolean(object.syncing); + } else { + message.syncing = false; + } + return message; + }, + + toJSON(message: GetSyncingResponse): unknown { + const obj: any = {}; + message.syncing !== undefined && (obj.syncing = message.syncing); + return obj; + }, + + fromPartial(object: DeepPartial): GetSyncingResponse { + const message = { ...baseGetSyncingResponse } as GetSyncingResponse; + if (object.syncing !== undefined && object.syncing !== null) { + message.syncing = object.syncing; + } else { + message.syncing = false; + } + return message; + }, +}; + +const baseGetNodeInfoRequest: object = {}; + +export const GetNodeInfoRequest = { + encode(_: GetNodeInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetNodeInfoRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetNodeInfoRequest } as GetNodeInfoRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): GetNodeInfoRequest { + const message = { ...baseGetNodeInfoRequest } as GetNodeInfoRequest; + return message; + }, + + toJSON(_: GetNodeInfoRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): GetNodeInfoRequest { + const message = { ...baseGetNodeInfoRequest } as GetNodeInfoRequest; + return message; + }, +}; + +const baseGetNodeInfoResponse: object = {}; + +export const GetNodeInfoResponse = { + encode(message: GetNodeInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.defaultNodeInfo !== undefined) { + DefaultNodeInfo.encode(message.defaultNodeInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.applicationVersion !== undefined) { + VersionInfo.encode(message.applicationVersion, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetNodeInfoResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetNodeInfoResponse } as GetNodeInfoResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.defaultNodeInfo = DefaultNodeInfo.decode(reader, reader.uint32()); + break; + case 2: + message.applicationVersion = VersionInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetNodeInfoResponse { + const message = { ...baseGetNodeInfoResponse } as GetNodeInfoResponse; + if (object.defaultNodeInfo !== undefined && object.defaultNodeInfo !== null) { + message.defaultNodeInfo = DefaultNodeInfo.fromJSON(object.defaultNodeInfo); + } else { + message.defaultNodeInfo = undefined; + } + if (object.applicationVersion !== undefined && object.applicationVersion !== null) { + message.applicationVersion = VersionInfo.fromJSON(object.applicationVersion); + } else { + message.applicationVersion = undefined; + } + return message; + }, + + toJSON(message: GetNodeInfoResponse): unknown { + const obj: any = {}; + message.defaultNodeInfo !== undefined && + (obj.defaultNodeInfo = message.defaultNodeInfo + ? DefaultNodeInfo.toJSON(message.defaultNodeInfo) + : undefined); + message.applicationVersion !== undefined && + (obj.applicationVersion = message.applicationVersion + ? VersionInfo.toJSON(message.applicationVersion) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): GetNodeInfoResponse { + const message = { ...baseGetNodeInfoResponse } as GetNodeInfoResponse; + if (object.defaultNodeInfo !== undefined && object.defaultNodeInfo !== null) { + message.defaultNodeInfo = DefaultNodeInfo.fromPartial(object.defaultNodeInfo); + } else { + message.defaultNodeInfo = undefined; + } + if (object.applicationVersion !== undefined && object.applicationVersion !== null) { + message.applicationVersion = VersionInfo.fromPartial(object.applicationVersion); + } else { + message.applicationVersion = undefined; + } + return message; + }, +}; + +const baseVersionInfo: object = { + name: "", + appName: "", + version: "", + gitCommit: "", + buildTags: "", + goVersion: "", +}; + +export const VersionInfo = { + encode(message: VersionInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.appName !== "") { + writer.uint32(18).string(message.appName); + } + if (message.version !== "") { + writer.uint32(26).string(message.version); + } + if (message.gitCommit !== "") { + writer.uint32(34).string(message.gitCommit); + } + if (message.buildTags !== "") { + writer.uint32(42).string(message.buildTags); + } + if (message.goVersion !== "") { + writer.uint32(50).string(message.goVersion); + } + for (const v of message.buildDeps) { + Module.encode(v!, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): VersionInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseVersionInfo } as VersionInfo; + message.buildDeps = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.appName = reader.string(); + break; + case 3: + message.version = reader.string(); + break; + case 4: + message.gitCommit = reader.string(); + break; + case 5: + message.buildTags = reader.string(); + break; + case 6: + message.goVersion = reader.string(); + break; + case 7: + message.buildDeps.push(Module.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): VersionInfo { + const message = { ...baseVersionInfo } as VersionInfo; + message.buildDeps = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.appName !== undefined && object.appName !== null) { + message.appName = String(object.appName); + } else { + message.appName = ""; + } + if (object.version !== undefined && object.version !== null) { + message.version = String(object.version); + } else { + message.version = ""; + } + if (object.gitCommit !== undefined && object.gitCommit !== null) { + message.gitCommit = String(object.gitCommit); + } else { + message.gitCommit = ""; + } + if (object.buildTags !== undefined && object.buildTags !== null) { + message.buildTags = String(object.buildTags); + } else { + message.buildTags = ""; + } + if (object.goVersion !== undefined && object.goVersion !== null) { + message.goVersion = String(object.goVersion); + } else { + message.goVersion = ""; + } + if (object.buildDeps !== undefined && object.buildDeps !== null) { + for (const e of object.buildDeps) { + message.buildDeps.push(Module.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: VersionInfo): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.appName !== undefined && (obj.appName = message.appName); + message.version !== undefined && (obj.version = message.version); + message.gitCommit !== undefined && (obj.gitCommit = message.gitCommit); + message.buildTags !== undefined && (obj.buildTags = message.buildTags); + message.goVersion !== undefined && (obj.goVersion = message.goVersion); + if (message.buildDeps) { + obj.buildDeps = message.buildDeps.map((e) => (e ? Module.toJSON(e) : undefined)); + } else { + obj.buildDeps = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): VersionInfo { + const message = { ...baseVersionInfo } as VersionInfo; + message.buildDeps = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.appName !== undefined && object.appName !== null) { + message.appName = object.appName; + } else { + message.appName = ""; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } else { + message.version = ""; + } + if (object.gitCommit !== undefined && object.gitCommit !== null) { + message.gitCommit = object.gitCommit; + } else { + message.gitCommit = ""; + } + if (object.buildTags !== undefined && object.buildTags !== null) { + message.buildTags = object.buildTags; + } else { + message.buildTags = ""; + } + if (object.goVersion !== undefined && object.goVersion !== null) { + message.goVersion = object.goVersion; + } else { + message.goVersion = ""; + } + if (object.buildDeps !== undefined && object.buildDeps !== null) { + for (const e of object.buildDeps) { + message.buildDeps.push(Module.fromPartial(e)); + } + } + return message; + }, +}; + +const baseModule: object = { path: "", version: "", sum: "" }; + +export const Module = { + encode(message: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.path !== "") { + writer.uint32(10).string(message.path); + } + if (message.version !== "") { + writer.uint32(18).string(message.version); + } + if (message.sum !== "") { + writer.uint32(26).string(message.sum); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Module { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseModule } as Module; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.string(); + break; + case 2: + message.version = reader.string(); + break; + case 3: + message.sum = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Module { + const message = { ...baseModule } as Module; + if (object.path !== undefined && object.path !== null) { + message.path = String(object.path); + } else { + message.path = ""; + } + if (object.version !== undefined && object.version !== null) { + message.version = String(object.version); + } else { + message.version = ""; + } + if (object.sum !== undefined && object.sum !== null) { + message.sum = String(object.sum); + } else { + message.sum = ""; + } + return message; + }, + + toJSON(message: Module): unknown { + const obj: any = {}; + message.path !== undefined && (obj.path = message.path); + message.version !== undefined && (obj.version = message.version); + message.sum !== undefined && (obj.sum = message.sum); + return obj; + }, + + fromPartial(object: DeepPartial): Module { + const message = { ...baseModule } as Module; + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } else { + message.path = ""; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } else { + message.version = ""; + } + if (object.sum !== undefined && object.sum !== null) { + message.sum = object.sum; + } else { + message.sum = ""; + } + return message; + }, +}; + +/** Service defines the gRPC querier service for tendermint queries. */ +export interface Service { + /** GetNodeInfo queries the current node info. */ + GetNodeInfo(request: GetNodeInfoRequest): Promise; + /** GetSyncing queries node syncing. */ + GetSyncing(request: GetSyncingRequest): Promise; + /** GetLatestBlock returns the latest block. */ + GetLatestBlock(request: GetLatestBlockRequest): Promise; + /** GetBlockByHeight queries block for given height. */ + GetBlockByHeight(request: GetBlockByHeightRequest): Promise; + /** GetLatestValidatorSet queries latest validator-set. */ + GetLatestValidatorSet(request: GetLatestValidatorSetRequest): Promise; + /** GetValidatorSetByHeight queries validator-set at a given height. */ + GetValidatorSetByHeight(request: GetValidatorSetByHeightRequest): Promise; +} + +export class ServiceClientImpl implements Service { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.GetNodeInfo = this.GetNodeInfo.bind(this); + this.GetSyncing = this.GetSyncing.bind(this); + this.GetLatestBlock = this.GetLatestBlock.bind(this); + this.GetBlockByHeight = this.GetBlockByHeight.bind(this); + this.GetLatestValidatorSet = this.GetLatestValidatorSet.bind(this); + this.GetValidatorSetByHeight = this.GetValidatorSetByHeight.bind(this); + } + GetNodeInfo(request: GetNodeInfoRequest): Promise { + const data = GetNodeInfoRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetNodeInfo", data); + return promise.then((data) => GetNodeInfoResponse.decode(new _m0.Reader(data))); + } + + GetSyncing(request: GetSyncingRequest): Promise { + const data = GetSyncingRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetSyncing", data); + return promise.then((data) => GetSyncingResponse.decode(new _m0.Reader(data))); + } + + GetLatestBlock(request: GetLatestBlockRequest): Promise { + const data = GetLatestBlockRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetLatestBlock", data); + return promise.then((data) => GetLatestBlockResponse.decode(new _m0.Reader(data))); + } + + GetBlockByHeight(request: GetBlockByHeightRequest): Promise { + const data = GetBlockByHeightRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetBlockByHeight", data); + return promise.then((data) => GetBlockByHeightResponse.decode(new _m0.Reader(data))); + } + + GetLatestValidatorSet(request: GetLatestValidatorSetRequest): Promise { + const data = GetLatestValidatorSetRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetLatestValidatorSet", data); + return promise.then((data) => GetLatestValidatorSetResponse.decode(new _m0.Reader(data))); + } + + GetValidatorSetByHeight(request: GetValidatorSetByHeightRequest): Promise { + const data = GetValidatorSetByHeightRequest.encode(request).finish(); + const promise = this.rpc.request( + "cosmos.base.tendermint.v1beta1.Service", + "GetValidatorSetByHeight", + data, + ); + return promise.then((data) => GetValidatorSetByHeightResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/base/v1beta1/coin.ts b/src/cosmos/base/v1beta1/coin.ts new file mode 100644 index 00000000..32d1e93f --- /dev/null +++ b/src/cosmos/base/v1beta1/coin.ts @@ -0,0 +1,307 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.base.v1beta1"; + +/** + * Coin defines a token with a denomination and an amount. + * + * NOTE: The amount field is an Int which implements the custom method + * signatures required by gogoproto. + */ +export interface Coin { + denom: string; + amount: string; +} + +/** + * DecCoin defines a token with a denomination and a decimal amount. + * + * NOTE: The amount field is an Dec which implements the custom method + * signatures required by gogoproto. + */ +export interface DecCoin { + denom: string; + amount: string; +} + +/** IntProto defines a Protobuf wrapper around an Int object. */ +export interface IntProto { + int: string; +} + +/** DecProto defines a Protobuf wrapper around a Dec object. */ +export interface DecProto { + dec: string; +} + +const baseCoin: object = { denom: "", amount: "" }; + +export const Coin = { + encode(message: Coin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Coin { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCoin } as Coin; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Coin { + const message = { ...baseCoin } as Coin; + if (object.denom !== undefined && object.denom !== null) { + message.denom = String(object.denom); + } else { + message.denom = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = String(object.amount); + } else { + message.amount = ""; + } + return message; + }, + + toJSON(message: Coin): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.amount !== undefined && (obj.amount = message.amount); + return obj; + }, + + fromPartial(object: DeepPartial): Coin { + const message = { ...baseCoin } as Coin; + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } else { + message.denom = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } else { + message.amount = ""; + } + return message; + }, +}; + +const baseDecCoin: object = { denom: "", amount: "" }; + +export const DecCoin = { + encode(message: DecCoin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.amount !== "") { + writer.uint32(18).string(message.amount); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DecCoin { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDecCoin } as DecCoin; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DecCoin { + const message = { ...baseDecCoin } as DecCoin; + if (object.denom !== undefined && object.denom !== null) { + message.denom = String(object.denom); + } else { + message.denom = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = String(object.amount); + } else { + message.amount = ""; + } + return message; + }, + + toJSON(message: DecCoin): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.amount !== undefined && (obj.amount = message.amount); + return obj; + }, + + fromPartial(object: DeepPartial): DecCoin { + const message = { ...baseDecCoin } as DecCoin; + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } else { + message.denom = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } else { + message.amount = ""; + } + return message; + }, +}; + +const baseIntProto: object = { int: "" }; + +export const IntProto = { + encode(message: IntProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.int !== "") { + writer.uint32(10).string(message.int); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): IntProto { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseIntProto } as IntProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.int = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): IntProto { + const message = { ...baseIntProto } as IntProto; + if (object.int !== undefined && object.int !== null) { + message.int = String(object.int); + } else { + message.int = ""; + } + return message; + }, + + toJSON(message: IntProto): unknown { + const obj: any = {}; + message.int !== undefined && (obj.int = message.int); + return obj; + }, + + fromPartial(object: DeepPartial): IntProto { + const message = { ...baseIntProto } as IntProto; + if (object.int !== undefined && object.int !== null) { + message.int = object.int; + } else { + message.int = ""; + } + return message; + }, +}; + +const baseDecProto: object = { dec: "" }; + +export const DecProto = { + encode(message: DecProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.dec !== "") { + writer.uint32(10).string(message.dec); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DecProto { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDecProto } as DecProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dec = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DecProto { + const message = { ...baseDecProto } as DecProto; + if (object.dec !== undefined && object.dec !== null) { + message.dec = String(object.dec); + } else { + message.dec = ""; + } + return message; + }, + + toJSON(message: DecProto): unknown { + const obj: any = {}; + message.dec !== undefined && (obj.dec = message.dec); + return obj; + }, + + fromPartial(object: DeepPartial): DecProto { + const message = { ...baseDecProto } as DecProto; + if (object.dec !== undefined && object.dec !== null) { + message.dec = object.dec; + } else { + message.dec = ""; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/capability/v1beta1/capability.ts b/src/cosmos/capability/v1beta1/capability.ts new file mode 100644 index 00000000..006778d5 --- /dev/null +++ b/src/cosmos/capability/v1beta1/capability.ts @@ -0,0 +1,235 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.capability.v1beta1"; + +/** + * Capability defines an implementation of an object capability. The index + * provided to a Capability must be globally unique. + */ +export interface Capability { + index: Long; +} + +/** + * Owner defines a single capability owner. An owner is defined by the name of + * capability and the module name. + */ +export interface Owner { + module: string; + name: string; +} + +/** + * CapabilityOwners defines a set of owners of a single Capability. The set of + * owners must be unique. + */ +export interface CapabilityOwners { + owners: Owner[]; +} + +const baseCapability: object = { index: Long.UZERO }; + +export const Capability = { + encode(message: Capability, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.index.isZero()) { + writer.uint32(8).uint64(message.index); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Capability { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCapability } as Capability; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Capability { + const message = { ...baseCapability } as Capability; + if (object.index !== undefined && object.index !== null) { + message.index = Long.fromString(object.index); + } else { + message.index = Long.UZERO; + } + return message; + }, + + toJSON(message: Capability): unknown { + const obj: any = {}; + message.index !== undefined && (obj.index = (message.index || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): Capability { + const message = { ...baseCapability } as Capability; + if (object.index !== undefined && object.index !== null) { + message.index = object.index as Long; + } else { + message.index = Long.UZERO; + } + return message; + }, +}; + +const baseOwner: object = { module: "", name: "" }; + +export const Owner = { + encode(message: Owner, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.module !== "") { + writer.uint32(10).string(message.module); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Owner { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseOwner } as Owner; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.module = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Owner { + const message = { ...baseOwner } as Owner; + if (object.module !== undefined && object.module !== null) { + message.module = String(object.module); + } else { + message.module = ""; + } + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + return message; + }, + + toJSON(message: Owner): unknown { + const obj: any = {}; + message.module !== undefined && (obj.module = message.module); + message.name !== undefined && (obj.name = message.name); + return obj; + }, + + fromPartial(object: DeepPartial): Owner { + const message = { ...baseOwner } as Owner; + if (object.module !== undefined && object.module !== null) { + message.module = object.module; + } else { + message.module = ""; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + return message; + }, +}; + +const baseCapabilityOwners: object = {}; + +export const CapabilityOwners = { + encode(message: CapabilityOwners, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.owners) { + Owner.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CapabilityOwners { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCapabilityOwners } as CapabilityOwners; + message.owners = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owners.push(Owner.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CapabilityOwners { + const message = { ...baseCapabilityOwners } as CapabilityOwners; + message.owners = []; + if (object.owners !== undefined && object.owners !== null) { + for (const e of object.owners) { + message.owners.push(Owner.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: CapabilityOwners): unknown { + const obj: any = {}; + if (message.owners) { + obj.owners = message.owners.map((e) => (e ? Owner.toJSON(e) : undefined)); + } else { + obj.owners = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): CapabilityOwners { + const message = { ...baseCapabilityOwners } as CapabilityOwners; + message.owners = []; + if (object.owners !== undefined && object.owners !== null) { + for (const e of object.owners) { + message.owners.push(Owner.fromPartial(e)); + } + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/capability/v1beta1/genesis.ts b/src/cosmos/capability/v1beta1/genesis.ts new file mode 100644 index 00000000..9ad3d0d5 --- /dev/null +++ b/src/cosmos/capability/v1beta1/genesis.ts @@ -0,0 +1,193 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { CapabilityOwners } from "../../../cosmos/capability/v1beta1/capability"; + +export const protobufPackage = "cosmos.capability.v1beta1"; + +/** GenesisOwners defines the capability owners with their corresponding index. */ +export interface GenesisOwners { + /** index is the index of the capability owner. */ + index: Long; + /** index_owners are the owners at the given index. */ + indexOwners?: CapabilityOwners; +} + +/** GenesisState defines the capability module's genesis state. */ +export interface GenesisState { + /** index is the capability global index. */ + index: Long; + /** + * owners represents a map from index to owners of the capability index + * index key is string to allow amino marshalling. + */ + owners: GenesisOwners[]; +} + +const baseGenesisOwners: object = { index: Long.UZERO }; + +export const GenesisOwners = { + encode(message: GenesisOwners, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.index.isZero()) { + writer.uint32(8).uint64(message.index); + } + if (message.indexOwners !== undefined) { + CapabilityOwners.encode(message.indexOwners, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisOwners { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGenesisOwners } as GenesisOwners; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint64() as Long; + break; + case 2: + message.indexOwners = CapabilityOwners.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisOwners { + const message = { ...baseGenesisOwners } as GenesisOwners; + if (object.index !== undefined && object.index !== null) { + message.index = Long.fromString(object.index); + } else { + message.index = Long.UZERO; + } + if (object.indexOwners !== undefined && object.indexOwners !== null) { + message.indexOwners = CapabilityOwners.fromJSON(object.indexOwners); + } else { + message.indexOwners = undefined; + } + return message; + }, + + toJSON(message: GenesisOwners): unknown { + const obj: any = {}; + message.index !== undefined && (obj.index = (message.index || Long.UZERO).toString()); + message.indexOwners !== undefined && + (obj.indexOwners = message.indexOwners ? CapabilityOwners.toJSON(message.indexOwners) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): GenesisOwners { + const message = { ...baseGenesisOwners } as GenesisOwners; + if (object.index !== undefined && object.index !== null) { + message.index = object.index as Long; + } else { + message.index = Long.UZERO; + } + if (object.indexOwners !== undefined && object.indexOwners !== null) { + message.indexOwners = CapabilityOwners.fromPartial(object.indexOwners); + } else { + message.indexOwners = undefined; + } + return message; + }, +}; + +const baseGenesisState: object = { index: Long.UZERO }; + +export const GenesisState = { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.index.isZero()) { + writer.uint32(8).uint64(message.index); + } + for (const v of message.owners) { + GenesisOwners.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGenesisState } as GenesisState; + message.owners = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint64() as Long; + break; + case 2: + message.owners.push(GenesisOwners.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.owners = []; + if (object.index !== undefined && object.index !== null) { + message.index = Long.fromString(object.index); + } else { + message.index = Long.UZERO; + } + if (object.owners !== undefined && object.owners !== null) { + for (const e of object.owners) { + message.owners.push(GenesisOwners.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.index !== undefined && (obj.index = (message.index || Long.UZERO).toString()); + if (message.owners) { + obj.owners = message.owners.map((e) => (e ? GenesisOwners.toJSON(e) : undefined)); + } else { + obj.owners = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.owners = []; + if (object.index !== undefined && object.index !== null) { + message.index = object.index as Long; + } else { + message.index = Long.UZERO; + } + if (object.owners !== undefined && object.owners !== null) { + for (const e of object.owners) { + message.owners.push(GenesisOwners.fromPartial(e)); + } + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/crisis/v1beta1/genesis.ts b/src/cosmos/crisis/v1beta1/genesis.ts new file mode 100644 index 00000000..43007dc6 --- /dev/null +++ b/src/cosmos/crisis/v1beta1/genesis.ts @@ -0,0 +1,87 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Coin } from "../../../cosmos/base/v1beta1/coin"; + +export const protobufPackage = "cosmos.crisis.v1beta1"; + +/** GenesisState defines the crisis module's genesis state. */ +export interface GenesisState { + /** + * constant_fee is the fee used to verify the invariant in the crisis + * module. + */ + constantFee?: Coin; +} + +const baseGenesisState: object = {}; + +export const GenesisState = { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.constantFee !== undefined) { + Coin.encode(message.constantFee, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGenesisState } as GenesisState; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.constantFee = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + if (object.constantFee !== undefined && object.constantFee !== null) { + message.constantFee = Coin.fromJSON(object.constantFee); + } else { + message.constantFee = undefined; + } + return message; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.constantFee !== undefined && + (obj.constantFee = message.constantFee ? Coin.toJSON(message.constantFee) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + if (object.constantFee !== undefined && object.constantFee !== null) { + message.constantFee = Coin.fromPartial(object.constantFee); + } else { + message.constantFee = undefined; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/crisis/v1beta1/tx.ts b/src/cosmos/crisis/v1beta1/tx.ts new file mode 100644 index 00000000..160340f7 --- /dev/null +++ b/src/cosmos/crisis/v1beta1/tx.ts @@ -0,0 +1,181 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.crisis.v1beta1"; + +/** MsgVerifyInvariant represents a message to verify a particular invariance. */ +export interface MsgVerifyInvariant { + sender: string; + invariantModuleName: string; + invariantRoute: string; +} + +/** MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. */ +export interface MsgVerifyInvariantResponse {} + +const baseMsgVerifyInvariant: object = { sender: "", invariantModuleName: "", invariantRoute: "" }; + +export const MsgVerifyInvariant = { + encode(message: MsgVerifyInvariant, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.invariantModuleName !== "") { + writer.uint32(18).string(message.invariantModuleName); + } + if (message.invariantRoute !== "") { + writer.uint32(26).string(message.invariantRoute); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgVerifyInvariant { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgVerifyInvariant } as MsgVerifyInvariant; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.invariantModuleName = reader.string(); + break; + case 3: + message.invariantRoute = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgVerifyInvariant { + const message = { ...baseMsgVerifyInvariant } as MsgVerifyInvariant; + if (object.sender !== undefined && object.sender !== null) { + message.sender = String(object.sender); + } else { + message.sender = ""; + } + if (object.invariantModuleName !== undefined && object.invariantModuleName !== null) { + message.invariantModuleName = String(object.invariantModuleName); + } else { + message.invariantModuleName = ""; + } + if (object.invariantRoute !== undefined && object.invariantRoute !== null) { + message.invariantRoute = String(object.invariantRoute); + } else { + message.invariantRoute = ""; + } + return message; + }, + + toJSON(message: MsgVerifyInvariant): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.invariantModuleName !== undefined && (obj.invariantModuleName = message.invariantModuleName); + message.invariantRoute !== undefined && (obj.invariantRoute = message.invariantRoute); + return obj; + }, + + fromPartial(object: DeepPartial): MsgVerifyInvariant { + const message = { ...baseMsgVerifyInvariant } as MsgVerifyInvariant; + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } else { + message.sender = ""; + } + if (object.invariantModuleName !== undefined && object.invariantModuleName !== null) { + message.invariantModuleName = object.invariantModuleName; + } else { + message.invariantModuleName = ""; + } + if (object.invariantRoute !== undefined && object.invariantRoute !== null) { + message.invariantRoute = object.invariantRoute; + } else { + message.invariantRoute = ""; + } + return message; + }, +}; + +const baseMsgVerifyInvariantResponse: object = {}; + +export const MsgVerifyInvariantResponse = { + encode(_: MsgVerifyInvariantResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgVerifyInvariantResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgVerifyInvariantResponse } as MsgVerifyInvariantResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgVerifyInvariantResponse { + const message = { ...baseMsgVerifyInvariantResponse } as MsgVerifyInvariantResponse; + return message; + }, + + toJSON(_: MsgVerifyInvariantResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgVerifyInvariantResponse { + const message = { ...baseMsgVerifyInvariantResponse } as MsgVerifyInvariantResponse; + return message; + }, +}; + +/** Msg defines the bank Msg service. */ +export interface Msg { + /** VerifyInvariant defines a method to verify a particular invariance. */ + VerifyInvariant(request: MsgVerifyInvariant): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.VerifyInvariant = this.VerifyInvariant.bind(this); + } + VerifyInvariant(request: MsgVerifyInvariant): Promise { + const data = MsgVerifyInvariant.encode(request).finish(); + const promise = this.rpc.request("cosmos.crisis.v1beta1.Msg", "VerifyInvariant", data); + return promise.then((data) => MsgVerifyInvariantResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/crypto/ed25519/keys.ts b/src/cosmos/crypto/ed25519/keys.ts new file mode 100644 index 00000000..c5d1360a --- /dev/null +++ b/src/cosmos/crypto/ed25519/keys.ts @@ -0,0 +1,183 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.crypto.ed25519"; + +/** + * PubKey is an ed25519 public key for handling Tendermint keys in SDK. + * It's needed for Any serialization and SDK compatibility. + * It must not be used in a non Tendermint key context because it doesn't implement + * ADR-28. Nevertheless, you will like to use ed25519 in app user level + * then you must create a new proto message and follow ADR-28 for Address construction. + */ +export interface PubKey { + key: Uint8Array; +} + +/** + * Deprecated: PrivKey defines a ed25519 private key. + * NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. + */ +export interface PrivKey { + key: Uint8Array; +} + +const basePubKey: object = {}; + +export const PubKey = { + encode(message: PubKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PubKey { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePubKey } as PubKey; + message.key = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PubKey { + const message = { ...basePubKey } as PubKey; + message.key = new Uint8Array(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + + toJSON(message: PubKey): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): PubKey { + const message = { ...basePubKey } as PubKey; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + return message; + }, +}; + +const basePrivKey: object = {}; + +export const PrivKey = { + encode(message: PrivKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PrivKey { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePrivKey } as PrivKey; + message.key = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PrivKey { + const message = { ...basePrivKey } as PrivKey; + message.key = new Uint8Array(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + + toJSON(message: PrivKey): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): PrivKey { + const message = { ...basePrivKey } as PrivKey; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/crypto/multisig/keys.ts b/src/cosmos/crypto/multisig/keys.ts new file mode 100644 index 00000000..c057a28b --- /dev/null +++ b/src/cosmos/crypto/multisig/keys.ts @@ -0,0 +1,111 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Any } from "../../../google/protobuf/any"; + +export const protobufPackage = "cosmos.crypto.multisig"; + +/** + * LegacyAminoPubKey specifies a public key type + * which nests multiple public keys and a threshold, + * it uses legacy amino address rules. + */ +export interface LegacyAminoPubKey { + threshold: number; + publicKeys: Any[]; +} + +const baseLegacyAminoPubKey: object = { threshold: 0 }; + +export const LegacyAminoPubKey = { + encode(message: LegacyAminoPubKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.threshold !== 0) { + writer.uint32(8).uint32(message.threshold); + } + for (const v of message.publicKeys) { + Any.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LegacyAminoPubKey { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseLegacyAminoPubKey } as LegacyAminoPubKey; + message.publicKeys = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.threshold = reader.uint32(); + break; + case 2: + message.publicKeys.push(Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LegacyAminoPubKey { + const message = { ...baseLegacyAminoPubKey } as LegacyAminoPubKey; + message.publicKeys = []; + if (object.threshold !== undefined && object.threshold !== null) { + message.threshold = Number(object.threshold); + } else { + message.threshold = 0; + } + if (object.publicKeys !== undefined && object.publicKeys !== null) { + for (const e of object.publicKeys) { + message.publicKeys.push(Any.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: LegacyAminoPubKey): unknown { + const obj: any = {}; + message.threshold !== undefined && (obj.threshold = message.threshold); + if (message.publicKeys) { + obj.publicKeys = message.publicKeys.map((e) => (e ? Any.toJSON(e) : undefined)); + } else { + obj.publicKeys = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): LegacyAminoPubKey { + const message = { ...baseLegacyAminoPubKey } as LegacyAminoPubKey; + message.publicKeys = []; + if (object.threshold !== undefined && object.threshold !== null) { + message.threshold = object.threshold; + } else { + message.threshold = 0; + } + if (object.publicKeys !== undefined && object.publicKeys !== null) { + for (const e of object.publicKeys) { + message.publicKeys.push(Any.fromPartial(e)); + } + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/crypto/multisig/v1beta1/multisig.ts b/src/cosmos/crypto/multisig/v1beta1/multisig.ts new file mode 100644 index 00000000..8cfa3512 --- /dev/null +++ b/src/cosmos/crypto/multisig/v1beta1/multisig.ts @@ -0,0 +1,207 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.crypto.multisig.v1beta1"; + +/** + * MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. + * See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers + * signed and with which modes. + */ +export interface MultiSignature { + signatures: Uint8Array[]; +} + +/** + * CompactBitArray is an implementation of a space efficient bit array. + * This is used to ensure that the encoded data takes up a minimal amount of + * space after proto encoding. + * This is not thread safe, and is not intended for concurrent usage. + */ +export interface CompactBitArray { + extraBitsStored: number; + elems: Uint8Array; +} + +const baseMultiSignature: object = {}; + +export const MultiSignature = { + encode(message: MultiSignature, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.signatures) { + writer.uint32(10).bytes(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MultiSignature { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMultiSignature } as MultiSignature; + message.signatures = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MultiSignature { + const message = { ...baseMultiSignature } as MultiSignature; + message.signatures = []; + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(bytesFromBase64(e)); + } + } + return message; + }, + + toJSON(message: MultiSignature): unknown { + const obj: any = {}; + if (message.signatures) { + obj.signatures = message.signatures.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.signatures = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): MultiSignature { + const message = { ...baseMultiSignature } as MultiSignature; + message.signatures = []; + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(e); + } + } + return message; + }, +}; + +const baseCompactBitArray: object = { extraBitsStored: 0 }; + +export const CompactBitArray = { + encode(message: CompactBitArray, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.extraBitsStored !== 0) { + writer.uint32(8).uint32(message.extraBitsStored); + } + if (message.elems.length !== 0) { + writer.uint32(18).bytes(message.elems); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CompactBitArray { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCompactBitArray } as CompactBitArray; + message.elems = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.extraBitsStored = reader.uint32(); + break; + case 2: + message.elems = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CompactBitArray { + const message = { ...baseCompactBitArray } as CompactBitArray; + message.elems = new Uint8Array(); + if (object.extraBitsStored !== undefined && object.extraBitsStored !== null) { + message.extraBitsStored = Number(object.extraBitsStored); + } else { + message.extraBitsStored = 0; + } + if (object.elems !== undefined && object.elems !== null) { + message.elems = bytesFromBase64(object.elems); + } + return message; + }, + + toJSON(message: CompactBitArray): unknown { + const obj: any = {}; + message.extraBitsStored !== undefined && (obj.extraBitsStored = message.extraBitsStored); + message.elems !== undefined && + (obj.elems = base64FromBytes(message.elems !== undefined ? message.elems : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): CompactBitArray { + const message = { ...baseCompactBitArray } as CompactBitArray; + if (object.extraBitsStored !== undefined && object.extraBitsStored !== null) { + message.extraBitsStored = object.extraBitsStored; + } else { + message.extraBitsStored = 0; + } + if (object.elems !== undefined && object.elems !== null) { + message.elems = object.elems; + } else { + message.elems = new Uint8Array(); + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/crypto/secp256k1/keys.ts b/src/cosmos/crypto/secp256k1/keys.ts new file mode 100644 index 00000000..0cecc1ae --- /dev/null +++ b/src/cosmos/crypto/secp256k1/keys.ts @@ -0,0 +1,180 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.crypto.secp256k1"; + +/** + * PubKey defines a secp256k1 public key + * Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte + * if the y-coordinate is the lexicographically largest of the two associated with + * the x-coordinate. Otherwise the first byte is a 0x03. + * This prefix is followed with the x-coordinate. + */ +export interface PubKey { + key: Uint8Array; +} + +/** PrivKey defines a secp256k1 private key. */ +export interface PrivKey { + key: Uint8Array; +} + +const basePubKey: object = {}; + +export const PubKey = { + encode(message: PubKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PubKey { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePubKey } as PubKey; + message.key = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PubKey { + const message = { ...basePubKey } as PubKey; + message.key = new Uint8Array(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + + toJSON(message: PubKey): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): PubKey { + const message = { ...basePubKey } as PubKey; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + return message; + }, +}; + +const basePrivKey: object = {}; + +export const PrivKey = { + encode(message: PrivKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PrivKey { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePrivKey } as PrivKey; + message.key = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PrivKey { + const message = { ...basePrivKey } as PrivKey; + message.key = new Uint8Array(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + return message; + }, + + toJSON(message: PrivKey): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): PrivKey { + const message = { ...basePrivKey } as PrivKey; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/distribution/v1beta1/distribution.ts b/src/cosmos/distribution/v1beta1/distribution.ts new file mode 100644 index 00000000..113ce343 --- /dev/null +++ b/src/cosmos/distribution/v1beta1/distribution.ts @@ -0,0 +1,1153 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { DecCoin, Coin } from "../../../cosmos/base/v1beta1/coin"; + +export const protobufPackage = "cosmos.distribution.v1beta1"; + +/** Params defines the set of params for the distribution module. */ +export interface Params { + communityTax: string; + baseProposerReward: string; + bonusProposerReward: string; + withdrawAddrEnabled: boolean; +} + +/** + * ValidatorHistoricalRewards represents historical rewards for a validator. + * Height is implicit within the store key. + * Cumulative reward ratio is the sum from the zeroeth period + * until this period of rewards / tokens, per the spec. + * The reference count indicates the number of objects + * which might need to reference this historical entry at any point. + * ReferenceCount = + * number of outstanding delegations which ended the associated period (and + * might need to read that record) + * + number of slashes which ended the associated period (and might need to + * read that record) + * + one per validator for the zeroeth period, set on initialization + */ +export interface ValidatorHistoricalRewards { + cumulativeRewardRatio: DecCoin[]; + referenceCount: number; +} + +/** + * ValidatorCurrentRewards represents current rewards and current + * period for a validator kept as a running counter and incremented + * each block as long as the validator's tokens remain constant. + */ +export interface ValidatorCurrentRewards { + rewards: DecCoin[]; + period: Long; +} + +/** + * ValidatorAccumulatedCommission represents accumulated commission + * for a validator kept as a running counter, can be withdrawn at any time. + */ +export interface ValidatorAccumulatedCommission { + commission: DecCoin[]; +} + +/** + * ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards + * for a validator inexpensive to track, allows simple sanity checks. + */ +export interface ValidatorOutstandingRewards { + rewards: DecCoin[]; +} + +/** + * ValidatorSlashEvent represents a validator slash event. + * Height is implicit within the store key. + * This is needed to calculate appropriate amount of staking tokens + * for delegations which are withdrawn after a slash has occurred. + */ +export interface ValidatorSlashEvent { + validatorPeriod: Long; + fraction: string; +} + +/** ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. */ +export interface ValidatorSlashEvents { + validatorSlashEvents: ValidatorSlashEvent[]; +} + +/** FeePool is the global fee pool for distribution. */ +export interface FeePool { + communityPool: DecCoin[]; +} + +/** + * CommunityPoolSpendProposal details a proposal for use of community funds, + * together with how many coins are proposed to be spent, and to which + * recipient account. + */ +export interface CommunityPoolSpendProposal { + title: string; + description: string; + recipient: string; + amount: Coin[]; +} + +/** + * DelegatorStartingInfo represents the starting info for a delegator reward + * period. It tracks the previous validator period, the delegation's amount of + * staking token, and the creation height (to check later on if any slashes have + * occurred). NOTE: Even though validators are slashed to whole staking tokens, + * the delegators within the validator may be left with less than a full token, + * thus sdk.Dec is used. + */ +export interface DelegatorStartingInfo { + previousPeriod: Long; + stake: string; + height: Long; +} + +/** + * DelegationDelegatorReward represents the properties + * of a delegator's delegation reward. + */ +export interface DelegationDelegatorReward { + validatorAddress: string; + reward: DecCoin[]; +} + +/** + * CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal + * with a deposit + */ +export interface CommunityPoolSpendProposalWithDeposit { + title: string; + description: string; + recipient: string; + amount: string; + deposit: string; +} + +const baseParams: object = { + communityTax: "", + baseProposerReward: "", + bonusProposerReward: "", + withdrawAddrEnabled: false, +}; + +export const Params = { + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.communityTax !== "") { + writer.uint32(10).string(message.communityTax); + } + if (message.baseProposerReward !== "") { + writer.uint32(18).string(message.baseProposerReward); + } + if (message.bonusProposerReward !== "") { + writer.uint32(26).string(message.bonusProposerReward); + } + if (message.withdrawAddrEnabled === true) { + writer.uint32(32).bool(message.withdrawAddrEnabled); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseParams } as Params; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.communityTax = reader.string(); + break; + case 2: + message.baseProposerReward = reader.string(); + break; + case 3: + message.bonusProposerReward = reader.string(); + break; + case 4: + message.withdrawAddrEnabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Params { + const message = { ...baseParams } as Params; + if (object.communityTax !== undefined && object.communityTax !== null) { + message.communityTax = String(object.communityTax); + } else { + message.communityTax = ""; + } + if (object.baseProposerReward !== undefined && object.baseProposerReward !== null) { + message.baseProposerReward = String(object.baseProposerReward); + } else { + message.baseProposerReward = ""; + } + if (object.bonusProposerReward !== undefined && object.bonusProposerReward !== null) { + message.bonusProposerReward = String(object.bonusProposerReward); + } else { + message.bonusProposerReward = ""; + } + if (object.withdrawAddrEnabled !== undefined && object.withdrawAddrEnabled !== null) { + message.withdrawAddrEnabled = Boolean(object.withdrawAddrEnabled); + } else { + message.withdrawAddrEnabled = false; + } + return message; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + message.communityTax !== undefined && (obj.communityTax = message.communityTax); + message.baseProposerReward !== undefined && (obj.baseProposerReward = message.baseProposerReward); + message.bonusProposerReward !== undefined && (obj.bonusProposerReward = message.bonusProposerReward); + message.withdrawAddrEnabled !== undefined && (obj.withdrawAddrEnabled = message.withdrawAddrEnabled); + return obj; + }, + + fromPartial(object: DeepPartial): Params { + const message = { ...baseParams } as Params; + if (object.communityTax !== undefined && object.communityTax !== null) { + message.communityTax = object.communityTax; + } else { + message.communityTax = ""; + } + if (object.baseProposerReward !== undefined && object.baseProposerReward !== null) { + message.baseProposerReward = object.baseProposerReward; + } else { + message.baseProposerReward = ""; + } + if (object.bonusProposerReward !== undefined && object.bonusProposerReward !== null) { + message.bonusProposerReward = object.bonusProposerReward; + } else { + message.bonusProposerReward = ""; + } + if (object.withdrawAddrEnabled !== undefined && object.withdrawAddrEnabled !== null) { + message.withdrawAddrEnabled = object.withdrawAddrEnabled; + } else { + message.withdrawAddrEnabled = false; + } + return message; + }, +}; + +const baseValidatorHistoricalRewards: object = { referenceCount: 0 }; + +export const ValidatorHistoricalRewards = { + encode(message: ValidatorHistoricalRewards, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.cumulativeRewardRatio) { + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.referenceCount !== 0) { + writer.uint32(16).uint32(message.referenceCount); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorHistoricalRewards { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseValidatorHistoricalRewards } as ValidatorHistoricalRewards; + message.cumulativeRewardRatio = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cumulativeRewardRatio.push(DecCoin.decode(reader, reader.uint32())); + break; + case 2: + message.referenceCount = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ValidatorHistoricalRewards { + const message = { ...baseValidatorHistoricalRewards } as ValidatorHistoricalRewards; + message.cumulativeRewardRatio = []; + if (object.cumulativeRewardRatio !== undefined && object.cumulativeRewardRatio !== null) { + for (const e of object.cumulativeRewardRatio) { + message.cumulativeRewardRatio.push(DecCoin.fromJSON(e)); + } + } + if (object.referenceCount !== undefined && object.referenceCount !== null) { + message.referenceCount = Number(object.referenceCount); + } else { + message.referenceCount = 0; + } + return message; + }, + + toJSON(message: ValidatorHistoricalRewards): unknown { + const obj: any = {}; + if (message.cumulativeRewardRatio) { + obj.cumulativeRewardRatio = message.cumulativeRewardRatio.map((e) => + e ? DecCoin.toJSON(e) : undefined, + ); + } else { + obj.cumulativeRewardRatio = []; + } + message.referenceCount !== undefined && (obj.referenceCount = message.referenceCount); + return obj; + }, + + fromPartial(object: DeepPartial): ValidatorHistoricalRewards { + const message = { ...baseValidatorHistoricalRewards } as ValidatorHistoricalRewards; + message.cumulativeRewardRatio = []; + if (object.cumulativeRewardRatio !== undefined && object.cumulativeRewardRatio !== null) { + for (const e of object.cumulativeRewardRatio) { + message.cumulativeRewardRatio.push(DecCoin.fromPartial(e)); + } + } + if (object.referenceCount !== undefined && object.referenceCount !== null) { + message.referenceCount = object.referenceCount; + } else { + message.referenceCount = 0; + } + return message; + }, +}; + +const baseValidatorCurrentRewards: object = { period: Long.UZERO }; + +export const ValidatorCurrentRewards = { + encode(message: ValidatorCurrentRewards, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.rewards) { + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (!message.period.isZero()) { + writer.uint32(16).uint64(message.period); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorCurrentRewards { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseValidatorCurrentRewards } as ValidatorCurrentRewards; + message.rewards = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rewards.push(DecCoin.decode(reader, reader.uint32())); + break; + case 2: + message.period = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ValidatorCurrentRewards { + const message = { ...baseValidatorCurrentRewards } as ValidatorCurrentRewards; + message.rewards = []; + if (object.rewards !== undefined && object.rewards !== null) { + for (const e of object.rewards) { + message.rewards.push(DecCoin.fromJSON(e)); + } + } + if (object.period !== undefined && object.period !== null) { + message.period = Long.fromString(object.period); + } else { + message.period = Long.UZERO; + } + return message; + }, + + toJSON(message: ValidatorCurrentRewards): unknown { + const obj: any = {}; + if (message.rewards) { + obj.rewards = message.rewards.map((e) => (e ? DecCoin.toJSON(e) : undefined)); + } else { + obj.rewards = []; + } + message.period !== undefined && (obj.period = (message.period || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): ValidatorCurrentRewards { + const message = { ...baseValidatorCurrentRewards } as ValidatorCurrentRewards; + message.rewards = []; + if (object.rewards !== undefined && object.rewards !== null) { + for (const e of object.rewards) { + message.rewards.push(DecCoin.fromPartial(e)); + } + } + if (object.period !== undefined && object.period !== null) { + message.period = object.period as Long; + } else { + message.period = Long.UZERO; + } + return message; + }, +}; + +const baseValidatorAccumulatedCommission: object = {}; + +export const ValidatorAccumulatedCommission = { + encode(message: ValidatorAccumulatedCommission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.commission) { + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorAccumulatedCommission { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseValidatorAccumulatedCommission } as ValidatorAccumulatedCommission; + message.commission = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.commission.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ValidatorAccumulatedCommission { + const message = { ...baseValidatorAccumulatedCommission } as ValidatorAccumulatedCommission; + message.commission = []; + if (object.commission !== undefined && object.commission !== null) { + for (const e of object.commission) { + message.commission.push(DecCoin.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: ValidatorAccumulatedCommission): unknown { + const obj: any = {}; + if (message.commission) { + obj.commission = message.commission.map((e) => (e ? DecCoin.toJSON(e) : undefined)); + } else { + obj.commission = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ValidatorAccumulatedCommission { + const message = { ...baseValidatorAccumulatedCommission } as ValidatorAccumulatedCommission; + message.commission = []; + if (object.commission !== undefined && object.commission !== null) { + for (const e of object.commission) { + message.commission.push(DecCoin.fromPartial(e)); + } + } + return message; + }, +}; + +const baseValidatorOutstandingRewards: object = {}; + +export const ValidatorOutstandingRewards = { + encode(message: ValidatorOutstandingRewards, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.rewards) { + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorOutstandingRewards { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseValidatorOutstandingRewards } as ValidatorOutstandingRewards; + message.rewards = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rewards.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ValidatorOutstandingRewards { + const message = { ...baseValidatorOutstandingRewards } as ValidatorOutstandingRewards; + message.rewards = []; + if (object.rewards !== undefined && object.rewards !== null) { + for (const e of object.rewards) { + message.rewards.push(DecCoin.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: ValidatorOutstandingRewards): unknown { + const obj: any = {}; + if (message.rewards) { + obj.rewards = message.rewards.map((e) => (e ? DecCoin.toJSON(e) : undefined)); + } else { + obj.rewards = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ValidatorOutstandingRewards { + const message = { ...baseValidatorOutstandingRewards } as ValidatorOutstandingRewards; + message.rewards = []; + if (object.rewards !== undefined && object.rewards !== null) { + for (const e of object.rewards) { + message.rewards.push(DecCoin.fromPartial(e)); + } + } + return message; + }, +}; + +const baseValidatorSlashEvent: object = { validatorPeriod: Long.UZERO, fraction: "" }; + +export const ValidatorSlashEvent = { + encode(message: ValidatorSlashEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.validatorPeriod.isZero()) { + writer.uint32(8).uint64(message.validatorPeriod); + } + if (message.fraction !== "") { + writer.uint32(18).string(message.fraction); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSlashEvent { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseValidatorSlashEvent } as ValidatorSlashEvent; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorPeriod = reader.uint64() as Long; + break; + case 2: + message.fraction = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ValidatorSlashEvent { + const message = { ...baseValidatorSlashEvent } as ValidatorSlashEvent; + if (object.validatorPeriod !== undefined && object.validatorPeriod !== null) { + message.validatorPeriod = Long.fromString(object.validatorPeriod); + } else { + message.validatorPeriod = Long.UZERO; + } + if (object.fraction !== undefined && object.fraction !== null) { + message.fraction = String(object.fraction); + } else { + message.fraction = ""; + } + return message; + }, + + toJSON(message: ValidatorSlashEvent): unknown { + const obj: any = {}; + message.validatorPeriod !== undefined && + (obj.validatorPeriod = (message.validatorPeriod || Long.UZERO).toString()); + message.fraction !== undefined && (obj.fraction = message.fraction); + return obj; + }, + + fromPartial(object: DeepPartial): ValidatorSlashEvent { + const message = { ...baseValidatorSlashEvent } as ValidatorSlashEvent; + if (object.validatorPeriod !== undefined && object.validatorPeriod !== null) { + message.validatorPeriod = object.validatorPeriod as Long; + } else { + message.validatorPeriod = Long.UZERO; + } + if (object.fraction !== undefined && object.fraction !== null) { + message.fraction = object.fraction; + } else { + message.fraction = ""; + } + return message; + }, +}; + +const baseValidatorSlashEvents: object = {}; + +export const ValidatorSlashEvents = { + encode(message: ValidatorSlashEvents, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.validatorSlashEvents) { + ValidatorSlashEvent.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSlashEvents { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseValidatorSlashEvents } as ValidatorSlashEvents; + message.validatorSlashEvents = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorSlashEvents.push(ValidatorSlashEvent.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ValidatorSlashEvents { + const message = { ...baseValidatorSlashEvents } as ValidatorSlashEvents; + message.validatorSlashEvents = []; + if (object.validatorSlashEvents !== undefined && object.validatorSlashEvents !== null) { + for (const e of object.validatorSlashEvents) { + message.validatorSlashEvents.push(ValidatorSlashEvent.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: ValidatorSlashEvents): unknown { + const obj: any = {}; + if (message.validatorSlashEvents) { + obj.validatorSlashEvents = message.validatorSlashEvents.map((e) => + e ? ValidatorSlashEvent.toJSON(e) : undefined, + ); + } else { + obj.validatorSlashEvents = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ValidatorSlashEvents { + const message = { ...baseValidatorSlashEvents } as ValidatorSlashEvents; + message.validatorSlashEvents = []; + if (object.validatorSlashEvents !== undefined && object.validatorSlashEvents !== null) { + for (const e of object.validatorSlashEvents) { + message.validatorSlashEvents.push(ValidatorSlashEvent.fromPartial(e)); + } + } + return message; + }, +}; + +const baseFeePool: object = {}; + +export const FeePool = { + encode(message: FeePool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.communityPool) { + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FeePool { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFeePool } as FeePool; + message.communityPool = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.communityPool.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FeePool { + const message = { ...baseFeePool } as FeePool; + message.communityPool = []; + if (object.communityPool !== undefined && object.communityPool !== null) { + for (const e of object.communityPool) { + message.communityPool.push(DecCoin.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: FeePool): unknown { + const obj: any = {}; + if (message.communityPool) { + obj.communityPool = message.communityPool.map((e) => (e ? DecCoin.toJSON(e) : undefined)); + } else { + obj.communityPool = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): FeePool { + const message = { ...baseFeePool } as FeePool; + message.communityPool = []; + if (object.communityPool !== undefined && object.communityPool !== null) { + for (const e of object.communityPool) { + message.communityPool.push(DecCoin.fromPartial(e)); + } + } + return message; + }, +}; + +const baseCommunityPoolSpendProposal: object = { title: "", description: "", recipient: "" }; + +export const CommunityPoolSpendProposal = { + encode(message: CommunityPoolSpendProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.recipient !== "") { + writer.uint32(26).string(message.recipient); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CommunityPoolSpendProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCommunityPoolSpendProposal } as CommunityPoolSpendProposal; + message.amount = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.recipient = reader.string(); + break; + case 4: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CommunityPoolSpendProposal { + const message = { ...baseCommunityPoolSpendProposal } as CommunityPoolSpendProposal; + message.amount = []; + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = String(object.recipient); + } else { + message.recipient = ""; + } + if (object.amount !== undefined && object.amount !== null) { + for (const e of object.amount) { + message.amount.push(Coin.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: CommunityPoolSpendProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.recipient !== undefined && (obj.recipient = message.recipient); + if (message.amount) { + obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.amount = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): CommunityPoolSpendProposal { + const message = { ...baseCommunityPoolSpendProposal } as CommunityPoolSpendProposal; + message.amount = []; + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } else { + message.recipient = ""; + } + if (object.amount !== undefined && object.amount !== null) { + for (const e of object.amount) { + message.amount.push(Coin.fromPartial(e)); + } + } + return message; + }, +}; + +const baseDelegatorStartingInfo: object = { previousPeriod: Long.UZERO, stake: "", height: Long.UZERO }; + +export const DelegatorStartingInfo = { + encode(message: DelegatorStartingInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.previousPeriod.isZero()) { + writer.uint32(8).uint64(message.previousPeriod); + } + if (message.stake !== "") { + writer.uint32(18).string(message.stake); + } + if (!message.height.isZero()) { + writer.uint32(24).uint64(message.height); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DelegatorStartingInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDelegatorStartingInfo } as DelegatorStartingInfo; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.previousPeriod = reader.uint64() as Long; + break; + case 2: + message.stake = reader.string(); + break; + case 3: + message.height = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DelegatorStartingInfo { + const message = { ...baseDelegatorStartingInfo } as DelegatorStartingInfo; + if (object.previousPeriod !== undefined && object.previousPeriod !== null) { + message.previousPeriod = Long.fromString(object.previousPeriod); + } else { + message.previousPeriod = Long.UZERO; + } + if (object.stake !== undefined && object.stake !== null) { + message.stake = String(object.stake); + } else { + message.stake = ""; + } + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.UZERO; + } + return message; + }, + + toJSON(message: DelegatorStartingInfo): unknown { + const obj: any = {}; + message.previousPeriod !== undefined && + (obj.previousPeriod = (message.previousPeriod || Long.UZERO).toString()); + message.stake !== undefined && (obj.stake = message.stake); + message.height !== undefined && (obj.height = (message.height || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): DelegatorStartingInfo { + const message = { ...baseDelegatorStartingInfo } as DelegatorStartingInfo; + if (object.previousPeriod !== undefined && object.previousPeriod !== null) { + message.previousPeriod = object.previousPeriod as Long; + } else { + message.previousPeriod = Long.UZERO; + } + if (object.stake !== undefined && object.stake !== null) { + message.stake = object.stake; + } else { + message.stake = ""; + } + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.UZERO; + } + return message; + }, +}; + +const baseDelegationDelegatorReward: object = { validatorAddress: "" }; + +export const DelegationDelegatorReward = { + encode(message: DelegationDelegatorReward, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + for (const v of message.reward) { + DecCoin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DelegationDelegatorReward { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDelegationDelegatorReward } as DelegationDelegatorReward; + message.reward = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.reward.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DelegationDelegatorReward { + const message = { ...baseDelegationDelegatorReward } as DelegationDelegatorReward; + message.reward = []; + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = String(object.validatorAddress); + } else { + message.validatorAddress = ""; + } + if (object.reward !== undefined && object.reward !== null) { + for (const e of object.reward) { + message.reward.push(DecCoin.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: DelegationDelegatorReward): unknown { + const obj: any = {}; + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + if (message.reward) { + obj.reward = message.reward.map((e) => (e ? DecCoin.toJSON(e) : undefined)); + } else { + obj.reward = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): DelegationDelegatorReward { + const message = { ...baseDelegationDelegatorReward } as DelegationDelegatorReward; + message.reward = []; + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = ""; + } + if (object.reward !== undefined && object.reward !== null) { + for (const e of object.reward) { + message.reward.push(DecCoin.fromPartial(e)); + } + } + return message; + }, +}; + +const baseCommunityPoolSpendProposalWithDeposit: object = { + title: "", + description: "", + recipient: "", + amount: "", + deposit: "", +}; + +export const CommunityPoolSpendProposalWithDeposit = { + encode( + message: CommunityPoolSpendProposalWithDeposit, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.recipient !== "") { + writer.uint32(26).string(message.recipient); + } + if (message.amount !== "") { + writer.uint32(34).string(message.amount); + } + if (message.deposit !== "") { + writer.uint32(42).string(message.deposit); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CommunityPoolSpendProposalWithDeposit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCommunityPoolSpendProposalWithDeposit } as CommunityPoolSpendProposalWithDeposit; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.recipient = reader.string(); + break; + case 4: + message.amount = reader.string(); + break; + case 5: + message.deposit = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CommunityPoolSpendProposalWithDeposit { + const message = { ...baseCommunityPoolSpendProposalWithDeposit } as CommunityPoolSpendProposalWithDeposit; + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = String(object.recipient); + } else { + message.recipient = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = String(object.amount); + } else { + message.amount = ""; + } + if (object.deposit !== undefined && object.deposit !== null) { + message.deposit = String(object.deposit); + } else { + message.deposit = ""; + } + return message; + }, + + toJSON(message: CommunityPoolSpendProposalWithDeposit): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.recipient !== undefined && (obj.recipient = message.recipient); + message.amount !== undefined && (obj.amount = message.amount); + message.deposit !== undefined && (obj.deposit = message.deposit); + return obj; + }, + + fromPartial( + object: DeepPartial, + ): CommunityPoolSpendProposalWithDeposit { + const message = { ...baseCommunityPoolSpendProposalWithDeposit } as CommunityPoolSpendProposalWithDeposit; + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } else { + message.recipient = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount; + } else { + message.amount = ""; + } + if (object.deposit !== undefined && object.deposit !== null) { + message.deposit = object.deposit; + } else { + message.deposit = ""; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/distribution/v1beta1/genesis.ts b/src/cosmos/distribution/v1beta1/genesis.ts new file mode 100644 index 00000000..aa427a15 --- /dev/null +++ b/src/cosmos/distribution/v1beta1/genesis.ts @@ -0,0 +1,1010 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { + ValidatorAccumulatedCommission, + ValidatorHistoricalRewards, + ValidatorCurrentRewards, + DelegatorStartingInfo, + ValidatorSlashEvent, + Params, + FeePool, +} from "../../../cosmos/distribution/v1beta1/distribution"; +import { DecCoin } from "../../../cosmos/base/v1beta1/coin"; + +export const protobufPackage = "cosmos.distribution.v1beta1"; + +/** + * DelegatorWithdrawInfo is the address for where distributions rewards are + * withdrawn to by default this struct is only used at genesis to feed in + * default withdraw addresses. + */ +export interface DelegatorWithdrawInfo { + /** delegator_address is the address of the delegator. */ + delegatorAddress: string; + /** withdraw_address is the address to withdraw the delegation rewards to. */ + withdrawAddress: string; +} + +/** ValidatorOutstandingRewardsRecord is used for import/export via genesis json. */ +export interface ValidatorOutstandingRewardsRecord { + /** validator_address is the address of the validator. */ + validatorAddress: string; + /** outstanding_rewards represents the oustanding rewards of a validator. */ + outstandingRewards: DecCoin[]; +} + +/** + * ValidatorAccumulatedCommissionRecord is used for import / export via genesis + * json. + */ +export interface ValidatorAccumulatedCommissionRecord { + /** validator_address is the address of the validator. */ + validatorAddress: string; + /** accumulated is the accumulated commission of a validator. */ + accumulated?: ValidatorAccumulatedCommission; +} + +/** + * ValidatorHistoricalRewardsRecord is used for import / export via genesis + * json. + */ +export interface ValidatorHistoricalRewardsRecord { + /** validator_address is the address of the validator. */ + validatorAddress: string; + /** period defines the period the historical rewards apply to. */ + period: Long; + /** rewards defines the historical rewards of a validator. */ + rewards?: ValidatorHistoricalRewards; +} + +/** ValidatorCurrentRewardsRecord is used for import / export via genesis json. */ +export interface ValidatorCurrentRewardsRecord { + /** validator_address is the address of the validator. */ + validatorAddress: string; + /** rewards defines the current rewards of a validator. */ + rewards?: ValidatorCurrentRewards; +} + +/** DelegatorStartingInfoRecord used for import / export via genesis json. */ +export interface DelegatorStartingInfoRecord { + /** delegator_address is the address of the delegator. */ + delegatorAddress: string; + /** validator_address is the address of the validator. */ + validatorAddress: string; + /** starting_info defines the starting info of a delegator. */ + startingInfo?: DelegatorStartingInfo; +} + +/** ValidatorSlashEventRecord is used for import / export via genesis json. */ +export interface ValidatorSlashEventRecord { + /** validator_address is the address of the validator. */ + validatorAddress: string; + /** height defines the block height at which the slash event occured. */ + height: Long; + /** period is the period of the slash event. */ + period: Long; + /** validator_slash_event describes the slash event. */ + validatorSlashEvent?: ValidatorSlashEvent; +} + +/** GenesisState defines the distribution module's genesis state. */ +export interface GenesisState { + /** params defines all the paramaters of the module. */ + params?: Params; + /** fee_pool defines the fee pool at genesis. */ + feePool?: FeePool; + /** fee_pool defines the delegator withdraw infos at genesis. */ + delegatorWithdrawInfos: DelegatorWithdrawInfo[]; + /** fee_pool defines the previous proposer at genesis. */ + previousProposer: string; + /** fee_pool defines the outstanding rewards of all validators at genesis. */ + outstandingRewards: ValidatorOutstandingRewardsRecord[]; + /** fee_pool defines the accumulated commisions of all validators at genesis. */ + validatorAccumulatedCommissions: ValidatorAccumulatedCommissionRecord[]; + /** fee_pool defines the historical rewards of all validators at genesis. */ + validatorHistoricalRewards: ValidatorHistoricalRewardsRecord[]; + /** fee_pool defines the current rewards of all validators at genesis. */ + validatorCurrentRewards: ValidatorCurrentRewardsRecord[]; + /** fee_pool defines the delegator starting infos at genesis. */ + delegatorStartingInfos: DelegatorStartingInfoRecord[]; + /** fee_pool defines the validator slash events at genesis. */ + validatorSlashEvents: ValidatorSlashEventRecord[]; +} + +const baseDelegatorWithdrawInfo: object = { delegatorAddress: "", withdrawAddress: "" }; + +export const DelegatorWithdrawInfo = { + encode(message: DelegatorWithdrawInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.withdrawAddress !== "") { + writer.uint32(18).string(message.withdrawAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DelegatorWithdrawInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDelegatorWithdrawInfo } as DelegatorWithdrawInfo; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.withdrawAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DelegatorWithdrawInfo { + const message = { ...baseDelegatorWithdrawInfo } as DelegatorWithdrawInfo; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = String(object.delegatorAddress); + } else { + message.delegatorAddress = ""; + } + if (object.withdrawAddress !== undefined && object.withdrawAddress !== null) { + message.withdrawAddress = String(object.withdrawAddress); + } else { + message.withdrawAddress = ""; + } + return message; + }, + + toJSON(message: DelegatorWithdrawInfo): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.withdrawAddress !== undefined && (obj.withdrawAddress = message.withdrawAddress); + return obj; + }, + + fromPartial(object: DeepPartial): DelegatorWithdrawInfo { + const message = { ...baseDelegatorWithdrawInfo } as DelegatorWithdrawInfo; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = object.delegatorAddress; + } else { + message.delegatorAddress = ""; + } + if (object.withdrawAddress !== undefined && object.withdrawAddress !== null) { + message.withdrawAddress = object.withdrawAddress; + } else { + message.withdrawAddress = ""; + } + return message; + }, +}; + +const baseValidatorOutstandingRewardsRecord: object = { validatorAddress: "" }; + +export const ValidatorOutstandingRewardsRecord = { + encode(message: ValidatorOutstandingRewardsRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + for (const v of message.outstandingRewards) { + DecCoin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorOutstandingRewardsRecord { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseValidatorOutstandingRewardsRecord } as ValidatorOutstandingRewardsRecord; + message.outstandingRewards = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.outstandingRewards.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ValidatorOutstandingRewardsRecord { + const message = { ...baseValidatorOutstandingRewardsRecord } as ValidatorOutstandingRewardsRecord; + message.outstandingRewards = []; + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = String(object.validatorAddress); + } else { + message.validatorAddress = ""; + } + if (object.outstandingRewards !== undefined && object.outstandingRewards !== null) { + for (const e of object.outstandingRewards) { + message.outstandingRewards.push(DecCoin.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: ValidatorOutstandingRewardsRecord): unknown { + const obj: any = {}; + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + if (message.outstandingRewards) { + obj.outstandingRewards = message.outstandingRewards.map((e) => (e ? DecCoin.toJSON(e) : undefined)); + } else { + obj.outstandingRewards = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ValidatorOutstandingRewardsRecord { + const message = { ...baseValidatorOutstandingRewardsRecord } as ValidatorOutstandingRewardsRecord; + message.outstandingRewards = []; + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = ""; + } + if (object.outstandingRewards !== undefined && object.outstandingRewards !== null) { + for (const e of object.outstandingRewards) { + message.outstandingRewards.push(DecCoin.fromPartial(e)); + } + } + return message; + }, +}; + +const baseValidatorAccumulatedCommissionRecord: object = { validatorAddress: "" }; + +export const ValidatorAccumulatedCommissionRecord = { + encode( + message: ValidatorAccumulatedCommissionRecord, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + if (message.accumulated !== undefined) { + ValidatorAccumulatedCommission.encode(message.accumulated, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorAccumulatedCommissionRecord { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseValidatorAccumulatedCommissionRecord } as ValidatorAccumulatedCommissionRecord; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.accumulated = ValidatorAccumulatedCommission.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ValidatorAccumulatedCommissionRecord { + const message = { ...baseValidatorAccumulatedCommissionRecord } as ValidatorAccumulatedCommissionRecord; + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = String(object.validatorAddress); + } else { + message.validatorAddress = ""; + } + if (object.accumulated !== undefined && object.accumulated !== null) { + message.accumulated = ValidatorAccumulatedCommission.fromJSON(object.accumulated); + } else { + message.accumulated = undefined; + } + return message; + }, + + toJSON(message: ValidatorAccumulatedCommissionRecord): unknown { + const obj: any = {}; + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.accumulated !== undefined && + (obj.accumulated = message.accumulated + ? ValidatorAccumulatedCommission.toJSON(message.accumulated) + : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial, + ): ValidatorAccumulatedCommissionRecord { + const message = { ...baseValidatorAccumulatedCommissionRecord } as ValidatorAccumulatedCommissionRecord; + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = ""; + } + if (object.accumulated !== undefined && object.accumulated !== null) { + message.accumulated = ValidatorAccumulatedCommission.fromPartial(object.accumulated); + } else { + message.accumulated = undefined; + } + return message; + }, +}; + +const baseValidatorHistoricalRewardsRecord: object = { validatorAddress: "", period: Long.UZERO }; + +export const ValidatorHistoricalRewardsRecord = { + encode(message: ValidatorHistoricalRewardsRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + if (!message.period.isZero()) { + writer.uint32(16).uint64(message.period); + } + if (message.rewards !== undefined) { + ValidatorHistoricalRewards.encode(message.rewards, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorHistoricalRewardsRecord { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseValidatorHistoricalRewardsRecord } as ValidatorHistoricalRewardsRecord; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.period = reader.uint64() as Long; + break; + case 3: + message.rewards = ValidatorHistoricalRewards.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ValidatorHistoricalRewardsRecord { + const message = { ...baseValidatorHistoricalRewardsRecord } as ValidatorHistoricalRewardsRecord; + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = String(object.validatorAddress); + } else { + message.validatorAddress = ""; + } + if (object.period !== undefined && object.period !== null) { + message.period = Long.fromString(object.period); + } else { + message.period = Long.UZERO; + } + if (object.rewards !== undefined && object.rewards !== null) { + message.rewards = ValidatorHistoricalRewards.fromJSON(object.rewards); + } else { + message.rewards = undefined; + } + return message; + }, + + toJSON(message: ValidatorHistoricalRewardsRecord): unknown { + const obj: any = {}; + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.period !== undefined && (obj.period = (message.period || Long.UZERO).toString()); + message.rewards !== undefined && + (obj.rewards = message.rewards ? ValidatorHistoricalRewards.toJSON(message.rewards) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): ValidatorHistoricalRewardsRecord { + const message = { ...baseValidatorHistoricalRewardsRecord } as ValidatorHistoricalRewardsRecord; + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = ""; + } + if (object.period !== undefined && object.period !== null) { + message.period = object.period as Long; + } else { + message.period = Long.UZERO; + } + if (object.rewards !== undefined && object.rewards !== null) { + message.rewards = ValidatorHistoricalRewards.fromPartial(object.rewards); + } else { + message.rewards = undefined; + } + return message; + }, +}; + +const baseValidatorCurrentRewardsRecord: object = { validatorAddress: "" }; + +export const ValidatorCurrentRewardsRecord = { + encode(message: ValidatorCurrentRewardsRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + if (message.rewards !== undefined) { + ValidatorCurrentRewards.encode(message.rewards, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorCurrentRewardsRecord { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseValidatorCurrentRewardsRecord } as ValidatorCurrentRewardsRecord; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.rewards = ValidatorCurrentRewards.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ValidatorCurrentRewardsRecord { + const message = { ...baseValidatorCurrentRewardsRecord } as ValidatorCurrentRewardsRecord; + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = String(object.validatorAddress); + } else { + message.validatorAddress = ""; + } + if (object.rewards !== undefined && object.rewards !== null) { + message.rewards = ValidatorCurrentRewards.fromJSON(object.rewards); + } else { + message.rewards = undefined; + } + return message; + }, + + toJSON(message: ValidatorCurrentRewardsRecord): unknown { + const obj: any = {}; + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.rewards !== undefined && + (obj.rewards = message.rewards ? ValidatorCurrentRewards.toJSON(message.rewards) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): ValidatorCurrentRewardsRecord { + const message = { ...baseValidatorCurrentRewardsRecord } as ValidatorCurrentRewardsRecord; + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = ""; + } + if (object.rewards !== undefined && object.rewards !== null) { + message.rewards = ValidatorCurrentRewards.fromPartial(object.rewards); + } else { + message.rewards = undefined; + } + return message; + }, +}; + +const baseDelegatorStartingInfoRecord: object = { delegatorAddress: "", validatorAddress: "" }; + +export const DelegatorStartingInfoRecord = { + encode(message: DelegatorStartingInfoRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + if (message.startingInfo !== undefined) { + DelegatorStartingInfo.encode(message.startingInfo, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DelegatorStartingInfoRecord { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDelegatorStartingInfoRecord } as DelegatorStartingInfoRecord; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.startingInfo = DelegatorStartingInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DelegatorStartingInfoRecord { + const message = { ...baseDelegatorStartingInfoRecord } as DelegatorStartingInfoRecord; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = String(object.delegatorAddress); + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = String(object.validatorAddress); + } else { + message.validatorAddress = ""; + } + if (object.startingInfo !== undefined && object.startingInfo !== null) { + message.startingInfo = DelegatorStartingInfo.fromJSON(object.startingInfo); + } else { + message.startingInfo = undefined; + } + return message; + }, + + toJSON(message: DelegatorStartingInfoRecord): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.startingInfo !== undefined && + (obj.startingInfo = message.startingInfo + ? DelegatorStartingInfo.toJSON(message.startingInfo) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): DelegatorStartingInfoRecord { + const message = { ...baseDelegatorStartingInfoRecord } as DelegatorStartingInfoRecord; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = object.delegatorAddress; + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = ""; + } + if (object.startingInfo !== undefined && object.startingInfo !== null) { + message.startingInfo = DelegatorStartingInfo.fromPartial(object.startingInfo); + } else { + message.startingInfo = undefined; + } + return message; + }, +}; + +const baseValidatorSlashEventRecord: object = { + validatorAddress: "", + height: Long.UZERO, + period: Long.UZERO, +}; + +export const ValidatorSlashEventRecord = { + encode(message: ValidatorSlashEventRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + if (!message.height.isZero()) { + writer.uint32(16).uint64(message.height); + } + if (!message.period.isZero()) { + writer.uint32(24).uint64(message.period); + } + if (message.validatorSlashEvent !== undefined) { + ValidatorSlashEvent.encode(message.validatorSlashEvent, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSlashEventRecord { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseValidatorSlashEventRecord } as ValidatorSlashEventRecord; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.height = reader.uint64() as Long; + break; + case 3: + message.period = reader.uint64() as Long; + break; + case 4: + message.validatorSlashEvent = ValidatorSlashEvent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ValidatorSlashEventRecord { + const message = { ...baseValidatorSlashEventRecord } as ValidatorSlashEventRecord; + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = String(object.validatorAddress); + } else { + message.validatorAddress = ""; + } + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.UZERO; + } + if (object.period !== undefined && object.period !== null) { + message.period = Long.fromString(object.period); + } else { + message.period = Long.UZERO; + } + if (object.validatorSlashEvent !== undefined && object.validatorSlashEvent !== null) { + message.validatorSlashEvent = ValidatorSlashEvent.fromJSON(object.validatorSlashEvent); + } else { + message.validatorSlashEvent = undefined; + } + return message; + }, + + toJSON(message: ValidatorSlashEventRecord): unknown { + const obj: any = {}; + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.height !== undefined && (obj.height = (message.height || Long.UZERO).toString()); + message.period !== undefined && (obj.period = (message.period || Long.UZERO).toString()); + message.validatorSlashEvent !== undefined && + (obj.validatorSlashEvent = message.validatorSlashEvent + ? ValidatorSlashEvent.toJSON(message.validatorSlashEvent) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): ValidatorSlashEventRecord { + const message = { ...baseValidatorSlashEventRecord } as ValidatorSlashEventRecord; + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = ""; + } + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.UZERO; + } + if (object.period !== undefined && object.period !== null) { + message.period = object.period as Long; + } else { + message.period = Long.UZERO; + } + if (object.validatorSlashEvent !== undefined && object.validatorSlashEvent !== null) { + message.validatorSlashEvent = ValidatorSlashEvent.fromPartial(object.validatorSlashEvent); + } else { + message.validatorSlashEvent = undefined; + } + return message; + }, +}; + +const baseGenesisState: object = { previousProposer: "" }; + +export const GenesisState = { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + if (message.feePool !== undefined) { + FeePool.encode(message.feePool, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.delegatorWithdrawInfos) { + DelegatorWithdrawInfo.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.previousProposer !== "") { + writer.uint32(34).string(message.previousProposer); + } + for (const v of message.outstandingRewards) { + ValidatorOutstandingRewardsRecord.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.validatorAccumulatedCommissions) { + ValidatorAccumulatedCommissionRecord.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.validatorHistoricalRewards) { + ValidatorHistoricalRewardsRecord.encode(v!, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.validatorCurrentRewards) { + ValidatorCurrentRewardsRecord.encode(v!, writer.uint32(66).fork()).ldelim(); + } + for (const v of message.delegatorStartingInfos) { + DelegatorStartingInfoRecord.encode(v!, writer.uint32(74).fork()).ldelim(); + } + for (const v of message.validatorSlashEvents) { + ValidatorSlashEventRecord.encode(v!, writer.uint32(82).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGenesisState } as GenesisState; + message.delegatorWithdrawInfos = []; + message.outstandingRewards = []; + message.validatorAccumulatedCommissions = []; + message.validatorHistoricalRewards = []; + message.validatorCurrentRewards = []; + message.delegatorStartingInfos = []; + message.validatorSlashEvents = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.feePool = FeePool.decode(reader, reader.uint32()); + break; + case 3: + message.delegatorWithdrawInfos.push(DelegatorWithdrawInfo.decode(reader, reader.uint32())); + break; + case 4: + message.previousProposer = reader.string(); + break; + case 5: + message.outstandingRewards.push(ValidatorOutstandingRewardsRecord.decode(reader, reader.uint32())); + break; + case 6: + message.validatorAccumulatedCommissions.push( + ValidatorAccumulatedCommissionRecord.decode(reader, reader.uint32()), + ); + break; + case 7: + message.validatorHistoricalRewards.push( + ValidatorHistoricalRewardsRecord.decode(reader, reader.uint32()), + ); + break; + case 8: + message.validatorCurrentRewards.push(ValidatorCurrentRewardsRecord.decode(reader, reader.uint32())); + break; + case 9: + message.delegatorStartingInfos.push(DelegatorStartingInfoRecord.decode(reader, reader.uint32())); + break; + case 10: + message.validatorSlashEvents.push(ValidatorSlashEventRecord.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.delegatorWithdrawInfos = []; + message.outstandingRewards = []; + message.validatorAccumulatedCommissions = []; + message.validatorHistoricalRewards = []; + message.validatorCurrentRewards = []; + message.delegatorStartingInfos = []; + message.validatorSlashEvents = []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + if (object.feePool !== undefined && object.feePool !== null) { + message.feePool = FeePool.fromJSON(object.feePool); + } else { + message.feePool = undefined; + } + if (object.delegatorWithdrawInfos !== undefined && object.delegatorWithdrawInfos !== null) { + for (const e of object.delegatorWithdrawInfos) { + message.delegatorWithdrawInfos.push(DelegatorWithdrawInfo.fromJSON(e)); + } + } + if (object.previousProposer !== undefined && object.previousProposer !== null) { + message.previousProposer = String(object.previousProposer); + } else { + message.previousProposer = ""; + } + if (object.outstandingRewards !== undefined && object.outstandingRewards !== null) { + for (const e of object.outstandingRewards) { + message.outstandingRewards.push(ValidatorOutstandingRewardsRecord.fromJSON(e)); + } + } + if ( + object.validatorAccumulatedCommissions !== undefined && + object.validatorAccumulatedCommissions !== null + ) { + for (const e of object.validatorAccumulatedCommissions) { + message.validatorAccumulatedCommissions.push(ValidatorAccumulatedCommissionRecord.fromJSON(e)); + } + } + if (object.validatorHistoricalRewards !== undefined && object.validatorHistoricalRewards !== null) { + for (const e of object.validatorHistoricalRewards) { + message.validatorHistoricalRewards.push(ValidatorHistoricalRewardsRecord.fromJSON(e)); + } + } + if (object.validatorCurrentRewards !== undefined && object.validatorCurrentRewards !== null) { + for (const e of object.validatorCurrentRewards) { + message.validatorCurrentRewards.push(ValidatorCurrentRewardsRecord.fromJSON(e)); + } + } + if (object.delegatorStartingInfos !== undefined && object.delegatorStartingInfos !== null) { + for (const e of object.delegatorStartingInfos) { + message.delegatorStartingInfos.push(DelegatorStartingInfoRecord.fromJSON(e)); + } + } + if (object.validatorSlashEvents !== undefined && object.validatorSlashEvents !== null) { + for (const e of object.validatorSlashEvents) { + message.validatorSlashEvents.push(ValidatorSlashEventRecord.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + message.feePool !== undefined && + (obj.feePool = message.feePool ? FeePool.toJSON(message.feePool) : undefined); + if (message.delegatorWithdrawInfos) { + obj.delegatorWithdrawInfos = message.delegatorWithdrawInfos.map((e) => + e ? DelegatorWithdrawInfo.toJSON(e) : undefined, + ); + } else { + obj.delegatorWithdrawInfos = []; + } + message.previousProposer !== undefined && (obj.previousProposer = message.previousProposer); + if (message.outstandingRewards) { + obj.outstandingRewards = message.outstandingRewards.map((e) => + e ? ValidatorOutstandingRewardsRecord.toJSON(e) : undefined, + ); + } else { + obj.outstandingRewards = []; + } + if (message.validatorAccumulatedCommissions) { + obj.validatorAccumulatedCommissions = message.validatorAccumulatedCommissions.map((e) => + e ? ValidatorAccumulatedCommissionRecord.toJSON(e) : undefined, + ); + } else { + obj.validatorAccumulatedCommissions = []; + } + if (message.validatorHistoricalRewards) { + obj.validatorHistoricalRewards = message.validatorHistoricalRewards.map((e) => + e ? ValidatorHistoricalRewardsRecord.toJSON(e) : undefined, + ); + } else { + obj.validatorHistoricalRewards = []; + } + if (message.validatorCurrentRewards) { + obj.validatorCurrentRewards = message.validatorCurrentRewards.map((e) => + e ? ValidatorCurrentRewardsRecord.toJSON(e) : undefined, + ); + } else { + obj.validatorCurrentRewards = []; + } + if (message.delegatorStartingInfos) { + obj.delegatorStartingInfos = message.delegatorStartingInfos.map((e) => + e ? DelegatorStartingInfoRecord.toJSON(e) : undefined, + ); + } else { + obj.delegatorStartingInfos = []; + } + if (message.validatorSlashEvents) { + obj.validatorSlashEvents = message.validatorSlashEvents.map((e) => + e ? ValidatorSlashEventRecord.toJSON(e) : undefined, + ); + } else { + obj.validatorSlashEvents = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.delegatorWithdrawInfos = []; + message.outstandingRewards = []; + message.validatorAccumulatedCommissions = []; + message.validatorHistoricalRewards = []; + message.validatorCurrentRewards = []; + message.delegatorStartingInfos = []; + message.validatorSlashEvents = []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + if (object.feePool !== undefined && object.feePool !== null) { + message.feePool = FeePool.fromPartial(object.feePool); + } else { + message.feePool = undefined; + } + if (object.delegatorWithdrawInfos !== undefined && object.delegatorWithdrawInfos !== null) { + for (const e of object.delegatorWithdrawInfos) { + message.delegatorWithdrawInfos.push(DelegatorWithdrawInfo.fromPartial(e)); + } + } + if (object.previousProposer !== undefined && object.previousProposer !== null) { + message.previousProposer = object.previousProposer; + } else { + message.previousProposer = ""; + } + if (object.outstandingRewards !== undefined && object.outstandingRewards !== null) { + for (const e of object.outstandingRewards) { + message.outstandingRewards.push(ValidatorOutstandingRewardsRecord.fromPartial(e)); + } + } + if ( + object.validatorAccumulatedCommissions !== undefined && + object.validatorAccumulatedCommissions !== null + ) { + for (const e of object.validatorAccumulatedCommissions) { + message.validatorAccumulatedCommissions.push(ValidatorAccumulatedCommissionRecord.fromPartial(e)); + } + } + if (object.validatorHistoricalRewards !== undefined && object.validatorHistoricalRewards !== null) { + for (const e of object.validatorHistoricalRewards) { + message.validatorHistoricalRewards.push(ValidatorHistoricalRewardsRecord.fromPartial(e)); + } + } + if (object.validatorCurrentRewards !== undefined && object.validatorCurrentRewards !== null) { + for (const e of object.validatorCurrentRewards) { + message.validatorCurrentRewards.push(ValidatorCurrentRewardsRecord.fromPartial(e)); + } + } + if (object.delegatorStartingInfos !== undefined && object.delegatorStartingInfos !== null) { + for (const e of object.delegatorStartingInfos) { + message.delegatorStartingInfos.push(DelegatorStartingInfoRecord.fromPartial(e)); + } + } + if (object.validatorSlashEvents !== undefined && object.validatorSlashEvents !== null) { + for (const e of object.validatorSlashEvents) { + message.validatorSlashEvents.push(ValidatorSlashEventRecord.fromPartial(e)); + } + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/distribution/v1beta1/query.ts b/src/cosmos/distribution/v1beta1/query.ts new file mode 100644 index 00000000..0fdbfad3 --- /dev/null +++ b/src/cosmos/distribution/v1beta1/query.ts @@ -0,0 +1,1449 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { + Params, + ValidatorOutstandingRewards, + ValidatorAccumulatedCommission, + ValidatorSlashEvent, + DelegationDelegatorReward, +} from "../../../cosmos/distribution/v1beta1/distribution"; +import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; +import { DecCoin } from "../../../cosmos/base/v1beta1/coin"; + +export const protobufPackage = "cosmos.distribution.v1beta1"; + +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} + +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params defines the parameters of the module. */ + params?: Params; +} + +/** + * QueryValidatorOutstandingRewardsRequest is the request type for the + * Query/ValidatorOutstandingRewards RPC method. + */ +export interface QueryValidatorOutstandingRewardsRequest { + /** validator_address defines the validator address to query for. */ + validatorAddress: string; +} + +/** + * QueryValidatorOutstandingRewardsResponse is the response type for the + * Query/ValidatorOutstandingRewards RPC method. + */ +export interface QueryValidatorOutstandingRewardsResponse { + rewards?: ValidatorOutstandingRewards; +} + +/** + * QueryValidatorCommissionRequest is the request type for the + * Query/ValidatorCommission RPC method + */ +export interface QueryValidatorCommissionRequest { + /** validator_address defines the validator address to query for. */ + validatorAddress: string; +} + +/** + * QueryValidatorCommissionResponse is the response type for the + * Query/ValidatorCommission RPC method + */ +export interface QueryValidatorCommissionResponse { + /** commission defines the commision the validator received. */ + commission?: ValidatorAccumulatedCommission; +} + +/** + * QueryValidatorSlashesRequest is the request type for the + * Query/ValidatorSlashes RPC method + */ +export interface QueryValidatorSlashesRequest { + /** validator_address defines the validator address to query for. */ + validatorAddress: string; + /** starting_height defines the optional starting height to query the slashes. */ + startingHeight: Long; + /** starting_height defines the optional ending height to query the slashes. */ + endingHeight: Long; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} + +/** + * QueryValidatorSlashesResponse is the response type for the + * Query/ValidatorSlashes RPC method. + */ +export interface QueryValidatorSlashesResponse { + /** slashes defines the slashes the validator received. */ + slashes: ValidatorSlashEvent[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} + +/** + * QueryDelegationRewardsRequest is the request type for the + * Query/DelegationRewards RPC method. + */ +export interface QueryDelegationRewardsRequest { + /** delegator_address defines the delegator address to query for. */ + delegatorAddress: string; + /** validator_address defines the validator address to query for. */ + validatorAddress: string; +} + +/** + * QueryDelegationRewardsResponse is the response type for the + * Query/DelegationRewards RPC method. + */ +export interface QueryDelegationRewardsResponse { + /** rewards defines the rewards accrued by a delegation. */ + rewards: DecCoin[]; +} + +/** + * QueryDelegationTotalRewardsRequest is the request type for the + * Query/DelegationTotalRewards RPC method. + */ +export interface QueryDelegationTotalRewardsRequest { + /** delegator_address defines the delegator address to query for. */ + delegatorAddress: string; +} + +/** + * QueryDelegationTotalRewardsResponse is the response type for the + * Query/DelegationTotalRewards RPC method. + */ +export interface QueryDelegationTotalRewardsResponse { + /** rewards defines all the rewards accrued by a delegator. */ + rewards: DelegationDelegatorReward[]; + /** total defines the sum of all the rewards. */ + total: DecCoin[]; +} + +/** + * QueryDelegatorValidatorsRequest is the request type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsRequest { + /** delegator_address defines the delegator address to query for. */ + delegatorAddress: string; +} + +/** + * QueryDelegatorValidatorsResponse is the response type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsResponse { + /** validators defines the validators a delegator is delegating for. */ + validators: string[]; +} + +/** + * QueryDelegatorWithdrawAddressRequest is the request type for the + * Query/DelegatorWithdrawAddress RPC method. + */ +export interface QueryDelegatorWithdrawAddressRequest { + /** delegator_address defines the delegator address to query for. */ + delegatorAddress: string; +} + +/** + * QueryDelegatorWithdrawAddressResponse is the response type for the + * Query/DelegatorWithdrawAddress RPC method. + */ +export interface QueryDelegatorWithdrawAddressResponse { + /** withdraw_address defines the delegator address to query for. */ + withdrawAddress: string; +} + +/** + * QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC + * method. + */ +export interface QueryCommunityPoolRequest {} + +/** + * QueryCommunityPoolResponse is the response type for the Query/CommunityPool + * RPC method. + */ +export interface QueryCommunityPoolResponse { + /** pool defines community pool's coins. */ + pool: DecCoin[]; +} + +const baseQueryParamsRequest: object = {}; + +export const QueryParamsRequest = { + encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + return message; + }, + + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + return message; + }, +}; + +const baseQueryParamsResponse: object = {}; + +export const QueryParamsResponse = { + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + return message; + }, + + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + return message; + }, +}; + +const baseQueryValidatorOutstandingRewardsRequest: object = { validatorAddress: "" }; + +export const QueryValidatorOutstandingRewardsRequest = { + encode( + message: QueryValidatorOutstandingRewardsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorOutstandingRewardsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseQueryValidatorOutstandingRewardsRequest, + } as QueryValidatorOutstandingRewardsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryValidatorOutstandingRewardsRequest { + const message = { + ...baseQueryValidatorOutstandingRewardsRequest, + } as QueryValidatorOutstandingRewardsRequest; + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = String(object.validatorAddress); + } else { + message.validatorAddress = ""; + } + return message; + }, + + toJSON(message: QueryValidatorOutstandingRewardsRequest): unknown { + const obj: any = {}; + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + return obj; + }, + + fromPartial( + object: DeepPartial, + ): QueryValidatorOutstandingRewardsRequest { + const message = { + ...baseQueryValidatorOutstandingRewardsRequest, + } as QueryValidatorOutstandingRewardsRequest; + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = ""; + } + return message; + }, +}; + +const baseQueryValidatorOutstandingRewardsResponse: object = {}; + +export const QueryValidatorOutstandingRewardsResponse = { + encode( + message: QueryValidatorOutstandingRewardsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.rewards !== undefined) { + ValidatorOutstandingRewards.encode(message.rewards, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorOutstandingRewardsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseQueryValidatorOutstandingRewardsResponse, + } as QueryValidatorOutstandingRewardsResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rewards = ValidatorOutstandingRewards.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryValidatorOutstandingRewardsResponse { + const message = { + ...baseQueryValidatorOutstandingRewardsResponse, + } as QueryValidatorOutstandingRewardsResponse; + if (object.rewards !== undefined && object.rewards !== null) { + message.rewards = ValidatorOutstandingRewards.fromJSON(object.rewards); + } else { + message.rewards = undefined; + } + return message; + }, + + toJSON(message: QueryValidatorOutstandingRewardsResponse): unknown { + const obj: any = {}; + message.rewards !== undefined && + (obj.rewards = message.rewards ? ValidatorOutstandingRewards.toJSON(message.rewards) : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial, + ): QueryValidatorOutstandingRewardsResponse { + const message = { + ...baseQueryValidatorOutstandingRewardsResponse, + } as QueryValidatorOutstandingRewardsResponse; + if (object.rewards !== undefined && object.rewards !== null) { + message.rewards = ValidatorOutstandingRewards.fromPartial(object.rewards); + } else { + message.rewards = undefined; + } + return message; + }, +}; + +const baseQueryValidatorCommissionRequest: object = { validatorAddress: "" }; + +export const QueryValidatorCommissionRequest = { + encode(message: QueryValidatorCommissionRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorCommissionRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryValidatorCommissionRequest } as QueryValidatorCommissionRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryValidatorCommissionRequest { + const message = { ...baseQueryValidatorCommissionRequest } as QueryValidatorCommissionRequest; + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = String(object.validatorAddress); + } else { + message.validatorAddress = ""; + } + return message; + }, + + toJSON(message: QueryValidatorCommissionRequest): unknown { + const obj: any = {}; + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + return obj; + }, + + fromPartial(object: DeepPartial): QueryValidatorCommissionRequest { + const message = { ...baseQueryValidatorCommissionRequest } as QueryValidatorCommissionRequest; + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = ""; + } + return message; + }, +}; + +const baseQueryValidatorCommissionResponse: object = {}; + +export const QueryValidatorCommissionResponse = { + encode(message: QueryValidatorCommissionResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.commission !== undefined) { + ValidatorAccumulatedCommission.encode(message.commission, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorCommissionResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryValidatorCommissionResponse } as QueryValidatorCommissionResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.commission = ValidatorAccumulatedCommission.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryValidatorCommissionResponse { + const message = { ...baseQueryValidatorCommissionResponse } as QueryValidatorCommissionResponse; + if (object.commission !== undefined && object.commission !== null) { + message.commission = ValidatorAccumulatedCommission.fromJSON(object.commission); + } else { + message.commission = undefined; + } + return message; + }, + + toJSON(message: QueryValidatorCommissionResponse): unknown { + const obj: any = {}; + message.commission !== undefined && + (obj.commission = message.commission + ? ValidatorAccumulatedCommission.toJSON(message.commission) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryValidatorCommissionResponse { + const message = { ...baseQueryValidatorCommissionResponse } as QueryValidatorCommissionResponse; + if (object.commission !== undefined && object.commission !== null) { + message.commission = ValidatorAccumulatedCommission.fromPartial(object.commission); + } else { + message.commission = undefined; + } + return message; + }, +}; + +const baseQueryValidatorSlashesRequest: object = { + validatorAddress: "", + startingHeight: Long.UZERO, + endingHeight: Long.UZERO, +}; + +export const QueryValidatorSlashesRequest = { + encode(message: QueryValidatorSlashesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + if (!message.startingHeight.isZero()) { + writer.uint32(16).uint64(message.startingHeight); + } + if (!message.endingHeight.isZero()) { + writer.uint32(24).uint64(message.endingHeight); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorSlashesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryValidatorSlashesRequest } as QueryValidatorSlashesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + case 2: + message.startingHeight = reader.uint64() as Long; + break; + case 3: + message.endingHeight = reader.uint64() as Long; + break; + case 4: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryValidatorSlashesRequest { + const message = { ...baseQueryValidatorSlashesRequest } as QueryValidatorSlashesRequest; + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = String(object.validatorAddress); + } else { + message.validatorAddress = ""; + } + if (object.startingHeight !== undefined && object.startingHeight !== null) { + message.startingHeight = Long.fromString(object.startingHeight); + } else { + message.startingHeight = Long.UZERO; + } + if (object.endingHeight !== undefined && object.endingHeight !== null) { + message.endingHeight = Long.fromString(object.endingHeight); + } else { + message.endingHeight = Long.UZERO; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryValidatorSlashesRequest): unknown { + const obj: any = {}; + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.startingHeight !== undefined && + (obj.startingHeight = (message.startingHeight || Long.UZERO).toString()); + message.endingHeight !== undefined && + (obj.endingHeight = (message.endingHeight || Long.UZERO).toString()); + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryValidatorSlashesRequest { + const message = { ...baseQueryValidatorSlashesRequest } as QueryValidatorSlashesRequest; + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = ""; + } + if (object.startingHeight !== undefined && object.startingHeight !== null) { + message.startingHeight = object.startingHeight as Long; + } else { + message.startingHeight = Long.UZERO; + } + if (object.endingHeight !== undefined && object.endingHeight !== null) { + message.endingHeight = object.endingHeight as Long; + } else { + message.endingHeight = Long.UZERO; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryValidatorSlashesResponse: object = {}; + +export const QueryValidatorSlashesResponse = { + encode(message: QueryValidatorSlashesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.slashes) { + ValidatorSlashEvent.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorSlashesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryValidatorSlashesResponse } as QueryValidatorSlashesResponse; + message.slashes = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.slashes.push(ValidatorSlashEvent.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryValidatorSlashesResponse { + const message = { ...baseQueryValidatorSlashesResponse } as QueryValidatorSlashesResponse; + message.slashes = []; + if (object.slashes !== undefined && object.slashes !== null) { + for (const e of object.slashes) { + message.slashes.push(ValidatorSlashEvent.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryValidatorSlashesResponse): unknown { + const obj: any = {}; + if (message.slashes) { + obj.slashes = message.slashes.map((e) => (e ? ValidatorSlashEvent.toJSON(e) : undefined)); + } else { + obj.slashes = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryValidatorSlashesResponse { + const message = { ...baseQueryValidatorSlashesResponse } as QueryValidatorSlashesResponse; + message.slashes = []; + if (object.slashes !== undefined && object.slashes !== null) { + for (const e of object.slashes) { + message.slashes.push(ValidatorSlashEvent.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryDelegationRewardsRequest: object = { delegatorAddress: "", validatorAddress: "" }; + +export const QueryDelegationRewardsRequest = { + encode(message: QueryDelegationRewardsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationRewardsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDelegationRewardsRequest } as QueryDelegationRewardsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDelegationRewardsRequest { + const message = { ...baseQueryDelegationRewardsRequest } as QueryDelegationRewardsRequest; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = String(object.delegatorAddress); + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = String(object.validatorAddress); + } else { + message.validatorAddress = ""; + } + return message; + }, + + toJSON(message: QueryDelegationRewardsRequest): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDelegationRewardsRequest { + const message = { ...baseQueryDelegationRewardsRequest } as QueryDelegationRewardsRequest; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = object.delegatorAddress; + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = ""; + } + return message; + }, +}; + +const baseQueryDelegationRewardsResponse: object = {}; + +export const QueryDelegationRewardsResponse = { + encode(message: QueryDelegationRewardsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.rewards) { + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationRewardsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDelegationRewardsResponse } as QueryDelegationRewardsResponse; + message.rewards = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rewards.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDelegationRewardsResponse { + const message = { ...baseQueryDelegationRewardsResponse } as QueryDelegationRewardsResponse; + message.rewards = []; + if (object.rewards !== undefined && object.rewards !== null) { + for (const e of object.rewards) { + message.rewards.push(DecCoin.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: QueryDelegationRewardsResponse): unknown { + const obj: any = {}; + if (message.rewards) { + obj.rewards = message.rewards.map((e) => (e ? DecCoin.toJSON(e) : undefined)); + } else { + obj.rewards = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): QueryDelegationRewardsResponse { + const message = { ...baseQueryDelegationRewardsResponse } as QueryDelegationRewardsResponse; + message.rewards = []; + if (object.rewards !== undefined && object.rewards !== null) { + for (const e of object.rewards) { + message.rewards.push(DecCoin.fromPartial(e)); + } + } + return message; + }, +}; + +const baseQueryDelegationTotalRewardsRequest: object = { delegatorAddress: "" }; + +export const QueryDelegationTotalRewardsRequest = { + encode(message: QueryDelegationTotalRewardsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationTotalRewardsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDelegationTotalRewardsRequest } as QueryDelegationTotalRewardsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDelegationTotalRewardsRequest { + const message = { ...baseQueryDelegationTotalRewardsRequest } as QueryDelegationTotalRewardsRequest; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = String(object.delegatorAddress); + } else { + message.delegatorAddress = ""; + } + return message; + }, + + toJSON(message: QueryDelegationTotalRewardsRequest): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDelegationTotalRewardsRequest { + const message = { ...baseQueryDelegationTotalRewardsRequest } as QueryDelegationTotalRewardsRequest; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = object.delegatorAddress; + } else { + message.delegatorAddress = ""; + } + return message; + }, +}; + +const baseQueryDelegationTotalRewardsResponse: object = {}; + +export const QueryDelegationTotalRewardsResponse = { + encode(message: QueryDelegationTotalRewardsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.rewards) { + DelegationDelegatorReward.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.total) { + DecCoin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationTotalRewardsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDelegationTotalRewardsResponse } as QueryDelegationTotalRewardsResponse; + message.rewards = []; + message.total = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rewards.push(DelegationDelegatorReward.decode(reader, reader.uint32())); + break; + case 2: + message.total.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDelegationTotalRewardsResponse { + const message = { ...baseQueryDelegationTotalRewardsResponse } as QueryDelegationTotalRewardsResponse; + message.rewards = []; + message.total = []; + if (object.rewards !== undefined && object.rewards !== null) { + for (const e of object.rewards) { + message.rewards.push(DelegationDelegatorReward.fromJSON(e)); + } + } + if (object.total !== undefined && object.total !== null) { + for (const e of object.total) { + message.total.push(DecCoin.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: QueryDelegationTotalRewardsResponse): unknown { + const obj: any = {}; + if (message.rewards) { + obj.rewards = message.rewards.map((e) => (e ? DelegationDelegatorReward.toJSON(e) : undefined)); + } else { + obj.rewards = []; + } + if (message.total) { + obj.total = message.total.map((e) => (e ? DecCoin.toJSON(e) : undefined)); + } else { + obj.total = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): QueryDelegationTotalRewardsResponse { + const message = { ...baseQueryDelegationTotalRewardsResponse } as QueryDelegationTotalRewardsResponse; + message.rewards = []; + message.total = []; + if (object.rewards !== undefined && object.rewards !== null) { + for (const e of object.rewards) { + message.rewards.push(DelegationDelegatorReward.fromPartial(e)); + } + } + if (object.total !== undefined && object.total !== null) { + for (const e of object.total) { + message.total.push(DecCoin.fromPartial(e)); + } + } + return message; + }, +}; + +const baseQueryDelegatorValidatorsRequest: object = { delegatorAddress: "" }; + +export const QueryDelegatorValidatorsRequest = { + encode(message: QueryDelegatorValidatorsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDelegatorValidatorsRequest } as QueryDelegatorValidatorsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDelegatorValidatorsRequest { + const message = { ...baseQueryDelegatorValidatorsRequest } as QueryDelegatorValidatorsRequest; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = String(object.delegatorAddress); + } else { + message.delegatorAddress = ""; + } + return message; + }, + + toJSON(message: QueryDelegatorValidatorsRequest): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDelegatorValidatorsRequest { + const message = { ...baseQueryDelegatorValidatorsRequest } as QueryDelegatorValidatorsRequest; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = object.delegatorAddress; + } else { + message.delegatorAddress = ""; + } + return message; + }, +}; + +const baseQueryDelegatorValidatorsResponse: object = { validators: "" }; + +export const QueryDelegatorValidatorsResponse = { + encode(message: QueryDelegatorValidatorsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.validators) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDelegatorValidatorsResponse } as QueryDelegatorValidatorsResponse; + message.validators = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validators.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDelegatorValidatorsResponse { + const message = { ...baseQueryDelegatorValidatorsResponse } as QueryDelegatorValidatorsResponse; + message.validators = []; + if (object.validators !== undefined && object.validators !== null) { + for (const e of object.validators) { + message.validators.push(String(e)); + } + } + return message; + }, + + toJSON(message: QueryDelegatorValidatorsResponse): unknown { + const obj: any = {}; + if (message.validators) { + obj.validators = message.validators.map((e) => e); + } else { + obj.validators = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): QueryDelegatorValidatorsResponse { + const message = { ...baseQueryDelegatorValidatorsResponse } as QueryDelegatorValidatorsResponse; + message.validators = []; + if (object.validators !== undefined && object.validators !== null) { + for (const e of object.validators) { + message.validators.push(e); + } + } + return message; + }, +}; + +const baseQueryDelegatorWithdrawAddressRequest: object = { delegatorAddress: "" }; + +export const QueryDelegatorWithdrawAddressRequest = { + encode( + message: QueryDelegatorWithdrawAddressRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorWithdrawAddressRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDelegatorWithdrawAddressRequest } as QueryDelegatorWithdrawAddressRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDelegatorWithdrawAddressRequest { + const message = { ...baseQueryDelegatorWithdrawAddressRequest } as QueryDelegatorWithdrawAddressRequest; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = String(object.delegatorAddress); + } else { + message.delegatorAddress = ""; + } + return message; + }, + + toJSON(message: QueryDelegatorWithdrawAddressRequest): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + return obj; + }, + + fromPartial( + object: DeepPartial, + ): QueryDelegatorWithdrawAddressRequest { + const message = { ...baseQueryDelegatorWithdrawAddressRequest } as QueryDelegatorWithdrawAddressRequest; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = object.delegatorAddress; + } else { + message.delegatorAddress = ""; + } + return message; + }, +}; + +const baseQueryDelegatorWithdrawAddressResponse: object = { withdrawAddress: "" }; + +export const QueryDelegatorWithdrawAddressResponse = { + encode( + message: QueryDelegatorWithdrawAddressResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.withdrawAddress !== "") { + writer.uint32(10).string(message.withdrawAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorWithdrawAddressResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDelegatorWithdrawAddressResponse } as QueryDelegatorWithdrawAddressResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.withdrawAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDelegatorWithdrawAddressResponse { + const message = { ...baseQueryDelegatorWithdrawAddressResponse } as QueryDelegatorWithdrawAddressResponse; + if (object.withdrawAddress !== undefined && object.withdrawAddress !== null) { + message.withdrawAddress = String(object.withdrawAddress); + } else { + message.withdrawAddress = ""; + } + return message; + }, + + toJSON(message: QueryDelegatorWithdrawAddressResponse): unknown { + const obj: any = {}; + message.withdrawAddress !== undefined && (obj.withdrawAddress = message.withdrawAddress); + return obj; + }, + + fromPartial( + object: DeepPartial, + ): QueryDelegatorWithdrawAddressResponse { + const message = { ...baseQueryDelegatorWithdrawAddressResponse } as QueryDelegatorWithdrawAddressResponse; + if (object.withdrawAddress !== undefined && object.withdrawAddress !== null) { + message.withdrawAddress = object.withdrawAddress; + } else { + message.withdrawAddress = ""; + } + return message; + }, +}; + +const baseQueryCommunityPoolRequest: object = {}; + +export const QueryCommunityPoolRequest = { + encode(_: QueryCommunityPoolRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCommunityPoolRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryCommunityPoolRequest } as QueryCommunityPoolRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryCommunityPoolRequest { + const message = { ...baseQueryCommunityPoolRequest } as QueryCommunityPoolRequest; + return message; + }, + + toJSON(_: QueryCommunityPoolRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): QueryCommunityPoolRequest { + const message = { ...baseQueryCommunityPoolRequest } as QueryCommunityPoolRequest; + return message; + }, +}; + +const baseQueryCommunityPoolResponse: object = {}; + +export const QueryCommunityPoolResponse = { + encode(message: QueryCommunityPoolResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.pool) { + DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCommunityPoolResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryCommunityPoolResponse } as QueryCommunityPoolResponse; + message.pool = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pool.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryCommunityPoolResponse { + const message = { ...baseQueryCommunityPoolResponse } as QueryCommunityPoolResponse; + message.pool = []; + if (object.pool !== undefined && object.pool !== null) { + for (const e of object.pool) { + message.pool.push(DecCoin.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: QueryCommunityPoolResponse): unknown { + const obj: any = {}; + if (message.pool) { + obj.pool = message.pool.map((e) => (e ? DecCoin.toJSON(e) : undefined)); + } else { + obj.pool = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): QueryCommunityPoolResponse { + const message = { ...baseQueryCommunityPoolResponse } as QueryCommunityPoolResponse; + message.pool = []; + if (object.pool !== undefined && object.pool !== null) { + for (const e of object.pool) { + message.pool.push(DecCoin.fromPartial(e)); + } + } + return message; + }, +}; + +/** Query defines the gRPC querier service for distribution module. */ +export interface Query { + /** Params queries params of the distribution module. */ + Params(request: QueryParamsRequest): Promise; + /** ValidatorOutstandingRewards queries rewards of a validator address. */ + ValidatorOutstandingRewards( + request: QueryValidatorOutstandingRewardsRequest, + ): Promise; + /** ValidatorCommission queries accumulated commission for a validator. */ + ValidatorCommission(request: QueryValidatorCommissionRequest): Promise; + /** ValidatorSlashes queries slash events of a validator. */ + ValidatorSlashes(request: QueryValidatorSlashesRequest): Promise; + /** DelegationRewards queries the total rewards accrued by a delegation. */ + DelegationRewards(request: QueryDelegationRewardsRequest): Promise; + /** + * DelegationTotalRewards queries the total rewards accrued by a each + * validator. + */ + DelegationTotalRewards( + request: QueryDelegationTotalRewardsRequest, + ): Promise; + /** DelegatorValidators queries the validators of a delegator. */ + DelegatorValidators(request: QueryDelegatorValidatorsRequest): Promise; + /** DelegatorWithdrawAddress queries withdraw address of a delegator. */ + DelegatorWithdrawAddress( + request: QueryDelegatorWithdrawAddressRequest, + ): Promise; + /** CommunityPool queries the community pool coins. */ + CommunityPool(request: QueryCommunityPoolRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Params = this.Params.bind(this); + this.ValidatorOutstandingRewards = this.ValidatorOutstandingRewards.bind(this); + this.ValidatorCommission = this.ValidatorCommission.bind(this); + this.ValidatorSlashes = this.ValidatorSlashes.bind(this); + this.DelegationRewards = this.DelegationRewards.bind(this); + this.DelegationTotalRewards = this.DelegationTotalRewards.bind(this); + this.DelegatorValidators = this.DelegatorValidators.bind(this); + this.DelegatorWithdrawAddress = this.DelegatorWithdrawAddress.bind(this); + this.CommunityPool = this.CommunityPool.bind(this); + } + Params(request: QueryParamsRequest): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "Params", data); + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + } + + ValidatorOutstandingRewards( + request: QueryValidatorOutstandingRewardsRequest, + ): Promise { + const data = QueryValidatorOutstandingRewardsRequest.encode(request).finish(); + const promise = this.rpc.request( + "cosmos.distribution.v1beta1.Query", + "ValidatorOutstandingRewards", + data, + ); + return promise.then((data) => QueryValidatorOutstandingRewardsResponse.decode(new _m0.Reader(data))); + } + + ValidatorCommission(request: QueryValidatorCommissionRequest): Promise { + const data = QueryValidatorCommissionRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "ValidatorCommission", data); + return promise.then((data) => QueryValidatorCommissionResponse.decode(new _m0.Reader(data))); + } + + ValidatorSlashes(request: QueryValidatorSlashesRequest): Promise { + const data = QueryValidatorSlashesRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "ValidatorSlashes", data); + return promise.then((data) => QueryValidatorSlashesResponse.decode(new _m0.Reader(data))); + } + + DelegationRewards(request: QueryDelegationRewardsRequest): Promise { + const data = QueryDelegationRewardsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "DelegationRewards", data); + return promise.then((data) => QueryDelegationRewardsResponse.decode(new _m0.Reader(data))); + } + + DelegationTotalRewards( + request: QueryDelegationTotalRewardsRequest, + ): Promise { + const data = QueryDelegationTotalRewardsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "DelegationTotalRewards", data); + return promise.then((data) => QueryDelegationTotalRewardsResponse.decode(new _m0.Reader(data))); + } + + DelegatorValidators(request: QueryDelegatorValidatorsRequest): Promise { + const data = QueryDelegatorValidatorsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "DelegatorValidators", data); + return promise.then((data) => QueryDelegatorValidatorsResponse.decode(new _m0.Reader(data))); + } + + DelegatorWithdrawAddress( + request: QueryDelegatorWithdrawAddressRequest, + ): Promise { + const data = QueryDelegatorWithdrawAddressRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "DelegatorWithdrawAddress", data); + return promise.then((data) => QueryDelegatorWithdrawAddressResponse.decode(new _m0.Reader(data))); + } + + CommunityPool(request: QueryCommunityPoolRequest): Promise { + const data = QueryCommunityPoolRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "CommunityPool", data); + return promise.then((data) => QueryCommunityPoolResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/distribution/v1beta1/tx.ts b/src/cosmos/distribution/v1beta1/tx.ts new file mode 100644 index 00000000..349c2971 --- /dev/null +++ b/src/cosmos/distribution/v1beta1/tx.ts @@ -0,0 +1,573 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Coin } from "../../../cosmos/base/v1beta1/coin"; + +export const protobufPackage = "cosmos.distribution.v1beta1"; + +/** + * MsgSetWithdrawAddress sets the withdraw address for + * a delegator (or validator self-delegation). + */ +export interface MsgSetWithdrawAddress { + delegatorAddress: string; + withdrawAddress: string; +} + +/** MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. */ +export interface MsgSetWithdrawAddressResponse {} + +/** + * MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator + * from a single validator. + */ +export interface MsgWithdrawDelegatorReward { + delegatorAddress: string; + validatorAddress: string; +} + +/** MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. */ +export interface MsgWithdrawDelegatorRewardResponse {} + +/** + * MsgWithdrawValidatorCommission withdraws the full commission to the validator + * address. + */ +export interface MsgWithdrawValidatorCommission { + validatorAddress: string; +} + +/** MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. */ +export interface MsgWithdrawValidatorCommissionResponse {} + +/** + * MsgFundCommunityPool allows an account to directly + * fund the community pool. + */ +export interface MsgFundCommunityPool { + amount: Coin[]; + depositor: string; +} + +/** MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. */ +export interface MsgFundCommunityPoolResponse {} + +const baseMsgSetWithdrawAddress: object = { delegatorAddress: "", withdrawAddress: "" }; + +export const MsgSetWithdrawAddress = { + encode(message: MsgSetWithdrawAddress, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.withdrawAddress !== "") { + writer.uint32(18).string(message.withdrawAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetWithdrawAddress { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgSetWithdrawAddress } as MsgSetWithdrawAddress; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.withdrawAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgSetWithdrawAddress { + const message = { ...baseMsgSetWithdrawAddress } as MsgSetWithdrawAddress; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = String(object.delegatorAddress); + } else { + message.delegatorAddress = ""; + } + if (object.withdrawAddress !== undefined && object.withdrawAddress !== null) { + message.withdrawAddress = String(object.withdrawAddress); + } else { + message.withdrawAddress = ""; + } + return message; + }, + + toJSON(message: MsgSetWithdrawAddress): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.withdrawAddress !== undefined && (obj.withdrawAddress = message.withdrawAddress); + return obj; + }, + + fromPartial(object: DeepPartial): MsgSetWithdrawAddress { + const message = { ...baseMsgSetWithdrawAddress } as MsgSetWithdrawAddress; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = object.delegatorAddress; + } else { + message.delegatorAddress = ""; + } + if (object.withdrawAddress !== undefined && object.withdrawAddress !== null) { + message.withdrawAddress = object.withdrawAddress; + } else { + message.withdrawAddress = ""; + } + return message; + }, +}; + +const baseMsgSetWithdrawAddressResponse: object = {}; + +export const MsgSetWithdrawAddressResponse = { + encode(_: MsgSetWithdrawAddressResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetWithdrawAddressResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgSetWithdrawAddressResponse } as MsgSetWithdrawAddressResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgSetWithdrawAddressResponse { + const message = { ...baseMsgSetWithdrawAddressResponse } as MsgSetWithdrawAddressResponse; + return message; + }, + + toJSON(_: MsgSetWithdrawAddressResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgSetWithdrawAddressResponse { + const message = { ...baseMsgSetWithdrawAddressResponse } as MsgSetWithdrawAddressResponse; + return message; + }, +}; + +const baseMsgWithdrawDelegatorReward: object = { delegatorAddress: "", validatorAddress: "" }; + +export const MsgWithdrawDelegatorReward = { + encode(message: MsgWithdrawDelegatorReward, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawDelegatorReward { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgWithdrawDelegatorReward } as MsgWithdrawDelegatorReward; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgWithdrawDelegatorReward { + const message = { ...baseMsgWithdrawDelegatorReward } as MsgWithdrawDelegatorReward; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = String(object.delegatorAddress); + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = String(object.validatorAddress); + } else { + message.validatorAddress = ""; + } + return message; + }, + + toJSON(message: MsgWithdrawDelegatorReward): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + return obj; + }, + + fromPartial(object: DeepPartial): MsgWithdrawDelegatorReward { + const message = { ...baseMsgWithdrawDelegatorReward } as MsgWithdrawDelegatorReward; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = object.delegatorAddress; + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = ""; + } + return message; + }, +}; + +const baseMsgWithdrawDelegatorRewardResponse: object = {}; + +export const MsgWithdrawDelegatorRewardResponse = { + encode(_: MsgWithdrawDelegatorRewardResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawDelegatorRewardResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgWithdrawDelegatorRewardResponse } as MsgWithdrawDelegatorRewardResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgWithdrawDelegatorRewardResponse { + const message = { ...baseMsgWithdrawDelegatorRewardResponse } as MsgWithdrawDelegatorRewardResponse; + return message; + }, + + toJSON(_: MsgWithdrawDelegatorRewardResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgWithdrawDelegatorRewardResponse { + const message = { ...baseMsgWithdrawDelegatorRewardResponse } as MsgWithdrawDelegatorRewardResponse; + return message; + }, +}; + +const baseMsgWithdrawValidatorCommission: object = { validatorAddress: "" }; + +export const MsgWithdrawValidatorCommission = { + encode(message: MsgWithdrawValidatorCommission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawValidatorCommission { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgWithdrawValidatorCommission } as MsgWithdrawValidatorCommission; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgWithdrawValidatorCommission { + const message = { ...baseMsgWithdrawValidatorCommission } as MsgWithdrawValidatorCommission; + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = String(object.validatorAddress); + } else { + message.validatorAddress = ""; + } + return message; + }, + + toJSON(message: MsgWithdrawValidatorCommission): unknown { + const obj: any = {}; + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + return obj; + }, + + fromPartial(object: DeepPartial): MsgWithdrawValidatorCommission { + const message = { ...baseMsgWithdrawValidatorCommission } as MsgWithdrawValidatorCommission; + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = ""; + } + return message; + }, +}; + +const baseMsgWithdrawValidatorCommissionResponse: object = {}; + +export const MsgWithdrawValidatorCommissionResponse = { + encode(_: MsgWithdrawValidatorCommissionResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawValidatorCommissionResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseMsgWithdrawValidatorCommissionResponse, + } as MsgWithdrawValidatorCommissionResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgWithdrawValidatorCommissionResponse { + const message = { + ...baseMsgWithdrawValidatorCommissionResponse, + } as MsgWithdrawValidatorCommissionResponse; + return message; + }, + + toJSON(_: MsgWithdrawValidatorCommissionResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial( + _: DeepPartial, + ): MsgWithdrawValidatorCommissionResponse { + const message = { + ...baseMsgWithdrawValidatorCommissionResponse, + } as MsgWithdrawValidatorCommissionResponse; + return message; + }, +}; + +const baseMsgFundCommunityPool: object = { depositor: "" }; + +export const MsgFundCommunityPool = { + encode(message: MsgFundCommunityPool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.depositor !== "") { + writer.uint32(18).string(message.depositor); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgFundCommunityPool { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgFundCommunityPool } as MsgFundCommunityPool; + message.amount = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.depositor = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgFundCommunityPool { + const message = { ...baseMsgFundCommunityPool } as MsgFundCommunityPool; + message.amount = []; + if (object.amount !== undefined && object.amount !== null) { + for (const e of object.amount) { + message.amount.push(Coin.fromJSON(e)); + } + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = String(object.depositor); + } else { + message.depositor = ""; + } + return message; + }, + + toJSON(message: MsgFundCommunityPool): unknown { + const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.amount = []; + } + message.depositor !== undefined && (obj.depositor = message.depositor); + return obj; + }, + + fromPartial(object: DeepPartial): MsgFundCommunityPool { + const message = { ...baseMsgFundCommunityPool } as MsgFundCommunityPool; + message.amount = []; + if (object.amount !== undefined && object.amount !== null) { + for (const e of object.amount) { + message.amount.push(Coin.fromPartial(e)); + } + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } else { + message.depositor = ""; + } + return message; + }, +}; + +const baseMsgFundCommunityPoolResponse: object = {}; + +export const MsgFundCommunityPoolResponse = { + encode(_: MsgFundCommunityPoolResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgFundCommunityPoolResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgFundCommunityPoolResponse } as MsgFundCommunityPoolResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgFundCommunityPoolResponse { + const message = { ...baseMsgFundCommunityPoolResponse } as MsgFundCommunityPoolResponse; + return message; + }, + + toJSON(_: MsgFundCommunityPoolResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgFundCommunityPoolResponse { + const message = { ...baseMsgFundCommunityPoolResponse } as MsgFundCommunityPoolResponse; + return message; + }, +}; + +/** Msg defines the distribution Msg service. */ +export interface Msg { + /** + * SetWithdrawAddress defines a method to change the withdraw address + * for a delegator (or validator self-delegation). + */ + SetWithdrawAddress(request: MsgSetWithdrawAddress): Promise; + /** + * WithdrawDelegatorReward defines a method to withdraw rewards of delegator + * from a single validator. + */ + WithdrawDelegatorReward(request: MsgWithdrawDelegatorReward): Promise; + /** + * WithdrawValidatorCommission defines a method to withdraw the + * full commission to the validator address. + */ + WithdrawValidatorCommission( + request: MsgWithdrawValidatorCommission, + ): Promise; + /** + * FundCommunityPool defines a method to allow an account to directly + * fund the community pool. + */ + FundCommunityPool(request: MsgFundCommunityPool): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.SetWithdrawAddress = this.SetWithdrawAddress.bind(this); + this.WithdrawDelegatorReward = this.WithdrawDelegatorReward.bind(this); + this.WithdrawValidatorCommission = this.WithdrawValidatorCommission.bind(this); + this.FundCommunityPool = this.FundCommunityPool.bind(this); + } + SetWithdrawAddress(request: MsgSetWithdrawAddress): Promise { + const data = MsgSetWithdrawAddress.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "SetWithdrawAddress", data); + return promise.then((data) => MsgSetWithdrawAddressResponse.decode(new _m0.Reader(data))); + } + + WithdrawDelegatorReward(request: MsgWithdrawDelegatorReward): Promise { + const data = MsgWithdrawDelegatorReward.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "WithdrawDelegatorReward", data); + return promise.then((data) => MsgWithdrawDelegatorRewardResponse.decode(new _m0.Reader(data))); + } + + WithdrawValidatorCommission( + request: MsgWithdrawValidatorCommission, + ): Promise { + const data = MsgWithdrawValidatorCommission.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "WithdrawValidatorCommission", data); + return promise.then((data) => MsgWithdrawValidatorCommissionResponse.decode(new _m0.Reader(data))); + } + + FundCommunityPool(request: MsgFundCommunityPool): Promise { + const data = MsgFundCommunityPool.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "FundCommunityPool", data); + return promise.then((data) => MsgFundCommunityPoolResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/evidence/v1beta1/evidence.ts b/src/cosmos/evidence/v1beta1/evidence.ts new file mode 100644 index 00000000..80b96cd1 --- /dev/null +++ b/src/cosmos/evidence/v1beta1/evidence.ts @@ -0,0 +1,165 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../../google/protobuf/timestamp"; + +export const protobufPackage = "cosmos.evidence.v1beta1"; + +/** + * Equivocation implements the Evidence interface and defines evidence of double + * signing misbehavior. + */ +export interface Equivocation { + height: Long; + time?: Date; + power: Long; + consensusAddress: string; +} + +const baseEquivocation: object = { height: Long.ZERO, power: Long.ZERO, consensusAddress: "" }; + +export const Equivocation = { + encode(message: Equivocation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.height.isZero()) { + writer.uint32(8).int64(message.height); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(18).fork()).ldelim(); + } + if (!message.power.isZero()) { + writer.uint32(24).int64(message.power); + } + if (message.consensusAddress !== "") { + writer.uint32(34).string(message.consensusAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Equivocation { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEquivocation } as Equivocation; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64() as Long; + break; + case 2: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 3: + message.power = reader.int64() as Long; + break; + case 4: + message.consensusAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Equivocation { + const message = { ...baseEquivocation } as Equivocation; + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.ZERO; + } + if (object.time !== undefined && object.time !== null) { + message.time = fromJsonTimestamp(object.time); + } else { + message.time = undefined; + } + if (object.power !== undefined && object.power !== null) { + message.power = Long.fromString(object.power); + } else { + message.power = Long.ZERO; + } + if (object.consensusAddress !== undefined && object.consensusAddress !== null) { + message.consensusAddress = String(object.consensusAddress); + } else { + message.consensusAddress = ""; + } + return message; + }, + + toJSON(message: Equivocation): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.time !== undefined && (obj.time = message.time.toISOString()); + message.power !== undefined && (obj.power = (message.power || Long.ZERO).toString()); + message.consensusAddress !== undefined && (obj.consensusAddress = message.consensusAddress); + return obj; + }, + + fromPartial(object: DeepPartial): Equivocation { + const message = { ...baseEquivocation } as Equivocation; + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.ZERO; + } + if (object.time !== undefined && object.time !== null) { + message.time = object.time; + } else { + message.time = undefined; + } + if (object.power !== undefined && object.power !== null) { + message.power = object.power as Long; + } else { + message.power = Long.ZERO; + } + if (object.consensusAddress !== undefined && object.consensusAddress !== null) { + message.consensusAddress = object.consensusAddress; + } else { + message.consensusAddress = ""; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function toTimestamp(date: Date): Timestamp { + const seconds = numberToLong(date.getTime() / 1_000); + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds.toNumber() * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function numberToLong(number: number) { + return Long.fromNumber(number); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/evidence/v1beta1/genesis.ts b/src/cosmos/evidence/v1beta1/genesis.ts new file mode 100644 index 00000000..b05d3715 --- /dev/null +++ b/src/cosmos/evidence/v1beta1/genesis.ts @@ -0,0 +1,90 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Any } from "../../../google/protobuf/any"; + +export const protobufPackage = "cosmos.evidence.v1beta1"; + +/** GenesisState defines the evidence module's genesis state. */ +export interface GenesisState { + /** evidence defines all the evidence at genesis. */ + evidence: Any[]; +} + +const baseGenesisState: object = {}; + +export const GenesisState = { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.evidence) { + Any.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGenesisState } as GenesisState; + message.evidence = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.evidence.push(Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.evidence = []; + if (object.evidence !== undefined && object.evidence !== null) { + for (const e of object.evidence) { + message.evidence.push(Any.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.evidence) { + obj.evidence = message.evidence.map((e) => (e ? Any.toJSON(e) : undefined)); + } else { + obj.evidence = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.evidence = []; + if (object.evidence !== undefined && object.evidence !== null) { + for (const e of object.evidence) { + message.evidence.push(Any.fromPartial(e)); + } + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/evidence/v1beta1/query.ts b/src/cosmos/evidence/v1beta1/query.ts new file mode 100644 index 00000000..88bfdcfd --- /dev/null +++ b/src/cosmos/evidence/v1beta1/query.ts @@ -0,0 +1,368 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Any } from "../../../google/protobuf/any"; +import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; + +export const protobufPackage = "cosmos.evidence.v1beta1"; + +/** QueryEvidenceRequest is the request type for the Query/Evidence RPC method. */ +export interface QueryEvidenceRequest { + /** evidence_hash defines the hash of the requested evidence. */ + evidenceHash: Uint8Array; +} + +/** QueryEvidenceResponse is the response type for the Query/Evidence RPC method. */ +export interface QueryEvidenceResponse { + /** evidence returns the requested evidence. */ + evidence?: Any; +} + +/** + * QueryEvidenceRequest is the request type for the Query/AllEvidence RPC + * method. + */ +export interface QueryAllEvidenceRequest { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} + +/** + * QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC + * method. + */ +export interface QueryAllEvidenceResponse { + /** evidence returns all evidences. */ + evidence: Any[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} + +const baseQueryEvidenceRequest: object = {}; + +export const QueryEvidenceRequest = { + encode(message: QueryEvidenceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.evidenceHash.length !== 0) { + writer.uint32(10).bytes(message.evidenceHash); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryEvidenceRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryEvidenceRequest } as QueryEvidenceRequest; + message.evidenceHash = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.evidenceHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryEvidenceRequest { + const message = { ...baseQueryEvidenceRequest } as QueryEvidenceRequest; + message.evidenceHash = new Uint8Array(); + if (object.evidenceHash !== undefined && object.evidenceHash !== null) { + message.evidenceHash = bytesFromBase64(object.evidenceHash); + } + return message; + }, + + toJSON(message: QueryEvidenceRequest): unknown { + const obj: any = {}; + message.evidenceHash !== undefined && + (obj.evidenceHash = base64FromBytes( + message.evidenceHash !== undefined ? message.evidenceHash : new Uint8Array(), + )); + return obj; + }, + + fromPartial(object: DeepPartial): QueryEvidenceRequest { + const message = { ...baseQueryEvidenceRequest } as QueryEvidenceRequest; + if (object.evidenceHash !== undefined && object.evidenceHash !== null) { + message.evidenceHash = object.evidenceHash; + } else { + message.evidenceHash = new Uint8Array(); + } + return message; + }, +}; + +const baseQueryEvidenceResponse: object = {}; + +export const QueryEvidenceResponse = { + encode(message: QueryEvidenceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.evidence !== undefined) { + Any.encode(message.evidence, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryEvidenceResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryEvidenceResponse } as QueryEvidenceResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.evidence = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryEvidenceResponse { + const message = { ...baseQueryEvidenceResponse } as QueryEvidenceResponse; + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = Any.fromJSON(object.evidence); + } else { + message.evidence = undefined; + } + return message; + }, + + toJSON(message: QueryEvidenceResponse): unknown { + const obj: any = {}; + message.evidence !== undefined && + (obj.evidence = message.evidence ? Any.toJSON(message.evidence) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryEvidenceResponse { + const message = { ...baseQueryEvidenceResponse } as QueryEvidenceResponse; + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = Any.fromPartial(object.evidence); + } else { + message.evidence = undefined; + } + return message; + }, +}; + +const baseQueryAllEvidenceRequest: object = {}; + +export const QueryAllEvidenceRequest = { + encode(message: QueryAllEvidenceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllEvidenceRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryAllEvidenceRequest } as QueryAllEvidenceRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllEvidenceRequest { + const message = { ...baseQueryAllEvidenceRequest } as QueryAllEvidenceRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryAllEvidenceRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryAllEvidenceRequest { + const message = { ...baseQueryAllEvidenceRequest } as QueryAllEvidenceRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryAllEvidenceResponse: object = {}; + +export const QueryAllEvidenceResponse = { + encode(message: QueryAllEvidenceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.evidence) { + Any.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllEvidenceResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryAllEvidenceResponse } as QueryAllEvidenceResponse; + message.evidence = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.evidence.push(Any.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllEvidenceResponse { + const message = { ...baseQueryAllEvidenceResponse } as QueryAllEvidenceResponse; + message.evidence = []; + if (object.evidence !== undefined && object.evidence !== null) { + for (const e of object.evidence) { + message.evidence.push(Any.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryAllEvidenceResponse): unknown { + const obj: any = {}; + if (message.evidence) { + obj.evidence = message.evidence.map((e) => (e ? Any.toJSON(e) : undefined)); + } else { + obj.evidence = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryAllEvidenceResponse { + const message = { ...baseQueryAllEvidenceResponse } as QueryAllEvidenceResponse; + message.evidence = []; + if (object.evidence !== undefined && object.evidence !== null) { + for (const e of object.evidence) { + message.evidence.push(Any.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +/** Query defines the gRPC querier service. */ +export interface Query { + /** Evidence queries evidence based on evidence hash. */ + Evidence(request: QueryEvidenceRequest): Promise; + /** AllEvidence queries all evidence. */ + AllEvidence(request: QueryAllEvidenceRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Evidence = this.Evidence.bind(this); + this.AllEvidence = this.AllEvidence.bind(this); + } + Evidence(request: QueryEvidenceRequest): Promise { + const data = QueryEvidenceRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.evidence.v1beta1.Query", "Evidence", data); + return promise.then((data) => QueryEvidenceResponse.decode(new _m0.Reader(data))); + } + + AllEvidence(request: QueryAllEvidenceRequest): Promise { + const data = QueryAllEvidenceRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.evidence.v1beta1.Query", "AllEvidence", data); + return promise.then((data) => QueryAllEvidenceResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/evidence/v1beta1/tx.ts b/src/cosmos/evidence/v1beta1/tx.ts new file mode 100644 index 00000000..448a96af --- /dev/null +++ b/src/cosmos/evidence/v1beta1/tx.ts @@ -0,0 +1,223 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Any } from "../../../google/protobuf/any"; + +export const protobufPackage = "cosmos.evidence.v1beta1"; + +/** + * MsgSubmitEvidence represents a message that supports submitting arbitrary + * Evidence of misbehavior such as equivocation or counterfactual signing. + */ +export interface MsgSubmitEvidence { + submitter: string; + evidence?: Any; +} + +/** MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. */ +export interface MsgSubmitEvidenceResponse { + /** hash defines the hash of the evidence. */ + hash: Uint8Array; +} + +const baseMsgSubmitEvidence: object = { submitter: "" }; + +export const MsgSubmitEvidence = { + encode(message: MsgSubmitEvidence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.submitter !== "") { + writer.uint32(10).string(message.submitter); + } + if (message.evidence !== undefined) { + Any.encode(message.evidence, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitEvidence { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgSubmitEvidence } as MsgSubmitEvidence; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.submitter = reader.string(); + break; + case 2: + message.evidence = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgSubmitEvidence { + const message = { ...baseMsgSubmitEvidence } as MsgSubmitEvidence; + if (object.submitter !== undefined && object.submitter !== null) { + message.submitter = String(object.submitter); + } else { + message.submitter = ""; + } + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = Any.fromJSON(object.evidence); + } else { + message.evidence = undefined; + } + return message; + }, + + toJSON(message: MsgSubmitEvidence): unknown { + const obj: any = {}; + message.submitter !== undefined && (obj.submitter = message.submitter); + message.evidence !== undefined && + (obj.evidence = message.evidence ? Any.toJSON(message.evidence) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): MsgSubmitEvidence { + const message = { ...baseMsgSubmitEvidence } as MsgSubmitEvidence; + if (object.submitter !== undefined && object.submitter !== null) { + message.submitter = object.submitter; + } else { + message.submitter = ""; + } + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = Any.fromPartial(object.evidence); + } else { + message.evidence = undefined; + } + return message; + }, +}; + +const baseMsgSubmitEvidenceResponse: object = {}; + +export const MsgSubmitEvidenceResponse = { + encode(message: MsgSubmitEvidenceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.hash.length !== 0) { + writer.uint32(34).bytes(message.hash); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitEvidenceResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgSubmitEvidenceResponse } as MsgSubmitEvidenceResponse; + message.hash = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.hash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgSubmitEvidenceResponse { + const message = { ...baseMsgSubmitEvidenceResponse } as MsgSubmitEvidenceResponse; + message.hash = new Uint8Array(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + return message; + }, + + toJSON(message: MsgSubmitEvidenceResponse): unknown { + const obj: any = {}; + message.hash !== undefined && + (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): MsgSubmitEvidenceResponse { + const message = { ...baseMsgSubmitEvidenceResponse } as MsgSubmitEvidenceResponse; + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } else { + message.hash = new Uint8Array(); + } + return message; + }, +}; + +/** Msg defines the evidence Msg service. */ +export interface Msg { + /** + * SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or + * counterfactual signing. + */ + SubmitEvidence(request: MsgSubmitEvidence): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.SubmitEvidence = this.SubmitEvidence.bind(this); + } + SubmitEvidence(request: MsgSubmitEvidence): Promise { + const data = MsgSubmitEvidence.encode(request).finish(); + const promise = this.rpc.request("cosmos.evidence.v1beta1.Msg", "SubmitEvidence", data); + return promise.then((data) => MsgSubmitEvidenceResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/genutil/v1beta1/genesis.ts b/src/cosmos/genutil/v1beta1/genesis.ts new file mode 100644 index 00000000..14c3a205 --- /dev/null +++ b/src/cosmos/genutil/v1beta1/genesis.ts @@ -0,0 +1,120 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.genutil.v1beta1"; + +/** GenesisState defines the raw genesis transaction in JSON. */ +export interface GenesisState { + /** gen_txs defines the genesis transactions. */ + genTxs: Uint8Array[]; +} + +const baseGenesisState: object = {}; + +export const GenesisState = { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.genTxs) { + writer.uint32(10).bytes(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGenesisState } as GenesisState; + message.genTxs = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.genTxs.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.genTxs = []; + if (object.genTxs !== undefined && object.genTxs !== null) { + for (const e of object.genTxs) { + message.genTxs.push(bytesFromBase64(e)); + } + } + return message; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.genTxs) { + obj.genTxs = message.genTxs.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.genTxs = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.genTxs = []; + if (object.genTxs !== undefined && object.genTxs !== null) { + for (const e of object.genTxs) { + message.genTxs.push(e); + } + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/gov/v1beta1/genesis.ts b/src/cosmos/gov/v1beta1/genesis.ts new file mode 100644 index 00000000..85ccc917 --- /dev/null +++ b/src/cosmos/gov/v1beta1/genesis.ts @@ -0,0 +1,229 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { + DepositParams, + VotingParams, + TallyParams, + Deposit, + Vote, + Proposal, +} from "../../../cosmos/gov/v1beta1/gov"; + +export const protobufPackage = "cosmos.gov.v1beta1"; + +/** GenesisState defines the gov module's genesis state. */ +export interface GenesisState { + /** starting_proposal_id is the ID of the starting proposal. */ + startingProposalId: Long; + /** deposits defines all the deposits present at genesis. */ + deposits: Deposit[]; + /** votes defines all the votes present at genesis. */ + votes: Vote[]; + /** proposals defines all the proposals present at genesis. */ + proposals: Proposal[]; + /** params defines all the paramaters of related to deposit. */ + depositParams?: DepositParams; + /** params defines all the paramaters of related to voting. */ + votingParams?: VotingParams; + /** params defines all the paramaters of related to tally. */ + tallyParams?: TallyParams; +} + +const baseGenesisState: object = { startingProposalId: Long.UZERO }; + +export const GenesisState = { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.startingProposalId.isZero()) { + writer.uint32(8).uint64(message.startingProposalId); + } + for (const v of message.deposits) { + Deposit.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.votes) { + Vote.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.proposals) { + Proposal.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.depositParams !== undefined) { + DepositParams.encode(message.depositParams, writer.uint32(42).fork()).ldelim(); + } + if (message.votingParams !== undefined) { + VotingParams.encode(message.votingParams, writer.uint32(50).fork()).ldelim(); + } + if (message.tallyParams !== undefined) { + TallyParams.encode(message.tallyParams, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGenesisState } as GenesisState; + message.deposits = []; + message.votes = []; + message.proposals = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startingProposalId = reader.uint64() as Long; + break; + case 2: + message.deposits.push(Deposit.decode(reader, reader.uint32())); + break; + case 3: + message.votes.push(Vote.decode(reader, reader.uint32())); + break; + case 4: + message.proposals.push(Proposal.decode(reader, reader.uint32())); + break; + case 5: + message.depositParams = DepositParams.decode(reader, reader.uint32()); + break; + case 6: + message.votingParams = VotingParams.decode(reader, reader.uint32()); + break; + case 7: + message.tallyParams = TallyParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.deposits = []; + message.votes = []; + message.proposals = []; + if (object.startingProposalId !== undefined && object.startingProposalId !== null) { + message.startingProposalId = Long.fromString(object.startingProposalId); + } else { + message.startingProposalId = Long.UZERO; + } + if (object.deposits !== undefined && object.deposits !== null) { + for (const e of object.deposits) { + message.deposits.push(Deposit.fromJSON(e)); + } + } + if (object.votes !== undefined && object.votes !== null) { + for (const e of object.votes) { + message.votes.push(Vote.fromJSON(e)); + } + } + if (object.proposals !== undefined && object.proposals !== null) { + for (const e of object.proposals) { + message.proposals.push(Proposal.fromJSON(e)); + } + } + if (object.depositParams !== undefined && object.depositParams !== null) { + message.depositParams = DepositParams.fromJSON(object.depositParams); + } else { + message.depositParams = undefined; + } + if (object.votingParams !== undefined && object.votingParams !== null) { + message.votingParams = VotingParams.fromJSON(object.votingParams); + } else { + message.votingParams = undefined; + } + if (object.tallyParams !== undefined && object.tallyParams !== null) { + message.tallyParams = TallyParams.fromJSON(object.tallyParams); + } else { + message.tallyParams = undefined; + } + return message; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.startingProposalId !== undefined && + (obj.startingProposalId = (message.startingProposalId || Long.UZERO).toString()); + if (message.deposits) { + obj.deposits = message.deposits.map((e) => (e ? Deposit.toJSON(e) : undefined)); + } else { + obj.deposits = []; + } + if (message.votes) { + obj.votes = message.votes.map((e) => (e ? Vote.toJSON(e) : undefined)); + } else { + obj.votes = []; + } + if (message.proposals) { + obj.proposals = message.proposals.map((e) => (e ? Proposal.toJSON(e) : undefined)); + } else { + obj.proposals = []; + } + message.depositParams !== undefined && + (obj.depositParams = message.depositParams ? DepositParams.toJSON(message.depositParams) : undefined); + message.votingParams !== undefined && + (obj.votingParams = message.votingParams ? VotingParams.toJSON(message.votingParams) : undefined); + message.tallyParams !== undefined && + (obj.tallyParams = message.tallyParams ? TallyParams.toJSON(message.tallyParams) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.deposits = []; + message.votes = []; + message.proposals = []; + if (object.startingProposalId !== undefined && object.startingProposalId !== null) { + message.startingProposalId = object.startingProposalId as Long; + } else { + message.startingProposalId = Long.UZERO; + } + if (object.deposits !== undefined && object.deposits !== null) { + for (const e of object.deposits) { + message.deposits.push(Deposit.fromPartial(e)); + } + } + if (object.votes !== undefined && object.votes !== null) { + for (const e of object.votes) { + message.votes.push(Vote.fromPartial(e)); + } + } + if (object.proposals !== undefined && object.proposals !== null) { + for (const e of object.proposals) { + message.proposals.push(Proposal.fromPartial(e)); + } + } + if (object.depositParams !== undefined && object.depositParams !== null) { + message.depositParams = DepositParams.fromPartial(object.depositParams); + } else { + message.depositParams = undefined; + } + if (object.votingParams !== undefined && object.votingParams !== null) { + message.votingParams = VotingParams.fromPartial(object.votingParams); + } else { + message.votingParams = undefined; + } + if (object.tallyParams !== undefined && object.tallyParams !== null) { + message.tallyParams = TallyParams.fromPartial(object.tallyParams); + } else { + message.tallyParams = undefined; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/gov/v1beta1/gov.ts b/src/cosmos/gov/v1beta1/gov.ts new file mode 100644 index 00000000..915962e8 --- /dev/null +++ b/src/cosmos/gov/v1beta1/gov.ts @@ -0,0 +1,1183 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Any } from "../../../google/protobuf/any"; +import { Duration } from "../../../google/protobuf/duration"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Coin } from "../../../cosmos/base/v1beta1/coin"; + +export const protobufPackage = "cosmos.gov.v1beta1"; + +/** VoteOption enumerates the valid vote options for a given governance proposal. */ +export enum VoteOption { + /** VOTE_OPTION_UNSPECIFIED - VOTE_OPTION_UNSPECIFIED defines a no-op vote option. */ + VOTE_OPTION_UNSPECIFIED = 0, + /** VOTE_OPTION_YES - VOTE_OPTION_YES defines a yes vote option. */ + VOTE_OPTION_YES = 1, + /** VOTE_OPTION_ABSTAIN - VOTE_OPTION_ABSTAIN defines an abstain vote option. */ + VOTE_OPTION_ABSTAIN = 2, + /** VOTE_OPTION_NO - VOTE_OPTION_NO defines a no vote option. */ + VOTE_OPTION_NO = 3, + /** VOTE_OPTION_NO_WITH_VETO - VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. */ + VOTE_OPTION_NO_WITH_VETO = 4, + UNRECOGNIZED = -1, +} + +export function voteOptionFromJSON(object: any): VoteOption { + switch (object) { + case 0: + case "VOTE_OPTION_UNSPECIFIED": + return VoteOption.VOTE_OPTION_UNSPECIFIED; + case 1: + case "VOTE_OPTION_YES": + return VoteOption.VOTE_OPTION_YES; + case 2: + case "VOTE_OPTION_ABSTAIN": + return VoteOption.VOTE_OPTION_ABSTAIN; + case 3: + case "VOTE_OPTION_NO": + return VoteOption.VOTE_OPTION_NO; + case 4: + case "VOTE_OPTION_NO_WITH_VETO": + return VoteOption.VOTE_OPTION_NO_WITH_VETO; + case -1: + case "UNRECOGNIZED": + default: + return VoteOption.UNRECOGNIZED; + } +} + +export function voteOptionToJSON(object: VoteOption): string { + switch (object) { + case VoteOption.VOTE_OPTION_UNSPECIFIED: + return "VOTE_OPTION_UNSPECIFIED"; + case VoteOption.VOTE_OPTION_YES: + return "VOTE_OPTION_YES"; + case VoteOption.VOTE_OPTION_ABSTAIN: + return "VOTE_OPTION_ABSTAIN"; + case VoteOption.VOTE_OPTION_NO: + return "VOTE_OPTION_NO"; + case VoteOption.VOTE_OPTION_NO_WITH_VETO: + return "VOTE_OPTION_NO_WITH_VETO"; + default: + return "UNKNOWN"; + } +} + +/** ProposalStatus enumerates the valid statuses of a proposal. */ +export enum ProposalStatus { + /** PROPOSAL_STATUS_UNSPECIFIED - PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. */ + PROPOSAL_STATUS_UNSPECIFIED = 0, + /** + * PROPOSAL_STATUS_DEPOSIT_PERIOD - PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + * period. + */ + PROPOSAL_STATUS_DEPOSIT_PERIOD = 1, + /** + * PROPOSAL_STATUS_VOTING_PERIOD - PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + * period. + */ + PROPOSAL_STATUS_VOTING_PERIOD = 2, + /** + * PROPOSAL_STATUS_PASSED - PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + * passed. + */ + PROPOSAL_STATUS_PASSED = 3, + /** + * PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + * been rejected. + */ + PROPOSAL_STATUS_REJECTED = 4, + /** + * PROPOSAL_STATUS_FAILED - PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + * failed. + */ + PROPOSAL_STATUS_FAILED = 5, + UNRECOGNIZED = -1, +} + +export function proposalStatusFromJSON(object: any): ProposalStatus { + switch (object) { + case 0: + case "PROPOSAL_STATUS_UNSPECIFIED": + return ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED; + case 1: + case "PROPOSAL_STATUS_DEPOSIT_PERIOD": + return ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD; + case 2: + case "PROPOSAL_STATUS_VOTING_PERIOD": + return ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD; + case 3: + case "PROPOSAL_STATUS_PASSED": + return ProposalStatus.PROPOSAL_STATUS_PASSED; + case 4: + case "PROPOSAL_STATUS_REJECTED": + return ProposalStatus.PROPOSAL_STATUS_REJECTED; + case 5: + case "PROPOSAL_STATUS_FAILED": + return ProposalStatus.PROPOSAL_STATUS_FAILED; + case -1: + case "UNRECOGNIZED": + default: + return ProposalStatus.UNRECOGNIZED; + } +} + +export function proposalStatusToJSON(object: ProposalStatus): string { + switch (object) { + case ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED: + return "PROPOSAL_STATUS_UNSPECIFIED"; + case ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD: + return "PROPOSAL_STATUS_DEPOSIT_PERIOD"; + case ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD: + return "PROPOSAL_STATUS_VOTING_PERIOD"; + case ProposalStatus.PROPOSAL_STATUS_PASSED: + return "PROPOSAL_STATUS_PASSED"; + case ProposalStatus.PROPOSAL_STATUS_REJECTED: + return "PROPOSAL_STATUS_REJECTED"; + case ProposalStatus.PROPOSAL_STATUS_FAILED: + return "PROPOSAL_STATUS_FAILED"; + default: + return "UNKNOWN"; + } +} + +/** WeightedVoteOption defines a unit of vote for vote split. */ +export interface WeightedVoteOption { + option: VoteOption; + weight: string; +} + +/** + * TextProposal defines a standard text proposal whose changes need to be + * manually updated in case of approval. + */ +export interface TextProposal { + title: string; + description: string; +} + +/** + * Deposit defines an amount deposited by an account address to an active + * proposal. + */ +export interface Deposit { + proposalId: Long; + depositor: string; + amount: Coin[]; +} + +/** Proposal defines the core field members of a governance proposal. */ +export interface Proposal { + proposalId: Long; + content?: Any; + status: ProposalStatus; + finalTallyResult?: TallyResult; + submitTime?: Date; + depositEndTime?: Date; + totalDeposit: Coin[]; + votingStartTime?: Date; + votingEndTime?: Date; +} + +/** TallyResult defines a standard tally for a governance proposal. */ +export interface TallyResult { + yes: string; + abstain: string; + no: string; + noWithVeto: string; +} + +/** + * Vote defines a vote on a governance proposal. + * A Vote consists of a proposal ID, the voter, and the vote option. + */ +export interface Vote { + proposalId: Long; + voter: string; + options: WeightedVoteOption[]; +} + +/** DepositParams defines the params for deposits on governance proposals. */ +export interface DepositParams { + /** Minimum deposit for a proposal to enter voting period. */ + minDeposit: Coin[]; + /** + * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + * months. + */ + maxDepositPeriod?: Duration; +} + +/** VotingParams defines the params for voting on governance proposals. */ +export interface VotingParams { + /** Length of the voting period. */ + votingPeriod?: Duration; +} + +/** TallyParams defines the params for tallying votes on governance proposals. */ +export interface TallyParams { + /** + * Minimum percentage of total stake needed to vote for a result to be + * considered valid. + */ + quorum: Uint8Array; + /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ + threshold: Uint8Array; + /** + * Minimum value of Veto votes to Total votes ratio for proposal to be + * vetoed. Default value: 1/3. + */ + vetoThreshold: Uint8Array; +} + +const baseWeightedVoteOption: object = { option: 0, weight: "" }; + +export const WeightedVoteOption = { + encode(message: WeightedVoteOption, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.option !== 0) { + writer.uint32(8).int32(message.option); + } + if (message.weight !== "") { + writer.uint32(18).string(message.weight); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): WeightedVoteOption { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseWeightedVoteOption } as WeightedVoteOption; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.option = reader.int32() as any; + break; + case 2: + message.weight = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): WeightedVoteOption { + const message = { ...baseWeightedVoteOption } as WeightedVoteOption; + if (object.option !== undefined && object.option !== null) { + message.option = voteOptionFromJSON(object.option); + } else { + message.option = 0; + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = String(object.weight); + } else { + message.weight = ""; + } + return message; + }, + + toJSON(message: WeightedVoteOption): unknown { + const obj: any = {}; + message.option !== undefined && (obj.option = voteOptionToJSON(message.option)); + message.weight !== undefined && (obj.weight = message.weight); + return obj; + }, + + fromPartial(object: DeepPartial): WeightedVoteOption { + const message = { ...baseWeightedVoteOption } as WeightedVoteOption; + if (object.option !== undefined && object.option !== null) { + message.option = object.option; + } else { + message.option = 0; + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = object.weight; + } else { + message.weight = ""; + } + return message; + }, +}; + +const baseTextProposal: object = { title: "", description: "" }; + +export const TextProposal = { + encode(message: TextProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TextProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTextProposal } as TextProposal; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TextProposal { + const message = { ...baseTextProposal } as TextProposal; + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + return message; + }, + + toJSON(message: TextProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial(object: DeepPartial): TextProposal { + const message = { ...baseTextProposal } as TextProposal; + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + return message; + }, +}; + +const baseDeposit: object = { proposalId: Long.UZERO, depositor: "" }; + +export const Deposit = { + encode(message: Deposit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.proposalId.isZero()) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.depositor !== "") { + writer.uint32(18).string(message.depositor); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Deposit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDeposit } as Deposit; + message.amount = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64() as Long; + break; + case 2: + message.depositor = reader.string(); + break; + case 3: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Deposit { + const message = { ...baseDeposit } as Deposit; + message.amount = []; + if (object.proposalId !== undefined && object.proposalId !== null) { + message.proposalId = Long.fromString(object.proposalId); + } else { + message.proposalId = Long.UZERO; + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = String(object.depositor); + } else { + message.depositor = ""; + } + if (object.amount !== undefined && object.amount !== null) { + for (const e of object.amount) { + message.amount.push(Coin.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: Deposit): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.depositor !== undefined && (obj.depositor = message.depositor); + if (message.amount) { + obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.amount = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): Deposit { + const message = { ...baseDeposit } as Deposit; + message.amount = []; + if (object.proposalId !== undefined && object.proposalId !== null) { + message.proposalId = object.proposalId as Long; + } else { + message.proposalId = Long.UZERO; + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } else { + message.depositor = ""; + } + if (object.amount !== undefined && object.amount !== null) { + for (const e of object.amount) { + message.amount.push(Coin.fromPartial(e)); + } + } + return message; + }, +}; + +const baseProposal: object = { proposalId: Long.UZERO, status: 0 }; + +export const Proposal = { + encode(message: Proposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.proposalId.isZero()) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.content !== undefined) { + Any.encode(message.content, writer.uint32(18).fork()).ldelim(); + } + if (message.status !== 0) { + writer.uint32(24).int32(message.status); + } + if (message.finalTallyResult !== undefined) { + TallyResult.encode(message.finalTallyResult, writer.uint32(34).fork()).ldelim(); + } + if (message.submitTime !== undefined) { + Timestamp.encode(toTimestamp(message.submitTime), writer.uint32(42).fork()).ldelim(); + } + if (message.depositEndTime !== undefined) { + Timestamp.encode(toTimestamp(message.depositEndTime), writer.uint32(50).fork()).ldelim(); + } + for (const v of message.totalDeposit) { + Coin.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.votingStartTime !== undefined) { + Timestamp.encode(toTimestamp(message.votingStartTime), writer.uint32(66).fork()).ldelim(); + } + if (message.votingEndTime !== undefined) { + Timestamp.encode(toTimestamp(message.votingEndTime), writer.uint32(74).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Proposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseProposal } as Proposal; + message.totalDeposit = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64() as Long; + break; + case 2: + message.content = Any.decode(reader, reader.uint32()); + break; + case 3: + message.status = reader.int32() as any; + break; + case 4: + message.finalTallyResult = TallyResult.decode(reader, reader.uint32()); + break; + case 5: + message.submitTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 6: + message.depositEndTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 7: + message.totalDeposit.push(Coin.decode(reader, reader.uint32())); + break; + case 8: + message.votingStartTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 9: + message.votingEndTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Proposal { + const message = { ...baseProposal } as Proposal; + message.totalDeposit = []; + if (object.proposalId !== undefined && object.proposalId !== null) { + message.proposalId = Long.fromString(object.proposalId); + } else { + message.proposalId = Long.UZERO; + } + if (object.content !== undefined && object.content !== null) { + message.content = Any.fromJSON(object.content); + } else { + message.content = undefined; + } + if (object.status !== undefined && object.status !== null) { + message.status = proposalStatusFromJSON(object.status); + } else { + message.status = 0; + } + if (object.finalTallyResult !== undefined && object.finalTallyResult !== null) { + message.finalTallyResult = TallyResult.fromJSON(object.finalTallyResult); + } else { + message.finalTallyResult = undefined; + } + if (object.submitTime !== undefined && object.submitTime !== null) { + message.submitTime = fromJsonTimestamp(object.submitTime); + } else { + message.submitTime = undefined; + } + if (object.depositEndTime !== undefined && object.depositEndTime !== null) { + message.depositEndTime = fromJsonTimestamp(object.depositEndTime); + } else { + message.depositEndTime = undefined; + } + if (object.totalDeposit !== undefined && object.totalDeposit !== null) { + for (const e of object.totalDeposit) { + message.totalDeposit.push(Coin.fromJSON(e)); + } + } + if (object.votingStartTime !== undefined && object.votingStartTime !== null) { + message.votingStartTime = fromJsonTimestamp(object.votingStartTime); + } else { + message.votingStartTime = undefined; + } + if (object.votingEndTime !== undefined && object.votingEndTime !== null) { + message.votingEndTime = fromJsonTimestamp(object.votingEndTime); + } else { + message.votingEndTime = undefined; + } + return message; + }, + + toJSON(message: Proposal): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.content !== undefined && + (obj.content = message.content ? Any.toJSON(message.content) : undefined); + message.status !== undefined && (obj.status = proposalStatusToJSON(message.status)); + message.finalTallyResult !== undefined && + (obj.finalTallyResult = message.finalTallyResult + ? TallyResult.toJSON(message.finalTallyResult) + : undefined); + message.submitTime !== undefined && (obj.submitTime = message.submitTime.toISOString()); + message.depositEndTime !== undefined && (obj.depositEndTime = message.depositEndTime.toISOString()); + if (message.totalDeposit) { + obj.totalDeposit = message.totalDeposit.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.totalDeposit = []; + } + message.votingStartTime !== undefined && (obj.votingStartTime = message.votingStartTime.toISOString()); + message.votingEndTime !== undefined && (obj.votingEndTime = message.votingEndTime.toISOString()); + return obj; + }, + + fromPartial(object: DeepPartial): Proposal { + const message = { ...baseProposal } as Proposal; + message.totalDeposit = []; + if (object.proposalId !== undefined && object.proposalId !== null) { + message.proposalId = object.proposalId as Long; + } else { + message.proposalId = Long.UZERO; + } + if (object.content !== undefined && object.content !== null) { + message.content = Any.fromPartial(object.content); + } else { + message.content = undefined; + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } else { + message.status = 0; + } + if (object.finalTallyResult !== undefined && object.finalTallyResult !== null) { + message.finalTallyResult = TallyResult.fromPartial(object.finalTallyResult); + } else { + message.finalTallyResult = undefined; + } + if (object.submitTime !== undefined && object.submitTime !== null) { + message.submitTime = object.submitTime; + } else { + message.submitTime = undefined; + } + if (object.depositEndTime !== undefined && object.depositEndTime !== null) { + message.depositEndTime = object.depositEndTime; + } else { + message.depositEndTime = undefined; + } + if (object.totalDeposit !== undefined && object.totalDeposit !== null) { + for (const e of object.totalDeposit) { + message.totalDeposit.push(Coin.fromPartial(e)); + } + } + if (object.votingStartTime !== undefined && object.votingStartTime !== null) { + message.votingStartTime = object.votingStartTime; + } else { + message.votingStartTime = undefined; + } + if (object.votingEndTime !== undefined && object.votingEndTime !== null) { + message.votingEndTime = object.votingEndTime; + } else { + message.votingEndTime = undefined; + } + return message; + }, +}; + +const baseTallyResult: object = { yes: "", abstain: "", no: "", noWithVeto: "" }; + +export const TallyResult = { + encode(message: TallyResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.yes !== "") { + writer.uint32(10).string(message.yes); + } + if (message.abstain !== "") { + writer.uint32(18).string(message.abstain); + } + if (message.no !== "") { + writer.uint32(26).string(message.no); + } + if (message.noWithVeto !== "") { + writer.uint32(34).string(message.noWithVeto); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TallyResult { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTallyResult } as TallyResult; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.yes = reader.string(); + break; + case 2: + message.abstain = reader.string(); + break; + case 3: + message.no = reader.string(); + break; + case 4: + message.noWithVeto = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TallyResult { + const message = { ...baseTallyResult } as TallyResult; + if (object.yes !== undefined && object.yes !== null) { + message.yes = String(object.yes); + } else { + message.yes = ""; + } + if (object.abstain !== undefined && object.abstain !== null) { + message.abstain = String(object.abstain); + } else { + message.abstain = ""; + } + if (object.no !== undefined && object.no !== null) { + message.no = String(object.no); + } else { + message.no = ""; + } + if (object.noWithVeto !== undefined && object.noWithVeto !== null) { + message.noWithVeto = String(object.noWithVeto); + } else { + message.noWithVeto = ""; + } + return message; + }, + + toJSON(message: TallyResult): unknown { + const obj: any = {}; + message.yes !== undefined && (obj.yes = message.yes); + message.abstain !== undefined && (obj.abstain = message.abstain); + message.no !== undefined && (obj.no = message.no); + message.noWithVeto !== undefined && (obj.noWithVeto = message.noWithVeto); + return obj; + }, + + fromPartial(object: DeepPartial): TallyResult { + const message = { ...baseTallyResult } as TallyResult; + if (object.yes !== undefined && object.yes !== null) { + message.yes = object.yes; + } else { + message.yes = ""; + } + if (object.abstain !== undefined && object.abstain !== null) { + message.abstain = object.abstain; + } else { + message.abstain = ""; + } + if (object.no !== undefined && object.no !== null) { + message.no = object.no; + } else { + message.no = ""; + } + if (object.noWithVeto !== undefined && object.noWithVeto !== null) { + message.noWithVeto = object.noWithVeto; + } else { + message.noWithVeto = ""; + } + return message; + }, +}; + +const baseVote: object = { proposalId: Long.UZERO, voter: "" }; + +export const Vote = { + encode(message: Vote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.proposalId.isZero()) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + for (const v of message.options) { + WeightedVoteOption.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Vote { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseVote } as Vote; + message.options = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64() as Long; + break; + case 2: + message.voter = reader.string(); + break; + case 4: + message.options.push(WeightedVoteOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Vote { + const message = { ...baseVote } as Vote; + message.options = []; + if (object.proposalId !== undefined && object.proposalId !== null) { + message.proposalId = Long.fromString(object.proposalId); + } else { + message.proposalId = Long.UZERO; + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = String(object.voter); + } else { + message.voter = ""; + } + if (object.options !== undefined && object.options !== null) { + for (const e of object.options) { + message.options.push(WeightedVoteOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: Vote): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.voter !== undefined && (obj.voter = message.voter); + if (message.options) { + obj.options = message.options.map((e) => (e ? WeightedVoteOption.toJSON(e) : undefined)); + } else { + obj.options = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): Vote { + const message = { ...baseVote } as Vote; + message.options = []; + if (object.proposalId !== undefined && object.proposalId !== null) { + message.proposalId = object.proposalId as Long; + } else { + message.proposalId = Long.UZERO; + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } else { + message.voter = ""; + } + if (object.options !== undefined && object.options !== null) { + for (const e of object.options) { + message.options.push(WeightedVoteOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseDepositParams: object = {}; + +export const DepositParams = { + encode(message: DepositParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.minDeposit) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.maxDepositPeriod !== undefined) { + Duration.encode(message.maxDepositPeriod, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DepositParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDepositParams } as DepositParams; + message.minDeposit = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.minDeposit.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.maxDepositPeriod = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DepositParams { + const message = { ...baseDepositParams } as DepositParams; + message.minDeposit = []; + if (object.minDeposit !== undefined && object.minDeposit !== null) { + for (const e of object.minDeposit) { + message.minDeposit.push(Coin.fromJSON(e)); + } + } + if (object.maxDepositPeriod !== undefined && object.maxDepositPeriod !== null) { + message.maxDepositPeriod = Duration.fromJSON(object.maxDepositPeriod); + } else { + message.maxDepositPeriod = undefined; + } + return message; + }, + + toJSON(message: DepositParams): unknown { + const obj: any = {}; + if (message.minDeposit) { + obj.minDeposit = message.minDeposit.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.minDeposit = []; + } + message.maxDepositPeriod !== undefined && + (obj.maxDepositPeriod = message.maxDepositPeriod + ? Duration.toJSON(message.maxDepositPeriod) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): DepositParams { + const message = { ...baseDepositParams } as DepositParams; + message.minDeposit = []; + if (object.minDeposit !== undefined && object.minDeposit !== null) { + for (const e of object.minDeposit) { + message.minDeposit.push(Coin.fromPartial(e)); + } + } + if (object.maxDepositPeriod !== undefined && object.maxDepositPeriod !== null) { + message.maxDepositPeriod = Duration.fromPartial(object.maxDepositPeriod); + } else { + message.maxDepositPeriod = undefined; + } + return message; + }, +}; + +const baseVotingParams: object = {}; + +export const VotingParams = { + encode(message: VotingParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.votingPeriod !== undefined) { + Duration.encode(message.votingPeriod, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): VotingParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseVotingParams } as VotingParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votingPeriod = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): VotingParams { + const message = { ...baseVotingParams } as VotingParams; + if (object.votingPeriod !== undefined && object.votingPeriod !== null) { + message.votingPeriod = Duration.fromJSON(object.votingPeriod); + } else { + message.votingPeriod = undefined; + } + return message; + }, + + toJSON(message: VotingParams): unknown { + const obj: any = {}; + message.votingPeriod !== undefined && + (obj.votingPeriod = message.votingPeriod ? Duration.toJSON(message.votingPeriod) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): VotingParams { + const message = { ...baseVotingParams } as VotingParams; + if (object.votingPeriod !== undefined && object.votingPeriod !== null) { + message.votingPeriod = Duration.fromPartial(object.votingPeriod); + } else { + message.votingPeriod = undefined; + } + return message; + }, +}; + +const baseTallyParams: object = {}; + +export const TallyParams = { + encode(message: TallyParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.quorum.length !== 0) { + writer.uint32(10).bytes(message.quorum); + } + if (message.threshold.length !== 0) { + writer.uint32(18).bytes(message.threshold); + } + if (message.vetoThreshold.length !== 0) { + writer.uint32(26).bytes(message.vetoThreshold); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TallyParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTallyParams } as TallyParams; + message.quorum = new Uint8Array(); + message.threshold = new Uint8Array(); + message.vetoThreshold = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.quorum = reader.bytes(); + break; + case 2: + message.threshold = reader.bytes(); + break; + case 3: + message.vetoThreshold = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TallyParams { + const message = { ...baseTallyParams } as TallyParams; + message.quorum = new Uint8Array(); + message.threshold = new Uint8Array(); + message.vetoThreshold = new Uint8Array(); + if (object.quorum !== undefined && object.quorum !== null) { + message.quorum = bytesFromBase64(object.quorum); + } + if (object.threshold !== undefined && object.threshold !== null) { + message.threshold = bytesFromBase64(object.threshold); + } + if (object.vetoThreshold !== undefined && object.vetoThreshold !== null) { + message.vetoThreshold = bytesFromBase64(object.vetoThreshold); + } + return message; + }, + + toJSON(message: TallyParams): unknown { + const obj: any = {}; + message.quorum !== undefined && + (obj.quorum = base64FromBytes(message.quorum !== undefined ? message.quorum : new Uint8Array())); + message.threshold !== undefined && + (obj.threshold = base64FromBytes( + message.threshold !== undefined ? message.threshold : new Uint8Array(), + )); + message.vetoThreshold !== undefined && + (obj.vetoThreshold = base64FromBytes( + message.vetoThreshold !== undefined ? message.vetoThreshold : new Uint8Array(), + )); + return obj; + }, + + fromPartial(object: DeepPartial): TallyParams { + const message = { ...baseTallyParams } as TallyParams; + if (object.quorum !== undefined && object.quorum !== null) { + message.quorum = object.quorum; + } else { + message.quorum = new Uint8Array(); + } + if (object.threshold !== undefined && object.threshold !== null) { + message.threshold = object.threshold; + } else { + message.threshold = new Uint8Array(); + } + if (object.vetoThreshold !== undefined && object.vetoThreshold !== null) { + message.vetoThreshold = object.vetoThreshold; + } else { + message.vetoThreshold = new Uint8Array(); + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function toTimestamp(date: Date): Timestamp { + const seconds = numberToLong(date.getTime() / 1_000); + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds.toNumber() * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function numberToLong(number: number) { + return Long.fromNumber(number); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/gov/v1beta1/query.ts b/src/cosmos/gov/v1beta1/query.ts new file mode 100644 index 00000000..6d65d405 --- /dev/null +++ b/src/cosmos/gov/v1beta1/query.ts @@ -0,0 +1,1361 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { + Proposal, + ProposalStatus, + Vote, + VotingParams, + DepositParams, + TallyParams, + Deposit, + TallyResult, + proposalStatusFromJSON, + proposalStatusToJSON, +} from "../../../cosmos/gov/v1beta1/gov"; +import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; + +export const protobufPackage = "cosmos.gov.v1beta1"; + +/** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ +export interface QueryProposalRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: Long; +} + +/** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ +export interface QueryProposalResponse { + proposal?: Proposal; +} + +/** QueryProposalsRequest is the request type for the Query/Proposals RPC method. */ +export interface QueryProposalsRequest { + /** proposal_status defines the status of the proposals. */ + proposalStatus: ProposalStatus; + /** voter defines the voter address for the proposals. */ + voter: string; + /** depositor defines the deposit addresses from the proposals. */ + depositor: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} + +/** + * QueryProposalsResponse is the response type for the Query/Proposals RPC + * method. + */ +export interface QueryProposalsResponse { + proposals: Proposal[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} + +/** QueryVoteRequest is the request type for the Query/Vote RPC method. */ +export interface QueryVoteRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: Long; + /** voter defines the oter address for the proposals. */ + voter: string; +} + +/** QueryVoteResponse is the response type for the Query/Vote RPC method. */ +export interface QueryVoteResponse { + /** vote defined the queried vote. */ + vote?: Vote; +} + +/** QueryVotesRequest is the request type for the Query/Votes RPC method. */ +export interface QueryVotesRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: Long; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} + +/** QueryVotesResponse is the response type for the Query/Votes RPC method. */ +export interface QueryVotesResponse { + /** votes defined the queried votes. */ + votes: Vote[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} + +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest { + /** + * params_type defines which parameters to query for, can be one of "voting", + * "tallying" or "deposit". + */ + paramsType: string; +} + +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** voting_params defines the parameters related to voting. */ + votingParams?: VotingParams; + /** deposit_params defines the parameters related to deposit. */ + depositParams?: DepositParams; + /** tally_params defines the parameters related to tally. */ + tallyParams?: TallyParams; +} + +/** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ +export interface QueryDepositRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: Long; + /** depositor defines the deposit addresses from the proposals. */ + depositor: string; +} + +/** QueryDepositResponse is the response type for the Query/Deposit RPC method. */ +export interface QueryDepositResponse { + /** deposit defines the requested deposit. */ + deposit?: Deposit; +} + +/** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ +export interface QueryDepositsRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: Long; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} + +/** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ +export interface QueryDepositsResponse { + deposits: Deposit[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} + +/** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ +export interface QueryTallyResultRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: Long; +} + +/** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ +export interface QueryTallyResultResponse { + /** tally defines the requested tally. */ + tally?: TallyResult; +} + +const baseQueryProposalRequest: object = { proposalId: Long.UZERO }; + +export const QueryProposalRequest = { + encode(message: QueryProposalRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.proposalId.isZero()) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryProposalRequest } as QueryProposalRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryProposalRequest { + const message = { ...baseQueryProposalRequest } as QueryProposalRequest; + if (object.proposalId !== undefined && object.proposalId !== null) { + message.proposalId = Long.fromString(object.proposalId); + } else { + message.proposalId = Long.UZERO; + } + return message; + }, + + toJSON(message: QueryProposalRequest): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): QueryProposalRequest { + const message = { ...baseQueryProposalRequest } as QueryProposalRequest; + if (object.proposalId !== undefined && object.proposalId !== null) { + message.proposalId = object.proposalId as Long; + } else { + message.proposalId = Long.UZERO; + } + return message; + }, +}; + +const baseQueryProposalResponse: object = {}; + +export const QueryProposalResponse = { + encode(message: QueryProposalResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposal !== undefined) { + Proposal.encode(message.proposal, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryProposalResponse } as QueryProposalResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposal = Proposal.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryProposalResponse { + const message = { ...baseQueryProposalResponse } as QueryProposalResponse; + if (object.proposal !== undefined && object.proposal !== null) { + message.proposal = Proposal.fromJSON(object.proposal); + } else { + message.proposal = undefined; + } + return message; + }, + + toJSON(message: QueryProposalResponse): unknown { + const obj: any = {}; + message.proposal !== undefined && + (obj.proposal = message.proposal ? Proposal.toJSON(message.proposal) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryProposalResponse { + const message = { ...baseQueryProposalResponse } as QueryProposalResponse; + if (object.proposal !== undefined && object.proposal !== null) { + message.proposal = Proposal.fromPartial(object.proposal); + } else { + message.proposal = undefined; + } + return message; + }, +}; + +const baseQueryProposalsRequest: object = { proposalStatus: 0, voter: "", depositor: "" }; + +export const QueryProposalsRequest = { + encode(message: QueryProposalsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposalStatus !== 0) { + writer.uint32(8).int32(message.proposalStatus); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + if (message.depositor !== "") { + writer.uint32(26).string(message.depositor); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryProposalsRequest } as QueryProposalsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalStatus = reader.int32() as any; + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.depositor = reader.string(); + break; + case 4: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryProposalsRequest { + const message = { ...baseQueryProposalsRequest } as QueryProposalsRequest; + if (object.proposalStatus !== undefined && object.proposalStatus !== null) { + message.proposalStatus = proposalStatusFromJSON(object.proposalStatus); + } else { + message.proposalStatus = 0; + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = String(object.voter); + } else { + message.voter = ""; + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = String(object.depositor); + } else { + message.depositor = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryProposalsRequest): unknown { + const obj: any = {}; + message.proposalStatus !== undefined && + (obj.proposalStatus = proposalStatusToJSON(message.proposalStatus)); + message.voter !== undefined && (obj.voter = message.voter); + message.depositor !== undefined && (obj.depositor = message.depositor); + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryProposalsRequest { + const message = { ...baseQueryProposalsRequest } as QueryProposalsRequest; + if (object.proposalStatus !== undefined && object.proposalStatus !== null) { + message.proposalStatus = object.proposalStatus; + } else { + message.proposalStatus = 0; + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } else { + message.voter = ""; + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } else { + message.depositor = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryProposalsResponse: object = {}; + +export const QueryProposalsResponse = { + encode(message: QueryProposalsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.proposals) { + Proposal.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryProposalsResponse } as QueryProposalsResponse; + message.proposals = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposals.push(Proposal.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryProposalsResponse { + const message = { ...baseQueryProposalsResponse } as QueryProposalsResponse; + message.proposals = []; + if (object.proposals !== undefined && object.proposals !== null) { + for (const e of object.proposals) { + message.proposals.push(Proposal.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryProposalsResponse): unknown { + const obj: any = {}; + if (message.proposals) { + obj.proposals = message.proposals.map((e) => (e ? Proposal.toJSON(e) : undefined)); + } else { + obj.proposals = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryProposalsResponse { + const message = { ...baseQueryProposalsResponse } as QueryProposalsResponse; + message.proposals = []; + if (object.proposals !== undefined && object.proposals !== null) { + for (const e of object.proposals) { + message.proposals.push(Proposal.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryVoteRequest: object = { proposalId: Long.UZERO, voter: "" }; + +export const QueryVoteRequest = { + encode(message: QueryVoteRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.proposalId.isZero()) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryVoteRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryVoteRequest } as QueryVoteRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64() as Long; + break; + case 2: + message.voter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryVoteRequest { + const message = { ...baseQueryVoteRequest } as QueryVoteRequest; + if (object.proposalId !== undefined && object.proposalId !== null) { + message.proposalId = Long.fromString(object.proposalId); + } else { + message.proposalId = Long.UZERO; + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = String(object.voter); + } else { + message.voter = ""; + } + return message; + }, + + toJSON(message: QueryVoteRequest): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.voter !== undefined && (obj.voter = message.voter); + return obj; + }, + + fromPartial(object: DeepPartial): QueryVoteRequest { + const message = { ...baseQueryVoteRequest } as QueryVoteRequest; + if (object.proposalId !== undefined && object.proposalId !== null) { + message.proposalId = object.proposalId as Long; + } else { + message.proposalId = Long.UZERO; + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } else { + message.voter = ""; + } + return message; + }, +}; + +const baseQueryVoteResponse: object = {}; + +export const QueryVoteResponse = { + encode(message: QueryVoteResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.vote !== undefined) { + Vote.encode(message.vote, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryVoteResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryVoteResponse } as QueryVoteResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vote = Vote.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryVoteResponse { + const message = { ...baseQueryVoteResponse } as QueryVoteResponse; + if (object.vote !== undefined && object.vote !== null) { + message.vote = Vote.fromJSON(object.vote); + } else { + message.vote = undefined; + } + return message; + }, + + toJSON(message: QueryVoteResponse): unknown { + const obj: any = {}; + message.vote !== undefined && (obj.vote = message.vote ? Vote.toJSON(message.vote) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryVoteResponse { + const message = { ...baseQueryVoteResponse } as QueryVoteResponse; + if (object.vote !== undefined && object.vote !== null) { + message.vote = Vote.fromPartial(object.vote); + } else { + message.vote = undefined; + } + return message; + }, +}; + +const baseQueryVotesRequest: object = { proposalId: Long.UZERO }; + +export const QueryVotesRequest = { + encode(message: QueryVotesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.proposalId.isZero()) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryVotesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryVotesRequest } as QueryVotesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64() as Long; + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryVotesRequest { + const message = { ...baseQueryVotesRequest } as QueryVotesRequest; + if (object.proposalId !== undefined && object.proposalId !== null) { + message.proposalId = Long.fromString(object.proposalId); + } else { + message.proposalId = Long.UZERO; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryVotesRequest): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryVotesRequest { + const message = { ...baseQueryVotesRequest } as QueryVotesRequest; + if (object.proposalId !== undefined && object.proposalId !== null) { + message.proposalId = object.proposalId as Long; + } else { + message.proposalId = Long.UZERO; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryVotesResponse: object = {}; + +export const QueryVotesResponse = { + encode(message: QueryVotesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.votes) { + Vote.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryVotesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryVotesResponse } as QueryVotesResponse; + message.votes = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votes.push(Vote.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryVotesResponse { + const message = { ...baseQueryVotesResponse } as QueryVotesResponse; + message.votes = []; + if (object.votes !== undefined && object.votes !== null) { + for (const e of object.votes) { + message.votes.push(Vote.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryVotesResponse): unknown { + const obj: any = {}; + if (message.votes) { + obj.votes = message.votes.map((e) => (e ? Vote.toJSON(e) : undefined)); + } else { + obj.votes = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryVotesResponse { + const message = { ...baseQueryVotesResponse } as QueryVotesResponse; + message.votes = []; + if (object.votes !== undefined && object.votes !== null) { + for (const e of object.votes) { + message.votes.push(Vote.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryParamsRequest: object = { paramsType: "" }; + +export const QueryParamsRequest = { + encode(message: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.paramsType !== "") { + writer.uint32(10).string(message.paramsType); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.paramsType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + if (object.paramsType !== undefined && object.paramsType !== null) { + message.paramsType = String(object.paramsType); + } else { + message.paramsType = ""; + } + return message; + }, + + toJSON(message: QueryParamsRequest): unknown { + const obj: any = {}; + message.paramsType !== undefined && (obj.paramsType = message.paramsType); + return obj; + }, + + fromPartial(object: DeepPartial): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + if (object.paramsType !== undefined && object.paramsType !== null) { + message.paramsType = object.paramsType; + } else { + message.paramsType = ""; + } + return message; + }, +}; + +const baseQueryParamsResponse: object = {}; + +export const QueryParamsResponse = { + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.votingParams !== undefined) { + VotingParams.encode(message.votingParams, writer.uint32(10).fork()).ldelim(); + } + if (message.depositParams !== undefined) { + DepositParams.encode(message.depositParams, writer.uint32(18).fork()).ldelim(); + } + if (message.tallyParams !== undefined) { + TallyParams.encode(message.tallyParams, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votingParams = VotingParams.decode(reader, reader.uint32()); + break; + case 2: + message.depositParams = DepositParams.decode(reader, reader.uint32()); + break; + case 3: + message.tallyParams = TallyParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.votingParams !== undefined && object.votingParams !== null) { + message.votingParams = VotingParams.fromJSON(object.votingParams); + } else { + message.votingParams = undefined; + } + if (object.depositParams !== undefined && object.depositParams !== null) { + message.depositParams = DepositParams.fromJSON(object.depositParams); + } else { + message.depositParams = undefined; + } + if (object.tallyParams !== undefined && object.tallyParams !== null) { + message.tallyParams = TallyParams.fromJSON(object.tallyParams); + } else { + message.tallyParams = undefined; + } + return message; + }, + + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.votingParams !== undefined && + (obj.votingParams = message.votingParams ? VotingParams.toJSON(message.votingParams) : undefined); + message.depositParams !== undefined && + (obj.depositParams = message.depositParams ? DepositParams.toJSON(message.depositParams) : undefined); + message.tallyParams !== undefined && + (obj.tallyParams = message.tallyParams ? TallyParams.toJSON(message.tallyParams) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.votingParams !== undefined && object.votingParams !== null) { + message.votingParams = VotingParams.fromPartial(object.votingParams); + } else { + message.votingParams = undefined; + } + if (object.depositParams !== undefined && object.depositParams !== null) { + message.depositParams = DepositParams.fromPartial(object.depositParams); + } else { + message.depositParams = undefined; + } + if (object.tallyParams !== undefined && object.tallyParams !== null) { + message.tallyParams = TallyParams.fromPartial(object.tallyParams); + } else { + message.tallyParams = undefined; + } + return message; + }, +}; + +const baseQueryDepositRequest: object = { proposalId: Long.UZERO, depositor: "" }; + +export const QueryDepositRequest = { + encode(message: QueryDepositRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.proposalId.isZero()) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.depositor !== "") { + writer.uint32(18).string(message.depositor); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDepositRequest } as QueryDepositRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64() as Long; + break; + case 2: + message.depositor = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDepositRequest { + const message = { ...baseQueryDepositRequest } as QueryDepositRequest; + if (object.proposalId !== undefined && object.proposalId !== null) { + message.proposalId = Long.fromString(object.proposalId); + } else { + message.proposalId = Long.UZERO; + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = String(object.depositor); + } else { + message.depositor = ""; + } + return message; + }, + + toJSON(message: QueryDepositRequest): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.depositor !== undefined && (obj.depositor = message.depositor); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDepositRequest { + const message = { ...baseQueryDepositRequest } as QueryDepositRequest; + if (object.proposalId !== undefined && object.proposalId !== null) { + message.proposalId = object.proposalId as Long; + } else { + message.proposalId = Long.UZERO; + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } else { + message.depositor = ""; + } + return message; + }, +}; + +const baseQueryDepositResponse: object = {}; + +export const QueryDepositResponse = { + encode(message: QueryDepositResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.deposit !== undefined) { + Deposit.encode(message.deposit, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDepositResponse } as QueryDepositResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deposit = Deposit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDepositResponse { + const message = { ...baseQueryDepositResponse } as QueryDepositResponse; + if (object.deposit !== undefined && object.deposit !== null) { + message.deposit = Deposit.fromJSON(object.deposit); + } else { + message.deposit = undefined; + } + return message; + }, + + toJSON(message: QueryDepositResponse): unknown { + const obj: any = {}; + message.deposit !== undefined && + (obj.deposit = message.deposit ? Deposit.toJSON(message.deposit) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDepositResponse { + const message = { ...baseQueryDepositResponse } as QueryDepositResponse; + if (object.deposit !== undefined && object.deposit !== null) { + message.deposit = Deposit.fromPartial(object.deposit); + } else { + message.deposit = undefined; + } + return message; + }, +}; + +const baseQueryDepositsRequest: object = { proposalId: Long.UZERO }; + +export const QueryDepositsRequest = { + encode(message: QueryDepositsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.proposalId.isZero()) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDepositsRequest } as QueryDepositsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64() as Long; + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDepositsRequest { + const message = { ...baseQueryDepositsRequest } as QueryDepositsRequest; + if (object.proposalId !== undefined && object.proposalId !== null) { + message.proposalId = Long.fromString(object.proposalId); + } else { + message.proposalId = Long.UZERO; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryDepositsRequest): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDepositsRequest { + const message = { ...baseQueryDepositsRequest } as QueryDepositsRequest; + if (object.proposalId !== undefined && object.proposalId !== null) { + message.proposalId = object.proposalId as Long; + } else { + message.proposalId = Long.UZERO; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryDepositsResponse: object = {}; + +export const QueryDepositsResponse = { + encode(message: QueryDepositsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.deposits) { + Deposit.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDepositsResponse } as QueryDepositsResponse; + message.deposits = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deposits.push(Deposit.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDepositsResponse { + const message = { ...baseQueryDepositsResponse } as QueryDepositsResponse; + message.deposits = []; + if (object.deposits !== undefined && object.deposits !== null) { + for (const e of object.deposits) { + message.deposits.push(Deposit.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryDepositsResponse): unknown { + const obj: any = {}; + if (message.deposits) { + obj.deposits = message.deposits.map((e) => (e ? Deposit.toJSON(e) : undefined)); + } else { + obj.deposits = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDepositsResponse { + const message = { ...baseQueryDepositsResponse } as QueryDepositsResponse; + message.deposits = []; + if (object.deposits !== undefined && object.deposits !== null) { + for (const e of object.deposits) { + message.deposits.push(Deposit.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryTallyResultRequest: object = { proposalId: Long.UZERO }; + +export const QueryTallyResultRequest = { + encode(message: QueryTallyResultRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.proposalId.isZero()) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryTallyResultRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryTallyResultRequest } as QueryTallyResultRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryTallyResultRequest { + const message = { ...baseQueryTallyResultRequest } as QueryTallyResultRequest; + if (object.proposalId !== undefined && object.proposalId !== null) { + message.proposalId = Long.fromString(object.proposalId); + } else { + message.proposalId = Long.UZERO; + } + return message; + }, + + toJSON(message: QueryTallyResultRequest): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): QueryTallyResultRequest { + const message = { ...baseQueryTallyResultRequest } as QueryTallyResultRequest; + if (object.proposalId !== undefined && object.proposalId !== null) { + message.proposalId = object.proposalId as Long; + } else { + message.proposalId = Long.UZERO; + } + return message; + }, +}; + +const baseQueryTallyResultResponse: object = {}; + +export const QueryTallyResultResponse = { + encode(message: QueryTallyResultResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.tally !== undefined) { + TallyResult.encode(message.tally, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryTallyResultResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryTallyResultResponse } as QueryTallyResultResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tally = TallyResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryTallyResultResponse { + const message = { ...baseQueryTallyResultResponse } as QueryTallyResultResponse; + if (object.tally !== undefined && object.tally !== null) { + message.tally = TallyResult.fromJSON(object.tally); + } else { + message.tally = undefined; + } + return message; + }, + + toJSON(message: QueryTallyResultResponse): unknown { + const obj: any = {}; + message.tally !== undefined && + (obj.tally = message.tally ? TallyResult.toJSON(message.tally) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryTallyResultResponse { + const message = { ...baseQueryTallyResultResponse } as QueryTallyResultResponse; + if (object.tally !== undefined && object.tally !== null) { + message.tally = TallyResult.fromPartial(object.tally); + } else { + message.tally = undefined; + } + return message; + }, +}; + +/** Query defines the gRPC querier service for gov module */ +export interface Query { + /** Proposal queries proposal details based on ProposalID. */ + Proposal(request: QueryProposalRequest): Promise; + /** Proposals queries all proposals based on given status. */ + Proposals(request: QueryProposalsRequest): Promise; + /** Vote queries voted information based on proposalID, voterAddr. */ + Vote(request: QueryVoteRequest): Promise; + /** Votes queries votes of a given proposal. */ + Votes(request: QueryVotesRequest): Promise; + /** Params queries all parameters of the gov module. */ + Params(request: QueryParamsRequest): Promise; + /** Deposit queries single deposit information based proposalID, depositAddr. */ + Deposit(request: QueryDepositRequest): Promise; + /** Deposits queries all deposits of a single proposal. */ + Deposits(request: QueryDepositsRequest): Promise; + /** TallyResult queries the tally of a proposal vote. */ + TallyResult(request: QueryTallyResultRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Proposal = this.Proposal.bind(this); + this.Proposals = this.Proposals.bind(this); + this.Vote = this.Vote.bind(this); + this.Votes = this.Votes.bind(this); + this.Params = this.Params.bind(this); + this.Deposit = this.Deposit.bind(this); + this.Deposits = this.Deposits.bind(this); + this.TallyResult = this.TallyResult.bind(this); + } + Proposal(request: QueryProposalRequest): Promise { + const data = QueryProposalRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Proposal", data); + return promise.then((data) => QueryProposalResponse.decode(new _m0.Reader(data))); + } + + Proposals(request: QueryProposalsRequest): Promise { + const data = QueryProposalsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Proposals", data); + return promise.then((data) => QueryProposalsResponse.decode(new _m0.Reader(data))); + } + + Vote(request: QueryVoteRequest): Promise { + const data = QueryVoteRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Vote", data); + return promise.then((data) => QueryVoteResponse.decode(new _m0.Reader(data))); + } + + Votes(request: QueryVotesRequest): Promise { + const data = QueryVotesRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Votes", data); + return promise.then((data) => QueryVotesResponse.decode(new _m0.Reader(data))); + } + + Params(request: QueryParamsRequest): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Params", data); + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + } + + Deposit(request: QueryDepositRequest): Promise { + const data = QueryDepositRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Deposit", data); + return promise.then((data) => QueryDepositResponse.decode(new _m0.Reader(data))); + } + + Deposits(request: QueryDepositsRequest): Promise { + const data = QueryDepositsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Deposits", data); + return promise.then((data) => QueryDepositsResponse.decode(new _m0.Reader(data))); + } + + TallyResult(request: QueryTallyResultRequest): Promise { + const data = QueryTallyResultRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "TallyResult", data); + return promise.then((data) => QueryTallyResultResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/gov/v1beta1/tx.ts b/src/cosmos/gov/v1beta1/tx.ts new file mode 100644 index 00000000..6bd37bfa --- /dev/null +++ b/src/cosmos/gov/v1beta1/tx.ts @@ -0,0 +1,671 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Any } from "../../../google/protobuf/any"; +import { + VoteOption, + WeightedVoteOption, + voteOptionFromJSON, + voteOptionToJSON, +} from "../../../cosmos/gov/v1beta1/gov"; +import { Coin } from "../../../cosmos/base/v1beta1/coin"; + +export const protobufPackage = "cosmos.gov.v1beta1"; + +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposal { + content?: Any; + initialDeposit: Coin[]; + proposer: string; +} + +/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponse { + proposalId: Long; +} + +/** MsgVote defines a message to cast a vote. */ +export interface MsgVote { + proposalId: Long; + voter: string; + option: VoteOption; +} + +/** MsgVoteResponse defines the Msg/Vote response type. */ +export interface MsgVoteResponse {} + +/** MsgVoteWeighted defines a message to cast a vote. */ +export interface MsgVoteWeighted { + proposalId: Long; + voter: string; + options: WeightedVoteOption[]; +} + +/** MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. */ +export interface MsgVoteWeightedResponse {} + +/** MsgDeposit defines a message to submit a deposit to an existing proposal. */ +export interface MsgDeposit { + proposalId: Long; + depositor: string; + amount: Coin[]; +} + +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponse {} + +const baseMsgSubmitProposal: object = { proposer: "" }; + +export const MsgSubmitProposal = { + encode(message: MsgSubmitProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.content !== undefined) { + Any.encode(message.content, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.initialDeposit) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.proposer !== "") { + writer.uint32(26).string(message.proposer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgSubmitProposal } as MsgSubmitProposal; + message.initialDeposit = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.content = Any.decode(reader, reader.uint32()); + break; + case 2: + message.initialDeposit.push(Coin.decode(reader, reader.uint32())); + break; + case 3: + message.proposer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgSubmitProposal { + const message = { ...baseMsgSubmitProposal } as MsgSubmitProposal; + message.initialDeposit = []; + if (object.content !== undefined && object.content !== null) { + message.content = Any.fromJSON(object.content); + } else { + message.content = undefined; + } + if (object.initialDeposit !== undefined && object.initialDeposit !== null) { + for (const e of object.initialDeposit) { + message.initialDeposit.push(Coin.fromJSON(e)); + } + } + if (object.proposer !== undefined && object.proposer !== null) { + message.proposer = String(object.proposer); + } else { + message.proposer = ""; + } + return message; + }, + + toJSON(message: MsgSubmitProposal): unknown { + const obj: any = {}; + message.content !== undefined && + (obj.content = message.content ? Any.toJSON(message.content) : undefined); + if (message.initialDeposit) { + obj.initialDeposit = message.initialDeposit.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.initialDeposit = []; + } + message.proposer !== undefined && (obj.proposer = message.proposer); + return obj; + }, + + fromPartial(object: DeepPartial): MsgSubmitProposal { + const message = { ...baseMsgSubmitProposal } as MsgSubmitProposal; + message.initialDeposit = []; + if (object.content !== undefined && object.content !== null) { + message.content = Any.fromPartial(object.content); + } else { + message.content = undefined; + } + if (object.initialDeposit !== undefined && object.initialDeposit !== null) { + for (const e of object.initialDeposit) { + message.initialDeposit.push(Coin.fromPartial(e)); + } + } + if (object.proposer !== undefined && object.proposer !== null) { + message.proposer = object.proposer; + } else { + message.proposer = ""; + } + return message; + }, +}; + +const baseMsgSubmitProposalResponse: object = { proposalId: Long.UZERO }; + +export const MsgSubmitProposalResponse = { + encode(message: MsgSubmitProposalResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.proposalId.isZero()) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitProposalResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgSubmitProposalResponse } as MsgSubmitProposalResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgSubmitProposalResponse { + const message = { ...baseMsgSubmitProposalResponse } as MsgSubmitProposalResponse; + if (object.proposalId !== undefined && object.proposalId !== null) { + message.proposalId = Long.fromString(object.proposalId); + } else { + message.proposalId = Long.UZERO; + } + return message; + }, + + toJSON(message: MsgSubmitProposalResponse): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): MsgSubmitProposalResponse { + const message = { ...baseMsgSubmitProposalResponse } as MsgSubmitProposalResponse; + if (object.proposalId !== undefined && object.proposalId !== null) { + message.proposalId = object.proposalId as Long; + } else { + message.proposalId = Long.UZERO; + } + return message; + }, +}; + +const baseMsgVote: object = { proposalId: Long.UZERO, voter: "", option: 0 }; + +export const MsgVote = { + encode(message: MsgVote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.proposalId.isZero()) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + if (message.option !== 0) { + writer.uint32(24).int32(message.option); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgVote { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgVote } as MsgVote; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64() as Long; + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.option = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgVote { + const message = { ...baseMsgVote } as MsgVote; + if (object.proposalId !== undefined && object.proposalId !== null) { + message.proposalId = Long.fromString(object.proposalId); + } else { + message.proposalId = Long.UZERO; + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = String(object.voter); + } else { + message.voter = ""; + } + if (object.option !== undefined && object.option !== null) { + message.option = voteOptionFromJSON(object.option); + } else { + message.option = 0; + } + return message; + }, + + toJSON(message: MsgVote): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.voter !== undefined && (obj.voter = message.voter); + message.option !== undefined && (obj.option = voteOptionToJSON(message.option)); + return obj; + }, + + fromPartial(object: DeepPartial): MsgVote { + const message = { ...baseMsgVote } as MsgVote; + if (object.proposalId !== undefined && object.proposalId !== null) { + message.proposalId = object.proposalId as Long; + } else { + message.proposalId = Long.UZERO; + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } else { + message.voter = ""; + } + if (object.option !== undefined && object.option !== null) { + message.option = object.option; + } else { + message.option = 0; + } + return message; + }, +}; + +const baseMsgVoteResponse: object = {}; + +export const MsgVoteResponse = { + encode(_: MsgVoteResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgVoteResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgVoteResponse } as MsgVoteResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgVoteResponse { + const message = { ...baseMsgVoteResponse } as MsgVoteResponse; + return message; + }, + + toJSON(_: MsgVoteResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgVoteResponse { + const message = { ...baseMsgVoteResponse } as MsgVoteResponse; + return message; + }, +}; + +const baseMsgVoteWeighted: object = { proposalId: Long.UZERO, voter: "" }; + +export const MsgVoteWeighted = { + encode(message: MsgVoteWeighted, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.proposalId.isZero()) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + for (const v of message.options) { + WeightedVoteOption.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgVoteWeighted { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgVoteWeighted } as MsgVoteWeighted; + message.options = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64() as Long; + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.options.push(WeightedVoteOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgVoteWeighted { + const message = { ...baseMsgVoteWeighted } as MsgVoteWeighted; + message.options = []; + if (object.proposalId !== undefined && object.proposalId !== null) { + message.proposalId = Long.fromString(object.proposalId); + } else { + message.proposalId = Long.UZERO; + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = String(object.voter); + } else { + message.voter = ""; + } + if (object.options !== undefined && object.options !== null) { + for (const e of object.options) { + message.options.push(WeightedVoteOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: MsgVoteWeighted): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.voter !== undefined && (obj.voter = message.voter); + if (message.options) { + obj.options = message.options.map((e) => (e ? WeightedVoteOption.toJSON(e) : undefined)); + } else { + obj.options = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): MsgVoteWeighted { + const message = { ...baseMsgVoteWeighted } as MsgVoteWeighted; + message.options = []; + if (object.proposalId !== undefined && object.proposalId !== null) { + message.proposalId = object.proposalId as Long; + } else { + message.proposalId = Long.UZERO; + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } else { + message.voter = ""; + } + if (object.options !== undefined && object.options !== null) { + for (const e of object.options) { + message.options.push(WeightedVoteOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseMsgVoteWeightedResponse: object = {}; + +export const MsgVoteWeightedResponse = { + encode(_: MsgVoteWeightedResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgVoteWeightedResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgVoteWeightedResponse } as MsgVoteWeightedResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgVoteWeightedResponse { + const message = { ...baseMsgVoteWeightedResponse } as MsgVoteWeightedResponse; + return message; + }, + + toJSON(_: MsgVoteWeightedResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgVoteWeightedResponse { + const message = { ...baseMsgVoteWeightedResponse } as MsgVoteWeightedResponse; + return message; + }, +}; + +const baseMsgDeposit: object = { proposalId: Long.UZERO, depositor: "" }; + +export const MsgDeposit = { + encode(message: MsgDeposit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.proposalId.isZero()) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.depositor !== "") { + writer.uint32(18).string(message.depositor); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgDeposit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgDeposit } as MsgDeposit; + message.amount = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64() as Long; + break; + case 2: + message.depositor = reader.string(); + break; + case 3: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgDeposit { + const message = { ...baseMsgDeposit } as MsgDeposit; + message.amount = []; + if (object.proposalId !== undefined && object.proposalId !== null) { + message.proposalId = Long.fromString(object.proposalId); + } else { + message.proposalId = Long.UZERO; + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = String(object.depositor); + } else { + message.depositor = ""; + } + if (object.amount !== undefined && object.amount !== null) { + for (const e of object.amount) { + message.amount.push(Coin.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: MsgDeposit): unknown { + const obj: any = {}; + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.depositor !== undefined && (obj.depositor = message.depositor); + if (message.amount) { + obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.amount = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): MsgDeposit { + const message = { ...baseMsgDeposit } as MsgDeposit; + message.amount = []; + if (object.proposalId !== undefined && object.proposalId !== null) { + message.proposalId = object.proposalId as Long; + } else { + message.proposalId = Long.UZERO; + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } else { + message.depositor = ""; + } + if (object.amount !== undefined && object.amount !== null) { + for (const e of object.amount) { + message.amount.push(Coin.fromPartial(e)); + } + } + return message; + }, +}; + +const baseMsgDepositResponse: object = {}; + +export const MsgDepositResponse = { + encode(_: MsgDepositResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgDepositResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgDepositResponse } as MsgDepositResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgDepositResponse { + const message = { ...baseMsgDepositResponse } as MsgDepositResponse; + return message; + }, + + toJSON(_: MsgDepositResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgDepositResponse { + const message = { ...baseMsgDepositResponse } as MsgDepositResponse; + return message; + }, +}; + +/** Msg defines the bank Msg service. */ +export interface Msg { + /** SubmitProposal defines a method to create new proposal given a content. */ + SubmitProposal(request: MsgSubmitProposal): Promise; + /** Vote defines a method to add a vote on a specific proposal. */ + Vote(request: MsgVote): Promise; + /** VoteWeighted defines a method to add a weighted vote on a specific proposal. */ + VoteWeighted(request: MsgVoteWeighted): Promise; + /** Deposit defines a method to add deposit on a specific proposal. */ + Deposit(request: MsgDeposit): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.SubmitProposal = this.SubmitProposal.bind(this); + this.Vote = this.Vote.bind(this); + this.VoteWeighted = this.VoteWeighted.bind(this); + this.Deposit = this.Deposit.bind(this); + } + SubmitProposal(request: MsgSubmitProposal): Promise { + const data = MsgSubmitProposal.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "SubmitProposal", data); + return promise.then((data) => MsgSubmitProposalResponse.decode(new _m0.Reader(data))); + } + + Vote(request: MsgVote): Promise { + const data = MsgVote.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "Vote", data); + return promise.then((data) => MsgVoteResponse.decode(new _m0.Reader(data))); + } + + VoteWeighted(request: MsgVoteWeighted): Promise { + const data = MsgVoteWeighted.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "VoteWeighted", data); + return promise.then((data) => MsgVoteWeightedResponse.decode(new _m0.Reader(data))); + } + + Deposit(request: MsgDeposit): Promise { + const data = MsgDeposit.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "Deposit", data); + return promise.then((data) => MsgDepositResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/mint/v1beta1/genesis.ts b/src/cosmos/mint/v1beta1/genesis.ts new file mode 100644 index 00000000..418db38d --- /dev/null +++ b/src/cosmos/mint/v1beta1/genesis.ts @@ -0,0 +1,102 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Minter, Params } from "../../../cosmos/mint/v1beta1/mint"; + +export const protobufPackage = "cosmos.mint.v1beta1"; + +/** GenesisState defines the mint module's genesis state. */ +export interface GenesisState { + /** minter is a space for holding current inflation information. */ + minter?: Minter; + /** params defines all the paramaters of the module. */ + params?: Params; +} + +const baseGenesisState: object = {}; + +export const GenesisState = { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.minter !== undefined) { + Minter.encode(message.minter, writer.uint32(10).fork()).ldelim(); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGenesisState } as GenesisState; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.minter = Minter.decode(reader, reader.uint32()); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + if (object.minter !== undefined && object.minter !== null) { + message.minter = Minter.fromJSON(object.minter); + } else { + message.minter = undefined; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + return message; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.minter !== undefined && (obj.minter = message.minter ? Minter.toJSON(message.minter) : undefined); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + if (object.minter !== undefined && object.minter !== null) { + message.minter = Minter.fromPartial(object.minter); + } else { + message.minter = undefined; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/mint/v1beta1/mint.ts b/src/cosmos/mint/v1beta1/mint.ts new file mode 100644 index 00000000..3f3740e5 --- /dev/null +++ b/src/cosmos/mint/v1beta1/mint.ts @@ -0,0 +1,265 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.mint.v1beta1"; + +/** Minter represents the minting state. */ +export interface Minter { + /** current annual inflation rate */ + inflation: string; + /** current annual expected provisions */ + annualProvisions: string; +} + +/** Params holds parameters for the mint module. */ +export interface Params { + /** type of coin to mint */ + mintDenom: string; + /** maximum annual change in inflation rate */ + inflationRateChange: string; + /** maximum inflation rate */ + inflationMax: string; + /** minimum inflation rate */ + inflationMin: string; + /** goal of percent bonded atoms */ + goalBonded: string; + /** expected blocks per year */ + blocksPerYear: Long; +} + +const baseMinter: object = { inflation: "", annualProvisions: "" }; + +export const Minter = { + encode(message: Minter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.inflation !== "") { + writer.uint32(10).string(message.inflation); + } + if (message.annualProvisions !== "") { + writer.uint32(18).string(message.annualProvisions); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Minter { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMinter } as Minter; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inflation = reader.string(); + break; + case 2: + message.annualProvisions = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Minter { + const message = { ...baseMinter } as Minter; + if (object.inflation !== undefined && object.inflation !== null) { + message.inflation = String(object.inflation); + } else { + message.inflation = ""; + } + if (object.annualProvisions !== undefined && object.annualProvisions !== null) { + message.annualProvisions = String(object.annualProvisions); + } else { + message.annualProvisions = ""; + } + return message; + }, + + toJSON(message: Minter): unknown { + const obj: any = {}; + message.inflation !== undefined && (obj.inflation = message.inflation); + message.annualProvisions !== undefined && (obj.annualProvisions = message.annualProvisions); + return obj; + }, + + fromPartial(object: DeepPartial): Minter { + const message = { ...baseMinter } as Minter; + if (object.inflation !== undefined && object.inflation !== null) { + message.inflation = object.inflation; + } else { + message.inflation = ""; + } + if (object.annualProvisions !== undefined && object.annualProvisions !== null) { + message.annualProvisions = object.annualProvisions; + } else { + message.annualProvisions = ""; + } + return message; + }, +}; + +const baseParams: object = { + mintDenom: "", + inflationRateChange: "", + inflationMax: "", + inflationMin: "", + goalBonded: "", + blocksPerYear: Long.UZERO, +}; + +export const Params = { + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.mintDenom !== "") { + writer.uint32(10).string(message.mintDenom); + } + if (message.inflationRateChange !== "") { + writer.uint32(18).string(message.inflationRateChange); + } + if (message.inflationMax !== "") { + writer.uint32(26).string(message.inflationMax); + } + if (message.inflationMin !== "") { + writer.uint32(34).string(message.inflationMin); + } + if (message.goalBonded !== "") { + writer.uint32(42).string(message.goalBonded); + } + if (!message.blocksPerYear.isZero()) { + writer.uint32(48).uint64(message.blocksPerYear); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseParams } as Params; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mintDenom = reader.string(); + break; + case 2: + message.inflationRateChange = reader.string(); + break; + case 3: + message.inflationMax = reader.string(); + break; + case 4: + message.inflationMin = reader.string(); + break; + case 5: + message.goalBonded = reader.string(); + break; + case 6: + message.blocksPerYear = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Params { + const message = { ...baseParams } as Params; + if (object.mintDenom !== undefined && object.mintDenom !== null) { + message.mintDenom = String(object.mintDenom); + } else { + message.mintDenom = ""; + } + if (object.inflationRateChange !== undefined && object.inflationRateChange !== null) { + message.inflationRateChange = String(object.inflationRateChange); + } else { + message.inflationRateChange = ""; + } + if (object.inflationMax !== undefined && object.inflationMax !== null) { + message.inflationMax = String(object.inflationMax); + } else { + message.inflationMax = ""; + } + if (object.inflationMin !== undefined && object.inflationMin !== null) { + message.inflationMin = String(object.inflationMin); + } else { + message.inflationMin = ""; + } + if (object.goalBonded !== undefined && object.goalBonded !== null) { + message.goalBonded = String(object.goalBonded); + } else { + message.goalBonded = ""; + } + if (object.blocksPerYear !== undefined && object.blocksPerYear !== null) { + message.blocksPerYear = Long.fromString(object.blocksPerYear); + } else { + message.blocksPerYear = Long.UZERO; + } + return message; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + message.mintDenom !== undefined && (obj.mintDenom = message.mintDenom); + message.inflationRateChange !== undefined && (obj.inflationRateChange = message.inflationRateChange); + message.inflationMax !== undefined && (obj.inflationMax = message.inflationMax); + message.inflationMin !== undefined && (obj.inflationMin = message.inflationMin); + message.goalBonded !== undefined && (obj.goalBonded = message.goalBonded); + message.blocksPerYear !== undefined && + (obj.blocksPerYear = (message.blocksPerYear || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): Params { + const message = { ...baseParams } as Params; + if (object.mintDenom !== undefined && object.mintDenom !== null) { + message.mintDenom = object.mintDenom; + } else { + message.mintDenom = ""; + } + if (object.inflationRateChange !== undefined && object.inflationRateChange !== null) { + message.inflationRateChange = object.inflationRateChange; + } else { + message.inflationRateChange = ""; + } + if (object.inflationMax !== undefined && object.inflationMax !== null) { + message.inflationMax = object.inflationMax; + } else { + message.inflationMax = ""; + } + if (object.inflationMin !== undefined && object.inflationMin !== null) { + message.inflationMin = object.inflationMin; + } else { + message.inflationMin = ""; + } + if (object.goalBonded !== undefined && object.goalBonded !== null) { + message.goalBonded = object.goalBonded; + } else { + message.goalBonded = ""; + } + if (object.blocksPerYear !== undefined && object.blocksPerYear !== null) { + message.blocksPerYear = object.blocksPerYear as Long; + } else { + message.blocksPerYear = Long.UZERO; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/mint/v1beta1/query.ts b/src/cosmos/mint/v1beta1/query.ts new file mode 100644 index 00000000..3758c6dd --- /dev/null +++ b/src/cosmos/mint/v1beta1/query.ts @@ -0,0 +1,415 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Params } from "../../../cosmos/mint/v1beta1/mint"; + +export const protobufPackage = "cosmos.mint.v1beta1"; + +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} + +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params defines the parameters of the module. */ + params?: Params; +} + +/** QueryInflationRequest is the request type for the Query/Inflation RPC method. */ +export interface QueryInflationRequest {} + +/** + * QueryInflationResponse is the response type for the Query/Inflation RPC + * method. + */ +export interface QueryInflationResponse { + /** inflation is the current minting inflation value. */ + inflation: Uint8Array; +} + +/** + * QueryAnnualProvisionsRequest is the request type for the + * Query/AnnualProvisions RPC method. + */ +export interface QueryAnnualProvisionsRequest {} + +/** + * QueryAnnualProvisionsResponse is the response type for the + * Query/AnnualProvisions RPC method. + */ +export interface QueryAnnualProvisionsResponse { + /** annual_provisions is the current minting annual provisions value. */ + annualProvisions: Uint8Array; +} + +const baseQueryParamsRequest: object = {}; + +export const QueryParamsRequest = { + encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + return message; + }, + + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + return message; + }, +}; + +const baseQueryParamsResponse: object = {}; + +export const QueryParamsResponse = { + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + return message; + }, + + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + return message; + }, +}; + +const baseQueryInflationRequest: object = {}; + +export const QueryInflationRequest = { + encode(_: QueryInflationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryInflationRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryInflationRequest } as QueryInflationRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryInflationRequest { + const message = { ...baseQueryInflationRequest } as QueryInflationRequest; + return message; + }, + + toJSON(_: QueryInflationRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): QueryInflationRequest { + const message = { ...baseQueryInflationRequest } as QueryInflationRequest; + return message; + }, +}; + +const baseQueryInflationResponse: object = {}; + +export const QueryInflationResponse = { + encode(message: QueryInflationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.inflation.length !== 0) { + writer.uint32(10).bytes(message.inflation); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryInflationResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryInflationResponse } as QueryInflationResponse; + message.inflation = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.inflation = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryInflationResponse { + const message = { ...baseQueryInflationResponse } as QueryInflationResponse; + message.inflation = new Uint8Array(); + if (object.inflation !== undefined && object.inflation !== null) { + message.inflation = bytesFromBase64(object.inflation); + } + return message; + }, + + toJSON(message: QueryInflationResponse): unknown { + const obj: any = {}; + message.inflation !== undefined && + (obj.inflation = base64FromBytes( + message.inflation !== undefined ? message.inflation : new Uint8Array(), + )); + return obj; + }, + + fromPartial(object: DeepPartial): QueryInflationResponse { + const message = { ...baseQueryInflationResponse } as QueryInflationResponse; + if (object.inflation !== undefined && object.inflation !== null) { + message.inflation = object.inflation; + } else { + message.inflation = new Uint8Array(); + } + return message; + }, +}; + +const baseQueryAnnualProvisionsRequest: object = {}; + +export const QueryAnnualProvisionsRequest = { + encode(_: QueryAnnualProvisionsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAnnualProvisionsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryAnnualProvisionsRequest } as QueryAnnualProvisionsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryAnnualProvisionsRequest { + const message = { ...baseQueryAnnualProvisionsRequest } as QueryAnnualProvisionsRequest; + return message; + }, + + toJSON(_: QueryAnnualProvisionsRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): QueryAnnualProvisionsRequest { + const message = { ...baseQueryAnnualProvisionsRequest } as QueryAnnualProvisionsRequest; + return message; + }, +}; + +const baseQueryAnnualProvisionsResponse: object = {}; + +export const QueryAnnualProvisionsResponse = { + encode(message: QueryAnnualProvisionsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.annualProvisions.length !== 0) { + writer.uint32(10).bytes(message.annualProvisions); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAnnualProvisionsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryAnnualProvisionsResponse } as QueryAnnualProvisionsResponse; + message.annualProvisions = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.annualProvisions = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAnnualProvisionsResponse { + const message = { ...baseQueryAnnualProvisionsResponse } as QueryAnnualProvisionsResponse; + message.annualProvisions = new Uint8Array(); + if (object.annualProvisions !== undefined && object.annualProvisions !== null) { + message.annualProvisions = bytesFromBase64(object.annualProvisions); + } + return message; + }, + + toJSON(message: QueryAnnualProvisionsResponse): unknown { + const obj: any = {}; + message.annualProvisions !== undefined && + (obj.annualProvisions = base64FromBytes( + message.annualProvisions !== undefined ? message.annualProvisions : new Uint8Array(), + )); + return obj; + }, + + fromPartial(object: DeepPartial): QueryAnnualProvisionsResponse { + const message = { ...baseQueryAnnualProvisionsResponse } as QueryAnnualProvisionsResponse; + if (object.annualProvisions !== undefined && object.annualProvisions !== null) { + message.annualProvisions = object.annualProvisions; + } else { + message.annualProvisions = new Uint8Array(); + } + return message; + }, +}; + +/** Query provides defines the gRPC querier service. */ +export interface Query { + /** Params returns the total set of minting parameters. */ + Params(request: QueryParamsRequest): Promise; + /** Inflation returns the current minting inflation value. */ + Inflation(request: QueryInflationRequest): Promise; + /** AnnualProvisions current minting annual provisions value. */ + AnnualProvisions(request: QueryAnnualProvisionsRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Params = this.Params.bind(this); + this.Inflation = this.Inflation.bind(this); + this.AnnualProvisions = this.AnnualProvisions.bind(this); + } + Params(request: QueryParamsRequest): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.mint.v1beta1.Query", "Params", data); + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + } + + Inflation(request: QueryInflationRequest): Promise { + const data = QueryInflationRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.mint.v1beta1.Query", "Inflation", data); + return promise.then((data) => QueryInflationResponse.decode(new _m0.Reader(data))); + } + + AnnualProvisions(request: QueryAnnualProvisionsRequest): Promise { + const data = QueryAnnualProvisionsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.mint.v1beta1.Query", "AnnualProvisions", data); + return promise.then((data) => QueryAnnualProvisionsResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/params/v1beta1/params.ts b/src/cosmos/params/v1beta1/params.ts new file mode 100644 index 00000000..5d61cfc2 --- /dev/null +++ b/src/cosmos/params/v1beta1/params.ts @@ -0,0 +1,223 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.params.v1beta1"; + +/** ParameterChangeProposal defines a proposal to change one or more parameters. */ +export interface ParameterChangeProposal { + title: string; + description: string; + changes: ParamChange[]; +} + +/** + * ParamChange defines an individual parameter change, for use in + * ParameterChangeProposal. + */ +export interface ParamChange { + subspace: string; + key: string; + value: string; +} + +const baseParameterChangeProposal: object = { title: "", description: "" }; + +export const ParameterChangeProposal = { + encode(message: ParameterChangeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + for (const v of message.changes) { + ParamChange.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ParameterChangeProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseParameterChangeProposal } as ParameterChangeProposal; + message.changes = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.changes.push(ParamChange.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ParameterChangeProposal { + const message = { ...baseParameterChangeProposal } as ParameterChangeProposal; + message.changes = []; + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.changes !== undefined && object.changes !== null) { + for (const e of object.changes) { + message.changes.push(ParamChange.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: ParameterChangeProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + if (message.changes) { + obj.changes = message.changes.map((e) => (e ? ParamChange.toJSON(e) : undefined)); + } else { + obj.changes = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ParameterChangeProposal { + const message = { ...baseParameterChangeProposal } as ParameterChangeProposal; + message.changes = []; + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.changes !== undefined && object.changes !== null) { + for (const e of object.changes) { + message.changes.push(ParamChange.fromPartial(e)); + } + } + return message; + }, +}; + +const baseParamChange: object = { subspace: "", key: "", value: "" }; + +export const ParamChange = { + encode(message: ParamChange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.subspace !== "") { + writer.uint32(10).string(message.subspace); + } + if (message.key !== "") { + writer.uint32(18).string(message.key); + } + if (message.value !== "") { + writer.uint32(26).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ParamChange { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseParamChange } as ParamChange; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subspace = reader.string(); + break; + case 2: + message.key = reader.string(); + break; + case 3: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ParamChange { + const message = { ...baseParamChange } as ParamChange; + if (object.subspace !== undefined && object.subspace !== null) { + message.subspace = String(object.subspace); + } else { + message.subspace = ""; + } + if (object.key !== undefined && object.key !== null) { + message.key = String(object.key); + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = String(object.value); + } else { + message.value = ""; + } + return message; + }, + + toJSON(message: ParamChange): unknown { + const obj: any = {}; + message.subspace !== undefined && (obj.subspace = message.subspace); + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial(object: DeepPartial): ParamChange { + const message = { ...baseParamChange } as ParamChange; + if (object.subspace !== undefined && object.subspace !== null) { + message.subspace = object.subspace; + } else { + message.subspace = ""; + } + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } else { + message.value = ""; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/params/v1beta1/query.ts b/src/cosmos/params/v1beta1/query.ts new file mode 100644 index 00000000..53ea9a63 --- /dev/null +++ b/src/cosmos/params/v1beta1/query.ts @@ -0,0 +1,190 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { ParamChange } from "../../../cosmos/params/v1beta1/params"; + +export const protobufPackage = "cosmos.params.v1beta1"; + +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequest { + /** subspace defines the module to query the parameter for. */ + subspace: string; + /** key defines the key of the parameter in the subspace. */ + key: string; +} + +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** param defines the queried parameter. */ + param?: ParamChange; +} + +const baseQueryParamsRequest: object = { subspace: "", key: "" }; + +export const QueryParamsRequest = { + encode(message: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.subspace !== "") { + writer.uint32(10).string(message.subspace); + } + if (message.key !== "") { + writer.uint32(18).string(message.key); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subspace = reader.string(); + break; + case 2: + message.key = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + if (object.subspace !== undefined && object.subspace !== null) { + message.subspace = String(object.subspace); + } else { + message.subspace = ""; + } + if (object.key !== undefined && object.key !== null) { + message.key = String(object.key); + } else { + message.key = ""; + } + return message; + }, + + toJSON(message: QueryParamsRequest): unknown { + const obj: any = {}; + message.subspace !== undefined && (obj.subspace = message.subspace); + message.key !== undefined && (obj.key = message.key); + return obj; + }, + + fromPartial(object: DeepPartial): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + if (object.subspace !== undefined && object.subspace !== null) { + message.subspace = object.subspace; + } else { + message.subspace = ""; + } + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = ""; + } + return message; + }, +}; + +const baseQueryParamsResponse: object = {}; + +export const QueryParamsResponse = { + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.param !== undefined) { + ParamChange.encode(message.param, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.param = ParamChange.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.param !== undefined && object.param !== null) { + message.param = ParamChange.fromJSON(object.param); + } else { + message.param = undefined; + } + return message; + }, + + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.param !== undefined && + (obj.param = message.param ? ParamChange.toJSON(message.param) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.param !== undefined && object.param !== null) { + message.param = ParamChange.fromPartial(object.param); + } else { + message.param = undefined; + } + return message; + }, +}; + +/** Query defines the gRPC querier service. */ +export interface Query { + /** + * Params queries a specific parameter of a module, given its subspace and + * key. + */ + Params(request: QueryParamsRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Params = this.Params.bind(this); + } + Params(request: QueryParamsRequest): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.params.v1beta1.Query", "Params", data); + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/slashing/v1beta1/genesis.ts b/src/cosmos/slashing/v1beta1/genesis.ts new file mode 100644 index 00000000..f19921e7 --- /dev/null +++ b/src/cosmos/slashing/v1beta1/genesis.ts @@ -0,0 +1,394 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Params, ValidatorSigningInfo } from "../../../cosmos/slashing/v1beta1/slashing"; + +export const protobufPackage = "cosmos.slashing.v1beta1"; + +/** GenesisState defines the slashing module's genesis state. */ +export interface GenesisState { + /** params defines all the paramaters of related to deposit. */ + params?: Params; + /** + * signing_infos represents a map between validator addresses and their + * signing infos. + */ + signingInfos: SigningInfo[]; + /** + * signing_infos represents a map between validator addresses and their + * missed blocks. + */ + missedBlocks: ValidatorMissedBlocks[]; +} + +/** SigningInfo stores validator signing info of corresponding address. */ +export interface SigningInfo { + /** address is the validator address. */ + address: string; + /** validator_signing_info represents the signing info of this validator. */ + validatorSigningInfo?: ValidatorSigningInfo; +} + +/** + * ValidatorMissedBlocks contains array of missed blocks of corresponding + * address. + */ +export interface ValidatorMissedBlocks { + /** address is the validator address. */ + address: string; + /** missed_blocks is an array of missed blocks by the validator. */ + missedBlocks: MissedBlock[]; +} + +/** MissedBlock contains height and missed status as boolean. */ +export interface MissedBlock { + /** index is the height at which the block was missed. */ + index: Long; + /** missed is the missed status. */ + missed: boolean; +} + +const baseGenesisState: object = {}; + +export const GenesisState = { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.signingInfos) { + SigningInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.missedBlocks) { + ValidatorMissedBlocks.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGenesisState } as GenesisState; + message.signingInfos = []; + message.missedBlocks = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.signingInfos.push(SigningInfo.decode(reader, reader.uint32())); + break; + case 3: + message.missedBlocks.push(ValidatorMissedBlocks.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.signingInfos = []; + message.missedBlocks = []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + if (object.signingInfos !== undefined && object.signingInfos !== null) { + for (const e of object.signingInfos) { + message.signingInfos.push(SigningInfo.fromJSON(e)); + } + } + if (object.missedBlocks !== undefined && object.missedBlocks !== null) { + for (const e of object.missedBlocks) { + message.missedBlocks.push(ValidatorMissedBlocks.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + if (message.signingInfos) { + obj.signingInfos = message.signingInfos.map((e) => (e ? SigningInfo.toJSON(e) : undefined)); + } else { + obj.signingInfos = []; + } + if (message.missedBlocks) { + obj.missedBlocks = message.missedBlocks.map((e) => (e ? ValidatorMissedBlocks.toJSON(e) : undefined)); + } else { + obj.missedBlocks = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.signingInfos = []; + message.missedBlocks = []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + if (object.signingInfos !== undefined && object.signingInfos !== null) { + for (const e of object.signingInfos) { + message.signingInfos.push(SigningInfo.fromPartial(e)); + } + } + if (object.missedBlocks !== undefined && object.missedBlocks !== null) { + for (const e of object.missedBlocks) { + message.missedBlocks.push(ValidatorMissedBlocks.fromPartial(e)); + } + } + return message; + }, +}; + +const baseSigningInfo: object = { address: "" }; + +export const SigningInfo = { + encode(message: SigningInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.validatorSigningInfo !== undefined) { + ValidatorSigningInfo.encode(message.validatorSigningInfo, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SigningInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSigningInfo } as SigningInfo; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.validatorSigningInfo = ValidatorSigningInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SigningInfo { + const message = { ...baseSigningInfo } as SigningInfo; + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.validatorSigningInfo !== undefined && object.validatorSigningInfo !== null) { + message.validatorSigningInfo = ValidatorSigningInfo.fromJSON(object.validatorSigningInfo); + } else { + message.validatorSigningInfo = undefined; + } + return message; + }, + + toJSON(message: SigningInfo): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.validatorSigningInfo !== undefined && + (obj.validatorSigningInfo = message.validatorSigningInfo + ? ValidatorSigningInfo.toJSON(message.validatorSigningInfo) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): SigningInfo { + const message = { ...baseSigningInfo } as SigningInfo; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.validatorSigningInfo !== undefined && object.validatorSigningInfo !== null) { + message.validatorSigningInfo = ValidatorSigningInfo.fromPartial(object.validatorSigningInfo); + } else { + message.validatorSigningInfo = undefined; + } + return message; + }, +}; + +const baseValidatorMissedBlocks: object = { address: "" }; + +export const ValidatorMissedBlocks = { + encode(message: ValidatorMissedBlocks, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + for (const v of message.missedBlocks) { + MissedBlock.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorMissedBlocks { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseValidatorMissedBlocks } as ValidatorMissedBlocks; + message.missedBlocks = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.missedBlocks.push(MissedBlock.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ValidatorMissedBlocks { + const message = { ...baseValidatorMissedBlocks } as ValidatorMissedBlocks; + message.missedBlocks = []; + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.missedBlocks !== undefined && object.missedBlocks !== null) { + for (const e of object.missedBlocks) { + message.missedBlocks.push(MissedBlock.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: ValidatorMissedBlocks): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + if (message.missedBlocks) { + obj.missedBlocks = message.missedBlocks.map((e) => (e ? MissedBlock.toJSON(e) : undefined)); + } else { + obj.missedBlocks = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ValidatorMissedBlocks { + const message = { ...baseValidatorMissedBlocks } as ValidatorMissedBlocks; + message.missedBlocks = []; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.missedBlocks !== undefined && object.missedBlocks !== null) { + for (const e of object.missedBlocks) { + message.missedBlocks.push(MissedBlock.fromPartial(e)); + } + } + return message; + }, +}; + +const baseMissedBlock: object = { index: Long.ZERO, missed: false }; + +export const MissedBlock = { + encode(message: MissedBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.index.isZero()) { + writer.uint32(8).int64(message.index); + } + if (message.missed === true) { + writer.uint32(16).bool(message.missed); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MissedBlock { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMissedBlock } as MissedBlock; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.int64() as Long; + break; + case 2: + message.missed = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MissedBlock { + const message = { ...baseMissedBlock } as MissedBlock; + if (object.index !== undefined && object.index !== null) { + message.index = Long.fromString(object.index); + } else { + message.index = Long.ZERO; + } + if (object.missed !== undefined && object.missed !== null) { + message.missed = Boolean(object.missed); + } else { + message.missed = false; + } + return message; + }, + + toJSON(message: MissedBlock): unknown { + const obj: any = {}; + message.index !== undefined && (obj.index = (message.index || Long.ZERO).toString()); + message.missed !== undefined && (obj.missed = message.missed); + return obj; + }, + + fromPartial(object: DeepPartial): MissedBlock { + const message = { ...baseMissedBlock } as MissedBlock; + if (object.index !== undefined && object.index !== null) { + message.index = object.index as Long; + } else { + message.index = Long.ZERO; + } + if (object.missed !== undefined && object.missed !== null) { + message.missed = object.missed; + } else { + message.missed = false; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/slashing/v1beta1/query.ts b/src/cosmos/slashing/v1beta1/query.ts new file mode 100644 index 00000000..cf0d152b --- /dev/null +++ b/src/cosmos/slashing/v1beta1/query.ts @@ -0,0 +1,450 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Params, ValidatorSigningInfo } from "../../../cosmos/slashing/v1beta1/slashing"; +import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; + +export const protobufPackage = "cosmos.slashing.v1beta1"; + +/** QueryParamsRequest is the request type for the Query/Params RPC method */ +export interface QueryParamsRequest {} + +/** QueryParamsResponse is the response type for the Query/Params RPC method */ +export interface QueryParamsResponse { + params?: Params; +} + +/** + * QuerySigningInfoRequest is the request type for the Query/SigningInfo RPC + * method + */ +export interface QuerySigningInfoRequest { + /** cons_address is the address to query signing info of */ + consAddress: string; +} + +/** + * QuerySigningInfoResponse is the response type for the Query/SigningInfo RPC + * method + */ +export interface QuerySigningInfoResponse { + /** val_signing_info is the signing info of requested val cons address */ + valSigningInfo?: ValidatorSigningInfo; +} + +/** + * QuerySigningInfosRequest is the request type for the Query/SigningInfos RPC + * method + */ +export interface QuerySigningInfosRequest { + pagination?: PageRequest; +} + +/** + * QuerySigningInfosResponse is the response type for the Query/SigningInfos RPC + * method + */ +export interface QuerySigningInfosResponse { + /** info is the signing info of all validators */ + info: ValidatorSigningInfo[]; + pagination?: PageResponse; +} + +const baseQueryParamsRequest: object = {}; + +export const QueryParamsRequest = { + encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + return message; + }, + + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + return message; + }, +}; + +const baseQueryParamsResponse: object = {}; + +export const QueryParamsResponse = { + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + return message; + }, + + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + return message; + }, +}; + +const baseQuerySigningInfoRequest: object = { consAddress: "" }; + +export const QuerySigningInfoRequest = { + encode(message: QuerySigningInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.consAddress !== "") { + writer.uint32(10).string(message.consAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySigningInfoRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQuerySigningInfoRequest } as QuerySigningInfoRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QuerySigningInfoRequest { + const message = { ...baseQuerySigningInfoRequest } as QuerySigningInfoRequest; + if (object.consAddress !== undefined && object.consAddress !== null) { + message.consAddress = String(object.consAddress); + } else { + message.consAddress = ""; + } + return message; + }, + + toJSON(message: QuerySigningInfoRequest): unknown { + const obj: any = {}; + message.consAddress !== undefined && (obj.consAddress = message.consAddress); + return obj; + }, + + fromPartial(object: DeepPartial): QuerySigningInfoRequest { + const message = { ...baseQuerySigningInfoRequest } as QuerySigningInfoRequest; + if (object.consAddress !== undefined && object.consAddress !== null) { + message.consAddress = object.consAddress; + } else { + message.consAddress = ""; + } + return message; + }, +}; + +const baseQuerySigningInfoResponse: object = {}; + +export const QuerySigningInfoResponse = { + encode(message: QuerySigningInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.valSigningInfo !== undefined) { + ValidatorSigningInfo.encode(message.valSigningInfo, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySigningInfoResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQuerySigningInfoResponse } as QuerySigningInfoResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.valSigningInfo = ValidatorSigningInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QuerySigningInfoResponse { + const message = { ...baseQuerySigningInfoResponse } as QuerySigningInfoResponse; + if (object.valSigningInfo !== undefined && object.valSigningInfo !== null) { + message.valSigningInfo = ValidatorSigningInfo.fromJSON(object.valSigningInfo); + } else { + message.valSigningInfo = undefined; + } + return message; + }, + + toJSON(message: QuerySigningInfoResponse): unknown { + const obj: any = {}; + message.valSigningInfo !== undefined && + (obj.valSigningInfo = message.valSigningInfo + ? ValidatorSigningInfo.toJSON(message.valSigningInfo) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QuerySigningInfoResponse { + const message = { ...baseQuerySigningInfoResponse } as QuerySigningInfoResponse; + if (object.valSigningInfo !== undefined && object.valSigningInfo !== null) { + message.valSigningInfo = ValidatorSigningInfo.fromPartial(object.valSigningInfo); + } else { + message.valSigningInfo = undefined; + } + return message; + }, +}; + +const baseQuerySigningInfosRequest: object = {}; + +export const QuerySigningInfosRequest = { + encode(message: QuerySigningInfosRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySigningInfosRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQuerySigningInfosRequest } as QuerySigningInfosRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QuerySigningInfosRequest { + const message = { ...baseQuerySigningInfosRequest } as QuerySigningInfosRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QuerySigningInfosRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QuerySigningInfosRequest { + const message = { ...baseQuerySigningInfosRequest } as QuerySigningInfosRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQuerySigningInfosResponse: object = {}; + +export const QuerySigningInfosResponse = { + encode(message: QuerySigningInfosResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.info) { + ValidatorSigningInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySigningInfosResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQuerySigningInfosResponse } as QuerySigningInfosResponse; + message.info = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.info.push(ValidatorSigningInfo.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QuerySigningInfosResponse { + const message = { ...baseQuerySigningInfosResponse } as QuerySigningInfosResponse; + message.info = []; + if (object.info !== undefined && object.info !== null) { + for (const e of object.info) { + message.info.push(ValidatorSigningInfo.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QuerySigningInfosResponse): unknown { + const obj: any = {}; + if (message.info) { + obj.info = message.info.map((e) => (e ? ValidatorSigningInfo.toJSON(e) : undefined)); + } else { + obj.info = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QuerySigningInfosResponse { + const message = { ...baseQuerySigningInfosResponse } as QuerySigningInfosResponse; + message.info = []; + if (object.info !== undefined && object.info !== null) { + for (const e of object.info) { + message.info.push(ValidatorSigningInfo.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +/** Query provides defines the gRPC querier service */ +export interface Query { + /** Params queries the parameters of slashing module */ + Params(request: QueryParamsRequest): Promise; + /** SigningInfo queries the signing info of given cons address */ + SigningInfo(request: QuerySigningInfoRequest): Promise; + /** SigningInfos queries signing info of all validators */ + SigningInfos(request: QuerySigningInfosRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Params = this.Params.bind(this); + this.SigningInfo = this.SigningInfo.bind(this); + this.SigningInfos = this.SigningInfos.bind(this); + } + Params(request: QueryParamsRequest): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.slashing.v1beta1.Query", "Params", data); + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + } + + SigningInfo(request: QuerySigningInfoRequest): Promise { + const data = QuerySigningInfoRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.slashing.v1beta1.Query", "SigningInfo", data); + return promise.then((data) => QuerySigningInfoResponse.decode(new _m0.Reader(data))); + } + + SigningInfos(request: QuerySigningInfosRequest): Promise { + const data = QuerySigningInfosRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.slashing.v1beta1.Query", "SigningInfos", data); + return promise.then((data) => QuerySigningInfosResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/slashing/v1beta1/slashing.ts b/src/cosmos/slashing/v1beta1/slashing.ts new file mode 100644 index 00000000..714b99a5 --- /dev/null +++ b/src/cosmos/slashing/v1beta1/slashing.ts @@ -0,0 +1,400 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Duration } from "../../../google/protobuf/duration"; +import { Timestamp } from "../../../google/protobuf/timestamp"; + +export const protobufPackage = "cosmos.slashing.v1beta1"; + +/** + * ValidatorSigningInfo defines a validator's signing info for monitoring their + * liveness activity. + */ +export interface ValidatorSigningInfo { + address: string; + /** Height at which validator was first a candidate OR was unjailed */ + startHeight: Long; + /** + * Index which is incremented each time the validator was a bonded + * in a block and may have signed a precommit or not. This in conjunction with the + * `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. + */ + indexOffset: Long; + /** Timestamp until which the validator is jailed due to liveness downtime. */ + jailedUntil?: Date; + /** + * Whether or not a validator has been tombstoned (killed out of validator set). It is set + * once the validator commits an equivocation or for any other configured misbehiavor. + */ + tombstoned: boolean; + /** + * A counter kept to avoid unnecessary array reads. + * Note that `Sum(MissedBlocksBitArray)` always equals `MissedBlocksCounter`. + */ + missedBlocksCounter: Long; +} + +/** Params represents the parameters used for by the slashing module. */ +export interface Params { + signedBlocksWindow: Long; + minSignedPerWindow: Uint8Array; + downtimeJailDuration?: Duration; + slashFractionDoubleSign: Uint8Array; + slashFractionDowntime: Uint8Array; +} + +const baseValidatorSigningInfo: object = { + address: "", + startHeight: Long.ZERO, + indexOffset: Long.ZERO, + tombstoned: false, + missedBlocksCounter: Long.ZERO, +}; + +export const ValidatorSigningInfo = { + encode(message: ValidatorSigningInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (!message.startHeight.isZero()) { + writer.uint32(16).int64(message.startHeight); + } + if (!message.indexOffset.isZero()) { + writer.uint32(24).int64(message.indexOffset); + } + if (message.jailedUntil !== undefined) { + Timestamp.encode(toTimestamp(message.jailedUntil), writer.uint32(34).fork()).ldelim(); + } + if (message.tombstoned === true) { + writer.uint32(40).bool(message.tombstoned); + } + if (!message.missedBlocksCounter.isZero()) { + writer.uint32(48).int64(message.missedBlocksCounter); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSigningInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseValidatorSigningInfo } as ValidatorSigningInfo; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.startHeight = reader.int64() as Long; + break; + case 3: + message.indexOffset = reader.int64() as Long; + break; + case 4: + message.jailedUntil = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 5: + message.tombstoned = reader.bool(); + break; + case 6: + message.missedBlocksCounter = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ValidatorSigningInfo { + const message = { ...baseValidatorSigningInfo } as ValidatorSigningInfo; + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.startHeight !== undefined && object.startHeight !== null) { + message.startHeight = Long.fromString(object.startHeight); + } else { + message.startHeight = Long.ZERO; + } + if (object.indexOffset !== undefined && object.indexOffset !== null) { + message.indexOffset = Long.fromString(object.indexOffset); + } else { + message.indexOffset = Long.ZERO; + } + if (object.jailedUntil !== undefined && object.jailedUntil !== null) { + message.jailedUntil = fromJsonTimestamp(object.jailedUntil); + } else { + message.jailedUntil = undefined; + } + if (object.tombstoned !== undefined && object.tombstoned !== null) { + message.tombstoned = Boolean(object.tombstoned); + } else { + message.tombstoned = false; + } + if (object.missedBlocksCounter !== undefined && object.missedBlocksCounter !== null) { + message.missedBlocksCounter = Long.fromString(object.missedBlocksCounter); + } else { + message.missedBlocksCounter = Long.ZERO; + } + return message; + }, + + toJSON(message: ValidatorSigningInfo): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.startHeight !== undefined && (obj.startHeight = (message.startHeight || Long.ZERO).toString()); + message.indexOffset !== undefined && (obj.indexOffset = (message.indexOffset || Long.ZERO).toString()); + message.jailedUntil !== undefined && (obj.jailedUntil = message.jailedUntil.toISOString()); + message.tombstoned !== undefined && (obj.tombstoned = message.tombstoned); + message.missedBlocksCounter !== undefined && + (obj.missedBlocksCounter = (message.missedBlocksCounter || Long.ZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): ValidatorSigningInfo { + const message = { ...baseValidatorSigningInfo } as ValidatorSigningInfo; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.startHeight !== undefined && object.startHeight !== null) { + message.startHeight = object.startHeight as Long; + } else { + message.startHeight = Long.ZERO; + } + if (object.indexOffset !== undefined && object.indexOffset !== null) { + message.indexOffset = object.indexOffset as Long; + } else { + message.indexOffset = Long.ZERO; + } + if (object.jailedUntil !== undefined && object.jailedUntil !== null) { + message.jailedUntil = object.jailedUntil; + } else { + message.jailedUntil = undefined; + } + if (object.tombstoned !== undefined && object.tombstoned !== null) { + message.tombstoned = object.tombstoned; + } else { + message.tombstoned = false; + } + if (object.missedBlocksCounter !== undefined && object.missedBlocksCounter !== null) { + message.missedBlocksCounter = object.missedBlocksCounter as Long; + } else { + message.missedBlocksCounter = Long.ZERO; + } + return message; + }, +}; + +const baseParams: object = { signedBlocksWindow: Long.ZERO }; + +export const Params = { + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.signedBlocksWindow.isZero()) { + writer.uint32(8).int64(message.signedBlocksWindow); + } + if (message.minSignedPerWindow.length !== 0) { + writer.uint32(18).bytes(message.minSignedPerWindow); + } + if (message.downtimeJailDuration !== undefined) { + Duration.encode(message.downtimeJailDuration, writer.uint32(26).fork()).ldelim(); + } + if (message.slashFractionDoubleSign.length !== 0) { + writer.uint32(34).bytes(message.slashFractionDoubleSign); + } + if (message.slashFractionDowntime.length !== 0) { + writer.uint32(42).bytes(message.slashFractionDowntime); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseParams } as Params; + message.minSignedPerWindow = new Uint8Array(); + message.slashFractionDoubleSign = new Uint8Array(); + message.slashFractionDowntime = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signedBlocksWindow = reader.int64() as Long; + break; + case 2: + message.minSignedPerWindow = reader.bytes(); + break; + case 3: + message.downtimeJailDuration = Duration.decode(reader, reader.uint32()); + break; + case 4: + message.slashFractionDoubleSign = reader.bytes(); + break; + case 5: + message.slashFractionDowntime = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Params { + const message = { ...baseParams } as Params; + message.minSignedPerWindow = new Uint8Array(); + message.slashFractionDoubleSign = new Uint8Array(); + message.slashFractionDowntime = new Uint8Array(); + if (object.signedBlocksWindow !== undefined && object.signedBlocksWindow !== null) { + message.signedBlocksWindow = Long.fromString(object.signedBlocksWindow); + } else { + message.signedBlocksWindow = Long.ZERO; + } + if (object.minSignedPerWindow !== undefined && object.minSignedPerWindow !== null) { + message.minSignedPerWindow = bytesFromBase64(object.minSignedPerWindow); + } + if (object.downtimeJailDuration !== undefined && object.downtimeJailDuration !== null) { + message.downtimeJailDuration = Duration.fromJSON(object.downtimeJailDuration); + } else { + message.downtimeJailDuration = undefined; + } + if (object.slashFractionDoubleSign !== undefined && object.slashFractionDoubleSign !== null) { + message.slashFractionDoubleSign = bytesFromBase64(object.slashFractionDoubleSign); + } + if (object.slashFractionDowntime !== undefined && object.slashFractionDowntime !== null) { + message.slashFractionDowntime = bytesFromBase64(object.slashFractionDowntime); + } + return message; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + message.signedBlocksWindow !== undefined && + (obj.signedBlocksWindow = (message.signedBlocksWindow || Long.ZERO).toString()); + message.minSignedPerWindow !== undefined && + (obj.minSignedPerWindow = base64FromBytes( + message.minSignedPerWindow !== undefined ? message.minSignedPerWindow : new Uint8Array(), + )); + message.downtimeJailDuration !== undefined && + (obj.downtimeJailDuration = message.downtimeJailDuration + ? Duration.toJSON(message.downtimeJailDuration) + : undefined); + message.slashFractionDoubleSign !== undefined && + (obj.slashFractionDoubleSign = base64FromBytes( + message.slashFractionDoubleSign !== undefined ? message.slashFractionDoubleSign : new Uint8Array(), + )); + message.slashFractionDowntime !== undefined && + (obj.slashFractionDowntime = base64FromBytes( + message.slashFractionDowntime !== undefined ? message.slashFractionDowntime : new Uint8Array(), + )); + return obj; + }, + + fromPartial(object: DeepPartial): Params { + const message = { ...baseParams } as Params; + if (object.signedBlocksWindow !== undefined && object.signedBlocksWindow !== null) { + message.signedBlocksWindow = object.signedBlocksWindow as Long; + } else { + message.signedBlocksWindow = Long.ZERO; + } + if (object.minSignedPerWindow !== undefined && object.minSignedPerWindow !== null) { + message.minSignedPerWindow = object.minSignedPerWindow; + } else { + message.minSignedPerWindow = new Uint8Array(); + } + if (object.downtimeJailDuration !== undefined && object.downtimeJailDuration !== null) { + message.downtimeJailDuration = Duration.fromPartial(object.downtimeJailDuration); + } else { + message.downtimeJailDuration = undefined; + } + if (object.slashFractionDoubleSign !== undefined && object.slashFractionDoubleSign !== null) { + message.slashFractionDoubleSign = object.slashFractionDoubleSign; + } else { + message.slashFractionDoubleSign = new Uint8Array(); + } + if (object.slashFractionDowntime !== undefined && object.slashFractionDowntime !== null) { + message.slashFractionDowntime = object.slashFractionDowntime; + } else { + message.slashFractionDowntime = new Uint8Array(); + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function toTimestamp(date: Date): Timestamp { + const seconds = numberToLong(date.getTime() / 1_000); + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds.toNumber() * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function numberToLong(number: number) { + return Long.fromNumber(number); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/slashing/v1beta1/tx.ts b/src/cosmos/slashing/v1beta1/tx.ts new file mode 100644 index 00000000..d3d7322a --- /dev/null +++ b/src/cosmos/slashing/v1beta1/tx.ts @@ -0,0 +1,149 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.slashing.v1beta1"; + +/** MsgUnjail defines the Msg/Unjail request type */ +export interface MsgUnjail { + validatorAddr: string; +} + +/** MsgUnjailResponse defines the Msg/Unjail response type */ +export interface MsgUnjailResponse {} + +const baseMsgUnjail: object = { validatorAddr: "" }; + +export const MsgUnjail = { + encode(message: MsgUnjail, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddr !== "") { + writer.uint32(10).string(message.validatorAddr); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUnjail { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgUnjail } as MsgUnjail; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgUnjail { + const message = { ...baseMsgUnjail } as MsgUnjail; + if (object.validatorAddr !== undefined && object.validatorAddr !== null) { + message.validatorAddr = String(object.validatorAddr); + } else { + message.validatorAddr = ""; + } + return message; + }, + + toJSON(message: MsgUnjail): unknown { + const obj: any = {}; + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); + return obj; + }, + + fromPartial(object: DeepPartial): MsgUnjail { + const message = { ...baseMsgUnjail } as MsgUnjail; + if (object.validatorAddr !== undefined && object.validatorAddr !== null) { + message.validatorAddr = object.validatorAddr; + } else { + message.validatorAddr = ""; + } + return message; + }, +}; + +const baseMsgUnjailResponse: object = {}; + +export const MsgUnjailResponse = { + encode(_: MsgUnjailResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUnjailResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgUnjailResponse } as MsgUnjailResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgUnjailResponse { + const message = { ...baseMsgUnjailResponse } as MsgUnjailResponse; + return message; + }, + + toJSON(_: MsgUnjailResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgUnjailResponse { + const message = { ...baseMsgUnjailResponse } as MsgUnjailResponse; + return message; + }, +}; + +/** Msg defines the slashing Msg service. */ +export interface Msg { + /** + * Unjail defines a method for unjailing a jailed validator, thus returning + * them into the bonded validator set, so they can begin receiving provisions + * and rewards again. + */ + Unjail(request: MsgUnjail): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Unjail = this.Unjail.bind(this); + } + Unjail(request: MsgUnjail): Promise { + const data = MsgUnjail.encode(request).finish(); + const promise = this.rpc.request("cosmos.slashing.v1beta1.Msg", "Unjail", data); + return promise.then((data) => MsgUnjailResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/staking/v1beta1/genesis.ts b/src/cosmos/staking/v1beta1/genesis.ts new file mode 100644 index 00000000..7a058d27 --- /dev/null +++ b/src/cosmos/staking/v1beta1/genesis.ts @@ -0,0 +1,380 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { + Params, + Validator, + Delegation, + UnbondingDelegation, + Redelegation, +} from "../../../cosmos/staking/v1beta1/staking"; + +export const protobufPackage = "cosmos.staking.v1beta1"; + +/** GenesisState defines the staking module's genesis state. */ +export interface GenesisState { + /** params defines all the paramaters of related to deposit. */ + params?: Params; + /** + * last_total_power tracks the total amounts of bonded tokens recorded during + * the previous end block. + */ + lastTotalPower: Uint8Array; + /** + * last_validator_powers is a special index that provides a historical list + * of the last-block's bonded validators. + */ + lastValidatorPowers: LastValidatorPower[]; + /** delegations defines the validator set at genesis. */ + validators: Validator[]; + /** delegations defines the delegations active at genesis. */ + delegations: Delegation[]; + /** unbonding_delegations defines the unbonding delegations active at genesis. */ + unbondingDelegations: UnbondingDelegation[]; + /** redelegations defines the redelegations active at genesis. */ + redelegations: Redelegation[]; + exported: boolean; +} + +/** LastValidatorPower required for validator set update logic. */ +export interface LastValidatorPower { + /** address is the address of the validator. */ + address: string; + /** power defines the power of the validator. */ + power: Long; +} + +const baseGenesisState: object = { exported: false }; + +export const GenesisState = { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + if (message.lastTotalPower.length !== 0) { + writer.uint32(18).bytes(message.lastTotalPower); + } + for (const v of message.lastValidatorPowers) { + LastValidatorPower.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.validators) { + Validator.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.delegations) { + Delegation.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.unbondingDelegations) { + UnbondingDelegation.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.redelegations) { + Redelegation.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.exported === true) { + writer.uint32(64).bool(message.exported); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGenesisState } as GenesisState; + message.lastValidatorPowers = []; + message.validators = []; + message.delegations = []; + message.unbondingDelegations = []; + message.redelegations = []; + message.lastTotalPower = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.lastTotalPower = reader.bytes(); + break; + case 3: + message.lastValidatorPowers.push(LastValidatorPower.decode(reader, reader.uint32())); + break; + case 4: + message.validators.push(Validator.decode(reader, reader.uint32())); + break; + case 5: + message.delegations.push(Delegation.decode(reader, reader.uint32())); + break; + case 6: + message.unbondingDelegations.push(UnbondingDelegation.decode(reader, reader.uint32())); + break; + case 7: + message.redelegations.push(Redelegation.decode(reader, reader.uint32())); + break; + case 8: + message.exported = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.lastValidatorPowers = []; + message.validators = []; + message.delegations = []; + message.unbondingDelegations = []; + message.redelegations = []; + message.lastTotalPower = new Uint8Array(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + if (object.lastTotalPower !== undefined && object.lastTotalPower !== null) { + message.lastTotalPower = bytesFromBase64(object.lastTotalPower); + } + if (object.lastValidatorPowers !== undefined && object.lastValidatorPowers !== null) { + for (const e of object.lastValidatorPowers) { + message.lastValidatorPowers.push(LastValidatorPower.fromJSON(e)); + } + } + if (object.validators !== undefined && object.validators !== null) { + for (const e of object.validators) { + message.validators.push(Validator.fromJSON(e)); + } + } + if (object.delegations !== undefined && object.delegations !== null) { + for (const e of object.delegations) { + message.delegations.push(Delegation.fromJSON(e)); + } + } + if (object.unbondingDelegations !== undefined && object.unbondingDelegations !== null) { + for (const e of object.unbondingDelegations) { + message.unbondingDelegations.push(UnbondingDelegation.fromJSON(e)); + } + } + if (object.redelegations !== undefined && object.redelegations !== null) { + for (const e of object.redelegations) { + message.redelegations.push(Redelegation.fromJSON(e)); + } + } + if (object.exported !== undefined && object.exported !== null) { + message.exported = Boolean(object.exported); + } else { + message.exported = false; + } + return message; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + message.lastTotalPower !== undefined && + (obj.lastTotalPower = base64FromBytes( + message.lastTotalPower !== undefined ? message.lastTotalPower : new Uint8Array(), + )); + if (message.lastValidatorPowers) { + obj.lastValidatorPowers = message.lastValidatorPowers.map((e) => + e ? LastValidatorPower.toJSON(e) : undefined, + ); + } else { + obj.lastValidatorPowers = []; + } + if (message.validators) { + obj.validators = message.validators.map((e) => (e ? Validator.toJSON(e) : undefined)); + } else { + obj.validators = []; + } + if (message.delegations) { + obj.delegations = message.delegations.map((e) => (e ? Delegation.toJSON(e) : undefined)); + } else { + obj.delegations = []; + } + if (message.unbondingDelegations) { + obj.unbondingDelegations = message.unbondingDelegations.map((e) => + e ? UnbondingDelegation.toJSON(e) : undefined, + ); + } else { + obj.unbondingDelegations = []; + } + if (message.redelegations) { + obj.redelegations = message.redelegations.map((e) => (e ? Redelegation.toJSON(e) : undefined)); + } else { + obj.redelegations = []; + } + message.exported !== undefined && (obj.exported = message.exported); + return obj; + }, + + fromPartial(object: DeepPartial): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.lastValidatorPowers = []; + message.validators = []; + message.delegations = []; + message.unbondingDelegations = []; + message.redelegations = []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + if (object.lastTotalPower !== undefined && object.lastTotalPower !== null) { + message.lastTotalPower = object.lastTotalPower; + } else { + message.lastTotalPower = new Uint8Array(); + } + if (object.lastValidatorPowers !== undefined && object.lastValidatorPowers !== null) { + for (const e of object.lastValidatorPowers) { + message.lastValidatorPowers.push(LastValidatorPower.fromPartial(e)); + } + } + if (object.validators !== undefined && object.validators !== null) { + for (const e of object.validators) { + message.validators.push(Validator.fromPartial(e)); + } + } + if (object.delegations !== undefined && object.delegations !== null) { + for (const e of object.delegations) { + message.delegations.push(Delegation.fromPartial(e)); + } + } + if (object.unbondingDelegations !== undefined && object.unbondingDelegations !== null) { + for (const e of object.unbondingDelegations) { + message.unbondingDelegations.push(UnbondingDelegation.fromPartial(e)); + } + } + if (object.redelegations !== undefined && object.redelegations !== null) { + for (const e of object.redelegations) { + message.redelegations.push(Redelegation.fromPartial(e)); + } + } + if (object.exported !== undefined && object.exported !== null) { + message.exported = object.exported; + } else { + message.exported = false; + } + return message; + }, +}; + +const baseLastValidatorPower: object = { address: "", power: Long.ZERO }; + +export const LastValidatorPower = { + encode(message: LastValidatorPower, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (!message.power.isZero()) { + writer.uint32(16).int64(message.power); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LastValidatorPower { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseLastValidatorPower } as LastValidatorPower; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.power = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LastValidatorPower { + const message = { ...baseLastValidatorPower } as LastValidatorPower; + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.power !== undefined && object.power !== null) { + message.power = Long.fromString(object.power); + } else { + message.power = Long.ZERO; + } + return message; + }, + + toJSON(message: LastValidatorPower): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.power !== undefined && (obj.power = (message.power || Long.ZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): LastValidatorPower { + const message = { ...baseLastValidatorPower } as LastValidatorPower; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.power !== undefined && object.power !== null) { + message.power = object.power as Long; + } else { + message.power = Long.ZERO; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/staking/v1beta1/query.ts b/src/cosmos/staking/v1beta1/query.ts new file mode 100644 index 00000000..a20dd3b4 --- /dev/null +++ b/src/cosmos/staking/v1beta1/query.ts @@ -0,0 +1,2401 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; +import { + Validator, + DelegationResponse, + UnbondingDelegation, + HistoricalInfo, + Pool, + Params, + RedelegationResponse, +} from "../../../cosmos/staking/v1beta1/staking"; + +export const protobufPackage = "cosmos.staking.v1beta1"; + +/** QueryValidatorsRequest is request type for Query/Validators RPC method. */ +export interface QueryValidatorsRequest { + /** status enables to query for validators matching a given status. */ + status: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} + +/** QueryValidatorsResponse is response type for the Query/Validators RPC method */ +export interface QueryValidatorsResponse { + /** validators contains all the queried validators. */ + validators: Validator[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} + +/** QueryValidatorRequest is response type for the Query/Validator RPC method */ +export interface QueryValidatorRequest { + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; +} + +/** QueryValidatorResponse is response type for the Query/Validator RPC method */ +export interface QueryValidatorResponse { + /** validator defines the the validator info. */ + validator?: Validator; +} + +/** + * QueryValidatorDelegationsRequest is request type for the + * Query/ValidatorDelegations RPC method + */ +export interface QueryValidatorDelegationsRequest { + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} + +/** + * QueryValidatorDelegationsResponse is response type for the + * Query/ValidatorDelegations RPC method + */ +export interface QueryValidatorDelegationsResponse { + delegationResponses: DelegationResponse[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} + +/** + * QueryValidatorUnbondingDelegationsRequest is required type for the + * Query/ValidatorUnbondingDelegations RPC method + */ +export interface QueryValidatorUnbondingDelegationsRequest { + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} + +/** + * QueryValidatorUnbondingDelegationsResponse is response type for the + * Query/ValidatorUnbondingDelegations RPC method. + */ +export interface QueryValidatorUnbondingDelegationsResponse { + unbondingResponses: UnbondingDelegation[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} + +/** QueryDelegationRequest is request type for the Query/Delegation RPC method. */ +export interface QueryDelegationRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; +} + +/** QueryDelegationResponse is response type for the Query/Delegation RPC method. */ +export interface QueryDelegationResponse { + /** delegation_responses defines the delegation info of a delegation. */ + delegationResponse?: DelegationResponse; +} + +/** + * QueryUnbondingDelegationRequest is request type for the + * Query/UnbondingDelegation RPC method. + */ +export interface QueryUnbondingDelegationRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; +} + +/** + * QueryDelegationResponse is response type for the Query/UnbondingDelegation + * RPC method. + */ +export interface QueryUnbondingDelegationResponse { + /** unbond defines the unbonding information of a delegation. */ + unbond?: UnbondingDelegation; +} + +/** + * QueryDelegatorDelegationsRequest is request type for the + * Query/DelegatorDelegations RPC method. + */ +export interface QueryDelegatorDelegationsRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} + +/** + * QueryDelegatorDelegationsResponse is response type for the + * Query/DelegatorDelegations RPC method. + */ +export interface QueryDelegatorDelegationsResponse { + /** delegation_responses defines all the delegations' info of a delegator. */ + delegationResponses: DelegationResponse[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} + +/** + * QueryDelegatorUnbondingDelegationsRequest is request type for the + * Query/DelegatorUnbondingDelegations RPC method. + */ +export interface QueryDelegatorUnbondingDelegationsRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} + +/** + * QueryUnbondingDelegatorDelegationsResponse is response type for the + * Query/UnbondingDelegatorDelegations RPC method. + */ +export interface QueryDelegatorUnbondingDelegationsResponse { + unbondingResponses: UnbondingDelegation[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} + +/** + * QueryRedelegationsRequest is request type for the Query/Redelegations RPC + * method. + */ +export interface QueryRedelegationsRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** src_validator_addr defines the validator address to redelegate from. */ + srcValidatorAddr: string; + /** dst_validator_addr defines the validator address to redelegate to. */ + dstValidatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} + +/** + * QueryRedelegationsResponse is response type for the Query/Redelegations RPC + * method. + */ +export interface QueryRedelegationsResponse { + redelegationResponses: RedelegationResponse[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} + +/** + * QueryDelegatorValidatorsRequest is request type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} + +/** + * QueryDelegatorValidatorsResponse is response type for the + * Query/DelegatorValidators RPC method. + */ +export interface QueryDelegatorValidatorsResponse { + /** validators defines the the validators' info of a delegator. */ + validators: Validator[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} + +/** + * QueryDelegatorValidatorRequest is request type for the + * Query/DelegatorValidator RPC method. + */ +export interface QueryDelegatorValidatorRequest { + /** delegator_addr defines the delegator address to query for. */ + delegatorAddr: string; + /** validator_addr defines the validator address to query for. */ + validatorAddr: string; +} + +/** + * QueryDelegatorValidatorResponse response type for the + * Query/DelegatorValidator RPC method. + */ +export interface QueryDelegatorValidatorResponse { + /** validator defines the the validator info. */ + validator?: Validator; +} + +/** + * QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC + * method. + */ +export interface QueryHistoricalInfoRequest { + /** height defines at which height to query the historical info. */ + height: Long; +} + +/** + * QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC + * method. + */ +export interface QueryHistoricalInfoResponse { + /** hist defines the historical info at the given height. */ + hist?: HistoricalInfo; +} + +/** QueryPoolRequest is request type for the Query/Pool RPC method. */ +export interface QueryPoolRequest {} + +/** QueryPoolResponse is response type for the Query/Pool RPC method. */ +export interface QueryPoolResponse { + /** pool defines the pool info. */ + pool?: Pool; +} + +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} + +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params holds all the parameters of this module. */ + params?: Params; +} + +const baseQueryValidatorsRequest: object = { status: "" }; + +export const QueryValidatorsRequest = { + encode(message: QueryValidatorsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.status !== "") { + writer.uint32(10).string(message.status); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryValidatorsRequest } as QueryValidatorsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryValidatorsRequest { + const message = { ...baseQueryValidatorsRequest } as QueryValidatorsRequest; + if (object.status !== undefined && object.status !== null) { + message.status = String(object.status); + } else { + message.status = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryValidatorsRequest): unknown { + const obj: any = {}; + message.status !== undefined && (obj.status = message.status); + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryValidatorsRequest { + const message = { ...baseQueryValidatorsRequest } as QueryValidatorsRequest; + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } else { + message.status = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryValidatorsResponse: object = {}; + +export const QueryValidatorsResponse = { + encode(message: QueryValidatorsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.validators) { + Validator.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryValidatorsResponse } as QueryValidatorsResponse; + message.validators = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validators.push(Validator.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryValidatorsResponse { + const message = { ...baseQueryValidatorsResponse } as QueryValidatorsResponse; + message.validators = []; + if (object.validators !== undefined && object.validators !== null) { + for (const e of object.validators) { + message.validators.push(Validator.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryValidatorsResponse): unknown { + const obj: any = {}; + if (message.validators) { + obj.validators = message.validators.map((e) => (e ? Validator.toJSON(e) : undefined)); + } else { + obj.validators = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryValidatorsResponse { + const message = { ...baseQueryValidatorsResponse } as QueryValidatorsResponse; + message.validators = []; + if (object.validators !== undefined && object.validators !== null) { + for (const e of object.validators) { + message.validators.push(Validator.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryValidatorRequest: object = { validatorAddr: "" }; + +export const QueryValidatorRequest = { + encode(message: QueryValidatorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddr !== "") { + writer.uint32(10).string(message.validatorAddr); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryValidatorRequest } as QueryValidatorRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryValidatorRequest { + const message = { ...baseQueryValidatorRequest } as QueryValidatorRequest; + if (object.validatorAddr !== undefined && object.validatorAddr !== null) { + message.validatorAddr = String(object.validatorAddr); + } else { + message.validatorAddr = ""; + } + return message; + }, + + toJSON(message: QueryValidatorRequest): unknown { + const obj: any = {}; + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); + return obj; + }, + + fromPartial(object: DeepPartial): QueryValidatorRequest { + const message = { ...baseQueryValidatorRequest } as QueryValidatorRequest; + if (object.validatorAddr !== undefined && object.validatorAddr !== null) { + message.validatorAddr = object.validatorAddr; + } else { + message.validatorAddr = ""; + } + return message; + }, +}; + +const baseQueryValidatorResponse: object = {}; + +export const QueryValidatorResponse = { + encode(message: QueryValidatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryValidatorResponse } as QueryValidatorResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = Validator.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryValidatorResponse { + const message = { ...baseQueryValidatorResponse } as QueryValidatorResponse; + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromJSON(object.validator); + } else { + message.validator = undefined; + } + return message; + }, + + toJSON(message: QueryValidatorResponse): unknown { + const obj: any = {}; + message.validator !== undefined && + (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryValidatorResponse { + const message = { ...baseQueryValidatorResponse } as QueryValidatorResponse; + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromPartial(object.validator); + } else { + message.validator = undefined; + } + return message; + }, +}; + +const baseQueryValidatorDelegationsRequest: object = { validatorAddr: "" }; + +export const QueryValidatorDelegationsRequest = { + encode(message: QueryValidatorDelegationsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validatorAddr !== "") { + writer.uint32(10).string(message.validatorAddr); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorDelegationsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryValidatorDelegationsRequest } as QueryValidatorDelegationsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddr = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryValidatorDelegationsRequest { + const message = { ...baseQueryValidatorDelegationsRequest } as QueryValidatorDelegationsRequest; + if (object.validatorAddr !== undefined && object.validatorAddr !== null) { + message.validatorAddr = String(object.validatorAddr); + } else { + message.validatorAddr = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryValidatorDelegationsRequest): unknown { + const obj: any = {}; + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryValidatorDelegationsRequest { + const message = { ...baseQueryValidatorDelegationsRequest } as QueryValidatorDelegationsRequest; + if (object.validatorAddr !== undefined && object.validatorAddr !== null) { + message.validatorAddr = object.validatorAddr; + } else { + message.validatorAddr = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryValidatorDelegationsResponse: object = {}; + +export const QueryValidatorDelegationsResponse = { + encode(message: QueryValidatorDelegationsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.delegationResponses) { + DelegationResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorDelegationsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryValidatorDelegationsResponse } as QueryValidatorDelegationsResponse; + message.delegationResponses = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegationResponses.push(DelegationResponse.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryValidatorDelegationsResponse { + const message = { ...baseQueryValidatorDelegationsResponse } as QueryValidatorDelegationsResponse; + message.delegationResponses = []; + if (object.delegationResponses !== undefined && object.delegationResponses !== null) { + for (const e of object.delegationResponses) { + message.delegationResponses.push(DelegationResponse.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryValidatorDelegationsResponse): unknown { + const obj: any = {}; + if (message.delegationResponses) { + obj.delegationResponses = message.delegationResponses.map((e) => + e ? DelegationResponse.toJSON(e) : undefined, + ); + } else { + obj.delegationResponses = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryValidatorDelegationsResponse { + const message = { ...baseQueryValidatorDelegationsResponse } as QueryValidatorDelegationsResponse; + message.delegationResponses = []; + if (object.delegationResponses !== undefined && object.delegationResponses !== null) { + for (const e of object.delegationResponses) { + message.delegationResponses.push(DelegationResponse.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryValidatorUnbondingDelegationsRequest: object = { validatorAddr: "" }; + +export const QueryValidatorUnbondingDelegationsRequest = { + encode( + message: QueryValidatorUnbondingDelegationsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.validatorAddr !== "") { + writer.uint32(10).string(message.validatorAddr); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorUnbondingDelegationsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseQueryValidatorUnbondingDelegationsRequest, + } as QueryValidatorUnbondingDelegationsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddr = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryValidatorUnbondingDelegationsRequest { + const message = { + ...baseQueryValidatorUnbondingDelegationsRequest, + } as QueryValidatorUnbondingDelegationsRequest; + if (object.validatorAddr !== undefined && object.validatorAddr !== null) { + message.validatorAddr = String(object.validatorAddr); + } else { + message.validatorAddr = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryValidatorUnbondingDelegationsRequest): unknown { + const obj: any = {}; + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial, + ): QueryValidatorUnbondingDelegationsRequest { + const message = { + ...baseQueryValidatorUnbondingDelegationsRequest, + } as QueryValidatorUnbondingDelegationsRequest; + if (object.validatorAddr !== undefined && object.validatorAddr !== null) { + message.validatorAddr = object.validatorAddr; + } else { + message.validatorAddr = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryValidatorUnbondingDelegationsResponse: object = {}; + +export const QueryValidatorUnbondingDelegationsResponse = { + encode( + message: QueryValidatorUnbondingDelegationsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.unbondingResponses) { + UnbondingDelegation.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorUnbondingDelegationsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseQueryValidatorUnbondingDelegationsResponse, + } as QueryValidatorUnbondingDelegationsResponse; + message.unbondingResponses = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unbondingResponses.push(UnbondingDelegation.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryValidatorUnbondingDelegationsResponse { + const message = { + ...baseQueryValidatorUnbondingDelegationsResponse, + } as QueryValidatorUnbondingDelegationsResponse; + message.unbondingResponses = []; + if (object.unbondingResponses !== undefined && object.unbondingResponses !== null) { + for (const e of object.unbondingResponses) { + message.unbondingResponses.push(UnbondingDelegation.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryValidatorUnbondingDelegationsResponse): unknown { + const obj: any = {}; + if (message.unbondingResponses) { + obj.unbondingResponses = message.unbondingResponses.map((e) => + e ? UnbondingDelegation.toJSON(e) : undefined, + ); + } else { + obj.unbondingResponses = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial, + ): QueryValidatorUnbondingDelegationsResponse { + const message = { + ...baseQueryValidatorUnbondingDelegationsResponse, + } as QueryValidatorUnbondingDelegationsResponse; + message.unbondingResponses = []; + if (object.unbondingResponses !== undefined && object.unbondingResponses !== null) { + for (const e of object.unbondingResponses) { + message.unbondingResponses.push(UnbondingDelegation.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryDelegationRequest: object = { delegatorAddr: "", validatorAddr: "" }; + +export const QueryDelegationRequest = { + encode(message: QueryDelegationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.validatorAddr !== "") { + writer.uint32(18).string(message.validatorAddr); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDelegationRequest } as QueryDelegationRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDelegationRequest { + const message = { ...baseQueryDelegationRequest } as QueryDelegationRequest; + if (object.delegatorAddr !== undefined && object.delegatorAddr !== null) { + message.delegatorAddr = String(object.delegatorAddr); + } else { + message.delegatorAddr = ""; + } + if (object.validatorAddr !== undefined && object.validatorAddr !== null) { + message.validatorAddr = String(object.validatorAddr); + } else { + message.validatorAddr = ""; + } + return message; + }, + + toJSON(message: QueryDelegationRequest): unknown { + const obj: any = {}; + message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr); + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDelegationRequest { + const message = { ...baseQueryDelegationRequest } as QueryDelegationRequest; + if (object.delegatorAddr !== undefined && object.delegatorAddr !== null) { + message.delegatorAddr = object.delegatorAddr; + } else { + message.delegatorAddr = ""; + } + if (object.validatorAddr !== undefined && object.validatorAddr !== null) { + message.validatorAddr = object.validatorAddr; + } else { + message.validatorAddr = ""; + } + return message; + }, +}; + +const baseQueryDelegationResponse: object = {}; + +export const QueryDelegationResponse = { + encode(message: QueryDelegationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegationResponse !== undefined) { + DelegationResponse.encode(message.delegationResponse, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDelegationResponse } as QueryDelegationResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegationResponse = DelegationResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDelegationResponse { + const message = { ...baseQueryDelegationResponse } as QueryDelegationResponse; + if (object.delegationResponse !== undefined && object.delegationResponse !== null) { + message.delegationResponse = DelegationResponse.fromJSON(object.delegationResponse); + } else { + message.delegationResponse = undefined; + } + return message; + }, + + toJSON(message: QueryDelegationResponse): unknown { + const obj: any = {}; + message.delegationResponse !== undefined && + (obj.delegationResponse = message.delegationResponse + ? DelegationResponse.toJSON(message.delegationResponse) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDelegationResponse { + const message = { ...baseQueryDelegationResponse } as QueryDelegationResponse; + if (object.delegationResponse !== undefined && object.delegationResponse !== null) { + message.delegationResponse = DelegationResponse.fromPartial(object.delegationResponse); + } else { + message.delegationResponse = undefined; + } + return message; + }, +}; + +const baseQueryUnbondingDelegationRequest: object = { delegatorAddr: "", validatorAddr: "" }; + +export const QueryUnbondingDelegationRequest = { + encode(message: QueryUnbondingDelegationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.validatorAddr !== "") { + writer.uint32(18).string(message.validatorAddr); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnbondingDelegationRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryUnbondingDelegationRequest } as QueryUnbondingDelegationRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryUnbondingDelegationRequest { + const message = { ...baseQueryUnbondingDelegationRequest } as QueryUnbondingDelegationRequest; + if (object.delegatorAddr !== undefined && object.delegatorAddr !== null) { + message.delegatorAddr = String(object.delegatorAddr); + } else { + message.delegatorAddr = ""; + } + if (object.validatorAddr !== undefined && object.validatorAddr !== null) { + message.validatorAddr = String(object.validatorAddr); + } else { + message.validatorAddr = ""; + } + return message; + }, + + toJSON(message: QueryUnbondingDelegationRequest): unknown { + const obj: any = {}; + message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr); + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); + return obj; + }, + + fromPartial(object: DeepPartial): QueryUnbondingDelegationRequest { + const message = { ...baseQueryUnbondingDelegationRequest } as QueryUnbondingDelegationRequest; + if (object.delegatorAddr !== undefined && object.delegatorAddr !== null) { + message.delegatorAddr = object.delegatorAddr; + } else { + message.delegatorAddr = ""; + } + if (object.validatorAddr !== undefined && object.validatorAddr !== null) { + message.validatorAddr = object.validatorAddr; + } else { + message.validatorAddr = ""; + } + return message; + }, +}; + +const baseQueryUnbondingDelegationResponse: object = {}; + +export const QueryUnbondingDelegationResponse = { + encode(message: QueryUnbondingDelegationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.unbond !== undefined) { + UnbondingDelegation.encode(message.unbond, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnbondingDelegationResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryUnbondingDelegationResponse } as QueryUnbondingDelegationResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unbond = UnbondingDelegation.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryUnbondingDelegationResponse { + const message = { ...baseQueryUnbondingDelegationResponse } as QueryUnbondingDelegationResponse; + if (object.unbond !== undefined && object.unbond !== null) { + message.unbond = UnbondingDelegation.fromJSON(object.unbond); + } else { + message.unbond = undefined; + } + return message; + }, + + toJSON(message: QueryUnbondingDelegationResponse): unknown { + const obj: any = {}; + message.unbond !== undefined && + (obj.unbond = message.unbond ? UnbondingDelegation.toJSON(message.unbond) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryUnbondingDelegationResponse { + const message = { ...baseQueryUnbondingDelegationResponse } as QueryUnbondingDelegationResponse; + if (object.unbond !== undefined && object.unbond !== null) { + message.unbond = UnbondingDelegation.fromPartial(object.unbond); + } else { + message.unbond = undefined; + } + return message; + }, +}; + +const baseQueryDelegatorDelegationsRequest: object = { delegatorAddr: "" }; + +export const QueryDelegatorDelegationsRequest = { + encode(message: QueryDelegatorDelegationsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorDelegationsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDelegatorDelegationsRequest } as QueryDelegatorDelegationsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDelegatorDelegationsRequest { + const message = { ...baseQueryDelegatorDelegationsRequest } as QueryDelegatorDelegationsRequest; + if (object.delegatorAddr !== undefined && object.delegatorAddr !== null) { + message.delegatorAddr = String(object.delegatorAddr); + } else { + message.delegatorAddr = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryDelegatorDelegationsRequest): unknown { + const obj: any = {}; + message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr); + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDelegatorDelegationsRequest { + const message = { ...baseQueryDelegatorDelegationsRequest } as QueryDelegatorDelegationsRequest; + if (object.delegatorAddr !== undefined && object.delegatorAddr !== null) { + message.delegatorAddr = object.delegatorAddr; + } else { + message.delegatorAddr = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryDelegatorDelegationsResponse: object = {}; + +export const QueryDelegatorDelegationsResponse = { + encode(message: QueryDelegatorDelegationsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.delegationResponses) { + DelegationResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorDelegationsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDelegatorDelegationsResponse } as QueryDelegatorDelegationsResponse; + message.delegationResponses = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegationResponses.push(DelegationResponse.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDelegatorDelegationsResponse { + const message = { ...baseQueryDelegatorDelegationsResponse } as QueryDelegatorDelegationsResponse; + message.delegationResponses = []; + if (object.delegationResponses !== undefined && object.delegationResponses !== null) { + for (const e of object.delegationResponses) { + message.delegationResponses.push(DelegationResponse.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryDelegatorDelegationsResponse): unknown { + const obj: any = {}; + if (message.delegationResponses) { + obj.delegationResponses = message.delegationResponses.map((e) => + e ? DelegationResponse.toJSON(e) : undefined, + ); + } else { + obj.delegationResponses = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDelegatorDelegationsResponse { + const message = { ...baseQueryDelegatorDelegationsResponse } as QueryDelegatorDelegationsResponse; + message.delegationResponses = []; + if (object.delegationResponses !== undefined && object.delegationResponses !== null) { + for (const e of object.delegationResponses) { + message.delegationResponses.push(DelegationResponse.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryDelegatorUnbondingDelegationsRequest: object = { delegatorAddr: "" }; + +export const QueryDelegatorUnbondingDelegationsRequest = { + encode( + message: QueryDelegatorUnbondingDelegationsRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorUnbondingDelegationsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseQueryDelegatorUnbondingDelegationsRequest, + } as QueryDelegatorUnbondingDelegationsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDelegatorUnbondingDelegationsRequest { + const message = { + ...baseQueryDelegatorUnbondingDelegationsRequest, + } as QueryDelegatorUnbondingDelegationsRequest; + if (object.delegatorAddr !== undefined && object.delegatorAddr !== null) { + message.delegatorAddr = String(object.delegatorAddr); + } else { + message.delegatorAddr = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryDelegatorUnbondingDelegationsRequest): unknown { + const obj: any = {}; + message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr); + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial, + ): QueryDelegatorUnbondingDelegationsRequest { + const message = { + ...baseQueryDelegatorUnbondingDelegationsRequest, + } as QueryDelegatorUnbondingDelegationsRequest; + if (object.delegatorAddr !== undefined && object.delegatorAddr !== null) { + message.delegatorAddr = object.delegatorAddr; + } else { + message.delegatorAddr = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryDelegatorUnbondingDelegationsResponse: object = {}; + +export const QueryDelegatorUnbondingDelegationsResponse = { + encode( + message: QueryDelegatorUnbondingDelegationsResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.unbondingResponses) { + UnbondingDelegation.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorUnbondingDelegationsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseQueryDelegatorUnbondingDelegationsResponse, + } as QueryDelegatorUnbondingDelegationsResponse; + message.unbondingResponses = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unbondingResponses.push(UnbondingDelegation.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDelegatorUnbondingDelegationsResponse { + const message = { + ...baseQueryDelegatorUnbondingDelegationsResponse, + } as QueryDelegatorUnbondingDelegationsResponse; + message.unbondingResponses = []; + if (object.unbondingResponses !== undefined && object.unbondingResponses !== null) { + for (const e of object.unbondingResponses) { + message.unbondingResponses.push(UnbondingDelegation.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryDelegatorUnbondingDelegationsResponse): unknown { + const obj: any = {}; + if (message.unbondingResponses) { + obj.unbondingResponses = message.unbondingResponses.map((e) => + e ? UnbondingDelegation.toJSON(e) : undefined, + ); + } else { + obj.unbondingResponses = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial, + ): QueryDelegatorUnbondingDelegationsResponse { + const message = { + ...baseQueryDelegatorUnbondingDelegationsResponse, + } as QueryDelegatorUnbondingDelegationsResponse; + message.unbondingResponses = []; + if (object.unbondingResponses !== undefined && object.unbondingResponses !== null) { + for (const e of object.unbondingResponses) { + message.unbondingResponses.push(UnbondingDelegation.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryRedelegationsRequest: object = { + delegatorAddr: "", + srcValidatorAddr: "", + dstValidatorAddr: "", +}; + +export const QueryRedelegationsRequest = { + encode(message: QueryRedelegationsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.srcValidatorAddr !== "") { + writer.uint32(18).string(message.srcValidatorAddr); + } + if (message.dstValidatorAddr !== "") { + writer.uint32(26).string(message.dstValidatorAddr); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryRedelegationsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryRedelegationsRequest } as QueryRedelegationsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.srcValidatorAddr = reader.string(); + break; + case 3: + message.dstValidatorAddr = reader.string(); + break; + case 4: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryRedelegationsRequest { + const message = { ...baseQueryRedelegationsRequest } as QueryRedelegationsRequest; + if (object.delegatorAddr !== undefined && object.delegatorAddr !== null) { + message.delegatorAddr = String(object.delegatorAddr); + } else { + message.delegatorAddr = ""; + } + if (object.srcValidatorAddr !== undefined && object.srcValidatorAddr !== null) { + message.srcValidatorAddr = String(object.srcValidatorAddr); + } else { + message.srcValidatorAddr = ""; + } + if (object.dstValidatorAddr !== undefined && object.dstValidatorAddr !== null) { + message.dstValidatorAddr = String(object.dstValidatorAddr); + } else { + message.dstValidatorAddr = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryRedelegationsRequest): unknown { + const obj: any = {}; + message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr); + message.srcValidatorAddr !== undefined && (obj.srcValidatorAddr = message.srcValidatorAddr); + message.dstValidatorAddr !== undefined && (obj.dstValidatorAddr = message.dstValidatorAddr); + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryRedelegationsRequest { + const message = { ...baseQueryRedelegationsRequest } as QueryRedelegationsRequest; + if (object.delegatorAddr !== undefined && object.delegatorAddr !== null) { + message.delegatorAddr = object.delegatorAddr; + } else { + message.delegatorAddr = ""; + } + if (object.srcValidatorAddr !== undefined && object.srcValidatorAddr !== null) { + message.srcValidatorAddr = object.srcValidatorAddr; + } else { + message.srcValidatorAddr = ""; + } + if (object.dstValidatorAddr !== undefined && object.dstValidatorAddr !== null) { + message.dstValidatorAddr = object.dstValidatorAddr; + } else { + message.dstValidatorAddr = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryRedelegationsResponse: object = {}; + +export const QueryRedelegationsResponse = { + encode(message: QueryRedelegationsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.redelegationResponses) { + RedelegationResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryRedelegationsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryRedelegationsResponse } as QueryRedelegationsResponse; + message.redelegationResponses = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.redelegationResponses.push(RedelegationResponse.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryRedelegationsResponse { + const message = { ...baseQueryRedelegationsResponse } as QueryRedelegationsResponse; + message.redelegationResponses = []; + if (object.redelegationResponses !== undefined && object.redelegationResponses !== null) { + for (const e of object.redelegationResponses) { + message.redelegationResponses.push(RedelegationResponse.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryRedelegationsResponse): unknown { + const obj: any = {}; + if (message.redelegationResponses) { + obj.redelegationResponses = message.redelegationResponses.map((e) => + e ? RedelegationResponse.toJSON(e) : undefined, + ); + } else { + obj.redelegationResponses = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryRedelegationsResponse { + const message = { ...baseQueryRedelegationsResponse } as QueryRedelegationsResponse; + message.redelegationResponses = []; + if (object.redelegationResponses !== undefined && object.redelegationResponses !== null) { + for (const e of object.redelegationResponses) { + message.redelegationResponses.push(RedelegationResponse.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryDelegatorValidatorsRequest: object = { delegatorAddr: "" }; + +export const QueryDelegatorValidatorsRequest = { + encode(message: QueryDelegatorValidatorsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDelegatorValidatorsRequest } as QueryDelegatorValidatorsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDelegatorValidatorsRequest { + const message = { ...baseQueryDelegatorValidatorsRequest } as QueryDelegatorValidatorsRequest; + if (object.delegatorAddr !== undefined && object.delegatorAddr !== null) { + message.delegatorAddr = String(object.delegatorAddr); + } else { + message.delegatorAddr = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryDelegatorValidatorsRequest): unknown { + const obj: any = {}; + message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr); + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDelegatorValidatorsRequest { + const message = { ...baseQueryDelegatorValidatorsRequest } as QueryDelegatorValidatorsRequest; + if (object.delegatorAddr !== undefined && object.delegatorAddr !== null) { + message.delegatorAddr = object.delegatorAddr; + } else { + message.delegatorAddr = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryDelegatorValidatorsResponse: object = {}; + +export const QueryDelegatorValidatorsResponse = { + encode(message: QueryDelegatorValidatorsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.validators) { + Validator.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDelegatorValidatorsResponse } as QueryDelegatorValidatorsResponse; + message.validators = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validators.push(Validator.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDelegatorValidatorsResponse { + const message = { ...baseQueryDelegatorValidatorsResponse } as QueryDelegatorValidatorsResponse; + message.validators = []; + if (object.validators !== undefined && object.validators !== null) { + for (const e of object.validators) { + message.validators.push(Validator.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryDelegatorValidatorsResponse): unknown { + const obj: any = {}; + if (message.validators) { + obj.validators = message.validators.map((e) => (e ? Validator.toJSON(e) : undefined)); + } else { + obj.validators = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDelegatorValidatorsResponse { + const message = { ...baseQueryDelegatorValidatorsResponse } as QueryDelegatorValidatorsResponse; + message.validators = []; + if (object.validators !== undefined && object.validators !== null) { + for (const e of object.validators) { + message.validators.push(Validator.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryDelegatorValidatorRequest: object = { delegatorAddr: "", validatorAddr: "" }; + +export const QueryDelegatorValidatorRequest = { + encode(message: QueryDelegatorValidatorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddr !== "") { + writer.uint32(10).string(message.delegatorAddr); + } + if (message.validatorAddr !== "") { + writer.uint32(18).string(message.validatorAddr); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDelegatorValidatorRequest } as QueryDelegatorValidatorRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddr = reader.string(); + break; + case 2: + message.validatorAddr = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDelegatorValidatorRequest { + const message = { ...baseQueryDelegatorValidatorRequest } as QueryDelegatorValidatorRequest; + if (object.delegatorAddr !== undefined && object.delegatorAddr !== null) { + message.delegatorAddr = String(object.delegatorAddr); + } else { + message.delegatorAddr = ""; + } + if (object.validatorAddr !== undefined && object.validatorAddr !== null) { + message.validatorAddr = String(object.validatorAddr); + } else { + message.validatorAddr = ""; + } + return message; + }, + + toJSON(message: QueryDelegatorValidatorRequest): unknown { + const obj: any = {}; + message.delegatorAddr !== undefined && (obj.delegatorAddr = message.delegatorAddr); + message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDelegatorValidatorRequest { + const message = { ...baseQueryDelegatorValidatorRequest } as QueryDelegatorValidatorRequest; + if (object.delegatorAddr !== undefined && object.delegatorAddr !== null) { + message.delegatorAddr = object.delegatorAddr; + } else { + message.delegatorAddr = ""; + } + if (object.validatorAddr !== undefined && object.validatorAddr !== null) { + message.validatorAddr = object.validatorAddr; + } else { + message.validatorAddr = ""; + } + return message; + }, +}; + +const baseQueryDelegatorValidatorResponse: object = {}; + +export const QueryDelegatorValidatorResponse = { + encode(message: QueryDelegatorValidatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDelegatorValidatorResponse } as QueryDelegatorValidatorResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = Validator.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDelegatorValidatorResponse { + const message = { ...baseQueryDelegatorValidatorResponse } as QueryDelegatorValidatorResponse; + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromJSON(object.validator); + } else { + message.validator = undefined; + } + return message; + }, + + toJSON(message: QueryDelegatorValidatorResponse): unknown { + const obj: any = {}; + message.validator !== undefined && + (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDelegatorValidatorResponse { + const message = { ...baseQueryDelegatorValidatorResponse } as QueryDelegatorValidatorResponse; + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromPartial(object.validator); + } else { + message.validator = undefined; + } + return message; + }, +}; + +const baseQueryHistoricalInfoRequest: object = { height: Long.ZERO }; + +export const QueryHistoricalInfoRequest = { + encode(message: QueryHistoricalInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.height.isZero()) { + writer.uint32(8).int64(message.height); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryHistoricalInfoRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryHistoricalInfoRequest } as QueryHistoricalInfoRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryHistoricalInfoRequest { + const message = { ...baseQueryHistoricalInfoRequest } as QueryHistoricalInfoRequest; + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.ZERO; + } + return message; + }, + + toJSON(message: QueryHistoricalInfoRequest): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): QueryHistoricalInfoRequest { + const message = { ...baseQueryHistoricalInfoRequest } as QueryHistoricalInfoRequest; + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.ZERO; + } + return message; + }, +}; + +const baseQueryHistoricalInfoResponse: object = {}; + +export const QueryHistoricalInfoResponse = { + encode(message: QueryHistoricalInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.hist !== undefined) { + HistoricalInfo.encode(message.hist, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryHistoricalInfoResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryHistoricalInfoResponse } as QueryHistoricalInfoResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hist = HistoricalInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryHistoricalInfoResponse { + const message = { ...baseQueryHistoricalInfoResponse } as QueryHistoricalInfoResponse; + if (object.hist !== undefined && object.hist !== null) { + message.hist = HistoricalInfo.fromJSON(object.hist); + } else { + message.hist = undefined; + } + return message; + }, + + toJSON(message: QueryHistoricalInfoResponse): unknown { + const obj: any = {}; + message.hist !== undefined && (obj.hist = message.hist ? HistoricalInfo.toJSON(message.hist) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryHistoricalInfoResponse { + const message = { ...baseQueryHistoricalInfoResponse } as QueryHistoricalInfoResponse; + if (object.hist !== undefined && object.hist !== null) { + message.hist = HistoricalInfo.fromPartial(object.hist); + } else { + message.hist = undefined; + } + return message; + }, +}; + +const baseQueryPoolRequest: object = {}; + +export const QueryPoolRequest = { + encode(_: QueryPoolRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryPoolRequest } as QueryPoolRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryPoolRequest { + const message = { ...baseQueryPoolRequest } as QueryPoolRequest; + return message; + }, + + toJSON(_: QueryPoolRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): QueryPoolRequest { + const message = { ...baseQueryPoolRequest } as QueryPoolRequest; + return message; + }, +}; + +const baseQueryPoolResponse: object = {}; + +export const QueryPoolResponse = { + encode(message: QueryPoolResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pool !== undefined) { + Pool.encode(message.pool, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryPoolResponse } as QueryPoolResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pool = Pool.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPoolResponse { + const message = { ...baseQueryPoolResponse } as QueryPoolResponse; + if (object.pool !== undefined && object.pool !== null) { + message.pool = Pool.fromJSON(object.pool); + } else { + message.pool = undefined; + } + return message; + }, + + toJSON(message: QueryPoolResponse): unknown { + const obj: any = {}; + message.pool !== undefined && (obj.pool = message.pool ? Pool.toJSON(message.pool) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryPoolResponse { + const message = { ...baseQueryPoolResponse } as QueryPoolResponse; + if (object.pool !== undefined && object.pool !== null) { + message.pool = Pool.fromPartial(object.pool); + } else { + message.pool = undefined; + } + return message; + }, +}; + +const baseQueryParamsRequest: object = {}; + +export const QueryParamsRequest = { + encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + return message; + }, + + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + return message; + }, +}; + +const baseQueryParamsResponse: object = {}; + +export const QueryParamsResponse = { + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + return message; + }, + + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + return message; + }, +}; + +/** Query defines the gRPC querier service. */ +export interface Query { + /** Validators queries all validators that match the given status. */ + Validators(request: QueryValidatorsRequest): Promise; + /** Validator queries validator info for given validator address. */ + Validator(request: QueryValidatorRequest): Promise; + /** ValidatorDelegations queries delegate info for given validator. */ + ValidatorDelegations(request: QueryValidatorDelegationsRequest): Promise; + /** ValidatorUnbondingDelegations queries unbonding delegations of a validator. */ + ValidatorUnbondingDelegations( + request: QueryValidatorUnbondingDelegationsRequest, + ): Promise; + /** Delegation queries delegate info for given validator delegator pair. */ + Delegation(request: QueryDelegationRequest): Promise; + /** + * UnbondingDelegation queries unbonding info for given validator delegator + * pair. + */ + UnbondingDelegation(request: QueryUnbondingDelegationRequest): Promise; + /** DelegatorDelegations queries all delegations of a given delegator address. */ + DelegatorDelegations(request: QueryDelegatorDelegationsRequest): Promise; + /** + * DelegatorUnbondingDelegations queries all unbonding delegations of a given + * delegator address. + */ + DelegatorUnbondingDelegations( + request: QueryDelegatorUnbondingDelegationsRequest, + ): Promise; + /** Redelegations queries redelegations of given address. */ + Redelegations(request: QueryRedelegationsRequest): Promise; + /** + * DelegatorValidators queries all validators info for given delegator + * address. + */ + DelegatorValidators(request: QueryDelegatorValidatorsRequest): Promise; + /** + * DelegatorValidator queries validator info for given delegator validator + * pair. + */ + DelegatorValidator(request: QueryDelegatorValidatorRequest): Promise; + /** HistoricalInfo queries the historical info for given height. */ + HistoricalInfo(request: QueryHistoricalInfoRequest): Promise; + /** Pool queries the pool info. */ + Pool(request: QueryPoolRequest): Promise; + /** Parameters queries the staking parameters. */ + Params(request: QueryParamsRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Validators = this.Validators.bind(this); + this.Validator = this.Validator.bind(this); + this.ValidatorDelegations = this.ValidatorDelegations.bind(this); + this.ValidatorUnbondingDelegations = this.ValidatorUnbondingDelegations.bind(this); + this.Delegation = this.Delegation.bind(this); + this.UnbondingDelegation = this.UnbondingDelegation.bind(this); + this.DelegatorDelegations = this.DelegatorDelegations.bind(this); + this.DelegatorUnbondingDelegations = this.DelegatorUnbondingDelegations.bind(this); + this.Redelegations = this.Redelegations.bind(this); + this.DelegatorValidators = this.DelegatorValidators.bind(this); + this.DelegatorValidator = this.DelegatorValidator.bind(this); + this.HistoricalInfo = this.HistoricalInfo.bind(this); + this.Pool = this.Pool.bind(this); + this.Params = this.Params.bind(this); + } + Validators(request: QueryValidatorsRequest): Promise { + const data = QueryValidatorsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Validators", data); + return promise.then((data) => QueryValidatorsResponse.decode(new _m0.Reader(data))); + } + + Validator(request: QueryValidatorRequest): Promise { + const data = QueryValidatorRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Validator", data); + return promise.then((data) => QueryValidatorResponse.decode(new _m0.Reader(data))); + } + + ValidatorDelegations( + request: QueryValidatorDelegationsRequest, + ): Promise { + const data = QueryValidatorDelegationsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "ValidatorDelegations", data); + return promise.then((data) => QueryValidatorDelegationsResponse.decode(new _m0.Reader(data))); + } + + ValidatorUnbondingDelegations( + request: QueryValidatorUnbondingDelegationsRequest, + ): Promise { + const data = QueryValidatorUnbondingDelegationsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "ValidatorUnbondingDelegations", data); + return promise.then((data) => QueryValidatorUnbondingDelegationsResponse.decode(new _m0.Reader(data))); + } + + Delegation(request: QueryDelegationRequest): Promise { + const data = QueryDelegationRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Delegation", data); + return promise.then((data) => QueryDelegationResponse.decode(new _m0.Reader(data))); + } + + UnbondingDelegation(request: QueryUnbondingDelegationRequest): Promise { + const data = QueryUnbondingDelegationRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "UnbondingDelegation", data); + return promise.then((data) => QueryUnbondingDelegationResponse.decode(new _m0.Reader(data))); + } + + DelegatorDelegations( + request: QueryDelegatorDelegationsRequest, + ): Promise { + const data = QueryDelegatorDelegationsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "DelegatorDelegations", data); + return promise.then((data) => QueryDelegatorDelegationsResponse.decode(new _m0.Reader(data))); + } + + DelegatorUnbondingDelegations( + request: QueryDelegatorUnbondingDelegationsRequest, + ): Promise { + const data = QueryDelegatorUnbondingDelegationsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "DelegatorUnbondingDelegations", data); + return promise.then((data) => QueryDelegatorUnbondingDelegationsResponse.decode(new _m0.Reader(data))); + } + + Redelegations(request: QueryRedelegationsRequest): Promise { + const data = QueryRedelegationsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Redelegations", data); + return promise.then((data) => QueryRedelegationsResponse.decode(new _m0.Reader(data))); + } + + DelegatorValidators(request: QueryDelegatorValidatorsRequest): Promise { + const data = QueryDelegatorValidatorsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "DelegatorValidators", data); + return promise.then((data) => QueryDelegatorValidatorsResponse.decode(new _m0.Reader(data))); + } + + DelegatorValidator(request: QueryDelegatorValidatorRequest): Promise { + const data = QueryDelegatorValidatorRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "DelegatorValidator", data); + return promise.then((data) => QueryDelegatorValidatorResponse.decode(new _m0.Reader(data))); + } + + HistoricalInfo(request: QueryHistoricalInfoRequest): Promise { + const data = QueryHistoricalInfoRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "HistoricalInfo", data); + return promise.then((data) => QueryHistoricalInfoResponse.decode(new _m0.Reader(data))); + } + + Pool(request: QueryPoolRequest): Promise { + const data = QueryPoolRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Pool", data); + return promise.then((data) => QueryPoolResponse.decode(new _m0.Reader(data))); + } + + Params(request: QueryParamsRequest): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Params", data); + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/staking/v1beta1/staking.ts b/src/cosmos/staking/v1beta1/staking.ts new file mode 100644 index 00000000..ee9a6473 --- /dev/null +++ b/src/cosmos/staking/v1beta1/staking.ts @@ -0,0 +1,2249 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Header } from "../../../tendermint/types/types"; +import { Any } from "../../../google/protobuf/any"; +import { Duration } from "../../../google/protobuf/duration"; +import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import { Timestamp } from "../../../google/protobuf/timestamp"; + +export const protobufPackage = "cosmos.staking.v1beta1"; + +/** BondStatus is the status of a validator. */ +export enum BondStatus { + /** BOND_STATUS_UNSPECIFIED - UNSPECIFIED defines an invalid validator status. */ + BOND_STATUS_UNSPECIFIED = 0, + /** BOND_STATUS_UNBONDED - UNBONDED defines a validator that is not bonded. */ + BOND_STATUS_UNBONDED = 1, + /** BOND_STATUS_UNBONDING - UNBONDING defines a validator that is unbonding. */ + BOND_STATUS_UNBONDING = 2, + /** BOND_STATUS_BONDED - BONDED defines a validator that is bonded. */ + BOND_STATUS_BONDED = 3, + UNRECOGNIZED = -1, +} + +export function bondStatusFromJSON(object: any): BondStatus { + switch (object) { + case 0: + case "BOND_STATUS_UNSPECIFIED": + return BondStatus.BOND_STATUS_UNSPECIFIED; + case 1: + case "BOND_STATUS_UNBONDED": + return BondStatus.BOND_STATUS_UNBONDED; + case 2: + case "BOND_STATUS_UNBONDING": + return BondStatus.BOND_STATUS_UNBONDING; + case 3: + case "BOND_STATUS_BONDED": + return BondStatus.BOND_STATUS_BONDED; + case -1: + case "UNRECOGNIZED": + default: + return BondStatus.UNRECOGNIZED; + } +} + +export function bondStatusToJSON(object: BondStatus): string { + switch (object) { + case BondStatus.BOND_STATUS_UNSPECIFIED: + return "BOND_STATUS_UNSPECIFIED"; + case BondStatus.BOND_STATUS_UNBONDED: + return "BOND_STATUS_UNBONDED"; + case BondStatus.BOND_STATUS_UNBONDING: + return "BOND_STATUS_UNBONDING"; + case BondStatus.BOND_STATUS_BONDED: + return "BOND_STATUS_BONDED"; + default: + return "UNKNOWN"; + } +} + +/** + * HistoricalInfo contains header and validator information for a given block. + * It is stored as part of staking module's state, which persists the `n` most + * recent HistoricalInfo + * (`n` is set by the staking module's `historical_entries` parameter). + */ +export interface HistoricalInfo { + header?: Header; + valset: Validator[]; +} + +/** + * CommissionRates defines the initial commission rates to be used for creating + * a validator. + */ +export interface CommissionRates { + /** rate is the commission rate charged to delegators, as a fraction. */ + rate: string; + /** max_rate defines the maximum commission rate which validator can ever charge, as a fraction. */ + maxRate: string; + /** max_change_rate defines the maximum daily increase of the validator commission, as a fraction. */ + maxChangeRate: string; +} + +/** Commission defines commission parameters for a given validator. */ +export interface Commission { + /** commission_rates defines the initial commission rates to be used for creating a validator. */ + commissionRates?: CommissionRates; + /** update_time is the last time the commission rate was changed. */ + updateTime?: Date; +} + +/** Description defines a validator description. */ +export interface Description { + /** moniker defines a human-readable name for the validator. */ + moniker: string; + /** identity defines an optional identity signature (ex. UPort or Keybase). */ + identity: string; + /** website defines an optional website link. */ + website: string; + /** security_contact defines an optional email for security contact. */ + securityContact: string; + /** details define other optional details. */ + details: string; +} + +/** + * Validator defines a validator, together with the total amount of the + * Validator's bond shares and their exchange rate to coins. Slashing results in + * a decrease in the exchange rate, allowing correct calculation of future + * undelegations without iterating over delegators. When coins are delegated to + * this validator, the validator is credited with a delegation whose number of + * bond shares is based on the amount of coins delegated divided by the current + * exchange rate. Voting power can be calculated as total bonded shares + * multiplied by exchange rate. + */ +export interface Validator { + /** operator_address defines the address of the validator's operator; bech encoded in JSON. */ + operatorAddress: string; + /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */ + consensusPubkey?: Any; + /** jailed defined whether the validator has been jailed from bonded status or not. */ + jailed: boolean; + /** status is the validator status (bonded/unbonding/unbonded). */ + status: BondStatus; + /** tokens define the delegated tokens (incl. self-delegation). */ + tokens: string; + /** delegator_shares defines total shares issued to a validator's delegators. */ + delegatorShares: string; + /** description defines the description terms for the validator. */ + description?: Description; + /** unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. */ + unbondingHeight: Long; + /** unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. */ + unbondingTime?: Date; + /** commission defines the commission parameters. */ + commission?: Commission; + /** min_self_delegation is the validator's self declared minimum self delegation. */ + minSelfDelegation: string; +} + +/** ValAddresses defines a repeated set of validator addresses. */ +export interface ValAddresses { + addresses: string[]; +} + +/** + * DVPair is struct that just has a delegator-validator pair with no other data. + * It is intended to be used as a marshalable pointer. For example, a DVPair can + * be used to construct the key to getting an UnbondingDelegation from state. + */ +export interface DVPair { + delegatorAddress: string; + validatorAddress: string; +} + +/** DVPairs defines an array of DVPair objects. */ +export interface DVPairs { + pairs: DVPair[]; +} + +/** + * DVVTriplet is struct that just has a delegator-validator-validator triplet + * with no other data. It is intended to be used as a marshalable pointer. For + * example, a DVVTriplet can be used to construct the key to getting a + * Redelegation from state. + */ +export interface DVVTriplet { + delegatorAddress: string; + validatorSrcAddress: string; + validatorDstAddress: string; +} + +/** DVVTriplets defines an array of DVVTriplet objects. */ +export interface DVVTriplets { + triplets: DVVTriplet[]; +} + +/** + * Delegation represents the bond with tokens held by an account. It is + * owned by one delegator, and is associated with the voting power of one + * validator. + */ +export interface Delegation { + /** delegator_address is the bech32-encoded address of the delegator. */ + delegatorAddress: string; + /** validator_address is the bech32-encoded address of the validator. */ + validatorAddress: string; + /** shares define the delegation shares received. */ + shares: string; +} + +/** + * UnbondingDelegation stores all of a single delegator's unbonding bonds + * for a single validator in an time-ordered list. + */ +export interface UnbondingDelegation { + /** delegator_address is the bech32-encoded address of the delegator. */ + delegatorAddress: string; + /** validator_address is the bech32-encoded address of the validator. */ + validatorAddress: string; + /** entries are the unbonding delegation entries. */ + entries: UnbondingDelegationEntry[]; +} + +/** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ +export interface UnbondingDelegationEntry { + /** creation_height is the height which the unbonding took place. */ + creationHeight: Long; + /** completion_time is the unix time for unbonding completion. */ + completionTime?: Date; + /** initial_balance defines the tokens initially scheduled to receive at completion. */ + initialBalance: string; + /** balance defines the tokens to receive at completion. */ + balance: string; +} + +/** RedelegationEntry defines a redelegation object with relevant metadata. */ +export interface RedelegationEntry { + /** creation_height defines the height which the redelegation took place. */ + creationHeight: Long; + /** completion_time defines the unix time for redelegation completion. */ + completionTime?: Date; + /** initial_balance defines the initial balance when redelegation started. */ + initialBalance: string; + /** shares_dst is the amount of destination-validator shares created by redelegation. */ + sharesDst: string; +} + +/** + * Redelegation contains the list of a particular delegator's redelegating bonds + * from a particular source validator to a particular destination validator. + */ +export interface Redelegation { + /** delegator_address is the bech32-encoded address of the delegator. */ + delegatorAddress: string; + /** validator_src_address is the validator redelegation source operator address. */ + validatorSrcAddress: string; + /** validator_dst_address is the validator redelegation destination operator address. */ + validatorDstAddress: string; + /** entries are the redelegation entries. */ + entries: RedelegationEntry[]; +} + +/** Params defines the parameters for the staking module. */ +export interface Params { + /** unbonding_time is the time duration of unbonding. */ + unbondingTime?: Duration; + /** max_validators is the maximum number of validators. */ + maxValidators: number; + /** max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). */ + maxEntries: number; + /** historical_entries is the number of historical entries to persist. */ + historicalEntries: number; + /** bond_denom defines the bondable coin denomination. */ + bondDenom: string; + /** power_reduction is the amount of staking tokens required for 1 unit of consensus-engine power */ + powerReduction: string; +} + +/** + * DelegationResponse is equivalent to Delegation except that it contains a + * balance in addition to shares which is more suitable for client responses. + */ +export interface DelegationResponse { + delegation?: Delegation; + balance?: Coin; +} + +/** + * RedelegationEntryResponse is equivalent to a RedelegationEntry except that it + * contains a balance in addition to shares which is more suitable for client + * responses. + */ +export interface RedelegationEntryResponse { + redelegationEntry?: RedelegationEntry; + balance: string; +} + +/** + * RedelegationResponse is equivalent to a Redelegation except that its entries + * contain a balance in addition to shares which is more suitable for client + * responses. + */ +export interface RedelegationResponse { + redelegation?: Redelegation; + entries: RedelegationEntryResponse[]; +} + +/** + * Pool is used for tracking bonded and not-bonded token supply of the bond + * denomination. + */ +export interface Pool { + notBondedTokens: string; + bondedTokens: string; +} + +const baseHistoricalInfo: object = {}; + +export const HistoricalInfo = { + encode(message: HistoricalInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.header !== undefined) { + Header.encode(message.header, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.valset) { + Validator.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): HistoricalInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHistoricalInfo } as HistoricalInfo; + message.valset = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = Header.decode(reader, reader.uint32()); + break; + case 2: + message.valset.push(Validator.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): HistoricalInfo { + const message = { ...baseHistoricalInfo } as HistoricalInfo; + message.valset = []; + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromJSON(object.header); + } else { + message.header = undefined; + } + if (object.valset !== undefined && object.valset !== null) { + for (const e of object.valset) { + message.valset.push(Validator.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: HistoricalInfo): unknown { + const obj: any = {}; + message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); + if (message.valset) { + obj.valset = message.valset.map((e) => (e ? Validator.toJSON(e) : undefined)); + } else { + obj.valset = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): HistoricalInfo { + const message = { ...baseHistoricalInfo } as HistoricalInfo; + message.valset = []; + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromPartial(object.header); + } else { + message.header = undefined; + } + if (object.valset !== undefined && object.valset !== null) { + for (const e of object.valset) { + message.valset.push(Validator.fromPartial(e)); + } + } + return message; + }, +}; + +const baseCommissionRates: object = { rate: "", maxRate: "", maxChangeRate: "" }; + +export const CommissionRates = { + encode(message: CommissionRates, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.rate !== "") { + writer.uint32(10).string(message.rate); + } + if (message.maxRate !== "") { + writer.uint32(18).string(message.maxRate); + } + if (message.maxChangeRate !== "") { + writer.uint32(26).string(message.maxChangeRate); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CommissionRates { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCommissionRates } as CommissionRates; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rate = reader.string(); + break; + case 2: + message.maxRate = reader.string(); + break; + case 3: + message.maxChangeRate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CommissionRates { + const message = { ...baseCommissionRates } as CommissionRates; + if (object.rate !== undefined && object.rate !== null) { + message.rate = String(object.rate); + } else { + message.rate = ""; + } + if (object.maxRate !== undefined && object.maxRate !== null) { + message.maxRate = String(object.maxRate); + } else { + message.maxRate = ""; + } + if (object.maxChangeRate !== undefined && object.maxChangeRate !== null) { + message.maxChangeRate = String(object.maxChangeRate); + } else { + message.maxChangeRate = ""; + } + return message; + }, + + toJSON(message: CommissionRates): unknown { + const obj: any = {}; + message.rate !== undefined && (obj.rate = message.rate); + message.maxRate !== undefined && (obj.maxRate = message.maxRate); + message.maxChangeRate !== undefined && (obj.maxChangeRate = message.maxChangeRate); + return obj; + }, + + fromPartial(object: DeepPartial): CommissionRates { + const message = { ...baseCommissionRates } as CommissionRates; + if (object.rate !== undefined && object.rate !== null) { + message.rate = object.rate; + } else { + message.rate = ""; + } + if (object.maxRate !== undefined && object.maxRate !== null) { + message.maxRate = object.maxRate; + } else { + message.maxRate = ""; + } + if (object.maxChangeRate !== undefined && object.maxChangeRate !== null) { + message.maxChangeRate = object.maxChangeRate; + } else { + message.maxChangeRate = ""; + } + return message; + }, +}; + +const baseCommission: object = {}; + +export const Commission = { + encode(message: Commission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.commissionRates !== undefined) { + CommissionRates.encode(message.commissionRates, writer.uint32(10).fork()).ldelim(); + } + if (message.updateTime !== undefined) { + Timestamp.encode(toTimestamp(message.updateTime), writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Commission { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCommission } as Commission; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.commissionRates = CommissionRates.decode(reader, reader.uint32()); + break; + case 2: + message.updateTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Commission { + const message = { ...baseCommission } as Commission; + if (object.commissionRates !== undefined && object.commissionRates !== null) { + message.commissionRates = CommissionRates.fromJSON(object.commissionRates); + } else { + message.commissionRates = undefined; + } + if (object.updateTime !== undefined && object.updateTime !== null) { + message.updateTime = fromJsonTimestamp(object.updateTime); + } else { + message.updateTime = undefined; + } + return message; + }, + + toJSON(message: Commission): unknown { + const obj: any = {}; + message.commissionRates !== undefined && + (obj.commissionRates = message.commissionRates + ? CommissionRates.toJSON(message.commissionRates) + : undefined); + message.updateTime !== undefined && (obj.updateTime = message.updateTime.toISOString()); + return obj; + }, + + fromPartial(object: DeepPartial): Commission { + const message = { ...baseCommission } as Commission; + if (object.commissionRates !== undefined && object.commissionRates !== null) { + message.commissionRates = CommissionRates.fromPartial(object.commissionRates); + } else { + message.commissionRates = undefined; + } + if (object.updateTime !== undefined && object.updateTime !== null) { + message.updateTime = object.updateTime; + } else { + message.updateTime = undefined; + } + return message; + }, +}; + +const baseDescription: object = { moniker: "", identity: "", website: "", securityContact: "", details: "" }; + +export const Description = { + encode(message: Description, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.moniker !== "") { + writer.uint32(10).string(message.moniker); + } + if (message.identity !== "") { + writer.uint32(18).string(message.identity); + } + if (message.website !== "") { + writer.uint32(26).string(message.website); + } + if (message.securityContact !== "") { + writer.uint32(34).string(message.securityContact); + } + if (message.details !== "") { + writer.uint32(42).string(message.details); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Description { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDescription } as Description; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.moniker = reader.string(); + break; + case 2: + message.identity = reader.string(); + break; + case 3: + message.website = reader.string(); + break; + case 4: + message.securityContact = reader.string(); + break; + case 5: + message.details = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Description { + const message = { ...baseDescription } as Description; + if (object.moniker !== undefined && object.moniker !== null) { + message.moniker = String(object.moniker); + } else { + message.moniker = ""; + } + if (object.identity !== undefined && object.identity !== null) { + message.identity = String(object.identity); + } else { + message.identity = ""; + } + if (object.website !== undefined && object.website !== null) { + message.website = String(object.website); + } else { + message.website = ""; + } + if (object.securityContact !== undefined && object.securityContact !== null) { + message.securityContact = String(object.securityContact); + } else { + message.securityContact = ""; + } + if (object.details !== undefined && object.details !== null) { + message.details = String(object.details); + } else { + message.details = ""; + } + return message; + }, + + toJSON(message: Description): unknown { + const obj: any = {}; + message.moniker !== undefined && (obj.moniker = message.moniker); + message.identity !== undefined && (obj.identity = message.identity); + message.website !== undefined && (obj.website = message.website); + message.securityContact !== undefined && (obj.securityContact = message.securityContact); + message.details !== undefined && (obj.details = message.details); + return obj; + }, + + fromPartial(object: DeepPartial): Description { + const message = { ...baseDescription } as Description; + if (object.moniker !== undefined && object.moniker !== null) { + message.moniker = object.moniker; + } else { + message.moniker = ""; + } + if (object.identity !== undefined && object.identity !== null) { + message.identity = object.identity; + } else { + message.identity = ""; + } + if (object.website !== undefined && object.website !== null) { + message.website = object.website; + } else { + message.website = ""; + } + if (object.securityContact !== undefined && object.securityContact !== null) { + message.securityContact = object.securityContact; + } else { + message.securityContact = ""; + } + if (object.details !== undefined && object.details !== null) { + message.details = object.details; + } else { + message.details = ""; + } + return message; + }, +}; + +const baseValidator: object = { + operatorAddress: "", + jailed: false, + status: 0, + tokens: "", + delegatorShares: "", + unbondingHeight: Long.ZERO, + minSelfDelegation: "", +}; + +export const Validator = { + encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.operatorAddress !== "") { + writer.uint32(10).string(message.operatorAddress); + } + if (message.consensusPubkey !== undefined) { + Any.encode(message.consensusPubkey, writer.uint32(18).fork()).ldelim(); + } + if (message.jailed === true) { + writer.uint32(24).bool(message.jailed); + } + if (message.status !== 0) { + writer.uint32(32).int32(message.status); + } + if (message.tokens !== "") { + writer.uint32(42).string(message.tokens); + } + if (message.delegatorShares !== "") { + writer.uint32(50).string(message.delegatorShares); + } + if (message.description !== undefined) { + Description.encode(message.description, writer.uint32(58).fork()).ldelim(); + } + if (!message.unbondingHeight.isZero()) { + writer.uint32(64).int64(message.unbondingHeight); + } + if (message.unbondingTime !== undefined) { + Timestamp.encode(toTimestamp(message.unbondingTime), writer.uint32(74).fork()).ldelim(); + } + if (message.commission !== undefined) { + Commission.encode(message.commission, writer.uint32(82).fork()).ldelim(); + } + if (message.minSelfDelegation !== "") { + writer.uint32(90).string(message.minSelfDelegation); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Validator { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseValidator } as Validator; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operatorAddress = reader.string(); + break; + case 2: + message.consensusPubkey = Any.decode(reader, reader.uint32()); + break; + case 3: + message.jailed = reader.bool(); + break; + case 4: + message.status = reader.int32() as any; + break; + case 5: + message.tokens = reader.string(); + break; + case 6: + message.delegatorShares = reader.string(); + break; + case 7: + message.description = Description.decode(reader, reader.uint32()); + break; + case 8: + message.unbondingHeight = reader.int64() as Long; + break; + case 9: + message.unbondingTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 10: + message.commission = Commission.decode(reader, reader.uint32()); + break; + case 11: + message.minSelfDelegation = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Validator { + const message = { ...baseValidator } as Validator; + if (object.operatorAddress !== undefined && object.operatorAddress !== null) { + message.operatorAddress = String(object.operatorAddress); + } else { + message.operatorAddress = ""; + } + if (object.consensusPubkey !== undefined && object.consensusPubkey !== null) { + message.consensusPubkey = Any.fromJSON(object.consensusPubkey); + } else { + message.consensusPubkey = undefined; + } + if (object.jailed !== undefined && object.jailed !== null) { + message.jailed = Boolean(object.jailed); + } else { + message.jailed = false; + } + if (object.status !== undefined && object.status !== null) { + message.status = bondStatusFromJSON(object.status); + } else { + message.status = 0; + } + if (object.tokens !== undefined && object.tokens !== null) { + message.tokens = String(object.tokens); + } else { + message.tokens = ""; + } + if (object.delegatorShares !== undefined && object.delegatorShares !== null) { + message.delegatorShares = String(object.delegatorShares); + } else { + message.delegatorShares = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromJSON(object.description); + } else { + message.description = undefined; + } + if (object.unbondingHeight !== undefined && object.unbondingHeight !== null) { + message.unbondingHeight = Long.fromString(object.unbondingHeight); + } else { + message.unbondingHeight = Long.ZERO; + } + if (object.unbondingTime !== undefined && object.unbondingTime !== null) { + message.unbondingTime = fromJsonTimestamp(object.unbondingTime); + } else { + message.unbondingTime = undefined; + } + if (object.commission !== undefined && object.commission !== null) { + message.commission = Commission.fromJSON(object.commission); + } else { + message.commission = undefined; + } + if (object.minSelfDelegation !== undefined && object.minSelfDelegation !== null) { + message.minSelfDelegation = String(object.minSelfDelegation); + } else { + message.minSelfDelegation = ""; + } + return message; + }, + + toJSON(message: Validator): unknown { + const obj: any = {}; + message.operatorAddress !== undefined && (obj.operatorAddress = message.operatorAddress); + message.consensusPubkey !== undefined && + (obj.consensusPubkey = message.consensusPubkey ? Any.toJSON(message.consensusPubkey) : undefined); + message.jailed !== undefined && (obj.jailed = message.jailed); + message.status !== undefined && (obj.status = bondStatusToJSON(message.status)); + message.tokens !== undefined && (obj.tokens = message.tokens); + message.delegatorShares !== undefined && (obj.delegatorShares = message.delegatorShares); + message.description !== undefined && + (obj.description = message.description ? Description.toJSON(message.description) : undefined); + message.unbondingHeight !== undefined && + (obj.unbondingHeight = (message.unbondingHeight || Long.ZERO).toString()); + message.unbondingTime !== undefined && (obj.unbondingTime = message.unbondingTime.toISOString()); + message.commission !== undefined && + (obj.commission = message.commission ? Commission.toJSON(message.commission) : undefined); + message.minSelfDelegation !== undefined && (obj.minSelfDelegation = message.minSelfDelegation); + return obj; + }, + + fromPartial(object: DeepPartial): Validator { + const message = { ...baseValidator } as Validator; + if (object.operatorAddress !== undefined && object.operatorAddress !== null) { + message.operatorAddress = object.operatorAddress; + } else { + message.operatorAddress = ""; + } + if (object.consensusPubkey !== undefined && object.consensusPubkey !== null) { + message.consensusPubkey = Any.fromPartial(object.consensusPubkey); + } else { + message.consensusPubkey = undefined; + } + if (object.jailed !== undefined && object.jailed !== null) { + message.jailed = object.jailed; + } else { + message.jailed = false; + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } else { + message.status = 0; + } + if (object.tokens !== undefined && object.tokens !== null) { + message.tokens = object.tokens; + } else { + message.tokens = ""; + } + if (object.delegatorShares !== undefined && object.delegatorShares !== null) { + message.delegatorShares = object.delegatorShares; + } else { + message.delegatorShares = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromPartial(object.description); + } else { + message.description = undefined; + } + if (object.unbondingHeight !== undefined && object.unbondingHeight !== null) { + message.unbondingHeight = object.unbondingHeight as Long; + } else { + message.unbondingHeight = Long.ZERO; + } + if (object.unbondingTime !== undefined && object.unbondingTime !== null) { + message.unbondingTime = object.unbondingTime; + } else { + message.unbondingTime = undefined; + } + if (object.commission !== undefined && object.commission !== null) { + message.commission = Commission.fromPartial(object.commission); + } else { + message.commission = undefined; + } + if (object.minSelfDelegation !== undefined && object.minSelfDelegation !== null) { + message.minSelfDelegation = object.minSelfDelegation; + } else { + message.minSelfDelegation = ""; + } + return message; + }, +}; + +const baseValAddresses: object = { addresses: "" }; + +export const ValAddresses = { + encode(message: ValAddresses, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.addresses) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ValAddresses { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseValAddresses } as ValAddresses; + message.addresses = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ValAddresses { + const message = { ...baseValAddresses } as ValAddresses; + message.addresses = []; + if (object.addresses !== undefined && object.addresses !== null) { + for (const e of object.addresses) { + message.addresses.push(String(e)); + } + } + return message; + }, + + toJSON(message: ValAddresses): unknown { + const obj: any = {}; + if (message.addresses) { + obj.addresses = message.addresses.map((e) => e); + } else { + obj.addresses = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ValAddresses { + const message = { ...baseValAddresses } as ValAddresses; + message.addresses = []; + if (object.addresses !== undefined && object.addresses !== null) { + for (const e of object.addresses) { + message.addresses.push(e); + } + } + return message; + }, +}; + +const baseDVPair: object = { delegatorAddress: "", validatorAddress: "" }; + +export const DVPair = { + encode(message: DVPair, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DVPair { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDVPair } as DVPair; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DVPair { + const message = { ...baseDVPair } as DVPair; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = String(object.delegatorAddress); + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = String(object.validatorAddress); + } else { + message.validatorAddress = ""; + } + return message; + }, + + toJSON(message: DVPair): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + return obj; + }, + + fromPartial(object: DeepPartial): DVPair { + const message = { ...baseDVPair } as DVPair; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = object.delegatorAddress; + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = ""; + } + return message; + }, +}; + +const baseDVPairs: object = {}; + +export const DVPairs = { + encode(message: DVPairs, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.pairs) { + DVPair.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DVPairs { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDVPairs } as DVPairs; + message.pairs = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pairs.push(DVPair.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DVPairs { + const message = { ...baseDVPairs } as DVPairs; + message.pairs = []; + if (object.pairs !== undefined && object.pairs !== null) { + for (const e of object.pairs) { + message.pairs.push(DVPair.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: DVPairs): unknown { + const obj: any = {}; + if (message.pairs) { + obj.pairs = message.pairs.map((e) => (e ? DVPair.toJSON(e) : undefined)); + } else { + obj.pairs = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): DVPairs { + const message = { ...baseDVPairs } as DVPairs; + message.pairs = []; + if (object.pairs !== undefined && object.pairs !== null) { + for (const e of object.pairs) { + message.pairs.push(DVPair.fromPartial(e)); + } + } + return message; + }, +}; + +const baseDVVTriplet: object = { delegatorAddress: "", validatorSrcAddress: "", validatorDstAddress: "" }; + +export const DVVTriplet = { + encode(message: DVVTriplet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorSrcAddress !== "") { + writer.uint32(18).string(message.validatorSrcAddress); + } + if (message.validatorDstAddress !== "") { + writer.uint32(26).string(message.validatorDstAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DVVTriplet { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDVVTriplet } as DVVTriplet; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorSrcAddress = reader.string(); + break; + case 3: + message.validatorDstAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DVVTriplet { + const message = { ...baseDVVTriplet } as DVVTriplet; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = String(object.delegatorAddress); + } else { + message.delegatorAddress = ""; + } + if (object.validatorSrcAddress !== undefined && object.validatorSrcAddress !== null) { + message.validatorSrcAddress = String(object.validatorSrcAddress); + } else { + message.validatorSrcAddress = ""; + } + if (object.validatorDstAddress !== undefined && object.validatorDstAddress !== null) { + message.validatorDstAddress = String(object.validatorDstAddress); + } else { + message.validatorDstAddress = ""; + } + return message; + }, + + toJSON(message: DVVTriplet): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorSrcAddress !== undefined && (obj.validatorSrcAddress = message.validatorSrcAddress); + message.validatorDstAddress !== undefined && (obj.validatorDstAddress = message.validatorDstAddress); + return obj; + }, + + fromPartial(object: DeepPartial): DVVTriplet { + const message = { ...baseDVVTriplet } as DVVTriplet; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = object.delegatorAddress; + } else { + message.delegatorAddress = ""; + } + if (object.validatorSrcAddress !== undefined && object.validatorSrcAddress !== null) { + message.validatorSrcAddress = object.validatorSrcAddress; + } else { + message.validatorSrcAddress = ""; + } + if (object.validatorDstAddress !== undefined && object.validatorDstAddress !== null) { + message.validatorDstAddress = object.validatorDstAddress; + } else { + message.validatorDstAddress = ""; + } + return message; + }, +}; + +const baseDVVTriplets: object = {}; + +export const DVVTriplets = { + encode(message: DVVTriplets, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.triplets) { + DVVTriplet.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DVVTriplets { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDVVTriplets } as DVVTriplets; + message.triplets = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.triplets.push(DVVTriplet.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DVVTriplets { + const message = { ...baseDVVTriplets } as DVVTriplets; + message.triplets = []; + if (object.triplets !== undefined && object.triplets !== null) { + for (const e of object.triplets) { + message.triplets.push(DVVTriplet.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: DVVTriplets): unknown { + const obj: any = {}; + if (message.triplets) { + obj.triplets = message.triplets.map((e) => (e ? DVVTriplet.toJSON(e) : undefined)); + } else { + obj.triplets = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): DVVTriplets { + const message = { ...baseDVVTriplets } as DVVTriplets; + message.triplets = []; + if (object.triplets !== undefined && object.triplets !== null) { + for (const e of object.triplets) { + message.triplets.push(DVVTriplet.fromPartial(e)); + } + } + return message; + }, +}; + +const baseDelegation: object = { delegatorAddress: "", validatorAddress: "", shares: "" }; + +export const Delegation = { + encode(message: Delegation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + if (message.shares !== "") { + writer.uint32(26).string(message.shares); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Delegation { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDelegation } as Delegation; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.shares = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Delegation { + const message = { ...baseDelegation } as Delegation; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = String(object.delegatorAddress); + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = String(object.validatorAddress); + } else { + message.validatorAddress = ""; + } + if (object.shares !== undefined && object.shares !== null) { + message.shares = String(object.shares); + } else { + message.shares = ""; + } + return message; + }, + + toJSON(message: Delegation): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.shares !== undefined && (obj.shares = message.shares); + return obj; + }, + + fromPartial(object: DeepPartial): Delegation { + const message = { ...baseDelegation } as Delegation; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = object.delegatorAddress; + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = ""; + } + if (object.shares !== undefined && object.shares !== null) { + message.shares = object.shares; + } else { + message.shares = ""; + } + return message; + }, +}; + +const baseUnbondingDelegation: object = { delegatorAddress: "", validatorAddress: "" }; + +export const UnbondingDelegation = { + encode(message: UnbondingDelegation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + for (const v of message.entries) { + UnbondingDelegationEntry.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UnbondingDelegation { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUnbondingDelegation } as UnbondingDelegation; + message.entries = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.entries.push(UnbondingDelegationEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UnbondingDelegation { + const message = { ...baseUnbondingDelegation } as UnbondingDelegation; + message.entries = []; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = String(object.delegatorAddress); + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = String(object.validatorAddress); + } else { + message.validatorAddress = ""; + } + if (object.entries !== undefined && object.entries !== null) { + for (const e of object.entries) { + message.entries.push(UnbondingDelegationEntry.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: UnbondingDelegation): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + if (message.entries) { + obj.entries = message.entries.map((e) => (e ? UnbondingDelegationEntry.toJSON(e) : undefined)); + } else { + obj.entries = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): UnbondingDelegation { + const message = { ...baseUnbondingDelegation } as UnbondingDelegation; + message.entries = []; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = object.delegatorAddress; + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = ""; + } + if (object.entries !== undefined && object.entries !== null) { + for (const e of object.entries) { + message.entries.push(UnbondingDelegationEntry.fromPartial(e)); + } + } + return message; + }, +}; + +const baseUnbondingDelegationEntry: object = { creationHeight: Long.ZERO, initialBalance: "", balance: "" }; + +export const UnbondingDelegationEntry = { + encode(message: UnbondingDelegationEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.creationHeight.isZero()) { + writer.uint32(8).int64(message.creationHeight); + } + if (message.completionTime !== undefined) { + Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(18).fork()).ldelim(); + } + if (message.initialBalance !== "") { + writer.uint32(26).string(message.initialBalance); + } + if (message.balance !== "") { + writer.uint32(34).string(message.balance); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UnbondingDelegationEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUnbondingDelegationEntry } as UnbondingDelegationEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creationHeight = reader.int64() as Long; + break; + case 2: + message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 3: + message.initialBalance = reader.string(); + break; + case 4: + message.balance = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UnbondingDelegationEntry { + const message = { ...baseUnbondingDelegationEntry } as UnbondingDelegationEntry; + if (object.creationHeight !== undefined && object.creationHeight !== null) { + message.creationHeight = Long.fromString(object.creationHeight); + } else { + message.creationHeight = Long.ZERO; + } + if (object.completionTime !== undefined && object.completionTime !== null) { + message.completionTime = fromJsonTimestamp(object.completionTime); + } else { + message.completionTime = undefined; + } + if (object.initialBalance !== undefined && object.initialBalance !== null) { + message.initialBalance = String(object.initialBalance); + } else { + message.initialBalance = ""; + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = String(object.balance); + } else { + message.balance = ""; + } + return message; + }, + + toJSON(message: UnbondingDelegationEntry): unknown { + const obj: any = {}; + message.creationHeight !== undefined && + (obj.creationHeight = (message.creationHeight || Long.ZERO).toString()); + message.completionTime !== undefined && (obj.completionTime = message.completionTime.toISOString()); + message.initialBalance !== undefined && (obj.initialBalance = message.initialBalance); + message.balance !== undefined && (obj.balance = message.balance); + return obj; + }, + + fromPartial(object: DeepPartial): UnbondingDelegationEntry { + const message = { ...baseUnbondingDelegationEntry } as UnbondingDelegationEntry; + if (object.creationHeight !== undefined && object.creationHeight !== null) { + message.creationHeight = object.creationHeight as Long; + } else { + message.creationHeight = Long.ZERO; + } + if (object.completionTime !== undefined && object.completionTime !== null) { + message.completionTime = object.completionTime; + } else { + message.completionTime = undefined; + } + if (object.initialBalance !== undefined && object.initialBalance !== null) { + message.initialBalance = object.initialBalance; + } else { + message.initialBalance = ""; + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = object.balance; + } else { + message.balance = ""; + } + return message; + }, +}; + +const baseRedelegationEntry: object = { creationHeight: Long.ZERO, initialBalance: "", sharesDst: "" }; + +export const RedelegationEntry = { + encode(message: RedelegationEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.creationHeight.isZero()) { + writer.uint32(8).int64(message.creationHeight); + } + if (message.completionTime !== undefined) { + Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(18).fork()).ldelim(); + } + if (message.initialBalance !== "") { + writer.uint32(26).string(message.initialBalance); + } + if (message.sharesDst !== "") { + writer.uint32(34).string(message.sharesDst); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RedelegationEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRedelegationEntry } as RedelegationEntry; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creationHeight = reader.int64() as Long; + break; + case 2: + message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 3: + message.initialBalance = reader.string(); + break; + case 4: + message.sharesDst = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RedelegationEntry { + const message = { ...baseRedelegationEntry } as RedelegationEntry; + if (object.creationHeight !== undefined && object.creationHeight !== null) { + message.creationHeight = Long.fromString(object.creationHeight); + } else { + message.creationHeight = Long.ZERO; + } + if (object.completionTime !== undefined && object.completionTime !== null) { + message.completionTime = fromJsonTimestamp(object.completionTime); + } else { + message.completionTime = undefined; + } + if (object.initialBalance !== undefined && object.initialBalance !== null) { + message.initialBalance = String(object.initialBalance); + } else { + message.initialBalance = ""; + } + if (object.sharesDst !== undefined && object.sharesDst !== null) { + message.sharesDst = String(object.sharesDst); + } else { + message.sharesDst = ""; + } + return message; + }, + + toJSON(message: RedelegationEntry): unknown { + const obj: any = {}; + message.creationHeight !== undefined && + (obj.creationHeight = (message.creationHeight || Long.ZERO).toString()); + message.completionTime !== undefined && (obj.completionTime = message.completionTime.toISOString()); + message.initialBalance !== undefined && (obj.initialBalance = message.initialBalance); + message.sharesDst !== undefined && (obj.sharesDst = message.sharesDst); + return obj; + }, + + fromPartial(object: DeepPartial): RedelegationEntry { + const message = { ...baseRedelegationEntry } as RedelegationEntry; + if (object.creationHeight !== undefined && object.creationHeight !== null) { + message.creationHeight = object.creationHeight as Long; + } else { + message.creationHeight = Long.ZERO; + } + if (object.completionTime !== undefined && object.completionTime !== null) { + message.completionTime = object.completionTime; + } else { + message.completionTime = undefined; + } + if (object.initialBalance !== undefined && object.initialBalance !== null) { + message.initialBalance = object.initialBalance; + } else { + message.initialBalance = ""; + } + if (object.sharesDst !== undefined && object.sharesDst !== null) { + message.sharesDst = object.sharesDst; + } else { + message.sharesDst = ""; + } + return message; + }, +}; + +const baseRedelegation: object = { delegatorAddress: "", validatorSrcAddress: "", validatorDstAddress: "" }; + +export const Redelegation = { + encode(message: Redelegation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorSrcAddress !== "") { + writer.uint32(18).string(message.validatorSrcAddress); + } + if (message.validatorDstAddress !== "") { + writer.uint32(26).string(message.validatorDstAddress); + } + for (const v of message.entries) { + RedelegationEntry.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Redelegation { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRedelegation } as Redelegation; + message.entries = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorSrcAddress = reader.string(); + break; + case 3: + message.validatorDstAddress = reader.string(); + break; + case 4: + message.entries.push(RedelegationEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Redelegation { + const message = { ...baseRedelegation } as Redelegation; + message.entries = []; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = String(object.delegatorAddress); + } else { + message.delegatorAddress = ""; + } + if (object.validatorSrcAddress !== undefined && object.validatorSrcAddress !== null) { + message.validatorSrcAddress = String(object.validatorSrcAddress); + } else { + message.validatorSrcAddress = ""; + } + if (object.validatorDstAddress !== undefined && object.validatorDstAddress !== null) { + message.validatorDstAddress = String(object.validatorDstAddress); + } else { + message.validatorDstAddress = ""; + } + if (object.entries !== undefined && object.entries !== null) { + for (const e of object.entries) { + message.entries.push(RedelegationEntry.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: Redelegation): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorSrcAddress !== undefined && (obj.validatorSrcAddress = message.validatorSrcAddress); + message.validatorDstAddress !== undefined && (obj.validatorDstAddress = message.validatorDstAddress); + if (message.entries) { + obj.entries = message.entries.map((e) => (e ? RedelegationEntry.toJSON(e) : undefined)); + } else { + obj.entries = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): Redelegation { + const message = { ...baseRedelegation } as Redelegation; + message.entries = []; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = object.delegatorAddress; + } else { + message.delegatorAddress = ""; + } + if (object.validatorSrcAddress !== undefined && object.validatorSrcAddress !== null) { + message.validatorSrcAddress = object.validatorSrcAddress; + } else { + message.validatorSrcAddress = ""; + } + if (object.validatorDstAddress !== undefined && object.validatorDstAddress !== null) { + message.validatorDstAddress = object.validatorDstAddress; + } else { + message.validatorDstAddress = ""; + } + if (object.entries !== undefined && object.entries !== null) { + for (const e of object.entries) { + message.entries.push(RedelegationEntry.fromPartial(e)); + } + } + return message; + }, +}; + +const baseParams: object = { + maxValidators: 0, + maxEntries: 0, + historicalEntries: 0, + bondDenom: "", + powerReduction: "", +}; + +export const Params = { + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.unbondingTime !== undefined) { + Duration.encode(message.unbondingTime, writer.uint32(10).fork()).ldelim(); + } + if (message.maxValidators !== 0) { + writer.uint32(16).uint32(message.maxValidators); + } + if (message.maxEntries !== 0) { + writer.uint32(24).uint32(message.maxEntries); + } + if (message.historicalEntries !== 0) { + writer.uint32(32).uint32(message.historicalEntries); + } + if (message.bondDenom !== "") { + writer.uint32(42).string(message.bondDenom); + } + if (message.powerReduction !== "") { + writer.uint32(50).string(message.powerReduction); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseParams } as Params; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.unbondingTime = Duration.decode(reader, reader.uint32()); + break; + case 2: + message.maxValidators = reader.uint32(); + break; + case 3: + message.maxEntries = reader.uint32(); + break; + case 4: + message.historicalEntries = reader.uint32(); + break; + case 5: + message.bondDenom = reader.string(); + break; + case 6: + message.powerReduction = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Params { + const message = { ...baseParams } as Params; + if (object.unbondingTime !== undefined && object.unbondingTime !== null) { + message.unbondingTime = Duration.fromJSON(object.unbondingTime); + } else { + message.unbondingTime = undefined; + } + if (object.maxValidators !== undefined && object.maxValidators !== null) { + message.maxValidators = Number(object.maxValidators); + } else { + message.maxValidators = 0; + } + if (object.maxEntries !== undefined && object.maxEntries !== null) { + message.maxEntries = Number(object.maxEntries); + } else { + message.maxEntries = 0; + } + if (object.historicalEntries !== undefined && object.historicalEntries !== null) { + message.historicalEntries = Number(object.historicalEntries); + } else { + message.historicalEntries = 0; + } + if (object.bondDenom !== undefined && object.bondDenom !== null) { + message.bondDenom = String(object.bondDenom); + } else { + message.bondDenom = ""; + } + if (object.powerReduction !== undefined && object.powerReduction !== null) { + message.powerReduction = String(object.powerReduction); + } else { + message.powerReduction = ""; + } + return message; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + message.unbondingTime !== undefined && + (obj.unbondingTime = message.unbondingTime ? Duration.toJSON(message.unbondingTime) : undefined); + message.maxValidators !== undefined && (obj.maxValidators = message.maxValidators); + message.maxEntries !== undefined && (obj.maxEntries = message.maxEntries); + message.historicalEntries !== undefined && (obj.historicalEntries = message.historicalEntries); + message.bondDenom !== undefined && (obj.bondDenom = message.bondDenom); + message.powerReduction !== undefined && (obj.powerReduction = message.powerReduction); + return obj; + }, + + fromPartial(object: DeepPartial): Params { + const message = { ...baseParams } as Params; + if (object.unbondingTime !== undefined && object.unbondingTime !== null) { + message.unbondingTime = Duration.fromPartial(object.unbondingTime); + } else { + message.unbondingTime = undefined; + } + if (object.maxValidators !== undefined && object.maxValidators !== null) { + message.maxValidators = object.maxValidators; + } else { + message.maxValidators = 0; + } + if (object.maxEntries !== undefined && object.maxEntries !== null) { + message.maxEntries = object.maxEntries; + } else { + message.maxEntries = 0; + } + if (object.historicalEntries !== undefined && object.historicalEntries !== null) { + message.historicalEntries = object.historicalEntries; + } else { + message.historicalEntries = 0; + } + if (object.bondDenom !== undefined && object.bondDenom !== null) { + message.bondDenom = object.bondDenom; + } else { + message.bondDenom = ""; + } + if (object.powerReduction !== undefined && object.powerReduction !== null) { + message.powerReduction = object.powerReduction; + } else { + message.powerReduction = ""; + } + return message; + }, +}; + +const baseDelegationResponse: object = {}; + +export const DelegationResponse = { + encode(message: DelegationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegation !== undefined) { + Delegation.encode(message.delegation, writer.uint32(10).fork()).ldelim(); + } + if (message.balance !== undefined) { + Coin.encode(message.balance, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DelegationResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDelegationResponse } as DelegationResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegation = Delegation.decode(reader, reader.uint32()); + break; + case 2: + message.balance = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DelegationResponse { + const message = { ...baseDelegationResponse } as DelegationResponse; + if (object.delegation !== undefined && object.delegation !== null) { + message.delegation = Delegation.fromJSON(object.delegation); + } else { + message.delegation = undefined; + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromJSON(object.balance); + } else { + message.balance = undefined; + } + return message; + }, + + toJSON(message: DelegationResponse): unknown { + const obj: any = {}; + message.delegation !== undefined && + (obj.delegation = message.delegation ? Delegation.toJSON(message.delegation) : undefined); + message.balance !== undefined && + (obj.balance = message.balance ? Coin.toJSON(message.balance) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): DelegationResponse { + const message = { ...baseDelegationResponse } as DelegationResponse; + if (object.delegation !== undefined && object.delegation !== null) { + message.delegation = Delegation.fromPartial(object.delegation); + } else { + message.delegation = undefined; + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromPartial(object.balance); + } else { + message.balance = undefined; + } + return message; + }, +}; + +const baseRedelegationEntryResponse: object = { balance: "" }; + +export const RedelegationEntryResponse = { + encode(message: RedelegationEntryResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.redelegationEntry !== undefined) { + RedelegationEntry.encode(message.redelegationEntry, writer.uint32(10).fork()).ldelim(); + } + if (message.balance !== "") { + writer.uint32(34).string(message.balance); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RedelegationEntryResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRedelegationEntryResponse } as RedelegationEntryResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.redelegationEntry = RedelegationEntry.decode(reader, reader.uint32()); + break; + case 4: + message.balance = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RedelegationEntryResponse { + const message = { ...baseRedelegationEntryResponse } as RedelegationEntryResponse; + if (object.redelegationEntry !== undefined && object.redelegationEntry !== null) { + message.redelegationEntry = RedelegationEntry.fromJSON(object.redelegationEntry); + } else { + message.redelegationEntry = undefined; + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = String(object.balance); + } else { + message.balance = ""; + } + return message; + }, + + toJSON(message: RedelegationEntryResponse): unknown { + const obj: any = {}; + message.redelegationEntry !== undefined && + (obj.redelegationEntry = message.redelegationEntry + ? RedelegationEntry.toJSON(message.redelegationEntry) + : undefined); + message.balance !== undefined && (obj.balance = message.balance); + return obj; + }, + + fromPartial(object: DeepPartial): RedelegationEntryResponse { + const message = { ...baseRedelegationEntryResponse } as RedelegationEntryResponse; + if (object.redelegationEntry !== undefined && object.redelegationEntry !== null) { + message.redelegationEntry = RedelegationEntry.fromPartial(object.redelegationEntry); + } else { + message.redelegationEntry = undefined; + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = object.balance; + } else { + message.balance = ""; + } + return message; + }, +}; + +const baseRedelegationResponse: object = {}; + +export const RedelegationResponse = { + encode(message: RedelegationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.redelegation !== undefined) { + Redelegation.encode(message.redelegation, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.entries) { + RedelegationEntryResponse.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RedelegationResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRedelegationResponse } as RedelegationResponse; + message.entries = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.redelegation = Redelegation.decode(reader, reader.uint32()); + break; + case 2: + message.entries.push(RedelegationEntryResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RedelegationResponse { + const message = { ...baseRedelegationResponse } as RedelegationResponse; + message.entries = []; + if (object.redelegation !== undefined && object.redelegation !== null) { + message.redelegation = Redelegation.fromJSON(object.redelegation); + } else { + message.redelegation = undefined; + } + if (object.entries !== undefined && object.entries !== null) { + for (const e of object.entries) { + message.entries.push(RedelegationEntryResponse.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: RedelegationResponse): unknown { + const obj: any = {}; + message.redelegation !== undefined && + (obj.redelegation = message.redelegation ? Redelegation.toJSON(message.redelegation) : undefined); + if (message.entries) { + obj.entries = message.entries.map((e) => (e ? RedelegationEntryResponse.toJSON(e) : undefined)); + } else { + obj.entries = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): RedelegationResponse { + const message = { ...baseRedelegationResponse } as RedelegationResponse; + message.entries = []; + if (object.redelegation !== undefined && object.redelegation !== null) { + message.redelegation = Redelegation.fromPartial(object.redelegation); + } else { + message.redelegation = undefined; + } + if (object.entries !== undefined && object.entries !== null) { + for (const e of object.entries) { + message.entries.push(RedelegationEntryResponse.fromPartial(e)); + } + } + return message; + }, +}; + +const basePool: object = { notBondedTokens: "", bondedTokens: "" }; + +export const Pool = { + encode(message: Pool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.notBondedTokens !== "") { + writer.uint32(10).string(message.notBondedTokens); + } + if (message.bondedTokens !== "") { + writer.uint32(18).string(message.bondedTokens); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Pool { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePool } as Pool; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.notBondedTokens = reader.string(); + break; + case 2: + message.bondedTokens = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Pool { + const message = { ...basePool } as Pool; + if (object.notBondedTokens !== undefined && object.notBondedTokens !== null) { + message.notBondedTokens = String(object.notBondedTokens); + } else { + message.notBondedTokens = ""; + } + if (object.bondedTokens !== undefined && object.bondedTokens !== null) { + message.bondedTokens = String(object.bondedTokens); + } else { + message.bondedTokens = ""; + } + return message; + }, + + toJSON(message: Pool): unknown { + const obj: any = {}; + message.notBondedTokens !== undefined && (obj.notBondedTokens = message.notBondedTokens); + message.bondedTokens !== undefined && (obj.bondedTokens = message.bondedTokens); + return obj; + }, + + fromPartial(object: DeepPartial): Pool { + const message = { ...basePool } as Pool; + if (object.notBondedTokens !== undefined && object.notBondedTokens !== null) { + message.notBondedTokens = object.notBondedTokens; + } else { + message.notBondedTokens = ""; + } + if (object.bondedTokens !== undefined && object.bondedTokens !== null) { + message.bondedTokens = object.bondedTokens; + } else { + message.bondedTokens = ""; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function toTimestamp(date: Date): Timestamp { + const seconds = numberToLong(date.getTime() / 1_000); + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds.toNumber() * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function numberToLong(number: number) { + return Long.fromNumber(number); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/staking/v1beta1/tx.ts b/src/cosmos/staking/v1beta1/tx.ts new file mode 100644 index 00000000..ef24bab2 --- /dev/null +++ b/src/cosmos/staking/v1beta1/tx.ts @@ -0,0 +1,972 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Description, CommissionRates } from "../../../cosmos/staking/v1beta1/staking"; +import { Any } from "../../../google/protobuf/any"; +import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import { Timestamp } from "../../../google/protobuf/timestamp"; + +export const protobufPackage = "cosmos.staking.v1beta1"; + +/** MsgCreateValidator defines a SDK message for creating a new validator. */ +export interface MsgCreateValidator { + description?: Description; + commission?: CommissionRates; + minSelfDelegation: string; + delegatorAddress: string; + validatorAddress: string; + pubkey?: Any; + value?: Coin; +} + +/** MsgCreateValidatorResponse defines the Msg/CreateValidator response type. */ +export interface MsgCreateValidatorResponse {} + +/** MsgEditValidator defines a SDK message for editing an existing validator. */ +export interface MsgEditValidator { + description?: Description; + validatorAddress: string; + /** + * We pass a reference to the new commission rate and min self delegation as + * it's not mandatory to update. If not updated, the deserialized rate will be + * zero with no way to distinguish if an update was intended. + * REF: #2373 + */ + commissionRate: string; + minSelfDelegation: string; +} + +/** MsgEditValidatorResponse defines the Msg/EditValidator response type. */ +export interface MsgEditValidatorResponse {} + +/** + * MsgDelegate defines a SDK message for performing a delegation of coins + * from a delegator to a validator. + */ +export interface MsgDelegate { + delegatorAddress: string; + validatorAddress: string; + amount?: Coin; +} + +/** MsgDelegateResponse defines the Msg/Delegate response type. */ +export interface MsgDelegateResponse {} + +/** + * MsgBeginRedelegate defines a SDK message for performing a redelegation + * of coins from a delegator and source validator to a destination validator. + */ +export interface MsgBeginRedelegate { + delegatorAddress: string; + validatorSrcAddress: string; + validatorDstAddress: string; + amount?: Coin; +} + +/** MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */ +export interface MsgBeginRedelegateResponse { + completionTime?: Date; +} + +/** + * MsgUndelegate defines a SDK message for performing an undelegation from a + * delegate and a validator. + */ +export interface MsgUndelegate { + delegatorAddress: string; + validatorAddress: string; + amount?: Coin; +} + +/** MsgUndelegateResponse defines the Msg/Undelegate response type. */ +export interface MsgUndelegateResponse { + completionTime?: Date; +} + +const baseMsgCreateValidator: object = { minSelfDelegation: "", delegatorAddress: "", validatorAddress: "" }; + +export const MsgCreateValidator = { + encode(message: MsgCreateValidator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.description !== undefined) { + Description.encode(message.description, writer.uint32(10).fork()).ldelim(); + } + if (message.commission !== undefined) { + CommissionRates.encode(message.commission, writer.uint32(18).fork()).ldelim(); + } + if (message.minSelfDelegation !== "") { + writer.uint32(26).string(message.minSelfDelegation); + } + if (message.delegatorAddress !== "") { + writer.uint32(34).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(42).string(message.validatorAddress); + } + if (message.pubkey !== undefined) { + Any.encode(message.pubkey, writer.uint32(50).fork()).ldelim(); + } + if (message.value !== undefined) { + Coin.encode(message.value, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateValidator { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgCreateValidator } as MsgCreateValidator; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = Description.decode(reader, reader.uint32()); + break; + case 2: + message.commission = CommissionRates.decode(reader, reader.uint32()); + break; + case 3: + message.minSelfDelegation = reader.string(); + break; + case 4: + message.delegatorAddress = reader.string(); + break; + case 5: + message.validatorAddress = reader.string(); + break; + case 6: + message.pubkey = Any.decode(reader, reader.uint32()); + break; + case 7: + message.value = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgCreateValidator { + const message = { ...baseMsgCreateValidator } as MsgCreateValidator; + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromJSON(object.description); + } else { + message.description = undefined; + } + if (object.commission !== undefined && object.commission !== null) { + message.commission = CommissionRates.fromJSON(object.commission); + } else { + message.commission = undefined; + } + if (object.minSelfDelegation !== undefined && object.minSelfDelegation !== null) { + message.minSelfDelegation = String(object.minSelfDelegation); + } else { + message.minSelfDelegation = ""; + } + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = String(object.delegatorAddress); + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = String(object.validatorAddress); + } else { + message.validatorAddress = ""; + } + if (object.pubkey !== undefined && object.pubkey !== null) { + message.pubkey = Any.fromJSON(object.pubkey); + } else { + message.pubkey = undefined; + } + if (object.value !== undefined && object.value !== null) { + message.value = Coin.fromJSON(object.value); + } else { + message.value = undefined; + } + return message; + }, + + toJSON(message: MsgCreateValidator): unknown { + const obj: any = {}; + message.description !== undefined && + (obj.description = message.description ? Description.toJSON(message.description) : undefined); + message.commission !== undefined && + (obj.commission = message.commission ? CommissionRates.toJSON(message.commission) : undefined); + message.minSelfDelegation !== undefined && (obj.minSelfDelegation = message.minSelfDelegation); + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.pubkey !== undefined && (obj.pubkey = message.pubkey ? Any.toJSON(message.pubkey) : undefined); + message.value !== undefined && (obj.value = message.value ? Coin.toJSON(message.value) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): MsgCreateValidator { + const message = { ...baseMsgCreateValidator } as MsgCreateValidator; + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromPartial(object.description); + } else { + message.description = undefined; + } + if (object.commission !== undefined && object.commission !== null) { + message.commission = CommissionRates.fromPartial(object.commission); + } else { + message.commission = undefined; + } + if (object.minSelfDelegation !== undefined && object.minSelfDelegation !== null) { + message.minSelfDelegation = object.minSelfDelegation; + } else { + message.minSelfDelegation = ""; + } + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = object.delegatorAddress; + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = ""; + } + if (object.pubkey !== undefined && object.pubkey !== null) { + message.pubkey = Any.fromPartial(object.pubkey); + } else { + message.pubkey = undefined; + } + if (object.value !== undefined && object.value !== null) { + message.value = Coin.fromPartial(object.value); + } else { + message.value = undefined; + } + return message; + }, +}; + +const baseMsgCreateValidatorResponse: object = {}; + +export const MsgCreateValidatorResponse = { + encode(_: MsgCreateValidatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateValidatorResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgCreateValidatorResponse } as MsgCreateValidatorResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgCreateValidatorResponse { + const message = { ...baseMsgCreateValidatorResponse } as MsgCreateValidatorResponse; + return message; + }, + + toJSON(_: MsgCreateValidatorResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgCreateValidatorResponse { + const message = { ...baseMsgCreateValidatorResponse } as MsgCreateValidatorResponse; + return message; + }, +}; + +const baseMsgEditValidator: object = { validatorAddress: "", commissionRate: "", minSelfDelegation: "" }; + +export const MsgEditValidator = { + encode(message: MsgEditValidator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.description !== undefined) { + Description.encode(message.description, writer.uint32(10).fork()).ldelim(); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + if (message.commissionRate !== "") { + writer.uint32(26).string(message.commissionRate); + } + if (message.minSelfDelegation !== "") { + writer.uint32(34).string(message.minSelfDelegation); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgEditValidator { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgEditValidator } as MsgEditValidator; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = Description.decode(reader, reader.uint32()); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.commissionRate = reader.string(); + break; + case 4: + message.minSelfDelegation = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgEditValidator { + const message = { ...baseMsgEditValidator } as MsgEditValidator; + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromJSON(object.description); + } else { + message.description = undefined; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = String(object.validatorAddress); + } else { + message.validatorAddress = ""; + } + if (object.commissionRate !== undefined && object.commissionRate !== null) { + message.commissionRate = String(object.commissionRate); + } else { + message.commissionRate = ""; + } + if (object.minSelfDelegation !== undefined && object.minSelfDelegation !== null) { + message.minSelfDelegation = String(object.minSelfDelegation); + } else { + message.minSelfDelegation = ""; + } + return message; + }, + + toJSON(message: MsgEditValidator): unknown { + const obj: any = {}; + message.description !== undefined && + (obj.description = message.description ? Description.toJSON(message.description) : undefined); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.commissionRate !== undefined && (obj.commissionRate = message.commissionRate); + message.minSelfDelegation !== undefined && (obj.minSelfDelegation = message.minSelfDelegation); + return obj; + }, + + fromPartial(object: DeepPartial): MsgEditValidator { + const message = { ...baseMsgEditValidator } as MsgEditValidator; + if (object.description !== undefined && object.description !== null) { + message.description = Description.fromPartial(object.description); + } else { + message.description = undefined; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = ""; + } + if (object.commissionRate !== undefined && object.commissionRate !== null) { + message.commissionRate = object.commissionRate; + } else { + message.commissionRate = ""; + } + if (object.minSelfDelegation !== undefined && object.minSelfDelegation !== null) { + message.minSelfDelegation = object.minSelfDelegation; + } else { + message.minSelfDelegation = ""; + } + return message; + }, +}; + +const baseMsgEditValidatorResponse: object = {}; + +export const MsgEditValidatorResponse = { + encode(_: MsgEditValidatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgEditValidatorResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgEditValidatorResponse } as MsgEditValidatorResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgEditValidatorResponse { + const message = { ...baseMsgEditValidatorResponse } as MsgEditValidatorResponse; + return message; + }, + + toJSON(_: MsgEditValidatorResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgEditValidatorResponse { + const message = { ...baseMsgEditValidatorResponse } as MsgEditValidatorResponse; + return message; + }, +}; + +const baseMsgDelegate: object = { delegatorAddress: "", validatorAddress: "" }; + +export const MsgDelegate = { + encode(message: MsgDelegate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgDelegate { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgDelegate } as MsgDelegate; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgDelegate { + const message = { ...baseMsgDelegate } as MsgDelegate; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = String(object.delegatorAddress); + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = String(object.validatorAddress); + } else { + message.validatorAddress = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromJSON(object.amount); + } else { + message.amount = undefined; + } + return message; + }, + + toJSON(message: MsgDelegate): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): MsgDelegate { + const message = { ...baseMsgDelegate } as MsgDelegate; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = object.delegatorAddress; + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromPartial(object.amount); + } else { + message.amount = undefined; + } + return message; + }, +}; + +const baseMsgDelegateResponse: object = {}; + +export const MsgDelegateResponse = { + encode(_: MsgDelegateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgDelegateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgDelegateResponse } as MsgDelegateResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgDelegateResponse { + const message = { ...baseMsgDelegateResponse } as MsgDelegateResponse; + return message; + }, + + toJSON(_: MsgDelegateResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgDelegateResponse { + const message = { ...baseMsgDelegateResponse } as MsgDelegateResponse; + return message; + }, +}; + +const baseMsgBeginRedelegate: object = { + delegatorAddress: "", + validatorSrcAddress: "", + validatorDstAddress: "", +}; + +export const MsgBeginRedelegate = { + encode(message: MsgBeginRedelegate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorSrcAddress !== "") { + writer.uint32(18).string(message.validatorSrcAddress); + } + if (message.validatorDstAddress !== "") { + writer.uint32(26).string(message.validatorDstAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgBeginRedelegate { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgBeginRedelegate } as MsgBeginRedelegate; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorSrcAddress = reader.string(); + break; + case 3: + message.validatorDstAddress = reader.string(); + break; + case 4: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgBeginRedelegate { + const message = { ...baseMsgBeginRedelegate } as MsgBeginRedelegate; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = String(object.delegatorAddress); + } else { + message.delegatorAddress = ""; + } + if (object.validatorSrcAddress !== undefined && object.validatorSrcAddress !== null) { + message.validatorSrcAddress = String(object.validatorSrcAddress); + } else { + message.validatorSrcAddress = ""; + } + if (object.validatorDstAddress !== undefined && object.validatorDstAddress !== null) { + message.validatorDstAddress = String(object.validatorDstAddress); + } else { + message.validatorDstAddress = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromJSON(object.amount); + } else { + message.amount = undefined; + } + return message; + }, + + toJSON(message: MsgBeginRedelegate): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorSrcAddress !== undefined && (obj.validatorSrcAddress = message.validatorSrcAddress); + message.validatorDstAddress !== undefined && (obj.validatorDstAddress = message.validatorDstAddress); + message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): MsgBeginRedelegate { + const message = { ...baseMsgBeginRedelegate } as MsgBeginRedelegate; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = object.delegatorAddress; + } else { + message.delegatorAddress = ""; + } + if (object.validatorSrcAddress !== undefined && object.validatorSrcAddress !== null) { + message.validatorSrcAddress = object.validatorSrcAddress; + } else { + message.validatorSrcAddress = ""; + } + if (object.validatorDstAddress !== undefined && object.validatorDstAddress !== null) { + message.validatorDstAddress = object.validatorDstAddress; + } else { + message.validatorDstAddress = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromPartial(object.amount); + } else { + message.amount = undefined; + } + return message; + }, +}; + +const baseMsgBeginRedelegateResponse: object = {}; + +export const MsgBeginRedelegateResponse = { + encode(message: MsgBeginRedelegateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.completionTime !== undefined) { + Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgBeginRedelegateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgBeginRedelegateResponse } as MsgBeginRedelegateResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgBeginRedelegateResponse { + const message = { ...baseMsgBeginRedelegateResponse } as MsgBeginRedelegateResponse; + if (object.completionTime !== undefined && object.completionTime !== null) { + message.completionTime = fromJsonTimestamp(object.completionTime); + } else { + message.completionTime = undefined; + } + return message; + }, + + toJSON(message: MsgBeginRedelegateResponse): unknown { + const obj: any = {}; + message.completionTime !== undefined && (obj.completionTime = message.completionTime.toISOString()); + return obj; + }, + + fromPartial(object: DeepPartial): MsgBeginRedelegateResponse { + const message = { ...baseMsgBeginRedelegateResponse } as MsgBeginRedelegateResponse; + if (object.completionTime !== undefined && object.completionTime !== null) { + message.completionTime = object.completionTime; + } else { + message.completionTime = undefined; + } + return message; + }, +}; + +const baseMsgUndelegate: object = { delegatorAddress: "", validatorAddress: "" }; + +export const MsgUndelegate = { + encode(message: MsgUndelegate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUndelegate { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgUndelegate } as MsgUndelegate; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgUndelegate { + const message = { ...baseMsgUndelegate } as MsgUndelegate; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = String(object.delegatorAddress); + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = String(object.validatorAddress); + } else { + message.validatorAddress = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromJSON(object.amount); + } else { + message.amount = undefined; + } + return message; + }, + + toJSON(message: MsgUndelegate): unknown { + const obj: any = {}; + message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); + message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); + message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): MsgUndelegate { + const message = { ...baseMsgUndelegate } as MsgUndelegate; + if (object.delegatorAddress !== undefined && object.delegatorAddress !== null) { + message.delegatorAddress = object.delegatorAddress; + } else { + message.delegatorAddress = ""; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromPartial(object.amount); + } else { + message.amount = undefined; + } + return message; + }, +}; + +const baseMsgUndelegateResponse: object = {}; + +export const MsgUndelegateResponse = { + encode(message: MsgUndelegateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.completionTime !== undefined) { + Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUndelegateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgUndelegateResponse } as MsgUndelegateResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgUndelegateResponse { + const message = { ...baseMsgUndelegateResponse } as MsgUndelegateResponse; + if (object.completionTime !== undefined && object.completionTime !== null) { + message.completionTime = fromJsonTimestamp(object.completionTime); + } else { + message.completionTime = undefined; + } + return message; + }, + + toJSON(message: MsgUndelegateResponse): unknown { + const obj: any = {}; + message.completionTime !== undefined && (obj.completionTime = message.completionTime.toISOString()); + return obj; + }, + + fromPartial(object: DeepPartial): MsgUndelegateResponse { + const message = { ...baseMsgUndelegateResponse } as MsgUndelegateResponse; + if (object.completionTime !== undefined && object.completionTime !== null) { + message.completionTime = object.completionTime; + } else { + message.completionTime = undefined; + } + return message; + }, +}; + +/** Msg defines the staking Msg service. */ +export interface Msg { + /** CreateValidator defines a method for creating a new validator. */ + CreateValidator(request: MsgCreateValidator): Promise; + /** EditValidator defines a method for editing an existing validator. */ + EditValidator(request: MsgEditValidator): Promise; + /** + * Delegate defines a method for performing a delegation of coins + * from a delegator to a validator. + */ + Delegate(request: MsgDelegate): Promise; + /** + * BeginRedelegate defines a method for performing a redelegation + * of coins from a delegator and source validator to a destination validator. + */ + BeginRedelegate(request: MsgBeginRedelegate): Promise; + /** + * Undelegate defines a method for performing an undelegation from a + * delegate and a validator. + */ + Undelegate(request: MsgUndelegate): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.CreateValidator = this.CreateValidator.bind(this); + this.EditValidator = this.EditValidator.bind(this); + this.Delegate = this.Delegate.bind(this); + this.BeginRedelegate = this.BeginRedelegate.bind(this); + this.Undelegate = this.Undelegate.bind(this); + } + CreateValidator(request: MsgCreateValidator): Promise { + const data = MsgCreateValidator.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "CreateValidator", data); + return promise.then((data) => MsgCreateValidatorResponse.decode(new _m0.Reader(data))); + } + + EditValidator(request: MsgEditValidator): Promise { + const data = MsgEditValidator.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "EditValidator", data); + return promise.then((data) => MsgEditValidatorResponse.decode(new _m0.Reader(data))); + } + + Delegate(request: MsgDelegate): Promise { + const data = MsgDelegate.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "Delegate", data); + return promise.then((data) => MsgDelegateResponse.decode(new _m0.Reader(data))); + } + + BeginRedelegate(request: MsgBeginRedelegate): Promise { + const data = MsgBeginRedelegate.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "BeginRedelegate", data); + return promise.then((data) => MsgBeginRedelegateResponse.decode(new _m0.Reader(data))); + } + + Undelegate(request: MsgUndelegate): Promise { + const data = MsgUndelegate.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "Undelegate", data); + return promise.then((data) => MsgUndelegateResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function toTimestamp(date: Date): Timestamp { + const seconds = numberToLong(date.getTime() / 1_000); + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds.toNumber() * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function numberToLong(number: number) { + return Long.fromNumber(number); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/tx/signing/v1beta1/signing.ts b/src/cosmos/tx/signing/v1beta1/signing.ts new file mode 100644 index 00000000..6e565754 --- /dev/null +++ b/src/cosmos/tx/signing/v1beta1/signing.ts @@ -0,0 +1,546 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Any } from "../../../../google/protobuf/any"; +import { CompactBitArray } from "../../../../cosmos/crypto/multisig/v1beta1/multisig"; + +export const protobufPackage = "cosmos.tx.signing.v1beta1"; + +/** SignMode represents a signing mode with its own security guarantees. */ +export enum SignMode { + /** + * SIGN_MODE_UNSPECIFIED - SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be + * rejected + */ + SIGN_MODE_UNSPECIFIED = 0, + /** + * SIGN_MODE_DIRECT - SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is + * verified with raw bytes from Tx + */ + SIGN_MODE_DIRECT = 1, + /** + * SIGN_MODE_TEXTUAL - SIGN_MODE_TEXTUAL is a future signing mode that will verify some + * human-readable textual representation on top of the binary representation + * from SIGN_MODE_DIRECT + */ + SIGN_MODE_TEXTUAL = 2, + /** + * SIGN_MODE_LEGACY_AMINO_JSON - SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses + * Amino JSON and will be removed in the future + */ + SIGN_MODE_LEGACY_AMINO_JSON = 127, + UNRECOGNIZED = -1, +} + +export function signModeFromJSON(object: any): SignMode { + switch (object) { + case 0: + case "SIGN_MODE_UNSPECIFIED": + return SignMode.SIGN_MODE_UNSPECIFIED; + case 1: + case "SIGN_MODE_DIRECT": + return SignMode.SIGN_MODE_DIRECT; + case 2: + case "SIGN_MODE_TEXTUAL": + return SignMode.SIGN_MODE_TEXTUAL; + case 127: + case "SIGN_MODE_LEGACY_AMINO_JSON": + return SignMode.SIGN_MODE_LEGACY_AMINO_JSON; + case -1: + case "UNRECOGNIZED": + default: + return SignMode.UNRECOGNIZED; + } +} + +export function signModeToJSON(object: SignMode): string { + switch (object) { + case SignMode.SIGN_MODE_UNSPECIFIED: + return "SIGN_MODE_UNSPECIFIED"; + case SignMode.SIGN_MODE_DIRECT: + return "SIGN_MODE_DIRECT"; + case SignMode.SIGN_MODE_TEXTUAL: + return "SIGN_MODE_TEXTUAL"; + case SignMode.SIGN_MODE_LEGACY_AMINO_JSON: + return "SIGN_MODE_LEGACY_AMINO_JSON"; + default: + return "UNKNOWN"; + } +} + +/** SignatureDescriptors wraps multiple SignatureDescriptor's. */ +export interface SignatureDescriptors { + /** signatures are the signature descriptors */ + signatures: SignatureDescriptor[]; +} + +/** + * SignatureDescriptor is a convenience type which represents the full data for + * a signature including the public key of the signer, signing modes and the + * signature itself. It is primarily used for coordinating signatures between + * clients. + */ +export interface SignatureDescriptor { + /** public_key is the public key of the signer */ + publicKey?: Any; + data?: SignatureDescriptor_Data; + /** + * sequence is the sequence of the account, which describes the + * number of committed transactions signed by a given address. It is used to prevent + * replay attacks. + */ + sequence: Long; +} + +/** Data represents signature data */ +export interface SignatureDescriptor_Data { + /** single represents a single signer */ + single?: SignatureDescriptor_Data_Single | undefined; + /** multi represents a multisig signer */ + multi?: SignatureDescriptor_Data_Multi | undefined; +} + +/** Single is the signature data for a single signer */ +export interface SignatureDescriptor_Data_Single { + /** mode is the signing mode of the single signer */ + mode: SignMode; + /** signature is the raw signature bytes */ + signature: Uint8Array; +} + +/** Multi is the signature data for a multisig public key */ +export interface SignatureDescriptor_Data_Multi { + /** bitarray specifies which keys within the multisig are signing */ + bitarray?: CompactBitArray; + /** signatures is the signatures of the multi-signature */ + signatures: SignatureDescriptor_Data[]; +} + +const baseSignatureDescriptors: object = {}; + +export const SignatureDescriptors = { + encode(message: SignatureDescriptors, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.signatures) { + SignatureDescriptor.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptors { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSignatureDescriptors } as SignatureDescriptors; + message.signatures = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signatures.push(SignatureDescriptor.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SignatureDescriptors { + const message = { ...baseSignatureDescriptors } as SignatureDescriptors; + message.signatures = []; + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(SignatureDescriptor.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: SignatureDescriptors): unknown { + const obj: any = {}; + if (message.signatures) { + obj.signatures = message.signatures.map((e) => (e ? SignatureDescriptor.toJSON(e) : undefined)); + } else { + obj.signatures = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): SignatureDescriptors { + const message = { ...baseSignatureDescriptors } as SignatureDescriptors; + message.signatures = []; + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(SignatureDescriptor.fromPartial(e)); + } + } + return message; + }, +}; + +const baseSignatureDescriptor: object = { sequence: Long.UZERO }; + +export const SignatureDescriptor = { + encode(message: SignatureDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.publicKey !== undefined) { + Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); + } + if (message.data !== undefined) { + SignatureDescriptor_Data.encode(message.data, writer.uint32(18).fork()).ldelim(); + } + if (!message.sequence.isZero()) { + writer.uint32(24).uint64(message.sequence); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSignatureDescriptor } as SignatureDescriptor; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicKey = Any.decode(reader, reader.uint32()); + break; + case 2: + message.data = SignatureDescriptor_Data.decode(reader, reader.uint32()); + break; + case 3: + message.sequence = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SignatureDescriptor { + const message = { ...baseSignatureDescriptor } as SignatureDescriptor; + if (object.publicKey !== undefined && object.publicKey !== null) { + message.publicKey = Any.fromJSON(object.publicKey); + } else { + message.publicKey = undefined; + } + if (object.data !== undefined && object.data !== null) { + message.data = SignatureDescriptor_Data.fromJSON(object.data); + } else { + message.data = undefined; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = Long.fromString(object.sequence); + } else { + message.sequence = Long.UZERO; + } + return message; + }, + + toJSON(message: SignatureDescriptor): unknown { + const obj: any = {}; + message.publicKey !== undefined && + (obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined); + message.data !== undefined && + (obj.data = message.data ? SignatureDescriptor_Data.toJSON(message.data) : undefined); + message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): SignatureDescriptor { + const message = { ...baseSignatureDescriptor } as SignatureDescriptor; + if (object.publicKey !== undefined && object.publicKey !== null) { + message.publicKey = Any.fromPartial(object.publicKey); + } else { + message.publicKey = undefined; + } + if (object.data !== undefined && object.data !== null) { + message.data = SignatureDescriptor_Data.fromPartial(object.data); + } else { + message.data = undefined; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = object.sequence as Long; + } else { + message.sequence = Long.UZERO; + } + return message; + }, +}; + +const baseSignatureDescriptor_Data: object = {}; + +export const SignatureDescriptor_Data = { + encode(message: SignatureDescriptor_Data, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.single !== undefined) { + SignatureDescriptor_Data_Single.encode(message.single, writer.uint32(10).fork()).ldelim(); + } + if (message.multi !== undefined) { + SignatureDescriptor_Data_Multi.encode(message.multi, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor_Data { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSignatureDescriptor_Data } as SignatureDescriptor_Data; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.single = SignatureDescriptor_Data_Single.decode(reader, reader.uint32()); + break; + case 2: + message.multi = SignatureDescriptor_Data_Multi.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SignatureDescriptor_Data { + const message = { ...baseSignatureDescriptor_Data } as SignatureDescriptor_Data; + if (object.single !== undefined && object.single !== null) { + message.single = SignatureDescriptor_Data_Single.fromJSON(object.single); + } else { + message.single = undefined; + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = SignatureDescriptor_Data_Multi.fromJSON(object.multi); + } else { + message.multi = undefined; + } + return message; + }, + + toJSON(message: SignatureDescriptor_Data): unknown { + const obj: any = {}; + message.single !== undefined && + (obj.single = message.single ? SignatureDescriptor_Data_Single.toJSON(message.single) : undefined); + message.multi !== undefined && + (obj.multi = message.multi ? SignatureDescriptor_Data_Multi.toJSON(message.multi) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): SignatureDescriptor_Data { + const message = { ...baseSignatureDescriptor_Data } as SignatureDescriptor_Data; + if (object.single !== undefined && object.single !== null) { + message.single = SignatureDescriptor_Data_Single.fromPartial(object.single); + } else { + message.single = undefined; + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = SignatureDescriptor_Data_Multi.fromPartial(object.multi); + } else { + message.multi = undefined; + } + return message; + }, +}; + +const baseSignatureDescriptor_Data_Single: object = { mode: 0 }; + +export const SignatureDescriptor_Data_Single = { + encode(message: SignatureDescriptor_Data_Single, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.mode !== 0) { + writer.uint32(8).int32(message.mode); + } + if (message.signature.length !== 0) { + writer.uint32(18).bytes(message.signature); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor_Data_Single { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSignatureDescriptor_Data_Single } as SignatureDescriptor_Data_Single; + message.signature = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mode = reader.int32() as any; + break; + case 2: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SignatureDescriptor_Data_Single { + const message = { ...baseSignatureDescriptor_Data_Single } as SignatureDescriptor_Data_Single; + message.signature = new Uint8Array(); + if (object.mode !== undefined && object.mode !== null) { + message.mode = signModeFromJSON(object.mode); + } else { + message.mode = 0; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; + }, + + toJSON(message: SignatureDescriptor_Data_Single): unknown { + const obj: any = {}; + message.mode !== undefined && (obj.mode = signModeToJSON(message.mode)); + message.signature !== undefined && + (obj.signature = base64FromBytes( + message.signature !== undefined ? message.signature : new Uint8Array(), + )); + return obj; + }, + + fromPartial(object: DeepPartial): SignatureDescriptor_Data_Single { + const message = { ...baseSignatureDescriptor_Data_Single } as SignatureDescriptor_Data_Single; + if (object.mode !== undefined && object.mode !== null) { + message.mode = object.mode; + } else { + message.mode = 0; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = object.signature; + } else { + message.signature = new Uint8Array(); + } + return message; + }, +}; + +const baseSignatureDescriptor_Data_Multi: object = {}; + +export const SignatureDescriptor_Data_Multi = { + encode(message: SignatureDescriptor_Data_Multi, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.bitarray !== undefined) { + CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.signatures) { + SignatureDescriptor_Data.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor_Data_Multi { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSignatureDescriptor_Data_Multi } as SignatureDescriptor_Data_Multi; + message.signatures = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bitarray = CompactBitArray.decode(reader, reader.uint32()); + break; + case 2: + message.signatures.push(SignatureDescriptor_Data.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SignatureDescriptor_Data_Multi { + const message = { ...baseSignatureDescriptor_Data_Multi } as SignatureDescriptor_Data_Multi; + message.signatures = []; + if (object.bitarray !== undefined && object.bitarray !== null) { + message.bitarray = CompactBitArray.fromJSON(object.bitarray); + } else { + message.bitarray = undefined; + } + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(SignatureDescriptor_Data.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: SignatureDescriptor_Data_Multi): unknown { + const obj: any = {}; + message.bitarray !== undefined && + (obj.bitarray = message.bitarray ? CompactBitArray.toJSON(message.bitarray) : undefined); + if (message.signatures) { + obj.signatures = message.signatures.map((e) => (e ? SignatureDescriptor_Data.toJSON(e) : undefined)); + } else { + obj.signatures = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): SignatureDescriptor_Data_Multi { + const message = { ...baseSignatureDescriptor_Data_Multi } as SignatureDescriptor_Data_Multi; + message.signatures = []; + if (object.bitarray !== undefined && object.bitarray !== null) { + message.bitarray = CompactBitArray.fromPartial(object.bitarray); + } else { + message.bitarray = undefined; + } + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(SignatureDescriptor_Data.fromPartial(e)); + } + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/tx/v1beta1/service.ts b/src/cosmos/tx/v1beta1/service.ts new file mode 100644 index 00000000..ad1cdabc --- /dev/null +++ b/src/cosmos/tx/v1beta1/service.ts @@ -0,0 +1,897 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; +import { TxResponse, GasInfo, Result } from "../../../cosmos/base/abci/v1beta1/abci"; +import { Tx } from "../../../cosmos/tx/v1beta1/tx"; + +export const protobufPackage = "cosmos.tx.v1beta1"; + +/** OrderBy defines the sorting order */ +export enum OrderBy { + /** ORDER_BY_UNSPECIFIED - ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. */ + ORDER_BY_UNSPECIFIED = 0, + /** ORDER_BY_ASC - ORDER_BY_ASC defines ascending order */ + ORDER_BY_ASC = 1, + /** ORDER_BY_DESC - ORDER_BY_DESC defines descending order */ + ORDER_BY_DESC = 2, + UNRECOGNIZED = -1, +} + +export function orderByFromJSON(object: any): OrderBy { + switch (object) { + case 0: + case "ORDER_BY_UNSPECIFIED": + return OrderBy.ORDER_BY_UNSPECIFIED; + case 1: + case "ORDER_BY_ASC": + return OrderBy.ORDER_BY_ASC; + case 2: + case "ORDER_BY_DESC": + return OrderBy.ORDER_BY_DESC; + case -1: + case "UNRECOGNIZED": + default: + return OrderBy.UNRECOGNIZED; + } +} + +export function orderByToJSON(object: OrderBy): string { + switch (object) { + case OrderBy.ORDER_BY_UNSPECIFIED: + return "ORDER_BY_UNSPECIFIED"; + case OrderBy.ORDER_BY_ASC: + return "ORDER_BY_ASC"; + case OrderBy.ORDER_BY_DESC: + return "ORDER_BY_DESC"; + default: + return "UNKNOWN"; + } +} + +/** BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. */ +export enum BroadcastMode { + /** BROADCAST_MODE_UNSPECIFIED - zero-value for mode ordering */ + BROADCAST_MODE_UNSPECIFIED = 0, + /** + * BROADCAST_MODE_BLOCK - BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for + * the tx to be committed in a block. + */ + BROADCAST_MODE_BLOCK = 1, + /** + * BROADCAST_MODE_SYNC - BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for + * a CheckTx execution response only. + */ + BROADCAST_MODE_SYNC = 2, + /** + * BROADCAST_MODE_ASYNC - BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns + * immediately. + */ + BROADCAST_MODE_ASYNC = 3, + UNRECOGNIZED = -1, +} + +export function broadcastModeFromJSON(object: any): BroadcastMode { + switch (object) { + case 0: + case "BROADCAST_MODE_UNSPECIFIED": + return BroadcastMode.BROADCAST_MODE_UNSPECIFIED; + case 1: + case "BROADCAST_MODE_BLOCK": + return BroadcastMode.BROADCAST_MODE_BLOCK; + case 2: + case "BROADCAST_MODE_SYNC": + return BroadcastMode.BROADCAST_MODE_SYNC; + case 3: + case "BROADCAST_MODE_ASYNC": + return BroadcastMode.BROADCAST_MODE_ASYNC; + case -1: + case "UNRECOGNIZED": + default: + return BroadcastMode.UNRECOGNIZED; + } +} + +export function broadcastModeToJSON(object: BroadcastMode): string { + switch (object) { + case BroadcastMode.BROADCAST_MODE_UNSPECIFIED: + return "BROADCAST_MODE_UNSPECIFIED"; + case BroadcastMode.BROADCAST_MODE_BLOCK: + return "BROADCAST_MODE_BLOCK"; + case BroadcastMode.BROADCAST_MODE_SYNC: + return "BROADCAST_MODE_SYNC"; + case BroadcastMode.BROADCAST_MODE_ASYNC: + return "BROADCAST_MODE_ASYNC"; + default: + return "UNKNOWN"; + } +} + +/** + * GetTxsEventRequest is the request type for the Service.TxsByEvents + * RPC method. + */ +export interface GetTxsEventRequest { + /** events is the list of transaction event type. */ + events: string[]; + /** pagination defines an pagination for the request. */ + pagination?: PageRequest; + orderBy: OrderBy; +} + +/** + * GetTxsEventResponse is the response type for the Service.TxsByEvents + * RPC method. + */ +export interface GetTxsEventResponse { + /** txs is the list of queried transactions. */ + txs: Tx[]; + /** tx_responses is the list of queried TxResponses. */ + txResponses: TxResponse[]; + /** pagination defines an pagination for the response. */ + pagination?: PageResponse; +} + +/** + * BroadcastTxRequest is the request type for the Service.BroadcastTxRequest + * RPC method. + */ +export interface BroadcastTxRequest { + /** tx_bytes is the raw transaction. */ + txBytes: Uint8Array; + mode: BroadcastMode; +} + +/** + * BroadcastTxResponse is the response type for the + * Service.BroadcastTx method. + */ +export interface BroadcastTxResponse { + /** tx_response is the queried TxResponses. */ + txResponse?: TxResponse; +} + +/** + * SimulateRequest is the request type for the Service.Simulate + * RPC method. + */ +export interface SimulateRequest { + /** + * tx is the transaction to simulate. + * Deprecated. Send raw tx bytes instead. + * + * @deprecated + */ + tx?: Tx; + /** tx_bytes is the raw transaction. */ + txBytes: Uint8Array; +} + +/** + * SimulateResponse is the response type for the + * Service.SimulateRPC method. + */ +export interface SimulateResponse { + /** gas_info is the information about gas used in the simulation. */ + gasInfo?: GasInfo; + /** result is the result of the simulation. */ + result?: Result; +} + +/** + * GetTxRequest is the request type for the Service.GetTx + * RPC method. + */ +export interface GetTxRequest { + /** hash is the tx hash to query, encoded as a hex string. */ + hash: string; +} + +/** GetTxResponse is the response type for the Service.GetTx method. */ +export interface GetTxResponse { + /** tx is the queried transaction. */ + tx?: Tx; + /** tx_response is the queried TxResponses. */ + txResponse?: TxResponse; +} + +const baseGetTxsEventRequest: object = { events: "", orderBy: 0 }; + +export const GetTxsEventRequest = { + encode(message: GetTxsEventRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.events) { + writer.uint32(10).string(v!); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + if (message.orderBy !== 0) { + writer.uint32(24).int32(message.orderBy); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetTxsEventRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetTxsEventRequest } as GetTxsEventRequest; + message.events = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.events.push(reader.string()); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + case 3: + message.orderBy = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetTxsEventRequest { + const message = { ...baseGetTxsEventRequest } as GetTxsEventRequest; + message.events = []; + if (object.events !== undefined && object.events !== null) { + for (const e of object.events) { + message.events.push(String(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + if (object.orderBy !== undefined && object.orderBy !== null) { + message.orderBy = orderByFromJSON(object.orderBy); + } else { + message.orderBy = 0; + } + return message; + }, + + toJSON(message: GetTxsEventRequest): unknown { + const obj: any = {}; + if (message.events) { + obj.events = message.events.map((e) => e); + } else { + obj.events = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + message.orderBy !== undefined && (obj.orderBy = orderByToJSON(message.orderBy)); + return obj; + }, + + fromPartial(object: DeepPartial): GetTxsEventRequest { + const message = { ...baseGetTxsEventRequest } as GetTxsEventRequest; + message.events = []; + if (object.events !== undefined && object.events !== null) { + for (const e of object.events) { + message.events.push(e); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + if (object.orderBy !== undefined && object.orderBy !== null) { + message.orderBy = object.orderBy; + } else { + message.orderBy = 0; + } + return message; + }, +}; + +const baseGetTxsEventResponse: object = {}; + +export const GetTxsEventResponse = { + encode(message: GetTxsEventResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.txs) { + Tx.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.txResponses) { + TxResponse.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetTxsEventResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetTxsEventResponse } as GetTxsEventResponse; + message.txs = []; + message.txResponses = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txs.push(Tx.decode(reader, reader.uint32())); + break; + case 2: + message.txResponses.push(TxResponse.decode(reader, reader.uint32())); + break; + case 3: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetTxsEventResponse { + const message = { ...baseGetTxsEventResponse } as GetTxsEventResponse; + message.txs = []; + message.txResponses = []; + if (object.txs !== undefined && object.txs !== null) { + for (const e of object.txs) { + message.txs.push(Tx.fromJSON(e)); + } + } + if (object.txResponses !== undefined && object.txResponses !== null) { + for (const e of object.txResponses) { + message.txResponses.push(TxResponse.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: GetTxsEventResponse): unknown { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map((e) => (e ? Tx.toJSON(e) : undefined)); + } else { + obj.txs = []; + } + if (message.txResponses) { + obj.txResponses = message.txResponses.map((e) => (e ? TxResponse.toJSON(e) : undefined)); + } else { + obj.txResponses = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): GetTxsEventResponse { + const message = { ...baseGetTxsEventResponse } as GetTxsEventResponse; + message.txs = []; + message.txResponses = []; + if (object.txs !== undefined && object.txs !== null) { + for (const e of object.txs) { + message.txs.push(Tx.fromPartial(e)); + } + } + if (object.txResponses !== undefined && object.txResponses !== null) { + for (const e of object.txResponses) { + message.txResponses.push(TxResponse.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseBroadcastTxRequest: object = { mode: 0 }; + +export const BroadcastTxRequest = { + encode(message: BroadcastTxRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.txBytes.length !== 0) { + writer.uint32(10).bytes(message.txBytes); + } + if (message.mode !== 0) { + writer.uint32(16).int32(message.mode); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BroadcastTxRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseBroadcastTxRequest } as BroadcastTxRequest; + message.txBytes = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txBytes = reader.bytes(); + break; + case 2: + message.mode = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): BroadcastTxRequest { + const message = { ...baseBroadcastTxRequest } as BroadcastTxRequest; + message.txBytes = new Uint8Array(); + if (object.txBytes !== undefined && object.txBytes !== null) { + message.txBytes = bytesFromBase64(object.txBytes); + } + if (object.mode !== undefined && object.mode !== null) { + message.mode = broadcastModeFromJSON(object.mode); + } else { + message.mode = 0; + } + return message; + }, + + toJSON(message: BroadcastTxRequest): unknown { + const obj: any = {}; + message.txBytes !== undefined && + (obj.txBytes = base64FromBytes(message.txBytes !== undefined ? message.txBytes : new Uint8Array())); + message.mode !== undefined && (obj.mode = broadcastModeToJSON(message.mode)); + return obj; + }, + + fromPartial(object: DeepPartial): BroadcastTxRequest { + const message = { ...baseBroadcastTxRequest } as BroadcastTxRequest; + if (object.txBytes !== undefined && object.txBytes !== null) { + message.txBytes = object.txBytes; + } else { + message.txBytes = new Uint8Array(); + } + if (object.mode !== undefined && object.mode !== null) { + message.mode = object.mode; + } else { + message.mode = 0; + } + return message; + }, +}; + +const baseBroadcastTxResponse: object = {}; + +export const BroadcastTxResponse = { + encode(message: BroadcastTxResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.txResponse !== undefined) { + TxResponse.encode(message.txResponse, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BroadcastTxResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseBroadcastTxResponse } as BroadcastTxResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txResponse = TxResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): BroadcastTxResponse { + const message = { ...baseBroadcastTxResponse } as BroadcastTxResponse; + if (object.txResponse !== undefined && object.txResponse !== null) { + message.txResponse = TxResponse.fromJSON(object.txResponse); + } else { + message.txResponse = undefined; + } + return message; + }, + + toJSON(message: BroadcastTxResponse): unknown { + const obj: any = {}; + message.txResponse !== undefined && + (obj.txResponse = message.txResponse ? TxResponse.toJSON(message.txResponse) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): BroadcastTxResponse { + const message = { ...baseBroadcastTxResponse } as BroadcastTxResponse; + if (object.txResponse !== undefined && object.txResponse !== null) { + message.txResponse = TxResponse.fromPartial(object.txResponse); + } else { + message.txResponse = undefined; + } + return message; + }, +}; + +const baseSimulateRequest: object = {}; + +export const SimulateRequest = { + encode(message: SimulateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.tx !== undefined) { + Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); + } + if (message.txBytes.length !== 0) { + writer.uint32(18).bytes(message.txBytes); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SimulateRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSimulateRequest } as SimulateRequest; + message.txBytes = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = Tx.decode(reader, reader.uint32()); + break; + case 2: + message.txBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SimulateRequest { + const message = { ...baseSimulateRequest } as SimulateRequest; + message.txBytes = new Uint8Array(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = Tx.fromJSON(object.tx); + } else { + message.tx = undefined; + } + if (object.txBytes !== undefined && object.txBytes !== null) { + message.txBytes = bytesFromBase64(object.txBytes); + } + return message; + }, + + toJSON(message: SimulateRequest): unknown { + const obj: any = {}; + message.tx !== undefined && (obj.tx = message.tx ? Tx.toJSON(message.tx) : undefined); + message.txBytes !== undefined && + (obj.txBytes = base64FromBytes(message.txBytes !== undefined ? message.txBytes : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): SimulateRequest { + const message = { ...baseSimulateRequest } as SimulateRequest; + if (object.tx !== undefined && object.tx !== null) { + message.tx = Tx.fromPartial(object.tx); + } else { + message.tx = undefined; + } + if (object.txBytes !== undefined && object.txBytes !== null) { + message.txBytes = object.txBytes; + } else { + message.txBytes = new Uint8Array(); + } + return message; + }, +}; + +const baseSimulateResponse: object = {}; + +export const SimulateResponse = { + encode(message: SimulateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.gasInfo !== undefined) { + GasInfo.encode(message.gasInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.result !== undefined) { + Result.encode(message.result, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SimulateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSimulateResponse } as SimulateResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.gasInfo = GasInfo.decode(reader, reader.uint32()); + break; + case 2: + message.result = Result.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SimulateResponse { + const message = { ...baseSimulateResponse } as SimulateResponse; + if (object.gasInfo !== undefined && object.gasInfo !== null) { + message.gasInfo = GasInfo.fromJSON(object.gasInfo); + } else { + message.gasInfo = undefined; + } + if (object.result !== undefined && object.result !== null) { + message.result = Result.fromJSON(object.result); + } else { + message.result = undefined; + } + return message; + }, + + toJSON(message: SimulateResponse): unknown { + const obj: any = {}; + message.gasInfo !== undefined && + (obj.gasInfo = message.gasInfo ? GasInfo.toJSON(message.gasInfo) : undefined); + message.result !== undefined && (obj.result = message.result ? Result.toJSON(message.result) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): SimulateResponse { + const message = { ...baseSimulateResponse } as SimulateResponse; + if (object.gasInfo !== undefined && object.gasInfo !== null) { + message.gasInfo = GasInfo.fromPartial(object.gasInfo); + } else { + message.gasInfo = undefined; + } + if (object.result !== undefined && object.result !== null) { + message.result = Result.fromPartial(object.result); + } else { + message.result = undefined; + } + return message; + }, +}; + +const baseGetTxRequest: object = { hash: "" }; + +export const GetTxRequest = { + encode(message: GetTxRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.hash !== "") { + writer.uint32(10).string(message.hash); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetTxRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetTxRequest } as GetTxRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetTxRequest { + const message = { ...baseGetTxRequest } as GetTxRequest; + if (object.hash !== undefined && object.hash !== null) { + message.hash = String(object.hash); + } else { + message.hash = ""; + } + return message; + }, + + toJSON(message: GetTxRequest): unknown { + const obj: any = {}; + message.hash !== undefined && (obj.hash = message.hash); + return obj; + }, + + fromPartial(object: DeepPartial): GetTxRequest { + const message = { ...baseGetTxRequest } as GetTxRequest; + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } else { + message.hash = ""; + } + return message; + }, +}; + +const baseGetTxResponse: object = {}; + +export const GetTxResponse = { + encode(message: GetTxResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.tx !== undefined) { + Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); + } + if (message.txResponse !== undefined) { + TxResponse.encode(message.txResponse, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetTxResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetTxResponse } as GetTxResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = Tx.decode(reader, reader.uint32()); + break; + case 2: + message.txResponse = TxResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetTxResponse { + const message = { ...baseGetTxResponse } as GetTxResponse; + if (object.tx !== undefined && object.tx !== null) { + message.tx = Tx.fromJSON(object.tx); + } else { + message.tx = undefined; + } + if (object.txResponse !== undefined && object.txResponse !== null) { + message.txResponse = TxResponse.fromJSON(object.txResponse); + } else { + message.txResponse = undefined; + } + return message; + }, + + toJSON(message: GetTxResponse): unknown { + const obj: any = {}; + message.tx !== undefined && (obj.tx = message.tx ? Tx.toJSON(message.tx) : undefined); + message.txResponse !== undefined && + (obj.txResponse = message.txResponse ? TxResponse.toJSON(message.txResponse) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): GetTxResponse { + const message = { ...baseGetTxResponse } as GetTxResponse; + if (object.tx !== undefined && object.tx !== null) { + message.tx = Tx.fromPartial(object.tx); + } else { + message.tx = undefined; + } + if (object.txResponse !== undefined && object.txResponse !== null) { + message.txResponse = TxResponse.fromPartial(object.txResponse); + } else { + message.txResponse = undefined; + } + return message; + }, +}; + +/** Service defines a gRPC service for interacting with transactions. */ +export interface Service { + /** Simulate simulates executing a transaction for estimating gas usage. */ + Simulate(request: SimulateRequest): Promise; + /** GetTx fetches a tx by hash. */ + GetTx(request: GetTxRequest): Promise; + /** BroadcastTx broadcast transaction. */ + BroadcastTx(request: BroadcastTxRequest): Promise; + /** GetTxsEvent fetches txs by event. */ + GetTxsEvent(request: GetTxsEventRequest): Promise; +} + +export class ServiceClientImpl implements Service { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Simulate = this.Simulate.bind(this); + this.GetTx = this.GetTx.bind(this); + this.BroadcastTx = this.BroadcastTx.bind(this); + this.GetTxsEvent = this.GetTxsEvent.bind(this); + } + Simulate(request: SimulateRequest): Promise { + const data = SimulateRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "Simulate", data); + return promise.then((data) => SimulateResponse.decode(new _m0.Reader(data))); + } + + GetTx(request: GetTxRequest): Promise { + const data = GetTxRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "GetTx", data); + return promise.then((data) => GetTxResponse.decode(new _m0.Reader(data))); + } + + BroadcastTx(request: BroadcastTxRequest): Promise { + const data = BroadcastTxRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "BroadcastTx", data); + return promise.then((data) => BroadcastTxResponse.decode(new _m0.Reader(data))); + } + + GetTxsEvent(request: GetTxsEventRequest): Promise { + const data = GetTxsEventRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "GetTxsEvent", data); + return promise.then((data) => GetTxsEventResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/tx/v1beta1/tx.ts b/src/cosmos/tx/v1beta1/tx.ts new file mode 100644 index 00000000..07394ce6 --- /dev/null +++ b/src/cosmos/tx/v1beta1/tx.ts @@ -0,0 +1,1210 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Any } from "../../../google/protobuf/any"; +import { SignMode, signModeFromJSON, signModeToJSON } from "../../../cosmos/tx/signing/v1beta1/signing"; +import { CompactBitArray } from "../../../cosmos/crypto/multisig/v1beta1/multisig"; +import { Coin } from "../../../cosmos/base/v1beta1/coin"; + +export const protobufPackage = "cosmos.tx.v1beta1"; + +/** Tx is the standard type used for broadcasting transactions. */ +export interface Tx { + /** body is the processable content of the transaction */ + body?: TxBody; + /** + * auth_info is the authorization related content of the transaction, + * specifically signers, signer modes and fee + */ + authInfo?: AuthInfo; + /** + * signatures is a list of signatures that matches the length and order of + * AuthInfo's signer_infos to allow connecting signature meta information like + * public key and signing mode by position. + */ + signatures: Uint8Array[]; +} + +/** + * TxRaw is a variant of Tx that pins the signer's exact binary representation + * of body and auth_info. This is used for signing, broadcasting and + * verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and + * the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used + * as the transaction ID. + */ +export interface TxRaw { + /** + * body_bytes is a protobuf serialization of a TxBody that matches the + * representation in SignDoc. + */ + bodyBytes: Uint8Array; + /** + * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + * representation in SignDoc. + */ + authInfoBytes: Uint8Array; + /** + * signatures is a list of signatures that matches the length and order of + * AuthInfo's signer_infos to allow connecting signature meta information like + * public key and signing mode by position. + */ + signatures: Uint8Array[]; +} + +/** SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. */ +export interface SignDoc { + /** + * body_bytes is protobuf serialization of a TxBody that matches the + * representation in TxRaw. + */ + bodyBytes: Uint8Array; + /** + * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + * representation in TxRaw. + */ + authInfoBytes: Uint8Array; + /** + * chain_id is the unique identifier of the chain this transaction targets. + * It prevents signed transactions from being used on another chain by an + * attacker + */ + chainId: string; + /** account_number is the account number of the account in state */ + accountNumber: Long; +} + +/** TxBody is the body of a transaction that all signers sign over. */ +export interface TxBody { + /** + * messages is a list of messages to be executed. The required signers of + * those messages define the number and order of elements in AuthInfo's + * signer_infos and Tx's signatures. Each required signer address is added to + * the list only the first time it occurs. + * By convention, the first required signer (usually from the first message) + * is referred to as the primary signer and pays the fee for the whole + * transaction. + */ + messages: Any[]; + /** + * memo is any arbitrary note/comment to be added to the transaction. + * WARNING: in clients, any publicly exposed text should not be called memo, + * but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). + */ + memo: string; + /** + * timeout is the block height after which this transaction will not + * be processed by the chain + */ + timeoutHeight: Long; + /** + * extension_options are arbitrary options that can be added by chains + * when the default options are not sufficient. If any of these are present + * and can't be handled, the transaction will be rejected + */ + extensionOptions: Any[]; + /** + * extension_options are arbitrary options that can be added by chains + * when the default options are not sufficient. If any of these are present + * and can't be handled, they will be ignored + */ + nonCriticalExtensionOptions: Any[]; +} + +/** + * AuthInfo describes the fee and signer modes that are used to sign a + * transaction. + */ +export interface AuthInfo { + /** + * signer_infos defines the signing modes for the required signers. The number + * and order of elements must match the required signers from TxBody's + * messages. The first element is the primary signer and the one which pays + * the fee. + */ + signerInfos: SignerInfo[]; + /** + * Fee is the fee and gas limit for the transaction. The first signer is the + * primary signer and the one which pays the fee. The fee can be calculated + * based on the cost of evaluating the body and doing signature verification + * of the signers. This can be estimated via simulation. + */ + fee?: Fee; +} + +/** + * SignerInfo describes the public key and signing mode of a single top-level + * signer. + */ +export interface SignerInfo { + /** + * public_key is the public key of the signer. It is optional for accounts + * that already exist in state. If unset, the verifier can use the required \ + * signer address for this position and lookup the public key. + */ + publicKey?: Any; + /** + * mode_info describes the signing mode of the signer and is a nested + * structure to support nested multisig pubkey's + */ + modeInfo?: ModeInfo; + /** + * sequence is the sequence of the account, which describes the + * number of committed transactions signed by a given address. It is used to + * prevent replay attacks. + */ + sequence: Long; +} + +/** ModeInfo describes the signing mode of a single or nested multisig signer. */ +export interface ModeInfo { + /** single represents a single signer */ + single?: ModeInfo_Single | undefined; + /** multi represents a nested multisig signer */ + multi?: ModeInfo_Multi | undefined; +} + +/** + * Single is the mode info for a single signer. It is structured as a message + * to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the + * future + */ +export interface ModeInfo_Single { + /** mode is the signing mode of the single signer */ + mode: SignMode; +} + +/** Multi is the mode info for a multisig public key */ +export interface ModeInfo_Multi { + /** bitarray specifies which keys within the multisig are signing */ + bitarray?: CompactBitArray; + /** + * mode_infos is the corresponding modes of the signers of the multisig + * which could include nested multisig public keys + */ + modeInfos: ModeInfo[]; +} + +/** + * Fee includes the amount of coins paid in fees and the maximum + * gas to be used by the transaction. The ratio yields an effective "gasprice", + * which must be above some miminum to be accepted into the mempool. + */ +export interface Fee { + /** amount is the amount of coins to be paid as a fee */ + amount: Coin[]; + /** + * gas_limit is the maximum gas that can be used in transaction processing + * before an out of gas error occurs + */ + gasLimit: Long; + /** + * if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. + * the payer must be a tx signer (and thus have signed this field in AuthInfo). + * setting this field does *not* change the ordering of required signers for the transaction. + */ + payer: string; + /** + * if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used + * to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does + * not support fee grants, this will fail + */ + granter: string; +} + +const baseTx: object = {}; + +export const Tx = { + encode(message: Tx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.body !== undefined) { + TxBody.encode(message.body, writer.uint32(10).fork()).ldelim(); + } + if (message.authInfo !== undefined) { + AuthInfo.encode(message.authInfo, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.signatures) { + writer.uint32(26).bytes(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Tx { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTx } as Tx; + message.signatures = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.body = TxBody.decode(reader, reader.uint32()); + break; + case 2: + message.authInfo = AuthInfo.decode(reader, reader.uint32()); + break; + case 3: + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Tx { + const message = { ...baseTx } as Tx; + message.signatures = []; + if (object.body !== undefined && object.body !== null) { + message.body = TxBody.fromJSON(object.body); + } else { + message.body = undefined; + } + if (object.authInfo !== undefined && object.authInfo !== null) { + message.authInfo = AuthInfo.fromJSON(object.authInfo); + } else { + message.authInfo = undefined; + } + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(bytesFromBase64(e)); + } + } + return message; + }, + + toJSON(message: Tx): unknown { + const obj: any = {}; + message.body !== undefined && (obj.body = message.body ? TxBody.toJSON(message.body) : undefined); + message.authInfo !== undefined && + (obj.authInfo = message.authInfo ? AuthInfo.toJSON(message.authInfo) : undefined); + if (message.signatures) { + obj.signatures = message.signatures.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.signatures = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): Tx { + const message = { ...baseTx } as Tx; + message.signatures = []; + if (object.body !== undefined && object.body !== null) { + message.body = TxBody.fromPartial(object.body); + } else { + message.body = undefined; + } + if (object.authInfo !== undefined && object.authInfo !== null) { + message.authInfo = AuthInfo.fromPartial(object.authInfo); + } else { + message.authInfo = undefined; + } + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(e); + } + } + return message; + }, +}; + +const baseTxRaw: object = {}; + +export const TxRaw = { + encode(message: TxRaw, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.bodyBytes.length !== 0) { + writer.uint32(10).bytes(message.bodyBytes); + } + if (message.authInfoBytes.length !== 0) { + writer.uint32(18).bytes(message.authInfoBytes); + } + for (const v of message.signatures) { + writer.uint32(26).bytes(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TxRaw { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTxRaw } as TxRaw; + message.signatures = []; + message.bodyBytes = new Uint8Array(); + message.authInfoBytes = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bodyBytes = reader.bytes(); + break; + case 2: + message.authInfoBytes = reader.bytes(); + break; + case 3: + message.signatures.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TxRaw { + const message = { ...baseTxRaw } as TxRaw; + message.signatures = []; + message.bodyBytes = new Uint8Array(); + message.authInfoBytes = new Uint8Array(); + if (object.bodyBytes !== undefined && object.bodyBytes !== null) { + message.bodyBytes = bytesFromBase64(object.bodyBytes); + } + if (object.authInfoBytes !== undefined && object.authInfoBytes !== null) { + message.authInfoBytes = bytesFromBase64(object.authInfoBytes); + } + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(bytesFromBase64(e)); + } + } + return message; + }, + + toJSON(message: TxRaw): unknown { + const obj: any = {}; + message.bodyBytes !== undefined && + (obj.bodyBytes = base64FromBytes( + message.bodyBytes !== undefined ? message.bodyBytes : new Uint8Array(), + )); + message.authInfoBytes !== undefined && + (obj.authInfoBytes = base64FromBytes( + message.authInfoBytes !== undefined ? message.authInfoBytes : new Uint8Array(), + )); + if (message.signatures) { + obj.signatures = message.signatures.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.signatures = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): TxRaw { + const message = { ...baseTxRaw } as TxRaw; + message.signatures = []; + if (object.bodyBytes !== undefined && object.bodyBytes !== null) { + message.bodyBytes = object.bodyBytes; + } else { + message.bodyBytes = new Uint8Array(); + } + if (object.authInfoBytes !== undefined && object.authInfoBytes !== null) { + message.authInfoBytes = object.authInfoBytes; + } else { + message.authInfoBytes = new Uint8Array(); + } + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(e); + } + } + return message; + }, +}; + +const baseSignDoc: object = { chainId: "", accountNumber: Long.UZERO }; + +export const SignDoc = { + encode(message: SignDoc, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.bodyBytes.length !== 0) { + writer.uint32(10).bytes(message.bodyBytes); + } + if (message.authInfoBytes.length !== 0) { + writer.uint32(18).bytes(message.authInfoBytes); + } + if (message.chainId !== "") { + writer.uint32(26).string(message.chainId); + } + if (!message.accountNumber.isZero()) { + writer.uint32(32).uint64(message.accountNumber); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SignDoc { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSignDoc } as SignDoc; + message.bodyBytes = new Uint8Array(); + message.authInfoBytes = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bodyBytes = reader.bytes(); + break; + case 2: + message.authInfoBytes = reader.bytes(); + break; + case 3: + message.chainId = reader.string(); + break; + case 4: + message.accountNumber = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SignDoc { + const message = { ...baseSignDoc } as SignDoc; + message.bodyBytes = new Uint8Array(); + message.authInfoBytes = new Uint8Array(); + if (object.bodyBytes !== undefined && object.bodyBytes !== null) { + message.bodyBytes = bytesFromBase64(object.bodyBytes); + } + if (object.authInfoBytes !== undefined && object.authInfoBytes !== null) { + message.authInfoBytes = bytesFromBase64(object.authInfoBytes); + } + if (object.chainId !== undefined && object.chainId !== null) { + message.chainId = String(object.chainId); + } else { + message.chainId = ""; + } + if (object.accountNumber !== undefined && object.accountNumber !== null) { + message.accountNumber = Long.fromString(object.accountNumber); + } else { + message.accountNumber = Long.UZERO; + } + return message; + }, + + toJSON(message: SignDoc): unknown { + const obj: any = {}; + message.bodyBytes !== undefined && + (obj.bodyBytes = base64FromBytes( + message.bodyBytes !== undefined ? message.bodyBytes : new Uint8Array(), + )); + message.authInfoBytes !== undefined && + (obj.authInfoBytes = base64FromBytes( + message.authInfoBytes !== undefined ? message.authInfoBytes : new Uint8Array(), + )); + message.chainId !== undefined && (obj.chainId = message.chainId); + message.accountNumber !== undefined && + (obj.accountNumber = (message.accountNumber || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): SignDoc { + const message = { ...baseSignDoc } as SignDoc; + if (object.bodyBytes !== undefined && object.bodyBytes !== null) { + message.bodyBytes = object.bodyBytes; + } else { + message.bodyBytes = new Uint8Array(); + } + if (object.authInfoBytes !== undefined && object.authInfoBytes !== null) { + message.authInfoBytes = object.authInfoBytes; + } else { + message.authInfoBytes = new Uint8Array(); + } + if (object.chainId !== undefined && object.chainId !== null) { + message.chainId = object.chainId; + } else { + message.chainId = ""; + } + if (object.accountNumber !== undefined && object.accountNumber !== null) { + message.accountNumber = object.accountNumber as Long; + } else { + message.accountNumber = Long.UZERO; + } + return message; + }, +}; + +const baseTxBody: object = { memo: "", timeoutHeight: Long.UZERO }; + +export const TxBody = { + encode(message: TxBody, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.messages) { + Any.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.memo !== "") { + writer.uint32(18).string(message.memo); + } + if (!message.timeoutHeight.isZero()) { + writer.uint32(24).uint64(message.timeoutHeight); + } + for (const v of message.extensionOptions) { + Any.encode(v!, writer.uint32(8186).fork()).ldelim(); + } + for (const v of message.nonCriticalExtensionOptions) { + Any.encode(v!, writer.uint32(16378).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TxBody { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTxBody } as TxBody; + message.messages = []; + message.extensionOptions = []; + message.nonCriticalExtensionOptions = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messages.push(Any.decode(reader, reader.uint32())); + break; + case 2: + message.memo = reader.string(); + break; + case 3: + message.timeoutHeight = reader.uint64() as Long; + break; + case 1023: + message.extensionOptions.push(Any.decode(reader, reader.uint32())); + break; + case 2047: + message.nonCriticalExtensionOptions.push(Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TxBody { + const message = { ...baseTxBody } as TxBody; + message.messages = []; + message.extensionOptions = []; + message.nonCriticalExtensionOptions = []; + if (object.messages !== undefined && object.messages !== null) { + for (const e of object.messages) { + message.messages.push(Any.fromJSON(e)); + } + } + if (object.memo !== undefined && object.memo !== null) { + message.memo = String(object.memo); + } else { + message.memo = ""; + } + if (object.timeoutHeight !== undefined && object.timeoutHeight !== null) { + message.timeoutHeight = Long.fromString(object.timeoutHeight); + } else { + message.timeoutHeight = Long.UZERO; + } + if (object.extensionOptions !== undefined && object.extensionOptions !== null) { + for (const e of object.extensionOptions) { + message.extensionOptions.push(Any.fromJSON(e)); + } + } + if (object.nonCriticalExtensionOptions !== undefined && object.nonCriticalExtensionOptions !== null) { + for (const e of object.nonCriticalExtensionOptions) { + message.nonCriticalExtensionOptions.push(Any.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: TxBody): unknown { + const obj: any = {}; + if (message.messages) { + obj.messages = message.messages.map((e) => (e ? Any.toJSON(e) : undefined)); + } else { + obj.messages = []; + } + message.memo !== undefined && (obj.memo = message.memo); + message.timeoutHeight !== undefined && + (obj.timeoutHeight = (message.timeoutHeight || Long.UZERO).toString()); + if (message.extensionOptions) { + obj.extensionOptions = message.extensionOptions.map((e) => (e ? Any.toJSON(e) : undefined)); + } else { + obj.extensionOptions = []; + } + if (message.nonCriticalExtensionOptions) { + obj.nonCriticalExtensionOptions = message.nonCriticalExtensionOptions.map((e) => + e ? Any.toJSON(e) : undefined, + ); + } else { + obj.nonCriticalExtensionOptions = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): TxBody { + const message = { ...baseTxBody } as TxBody; + message.messages = []; + message.extensionOptions = []; + message.nonCriticalExtensionOptions = []; + if (object.messages !== undefined && object.messages !== null) { + for (const e of object.messages) { + message.messages.push(Any.fromPartial(e)); + } + } + if (object.memo !== undefined && object.memo !== null) { + message.memo = object.memo; + } else { + message.memo = ""; + } + if (object.timeoutHeight !== undefined && object.timeoutHeight !== null) { + message.timeoutHeight = object.timeoutHeight as Long; + } else { + message.timeoutHeight = Long.UZERO; + } + if (object.extensionOptions !== undefined && object.extensionOptions !== null) { + for (const e of object.extensionOptions) { + message.extensionOptions.push(Any.fromPartial(e)); + } + } + if (object.nonCriticalExtensionOptions !== undefined && object.nonCriticalExtensionOptions !== null) { + for (const e of object.nonCriticalExtensionOptions) { + message.nonCriticalExtensionOptions.push(Any.fromPartial(e)); + } + } + return message; + }, +}; + +const baseAuthInfo: object = {}; + +export const AuthInfo = { + encode(message: AuthInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.signerInfos) { + SignerInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.fee !== undefined) { + Fee.encode(message.fee, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AuthInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAuthInfo } as AuthInfo; + message.signerInfos = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signerInfos.push(SignerInfo.decode(reader, reader.uint32())); + break; + case 2: + message.fee = Fee.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AuthInfo { + const message = { ...baseAuthInfo } as AuthInfo; + message.signerInfos = []; + if (object.signerInfos !== undefined && object.signerInfos !== null) { + for (const e of object.signerInfos) { + message.signerInfos.push(SignerInfo.fromJSON(e)); + } + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = Fee.fromJSON(object.fee); + } else { + message.fee = undefined; + } + return message; + }, + + toJSON(message: AuthInfo): unknown { + const obj: any = {}; + if (message.signerInfos) { + obj.signerInfos = message.signerInfos.map((e) => (e ? SignerInfo.toJSON(e) : undefined)); + } else { + obj.signerInfos = []; + } + message.fee !== undefined && (obj.fee = message.fee ? Fee.toJSON(message.fee) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): AuthInfo { + const message = { ...baseAuthInfo } as AuthInfo; + message.signerInfos = []; + if (object.signerInfos !== undefined && object.signerInfos !== null) { + for (const e of object.signerInfos) { + message.signerInfos.push(SignerInfo.fromPartial(e)); + } + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = Fee.fromPartial(object.fee); + } else { + message.fee = undefined; + } + return message; + }, +}; + +const baseSignerInfo: object = { sequence: Long.UZERO }; + +export const SignerInfo = { + encode(message: SignerInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.publicKey !== undefined) { + Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); + } + if (message.modeInfo !== undefined) { + ModeInfo.encode(message.modeInfo, writer.uint32(18).fork()).ldelim(); + } + if (!message.sequence.isZero()) { + writer.uint32(24).uint64(message.sequence); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SignerInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSignerInfo } as SignerInfo; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicKey = Any.decode(reader, reader.uint32()); + break; + case 2: + message.modeInfo = ModeInfo.decode(reader, reader.uint32()); + break; + case 3: + message.sequence = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SignerInfo { + const message = { ...baseSignerInfo } as SignerInfo; + if (object.publicKey !== undefined && object.publicKey !== null) { + message.publicKey = Any.fromJSON(object.publicKey); + } else { + message.publicKey = undefined; + } + if (object.modeInfo !== undefined && object.modeInfo !== null) { + message.modeInfo = ModeInfo.fromJSON(object.modeInfo); + } else { + message.modeInfo = undefined; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = Long.fromString(object.sequence); + } else { + message.sequence = Long.UZERO; + } + return message; + }, + + toJSON(message: SignerInfo): unknown { + const obj: any = {}; + message.publicKey !== undefined && + (obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined); + message.modeInfo !== undefined && + (obj.modeInfo = message.modeInfo ? ModeInfo.toJSON(message.modeInfo) : undefined); + message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): SignerInfo { + const message = { ...baseSignerInfo } as SignerInfo; + if (object.publicKey !== undefined && object.publicKey !== null) { + message.publicKey = Any.fromPartial(object.publicKey); + } else { + message.publicKey = undefined; + } + if (object.modeInfo !== undefined && object.modeInfo !== null) { + message.modeInfo = ModeInfo.fromPartial(object.modeInfo); + } else { + message.modeInfo = undefined; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = object.sequence as Long; + } else { + message.sequence = Long.UZERO; + } + return message; + }, +}; + +const baseModeInfo: object = {}; + +export const ModeInfo = { + encode(message: ModeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.single !== undefined) { + ModeInfo_Single.encode(message.single, writer.uint32(10).fork()).ldelim(); + } + if (message.multi !== undefined) { + ModeInfo_Multi.encode(message.multi, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ModeInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseModeInfo } as ModeInfo; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.single = ModeInfo_Single.decode(reader, reader.uint32()); + break; + case 2: + message.multi = ModeInfo_Multi.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ModeInfo { + const message = { ...baseModeInfo } as ModeInfo; + if (object.single !== undefined && object.single !== null) { + message.single = ModeInfo_Single.fromJSON(object.single); + } else { + message.single = undefined; + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = ModeInfo_Multi.fromJSON(object.multi); + } else { + message.multi = undefined; + } + return message; + }, + + toJSON(message: ModeInfo): unknown { + const obj: any = {}; + message.single !== undefined && + (obj.single = message.single ? ModeInfo_Single.toJSON(message.single) : undefined); + message.multi !== undefined && + (obj.multi = message.multi ? ModeInfo_Multi.toJSON(message.multi) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): ModeInfo { + const message = { ...baseModeInfo } as ModeInfo; + if (object.single !== undefined && object.single !== null) { + message.single = ModeInfo_Single.fromPartial(object.single); + } else { + message.single = undefined; + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = ModeInfo_Multi.fromPartial(object.multi); + } else { + message.multi = undefined; + } + return message; + }, +}; + +const baseModeInfo_Single: object = { mode: 0 }; + +export const ModeInfo_Single = { + encode(message: ModeInfo_Single, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.mode !== 0) { + writer.uint32(8).int32(message.mode); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ModeInfo_Single { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseModeInfo_Single } as ModeInfo_Single; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mode = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ModeInfo_Single { + const message = { ...baseModeInfo_Single } as ModeInfo_Single; + if (object.mode !== undefined && object.mode !== null) { + message.mode = signModeFromJSON(object.mode); + } else { + message.mode = 0; + } + return message; + }, + + toJSON(message: ModeInfo_Single): unknown { + const obj: any = {}; + message.mode !== undefined && (obj.mode = signModeToJSON(message.mode)); + return obj; + }, + + fromPartial(object: DeepPartial): ModeInfo_Single { + const message = { ...baseModeInfo_Single } as ModeInfo_Single; + if (object.mode !== undefined && object.mode !== null) { + message.mode = object.mode; + } else { + message.mode = 0; + } + return message; + }, +}; + +const baseModeInfo_Multi: object = {}; + +export const ModeInfo_Multi = { + encode(message: ModeInfo_Multi, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.bitarray !== undefined) { + CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.modeInfos) { + ModeInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ModeInfo_Multi { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseModeInfo_Multi } as ModeInfo_Multi; + message.modeInfos = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bitarray = CompactBitArray.decode(reader, reader.uint32()); + break; + case 2: + message.modeInfos.push(ModeInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ModeInfo_Multi { + const message = { ...baseModeInfo_Multi } as ModeInfo_Multi; + message.modeInfos = []; + if (object.bitarray !== undefined && object.bitarray !== null) { + message.bitarray = CompactBitArray.fromJSON(object.bitarray); + } else { + message.bitarray = undefined; + } + if (object.modeInfos !== undefined && object.modeInfos !== null) { + for (const e of object.modeInfos) { + message.modeInfos.push(ModeInfo.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: ModeInfo_Multi): unknown { + const obj: any = {}; + message.bitarray !== undefined && + (obj.bitarray = message.bitarray ? CompactBitArray.toJSON(message.bitarray) : undefined); + if (message.modeInfos) { + obj.modeInfos = message.modeInfos.map((e) => (e ? ModeInfo.toJSON(e) : undefined)); + } else { + obj.modeInfos = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ModeInfo_Multi { + const message = { ...baseModeInfo_Multi } as ModeInfo_Multi; + message.modeInfos = []; + if (object.bitarray !== undefined && object.bitarray !== null) { + message.bitarray = CompactBitArray.fromPartial(object.bitarray); + } else { + message.bitarray = undefined; + } + if (object.modeInfos !== undefined && object.modeInfos !== null) { + for (const e of object.modeInfos) { + message.modeInfos.push(ModeInfo.fromPartial(e)); + } + } + return message; + }, +}; + +const baseFee: object = { gasLimit: Long.UZERO, payer: "", granter: "" }; + +export const Fee = { + encode(message: Fee, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (!message.gasLimit.isZero()) { + writer.uint32(16).uint64(message.gasLimit); + } + if (message.payer !== "") { + writer.uint32(26).string(message.payer); + } + if (message.granter !== "") { + writer.uint32(34).string(message.granter); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Fee { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFee } as Fee; + message.amount = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.gasLimit = reader.uint64() as Long; + break; + case 3: + message.payer = reader.string(); + break; + case 4: + message.granter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Fee { + const message = { ...baseFee } as Fee; + message.amount = []; + if (object.amount !== undefined && object.amount !== null) { + for (const e of object.amount) { + message.amount.push(Coin.fromJSON(e)); + } + } + if (object.gasLimit !== undefined && object.gasLimit !== null) { + message.gasLimit = Long.fromString(object.gasLimit); + } else { + message.gasLimit = Long.UZERO; + } + if (object.payer !== undefined && object.payer !== null) { + message.payer = String(object.payer); + } else { + message.payer = ""; + } + if (object.granter !== undefined && object.granter !== null) { + message.granter = String(object.granter); + } else { + message.granter = ""; + } + return message; + }, + + toJSON(message: Fee): unknown { + const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.amount = []; + } + message.gasLimit !== undefined && (obj.gasLimit = (message.gasLimit || Long.UZERO).toString()); + message.payer !== undefined && (obj.payer = message.payer); + message.granter !== undefined && (obj.granter = message.granter); + return obj; + }, + + fromPartial(object: DeepPartial): Fee { + const message = { ...baseFee } as Fee; + message.amount = []; + if (object.amount !== undefined && object.amount !== null) { + for (const e of object.amount) { + message.amount.push(Coin.fromPartial(e)); + } + } + if (object.gasLimit !== undefined && object.gasLimit !== null) { + message.gasLimit = object.gasLimit as Long; + } else { + message.gasLimit = Long.UZERO; + } + if (object.payer !== undefined && object.payer !== null) { + message.payer = object.payer; + } else { + message.payer = ""; + } + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } else { + message.granter = ""; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/upgrade/v1beta1/query.ts b/src/cosmos/upgrade/v1beta1/query.ts new file mode 100644 index 00000000..722b6ab7 --- /dev/null +++ b/src/cosmos/upgrade/v1beta1/query.ts @@ -0,0 +1,472 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Plan } from "../../../cosmos/upgrade/v1beta1/upgrade"; + +export const protobufPackage = "cosmos.upgrade.v1beta1"; + +/** + * QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC + * method. + */ +export interface QueryCurrentPlanRequest {} + +/** + * QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC + * method. + */ +export interface QueryCurrentPlanResponse { + /** plan is the current upgrade plan. */ + plan?: Plan; +} + +/** + * QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC + * method. + */ +export interface QueryAppliedPlanRequest { + /** name is the name of the applied plan to query for. */ + name: string; +} + +/** + * QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC + * method. + */ +export interface QueryAppliedPlanResponse { + /** height is the block height at which the plan was applied. */ + height: Long; +} + +/** + * QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState + * RPC method. + */ +export interface QueryUpgradedConsensusStateRequest { + /** + * last height of the current chain must be sent in request + * as this is the height under which next consensus state is stored + */ + lastHeight: Long; +} + +/** + * QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState + * RPC method. + */ +export interface QueryUpgradedConsensusStateResponse { + upgradedConsensusState: Uint8Array; +} + +const baseQueryCurrentPlanRequest: object = {}; + +export const QueryCurrentPlanRequest = { + encode(_: QueryCurrentPlanRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCurrentPlanRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryCurrentPlanRequest } as QueryCurrentPlanRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryCurrentPlanRequest { + const message = { ...baseQueryCurrentPlanRequest } as QueryCurrentPlanRequest; + return message; + }, + + toJSON(_: QueryCurrentPlanRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): QueryCurrentPlanRequest { + const message = { ...baseQueryCurrentPlanRequest } as QueryCurrentPlanRequest; + return message; + }, +}; + +const baseQueryCurrentPlanResponse: object = {}; + +export const QueryCurrentPlanResponse = { + encode(message: QueryCurrentPlanResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCurrentPlanResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryCurrentPlanResponse } as QueryCurrentPlanResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.plan = Plan.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryCurrentPlanResponse { + const message = { ...baseQueryCurrentPlanResponse } as QueryCurrentPlanResponse; + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromJSON(object.plan); + } else { + message.plan = undefined; + } + return message; + }, + + toJSON(message: QueryCurrentPlanResponse): unknown { + const obj: any = {}; + message.plan !== undefined && (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryCurrentPlanResponse { + const message = { ...baseQueryCurrentPlanResponse } as QueryCurrentPlanResponse; + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromPartial(object.plan); + } else { + message.plan = undefined; + } + return message; + }, +}; + +const baseQueryAppliedPlanRequest: object = { name: "" }; + +export const QueryAppliedPlanRequest = { + encode(message: QueryAppliedPlanRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAppliedPlanRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryAppliedPlanRequest } as QueryAppliedPlanRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAppliedPlanRequest { + const message = { ...baseQueryAppliedPlanRequest } as QueryAppliedPlanRequest; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + return message; + }, + + toJSON(message: QueryAppliedPlanRequest): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + return obj; + }, + + fromPartial(object: DeepPartial): QueryAppliedPlanRequest { + const message = { ...baseQueryAppliedPlanRequest } as QueryAppliedPlanRequest; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + return message; + }, +}; + +const baseQueryAppliedPlanResponse: object = { height: Long.ZERO }; + +export const QueryAppliedPlanResponse = { + encode(message: QueryAppliedPlanResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.height.isZero()) { + writer.uint32(8).int64(message.height); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAppliedPlanResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryAppliedPlanResponse } as QueryAppliedPlanResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAppliedPlanResponse { + const message = { ...baseQueryAppliedPlanResponse } as QueryAppliedPlanResponse; + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.ZERO; + } + return message; + }, + + toJSON(message: QueryAppliedPlanResponse): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): QueryAppliedPlanResponse { + const message = { ...baseQueryAppliedPlanResponse } as QueryAppliedPlanResponse; + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.ZERO; + } + return message; + }, +}; + +const baseQueryUpgradedConsensusStateRequest: object = { lastHeight: Long.ZERO }; + +export const QueryUpgradedConsensusStateRequest = { + encode(message: QueryUpgradedConsensusStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.lastHeight.isZero()) { + writer.uint32(8).int64(message.lastHeight); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryUpgradedConsensusStateRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryUpgradedConsensusStateRequest } as QueryUpgradedConsensusStateRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lastHeight = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryUpgradedConsensusStateRequest { + const message = { ...baseQueryUpgradedConsensusStateRequest } as QueryUpgradedConsensusStateRequest; + if (object.lastHeight !== undefined && object.lastHeight !== null) { + message.lastHeight = Long.fromString(object.lastHeight); + } else { + message.lastHeight = Long.ZERO; + } + return message; + }, + + toJSON(message: QueryUpgradedConsensusStateRequest): unknown { + const obj: any = {}; + message.lastHeight !== undefined && (obj.lastHeight = (message.lastHeight || Long.ZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): QueryUpgradedConsensusStateRequest { + const message = { ...baseQueryUpgradedConsensusStateRequest } as QueryUpgradedConsensusStateRequest; + if (object.lastHeight !== undefined && object.lastHeight !== null) { + message.lastHeight = object.lastHeight as Long; + } else { + message.lastHeight = Long.ZERO; + } + return message; + }, +}; + +const baseQueryUpgradedConsensusStateResponse: object = {}; + +export const QueryUpgradedConsensusStateResponse = { + encode(message: QueryUpgradedConsensusStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.upgradedConsensusState.length !== 0) { + writer.uint32(18).bytes(message.upgradedConsensusState); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryUpgradedConsensusStateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryUpgradedConsensusStateResponse } as QueryUpgradedConsensusStateResponse; + message.upgradedConsensusState = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.upgradedConsensusState = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryUpgradedConsensusStateResponse { + const message = { ...baseQueryUpgradedConsensusStateResponse } as QueryUpgradedConsensusStateResponse; + message.upgradedConsensusState = new Uint8Array(); + if (object.upgradedConsensusState !== undefined && object.upgradedConsensusState !== null) { + message.upgradedConsensusState = bytesFromBase64(object.upgradedConsensusState); + } + return message; + }, + + toJSON(message: QueryUpgradedConsensusStateResponse): unknown { + const obj: any = {}; + message.upgradedConsensusState !== undefined && + (obj.upgradedConsensusState = base64FromBytes( + message.upgradedConsensusState !== undefined ? message.upgradedConsensusState : new Uint8Array(), + )); + return obj; + }, + + fromPartial(object: DeepPartial): QueryUpgradedConsensusStateResponse { + const message = { ...baseQueryUpgradedConsensusStateResponse } as QueryUpgradedConsensusStateResponse; + if (object.upgradedConsensusState !== undefined && object.upgradedConsensusState !== null) { + message.upgradedConsensusState = object.upgradedConsensusState; + } else { + message.upgradedConsensusState = new Uint8Array(); + } + return message; + }, +}; + +/** Query defines the gRPC upgrade querier service. */ +export interface Query { + /** CurrentPlan queries the current upgrade plan. */ + CurrentPlan(request: QueryCurrentPlanRequest): Promise; + /** AppliedPlan queries a previously applied upgrade plan by its name. */ + AppliedPlan(request: QueryAppliedPlanRequest): Promise; + /** + * UpgradedConsensusState queries the consensus state that will serve + * as a trusted kernel for the next version of this chain. It will only be + * stored at the last height of this chain. + * UpgradedConsensusState RPC not supported with legacy querier + */ + UpgradedConsensusState( + request: QueryUpgradedConsensusStateRequest, + ): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.CurrentPlan = this.CurrentPlan.bind(this); + this.AppliedPlan = this.AppliedPlan.bind(this); + this.UpgradedConsensusState = this.UpgradedConsensusState.bind(this); + } + CurrentPlan(request: QueryCurrentPlanRequest): Promise { + const data = QueryCurrentPlanRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "CurrentPlan", data); + return promise.then((data) => QueryCurrentPlanResponse.decode(new _m0.Reader(data))); + } + + AppliedPlan(request: QueryAppliedPlanRequest): Promise { + const data = QueryAppliedPlanRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "AppliedPlan", data); + return promise.then((data) => QueryAppliedPlanResponse.decode(new _m0.Reader(data))); + } + + UpgradedConsensusState( + request: QueryUpgradedConsensusStateRequest, + ): Promise { + const data = QueryUpgradedConsensusStateRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "UpgradedConsensusState", data); + return promise.then((data) => QueryUpgradedConsensusStateResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/upgrade/v1beta1/upgrade.ts b/src/cosmos/upgrade/v1beta1/upgrade.ts new file mode 100644 index 00000000..5d8b4923 --- /dev/null +++ b/src/cosmos/upgrade/v1beta1/upgrade.ts @@ -0,0 +1,314 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos.upgrade.v1beta1"; + +/** Plan specifies information about a planned upgrade and when it should occur. */ +export interface Plan { + /** + * Sets the name for the upgrade. This name will be used by the upgraded + * version of the software to apply any special "on-upgrade" commands during + * the first BeginBlock method after the upgrade is applied. It is also used + * to detect whether a software version can handle a given upgrade. If no + * upgrade handler with this name has been set in the software, it will be + * assumed that the software is out-of-date when the upgrade Time or Height is + * reached and the software will exit. + */ + name: string; + /** + * The height at which the upgrade must be performed. + * Only used if Time is not set. + */ + height: Long; + /** + * Any application specific upgrade info to be included on-chain + * such as a git commit that validators could automatically upgrade to + */ + info: string; +} + +/** + * SoftwareUpgradeProposal is a gov Content type for initiating a software + * upgrade. + */ +export interface SoftwareUpgradeProposal { + title: string; + description: string; + plan?: Plan; +} + +/** + * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software + * upgrade. + */ +export interface CancelSoftwareUpgradeProposal { + title: string; + description: string; +} + +const basePlan: object = { name: "", height: Long.ZERO, info: "" }; + +export const Plan = { + encode(message: Plan, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (!message.height.isZero()) { + writer.uint32(24).int64(message.height); + } + if (message.info !== "") { + writer.uint32(34).string(message.info); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Plan { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePlan } as Plan; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.height = reader.int64() as Long; + break; + case 4: + message.info = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Plan { + const message = { ...basePlan } as Plan; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.ZERO; + } + if (object.info !== undefined && object.info !== null) { + message.info = String(object.info); + } else { + message.info = ""; + } + return message; + }, + + toJSON(message: Plan): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.info !== undefined && (obj.info = message.info); + return obj; + }, + + fromPartial(object: DeepPartial): Plan { + const message = { ...basePlan } as Plan; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.ZERO; + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } else { + message.info = ""; + } + return message; + }, +}; + +const baseSoftwareUpgradeProposal: object = { title: "", description: "" }; + +export const SoftwareUpgradeProposal = { + encode(message: SoftwareUpgradeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SoftwareUpgradeProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSoftwareUpgradeProposal } as SoftwareUpgradeProposal; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.plan = Plan.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SoftwareUpgradeProposal { + const message = { ...baseSoftwareUpgradeProposal } as SoftwareUpgradeProposal; + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromJSON(object.plan); + } else { + message.plan = undefined; + } + return message; + }, + + toJSON(message: SoftwareUpgradeProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.plan !== undefined && (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): SoftwareUpgradeProposal { + const message = { ...baseSoftwareUpgradeProposal } as SoftwareUpgradeProposal; + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromPartial(object.plan); + } else { + message.plan = undefined; + } + return message; + }, +}; + +const baseCancelSoftwareUpgradeProposal: object = { title: "", description: "" }; + +export const CancelSoftwareUpgradeProposal = { + encode(message: CancelSoftwareUpgradeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CancelSoftwareUpgradeProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCancelSoftwareUpgradeProposal } as CancelSoftwareUpgradeProposal; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CancelSoftwareUpgradeProposal { + const message = { ...baseCancelSoftwareUpgradeProposal } as CancelSoftwareUpgradeProposal; + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + return message; + }, + + toJSON(message: CancelSoftwareUpgradeProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + + fromPartial(object: DeepPartial): CancelSoftwareUpgradeProposal { + const message = { ...baseCancelSoftwareUpgradeProposal } as CancelSoftwareUpgradeProposal; + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/vesting/v1beta1/tx.ts b/src/cosmos/vesting/v1beta1/tx.ts new file mode 100644 index 00000000..96291864 --- /dev/null +++ b/src/cosmos/vesting/v1beta1/tx.ts @@ -0,0 +1,236 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Coin } from "../../../cosmos/base/v1beta1/coin"; + +export const protobufPackage = "cosmos.vesting.v1beta1"; + +/** + * MsgCreateVestingAccount defines a message that enables creating a vesting + * account. + */ +export interface MsgCreateVestingAccount { + fromAddress: string; + toAddress: string; + amount: Coin[]; + endTime: Long; + delayed: boolean; +} + +/** MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. */ +export interface MsgCreateVestingAccountResponse {} + +const baseMsgCreateVestingAccount: object = { + fromAddress: "", + toAddress: "", + endTime: Long.ZERO, + delayed: false, +}; + +export const MsgCreateVestingAccount = { + encode(message: MsgCreateVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.fromAddress !== "") { + writer.uint32(10).string(message.fromAddress); + } + if (message.toAddress !== "") { + writer.uint32(18).string(message.toAddress); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (!message.endTime.isZero()) { + writer.uint32(32).int64(message.endTime); + } + if (message.delayed === true) { + writer.uint32(40).bool(message.delayed); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateVestingAccount { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgCreateVestingAccount } as MsgCreateVestingAccount; + message.amount = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromAddress = reader.string(); + break; + case 2: + message.toAddress = reader.string(); + break; + case 3: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + case 4: + message.endTime = reader.int64() as Long; + break; + case 5: + message.delayed = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgCreateVestingAccount { + const message = { ...baseMsgCreateVestingAccount } as MsgCreateVestingAccount; + message.amount = []; + if (object.fromAddress !== undefined && object.fromAddress !== null) { + message.fromAddress = String(object.fromAddress); + } else { + message.fromAddress = ""; + } + if (object.toAddress !== undefined && object.toAddress !== null) { + message.toAddress = String(object.toAddress); + } else { + message.toAddress = ""; + } + if (object.amount !== undefined && object.amount !== null) { + for (const e of object.amount) { + message.amount.push(Coin.fromJSON(e)); + } + } + if (object.endTime !== undefined && object.endTime !== null) { + message.endTime = Long.fromString(object.endTime); + } else { + message.endTime = Long.ZERO; + } + if (object.delayed !== undefined && object.delayed !== null) { + message.delayed = Boolean(object.delayed); + } else { + message.delayed = false; + } + return message; + }, + + toJSON(message: MsgCreateVestingAccount): unknown { + const obj: any = {}; + message.fromAddress !== undefined && (obj.fromAddress = message.fromAddress); + message.toAddress !== undefined && (obj.toAddress = message.toAddress); + if (message.amount) { + obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.amount = []; + } + message.endTime !== undefined && (obj.endTime = (message.endTime || Long.ZERO).toString()); + message.delayed !== undefined && (obj.delayed = message.delayed); + return obj; + }, + + fromPartial(object: DeepPartial): MsgCreateVestingAccount { + const message = { ...baseMsgCreateVestingAccount } as MsgCreateVestingAccount; + message.amount = []; + if (object.fromAddress !== undefined && object.fromAddress !== null) { + message.fromAddress = object.fromAddress; + } else { + message.fromAddress = ""; + } + if (object.toAddress !== undefined && object.toAddress !== null) { + message.toAddress = object.toAddress; + } else { + message.toAddress = ""; + } + if (object.amount !== undefined && object.amount !== null) { + for (const e of object.amount) { + message.amount.push(Coin.fromPartial(e)); + } + } + if (object.endTime !== undefined && object.endTime !== null) { + message.endTime = object.endTime as Long; + } else { + message.endTime = Long.ZERO; + } + if (object.delayed !== undefined && object.delayed !== null) { + message.delayed = object.delayed; + } else { + message.delayed = false; + } + return message; + }, +}; + +const baseMsgCreateVestingAccountResponse: object = {}; + +export const MsgCreateVestingAccountResponse = { + encode(_: MsgCreateVestingAccountResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateVestingAccountResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgCreateVestingAccountResponse } as MsgCreateVestingAccountResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgCreateVestingAccountResponse { + const message = { ...baseMsgCreateVestingAccountResponse } as MsgCreateVestingAccountResponse; + return message; + }, + + toJSON(_: MsgCreateVestingAccountResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgCreateVestingAccountResponse { + const message = { ...baseMsgCreateVestingAccountResponse } as MsgCreateVestingAccountResponse; + return message; + }, +}; + +/** Msg defines the bank Msg service. */ +export interface Msg { + /** + * CreateVestingAccount defines a method that enables creating a vesting + * account. + */ + CreateVestingAccount(request: MsgCreateVestingAccount): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.CreateVestingAccount = this.CreateVestingAccount.bind(this); + } + CreateVestingAccount(request: MsgCreateVestingAccount): Promise { + const data = MsgCreateVestingAccount.encode(request).finish(); + const promise = this.rpc.request("cosmos.vesting.v1beta1.Msg", "CreateVestingAccount", data); + return promise.then((data) => MsgCreateVestingAccountResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos/vesting/v1beta1/vesting.ts b/src/cosmos/vesting/v1beta1/vesting.ts new file mode 100644 index 00000000..450a6da2 --- /dev/null +++ b/src/cosmos/vesting/v1beta1/vesting.ts @@ -0,0 +1,592 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { BaseAccount } from "../../../cosmos/auth/v1beta1/auth"; +import { Coin } from "../../../cosmos/base/v1beta1/coin"; + +export const protobufPackage = "cosmos.vesting.v1beta1"; + +/** + * BaseVestingAccount implements the VestingAccount interface. It contains all + * the necessary fields needed for any vesting account implementation. + */ +export interface BaseVestingAccount { + baseAccount?: BaseAccount; + originalVesting: Coin[]; + delegatedFree: Coin[]; + delegatedVesting: Coin[]; + endTime: Long; +} + +/** + * ContinuousVestingAccount implements the VestingAccount interface. It + * continuously vests by unlocking coins linearly with respect to time. + */ +export interface ContinuousVestingAccount { + baseVestingAccount?: BaseVestingAccount; + startTime: Long; +} + +/** + * DelayedVestingAccount implements the VestingAccount interface. It vests all + * coins after a specific time, but non prior. In other words, it keeps them + * locked until a specified time. + */ +export interface DelayedVestingAccount { + baseVestingAccount?: BaseVestingAccount; +} + +/** Period defines a length of time and amount of coins that will vest. */ +export interface Period { + length: Long; + amount: Coin[]; +} + +/** + * PeriodicVestingAccount implements the VestingAccount interface. It + * periodically vests by unlocking coins during each specified period. + */ +export interface PeriodicVestingAccount { + baseVestingAccount?: BaseVestingAccount; + startTime: Long; + vestingPeriods: Period[]; +} + +/** + * PermanentLockedAccount implements the VestingAccount interface. It does + * not ever release coins, locking them indefinitely. Coins in this account can + * still be used for delegating and for governance votes even while locked. + */ +export interface PermanentLockedAccount { + baseVestingAccount?: BaseVestingAccount; +} + +const baseBaseVestingAccount: object = { endTime: Long.ZERO }; + +export const BaseVestingAccount = { + encode(message: BaseVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.baseAccount !== undefined) { + BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.originalVesting) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.delegatedFree) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.delegatedVesting) { + Coin.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (!message.endTime.isZero()) { + writer.uint32(40).int64(message.endTime); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BaseVestingAccount { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseBaseVestingAccount } as BaseVestingAccount; + message.originalVesting = []; + message.delegatedFree = []; + message.delegatedVesting = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseAccount = BaseAccount.decode(reader, reader.uint32()); + break; + case 2: + message.originalVesting.push(Coin.decode(reader, reader.uint32())); + break; + case 3: + message.delegatedFree.push(Coin.decode(reader, reader.uint32())); + break; + case 4: + message.delegatedVesting.push(Coin.decode(reader, reader.uint32())); + break; + case 5: + message.endTime = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): BaseVestingAccount { + const message = { ...baseBaseVestingAccount } as BaseVestingAccount; + message.originalVesting = []; + message.delegatedFree = []; + message.delegatedVesting = []; + if (object.baseAccount !== undefined && object.baseAccount !== null) { + message.baseAccount = BaseAccount.fromJSON(object.baseAccount); + } else { + message.baseAccount = undefined; + } + if (object.originalVesting !== undefined && object.originalVesting !== null) { + for (const e of object.originalVesting) { + message.originalVesting.push(Coin.fromJSON(e)); + } + } + if (object.delegatedFree !== undefined && object.delegatedFree !== null) { + for (const e of object.delegatedFree) { + message.delegatedFree.push(Coin.fromJSON(e)); + } + } + if (object.delegatedVesting !== undefined && object.delegatedVesting !== null) { + for (const e of object.delegatedVesting) { + message.delegatedVesting.push(Coin.fromJSON(e)); + } + } + if (object.endTime !== undefined && object.endTime !== null) { + message.endTime = Long.fromString(object.endTime); + } else { + message.endTime = Long.ZERO; + } + return message; + }, + + toJSON(message: BaseVestingAccount): unknown { + const obj: any = {}; + message.baseAccount !== undefined && + (obj.baseAccount = message.baseAccount ? BaseAccount.toJSON(message.baseAccount) : undefined); + if (message.originalVesting) { + obj.originalVesting = message.originalVesting.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.originalVesting = []; + } + if (message.delegatedFree) { + obj.delegatedFree = message.delegatedFree.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.delegatedFree = []; + } + if (message.delegatedVesting) { + obj.delegatedVesting = message.delegatedVesting.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.delegatedVesting = []; + } + message.endTime !== undefined && (obj.endTime = (message.endTime || Long.ZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): BaseVestingAccount { + const message = { ...baseBaseVestingAccount } as BaseVestingAccount; + message.originalVesting = []; + message.delegatedFree = []; + message.delegatedVesting = []; + if (object.baseAccount !== undefined && object.baseAccount !== null) { + message.baseAccount = BaseAccount.fromPartial(object.baseAccount); + } else { + message.baseAccount = undefined; + } + if (object.originalVesting !== undefined && object.originalVesting !== null) { + for (const e of object.originalVesting) { + message.originalVesting.push(Coin.fromPartial(e)); + } + } + if (object.delegatedFree !== undefined && object.delegatedFree !== null) { + for (const e of object.delegatedFree) { + message.delegatedFree.push(Coin.fromPartial(e)); + } + } + if (object.delegatedVesting !== undefined && object.delegatedVesting !== null) { + for (const e of object.delegatedVesting) { + message.delegatedVesting.push(Coin.fromPartial(e)); + } + } + if (object.endTime !== undefined && object.endTime !== null) { + message.endTime = object.endTime as Long; + } else { + message.endTime = Long.ZERO; + } + return message; + }, +}; + +const baseContinuousVestingAccount: object = { startTime: Long.ZERO }; + +export const ContinuousVestingAccount = { + encode(message: ContinuousVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.baseVestingAccount !== undefined) { + BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); + } + if (!message.startTime.isZero()) { + writer.uint32(16).int64(message.startTime); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ContinuousVestingAccount { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseContinuousVestingAccount } as ContinuousVestingAccount; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); + break; + case 2: + message.startTime = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ContinuousVestingAccount { + const message = { ...baseContinuousVestingAccount } as ContinuousVestingAccount; + if (object.baseVestingAccount !== undefined && object.baseVestingAccount !== null) { + message.baseVestingAccount = BaseVestingAccount.fromJSON(object.baseVestingAccount); + } else { + message.baseVestingAccount = undefined; + } + if (object.startTime !== undefined && object.startTime !== null) { + message.startTime = Long.fromString(object.startTime); + } else { + message.startTime = Long.ZERO; + } + return message; + }, + + toJSON(message: ContinuousVestingAccount): unknown { + const obj: any = {}; + message.baseVestingAccount !== undefined && + (obj.baseVestingAccount = message.baseVestingAccount + ? BaseVestingAccount.toJSON(message.baseVestingAccount) + : undefined); + message.startTime !== undefined && (obj.startTime = (message.startTime || Long.ZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): ContinuousVestingAccount { + const message = { ...baseContinuousVestingAccount } as ContinuousVestingAccount; + if (object.baseVestingAccount !== undefined && object.baseVestingAccount !== null) { + message.baseVestingAccount = BaseVestingAccount.fromPartial(object.baseVestingAccount); + } else { + message.baseVestingAccount = undefined; + } + if (object.startTime !== undefined && object.startTime !== null) { + message.startTime = object.startTime as Long; + } else { + message.startTime = Long.ZERO; + } + return message; + }, +}; + +const baseDelayedVestingAccount: object = {}; + +export const DelayedVestingAccount = { + encode(message: DelayedVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.baseVestingAccount !== undefined) { + BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DelayedVestingAccount { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDelayedVestingAccount } as DelayedVestingAccount; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DelayedVestingAccount { + const message = { ...baseDelayedVestingAccount } as DelayedVestingAccount; + if (object.baseVestingAccount !== undefined && object.baseVestingAccount !== null) { + message.baseVestingAccount = BaseVestingAccount.fromJSON(object.baseVestingAccount); + } else { + message.baseVestingAccount = undefined; + } + return message; + }, + + toJSON(message: DelayedVestingAccount): unknown { + const obj: any = {}; + message.baseVestingAccount !== undefined && + (obj.baseVestingAccount = message.baseVestingAccount + ? BaseVestingAccount.toJSON(message.baseVestingAccount) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): DelayedVestingAccount { + const message = { ...baseDelayedVestingAccount } as DelayedVestingAccount; + if (object.baseVestingAccount !== undefined && object.baseVestingAccount !== null) { + message.baseVestingAccount = BaseVestingAccount.fromPartial(object.baseVestingAccount); + } else { + message.baseVestingAccount = undefined; + } + return message; + }, +}; + +const basePeriod: object = { length: Long.ZERO }; + +export const Period = { + encode(message: Period, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.length.isZero()) { + writer.uint32(8).int64(message.length); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Period { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePeriod } as Period; + message.amount = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.length = reader.int64() as Long; + break; + case 2: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Period { + const message = { ...basePeriod } as Period; + message.amount = []; + if (object.length !== undefined && object.length !== null) { + message.length = Long.fromString(object.length); + } else { + message.length = Long.ZERO; + } + if (object.amount !== undefined && object.amount !== null) { + for (const e of object.amount) { + message.amount.push(Coin.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: Period): unknown { + const obj: any = {}; + message.length !== undefined && (obj.length = (message.length || Long.ZERO).toString()); + if (message.amount) { + obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.amount = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): Period { + const message = { ...basePeriod } as Period; + message.amount = []; + if (object.length !== undefined && object.length !== null) { + message.length = object.length as Long; + } else { + message.length = Long.ZERO; + } + if (object.amount !== undefined && object.amount !== null) { + for (const e of object.amount) { + message.amount.push(Coin.fromPartial(e)); + } + } + return message; + }, +}; + +const basePeriodicVestingAccount: object = { startTime: Long.ZERO }; + +export const PeriodicVestingAccount = { + encode(message: PeriodicVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.baseVestingAccount !== undefined) { + BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); + } + if (!message.startTime.isZero()) { + writer.uint32(16).int64(message.startTime); + } + for (const v of message.vestingPeriods) { + Period.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PeriodicVestingAccount { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePeriodicVestingAccount } as PeriodicVestingAccount; + message.vestingPeriods = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); + break; + case 2: + message.startTime = reader.int64() as Long; + break; + case 3: + message.vestingPeriods.push(Period.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PeriodicVestingAccount { + const message = { ...basePeriodicVestingAccount } as PeriodicVestingAccount; + message.vestingPeriods = []; + if (object.baseVestingAccount !== undefined && object.baseVestingAccount !== null) { + message.baseVestingAccount = BaseVestingAccount.fromJSON(object.baseVestingAccount); + } else { + message.baseVestingAccount = undefined; + } + if (object.startTime !== undefined && object.startTime !== null) { + message.startTime = Long.fromString(object.startTime); + } else { + message.startTime = Long.ZERO; + } + if (object.vestingPeriods !== undefined && object.vestingPeriods !== null) { + for (const e of object.vestingPeriods) { + message.vestingPeriods.push(Period.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: PeriodicVestingAccount): unknown { + const obj: any = {}; + message.baseVestingAccount !== undefined && + (obj.baseVestingAccount = message.baseVestingAccount + ? BaseVestingAccount.toJSON(message.baseVestingAccount) + : undefined); + message.startTime !== undefined && (obj.startTime = (message.startTime || Long.ZERO).toString()); + if (message.vestingPeriods) { + obj.vestingPeriods = message.vestingPeriods.map((e) => (e ? Period.toJSON(e) : undefined)); + } else { + obj.vestingPeriods = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): PeriodicVestingAccount { + const message = { ...basePeriodicVestingAccount } as PeriodicVestingAccount; + message.vestingPeriods = []; + if (object.baseVestingAccount !== undefined && object.baseVestingAccount !== null) { + message.baseVestingAccount = BaseVestingAccount.fromPartial(object.baseVestingAccount); + } else { + message.baseVestingAccount = undefined; + } + if (object.startTime !== undefined && object.startTime !== null) { + message.startTime = object.startTime as Long; + } else { + message.startTime = Long.ZERO; + } + if (object.vestingPeriods !== undefined && object.vestingPeriods !== null) { + for (const e of object.vestingPeriods) { + message.vestingPeriods.push(Period.fromPartial(e)); + } + } + return message; + }, +}; + +const basePermanentLockedAccount: object = {}; + +export const PermanentLockedAccount = { + encode(message: PermanentLockedAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.baseVestingAccount !== undefined) { + BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PermanentLockedAccount { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePermanentLockedAccount } as PermanentLockedAccount; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PermanentLockedAccount { + const message = { ...basePermanentLockedAccount } as PermanentLockedAccount; + if (object.baseVestingAccount !== undefined && object.baseVestingAccount !== null) { + message.baseVestingAccount = BaseVestingAccount.fromJSON(object.baseVestingAccount); + } else { + message.baseVestingAccount = undefined; + } + return message; + }, + + toJSON(message: PermanentLockedAccount): unknown { + const obj: any = {}; + message.baseVestingAccount !== undefined && + (obj.baseVestingAccount = message.baseVestingAccount + ? BaseVestingAccount.toJSON(message.baseVestingAccount) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): PermanentLockedAccount { + const message = { ...basePermanentLockedAccount } as PermanentLockedAccount; + if (object.baseVestingAccount !== undefined && object.baseVestingAccount !== null) { + message.baseVestingAccount = BaseVestingAccount.fromPartial(object.baseVestingAccount); + } else { + message.baseVestingAccount = undefined; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmos_proto/cosmos.ts b/src/cosmos_proto/cosmos.ts new file mode 100644 index 00000000..be41366a --- /dev/null +++ b/src/cosmos_proto/cosmos.ts @@ -0,0 +1,10 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmos_proto"; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmwasm/wasm/v1beta1/genesis.ts b/src/cosmwasm/wasm/v1beta1/genesis.ts new file mode 100644 index 00000000..d9da9874 --- /dev/null +++ b/src/cosmwasm/wasm/v1beta1/genesis.ts @@ -0,0 +1,622 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Params, CodeInfo, ContractInfo, Model } from "../../../cosmwasm/wasm/v1beta1/types"; +import { MsgStoreCode, MsgInstantiateContract, MsgExecuteContract } from "../../../cosmwasm/wasm/v1beta1/tx"; + +export const protobufPackage = "cosmwasm.wasm.v1beta1"; + +/** GenesisState - genesis state of x/wasm */ +export interface GenesisState { + params?: Params; + codes: Code[]; + contracts: Contract[]; + sequences: Sequence[]; + genMsgs: GenesisState_GenMsgs[]; +} + +/** + * GenMsgs define the messages that can be executed during genesis phase in + * order. The intention is to have more human readable data that is auditable. + */ +export interface GenesisState_GenMsgs { + storeCode?: MsgStoreCode | undefined; + instantiateContract?: MsgInstantiateContract | undefined; + executeContract?: MsgExecuteContract | undefined; +} + +/** Code struct encompasses CodeInfo and CodeBytes */ +export interface Code { + codeId: Long; + codeInfo?: CodeInfo; + codeBytes: Uint8Array; + /** Pinned to wasmvm cache */ + pinned: boolean; +} + +/** Contract struct encompasses ContractAddress, ContractInfo, and ContractState */ +export interface Contract { + contractAddress: string; + contractInfo?: ContractInfo; + contractState: Model[]; +} + +/** Sequence key and value of an id generation counter */ +export interface Sequence { + idKey: Uint8Array; + value: Long; +} + +const baseGenesisState: object = {}; + +export const GenesisState = { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.codes) { + Code.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.contracts) { + Contract.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.sequences) { + Sequence.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.genMsgs) { + GenesisState_GenMsgs.encode(v!, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGenesisState } as GenesisState; + message.codes = []; + message.contracts = []; + message.sequences = []; + message.genMsgs = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.codes.push(Code.decode(reader, reader.uint32())); + break; + case 3: + message.contracts.push(Contract.decode(reader, reader.uint32())); + break; + case 4: + message.sequences.push(Sequence.decode(reader, reader.uint32())); + break; + case 5: + message.genMsgs.push(GenesisState_GenMsgs.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.codes = []; + message.contracts = []; + message.sequences = []; + message.genMsgs = []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + if (object.codes !== undefined && object.codes !== null) { + for (const e of object.codes) { + message.codes.push(Code.fromJSON(e)); + } + } + if (object.contracts !== undefined && object.contracts !== null) { + for (const e of object.contracts) { + message.contracts.push(Contract.fromJSON(e)); + } + } + if (object.sequences !== undefined && object.sequences !== null) { + for (const e of object.sequences) { + message.sequences.push(Sequence.fromJSON(e)); + } + } + if (object.genMsgs !== undefined && object.genMsgs !== null) { + for (const e of object.genMsgs) { + message.genMsgs.push(GenesisState_GenMsgs.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + if (message.codes) { + obj.codes = message.codes.map((e) => (e ? Code.toJSON(e) : undefined)); + } else { + obj.codes = []; + } + if (message.contracts) { + obj.contracts = message.contracts.map((e) => (e ? Contract.toJSON(e) : undefined)); + } else { + obj.contracts = []; + } + if (message.sequences) { + obj.sequences = message.sequences.map((e) => (e ? Sequence.toJSON(e) : undefined)); + } else { + obj.sequences = []; + } + if (message.genMsgs) { + obj.genMsgs = message.genMsgs.map((e) => (e ? GenesisState_GenMsgs.toJSON(e) : undefined)); + } else { + obj.genMsgs = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.codes = []; + message.contracts = []; + message.sequences = []; + message.genMsgs = []; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + if (object.codes !== undefined && object.codes !== null) { + for (const e of object.codes) { + message.codes.push(Code.fromPartial(e)); + } + } + if (object.contracts !== undefined && object.contracts !== null) { + for (const e of object.contracts) { + message.contracts.push(Contract.fromPartial(e)); + } + } + if (object.sequences !== undefined && object.sequences !== null) { + for (const e of object.sequences) { + message.sequences.push(Sequence.fromPartial(e)); + } + } + if (object.genMsgs !== undefined && object.genMsgs !== null) { + for (const e of object.genMsgs) { + message.genMsgs.push(GenesisState_GenMsgs.fromPartial(e)); + } + } + return message; + }, +}; + +const baseGenesisState_GenMsgs: object = {}; + +export const GenesisState_GenMsgs = { + encode(message: GenesisState_GenMsgs, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.storeCode !== undefined) { + MsgStoreCode.encode(message.storeCode, writer.uint32(10).fork()).ldelim(); + } + if (message.instantiateContract !== undefined) { + MsgInstantiateContract.encode(message.instantiateContract, writer.uint32(18).fork()).ldelim(); + } + if (message.executeContract !== undefined) { + MsgExecuteContract.encode(message.executeContract, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState_GenMsgs { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGenesisState_GenMsgs } as GenesisState_GenMsgs; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.storeCode = MsgStoreCode.decode(reader, reader.uint32()); + break; + case 2: + message.instantiateContract = MsgInstantiateContract.decode(reader, reader.uint32()); + break; + case 3: + message.executeContract = MsgExecuteContract.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState_GenMsgs { + const message = { ...baseGenesisState_GenMsgs } as GenesisState_GenMsgs; + if (object.storeCode !== undefined && object.storeCode !== null) { + message.storeCode = MsgStoreCode.fromJSON(object.storeCode); + } else { + message.storeCode = undefined; + } + if (object.instantiateContract !== undefined && object.instantiateContract !== null) { + message.instantiateContract = MsgInstantiateContract.fromJSON(object.instantiateContract); + } else { + message.instantiateContract = undefined; + } + if (object.executeContract !== undefined && object.executeContract !== null) { + message.executeContract = MsgExecuteContract.fromJSON(object.executeContract); + } else { + message.executeContract = undefined; + } + return message; + }, + + toJSON(message: GenesisState_GenMsgs): unknown { + const obj: any = {}; + message.storeCode !== undefined && + (obj.storeCode = message.storeCode ? MsgStoreCode.toJSON(message.storeCode) : undefined); + message.instantiateContract !== undefined && + (obj.instantiateContract = message.instantiateContract + ? MsgInstantiateContract.toJSON(message.instantiateContract) + : undefined); + message.executeContract !== undefined && + (obj.executeContract = message.executeContract + ? MsgExecuteContract.toJSON(message.executeContract) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): GenesisState_GenMsgs { + const message = { ...baseGenesisState_GenMsgs } as GenesisState_GenMsgs; + if (object.storeCode !== undefined && object.storeCode !== null) { + message.storeCode = MsgStoreCode.fromPartial(object.storeCode); + } else { + message.storeCode = undefined; + } + if (object.instantiateContract !== undefined && object.instantiateContract !== null) { + message.instantiateContract = MsgInstantiateContract.fromPartial(object.instantiateContract); + } else { + message.instantiateContract = undefined; + } + if (object.executeContract !== undefined && object.executeContract !== null) { + message.executeContract = MsgExecuteContract.fromPartial(object.executeContract); + } else { + message.executeContract = undefined; + } + return message; + }, +}; + +const baseCode: object = { codeId: Long.UZERO, pinned: false }; + +export const Code = { + encode(message: Code, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.codeId.isZero()) { + writer.uint32(8).uint64(message.codeId); + } + if (message.codeInfo !== undefined) { + CodeInfo.encode(message.codeInfo, writer.uint32(18).fork()).ldelim(); + } + if (message.codeBytes.length !== 0) { + writer.uint32(26).bytes(message.codeBytes); + } + if (message.pinned === true) { + writer.uint32(32).bool(message.pinned); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Code { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCode } as Code; + message.codeBytes = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64() as Long; + break; + case 2: + message.codeInfo = CodeInfo.decode(reader, reader.uint32()); + break; + case 3: + message.codeBytes = reader.bytes(); + break; + case 4: + message.pinned = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Code { + const message = { ...baseCode } as Code; + message.codeBytes = new Uint8Array(); + if (object.codeId !== undefined && object.codeId !== null) { + message.codeId = Long.fromString(object.codeId); + } else { + message.codeId = Long.UZERO; + } + if (object.codeInfo !== undefined && object.codeInfo !== null) { + message.codeInfo = CodeInfo.fromJSON(object.codeInfo); + } else { + message.codeInfo = undefined; + } + if (object.codeBytes !== undefined && object.codeBytes !== null) { + message.codeBytes = bytesFromBase64(object.codeBytes); + } + if (object.pinned !== undefined && object.pinned !== null) { + message.pinned = Boolean(object.pinned); + } else { + message.pinned = false; + } + return message; + }, + + toJSON(message: Code): unknown { + const obj: any = {}; + message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); + message.codeInfo !== undefined && + (obj.codeInfo = message.codeInfo ? CodeInfo.toJSON(message.codeInfo) : undefined); + message.codeBytes !== undefined && + (obj.codeBytes = base64FromBytes( + message.codeBytes !== undefined ? message.codeBytes : new Uint8Array(), + )); + message.pinned !== undefined && (obj.pinned = message.pinned); + return obj; + }, + + fromPartial(object: DeepPartial): Code { + const message = { ...baseCode } as Code; + if (object.codeId !== undefined && object.codeId !== null) { + message.codeId = object.codeId as Long; + } else { + message.codeId = Long.UZERO; + } + if (object.codeInfo !== undefined && object.codeInfo !== null) { + message.codeInfo = CodeInfo.fromPartial(object.codeInfo); + } else { + message.codeInfo = undefined; + } + if (object.codeBytes !== undefined && object.codeBytes !== null) { + message.codeBytes = object.codeBytes; + } else { + message.codeBytes = new Uint8Array(); + } + if (object.pinned !== undefined && object.pinned !== null) { + message.pinned = object.pinned; + } else { + message.pinned = false; + } + return message; + }, +}; + +const baseContract: object = { contractAddress: "" }; + +export const Contract = { + encode(message: Contract, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + if (message.contractInfo !== undefined) { + ContractInfo.encode(message.contractInfo, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.contractState) { + Model.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Contract { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseContract } as Contract; + message.contractState = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + case 2: + message.contractInfo = ContractInfo.decode(reader, reader.uint32()); + break; + case 3: + message.contractState.push(Model.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Contract { + const message = { ...baseContract } as Contract; + message.contractState = []; + if (object.contractAddress !== undefined && object.contractAddress !== null) { + message.contractAddress = String(object.contractAddress); + } else { + message.contractAddress = ""; + } + if (object.contractInfo !== undefined && object.contractInfo !== null) { + message.contractInfo = ContractInfo.fromJSON(object.contractInfo); + } else { + message.contractInfo = undefined; + } + if (object.contractState !== undefined && object.contractState !== null) { + for (const e of object.contractState) { + message.contractState.push(Model.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: Contract): unknown { + const obj: any = {}; + message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); + message.contractInfo !== undefined && + (obj.contractInfo = message.contractInfo ? ContractInfo.toJSON(message.contractInfo) : undefined); + if (message.contractState) { + obj.contractState = message.contractState.map((e) => (e ? Model.toJSON(e) : undefined)); + } else { + obj.contractState = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): Contract { + const message = { ...baseContract } as Contract; + message.contractState = []; + if (object.contractAddress !== undefined && object.contractAddress !== null) { + message.contractAddress = object.contractAddress; + } else { + message.contractAddress = ""; + } + if (object.contractInfo !== undefined && object.contractInfo !== null) { + message.contractInfo = ContractInfo.fromPartial(object.contractInfo); + } else { + message.contractInfo = undefined; + } + if (object.contractState !== undefined && object.contractState !== null) { + for (const e of object.contractState) { + message.contractState.push(Model.fromPartial(e)); + } + } + return message; + }, +}; + +const baseSequence: object = { value: Long.UZERO }; + +export const Sequence = { + encode(message: Sequence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.idKey.length !== 0) { + writer.uint32(10).bytes(message.idKey); + } + if (!message.value.isZero()) { + writer.uint32(16).uint64(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Sequence { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSequence } as Sequence; + message.idKey = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.idKey = reader.bytes(); + break; + case 2: + message.value = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Sequence { + const message = { ...baseSequence } as Sequence; + message.idKey = new Uint8Array(); + if (object.idKey !== undefined && object.idKey !== null) { + message.idKey = bytesFromBase64(object.idKey); + } + if (object.value !== undefined && object.value !== null) { + message.value = Long.fromString(object.value); + } else { + message.value = Long.UZERO; + } + return message; + }, + + toJSON(message: Sequence): unknown { + const obj: any = {}; + message.idKey !== undefined && + (obj.idKey = base64FromBytes(message.idKey !== undefined ? message.idKey : new Uint8Array())); + message.value !== undefined && (obj.value = (message.value || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): Sequence { + const message = { ...baseSequence } as Sequence; + if (object.idKey !== undefined && object.idKey !== null) { + message.idKey = object.idKey; + } else { + message.idKey = new Uint8Array(); + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value as Long; + } else { + message.value = Long.UZERO; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmwasm/wasm/v1beta1/ibc.ts b/src/cosmwasm/wasm/v1beta1/ibc.ts new file mode 100644 index 00000000..f80aac8d --- /dev/null +++ b/src/cosmwasm/wasm/v1beta1/ibc.ts @@ -0,0 +1,239 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "cosmwasm.wasm.v1beta1"; + +/** MsgIBCSend */ +export interface MsgIBCSend { + /** the channel by which the packet will be sent */ + channel: string; + /** + * Timeout height relative to the current block height. + * The timeout is disabled when set to 0. + */ + timeoutHeight: Long; + /** + * Timeout timestamp (in nanoseconds) relative to the current block timestamp. + * The timeout is disabled when set to 0. + */ + timeoutTimestamp: Long; + /** data is the payload to transfer */ + data: Uint8Array; +} + +/** MsgIBCCloseChannel port and channel need to be owned by the contract */ +export interface MsgIBCCloseChannel { + channel: string; +} + +const baseMsgIBCSend: object = { channel: "", timeoutHeight: Long.UZERO, timeoutTimestamp: Long.UZERO }; + +export const MsgIBCSend = { + encode(message: MsgIBCSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.channel !== "") { + writer.uint32(18).string(message.channel); + } + if (!message.timeoutHeight.isZero()) { + writer.uint32(32).uint64(message.timeoutHeight); + } + if (!message.timeoutTimestamp.isZero()) { + writer.uint32(40).uint64(message.timeoutTimestamp); + } + if (message.data.length !== 0) { + writer.uint32(50).bytes(message.data); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgIBCSend { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgIBCSend } as MsgIBCSend; + message.data = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.channel = reader.string(); + break; + case 4: + message.timeoutHeight = reader.uint64() as Long; + break; + case 5: + message.timeoutTimestamp = reader.uint64() as Long; + break; + case 6: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgIBCSend { + const message = { ...baseMsgIBCSend } as MsgIBCSend; + message.data = new Uint8Array(); + if (object.channel !== undefined && object.channel !== null) { + message.channel = String(object.channel); + } else { + message.channel = ""; + } + if (object.timeoutHeight !== undefined && object.timeoutHeight !== null) { + message.timeoutHeight = Long.fromString(object.timeoutHeight); + } else { + message.timeoutHeight = Long.UZERO; + } + if (object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null) { + message.timeoutTimestamp = Long.fromString(object.timeoutTimestamp); + } else { + message.timeoutTimestamp = Long.UZERO; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + + toJSON(message: MsgIBCSend): unknown { + const obj: any = {}; + message.channel !== undefined && (obj.channel = message.channel); + message.timeoutHeight !== undefined && + (obj.timeoutHeight = (message.timeoutHeight || Long.UZERO).toString()); + message.timeoutTimestamp !== undefined && + (obj.timeoutTimestamp = (message.timeoutTimestamp || Long.UZERO).toString()); + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): MsgIBCSend { + const message = { ...baseMsgIBCSend } as MsgIBCSend; + if (object.channel !== undefined && object.channel !== null) { + message.channel = object.channel; + } else { + message.channel = ""; + } + if (object.timeoutHeight !== undefined && object.timeoutHeight !== null) { + message.timeoutHeight = object.timeoutHeight as Long; + } else { + message.timeoutHeight = Long.UZERO; + } + if (object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null) { + message.timeoutTimestamp = object.timeoutTimestamp as Long; + } else { + message.timeoutTimestamp = Long.UZERO; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + return message; + }, +}; + +const baseMsgIBCCloseChannel: object = { channel: "" }; + +export const MsgIBCCloseChannel = { + encode(message: MsgIBCCloseChannel, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.channel !== "") { + writer.uint32(18).string(message.channel); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgIBCCloseChannel { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgIBCCloseChannel } as MsgIBCCloseChannel; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.channel = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgIBCCloseChannel { + const message = { ...baseMsgIBCCloseChannel } as MsgIBCCloseChannel; + if (object.channel !== undefined && object.channel !== null) { + message.channel = String(object.channel); + } else { + message.channel = ""; + } + return message; + }, + + toJSON(message: MsgIBCCloseChannel): unknown { + const obj: any = {}; + message.channel !== undefined && (obj.channel = message.channel); + return obj; + }, + + fromPartial(object: DeepPartial): MsgIBCCloseChannel { + const message = { ...baseMsgIBCCloseChannel } as MsgIBCCloseChannel; + if (object.channel !== undefined && object.channel !== null) { + message.channel = object.channel; + } else { + message.channel = ""; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmwasm/wasm/v1beta1/proposal.ts b/src/cosmwasm/wasm/v1beta1/proposal.ts new file mode 100644 index 00000000..f7a4d143 --- /dev/null +++ b/src/cosmwasm/wasm/v1beta1/proposal.ts @@ -0,0 +1,1071 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { AccessConfig } from "../../../cosmwasm/wasm/v1beta1/types"; +import { Coin } from "../../../cosmos/base/v1beta1/coin"; + +export const protobufPackage = "cosmwasm.wasm.v1beta1"; + +/** StoreCodeProposal gov proposal content type to submit WASM code to the system */ +export interface StoreCodeProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + runAs: string; + /** WASMByteCode can be raw or gzip compressed */ + wasmByteCode: Uint8Array; + /** + * Source is a valid absolute HTTPS URI to the contract's source code, + * optional + */ + source: string; + /** Builder is a valid docker image name with tag, optional */ + builder: string; + /** InstantiatePermission to apply on contract creation, optional */ + instantiatePermission?: AccessConfig; +} + +/** + * InstantiateContractProposal gov proposal content type to instantiate a + * contract. + */ +export interface InstantiateContractProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + runAs: string; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** CodeID is the reference to the stored WASM code */ + codeId: Long; + /** Label is optional metadata to be stored with a constract instance. */ + label: string; + /** InitMsg json encoded message to be passed to the contract on instantiation */ + initMsg: Uint8Array; + /** Funds coins that are transferred to the contract on instantiation */ + funds: Coin[]; +} + +/** MigrateContractProposal gov proposal content type to migrate a contract. */ +export interface MigrateContractProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + runAs: string; + /** Contract is the address of the smart contract */ + contract: string; + /** CodeID references the new WASM code */ + codeId: Long; + /** MigrateMsg json encoded message to be passed to the contract on migration */ + migrateMsg: Uint8Array; +} + +/** UpdateAdminProposal gov proposal content type to set an admin for a contract. */ +export interface UpdateAdminProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** NewAdmin address to be set */ + newAdmin: string; + /** Contract is the address of the smart contract */ + contract: string; +} + +/** + * ClearAdminProposal gov proposal content type to clear the admin of a + * contract. + */ +export interface ClearAdminProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** Contract is the address of the smart contract */ + contract: string; +} + +/** + * PinCodesProposal gov proposal content type to pin a set of code ids in the + * wasmvm cache. + */ +export interface PinCodesProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** CodeIDs references the new WASM codes */ + codeIds: Long[]; +} + +/** + * UnpinCodesProposal gov proposal content type to unpin a set of code ids in + * the wasmvm cache. + */ +export interface UnpinCodesProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** CodeIDs references the WASM codes */ + codeIds: Long[]; +} + +const baseStoreCodeProposal: object = { title: "", description: "", runAs: "", source: "", builder: "" }; + +export const StoreCodeProposal = { + encode(message: StoreCodeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.runAs !== "") { + writer.uint32(26).string(message.runAs); + } + if (message.wasmByteCode.length !== 0) { + writer.uint32(34).bytes(message.wasmByteCode); + } + if (message.source !== "") { + writer.uint32(42).string(message.source); + } + if (message.builder !== "") { + writer.uint32(50).string(message.builder); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StoreCodeProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseStoreCodeProposal } as StoreCodeProposal; + message.wasmByteCode = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.runAs = reader.string(); + break; + case 4: + message.wasmByteCode = reader.bytes(); + break; + case 5: + message.source = reader.string(); + break; + case 6: + message.builder = reader.string(); + break; + case 7: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): StoreCodeProposal { + const message = { ...baseStoreCodeProposal } as StoreCodeProposal; + message.wasmByteCode = new Uint8Array(); + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.runAs !== undefined && object.runAs !== null) { + message.runAs = String(object.runAs); + } else { + message.runAs = ""; + } + if (object.wasmByteCode !== undefined && object.wasmByteCode !== null) { + message.wasmByteCode = bytesFromBase64(object.wasmByteCode); + } + if (object.source !== undefined && object.source !== null) { + message.source = String(object.source); + } else { + message.source = ""; + } + if (object.builder !== undefined && object.builder !== null) { + message.builder = String(object.builder); + } else { + message.builder = ""; + } + if (object.instantiatePermission !== undefined && object.instantiatePermission !== null) { + message.instantiatePermission = AccessConfig.fromJSON(object.instantiatePermission); + } else { + message.instantiatePermission = undefined; + } + return message; + }, + + toJSON(message: StoreCodeProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.runAs !== undefined && (obj.runAs = message.runAs); + message.wasmByteCode !== undefined && + (obj.wasmByteCode = base64FromBytes( + message.wasmByteCode !== undefined ? message.wasmByteCode : new Uint8Array(), + )); + message.source !== undefined && (obj.source = message.source); + message.builder !== undefined && (obj.builder = message.builder); + message.instantiatePermission !== undefined && + (obj.instantiatePermission = message.instantiatePermission + ? AccessConfig.toJSON(message.instantiatePermission) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): StoreCodeProposal { + const message = { ...baseStoreCodeProposal } as StoreCodeProposal; + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.runAs !== undefined && object.runAs !== null) { + message.runAs = object.runAs; + } else { + message.runAs = ""; + } + if (object.wasmByteCode !== undefined && object.wasmByteCode !== null) { + message.wasmByteCode = object.wasmByteCode; + } else { + message.wasmByteCode = new Uint8Array(); + } + if (object.source !== undefined && object.source !== null) { + message.source = object.source; + } else { + message.source = ""; + } + if (object.builder !== undefined && object.builder !== null) { + message.builder = object.builder; + } else { + message.builder = ""; + } + if (object.instantiatePermission !== undefined && object.instantiatePermission !== null) { + message.instantiatePermission = AccessConfig.fromPartial(object.instantiatePermission); + } else { + message.instantiatePermission = undefined; + } + return message; + }, +}; + +const baseInstantiateContractProposal: object = { + title: "", + description: "", + runAs: "", + admin: "", + codeId: Long.UZERO, + label: "", +}; + +export const InstantiateContractProposal = { + encode(message: InstantiateContractProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.runAs !== "") { + writer.uint32(26).string(message.runAs); + } + if (message.admin !== "") { + writer.uint32(34).string(message.admin); + } + if (!message.codeId.isZero()) { + writer.uint32(40).uint64(message.codeId); + } + if (message.label !== "") { + writer.uint32(50).string(message.label); + } + if (message.initMsg.length !== 0) { + writer.uint32(58).bytes(message.initMsg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(66).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InstantiateContractProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseInstantiateContractProposal } as InstantiateContractProposal; + message.funds = []; + message.initMsg = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.runAs = reader.string(); + break; + case 4: + message.admin = reader.string(); + break; + case 5: + message.codeId = reader.uint64() as Long; + break; + case 6: + message.label = reader.string(); + break; + case 7: + message.initMsg = reader.bytes(); + break; + case 8: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): InstantiateContractProposal { + const message = { ...baseInstantiateContractProposal } as InstantiateContractProposal; + message.funds = []; + message.initMsg = new Uint8Array(); + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.runAs !== undefined && object.runAs !== null) { + message.runAs = String(object.runAs); + } else { + message.runAs = ""; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = String(object.admin); + } else { + message.admin = ""; + } + if (object.codeId !== undefined && object.codeId !== null) { + message.codeId = Long.fromString(object.codeId); + } else { + message.codeId = Long.UZERO; + } + if (object.label !== undefined && object.label !== null) { + message.label = String(object.label); + } else { + message.label = ""; + } + if (object.initMsg !== undefined && object.initMsg !== null) { + message.initMsg = bytesFromBase64(object.initMsg); + } + if (object.funds !== undefined && object.funds !== null) { + for (const e of object.funds) { + message.funds.push(Coin.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: InstantiateContractProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.runAs !== undefined && (obj.runAs = message.runAs); + message.admin !== undefined && (obj.admin = message.admin); + message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); + message.label !== undefined && (obj.label = message.label); + message.initMsg !== undefined && + (obj.initMsg = base64FromBytes(message.initMsg !== undefined ? message.initMsg : new Uint8Array())); + if (message.funds) { + obj.funds = message.funds.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.funds = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): InstantiateContractProposal { + const message = { ...baseInstantiateContractProposal } as InstantiateContractProposal; + message.funds = []; + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.runAs !== undefined && object.runAs !== null) { + message.runAs = object.runAs; + } else { + message.runAs = ""; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } else { + message.admin = ""; + } + if (object.codeId !== undefined && object.codeId !== null) { + message.codeId = object.codeId as Long; + } else { + message.codeId = Long.UZERO; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } else { + message.label = ""; + } + if (object.initMsg !== undefined && object.initMsg !== null) { + message.initMsg = object.initMsg; + } else { + message.initMsg = new Uint8Array(); + } + if (object.funds !== undefined && object.funds !== null) { + for (const e of object.funds) { + message.funds.push(Coin.fromPartial(e)); + } + } + return message; + }, +}; + +const baseMigrateContractProposal: object = { + title: "", + description: "", + runAs: "", + contract: "", + codeId: Long.UZERO, +}; + +export const MigrateContractProposal = { + encode(message: MigrateContractProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.runAs !== "") { + writer.uint32(26).string(message.runAs); + } + if (message.contract !== "") { + writer.uint32(34).string(message.contract); + } + if (!message.codeId.isZero()) { + writer.uint32(40).uint64(message.codeId); + } + if (message.migrateMsg.length !== 0) { + writer.uint32(50).bytes(message.migrateMsg); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MigrateContractProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMigrateContractProposal } as MigrateContractProposal; + message.migrateMsg = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.runAs = reader.string(); + break; + case 4: + message.contract = reader.string(); + break; + case 5: + message.codeId = reader.uint64() as Long; + break; + case 6: + message.migrateMsg = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MigrateContractProposal { + const message = { ...baseMigrateContractProposal } as MigrateContractProposal; + message.migrateMsg = new Uint8Array(); + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.runAs !== undefined && object.runAs !== null) { + message.runAs = String(object.runAs); + } else { + message.runAs = ""; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = String(object.contract); + } else { + message.contract = ""; + } + if (object.codeId !== undefined && object.codeId !== null) { + message.codeId = Long.fromString(object.codeId); + } else { + message.codeId = Long.UZERO; + } + if (object.migrateMsg !== undefined && object.migrateMsg !== null) { + message.migrateMsg = bytesFromBase64(object.migrateMsg); + } + return message; + }, + + toJSON(message: MigrateContractProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.runAs !== undefined && (obj.runAs = message.runAs); + message.contract !== undefined && (obj.contract = message.contract); + message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); + message.migrateMsg !== undefined && + (obj.migrateMsg = base64FromBytes( + message.migrateMsg !== undefined ? message.migrateMsg : new Uint8Array(), + )); + return obj; + }, + + fromPartial(object: DeepPartial): MigrateContractProposal { + const message = { ...baseMigrateContractProposal } as MigrateContractProposal; + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.runAs !== undefined && object.runAs !== null) { + message.runAs = object.runAs; + } else { + message.runAs = ""; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } else { + message.contract = ""; + } + if (object.codeId !== undefined && object.codeId !== null) { + message.codeId = object.codeId as Long; + } else { + message.codeId = Long.UZERO; + } + if (object.migrateMsg !== undefined && object.migrateMsg !== null) { + message.migrateMsg = object.migrateMsg; + } else { + message.migrateMsg = new Uint8Array(); + } + return message; + }, +}; + +const baseUpdateAdminProposal: object = { title: "", description: "", newAdmin: "", contract: "" }; + +export const UpdateAdminProposal = { + encode(message: UpdateAdminProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.newAdmin !== "") { + writer.uint32(26).string(message.newAdmin); + } + if (message.contract !== "") { + writer.uint32(34).string(message.contract); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateAdminProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUpdateAdminProposal } as UpdateAdminProposal; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.newAdmin = reader.string(); + break; + case 4: + message.contract = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateAdminProposal { + const message = { ...baseUpdateAdminProposal } as UpdateAdminProposal; + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.newAdmin !== undefined && object.newAdmin !== null) { + message.newAdmin = String(object.newAdmin); + } else { + message.newAdmin = ""; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = String(object.contract); + } else { + message.contract = ""; + } + return message; + }, + + toJSON(message: UpdateAdminProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.newAdmin !== undefined && (obj.newAdmin = message.newAdmin); + message.contract !== undefined && (obj.contract = message.contract); + return obj; + }, + + fromPartial(object: DeepPartial): UpdateAdminProposal { + const message = { ...baseUpdateAdminProposal } as UpdateAdminProposal; + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.newAdmin !== undefined && object.newAdmin !== null) { + message.newAdmin = object.newAdmin; + } else { + message.newAdmin = ""; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } else { + message.contract = ""; + } + return message; + }, +}; + +const baseClearAdminProposal: object = { title: "", description: "", contract: "" }; + +export const ClearAdminProposal = { + encode(message: ClearAdminProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.contract !== "") { + writer.uint32(26).string(message.contract); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ClearAdminProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseClearAdminProposal } as ClearAdminProposal; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.contract = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ClearAdminProposal { + const message = { ...baseClearAdminProposal } as ClearAdminProposal; + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = String(object.contract); + } else { + message.contract = ""; + } + return message; + }, + + toJSON(message: ClearAdminProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.contract !== undefined && (obj.contract = message.contract); + return obj; + }, + + fromPartial(object: DeepPartial): ClearAdminProposal { + const message = { ...baseClearAdminProposal } as ClearAdminProposal; + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } else { + message.contract = ""; + } + return message; + }, +}; + +const basePinCodesProposal: object = { title: "", description: "", codeIds: Long.UZERO }; + +export const PinCodesProposal = { + encode(message: PinCodesProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.codeIds) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PinCodesProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePinCodesProposal } as PinCodesProposal; + message.codeIds = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.codeIds.push(reader.uint64() as Long); + } + } else { + message.codeIds.push(reader.uint64() as Long); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PinCodesProposal { + const message = { ...basePinCodesProposal } as PinCodesProposal; + message.codeIds = []; + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.codeIds !== undefined && object.codeIds !== null) { + for (const e of object.codeIds) { + message.codeIds.push(Long.fromString(e)); + } + } + return message; + }, + + toJSON(message: PinCodesProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + if (message.codeIds) { + obj.codeIds = message.codeIds.map((e) => (e || Long.UZERO).toString()); + } else { + obj.codeIds = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): PinCodesProposal { + const message = { ...basePinCodesProposal } as PinCodesProposal; + message.codeIds = []; + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.codeIds !== undefined && object.codeIds !== null) { + for (const e of object.codeIds) { + message.codeIds.push(e); + } + } + return message; + }, +}; + +const baseUnpinCodesProposal: object = { title: "", description: "", codeIds: Long.UZERO }; + +export const UnpinCodesProposal = { + encode(message: UnpinCodesProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.codeIds) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UnpinCodesProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUnpinCodesProposal } as UnpinCodesProposal; + message.codeIds = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.codeIds.push(reader.uint64() as Long); + } + } else { + message.codeIds.push(reader.uint64() as Long); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UnpinCodesProposal { + const message = { ...baseUnpinCodesProposal } as UnpinCodesProposal; + message.codeIds = []; + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.codeIds !== undefined && object.codeIds !== null) { + for (const e of object.codeIds) { + message.codeIds.push(Long.fromString(e)); + } + } + return message; + }, + + toJSON(message: UnpinCodesProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + if (message.codeIds) { + obj.codeIds = message.codeIds.map((e) => (e || Long.UZERO).toString()); + } else { + obj.codeIds = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): UnpinCodesProposal { + const message = { ...baseUnpinCodesProposal } as UnpinCodesProposal; + message.codeIds = []; + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.codeIds !== undefined && object.codeIds !== null) { + for (const e of object.codeIds) { + message.codeIds.push(e); + } + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmwasm/wasm/v1beta1/query.ts b/src/cosmwasm/wasm/v1beta1/query.ts new file mode 100644 index 00000000..cedef7c4 --- /dev/null +++ b/src/cosmwasm/wasm/v1beta1/query.ts @@ -0,0 +1,1535 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { ContractInfo, ContractCodeHistoryEntry, Model } from "../../../cosmwasm/wasm/v1beta1/types"; +import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; + +export const protobufPackage = "cosmwasm.wasm.v1beta1"; + +/** + * QueryContractInfoRequest is the request type for the Query/ContractInfo RPC + * method + */ +export interface QueryContractInfoRequest { + /** address is the address of the contract to query */ + address: string; +} + +/** + * QueryContractInfoResponse is the response type for the Query/ContractInfo RPC + * method + */ +export interface QueryContractInfoResponse { + /** address is the address of the contract */ + address: string; + contractInfo?: ContractInfo; +} + +/** + * QueryContractHistoryRequest is the request type for the Query/ContractHistory + * RPC method + */ +export interface QueryContractHistoryRequest { + /** address is the address of the contract to query */ + address: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} + +/** + * QueryContractHistoryResponse is the response type for the + * Query/ContractHistory RPC method + */ +export interface QueryContractHistoryResponse { + entries: ContractCodeHistoryEntry[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} + +/** + * QueryContractsByCodeRequest is the request type for the Query/ContractsByCode + * RPC method + */ +export interface QueryContractsByCodeRequest { + /** grpc-gateway_out does not support Go style CodID */ + codeId: Long; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} + +/** + * QueryContractsByCodeResponse is the response type for the + * Query/ContractsByCode RPC method + */ +export interface QueryContractsByCodeResponse { + /** contracts are a set of contract addresses */ + contracts: string[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} + +/** + * QueryAllContractStateRequest is the request type for the + * Query/AllContractState RPC method + */ +export interface QueryAllContractStateRequest { + /** address is the address of the contract */ + address: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} + +/** + * QueryAllContractStateResponse is the response type for the + * Query/AllContractState RPC method + */ +export interface QueryAllContractStateResponse { + models: Model[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} + +/** + * QueryRawContractStateRequest is the request type for the + * Query/RawContractState RPC method + */ +export interface QueryRawContractStateRequest { + /** address is the address of the contract */ + address: string; + queryData: Uint8Array; +} + +/** + * QueryRawContractStateResponse is the response type for the + * Query/RawContractState RPC method + */ +export interface QueryRawContractStateResponse { + /** Data contains the raw store data */ + data: Uint8Array; +} + +/** + * QuerySmartContractStateRequest is the request type for the + * Query/SmartContractState RPC method + */ +export interface QuerySmartContractStateRequest { + /** address is the address of the contract */ + address: string; + /** QueryData contains the query data passed to the contract */ + queryData: Uint8Array; +} + +/** + * QuerySmartContractStateResponse is the response type for the + * Query/SmartContractState RPC method + */ +export interface QuerySmartContractStateResponse { + /** Data contains the json data returned from the smart contract */ + data: Uint8Array; +} + +/** QueryCodeRequest is the request type for the Query/Code RPC method */ +export interface QueryCodeRequest { + /** grpc-gateway_out does not support Go style CodID */ + codeId: Long; +} + +/** CodeInfoResponse contains code meta data from CodeInfo */ +export interface CodeInfoResponse { + /** id for legacy support */ + codeId: Long; + creator: string; + dataHash: Uint8Array; + source: string; + builder: string; +} + +/** QueryCodeResponse is the response type for the Query/Code RPC method */ +export interface QueryCodeResponse { + codeInfo?: CodeInfoResponse; + data: Uint8Array; +} + +/** QueryCodesRequest is the request type for the Query/Codes RPC method */ +export interface QueryCodesRequest { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} + +/** QueryCodesResponse is the response type for the Query/Codes RPC method */ +export interface QueryCodesResponse { + codeInfos: CodeInfoResponse[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} + +const baseQueryContractInfoRequest: object = { address: "" }; + +export const QueryContractInfoRequest = { + encode(message: QueryContractInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractInfoRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryContractInfoRequest } as QueryContractInfoRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryContractInfoRequest { + const message = { ...baseQueryContractInfoRequest } as QueryContractInfoRequest; + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + return message; + }, + + toJSON(message: QueryContractInfoRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + return obj; + }, + + fromPartial(object: DeepPartial): QueryContractInfoRequest { + const message = { ...baseQueryContractInfoRequest } as QueryContractInfoRequest; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + return message; + }, +}; + +const baseQueryContractInfoResponse: object = { address: "" }; + +export const QueryContractInfoResponse = { + encode(message: QueryContractInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.contractInfo !== undefined) { + ContractInfo.encode(message.contractInfo, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractInfoResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryContractInfoResponse } as QueryContractInfoResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.contractInfo = ContractInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryContractInfoResponse { + const message = { ...baseQueryContractInfoResponse } as QueryContractInfoResponse; + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.contractInfo !== undefined && object.contractInfo !== null) { + message.contractInfo = ContractInfo.fromJSON(object.contractInfo); + } else { + message.contractInfo = undefined; + } + return message; + }, + + toJSON(message: QueryContractInfoResponse): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.contractInfo !== undefined && + (obj.contractInfo = message.contractInfo ? ContractInfo.toJSON(message.contractInfo) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryContractInfoResponse { + const message = { ...baseQueryContractInfoResponse } as QueryContractInfoResponse; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.contractInfo !== undefined && object.contractInfo !== null) { + message.contractInfo = ContractInfo.fromPartial(object.contractInfo); + } else { + message.contractInfo = undefined; + } + return message; + }, +}; + +const baseQueryContractHistoryRequest: object = { address: "" }; + +export const QueryContractHistoryRequest = { + encode(message: QueryContractHistoryRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractHistoryRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryContractHistoryRequest } as QueryContractHistoryRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryContractHistoryRequest { + const message = { ...baseQueryContractHistoryRequest } as QueryContractHistoryRequest; + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryContractHistoryRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryContractHistoryRequest { + const message = { ...baseQueryContractHistoryRequest } as QueryContractHistoryRequest; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryContractHistoryResponse: object = {}; + +export const QueryContractHistoryResponse = { + encode(message: QueryContractHistoryResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.entries) { + ContractCodeHistoryEntry.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractHistoryResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryContractHistoryResponse } as QueryContractHistoryResponse; + message.entries = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.entries.push(ContractCodeHistoryEntry.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryContractHistoryResponse { + const message = { ...baseQueryContractHistoryResponse } as QueryContractHistoryResponse; + message.entries = []; + if (object.entries !== undefined && object.entries !== null) { + for (const e of object.entries) { + message.entries.push(ContractCodeHistoryEntry.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryContractHistoryResponse): unknown { + const obj: any = {}; + if (message.entries) { + obj.entries = message.entries.map((e) => (e ? ContractCodeHistoryEntry.toJSON(e) : undefined)); + } else { + obj.entries = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryContractHistoryResponse { + const message = { ...baseQueryContractHistoryResponse } as QueryContractHistoryResponse; + message.entries = []; + if (object.entries !== undefined && object.entries !== null) { + for (const e of object.entries) { + message.entries.push(ContractCodeHistoryEntry.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryContractsByCodeRequest: object = { codeId: Long.UZERO }; + +export const QueryContractsByCodeRequest = { + encode(message: QueryContractsByCodeRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.codeId.isZero()) { + writer.uint32(8).uint64(message.codeId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractsByCodeRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryContractsByCodeRequest } as QueryContractsByCodeRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64() as Long; + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryContractsByCodeRequest { + const message = { ...baseQueryContractsByCodeRequest } as QueryContractsByCodeRequest; + if (object.codeId !== undefined && object.codeId !== null) { + message.codeId = Long.fromString(object.codeId); + } else { + message.codeId = Long.UZERO; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryContractsByCodeRequest): unknown { + const obj: any = {}; + message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryContractsByCodeRequest { + const message = { ...baseQueryContractsByCodeRequest } as QueryContractsByCodeRequest; + if (object.codeId !== undefined && object.codeId !== null) { + message.codeId = object.codeId as Long; + } else { + message.codeId = Long.UZERO; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryContractsByCodeResponse: object = { contracts: "" }; + +export const QueryContractsByCodeResponse = { + encode(message: QueryContractsByCodeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.contracts) { + writer.uint32(10).string(v!); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractsByCodeResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryContractsByCodeResponse } as QueryContractsByCodeResponse; + message.contracts = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contracts.push(reader.string()); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryContractsByCodeResponse { + const message = { ...baseQueryContractsByCodeResponse } as QueryContractsByCodeResponse; + message.contracts = []; + if (object.contracts !== undefined && object.contracts !== null) { + for (const e of object.contracts) { + message.contracts.push(String(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryContractsByCodeResponse): unknown { + const obj: any = {}; + if (message.contracts) { + obj.contracts = message.contracts.map((e) => e); + } else { + obj.contracts = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryContractsByCodeResponse { + const message = { ...baseQueryContractsByCodeResponse } as QueryContractsByCodeResponse; + message.contracts = []; + if (object.contracts !== undefined && object.contracts !== null) { + for (const e of object.contracts) { + message.contracts.push(e); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryAllContractStateRequest: object = { address: "" }; + +export const QueryAllContractStateRequest = { + encode(message: QueryAllContractStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllContractStateRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryAllContractStateRequest } as QueryAllContractStateRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllContractStateRequest { + const message = { ...baseQueryAllContractStateRequest } as QueryAllContractStateRequest; + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryAllContractStateRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryAllContractStateRequest { + const message = { ...baseQueryAllContractStateRequest } as QueryAllContractStateRequest; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryAllContractStateResponse: object = {}; + +export const QueryAllContractStateResponse = { + encode(message: QueryAllContractStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.models) { + Model.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllContractStateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryAllContractStateResponse } as QueryAllContractStateResponse; + message.models = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.models.push(Model.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllContractStateResponse { + const message = { ...baseQueryAllContractStateResponse } as QueryAllContractStateResponse; + message.models = []; + if (object.models !== undefined && object.models !== null) { + for (const e of object.models) { + message.models.push(Model.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryAllContractStateResponse): unknown { + const obj: any = {}; + if (message.models) { + obj.models = message.models.map((e) => (e ? Model.toJSON(e) : undefined)); + } else { + obj.models = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryAllContractStateResponse { + const message = { ...baseQueryAllContractStateResponse } as QueryAllContractStateResponse; + message.models = []; + if (object.models !== undefined && object.models !== null) { + for (const e of object.models) { + message.models.push(Model.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryRawContractStateRequest: object = { address: "" }; + +export const QueryRawContractStateRequest = { + encode(message: QueryRawContractStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.queryData.length !== 0) { + writer.uint32(18).bytes(message.queryData); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryRawContractStateRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryRawContractStateRequest } as QueryRawContractStateRequest; + message.queryData = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.queryData = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryRawContractStateRequest { + const message = { ...baseQueryRawContractStateRequest } as QueryRawContractStateRequest; + message.queryData = new Uint8Array(); + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.queryData !== undefined && object.queryData !== null) { + message.queryData = bytesFromBase64(object.queryData); + } + return message; + }, + + toJSON(message: QueryRawContractStateRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.queryData !== undefined && + (obj.queryData = base64FromBytes( + message.queryData !== undefined ? message.queryData : new Uint8Array(), + )); + return obj; + }, + + fromPartial(object: DeepPartial): QueryRawContractStateRequest { + const message = { ...baseQueryRawContractStateRequest } as QueryRawContractStateRequest; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.queryData !== undefined && object.queryData !== null) { + message.queryData = object.queryData; + } else { + message.queryData = new Uint8Array(); + } + return message; + }, +}; + +const baseQueryRawContractStateResponse: object = {}; + +export const QueryRawContractStateResponse = { + encode(message: QueryRawContractStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryRawContractStateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryRawContractStateResponse } as QueryRawContractStateResponse; + message.data = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryRawContractStateResponse { + const message = { ...baseQueryRawContractStateResponse } as QueryRawContractStateResponse; + message.data = new Uint8Array(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + + toJSON(message: QueryRawContractStateResponse): unknown { + const obj: any = {}; + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): QueryRawContractStateResponse { + const message = { ...baseQueryRawContractStateResponse } as QueryRawContractStateResponse; + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + return message; + }, +}; + +const baseQuerySmartContractStateRequest: object = { address: "" }; + +export const QuerySmartContractStateRequest = { + encode(message: QuerySmartContractStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.queryData.length !== 0) { + writer.uint32(18).bytes(message.queryData); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySmartContractStateRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQuerySmartContractStateRequest } as QuerySmartContractStateRequest; + message.queryData = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.queryData = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QuerySmartContractStateRequest { + const message = { ...baseQuerySmartContractStateRequest } as QuerySmartContractStateRequest; + message.queryData = new Uint8Array(); + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.queryData !== undefined && object.queryData !== null) { + message.queryData = bytesFromBase64(object.queryData); + } + return message; + }, + + toJSON(message: QuerySmartContractStateRequest): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.queryData !== undefined && + (obj.queryData = base64FromBytes( + message.queryData !== undefined ? message.queryData : new Uint8Array(), + )); + return obj; + }, + + fromPartial(object: DeepPartial): QuerySmartContractStateRequest { + const message = { ...baseQuerySmartContractStateRequest } as QuerySmartContractStateRequest; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.queryData !== undefined && object.queryData !== null) { + message.queryData = object.queryData; + } else { + message.queryData = new Uint8Array(); + } + return message; + }, +}; + +const baseQuerySmartContractStateResponse: object = {}; + +export const QuerySmartContractStateResponse = { + encode(message: QuerySmartContractStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySmartContractStateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQuerySmartContractStateResponse } as QuerySmartContractStateResponse; + message.data = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QuerySmartContractStateResponse { + const message = { ...baseQuerySmartContractStateResponse } as QuerySmartContractStateResponse; + message.data = new Uint8Array(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + + toJSON(message: QuerySmartContractStateResponse): unknown { + const obj: any = {}; + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): QuerySmartContractStateResponse { + const message = { ...baseQuerySmartContractStateResponse } as QuerySmartContractStateResponse; + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + return message; + }, +}; + +const baseQueryCodeRequest: object = { codeId: Long.UZERO }; + +export const QueryCodeRequest = { + encode(message: QueryCodeRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.codeId.isZero()) { + writer.uint32(8).uint64(message.codeId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCodeRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryCodeRequest } as QueryCodeRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryCodeRequest { + const message = { ...baseQueryCodeRequest } as QueryCodeRequest; + if (object.codeId !== undefined && object.codeId !== null) { + message.codeId = Long.fromString(object.codeId); + } else { + message.codeId = Long.UZERO; + } + return message; + }, + + toJSON(message: QueryCodeRequest): unknown { + const obj: any = {}; + message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): QueryCodeRequest { + const message = { ...baseQueryCodeRequest } as QueryCodeRequest; + if (object.codeId !== undefined && object.codeId !== null) { + message.codeId = object.codeId as Long; + } else { + message.codeId = Long.UZERO; + } + return message; + }, +}; + +const baseCodeInfoResponse: object = { codeId: Long.UZERO, creator: "", source: "", builder: "" }; + +export const CodeInfoResponse = { + encode(message: CodeInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.codeId.isZero()) { + writer.uint32(8).uint64(message.codeId); + } + if (message.creator !== "") { + writer.uint32(18).string(message.creator); + } + if (message.dataHash.length !== 0) { + writer.uint32(26).bytes(message.dataHash); + } + if (message.source !== "") { + writer.uint32(34).string(message.source); + } + if (message.builder !== "") { + writer.uint32(42).string(message.builder); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CodeInfoResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCodeInfoResponse } as CodeInfoResponse; + message.dataHash = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64() as Long; + break; + case 2: + message.creator = reader.string(); + break; + case 3: + message.dataHash = reader.bytes(); + break; + case 4: + message.source = reader.string(); + break; + case 5: + message.builder = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CodeInfoResponse { + const message = { ...baseCodeInfoResponse } as CodeInfoResponse; + message.dataHash = new Uint8Array(); + if (object.codeId !== undefined && object.codeId !== null) { + message.codeId = Long.fromString(object.codeId); + } else { + message.codeId = Long.UZERO; + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = String(object.creator); + } else { + message.creator = ""; + } + if (object.dataHash !== undefined && object.dataHash !== null) { + message.dataHash = bytesFromBase64(object.dataHash); + } + if (object.source !== undefined && object.source !== null) { + message.source = String(object.source); + } else { + message.source = ""; + } + if (object.builder !== undefined && object.builder !== null) { + message.builder = String(object.builder); + } else { + message.builder = ""; + } + return message; + }, + + toJSON(message: CodeInfoResponse): unknown { + const obj: any = {}; + message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); + message.creator !== undefined && (obj.creator = message.creator); + message.dataHash !== undefined && + (obj.dataHash = base64FromBytes(message.dataHash !== undefined ? message.dataHash : new Uint8Array())); + message.source !== undefined && (obj.source = message.source); + message.builder !== undefined && (obj.builder = message.builder); + return obj; + }, + + fromPartial(object: DeepPartial): CodeInfoResponse { + const message = { ...baseCodeInfoResponse } as CodeInfoResponse; + if (object.codeId !== undefined && object.codeId !== null) { + message.codeId = object.codeId as Long; + } else { + message.codeId = Long.UZERO; + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } else { + message.creator = ""; + } + if (object.dataHash !== undefined && object.dataHash !== null) { + message.dataHash = object.dataHash; + } else { + message.dataHash = new Uint8Array(); + } + if (object.source !== undefined && object.source !== null) { + message.source = object.source; + } else { + message.source = ""; + } + if (object.builder !== undefined && object.builder !== null) { + message.builder = object.builder; + } else { + message.builder = ""; + } + return message; + }, +}; + +const baseQueryCodeResponse: object = {}; + +export const QueryCodeResponse = { + encode(message: QueryCodeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.codeInfo !== undefined) { + CodeInfoResponse.encode(message.codeInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCodeResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryCodeResponse } as QueryCodeResponse; + message.data = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeInfo = CodeInfoResponse.decode(reader, reader.uint32()); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryCodeResponse { + const message = { ...baseQueryCodeResponse } as QueryCodeResponse; + message.data = new Uint8Array(); + if (object.codeInfo !== undefined && object.codeInfo !== null) { + message.codeInfo = CodeInfoResponse.fromJSON(object.codeInfo); + } else { + message.codeInfo = undefined; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + + toJSON(message: QueryCodeResponse): unknown { + const obj: any = {}; + message.codeInfo !== undefined && + (obj.codeInfo = message.codeInfo ? CodeInfoResponse.toJSON(message.codeInfo) : undefined); + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): QueryCodeResponse { + const message = { ...baseQueryCodeResponse } as QueryCodeResponse; + if (object.codeInfo !== undefined && object.codeInfo !== null) { + message.codeInfo = CodeInfoResponse.fromPartial(object.codeInfo); + } else { + message.codeInfo = undefined; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + return message; + }, +}; + +const baseQueryCodesRequest: object = {}; + +export const QueryCodesRequest = { + encode(message: QueryCodesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCodesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryCodesRequest } as QueryCodesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryCodesRequest { + const message = { ...baseQueryCodesRequest } as QueryCodesRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryCodesRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryCodesRequest { + const message = { ...baseQueryCodesRequest } as QueryCodesRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryCodesResponse: object = {}; + +export const QueryCodesResponse = { + encode(message: QueryCodesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.codeInfos) { + CodeInfoResponse.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCodesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryCodesResponse } as QueryCodesResponse; + message.codeInfos = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeInfos.push(CodeInfoResponse.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryCodesResponse { + const message = { ...baseQueryCodesResponse } as QueryCodesResponse; + message.codeInfos = []; + if (object.codeInfos !== undefined && object.codeInfos !== null) { + for (const e of object.codeInfos) { + message.codeInfos.push(CodeInfoResponse.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryCodesResponse): unknown { + const obj: any = {}; + if (message.codeInfos) { + obj.codeInfos = message.codeInfos.map((e) => (e ? CodeInfoResponse.toJSON(e) : undefined)); + } else { + obj.codeInfos = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryCodesResponse { + const message = { ...baseQueryCodesResponse } as QueryCodesResponse; + message.codeInfos = []; + if (object.codeInfos !== undefined && object.codeInfos !== null) { + for (const e of object.codeInfos) { + message.codeInfos.push(CodeInfoResponse.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +/** Query provides defines the gRPC querier service */ +export interface Query { + /** ContractInfo gets the contract meta data */ + ContractInfo(request: QueryContractInfoRequest): Promise; + /** ContractHistory gets the contract code history */ + ContractHistory(request: QueryContractHistoryRequest): Promise; + /** ContractsByCode lists all smart contracts for a code id */ + ContractsByCode(request: QueryContractsByCodeRequest): Promise; + /** AllContractState gets all raw store data for a single contract */ + AllContractState(request: QueryAllContractStateRequest): Promise; + /** RawContractState gets single key from the raw store data of a contract */ + RawContractState(request: QueryRawContractStateRequest): Promise; + /** SmartContractState get smart query result from the contract */ + SmartContractState(request: QuerySmartContractStateRequest): Promise; + /** Code gets the binary code and metadata for a singe wasm code */ + Code(request: QueryCodeRequest): Promise; + /** Codes gets the metadata for all stored wasm codes */ + Codes(request: QueryCodesRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.ContractInfo = this.ContractInfo.bind(this); + this.ContractHistory = this.ContractHistory.bind(this); + this.ContractsByCode = this.ContractsByCode.bind(this); + this.AllContractState = this.AllContractState.bind(this); + this.RawContractState = this.RawContractState.bind(this); + this.SmartContractState = this.SmartContractState.bind(this); + this.Code = this.Code.bind(this); + this.Codes = this.Codes.bind(this); + } + ContractInfo(request: QueryContractInfoRequest): Promise { + const data = QueryContractInfoRequest.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Query", "ContractInfo", data); + return promise.then((data) => QueryContractInfoResponse.decode(new _m0.Reader(data))); + } + + ContractHistory(request: QueryContractHistoryRequest): Promise { + const data = QueryContractHistoryRequest.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Query", "ContractHistory", data); + return promise.then((data) => QueryContractHistoryResponse.decode(new _m0.Reader(data))); + } + + ContractsByCode(request: QueryContractsByCodeRequest): Promise { + const data = QueryContractsByCodeRequest.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Query", "ContractsByCode", data); + return promise.then((data) => QueryContractsByCodeResponse.decode(new _m0.Reader(data))); + } + + AllContractState(request: QueryAllContractStateRequest): Promise { + const data = QueryAllContractStateRequest.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Query", "AllContractState", data); + return promise.then((data) => QueryAllContractStateResponse.decode(new _m0.Reader(data))); + } + + RawContractState(request: QueryRawContractStateRequest): Promise { + const data = QueryRawContractStateRequest.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Query", "RawContractState", data); + return promise.then((data) => QueryRawContractStateResponse.decode(new _m0.Reader(data))); + } + + SmartContractState(request: QuerySmartContractStateRequest): Promise { + const data = QuerySmartContractStateRequest.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Query", "SmartContractState", data); + return promise.then((data) => QuerySmartContractStateResponse.decode(new _m0.Reader(data))); + } + + Code(request: QueryCodeRequest): Promise { + const data = QueryCodeRequest.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Query", "Code", data); + return promise.then((data) => QueryCodeResponse.decode(new _m0.Reader(data))); + } + + Codes(request: QueryCodesRequest): Promise { + const data = QueryCodesRequest.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Query", "Codes", data); + return promise.then((data) => QueryCodesResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmwasm/wasm/v1beta1/tx.ts b/src/cosmwasm/wasm/v1beta1/tx.ts new file mode 100644 index 00000000..cd002f65 --- /dev/null +++ b/src/cosmwasm/wasm/v1beta1/tx.ts @@ -0,0 +1,1215 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { AccessConfig } from "../../../cosmwasm/wasm/v1beta1/types"; +import { Coin } from "../../../cosmos/base/v1beta1/coin"; + +export const protobufPackage = "cosmwasm.wasm.v1beta1"; + +/** MsgStoreCode submit Wasm code to the system */ +export interface MsgStoreCode { + /** Sender is the that actor that signed the messages */ + sender: string; + /** WASMByteCode can be raw or gzip compressed */ + wasmByteCode: Uint8Array; + /** + * Source is a valid absolute HTTPS URI to the contract's source code, + * optional + */ + source: string; + /** Builder is a valid docker image name with tag, optional */ + builder: string; + /** + * InstantiatePermission access control to apply on contract creation, + * optional + */ + instantiatePermission?: AccessConfig; +} + +/** MsgStoreCodeResponse returns store result data. */ +export interface MsgStoreCodeResponse { + /** CodeID is the reference to the stored WASM code */ + codeId: Long; +} + +/** + * MsgInstantiateContract create a new smart contract instance for the given + * code id. + */ +export interface MsgInstantiateContract { + /** Sender is the that actor that signed the messages */ + sender: string; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** CodeID is the reference to the stored WASM code */ + codeId: Long; + /** Label is optional metadata to be stored with a contract instance. */ + label: string; + /** InitMsg json encoded message to be passed to the contract on instantiation */ + initMsg: Uint8Array; + /** Funds coins that are transferred to the contract on instantiation */ + funds: Coin[]; +} + +/** MsgInstantiateContractResponse return instantiation result data */ +export interface MsgInstantiateContractResponse { + /** Address is the bech32 address of the new contract instance. */ + address: string; + /** Data contains base64-encoded bytes to returned from the contract */ + data: Uint8Array; +} + +/** MsgExecuteContract submits the given message data to a smart contract */ +export interface MsgExecuteContract { + /** Sender is the that actor that signed the messages */ + sender: string; + /** Contract is the address of the smart contract */ + contract: string; + /** Msg json encoded message to be passed to the contract */ + msg: Uint8Array; + /** Funds coins that are transferred to the contract on execution */ + funds: Coin[]; +} + +/** MsgExecuteContractResponse returns execution result data. */ +export interface MsgExecuteContractResponse { + /** Data contains base64-encoded bytes to returned from the contract */ + data: Uint8Array; +} + +/** MsgMigrateContract runs a code upgrade/ downgrade for a smart contract */ +export interface MsgMigrateContract { + /** Sender is the that actor that signed the messages */ + sender: string; + /** Contract is the address of the smart contract */ + contract: string; + /** CodeID references the new WASM code */ + codeId: Long; + /** MigrateMsg json encoded message to be passed to the contract on migration */ + migrateMsg: Uint8Array; +} + +/** MsgMigrateContractResponse returns contract migration result data. */ +export interface MsgMigrateContractResponse { + /** + * Data contains same raw bytes returned as data from the wasm contract. + * (May be empty) + */ + data: Uint8Array; +} + +/** MsgUpdateAdmin sets a new admin for a smart contract */ +export interface MsgUpdateAdmin { + /** Sender is the that actor that signed the messages */ + sender: string; + /** NewAdmin address to be set */ + newAdmin: string; + /** Contract is the address of the smart contract */ + contract: string; +} + +/** MsgUpdateAdminResponse returns empty data */ +export interface MsgUpdateAdminResponse {} + +/** MsgClearAdmin removes any admin stored for a smart contract */ +export interface MsgClearAdmin { + /** Sender is the that actor that signed the messages */ + sender: string; + /** Contract is the address of the smart contract */ + contract: string; +} + +/** MsgClearAdminResponse returns empty data */ +export interface MsgClearAdminResponse {} + +const baseMsgStoreCode: object = { sender: "", source: "", builder: "" }; + +export const MsgStoreCode = { + encode(message: MsgStoreCode, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.wasmByteCode.length !== 0) { + writer.uint32(18).bytes(message.wasmByteCode); + } + if (message.source !== "") { + writer.uint32(26).string(message.source); + } + if (message.builder !== "") { + writer.uint32(34).string(message.builder); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgStoreCode { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgStoreCode } as MsgStoreCode; + message.wasmByteCode = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.wasmByteCode = reader.bytes(); + break; + case 3: + message.source = reader.string(); + break; + case 4: + message.builder = reader.string(); + break; + case 5: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgStoreCode { + const message = { ...baseMsgStoreCode } as MsgStoreCode; + message.wasmByteCode = new Uint8Array(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = String(object.sender); + } else { + message.sender = ""; + } + if (object.wasmByteCode !== undefined && object.wasmByteCode !== null) { + message.wasmByteCode = bytesFromBase64(object.wasmByteCode); + } + if (object.source !== undefined && object.source !== null) { + message.source = String(object.source); + } else { + message.source = ""; + } + if (object.builder !== undefined && object.builder !== null) { + message.builder = String(object.builder); + } else { + message.builder = ""; + } + if (object.instantiatePermission !== undefined && object.instantiatePermission !== null) { + message.instantiatePermission = AccessConfig.fromJSON(object.instantiatePermission); + } else { + message.instantiatePermission = undefined; + } + return message; + }, + + toJSON(message: MsgStoreCode): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.wasmByteCode !== undefined && + (obj.wasmByteCode = base64FromBytes( + message.wasmByteCode !== undefined ? message.wasmByteCode : new Uint8Array(), + )); + message.source !== undefined && (obj.source = message.source); + message.builder !== undefined && (obj.builder = message.builder); + message.instantiatePermission !== undefined && + (obj.instantiatePermission = message.instantiatePermission + ? AccessConfig.toJSON(message.instantiatePermission) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): MsgStoreCode { + const message = { ...baseMsgStoreCode } as MsgStoreCode; + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } else { + message.sender = ""; + } + if (object.wasmByteCode !== undefined && object.wasmByteCode !== null) { + message.wasmByteCode = object.wasmByteCode; + } else { + message.wasmByteCode = new Uint8Array(); + } + if (object.source !== undefined && object.source !== null) { + message.source = object.source; + } else { + message.source = ""; + } + if (object.builder !== undefined && object.builder !== null) { + message.builder = object.builder; + } else { + message.builder = ""; + } + if (object.instantiatePermission !== undefined && object.instantiatePermission !== null) { + message.instantiatePermission = AccessConfig.fromPartial(object.instantiatePermission); + } else { + message.instantiatePermission = undefined; + } + return message; + }, +}; + +const baseMsgStoreCodeResponse: object = { codeId: Long.UZERO }; + +export const MsgStoreCodeResponse = { + encode(message: MsgStoreCodeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.codeId.isZero()) { + writer.uint32(8).uint64(message.codeId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgStoreCodeResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgStoreCodeResponse } as MsgStoreCodeResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgStoreCodeResponse { + const message = { ...baseMsgStoreCodeResponse } as MsgStoreCodeResponse; + if (object.codeId !== undefined && object.codeId !== null) { + message.codeId = Long.fromString(object.codeId); + } else { + message.codeId = Long.UZERO; + } + return message; + }, + + toJSON(message: MsgStoreCodeResponse): unknown { + const obj: any = {}; + message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): MsgStoreCodeResponse { + const message = { ...baseMsgStoreCodeResponse } as MsgStoreCodeResponse; + if (object.codeId !== undefined && object.codeId !== null) { + message.codeId = object.codeId as Long; + } else { + message.codeId = Long.UZERO; + } + return message; + }, +}; + +const baseMsgInstantiateContract: object = { sender: "", admin: "", codeId: Long.UZERO, label: "" }; + +export const MsgInstantiateContract = { + encode(message: MsgInstantiateContract, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.admin !== "") { + writer.uint32(18).string(message.admin); + } + if (!message.codeId.isZero()) { + writer.uint32(24).uint64(message.codeId); + } + if (message.label !== "") { + writer.uint32(34).string(message.label); + } + if (message.initMsg.length !== 0) { + writer.uint32(42).bytes(message.initMsg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgInstantiateContract { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgInstantiateContract } as MsgInstantiateContract; + message.funds = []; + message.initMsg = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.admin = reader.string(); + break; + case 3: + message.codeId = reader.uint64() as Long; + break; + case 4: + message.label = reader.string(); + break; + case 5: + message.initMsg = reader.bytes(); + break; + case 6: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgInstantiateContract { + const message = { ...baseMsgInstantiateContract } as MsgInstantiateContract; + message.funds = []; + message.initMsg = new Uint8Array(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = String(object.sender); + } else { + message.sender = ""; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = String(object.admin); + } else { + message.admin = ""; + } + if (object.codeId !== undefined && object.codeId !== null) { + message.codeId = Long.fromString(object.codeId); + } else { + message.codeId = Long.UZERO; + } + if (object.label !== undefined && object.label !== null) { + message.label = String(object.label); + } else { + message.label = ""; + } + if (object.initMsg !== undefined && object.initMsg !== null) { + message.initMsg = bytesFromBase64(object.initMsg); + } + if (object.funds !== undefined && object.funds !== null) { + for (const e of object.funds) { + message.funds.push(Coin.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: MsgInstantiateContract): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.admin !== undefined && (obj.admin = message.admin); + message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); + message.label !== undefined && (obj.label = message.label); + message.initMsg !== undefined && + (obj.initMsg = base64FromBytes(message.initMsg !== undefined ? message.initMsg : new Uint8Array())); + if (message.funds) { + obj.funds = message.funds.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.funds = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): MsgInstantiateContract { + const message = { ...baseMsgInstantiateContract } as MsgInstantiateContract; + message.funds = []; + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } else { + message.sender = ""; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } else { + message.admin = ""; + } + if (object.codeId !== undefined && object.codeId !== null) { + message.codeId = object.codeId as Long; + } else { + message.codeId = Long.UZERO; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } else { + message.label = ""; + } + if (object.initMsg !== undefined && object.initMsg !== null) { + message.initMsg = object.initMsg; + } else { + message.initMsg = new Uint8Array(); + } + if (object.funds !== undefined && object.funds !== null) { + for (const e of object.funds) { + message.funds.push(Coin.fromPartial(e)); + } + } + return message; + }, +}; + +const baseMsgInstantiateContractResponse: object = { address: "" }; + +export const MsgInstantiateContractResponse = { + encode(message: MsgInstantiateContractResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgInstantiateContractResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgInstantiateContractResponse } as MsgInstantiateContractResponse; + message.data = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgInstantiateContractResponse { + const message = { ...baseMsgInstantiateContractResponse } as MsgInstantiateContractResponse; + message.data = new Uint8Array(); + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + + toJSON(message: MsgInstantiateContractResponse): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): MsgInstantiateContractResponse { + const message = { ...baseMsgInstantiateContractResponse } as MsgInstantiateContractResponse; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + return message; + }, +}; + +const baseMsgExecuteContract: object = { sender: "", contract: "" }; + +export const MsgExecuteContract = { + encode(message: MsgExecuteContract, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contract !== "") { + writer.uint32(18).string(message.contract); + } + if (message.msg.length !== 0) { + writer.uint32(26).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgExecuteContract { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgExecuteContract } as MsgExecuteContract; + message.funds = []; + message.msg = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.contract = reader.string(); + break; + case 3: + message.msg = reader.bytes(); + break; + case 5: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgExecuteContract { + const message = { ...baseMsgExecuteContract } as MsgExecuteContract; + message.funds = []; + message.msg = new Uint8Array(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = String(object.sender); + } else { + message.sender = ""; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = String(object.contract); + } else { + message.contract = ""; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = bytesFromBase64(object.msg); + } + if (object.funds !== undefined && object.funds !== null) { + for (const e of object.funds) { + message.funds.push(Coin.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: MsgExecuteContract): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.contract !== undefined && (obj.contract = message.contract); + message.msg !== undefined && + (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + if (message.funds) { + obj.funds = message.funds.map((e) => (e ? Coin.toJSON(e) : undefined)); + } else { + obj.funds = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): MsgExecuteContract { + const message = { ...baseMsgExecuteContract } as MsgExecuteContract; + message.funds = []; + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } else { + message.sender = ""; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } else { + message.contract = ""; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = object.msg; + } else { + message.msg = new Uint8Array(); + } + if (object.funds !== undefined && object.funds !== null) { + for (const e of object.funds) { + message.funds.push(Coin.fromPartial(e)); + } + } + return message; + }, +}; + +const baseMsgExecuteContractResponse: object = {}; + +export const MsgExecuteContractResponse = { + encode(message: MsgExecuteContractResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgExecuteContractResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgExecuteContractResponse } as MsgExecuteContractResponse; + message.data = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgExecuteContractResponse { + const message = { ...baseMsgExecuteContractResponse } as MsgExecuteContractResponse; + message.data = new Uint8Array(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + + toJSON(message: MsgExecuteContractResponse): unknown { + const obj: any = {}; + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): MsgExecuteContractResponse { + const message = { ...baseMsgExecuteContractResponse } as MsgExecuteContractResponse; + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + return message; + }, +}; + +const baseMsgMigrateContract: object = { sender: "", contract: "", codeId: Long.UZERO }; + +export const MsgMigrateContract = { + encode(message: MsgMigrateContract, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contract !== "") { + writer.uint32(18).string(message.contract); + } + if (!message.codeId.isZero()) { + writer.uint32(24).uint64(message.codeId); + } + if (message.migrateMsg.length !== 0) { + writer.uint32(34).bytes(message.migrateMsg); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgMigrateContract { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgMigrateContract } as MsgMigrateContract; + message.migrateMsg = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.contract = reader.string(); + break; + case 3: + message.codeId = reader.uint64() as Long; + break; + case 4: + message.migrateMsg = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgMigrateContract { + const message = { ...baseMsgMigrateContract } as MsgMigrateContract; + message.migrateMsg = new Uint8Array(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = String(object.sender); + } else { + message.sender = ""; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = String(object.contract); + } else { + message.contract = ""; + } + if (object.codeId !== undefined && object.codeId !== null) { + message.codeId = Long.fromString(object.codeId); + } else { + message.codeId = Long.UZERO; + } + if (object.migrateMsg !== undefined && object.migrateMsg !== null) { + message.migrateMsg = bytesFromBase64(object.migrateMsg); + } + return message; + }, + + toJSON(message: MsgMigrateContract): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.contract !== undefined && (obj.contract = message.contract); + message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); + message.migrateMsg !== undefined && + (obj.migrateMsg = base64FromBytes( + message.migrateMsg !== undefined ? message.migrateMsg : new Uint8Array(), + )); + return obj; + }, + + fromPartial(object: DeepPartial): MsgMigrateContract { + const message = { ...baseMsgMigrateContract } as MsgMigrateContract; + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } else { + message.sender = ""; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } else { + message.contract = ""; + } + if (object.codeId !== undefined && object.codeId !== null) { + message.codeId = object.codeId as Long; + } else { + message.codeId = Long.UZERO; + } + if (object.migrateMsg !== undefined && object.migrateMsg !== null) { + message.migrateMsg = object.migrateMsg; + } else { + message.migrateMsg = new Uint8Array(); + } + return message; + }, +}; + +const baseMsgMigrateContractResponse: object = {}; + +export const MsgMigrateContractResponse = { + encode(message: MsgMigrateContractResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgMigrateContractResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgMigrateContractResponse } as MsgMigrateContractResponse; + message.data = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgMigrateContractResponse { + const message = { ...baseMsgMigrateContractResponse } as MsgMigrateContractResponse; + message.data = new Uint8Array(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + + toJSON(message: MsgMigrateContractResponse): unknown { + const obj: any = {}; + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): MsgMigrateContractResponse { + const message = { ...baseMsgMigrateContractResponse } as MsgMigrateContractResponse; + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + return message; + }, +}; + +const baseMsgUpdateAdmin: object = { sender: "", newAdmin: "", contract: "" }; + +export const MsgUpdateAdmin = { + encode(message: MsgUpdateAdmin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.newAdmin !== "") { + writer.uint32(18).string(message.newAdmin); + } + if (message.contract !== "") { + writer.uint32(26).string(message.contract); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateAdmin { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgUpdateAdmin } as MsgUpdateAdmin; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.newAdmin = reader.string(); + break; + case 3: + message.contract = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgUpdateAdmin { + const message = { ...baseMsgUpdateAdmin } as MsgUpdateAdmin; + if (object.sender !== undefined && object.sender !== null) { + message.sender = String(object.sender); + } else { + message.sender = ""; + } + if (object.newAdmin !== undefined && object.newAdmin !== null) { + message.newAdmin = String(object.newAdmin); + } else { + message.newAdmin = ""; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = String(object.contract); + } else { + message.contract = ""; + } + return message; + }, + + toJSON(message: MsgUpdateAdmin): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.newAdmin !== undefined && (obj.newAdmin = message.newAdmin); + message.contract !== undefined && (obj.contract = message.contract); + return obj; + }, + + fromPartial(object: DeepPartial): MsgUpdateAdmin { + const message = { ...baseMsgUpdateAdmin } as MsgUpdateAdmin; + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } else { + message.sender = ""; + } + if (object.newAdmin !== undefined && object.newAdmin !== null) { + message.newAdmin = object.newAdmin; + } else { + message.newAdmin = ""; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } else { + message.contract = ""; + } + return message; + }, +}; + +const baseMsgUpdateAdminResponse: object = {}; + +export const MsgUpdateAdminResponse = { + encode(_: MsgUpdateAdminResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateAdminResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgUpdateAdminResponse } as MsgUpdateAdminResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgUpdateAdminResponse { + const message = { ...baseMsgUpdateAdminResponse } as MsgUpdateAdminResponse; + return message; + }, + + toJSON(_: MsgUpdateAdminResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgUpdateAdminResponse { + const message = { ...baseMsgUpdateAdminResponse } as MsgUpdateAdminResponse; + return message; + }, +}; + +const baseMsgClearAdmin: object = { sender: "", contract: "" }; + +export const MsgClearAdmin = { + encode(message: MsgClearAdmin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contract !== "") { + writer.uint32(26).string(message.contract); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgClearAdmin { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgClearAdmin } as MsgClearAdmin; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 3: + message.contract = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgClearAdmin { + const message = { ...baseMsgClearAdmin } as MsgClearAdmin; + if (object.sender !== undefined && object.sender !== null) { + message.sender = String(object.sender); + } else { + message.sender = ""; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = String(object.contract); + } else { + message.contract = ""; + } + return message; + }, + + toJSON(message: MsgClearAdmin): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.contract !== undefined && (obj.contract = message.contract); + return obj; + }, + + fromPartial(object: DeepPartial): MsgClearAdmin { + const message = { ...baseMsgClearAdmin } as MsgClearAdmin; + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } else { + message.sender = ""; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } else { + message.contract = ""; + } + return message; + }, +}; + +const baseMsgClearAdminResponse: object = {}; + +export const MsgClearAdminResponse = { + encode(_: MsgClearAdminResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgClearAdminResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgClearAdminResponse } as MsgClearAdminResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgClearAdminResponse { + const message = { ...baseMsgClearAdminResponse } as MsgClearAdminResponse; + return message; + }, + + toJSON(_: MsgClearAdminResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgClearAdminResponse { + const message = { ...baseMsgClearAdminResponse } as MsgClearAdminResponse; + return message; + }, +}; + +/** Msg defines the wasm Msg service. */ +export interface Msg { + /** StoreCode to submit Wasm code to the system */ + StoreCode(request: MsgStoreCode): Promise; + /** Instantiate creates a new smart contract instance for the given code id. */ + InstantiateContract(request: MsgInstantiateContract): Promise; + /** Execute submits the given message data to a smart contract */ + ExecuteContract(request: MsgExecuteContract): Promise; + /** Migrate runs a code upgrade/ downgrade for a smart contract */ + MigrateContract(request: MsgMigrateContract): Promise; + /** UpdateAdmin sets a new admin for a smart contract */ + UpdateAdmin(request: MsgUpdateAdmin): Promise; + /** ClearAdmin removes any admin stored for a smart contract */ + ClearAdmin(request: MsgClearAdmin): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.StoreCode = this.StoreCode.bind(this); + this.InstantiateContract = this.InstantiateContract.bind(this); + this.ExecuteContract = this.ExecuteContract.bind(this); + this.MigrateContract = this.MigrateContract.bind(this); + this.UpdateAdmin = this.UpdateAdmin.bind(this); + this.ClearAdmin = this.ClearAdmin.bind(this); + } + StoreCode(request: MsgStoreCode): Promise { + const data = MsgStoreCode.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Msg", "StoreCode", data); + return promise.then((data) => MsgStoreCodeResponse.decode(new _m0.Reader(data))); + } + + InstantiateContract(request: MsgInstantiateContract): Promise { + const data = MsgInstantiateContract.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Msg", "InstantiateContract", data); + return promise.then((data) => MsgInstantiateContractResponse.decode(new _m0.Reader(data))); + } + + ExecuteContract(request: MsgExecuteContract): Promise { + const data = MsgExecuteContract.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Msg", "ExecuteContract", data); + return promise.then((data) => MsgExecuteContractResponse.decode(new _m0.Reader(data))); + } + + MigrateContract(request: MsgMigrateContract): Promise { + const data = MsgMigrateContract.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Msg", "MigrateContract", data); + return promise.then((data) => MsgMigrateContractResponse.decode(new _m0.Reader(data))); + } + + UpdateAdmin(request: MsgUpdateAdmin): Promise { + const data = MsgUpdateAdmin.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Msg", "UpdateAdmin", data); + return promise.then((data) => MsgUpdateAdminResponse.decode(new _m0.Reader(data))); + } + + ClearAdmin(request: MsgClearAdmin): Promise { + const data = MsgClearAdmin.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1beta1.Msg", "ClearAdmin", data); + return promise.then((data) => MsgClearAdminResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/cosmwasm/wasm/v1beta1/types.ts b/src/cosmwasm/wasm/v1beta1/types.ts new file mode 100644 index 00000000..e4fc1cc5 --- /dev/null +++ b/src/cosmwasm/wasm/v1beta1/types.ts @@ -0,0 +1,1004 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Any } from "../../../google/protobuf/any"; + +export const protobufPackage = "cosmwasm.wasm.v1beta1"; + +/** AccessType permission types */ +export enum AccessType { + /** ACCESS_TYPE_UNSPECIFIED - AccessTypeUnspecified placeholder for empty value */ + ACCESS_TYPE_UNSPECIFIED = 0, + /** ACCESS_TYPE_NOBODY - AccessTypeNobody forbidden */ + ACCESS_TYPE_NOBODY = 1, + /** ACCESS_TYPE_ONLY_ADDRESS - AccessTypeOnlyAddress restricted to an address */ + ACCESS_TYPE_ONLY_ADDRESS = 2, + /** ACCESS_TYPE_EVERYBODY - AccessTypeEverybody unrestricted */ + ACCESS_TYPE_EVERYBODY = 3, + UNRECOGNIZED = -1, +} + +export function accessTypeFromJSON(object: any): AccessType { + switch (object) { + case 0: + case "ACCESS_TYPE_UNSPECIFIED": + return AccessType.ACCESS_TYPE_UNSPECIFIED; + case 1: + case "ACCESS_TYPE_NOBODY": + return AccessType.ACCESS_TYPE_NOBODY; + case 2: + case "ACCESS_TYPE_ONLY_ADDRESS": + return AccessType.ACCESS_TYPE_ONLY_ADDRESS; + case 3: + case "ACCESS_TYPE_EVERYBODY": + return AccessType.ACCESS_TYPE_EVERYBODY; + case -1: + case "UNRECOGNIZED": + default: + return AccessType.UNRECOGNIZED; + } +} + +export function accessTypeToJSON(object: AccessType): string { + switch (object) { + case AccessType.ACCESS_TYPE_UNSPECIFIED: + return "ACCESS_TYPE_UNSPECIFIED"; + case AccessType.ACCESS_TYPE_NOBODY: + return "ACCESS_TYPE_NOBODY"; + case AccessType.ACCESS_TYPE_ONLY_ADDRESS: + return "ACCESS_TYPE_ONLY_ADDRESS"; + case AccessType.ACCESS_TYPE_EVERYBODY: + return "ACCESS_TYPE_EVERYBODY"; + default: + return "UNKNOWN"; + } +} + +/** ContractCodeHistoryOperationType actions that caused a code change */ +export enum ContractCodeHistoryOperationType { + /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED - ContractCodeHistoryOperationTypeUnspecified placeholder for empty value */ + CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED = 0, + /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT - ContractCodeHistoryOperationTypeInit on chain contract instantiation */ + CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT = 1, + /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE - ContractCodeHistoryOperationTypeMigrate code migration */ + CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE = 2, + /** CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS - ContractCodeHistoryOperationTypeGenesis based on genesis data */ + CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS = 3, + UNRECOGNIZED = -1, +} + +export function contractCodeHistoryOperationTypeFromJSON(object: any): ContractCodeHistoryOperationType { + switch (object) { + case 0: + case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED": + return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED; + case 1: + case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT": + return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT; + case 2: + case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE": + return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE; + case 3: + case "CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS": + return ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS; + case -1: + case "UNRECOGNIZED": + default: + return ContractCodeHistoryOperationType.UNRECOGNIZED; + } +} + +export function contractCodeHistoryOperationTypeToJSON(object: ContractCodeHistoryOperationType): string { + switch (object) { + case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED: + return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED"; + case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT: + return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT"; + case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE: + return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE"; + case ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS: + return "CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS"; + default: + return "UNKNOWN"; + } +} + +/** AccessTypeParam */ +export interface AccessTypeParam { + value: AccessType; +} + +/** AccessConfig access control type. */ +export interface AccessConfig { + permission: AccessType; + address: string; +} + +/** Params defines the set of wasm parameters. */ +export interface Params { + codeUploadAccess?: AccessConfig; + instantiateDefaultPermission: AccessType; + maxWasmCodeSize: Long; +} + +/** CodeInfo is data for the uploaded contract WASM code */ +export interface CodeInfo { + /** CodeHash is the unique identifier created by wasmvm */ + codeHash: Uint8Array; + /** Creator address who initially stored the code */ + creator: string; + /** + * Source is a valid absolute HTTPS URI to the contract's source code, + * optional + */ + source: string; + /** Builder is a valid docker image name with tag, optional */ + builder: string; + /** InstantiateConfig access control to apply on contract creation, optional */ + instantiateConfig?: AccessConfig; +} + +/** ContractInfo stores a WASM contract instance */ +export interface ContractInfo { + /** CodeID is the reference to the stored Wasm code */ + codeId: Long; + /** Creator address who initially instantiated the contract */ + creator: string; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** Label is optional metadata to be stored with a contract instance. */ + label: string; + /** + * Created Tx position when the contract was instantiated. + * This data should kept internal and not be exposed via query results. Just + * use for sorting + */ + created?: AbsoluteTxPosition; + ibcPortId: string; + /** + * Extension is an extension point to store custom metadata within the + * persistence model. + */ + extension?: Any; +} + +/** ContractCodeHistoryEntry metadata to a contract. */ +export interface ContractCodeHistoryEntry { + operation: ContractCodeHistoryOperationType; + /** CodeID is the reference to the stored WASM code */ + codeId: Long; + /** Updated Tx position when the operation was executed. */ + updated?: AbsoluteTxPosition; + msg: Uint8Array; +} + +/** + * AbsoluteTxPosition is a unique transaction position that allows for global + * ordering of transactions. + */ +export interface AbsoluteTxPosition { + /** BlockHeight is the block the contract was created at */ + blockHeight: Long; + /** + * TxIndex is a monotonic counter within the block (actual transaction index, + * or gas consumed) + */ + txIndex: Long; +} + +/** Model is a struct that holds a KV pair */ +export interface Model { + /** hex-encode key to read it better (this is often ascii) */ + key: Uint8Array; + /** base64-encode raw value */ + value: Uint8Array; +} + +const baseAccessTypeParam: object = { value: 0 }; + +export const AccessTypeParam = { + encode(message: AccessTypeParam, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.value !== 0) { + writer.uint32(8).int32(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AccessTypeParam { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAccessTypeParam } as AccessTypeParam; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AccessTypeParam { + const message = { ...baseAccessTypeParam } as AccessTypeParam; + if (object.value !== undefined && object.value !== null) { + message.value = accessTypeFromJSON(object.value); + } else { + message.value = 0; + } + return message; + }, + + toJSON(message: AccessTypeParam): unknown { + const obj: any = {}; + message.value !== undefined && (obj.value = accessTypeToJSON(message.value)); + return obj; + }, + + fromPartial(object: DeepPartial): AccessTypeParam { + const message = { ...baseAccessTypeParam } as AccessTypeParam; + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } else { + message.value = 0; + } + return message; + }, +}; + +const baseAccessConfig: object = { permission: 0, address: "" }; + +export const AccessConfig = { + encode(message: AccessConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.permission !== 0) { + writer.uint32(8).int32(message.permission); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AccessConfig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAccessConfig } as AccessConfig; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.permission = reader.int32() as any; + break; + case 2: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AccessConfig { + const message = { ...baseAccessConfig } as AccessConfig; + if (object.permission !== undefined && object.permission !== null) { + message.permission = accessTypeFromJSON(object.permission); + } else { + message.permission = 0; + } + if (object.address !== undefined && object.address !== null) { + message.address = String(object.address); + } else { + message.address = ""; + } + return message; + }, + + toJSON(message: AccessConfig): unknown { + const obj: any = {}; + message.permission !== undefined && (obj.permission = accessTypeToJSON(message.permission)); + message.address !== undefined && (obj.address = message.address); + return obj; + }, + + fromPartial(object: DeepPartial): AccessConfig { + const message = { ...baseAccessConfig } as AccessConfig; + if (object.permission !== undefined && object.permission !== null) { + message.permission = object.permission; + } else { + message.permission = 0; + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = ""; + } + return message; + }, +}; + +const baseParams: object = { instantiateDefaultPermission: 0, maxWasmCodeSize: Long.UZERO }; + +export const Params = { + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.codeUploadAccess !== undefined) { + AccessConfig.encode(message.codeUploadAccess, writer.uint32(10).fork()).ldelim(); + } + if (message.instantiateDefaultPermission !== 0) { + writer.uint32(16).int32(message.instantiateDefaultPermission); + } + if (!message.maxWasmCodeSize.isZero()) { + writer.uint32(24).uint64(message.maxWasmCodeSize); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseParams } as Params; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeUploadAccess = AccessConfig.decode(reader, reader.uint32()); + break; + case 2: + message.instantiateDefaultPermission = reader.int32() as any; + break; + case 3: + message.maxWasmCodeSize = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Params { + const message = { ...baseParams } as Params; + if (object.codeUploadAccess !== undefined && object.codeUploadAccess !== null) { + message.codeUploadAccess = AccessConfig.fromJSON(object.codeUploadAccess); + } else { + message.codeUploadAccess = undefined; + } + if (object.instantiateDefaultPermission !== undefined && object.instantiateDefaultPermission !== null) { + message.instantiateDefaultPermission = accessTypeFromJSON(object.instantiateDefaultPermission); + } else { + message.instantiateDefaultPermission = 0; + } + if (object.maxWasmCodeSize !== undefined && object.maxWasmCodeSize !== null) { + message.maxWasmCodeSize = Long.fromString(object.maxWasmCodeSize); + } else { + message.maxWasmCodeSize = Long.UZERO; + } + return message; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + message.codeUploadAccess !== undefined && + (obj.codeUploadAccess = message.codeUploadAccess + ? AccessConfig.toJSON(message.codeUploadAccess) + : undefined); + message.instantiateDefaultPermission !== undefined && + (obj.instantiateDefaultPermission = accessTypeToJSON(message.instantiateDefaultPermission)); + message.maxWasmCodeSize !== undefined && + (obj.maxWasmCodeSize = (message.maxWasmCodeSize || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): Params { + const message = { ...baseParams } as Params; + if (object.codeUploadAccess !== undefined && object.codeUploadAccess !== null) { + message.codeUploadAccess = AccessConfig.fromPartial(object.codeUploadAccess); + } else { + message.codeUploadAccess = undefined; + } + if (object.instantiateDefaultPermission !== undefined && object.instantiateDefaultPermission !== null) { + message.instantiateDefaultPermission = object.instantiateDefaultPermission; + } else { + message.instantiateDefaultPermission = 0; + } + if (object.maxWasmCodeSize !== undefined && object.maxWasmCodeSize !== null) { + message.maxWasmCodeSize = object.maxWasmCodeSize as Long; + } else { + message.maxWasmCodeSize = Long.UZERO; + } + return message; + }, +}; + +const baseCodeInfo: object = { creator: "", source: "", builder: "" }; + +export const CodeInfo = { + encode(message: CodeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.codeHash.length !== 0) { + writer.uint32(10).bytes(message.codeHash); + } + if (message.creator !== "") { + writer.uint32(18).string(message.creator); + } + if (message.source !== "") { + writer.uint32(26).string(message.source); + } + if (message.builder !== "") { + writer.uint32(34).string(message.builder); + } + if (message.instantiateConfig !== undefined) { + AccessConfig.encode(message.instantiateConfig, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CodeInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCodeInfo } as CodeInfo; + message.codeHash = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeHash = reader.bytes(); + break; + case 2: + message.creator = reader.string(); + break; + case 3: + message.source = reader.string(); + break; + case 4: + message.builder = reader.string(); + break; + case 5: + message.instantiateConfig = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CodeInfo { + const message = { ...baseCodeInfo } as CodeInfo; + message.codeHash = new Uint8Array(); + if (object.codeHash !== undefined && object.codeHash !== null) { + message.codeHash = bytesFromBase64(object.codeHash); + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = String(object.creator); + } else { + message.creator = ""; + } + if (object.source !== undefined && object.source !== null) { + message.source = String(object.source); + } else { + message.source = ""; + } + if (object.builder !== undefined && object.builder !== null) { + message.builder = String(object.builder); + } else { + message.builder = ""; + } + if (object.instantiateConfig !== undefined && object.instantiateConfig !== null) { + message.instantiateConfig = AccessConfig.fromJSON(object.instantiateConfig); + } else { + message.instantiateConfig = undefined; + } + return message; + }, + + toJSON(message: CodeInfo): unknown { + const obj: any = {}; + message.codeHash !== undefined && + (obj.codeHash = base64FromBytes(message.codeHash !== undefined ? message.codeHash : new Uint8Array())); + message.creator !== undefined && (obj.creator = message.creator); + message.source !== undefined && (obj.source = message.source); + message.builder !== undefined && (obj.builder = message.builder); + message.instantiateConfig !== undefined && + (obj.instantiateConfig = message.instantiateConfig + ? AccessConfig.toJSON(message.instantiateConfig) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): CodeInfo { + const message = { ...baseCodeInfo } as CodeInfo; + if (object.codeHash !== undefined && object.codeHash !== null) { + message.codeHash = object.codeHash; + } else { + message.codeHash = new Uint8Array(); + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } else { + message.creator = ""; + } + if (object.source !== undefined && object.source !== null) { + message.source = object.source; + } else { + message.source = ""; + } + if (object.builder !== undefined && object.builder !== null) { + message.builder = object.builder; + } else { + message.builder = ""; + } + if (object.instantiateConfig !== undefined && object.instantiateConfig !== null) { + message.instantiateConfig = AccessConfig.fromPartial(object.instantiateConfig); + } else { + message.instantiateConfig = undefined; + } + return message; + }, +}; + +const baseContractInfo: object = { codeId: Long.UZERO, creator: "", admin: "", label: "", ibcPortId: "" }; + +export const ContractInfo = { + encode(message: ContractInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.codeId.isZero()) { + writer.uint32(8).uint64(message.codeId); + } + if (message.creator !== "") { + writer.uint32(18).string(message.creator); + } + if (message.admin !== "") { + writer.uint32(26).string(message.admin); + } + if (message.label !== "") { + writer.uint32(34).string(message.label); + } + if (message.created !== undefined) { + AbsoluteTxPosition.encode(message.created, writer.uint32(42).fork()).ldelim(); + } + if (message.ibcPortId !== "") { + writer.uint32(50).string(message.ibcPortId); + } + if (message.extension !== undefined) { + Any.encode(message.extension, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ContractInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseContractInfo } as ContractInfo; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64() as Long; + break; + case 2: + message.creator = reader.string(); + break; + case 3: + message.admin = reader.string(); + break; + case 4: + message.label = reader.string(); + break; + case 5: + message.created = AbsoluteTxPosition.decode(reader, reader.uint32()); + break; + case 6: + message.ibcPortId = reader.string(); + break; + case 7: + message.extension = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ContractInfo { + const message = { ...baseContractInfo } as ContractInfo; + if (object.codeId !== undefined && object.codeId !== null) { + message.codeId = Long.fromString(object.codeId); + } else { + message.codeId = Long.UZERO; + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = String(object.creator); + } else { + message.creator = ""; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = String(object.admin); + } else { + message.admin = ""; + } + if (object.label !== undefined && object.label !== null) { + message.label = String(object.label); + } else { + message.label = ""; + } + if (object.created !== undefined && object.created !== null) { + message.created = AbsoluteTxPosition.fromJSON(object.created); + } else { + message.created = undefined; + } + if (object.ibcPortId !== undefined && object.ibcPortId !== null) { + message.ibcPortId = String(object.ibcPortId); + } else { + message.ibcPortId = ""; + } + if (object.extension !== undefined && object.extension !== null) { + message.extension = Any.fromJSON(object.extension); + } else { + message.extension = undefined; + } + return message; + }, + + toJSON(message: ContractInfo): unknown { + const obj: any = {}; + message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); + message.creator !== undefined && (obj.creator = message.creator); + message.admin !== undefined && (obj.admin = message.admin); + message.label !== undefined && (obj.label = message.label); + message.created !== undefined && + (obj.created = message.created ? AbsoluteTxPosition.toJSON(message.created) : undefined); + message.ibcPortId !== undefined && (obj.ibcPortId = message.ibcPortId); + message.extension !== undefined && + (obj.extension = message.extension ? Any.toJSON(message.extension) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): ContractInfo { + const message = { ...baseContractInfo } as ContractInfo; + if (object.codeId !== undefined && object.codeId !== null) { + message.codeId = object.codeId as Long; + } else { + message.codeId = Long.UZERO; + } + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } else { + message.creator = ""; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } else { + message.admin = ""; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } else { + message.label = ""; + } + if (object.created !== undefined && object.created !== null) { + message.created = AbsoluteTxPosition.fromPartial(object.created); + } else { + message.created = undefined; + } + if (object.ibcPortId !== undefined && object.ibcPortId !== null) { + message.ibcPortId = object.ibcPortId; + } else { + message.ibcPortId = ""; + } + if (object.extension !== undefined && object.extension !== null) { + message.extension = Any.fromPartial(object.extension); + } else { + message.extension = undefined; + } + return message; + }, +}; + +const baseContractCodeHistoryEntry: object = { operation: 0, codeId: Long.UZERO }; + +export const ContractCodeHistoryEntry = { + encode(message: ContractCodeHistoryEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.operation !== 0) { + writer.uint32(8).int32(message.operation); + } + if (!message.codeId.isZero()) { + writer.uint32(16).uint64(message.codeId); + } + if (message.updated !== undefined) { + AbsoluteTxPosition.encode(message.updated, writer.uint32(26).fork()).ldelim(); + } + if (message.msg.length !== 0) { + writer.uint32(34).bytes(message.msg); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ContractCodeHistoryEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseContractCodeHistoryEntry } as ContractCodeHistoryEntry; + message.msg = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operation = reader.int32() as any; + break; + case 2: + message.codeId = reader.uint64() as Long; + break; + case 3: + message.updated = AbsoluteTxPosition.decode(reader, reader.uint32()); + break; + case 4: + message.msg = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ContractCodeHistoryEntry { + const message = { ...baseContractCodeHistoryEntry } as ContractCodeHistoryEntry; + message.msg = new Uint8Array(); + if (object.operation !== undefined && object.operation !== null) { + message.operation = contractCodeHistoryOperationTypeFromJSON(object.operation); + } else { + message.operation = 0; + } + if (object.codeId !== undefined && object.codeId !== null) { + message.codeId = Long.fromString(object.codeId); + } else { + message.codeId = Long.UZERO; + } + if (object.updated !== undefined && object.updated !== null) { + message.updated = AbsoluteTxPosition.fromJSON(object.updated); + } else { + message.updated = undefined; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = bytesFromBase64(object.msg); + } + return message; + }, + + toJSON(message: ContractCodeHistoryEntry): unknown { + const obj: any = {}; + message.operation !== undefined && + (obj.operation = contractCodeHistoryOperationTypeToJSON(message.operation)); + message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); + message.updated !== undefined && + (obj.updated = message.updated ? AbsoluteTxPosition.toJSON(message.updated) : undefined); + message.msg !== undefined && + (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): ContractCodeHistoryEntry { + const message = { ...baseContractCodeHistoryEntry } as ContractCodeHistoryEntry; + if (object.operation !== undefined && object.operation !== null) { + message.operation = object.operation; + } else { + message.operation = 0; + } + if (object.codeId !== undefined && object.codeId !== null) { + message.codeId = object.codeId as Long; + } else { + message.codeId = Long.UZERO; + } + if (object.updated !== undefined && object.updated !== null) { + message.updated = AbsoluteTxPosition.fromPartial(object.updated); + } else { + message.updated = undefined; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = object.msg; + } else { + message.msg = new Uint8Array(); + } + return message; + }, +}; + +const baseAbsoluteTxPosition: object = { blockHeight: Long.UZERO, txIndex: Long.UZERO }; + +export const AbsoluteTxPosition = { + encode(message: AbsoluteTxPosition, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.blockHeight.isZero()) { + writer.uint32(8).uint64(message.blockHeight); + } + if (!message.txIndex.isZero()) { + writer.uint32(16).uint64(message.txIndex); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AbsoluteTxPosition { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAbsoluteTxPosition } as AbsoluteTxPosition; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHeight = reader.uint64() as Long; + break; + case 2: + message.txIndex = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AbsoluteTxPosition { + const message = { ...baseAbsoluteTxPosition } as AbsoluteTxPosition; + if (object.blockHeight !== undefined && object.blockHeight !== null) { + message.blockHeight = Long.fromString(object.blockHeight); + } else { + message.blockHeight = Long.UZERO; + } + if (object.txIndex !== undefined && object.txIndex !== null) { + message.txIndex = Long.fromString(object.txIndex); + } else { + message.txIndex = Long.UZERO; + } + return message; + }, + + toJSON(message: AbsoluteTxPosition): unknown { + const obj: any = {}; + message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || Long.UZERO).toString()); + message.txIndex !== undefined && (obj.txIndex = (message.txIndex || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): AbsoluteTxPosition { + const message = { ...baseAbsoluteTxPosition } as AbsoluteTxPosition; + if (object.blockHeight !== undefined && object.blockHeight !== null) { + message.blockHeight = object.blockHeight as Long; + } else { + message.blockHeight = Long.UZERO; + } + if (object.txIndex !== undefined && object.txIndex !== null) { + message.txIndex = object.txIndex as Long; + } else { + message.txIndex = Long.UZERO; + } + return message; + }, +}; + +const baseModel: object = {}; + +export const Model = { + encode(message: Model, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Model { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseModel } as Model; + message.key = new Uint8Array(); + message.value = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Model { + const message = { ...baseModel } as Model; + message.key = new Uint8Array(); + message.value = new Uint8Array(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; + }, + + toJSON(message: Model): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.value !== undefined && + (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): Model { + const message = { ...baseModel } as Model; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } else { + message.value = new Uint8Array(); + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/gogoproto/gogo.ts b/src/gogoproto/gogo.ts new file mode 100644 index 00000000..2f8cdcc0 --- /dev/null +++ b/src/gogoproto/gogo.ts @@ -0,0 +1,10 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "gogoproto"; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/google/api/annotations.ts b/src/google/api/annotations.ts new file mode 100644 index 00000000..b0b6729f --- /dev/null +++ b/src/google/api/annotations.ts @@ -0,0 +1,10 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "google.api"; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/google/api/http.ts b/src/google/api/http.ts new file mode 100644 index 00000000..7691f0cb --- /dev/null +++ b/src/google/api/http.ts @@ -0,0 +1,684 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "google.api"; + +/** + * Defines the HTTP configuration for an API service. It contains a list of + * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method + * to one or more HTTP REST API methods. + */ +export interface Http { + /** + * A list of HTTP configuration rules that apply to individual API methods. + * + * **NOTE:** All service configuration rules follow "last one wins" order. + */ + rules: HttpRule[]; + /** + * When set to true, URL path parmeters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where "%2F" will be + * left encoded. + * + * The default behavior is to not decode RFC 6570 reserved characters in multi + * segment matches. + */ + fullyDecodeReservedExpansion: boolean; +} + +/** + * `HttpRule` defines the mapping of an RPC method to one or more HTTP + * REST API methods. The mapping specifies how different portions of the RPC + * request message are mapped to URL path, URL query parameters, and + * HTTP request body. The mapping is typically specified as an + * `google.api.http` annotation on the RPC method, + * see "google/api/annotations.proto" for details. + * + * The mapping consists of a field specifying the path template and + * method kind. The path template can refer to fields in the request + * message, as in the example below which describes a REST GET + * operation on a resource collection of messages: + * + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}"; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // mapped to the URL + * SubMessage sub = 2; // `sub.subfield` is url-mapped + * } + * message Message { + * string text = 1; // content of the resource + * } + * + * The same http annotation can alternatively be expressed inside the + * `GRPC API Configuration` YAML file. + * + * http: + * rules: + * - selector: .Messaging.GetMessage + * get: /v1/messages/{message_id}/{sub.subfield} + * + * This definition enables an automatic, bidrectional mapping of HTTP + * JSON to RPC. Example: + * + * HTTP | RPC + * -----|----- + * `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))` + * + * In general, not only fields but also field paths can be referenced + * from a path pattern. Fields mapped to the path pattern cannot be + * repeated and must have a primitive (non-message) type. + * + * Any fields in the request message which are not bound by the path + * pattern automatically become (optional) HTTP query + * parameters. Assume the following definition of the request message: + * + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http).get = "/v1/messages/{message_id}"; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // mapped to the URL + * int64 revision = 2; // becomes a parameter + * SubMessage sub = 3; // `sub.subfield` becomes a parameter + * } + * + * + * This enables a HTTP JSON to RPC mapping as below: + * + * HTTP | RPC + * -----|----- + * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))` + * + * Note that fields which are mapped to HTTP parameters must have a + * primitive type or a repeated primitive type. Message types are not + * allowed. In the case of a repeated type, the parameter can be + * repeated in the URL, as in `...?param=A¶m=B`. + * + * For HTTP method kinds which allow a request body, the `body` field + * specifies the mapping. Consider a REST update method on the + * message resource collection: + * + * + * service Messaging { + * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { + * option (google.api.http) = { + * put: "/v1/messages/{message_id}" + * body: "message" + * }; + * } + * } + * message UpdateMessageRequest { + * string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body + * } + * + * + * The following HTTP JSON to RPC mapping is enabled, where the + * representation of the JSON in the request body is determined by + * protos JSON encoding: + * + * HTTP | RPC + * -----|----- + * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: "Hi!" })` + * + * The special name `*` can be used in the body mapping to define that + * every field not bound by the path template should be mapped to the + * request body. This enables the following alternative definition of + * the update method: + * + * service Messaging { + * rpc UpdateMessage(Message) returns (Message) { + * option (google.api.http) = { + * put: "/v1/messages/{message_id}" + * body: "*" + * }; + * } + * } + * message Message { + * string message_id = 1; + * string text = 2; + * } + * + * + * The following HTTP JSON to RPC mapping is enabled: + * + * HTTP | RPC + * -----|----- + * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" text: "Hi!")` + * + * Note that when using `*` in the body mapping, it is not possible to + * have HTTP parameters, as all fields not bound by the path end in + * the body. This makes this option more rarely used in practice of + * defining REST APIs. The common usage of `*` is in custom methods + * which don't use the URL at all for transferring data. + * + * It is possible to define multiple HTTP methods for one RPC by using + * the `additional_bindings` option. Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/messages/{message_id}" + * additional_bindings { + * get: "/v1/users/{user_id}/messages/{message_id}" + * } + * }; + * } + * } + * message GetMessageRequest { + * string message_id = 1; + * string user_id = 2; + * } + * + * + * This enables the following two alternative HTTP JSON to RPC + * mappings: + * + * HTTP | RPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` + * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: "123456")` + * + * # Rules for HTTP mapping + * + * The rules for mapping HTTP path, query parameters, and body fields + * to the request message are as follows: + * + * 1. The `body` field specifies either `*` or a field path, or is + * omitted. If omitted, it indicates there is no HTTP request body. + * 2. Leaf fields (recursive expansion of nested messages in the + * request) can be classified into three types: + * (a) Matched in the URL template. + * (b) Covered by body (if body is `*`, everything except (a) fields; + * else everything under the body field) + * (c) All other fields. + * 3. URL query parameters found in the HTTP request are mapped to (c) fields. + * 4. Any body sent with an HTTP request can contain only (b) fields. + * + * The syntax of the path template is as follows: + * + * Template = "/" Segments [ Verb ] ; + * Segments = Segment { "/" Segment } ; + * Segment = "*" | "**" | LITERAL | Variable ; + * Variable = "{" FieldPath [ "=" Segments ] "}" ; + * FieldPath = IDENT { "." IDENT } ; + * Verb = ":" LITERAL ; + * + * The syntax `*` matches a single path segment. The syntax `**` matches zero + * or more path segments, which must be the last part of the path except the + * `Verb`. The syntax `LITERAL` matches literal text in the path. + * + * The syntax `Variable` matches part of the URL path as specified by its + * template. A variable template must not contain other variables. If a variable + * matches a single path segment, its template may be omitted, e.g. `{var}` + * is equivalent to `{var=*}`. + * + * If a variable contains exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path, all characters + * except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the + * Discovery Document as `{var}`. + * + * If a variable contains one or more path segments, such as `"{var=foo/*}"` + * or `"{var=**}"`, when such a variable is expanded into a URL path, all + * characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables + * show up in the Discovery Document as `{+var}`. + * + * NOTE: While the single segment variable matches the semantics of + * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 + * Simple String Expansion, the multi segment variable **does not** match + * RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion + * does not expand special characters like `?` and `#`, which would lead + * to invalid URLs. + * + * NOTE: the field paths in variables and in the `body` must not refer to + * repeated fields or map fields. + */ +export interface HttpRule { + /** + * Selects methods to which this rule applies. + * + * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + */ + selector: string; + /** Used for listing and getting information about resources. */ + get: string | undefined; + /** Used for updating a resource. */ + put: string | undefined; + /** Used for creating a resource. */ + post: string | undefined; + /** Used for deleting a resource. */ + delete: string | undefined; + /** Used for updating a resource. */ + patch: string | undefined; + /** + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave the + * HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + */ + custom?: CustomHttpPattern | undefined; + /** + * The name of the request field whose value is mapped to the HTTP body, or + * `*` for mapping all fields not captured by the path pattern to the HTTP + * body. NOTE: the referred field must not be a repeated field and must be + * present at the top-level of request message type. + */ + body: string; + /** + * Optional. The name of the response field whose value is mapped to the HTTP + * body of response. Other response fields are ignored. When + * not set, the response message will be used as HTTP body of response. + */ + responseBody: string; + /** + * Additional HTTP bindings for the selector. Nested bindings must + * not contain an `additional_bindings` field themselves (that is, + * the nesting may only be one level deep). + */ + additionalBindings: HttpRule[]; +} + +/** A custom pattern is used for defining custom HTTP verb. */ +export interface CustomHttpPattern { + /** The name of this custom HTTP verb. */ + kind: string; + /** The path matched by this custom verb. */ + path: string; +} + +const baseHttp: object = { fullyDecodeReservedExpansion: false }; + +export const Http = { + encode(message: Http, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.rules) { + HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.fullyDecodeReservedExpansion === true) { + writer.uint32(16).bool(message.fullyDecodeReservedExpansion); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Http { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHttp } as Http; + message.rules = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rules.push(HttpRule.decode(reader, reader.uint32())); + break; + case 2: + message.fullyDecodeReservedExpansion = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Http { + const message = { ...baseHttp } as Http; + message.rules = []; + if (object.rules !== undefined && object.rules !== null) { + for (const e of object.rules) { + message.rules.push(HttpRule.fromJSON(e)); + } + } + if (object.fullyDecodeReservedExpansion !== undefined && object.fullyDecodeReservedExpansion !== null) { + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + } else { + message.fullyDecodeReservedExpansion = false; + } + return message; + }, + + toJSON(message: Http): unknown { + const obj: any = {}; + if (message.rules) { + obj.rules = message.rules.map((e) => (e ? HttpRule.toJSON(e) : undefined)); + } else { + obj.rules = []; + } + message.fullyDecodeReservedExpansion !== undefined && + (obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion); + return obj; + }, + + fromPartial(object: DeepPartial): Http { + const message = { ...baseHttp } as Http; + message.rules = []; + if (object.rules !== undefined && object.rules !== null) { + for (const e of object.rules) { + message.rules.push(HttpRule.fromPartial(e)); + } + } + if (object.fullyDecodeReservedExpansion !== undefined && object.fullyDecodeReservedExpansion !== null) { + message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion; + } else { + message.fullyDecodeReservedExpansion = false; + } + return message; + }, +}; + +const baseHttpRule: object = { selector: "", body: "", responseBody: "" }; + +export const HttpRule = { + encode(message: HttpRule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.selector !== "") { + writer.uint32(10).string(message.selector); + } + if (message.get !== undefined) { + writer.uint32(18).string(message.get); + } + if (message.put !== undefined) { + writer.uint32(26).string(message.put); + } + if (message.post !== undefined) { + writer.uint32(34).string(message.post); + } + if (message.delete !== undefined) { + writer.uint32(42).string(message.delete); + } + if (message.patch !== undefined) { + writer.uint32(50).string(message.patch); + } + if (message.custom !== undefined) { + CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim(); + } + if (message.body !== "") { + writer.uint32(58).string(message.body); + } + if (message.responseBody !== "") { + writer.uint32(98).string(message.responseBody); + } + for (const v of message.additionalBindings) { + HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): HttpRule { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHttpRule } as HttpRule; + message.additionalBindings = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.selector = reader.string(); + break; + case 2: + message.get = reader.string(); + break; + case 3: + message.put = reader.string(); + break; + case 4: + message.post = reader.string(); + break; + case 5: + message.delete = reader.string(); + break; + case 6: + message.patch = reader.string(); + break; + case 8: + message.custom = CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.responseBody = reader.string(); + break; + case 11: + message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): HttpRule { + const message = { ...baseHttpRule } as HttpRule; + message.additionalBindings = []; + if (object.selector !== undefined && object.selector !== null) { + message.selector = String(object.selector); + } else { + message.selector = ""; + } + if (object.get !== undefined && object.get !== null) { + message.get = String(object.get); + } else { + message.get = undefined; + } + if (object.put !== undefined && object.put !== null) { + message.put = String(object.put); + } else { + message.put = undefined; + } + if (object.post !== undefined && object.post !== null) { + message.post = String(object.post); + } else { + message.post = undefined; + } + if (object.delete !== undefined && object.delete !== null) { + message.delete = String(object.delete); + } else { + message.delete = undefined; + } + if (object.patch !== undefined && object.patch !== null) { + message.patch = String(object.patch); + } else { + message.patch = undefined; + } + if (object.custom !== undefined && object.custom !== null) { + message.custom = CustomHttpPattern.fromJSON(object.custom); + } else { + message.custom = undefined; + } + if (object.body !== undefined && object.body !== null) { + message.body = String(object.body); + } else { + message.body = ""; + } + if (object.responseBody !== undefined && object.responseBody !== null) { + message.responseBody = String(object.responseBody); + } else { + message.responseBody = ""; + } + if (object.additionalBindings !== undefined && object.additionalBindings !== null) { + for (const e of object.additionalBindings) { + message.additionalBindings.push(HttpRule.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: HttpRule): unknown { + const obj: any = {}; + message.selector !== undefined && (obj.selector = message.selector); + message.get !== undefined && (obj.get = message.get); + message.put !== undefined && (obj.put = message.put); + message.post !== undefined && (obj.post = message.post); + message.delete !== undefined && (obj.delete = message.delete); + message.patch !== undefined && (obj.patch = message.patch); + message.custom !== undefined && + (obj.custom = message.custom ? CustomHttpPattern.toJSON(message.custom) : undefined); + message.body !== undefined && (obj.body = message.body); + message.responseBody !== undefined && (obj.responseBody = message.responseBody); + if (message.additionalBindings) { + obj.additionalBindings = message.additionalBindings.map((e) => (e ? HttpRule.toJSON(e) : undefined)); + } else { + obj.additionalBindings = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): HttpRule { + const message = { ...baseHttpRule } as HttpRule; + message.additionalBindings = []; + if (object.selector !== undefined && object.selector !== null) { + message.selector = object.selector; + } else { + message.selector = ""; + } + if (object.get !== undefined && object.get !== null) { + message.get = object.get; + } else { + message.get = undefined; + } + if (object.put !== undefined && object.put !== null) { + message.put = object.put; + } else { + message.put = undefined; + } + if (object.post !== undefined && object.post !== null) { + message.post = object.post; + } else { + message.post = undefined; + } + if (object.delete !== undefined && object.delete !== null) { + message.delete = object.delete; + } else { + message.delete = undefined; + } + if (object.patch !== undefined && object.patch !== null) { + message.patch = object.patch; + } else { + message.patch = undefined; + } + if (object.custom !== undefined && object.custom !== null) { + message.custom = CustomHttpPattern.fromPartial(object.custom); + } else { + message.custom = undefined; + } + if (object.body !== undefined && object.body !== null) { + message.body = object.body; + } else { + message.body = ""; + } + if (object.responseBody !== undefined && object.responseBody !== null) { + message.responseBody = object.responseBody; + } else { + message.responseBody = ""; + } + if (object.additionalBindings !== undefined && object.additionalBindings !== null) { + for (const e of object.additionalBindings) { + message.additionalBindings.push(HttpRule.fromPartial(e)); + } + } + return message; + }, +}; + +const baseCustomHttpPattern: object = { kind: "", path: "" }; + +export const CustomHttpPattern = { + encode(message: CustomHttpPattern, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.kind !== "") { + writer.uint32(10).string(message.kind); + } + if (message.path !== "") { + writer.uint32(18).string(message.path); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CustomHttpPattern { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCustomHttpPattern } as CustomHttpPattern; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.string(); + break; + case 2: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CustomHttpPattern { + const message = { ...baseCustomHttpPattern } as CustomHttpPattern; + if (object.kind !== undefined && object.kind !== null) { + message.kind = String(object.kind); + } else { + message.kind = ""; + } + if (object.path !== undefined && object.path !== null) { + message.path = String(object.path); + } else { + message.path = ""; + } + return message; + }, + + toJSON(message: CustomHttpPattern): unknown { + const obj: any = {}; + message.kind !== undefined && (obj.kind = message.kind); + message.path !== undefined && (obj.path = message.path); + return obj; + }, + + fromPartial(object: DeepPartial): CustomHttpPattern { + const message = { ...baseCustomHttpPattern } as CustomHttpPattern; + if (object.kind !== undefined && object.kind !== null) { + message.kind = object.kind; + } else { + message.kind = ""; + } + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } else { + message.path = ""; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/google/protobuf/any.ts b/src/google/protobuf/any.ts new file mode 100644 index 00000000..b6bbf845 --- /dev/null +++ b/src/google/protobuf/any.ts @@ -0,0 +1,241 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "google.protobuf"; + +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := ptypes.MarshalAny(foo) + * ... + * foo := &pb.Foo{} + * if err := ptypes.UnmarshalAny(any, foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + */ +export interface Any { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + */ + typeUrl: string; + /** Must be a valid serialized protocol buffer of the above specified type. */ + value: Uint8Array; +} + +const baseAny: object = { typeUrl: "" }; + +export const Any = { + encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.typeUrl !== "") { + writer.uint32(10).string(message.typeUrl); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Any { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAny } as Any; + message.value = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.typeUrl = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Any { + const message = { ...baseAny } as Any; + message.value = new Uint8Array(); + if (object.typeUrl !== undefined && object.typeUrl !== null) { + message.typeUrl = String(object.typeUrl); + } else { + message.typeUrl = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; + }, + + toJSON(message: Any): unknown { + const obj: any = {}; + message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl); + message.value !== undefined && + (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): Any { + const message = { ...baseAny } as Any; + if (object.typeUrl !== undefined && object.typeUrl !== null) { + message.typeUrl = object.typeUrl; + } else { + message.typeUrl = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } else { + message.value = new Uint8Array(); + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/google/protobuf/descriptor.ts b/src/google/protobuf/descriptor.ts new file mode 100644 index 00000000..d54a6452 --- /dev/null +++ b/src/google/protobuf/descriptor.ts @@ -0,0 +1,4729 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "google.protobuf"; + +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + */ +export interface FileDescriptorSet { + file: FileDescriptorProto[]; +} + +/** Describes a complete .proto file. */ +export interface FileDescriptorProto { + /** file name, relative to root of source tree */ + name: string; + /** e.g. "foo", "foo.bar", etc. */ + package: string; + /** Names of files imported by this file. */ + dependency: string[]; + /** Indexes of the public imported files in the dependency list above. */ + publicDependency: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + */ + weakDependency: number[]; + /** All top-level definitions in this file. */ + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + service: ServiceDescriptorProto[]; + extension: FieldDescriptorProto[]; + options?: FileOptions; + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + */ + sourceCodeInfo?: SourceCodeInfo; + /** + * The syntax of the proto file. + * The supported values are "proto2" and "proto3". + */ + syntax: string; +} + +/** Describes a message type. */ +export interface DescriptorProto { + name: string; + field: FieldDescriptorProto[]; + extension: FieldDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; + options?: MessageOptions; + reservedRange: DescriptorProto_ReservedRange[]; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + */ + reservedName: string[]; +} + +export interface DescriptorProto_ExtensionRange { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; + options?: ExtensionRangeOptions; +} + +/** + * Range of reserved tag numbers. Reserved tag numbers may not be used by + * fields or extension ranges in the same message. Reserved ranges may + * not overlap. + */ +export interface DescriptorProto_ReservedRange { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; +} + +export interface ExtensionRangeOptions { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +/** Describes a field within a message. */ +export interface FieldDescriptorProto { + name: string; + number: number; + label: FieldDescriptorProto_Label; + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + */ + type: FieldDescriptorProto_Type; + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + */ + typeName: string; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + */ + extendee: string; + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + * TODO(kenton): Base-64 encode? + */ + defaultValue: string; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + */ + oneofIndex: number; + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + */ + jsonName: string; + options?: FieldOptions; + /** + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. + * + * When proto3_optional is true, this field must be belong to a oneof to + * signal to old proto3 clients that presence is tracked for this field. This + * oneof is known as a "synthetic" oneof, and this field must be its sole + * member (each proto3 optional field gets its own synthetic oneof). Synthetic + * oneofs exist in the descriptor only, and do not generate any API. Synthetic + * oneofs must be ordered after all "real" oneofs. + * + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. + * + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. + */ + proto3Optional: boolean; +} + +export enum FieldDescriptorProto_Type { + /** + * TYPE_DOUBLE - 0 is reserved for errors. + * Order is weird for historical reasons. + */ + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + /** + * TYPE_INT64 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + * negative values are likely. + */ + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + /** + * TYPE_INT32 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + * negative values are likely. + */ + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + /** + * TYPE_GROUP - Tag-delimited aggregate. + * Group type is deprecated and not supported in proto3. However, Proto3 + * implementations should still be able to parse the group wire format and + * treat group fields as unknown fields. + */ + TYPE_GROUP = 10, + /** TYPE_MESSAGE - Length-delimited aggregate. */ + TYPE_MESSAGE = 11, + /** TYPE_BYTES - New in version 2. */ + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + /** TYPE_SINT32 - Uses ZigZag encoding. */ + TYPE_SINT32 = 17, + /** TYPE_SINT64 - Uses ZigZag encoding. */ + TYPE_SINT64 = 18, + UNRECOGNIZED = -1, +} + +export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type { + switch (object) { + case 1: + case "TYPE_DOUBLE": + return FieldDescriptorProto_Type.TYPE_DOUBLE; + case 2: + case "TYPE_FLOAT": + return FieldDescriptorProto_Type.TYPE_FLOAT; + case 3: + case "TYPE_INT64": + return FieldDescriptorProto_Type.TYPE_INT64; + case 4: + case "TYPE_UINT64": + return FieldDescriptorProto_Type.TYPE_UINT64; + case 5: + case "TYPE_INT32": + return FieldDescriptorProto_Type.TYPE_INT32; + case 6: + case "TYPE_FIXED64": + return FieldDescriptorProto_Type.TYPE_FIXED64; + case 7: + case "TYPE_FIXED32": + return FieldDescriptorProto_Type.TYPE_FIXED32; + case 8: + case "TYPE_BOOL": + return FieldDescriptorProto_Type.TYPE_BOOL; + case 9: + case "TYPE_STRING": + return FieldDescriptorProto_Type.TYPE_STRING; + case 10: + case "TYPE_GROUP": + return FieldDescriptorProto_Type.TYPE_GROUP; + case 11: + case "TYPE_MESSAGE": + return FieldDescriptorProto_Type.TYPE_MESSAGE; + case 12: + case "TYPE_BYTES": + return FieldDescriptorProto_Type.TYPE_BYTES; + case 13: + case "TYPE_UINT32": + return FieldDescriptorProto_Type.TYPE_UINT32; + case 14: + case "TYPE_ENUM": + return FieldDescriptorProto_Type.TYPE_ENUM; + case 15: + case "TYPE_SFIXED32": + return FieldDescriptorProto_Type.TYPE_SFIXED32; + case 16: + case "TYPE_SFIXED64": + return FieldDescriptorProto_Type.TYPE_SFIXED64; + case 17: + case "TYPE_SINT32": + return FieldDescriptorProto_Type.TYPE_SINT32; + case 18: + case "TYPE_SINT64": + return FieldDescriptorProto_Type.TYPE_SINT64; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Type.UNRECOGNIZED; + } +} + +export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string { + switch (object) { + case FieldDescriptorProto_Type.TYPE_DOUBLE: + return "TYPE_DOUBLE"; + case FieldDescriptorProto_Type.TYPE_FLOAT: + return "TYPE_FLOAT"; + case FieldDescriptorProto_Type.TYPE_INT64: + return "TYPE_INT64"; + case FieldDescriptorProto_Type.TYPE_UINT64: + return "TYPE_UINT64"; + case FieldDescriptorProto_Type.TYPE_INT32: + return "TYPE_INT32"; + case FieldDescriptorProto_Type.TYPE_FIXED64: + return "TYPE_FIXED64"; + case FieldDescriptorProto_Type.TYPE_FIXED32: + return "TYPE_FIXED32"; + case FieldDescriptorProto_Type.TYPE_BOOL: + return "TYPE_BOOL"; + case FieldDescriptorProto_Type.TYPE_STRING: + return "TYPE_STRING"; + case FieldDescriptorProto_Type.TYPE_GROUP: + return "TYPE_GROUP"; + case FieldDescriptorProto_Type.TYPE_MESSAGE: + return "TYPE_MESSAGE"; + case FieldDescriptorProto_Type.TYPE_BYTES: + return "TYPE_BYTES"; + case FieldDescriptorProto_Type.TYPE_UINT32: + return "TYPE_UINT32"; + case FieldDescriptorProto_Type.TYPE_ENUM: + return "TYPE_ENUM"; + case FieldDescriptorProto_Type.TYPE_SFIXED32: + return "TYPE_SFIXED32"; + case FieldDescriptorProto_Type.TYPE_SFIXED64: + return "TYPE_SFIXED64"; + case FieldDescriptorProto_Type.TYPE_SINT32: + return "TYPE_SINT32"; + case FieldDescriptorProto_Type.TYPE_SINT64: + return "TYPE_SINT64"; + default: + return "UNKNOWN"; + } +} + +export enum FieldDescriptorProto_Label { + /** LABEL_OPTIONAL - 0 is reserved for errors */ + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3, + UNRECOGNIZED = -1, +} + +export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label { + switch (object) { + case 1: + case "LABEL_OPTIONAL": + return FieldDescriptorProto_Label.LABEL_OPTIONAL; + case 2: + case "LABEL_REQUIRED": + return FieldDescriptorProto_Label.LABEL_REQUIRED; + case 3: + case "LABEL_REPEATED": + return FieldDescriptorProto_Label.LABEL_REPEATED; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Label.UNRECOGNIZED; + } +} + +export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string { + switch (object) { + case FieldDescriptorProto_Label.LABEL_OPTIONAL: + return "LABEL_OPTIONAL"; + case FieldDescriptorProto_Label.LABEL_REQUIRED: + return "LABEL_REQUIRED"; + case FieldDescriptorProto_Label.LABEL_REPEATED: + return "LABEL_REPEATED"; + default: + return "UNKNOWN"; + } +} + +/** Describes a oneof. */ +export interface OneofDescriptorProto { + name: string; + options?: OneofOptions; +} + +/** Describes an enum type. */ +export interface EnumDescriptorProto { + name: string; + value: EnumValueDescriptorProto[]; + options?: EnumOptions; + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + */ + reservedRange: EnumDescriptorProto_EnumReservedRange[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + */ + reservedName: string[]; +} + +/** + * Range of reserved numeric values. Reserved values may not be used by + * entries in the same enum. Reserved ranges may not overlap. + * + * Note that this is distinct from DescriptorProto.ReservedRange in that it + * is inclusive such that it can appropriately represent the entire int32 + * domain. + */ +export interface EnumDescriptorProto_EnumReservedRange { + /** Inclusive. */ + start: number; + /** Inclusive. */ + end: number; +} + +/** Describes a value within an enum. */ +export interface EnumValueDescriptorProto { + name: string; + number: number; + options?: EnumValueOptions; +} + +/** Describes a service. */ +export interface ServiceDescriptorProto { + name: string; + method: MethodDescriptorProto[]; + options?: ServiceOptions; +} + +/** Describes a method of a service. */ +export interface MethodDescriptorProto { + name: string; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + */ + inputType: string; + outputType: string; + options?: MethodOptions; + /** Identifies if client streams multiple client messages */ + clientStreaming: boolean; + /** Identifies if server streams multiple server messages */ + serverStreaming: boolean; +} + +export interface FileOptions { + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + */ + javaPackage: string; + /** + * If set, all the classes from the .proto file are wrapped in a single + * outer class with the given name. This applies to both Proto1 + * (equivalent to the old "--one_java_file" option) and Proto2 (where + * a .proto always translates to a single class, but you may want to + * explicitly choose the class name). + */ + javaOuterClassname: string; + /** + * If set true, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the outer class + * named by java_outer_classname. However, the outer class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + */ + javaMultipleFiles: boolean; + /** + * This option does nothing. + * + * @deprecated + */ + javaGenerateEqualsAndHash: boolean; + /** + * If set true, then the Java2 code generator will generate code that + * throws an exception whenever an attempt is made to assign a non-UTF-8 + * byte sequence to a string field. + * Message reflection will do the same. + * However, an extension field still accepts non-UTF-8 byte sequences. + * This option has no effect on when used with the lite runtime. + */ + javaStringCheckUtf8: boolean; + optimizeFor: FileOptions_OptimizeMode; + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + */ + goPackage: string; + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + */ + ccGenericServices: boolean; + javaGenericServices: boolean; + pyGenericServices: boolean; + phpGenericServices: boolean; + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + */ + deprecated: boolean; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + */ + ccEnableArenas: boolean; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + */ + objcClassPrefix: string; + /** Namespace for generated classes; defaults to the package. */ + csharpNamespace: string; + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + */ + swiftPrefix: string; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + */ + phpClassPrefix: string; + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + */ + phpNamespace: string; + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + */ + phpMetadataNamespace: string; + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + */ + rubyPackage: string; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + */ + uninterpretedOption: UninterpretedOption[]; +} + +/** Generated classes can be optimized for speed or code size. */ +export enum FileOptions_OptimizeMode { + /** SPEED - Generate complete code for parsing, serialization, */ + SPEED = 1, + /** CODE_SIZE - etc. */ + CODE_SIZE = 2, + /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. */ + LITE_RUNTIME = 3, + UNRECOGNIZED = -1, +} + +export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode { + switch (object) { + case 1: + case "SPEED": + return FileOptions_OptimizeMode.SPEED; + case 2: + case "CODE_SIZE": + return FileOptions_OptimizeMode.CODE_SIZE; + case 3: + case "LITE_RUNTIME": + return FileOptions_OptimizeMode.LITE_RUNTIME; + case -1: + case "UNRECOGNIZED": + default: + return FileOptions_OptimizeMode.UNRECOGNIZED; + } +} + +export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string { + switch (object) { + case FileOptions_OptimizeMode.SPEED: + return "SPEED"; + case FileOptions_OptimizeMode.CODE_SIZE: + return "CODE_SIZE"; + case FileOptions_OptimizeMode.LITE_RUNTIME: + return "LITE_RUNTIME"; + default: + return "UNKNOWN"; + } +} + +export interface MessageOptions { + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + */ + messageSetWireFormat: boolean; + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + */ + noStandardDescriptorAccessor: boolean; + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + */ + deprecated: boolean; + /** + * Whether the message is an automatically generated map entry type for the + * maps field. + * + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + */ + mapEntry: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface FieldOptions { + /** + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is not yet implemented in the open source + * release -- sorry, we'll try to include it in a future version! + */ + ctype: FieldOptions_CType; + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. + */ + packed: boolean; + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + */ + jstype: FieldOptions_JSType; + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * + * + * Note that implementations may choose not to check required fields within + * a lazy sub-message. That is, calling IsInitialized() on the outer message + * may return true even if the inner message has missing required fields. + * This is necessary because otherwise the inner message would have to be + * parsed in order to perform the check, defeating the purpose of lazy + * parsing. An implementation which chooses not to check required fields + * must be consistent about it. That is, for any particular sub-message, the + * implementation must either *always* check its required fields, or *never* + * check its required fields, regardless of whether or not the message has + * been parsed. + */ + lazy: boolean; + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + */ + deprecated: boolean; + /** For Google-internal migration only. Do not use. */ + weak: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export enum FieldOptions_CType { + /** STRING - Default mode. */ + STRING = 0, + CORD = 1, + STRING_PIECE = 2, + UNRECOGNIZED = -1, +} + +export function fieldOptions_CTypeFromJSON(object: any): FieldOptions_CType { + switch (object) { + case 0: + case "STRING": + return FieldOptions_CType.STRING; + case 1: + case "CORD": + return FieldOptions_CType.CORD; + case 2: + case "STRING_PIECE": + return FieldOptions_CType.STRING_PIECE; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_CType.UNRECOGNIZED; + } +} + +export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { + switch (object) { + case FieldOptions_CType.STRING: + return "STRING"; + case FieldOptions_CType.CORD: + return "CORD"; + case FieldOptions_CType.STRING_PIECE: + return "STRING_PIECE"; + default: + return "UNKNOWN"; + } +} + +export enum FieldOptions_JSType { + /** JS_NORMAL - Use the default type. */ + JS_NORMAL = 0, + /** JS_STRING - Use JavaScript strings. */ + JS_STRING = 1, + /** JS_NUMBER - Use JavaScript numbers. */ + JS_NUMBER = 2, + UNRECOGNIZED = -1, +} + +export function fieldOptions_JSTypeFromJSON(object: any): FieldOptions_JSType { + switch (object) { + case 0: + case "JS_NORMAL": + return FieldOptions_JSType.JS_NORMAL; + case 1: + case "JS_STRING": + return FieldOptions_JSType.JS_STRING; + case 2: + case "JS_NUMBER": + return FieldOptions_JSType.JS_NUMBER; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_JSType.UNRECOGNIZED; + } +} + +export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { + switch (object) { + case FieldOptions_JSType.JS_NORMAL: + return "JS_NORMAL"; + case FieldOptions_JSType.JS_STRING: + return "JS_STRING"; + case FieldOptions_JSType.JS_NUMBER: + return "JS_NUMBER"; + default: + return "UNKNOWN"; + } +} + +export interface OneofOptions { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface EnumOptions { + /** + * Set this option to true to allow mapping different tag names to the same + * value. + */ + allowAlias: boolean; + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface EnumValueOptions { + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface ServiceOptions { + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface MethodOptions { + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + */ + deprecated: boolean; + idempotencyLevel: MethodOptions_IdempotencyLevel; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +/** + * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + * or neither? HTTP based RPC implementation may choose GET verb for safe + * methods, and PUT verb for idempotent methods instead of the default POST. + */ +export enum MethodOptions_IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + /** NO_SIDE_EFFECTS - implies idempotent */ + NO_SIDE_EFFECTS = 1, + /** IDEMPOTENT - idempotent, but may have side effects */ + IDEMPOTENT = 2, + UNRECOGNIZED = -1, +} + +export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel { + switch (object) { + case 0: + case "IDEMPOTENCY_UNKNOWN": + return MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN; + case 1: + case "NO_SIDE_EFFECTS": + return MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS; + case 2: + case "IDEMPOTENT": + return MethodOptions_IdempotencyLevel.IDEMPOTENT; + case -1: + case "UNRECOGNIZED": + default: + return MethodOptions_IdempotencyLevel.UNRECOGNIZED; + } +} + +export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string { + switch (object) { + case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: + return "IDEMPOTENCY_UNKNOWN"; + case MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS: + return "NO_SIDE_EFFECTS"; + case MethodOptions_IdempotencyLevel.IDEMPOTENT: + return "IDEMPOTENT"; + default: + return "UNKNOWN"; + } +} + +/** + * A message representing a option the parser does not recognize. This only + * appears in options protos created by the compiler::Parser class. + * DescriptorPool resolves these when building Descriptor objects. Therefore, + * options protos in descriptor objects (e.g. returned by Descriptor::options(), + * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + * in them. + */ +export interface UninterpretedOption { + name: UninterpretedOption_NamePart[]; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + */ + identifierValue: string; + positiveIntValue: Long; + negativeIntValue: Long; + doubleValue: number; + stringValue: Uint8Array; + aggregateValue: string; +} + +/** + * The name of the uninterpreted option. Each string represents a segment in + * a dot-separated name. is_extension is true iff a segment represents an + * extension (denoted with parentheses in options specs in .proto files). + * E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + * "foo.(bar.baz).qux". + */ +export interface UninterpretedOption_NamePart { + namePart: string; + isExtension: boolean; +} + +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + */ +export interface SourceCodeInfo { + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + */ + location: SourceCodeInfo_Location[]; +} + +export interface SourceCodeInfo_Location { + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition. For + * example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + */ + path: number[]; + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + */ + span: number[]; + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * + * Examples: + * + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * + * // Comment attached to qux. + * // + * // Another line attached to qux. + * optional double qux = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to qux or corge because there are blank lines separating it from + * // both. + * + * // Detached comment for corge paragraph 2. + * + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. * / + * /* Block comment attached to + * * grault. * / + * optional int32 grault = 6; + * + * // ignored detached comments. + */ + leadingComments: string; + trailingComments: string; + leadingDetachedComments: string[]; +} + +/** + * Describes the relationship between generated code and its original source + * file. A GeneratedCodeInfo message is associated with only one generated + * source file, but may contain references to different source .proto files. + */ +export interface GeneratedCodeInfo { + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + */ + annotation: GeneratedCodeInfo_Annotation[]; +} + +export interface GeneratedCodeInfo_Annotation { + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + */ + path: number[]; + /** Identifies the filesystem path to the original source .proto. */ + sourceFile: string; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + */ + begin: number; + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified offset. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + */ + end: number; +} + +const baseFileDescriptorSet: object = {}; + +export const FileDescriptorSet = { + encode(message: FileDescriptorSet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.file) { + FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FileDescriptorSet { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFileDescriptorSet } as FileDescriptorSet; + message.file = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FileDescriptorSet { + const message = { ...baseFileDescriptorSet } as FileDescriptorSet; + message.file = []; + if (object.file !== undefined && object.file !== null) { + for (const e of object.file) { + message.file.push(FileDescriptorProto.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: FileDescriptorSet): unknown { + const obj: any = {}; + if (message.file) { + obj.file = message.file.map((e) => (e ? FileDescriptorProto.toJSON(e) : undefined)); + } else { + obj.file = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): FileDescriptorSet { + const message = { ...baseFileDescriptorSet } as FileDescriptorSet; + message.file = []; + if (object.file !== undefined && object.file !== null) { + for (const e of object.file) { + message.file.push(FileDescriptorProto.fromPartial(e)); + } + } + return message; + }, +}; + +const baseFileDescriptorProto: object = { + name: "", + package: "", + dependency: "", + publicDependency: 0, + weakDependency: 0, + syntax: "", +}; + +export const FileDescriptorProto = { + encode(message: FileDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.package !== "") { + writer.uint32(18).string(message.package); + } + for (const v of message.dependency) { + writer.uint32(26).string(v!); + } + writer.uint32(82).fork(); + for (const v of message.publicDependency) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(90).fork(); + for (const v of message.weakDependency) { + writer.int32(v); + } + writer.ldelim(); + for (const v of message.messageType) { + DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.enumType) { + EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.service) { + ServiceDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.options !== undefined) { + FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + if (message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).ldelim(); + } + if (message.syntax !== "") { + writer.uint32(98).string(message.syntax); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FileDescriptorProto { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFileDescriptorProto } as FileDescriptorProto; + message.dependency = []; + message.publicDependency = []; + message.weakDependency = []; + message.messageType = []; + message.enumType = []; + message.service = []; + message.extension = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.package = reader.string(); + break; + case 3: + message.dependency.push(reader.string()); + break; + case 10: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.publicDependency.push(reader.int32()); + } + } else { + message.publicDependency.push(reader.int32()); + } + break; + case 11: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.weakDependency.push(reader.int32()); + } + } else { + message.weakDependency.push(reader.int32()); + } + break; + case 4: + message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 8: + message.options = FileOptions.decode(reader, reader.uint32()); + break; + case 9: + message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); + break; + case 12: + message.syntax = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FileDescriptorProto { + const message = { ...baseFileDescriptorProto } as FileDescriptorProto; + message.dependency = []; + message.publicDependency = []; + message.weakDependency = []; + message.messageType = []; + message.enumType = []; + message.service = []; + message.extension = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.package !== undefined && object.package !== null) { + message.package = String(object.package); + } else { + message.package = ""; + } + if (object.dependency !== undefined && object.dependency !== null) { + for (const e of object.dependency) { + message.dependency.push(String(e)); + } + } + if (object.publicDependency !== undefined && object.publicDependency !== null) { + for (const e of object.publicDependency) { + message.publicDependency.push(Number(e)); + } + } + if (object.weakDependency !== undefined && object.weakDependency !== null) { + for (const e of object.weakDependency) { + message.weakDependency.push(Number(e)); + } + } + if (object.messageType !== undefined && object.messageType !== null) { + for (const e of object.messageType) { + message.messageType.push(DescriptorProto.fromJSON(e)); + } + } + if (object.enumType !== undefined && object.enumType !== null) { + for (const e of object.enumType) { + message.enumType.push(EnumDescriptorProto.fromJSON(e)); + } + } + if (object.service !== undefined && object.service !== null) { + for (const e of object.service) { + message.service.push(ServiceDescriptorProto.fromJSON(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = FileOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.sourceCodeInfo !== undefined && object.sourceCodeInfo !== null) { + message.sourceCodeInfo = SourceCodeInfo.fromJSON(object.sourceCodeInfo); + } else { + message.sourceCodeInfo = undefined; + } + if (object.syntax !== undefined && object.syntax !== null) { + message.syntax = String(object.syntax); + } else { + message.syntax = ""; + } + return message; + }, + + toJSON(message: FileDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.package !== undefined && (obj.package = message.package); + if (message.dependency) { + obj.dependency = message.dependency.map((e) => e); + } else { + obj.dependency = []; + } + if (message.publicDependency) { + obj.publicDependency = message.publicDependency.map((e) => e); + } else { + obj.publicDependency = []; + } + if (message.weakDependency) { + obj.weakDependency = message.weakDependency.map((e) => e); + } else { + obj.weakDependency = []; + } + if (message.messageType) { + obj.messageType = message.messageType.map((e) => (e ? DescriptorProto.toJSON(e) : undefined)); + } else { + obj.messageType = []; + } + if (message.enumType) { + obj.enumType = message.enumType.map((e) => (e ? EnumDescriptorProto.toJSON(e) : undefined)); + } else { + obj.enumType = []; + } + if (message.service) { + obj.service = message.service.map((e) => (e ? ServiceDescriptorProto.toJSON(e) : undefined)); + } else { + obj.service = []; + } + if (message.extension) { + obj.extension = message.extension.map((e) => (e ? FieldDescriptorProto.toJSON(e) : undefined)); + } else { + obj.extension = []; + } + message.options !== undefined && + (obj.options = message.options ? FileOptions.toJSON(message.options) : undefined); + message.sourceCodeInfo !== undefined && + (obj.sourceCodeInfo = message.sourceCodeInfo + ? SourceCodeInfo.toJSON(message.sourceCodeInfo) + : undefined); + message.syntax !== undefined && (obj.syntax = message.syntax); + return obj; + }, + + fromPartial(object: DeepPartial): FileDescriptorProto { + const message = { ...baseFileDescriptorProto } as FileDescriptorProto; + message.dependency = []; + message.publicDependency = []; + message.weakDependency = []; + message.messageType = []; + message.enumType = []; + message.service = []; + message.extension = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.package !== undefined && object.package !== null) { + message.package = object.package; + } else { + message.package = ""; + } + if (object.dependency !== undefined && object.dependency !== null) { + for (const e of object.dependency) { + message.dependency.push(e); + } + } + if (object.publicDependency !== undefined && object.publicDependency !== null) { + for (const e of object.publicDependency) { + message.publicDependency.push(e); + } + } + if (object.weakDependency !== undefined && object.weakDependency !== null) { + for (const e of object.weakDependency) { + message.weakDependency.push(e); + } + } + if (object.messageType !== undefined && object.messageType !== null) { + for (const e of object.messageType) { + message.messageType.push(DescriptorProto.fromPartial(e)); + } + } + if (object.enumType !== undefined && object.enumType !== null) { + for (const e of object.enumType) { + message.enumType.push(EnumDescriptorProto.fromPartial(e)); + } + } + if (object.service !== undefined && object.service !== null) { + for (const e of object.service) { + message.service.push(ServiceDescriptorProto.fromPartial(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = FileOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.sourceCodeInfo !== undefined && object.sourceCodeInfo !== null) { + message.sourceCodeInfo = SourceCodeInfo.fromPartial(object.sourceCodeInfo); + } else { + message.sourceCodeInfo = undefined; + } + if (object.syntax !== undefined && object.syntax !== null) { + message.syntax = object.syntax; + } else { + message.syntax = ""; + } + return message; + }, +}; + +const baseDescriptorProto: object = { name: "", reservedName: "" }; + +export const DescriptorProto = { + encode(message: DescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.field) { + FieldDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.nestedType) { + DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.enumType) { + EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.oneofDecl) { + OneofDescriptorProto.encode(v!, writer.uint32(66).fork()).ldelim(); + } + if (message.options !== undefined) { + MessageOptions.encode(message.options, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).ldelim(); + } + for (const v of message.reservedName) { + writer.uint32(82).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DescriptorProto { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDescriptorProto } as DescriptorProto; + message.field = []; + message.extension = []; + message.nestedType = []; + message.enumType = []; + message.extensionRange = []; + message.oneofDecl = []; + message.reservedRange = []; + message.reservedName = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); + break; + case 4: + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); + break; + case 8: + message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + message.options = MessageOptions.decode(reader, reader.uint32()); + break; + case 9: + message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); + break; + case 10: + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DescriptorProto { + const message = { ...baseDescriptorProto } as DescriptorProto; + message.field = []; + message.extension = []; + message.nestedType = []; + message.enumType = []; + message.extensionRange = []; + message.oneofDecl = []; + message.reservedRange = []; + message.reservedName = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.field !== undefined && object.field !== null) { + for (const e of object.field) { + message.field.push(FieldDescriptorProto.fromJSON(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromJSON(e)); + } + } + if (object.nestedType !== undefined && object.nestedType !== null) { + for (const e of object.nestedType) { + message.nestedType.push(DescriptorProto.fromJSON(e)); + } + } + if (object.enumType !== undefined && object.enumType !== null) { + for (const e of object.enumType) { + message.enumType.push(EnumDescriptorProto.fromJSON(e)); + } + } + if (object.extensionRange !== undefined && object.extensionRange !== null) { + for (const e of object.extensionRange) { + message.extensionRange.push(DescriptorProto_ExtensionRange.fromJSON(e)); + } + } + if (object.oneofDecl !== undefined && object.oneofDecl !== null) { + for (const e of object.oneofDecl) { + message.oneofDecl.push(OneofDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = MessageOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.reservedRange !== undefined && object.reservedRange !== null) { + for (const e of object.reservedRange) { + message.reservedRange.push(DescriptorProto_ReservedRange.fromJSON(e)); + } + } + if (object.reservedName !== undefined && object.reservedName !== null) { + for (const e of object.reservedName) { + message.reservedName.push(String(e)); + } + } + return message; + }, + + toJSON(message: DescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.field) { + obj.field = message.field.map((e) => (e ? FieldDescriptorProto.toJSON(e) : undefined)); + } else { + obj.field = []; + } + if (message.extension) { + obj.extension = message.extension.map((e) => (e ? FieldDescriptorProto.toJSON(e) : undefined)); + } else { + obj.extension = []; + } + if (message.nestedType) { + obj.nestedType = message.nestedType.map((e) => (e ? DescriptorProto.toJSON(e) : undefined)); + } else { + obj.nestedType = []; + } + if (message.enumType) { + obj.enumType = message.enumType.map((e) => (e ? EnumDescriptorProto.toJSON(e) : undefined)); + } else { + obj.enumType = []; + } + if (message.extensionRange) { + obj.extensionRange = message.extensionRange.map((e) => + e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined, + ); + } else { + obj.extensionRange = []; + } + if (message.oneofDecl) { + obj.oneofDecl = message.oneofDecl.map((e) => (e ? OneofDescriptorProto.toJSON(e) : undefined)); + } else { + obj.oneofDecl = []; + } + message.options !== undefined && + (obj.options = message.options ? MessageOptions.toJSON(message.options) : undefined); + if (message.reservedRange) { + obj.reservedRange = message.reservedRange.map((e) => + e ? DescriptorProto_ReservedRange.toJSON(e) : undefined, + ); + } else { + obj.reservedRange = []; + } + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); + } else { + obj.reservedName = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): DescriptorProto { + const message = { ...baseDescriptorProto } as DescriptorProto; + message.field = []; + message.extension = []; + message.nestedType = []; + message.enumType = []; + message.extensionRange = []; + message.oneofDecl = []; + message.reservedRange = []; + message.reservedName = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.field !== undefined && object.field !== null) { + for (const e of object.field) { + message.field.push(FieldDescriptorProto.fromPartial(e)); + } + } + if (object.extension !== undefined && object.extension !== null) { + for (const e of object.extension) { + message.extension.push(FieldDescriptorProto.fromPartial(e)); + } + } + if (object.nestedType !== undefined && object.nestedType !== null) { + for (const e of object.nestedType) { + message.nestedType.push(DescriptorProto.fromPartial(e)); + } + } + if (object.enumType !== undefined && object.enumType !== null) { + for (const e of object.enumType) { + message.enumType.push(EnumDescriptorProto.fromPartial(e)); + } + } + if (object.extensionRange !== undefined && object.extensionRange !== null) { + for (const e of object.extensionRange) { + message.extensionRange.push(DescriptorProto_ExtensionRange.fromPartial(e)); + } + } + if (object.oneofDecl !== undefined && object.oneofDecl !== null) { + for (const e of object.oneofDecl) { + message.oneofDecl.push(OneofDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = MessageOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.reservedRange !== undefined && object.reservedRange !== null) { + for (const e of object.reservedRange) { + message.reservedRange.push(DescriptorProto_ReservedRange.fromPartial(e)); + } + } + if (object.reservedName !== undefined && object.reservedName !== null) { + for (const e of object.reservedName) { + message.reservedName.push(e); + } + } + return message; + }, +}; + +const baseDescriptorProto_ExtensionRange: object = { start: 0, end: 0 }; + +export const DescriptorProto_ExtensionRange = { + encode(message: DescriptorProto_ExtensionRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + if (message.options !== undefined) { + ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DescriptorProto_ExtensionRange { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDescriptorProto_ExtensionRange } as DescriptorProto_ExtensionRange; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + case 3: + message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DescriptorProto_ExtensionRange { + const message = { ...baseDescriptorProto_ExtensionRange } as DescriptorProto_ExtensionRange; + if (object.start !== undefined && object.start !== null) { + message.start = Number(object.start); + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = ExtensionRangeOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + + toJSON(message: DescriptorProto_ExtensionRange): unknown { + const obj: any = {}; + message.start !== undefined && (obj.start = message.start); + message.end !== undefined && (obj.end = message.end); + message.options !== undefined && + (obj.options = message.options ? ExtensionRangeOptions.toJSON(message.options) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): DescriptorProto_ExtensionRange { + const message = { ...baseDescriptorProto_ExtensionRange } as DescriptorProto_ExtensionRange; + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = ExtensionRangeOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, +}; + +const baseDescriptorProto_ReservedRange: object = { start: 0, end: 0 }; + +export const DescriptorProto_ReservedRange = { + encode(message: DescriptorProto_ReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DescriptorProto_ReservedRange { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDescriptorProto_ReservedRange } as DescriptorProto_ReservedRange; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DescriptorProto_ReservedRange { + const message = { ...baseDescriptorProto_ReservedRange } as DescriptorProto_ReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = Number(object.start); + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + return message; + }, + + toJSON(message: DescriptorProto_ReservedRange): unknown { + const obj: any = {}; + message.start !== undefined && (obj.start = message.start); + message.end !== undefined && (obj.end = message.end); + return obj; + }, + + fromPartial(object: DeepPartial): DescriptorProto_ReservedRange { + const message = { ...baseDescriptorProto_ReservedRange } as DescriptorProto_ReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + return message; + }, +}; + +const baseExtensionRangeOptions: object = {}; + +export const ExtensionRangeOptions = { + encode(message: ExtensionRangeOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ExtensionRangeOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; + message.uninterpretedOption = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ExtensionRangeOptions { + const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; + message.uninterpretedOption = []; + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: ExtensionRangeOptions): unknown { + const obj: any = {}; + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ExtensionRangeOptions { + const message = { ...baseExtensionRangeOptions } as ExtensionRangeOptions; + message.uninterpretedOption = []; + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseFieldDescriptorProto: object = { + name: "", + number: 0, + label: 1, + type: 1, + typeName: "", + extendee: "", + defaultValue: "", + oneofIndex: 0, + jsonName: "", + proto3Optional: false, +}; + +export const FieldDescriptorProto = { + encode(message: FieldDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.number !== 0) { + writer.uint32(24).int32(message.number); + } + if (message.label !== 1) { + writer.uint32(32).int32(message.label); + } + if (message.type !== 1) { + writer.uint32(40).int32(message.type); + } + if (message.typeName !== "") { + writer.uint32(50).string(message.typeName); + } + if (message.extendee !== "") { + writer.uint32(18).string(message.extendee); + } + if (message.defaultValue !== "") { + writer.uint32(58).string(message.defaultValue); + } + if (message.oneofIndex !== 0) { + writer.uint32(72).int32(message.oneofIndex); + } + if (message.jsonName !== "") { + writer.uint32(82).string(message.jsonName); + } + if (message.options !== undefined) { + FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + if (message.proto3Optional === true) { + writer.uint32(136).bool(message.proto3Optional); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FieldDescriptorProto { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.number = reader.int32(); + break; + case 4: + message.label = reader.int32() as any; + break; + case 5: + message.type = reader.int32() as any; + break; + case 6: + message.typeName = reader.string(); + break; + case 2: + message.extendee = reader.string(); + break; + case 7: + message.defaultValue = reader.string(); + break; + case 9: + message.oneofIndex = reader.int32(); + break; + case 10: + message.jsonName = reader.string(); + break; + case 8: + message.options = FieldOptions.decode(reader, reader.uint32()); + break; + case 17: + message.proto3Optional = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FieldDescriptorProto { + const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = Number(object.number); + } else { + message.number = 0; + } + if (object.label !== undefined && object.label !== null) { + message.label = fieldDescriptorProto_LabelFromJSON(object.label); + } else { + message.label = 1; + } + if (object.type !== undefined && object.type !== null) { + message.type = fieldDescriptorProto_TypeFromJSON(object.type); + } else { + message.type = 1; + } + if (object.typeName !== undefined && object.typeName !== null) { + message.typeName = String(object.typeName); + } else { + message.typeName = ""; + } + if (object.extendee !== undefined && object.extendee !== null) { + message.extendee = String(object.extendee); + } else { + message.extendee = ""; + } + if (object.defaultValue !== undefined && object.defaultValue !== null) { + message.defaultValue = String(object.defaultValue); + } else { + message.defaultValue = ""; + } + if (object.oneofIndex !== undefined && object.oneofIndex !== null) { + message.oneofIndex = Number(object.oneofIndex); + } else { + message.oneofIndex = 0; + } + if (object.jsonName !== undefined && object.jsonName !== null) { + message.jsonName = String(object.jsonName); + } else { + message.jsonName = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = FieldOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.proto3Optional !== undefined && object.proto3Optional !== null) { + message.proto3Optional = Boolean(object.proto3Optional); + } else { + message.proto3Optional = false; + } + return message; + }, + + toJSON(message: FieldDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.number !== undefined && (obj.number = message.number); + message.label !== undefined && (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); + message.type !== undefined && (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); + message.typeName !== undefined && (obj.typeName = message.typeName); + message.extendee !== undefined && (obj.extendee = message.extendee); + message.defaultValue !== undefined && (obj.defaultValue = message.defaultValue); + message.oneofIndex !== undefined && (obj.oneofIndex = message.oneofIndex); + message.jsonName !== undefined && (obj.jsonName = message.jsonName); + message.options !== undefined && + (obj.options = message.options ? FieldOptions.toJSON(message.options) : undefined); + message.proto3Optional !== undefined && (obj.proto3Optional = message.proto3Optional); + return obj; + }, + + fromPartial(object: DeepPartial): FieldDescriptorProto { + const message = { ...baseFieldDescriptorProto } as FieldDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } else { + message.number = 0; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } else { + message.label = 1; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = 1; + } + if (object.typeName !== undefined && object.typeName !== null) { + message.typeName = object.typeName; + } else { + message.typeName = ""; + } + if (object.extendee !== undefined && object.extendee !== null) { + message.extendee = object.extendee; + } else { + message.extendee = ""; + } + if (object.defaultValue !== undefined && object.defaultValue !== null) { + message.defaultValue = object.defaultValue; + } else { + message.defaultValue = ""; + } + if (object.oneofIndex !== undefined && object.oneofIndex !== null) { + message.oneofIndex = object.oneofIndex; + } else { + message.oneofIndex = 0; + } + if (object.jsonName !== undefined && object.jsonName !== null) { + message.jsonName = object.jsonName; + } else { + message.jsonName = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = FieldOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.proto3Optional !== undefined && object.proto3Optional !== null) { + message.proto3Optional = object.proto3Optional; + } else { + message.proto3Optional = false; + } + return message; + }, +}; + +const baseOneofDescriptorProto: object = { name: "" }; + +export const OneofDescriptorProto = { + encode(message: OneofDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.options !== undefined) { + OneofOptions.encode(message.options, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): OneofDescriptorProto { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.options = OneofOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): OneofDescriptorProto { + const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = OneofOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + + toJSON(message: OneofDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.options !== undefined && + (obj.options = message.options ? OneofOptions.toJSON(message.options) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): OneofDescriptorProto { + const message = { ...baseOneofDescriptorProto } as OneofDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = OneofOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, +}; + +const baseEnumDescriptorProto: object = { name: "", reservedName: "" }; + +export const EnumDescriptorProto = { + encode(message: EnumDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.value) { + EnumValueDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined) { + EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.reservedName) { + writer.uint32(42).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EnumDescriptorProto { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; + message.value = []; + message.reservedRange = []; + message.reservedName = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = EnumOptions.decode(reader, reader.uint32()); + break; + case 4: + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); + break; + case 5: + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumDescriptorProto { + const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; + message.value = []; + message.reservedRange = []; + message.reservedName = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.value !== undefined && object.value !== null) { + for (const e of object.value) { + message.value.push(EnumValueDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.reservedRange !== undefined && object.reservedRange !== null) { + for (const e of object.reservedRange) { + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.fromJSON(e)); + } + } + if (object.reservedName !== undefined && object.reservedName !== null) { + for (const e of object.reservedName) { + message.reservedName.push(String(e)); + } + } + return message; + }, + + toJSON(message: EnumDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.value) { + obj.value = message.value.map((e) => (e ? EnumValueDescriptorProto.toJSON(e) : undefined)); + } else { + obj.value = []; + } + message.options !== undefined && + (obj.options = message.options ? EnumOptions.toJSON(message.options) : undefined); + if (message.reservedRange) { + obj.reservedRange = message.reservedRange.map((e) => + e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined, + ); + } else { + obj.reservedRange = []; + } + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); + } else { + obj.reservedName = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): EnumDescriptorProto { + const message = { ...baseEnumDescriptorProto } as EnumDescriptorProto; + message.value = []; + message.reservedRange = []; + message.reservedName = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.value !== undefined && object.value !== null) { + for (const e of object.value) { + message.value.push(EnumValueDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.reservedRange !== undefined && object.reservedRange !== null) { + for (const e of object.reservedRange) { + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.fromPartial(e)); + } + } + if (object.reservedName !== undefined && object.reservedName !== null) { + for (const e of object.reservedName) { + message.reservedName.push(e); + } + } + return message; + }, +}; + +const baseEnumDescriptorProto_EnumReservedRange: object = { start: 0, end: 0 }; + +export const EnumDescriptorProto_EnumReservedRange = { + encode( + message: EnumDescriptorProto_EnumReservedRange, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EnumDescriptorProto_EnumReservedRange { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnumDescriptorProto_EnumReservedRange } as EnumDescriptorProto_EnumReservedRange; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { + const message = { ...baseEnumDescriptorProto_EnumReservedRange } as EnumDescriptorProto_EnumReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = Number(object.start); + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + return message; + }, + + toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { + const obj: any = {}; + message.start !== undefined && (obj.start = message.start); + message.end !== undefined && (obj.end = message.end); + return obj; + }, + + fromPartial( + object: DeepPartial, + ): EnumDescriptorProto_EnumReservedRange { + const message = { ...baseEnumDescriptorProto_EnumReservedRange } as EnumDescriptorProto_EnumReservedRange; + if (object.start !== undefined && object.start !== null) { + message.start = object.start; + } else { + message.start = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + return message; + }, +}; + +const baseEnumValueDescriptorProto: object = { name: "", number: 0 }; + +export const EnumValueDescriptorProto = { + encode(message: EnumValueDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.number !== 0) { + writer.uint32(16).int32(message.number); + } + if (message.options !== undefined) { + EnumValueOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EnumValueDescriptorProto { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnumValueDescriptorProto } as EnumValueDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.number = reader.int32(); + break; + case 3: + message.options = EnumValueOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumValueDescriptorProto { + const message = { ...baseEnumValueDescriptorProto } as EnumValueDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = Number(object.number); + } else { + message.number = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumValueOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + + toJSON(message: EnumValueDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.number !== undefined && (obj.number = message.number); + message.options !== undefined && + (obj.options = message.options ? EnumValueOptions.toJSON(message.options) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): EnumValueDescriptorProto { + const message = { ...baseEnumValueDescriptorProto } as EnumValueDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.number !== undefined && object.number !== null) { + message.number = object.number; + } else { + message.number = 0; + } + if (object.options !== undefined && object.options !== null) { + message.options = EnumValueOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, +}; + +const baseServiceDescriptorProto: object = { name: "" }; + +export const ServiceDescriptorProto = { + encode(message: ServiceDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.method) { + MethodDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined) { + ServiceOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ServiceDescriptorProto { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; + message.method = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = ServiceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ServiceDescriptorProto { + const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; + message.method = []; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.method !== undefined && object.method !== null) { + for (const e of object.method) { + message.method.push(MethodDescriptorProto.fromJSON(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = ServiceOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + return message; + }, + + toJSON(message: ServiceDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.method) { + obj.method = message.method.map((e) => (e ? MethodDescriptorProto.toJSON(e) : undefined)); + } else { + obj.method = []; + } + message.options !== undefined && + (obj.options = message.options ? ServiceOptions.toJSON(message.options) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): ServiceDescriptorProto { + const message = { ...baseServiceDescriptorProto } as ServiceDescriptorProto; + message.method = []; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.method !== undefined && object.method !== null) { + for (const e of object.method) { + message.method.push(MethodDescriptorProto.fromPartial(e)); + } + } + if (object.options !== undefined && object.options !== null) { + message.options = ServiceOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + return message; + }, +}; + +const baseMethodDescriptorProto: object = { + name: "", + inputType: "", + outputType: "", + clientStreaming: false, + serverStreaming: false, +}; + +export const MethodDescriptorProto = { + encode(message: MethodDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.inputType !== "") { + writer.uint32(18).string(message.inputType); + } + if (message.outputType !== "") { + writer.uint32(26).string(message.outputType); + } + if (message.options !== undefined) { + MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); + } + if (message.clientStreaming === true) { + writer.uint32(40).bool(message.clientStreaming); + } + if (message.serverStreaming === true) { + writer.uint32(48).bool(message.serverStreaming); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MethodDescriptorProto { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.inputType = reader.string(); + break; + case 3: + message.outputType = reader.string(); + break; + case 4: + message.options = MethodOptions.decode(reader, reader.uint32()); + break; + case 5: + message.clientStreaming = reader.bool(); + break; + case 6: + message.serverStreaming = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MethodDescriptorProto { + const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = String(object.name); + } else { + message.name = ""; + } + if (object.inputType !== undefined && object.inputType !== null) { + message.inputType = String(object.inputType); + } else { + message.inputType = ""; + } + if (object.outputType !== undefined && object.outputType !== null) { + message.outputType = String(object.outputType); + } else { + message.outputType = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = MethodOptions.fromJSON(object.options); + } else { + message.options = undefined; + } + if (object.clientStreaming !== undefined && object.clientStreaming !== null) { + message.clientStreaming = Boolean(object.clientStreaming); + } else { + message.clientStreaming = false; + } + if (object.serverStreaming !== undefined && object.serverStreaming !== null) { + message.serverStreaming = Boolean(object.serverStreaming); + } else { + message.serverStreaming = false; + } + return message; + }, + + toJSON(message: MethodDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.inputType !== undefined && (obj.inputType = message.inputType); + message.outputType !== undefined && (obj.outputType = message.outputType); + message.options !== undefined && + (obj.options = message.options ? MethodOptions.toJSON(message.options) : undefined); + message.clientStreaming !== undefined && (obj.clientStreaming = message.clientStreaming); + message.serverStreaming !== undefined && (obj.serverStreaming = message.serverStreaming); + return obj; + }, + + fromPartial(object: DeepPartial): MethodDescriptorProto { + const message = { ...baseMethodDescriptorProto } as MethodDescriptorProto; + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } else { + message.name = ""; + } + if (object.inputType !== undefined && object.inputType !== null) { + message.inputType = object.inputType; + } else { + message.inputType = ""; + } + if (object.outputType !== undefined && object.outputType !== null) { + message.outputType = object.outputType; + } else { + message.outputType = ""; + } + if (object.options !== undefined && object.options !== null) { + message.options = MethodOptions.fromPartial(object.options); + } else { + message.options = undefined; + } + if (object.clientStreaming !== undefined && object.clientStreaming !== null) { + message.clientStreaming = object.clientStreaming; + } else { + message.clientStreaming = false; + } + if (object.serverStreaming !== undefined && object.serverStreaming !== null) { + message.serverStreaming = object.serverStreaming; + } else { + message.serverStreaming = false; + } + return message; + }, +}; + +const baseFileOptions: object = { + javaPackage: "", + javaOuterClassname: "", + javaMultipleFiles: false, + javaGenerateEqualsAndHash: false, + javaStringCheckUtf8: false, + optimizeFor: 1, + goPackage: "", + ccGenericServices: false, + javaGenericServices: false, + pyGenericServices: false, + phpGenericServices: false, + deprecated: false, + ccEnableArenas: false, + objcClassPrefix: "", + csharpNamespace: "", + swiftPrefix: "", + phpClassPrefix: "", + phpNamespace: "", + phpMetadataNamespace: "", + rubyPackage: "", +}; + +export const FileOptions = { + encode(message: FileOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.javaPackage !== "") { + writer.uint32(10).string(message.javaPackage); + } + if (message.javaOuterClassname !== "") { + writer.uint32(66).string(message.javaOuterClassname); + } + if (message.javaMultipleFiles === true) { + writer.uint32(80).bool(message.javaMultipleFiles); + } + if (message.javaGenerateEqualsAndHash === true) { + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); + } + if (message.javaStringCheckUtf8 === true) { + writer.uint32(216).bool(message.javaStringCheckUtf8); + } + if (message.optimizeFor !== 1) { + writer.uint32(72).int32(message.optimizeFor); + } + if (message.goPackage !== "") { + writer.uint32(90).string(message.goPackage); + } + if (message.ccGenericServices === true) { + writer.uint32(128).bool(message.ccGenericServices); + } + if (message.javaGenericServices === true) { + writer.uint32(136).bool(message.javaGenericServices); + } + if (message.pyGenericServices === true) { + writer.uint32(144).bool(message.pyGenericServices); + } + if (message.phpGenericServices === true) { + writer.uint32(336).bool(message.phpGenericServices); + } + if (message.deprecated === true) { + writer.uint32(184).bool(message.deprecated); + } + if (message.ccEnableArenas === true) { + writer.uint32(248).bool(message.ccEnableArenas); + } + if (message.objcClassPrefix !== "") { + writer.uint32(290).string(message.objcClassPrefix); + } + if (message.csharpNamespace !== "") { + writer.uint32(298).string(message.csharpNamespace); + } + if (message.swiftPrefix !== "") { + writer.uint32(314).string(message.swiftPrefix); + } + if (message.phpClassPrefix !== "") { + writer.uint32(322).string(message.phpClassPrefix); + } + if (message.phpNamespace !== "") { + writer.uint32(330).string(message.phpNamespace); + } + if (message.phpMetadataNamespace !== "") { + writer.uint32(354).string(message.phpMetadataNamespace); + } + if (message.rubyPackage !== "") { + writer.uint32(362).string(message.rubyPackage); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FileOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFileOptions } as FileOptions; + message.uninterpretedOption = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.javaPackage = reader.string(); + break; + case 8: + message.javaOuterClassname = reader.string(); + break; + case 10: + message.javaMultipleFiles = reader.bool(); + break; + case 20: + message.javaGenerateEqualsAndHash = reader.bool(); + break; + case 27: + message.javaStringCheckUtf8 = reader.bool(); + break; + case 9: + message.optimizeFor = reader.int32() as any; + break; + case 11: + message.goPackage = reader.string(); + break; + case 16: + message.ccGenericServices = reader.bool(); + break; + case 17: + message.javaGenericServices = reader.bool(); + break; + case 18: + message.pyGenericServices = reader.bool(); + break; + case 42: + message.phpGenericServices = reader.bool(); + break; + case 23: + message.deprecated = reader.bool(); + break; + case 31: + message.ccEnableArenas = reader.bool(); + break; + case 36: + message.objcClassPrefix = reader.string(); + break; + case 37: + message.csharpNamespace = reader.string(); + break; + case 39: + message.swiftPrefix = reader.string(); + break; + case 40: + message.phpClassPrefix = reader.string(); + break; + case 41: + message.phpNamespace = reader.string(); + break; + case 44: + message.phpMetadataNamespace = reader.string(); + break; + case 45: + message.rubyPackage = reader.string(); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FileOptions { + const message = { ...baseFileOptions } as FileOptions; + message.uninterpretedOption = []; + if (object.javaPackage !== undefined && object.javaPackage !== null) { + message.javaPackage = String(object.javaPackage); + } else { + message.javaPackage = ""; + } + if (object.javaOuterClassname !== undefined && object.javaOuterClassname !== null) { + message.javaOuterClassname = String(object.javaOuterClassname); + } else { + message.javaOuterClassname = ""; + } + if (object.javaMultipleFiles !== undefined && object.javaMultipleFiles !== null) { + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + } else { + message.javaMultipleFiles = false; + } + if (object.javaGenerateEqualsAndHash !== undefined && object.javaGenerateEqualsAndHash !== null) { + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + } else { + message.javaGenerateEqualsAndHash = false; + } + if (object.javaStringCheckUtf8 !== undefined && object.javaStringCheckUtf8 !== null) { + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + } else { + message.javaStringCheckUtf8 = false; + } + if (object.optimizeFor !== undefined && object.optimizeFor !== null) { + message.optimizeFor = fileOptions_OptimizeModeFromJSON(object.optimizeFor); + } else { + message.optimizeFor = 1; + } + if (object.goPackage !== undefined && object.goPackage !== null) { + message.goPackage = String(object.goPackage); + } else { + message.goPackage = ""; + } + if (object.ccGenericServices !== undefined && object.ccGenericServices !== null) { + message.ccGenericServices = Boolean(object.ccGenericServices); + } else { + message.ccGenericServices = false; + } + if (object.javaGenericServices !== undefined && object.javaGenericServices !== null) { + message.javaGenericServices = Boolean(object.javaGenericServices); + } else { + message.javaGenericServices = false; + } + if (object.pyGenericServices !== undefined && object.pyGenericServices !== null) { + message.pyGenericServices = Boolean(object.pyGenericServices); + } else { + message.pyGenericServices = false; + } + if (object.phpGenericServices !== undefined && object.phpGenericServices !== null) { + message.phpGenericServices = Boolean(object.phpGenericServices); + } else { + message.phpGenericServices = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.ccEnableArenas !== undefined && object.ccEnableArenas !== null) { + message.ccEnableArenas = Boolean(object.ccEnableArenas); + } else { + message.ccEnableArenas = false; + } + if (object.objcClassPrefix !== undefined && object.objcClassPrefix !== null) { + message.objcClassPrefix = String(object.objcClassPrefix); + } else { + message.objcClassPrefix = ""; + } + if (object.csharpNamespace !== undefined && object.csharpNamespace !== null) { + message.csharpNamespace = String(object.csharpNamespace); + } else { + message.csharpNamespace = ""; + } + if (object.swiftPrefix !== undefined && object.swiftPrefix !== null) { + message.swiftPrefix = String(object.swiftPrefix); + } else { + message.swiftPrefix = ""; + } + if (object.phpClassPrefix !== undefined && object.phpClassPrefix !== null) { + message.phpClassPrefix = String(object.phpClassPrefix); + } else { + message.phpClassPrefix = ""; + } + if (object.phpNamespace !== undefined && object.phpNamespace !== null) { + message.phpNamespace = String(object.phpNamespace); + } else { + message.phpNamespace = ""; + } + if (object.phpMetadataNamespace !== undefined && object.phpMetadataNamespace !== null) { + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + } else { + message.phpMetadataNamespace = ""; + } + if (object.rubyPackage !== undefined && object.rubyPackage !== null) { + message.rubyPackage = String(object.rubyPackage); + } else { + message.rubyPackage = ""; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: FileOptions): unknown { + const obj: any = {}; + message.javaPackage !== undefined && (obj.javaPackage = message.javaPackage); + message.javaOuterClassname !== undefined && (obj.javaOuterClassname = message.javaOuterClassname); + message.javaMultipleFiles !== undefined && (obj.javaMultipleFiles = message.javaMultipleFiles); + message.javaGenerateEqualsAndHash !== undefined && + (obj.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash); + message.javaStringCheckUtf8 !== undefined && (obj.javaStringCheckUtf8 = message.javaStringCheckUtf8); + message.optimizeFor !== undefined && + (obj.optimizeFor = fileOptions_OptimizeModeToJSON(message.optimizeFor)); + message.goPackage !== undefined && (obj.goPackage = message.goPackage); + message.ccGenericServices !== undefined && (obj.ccGenericServices = message.ccGenericServices); + message.javaGenericServices !== undefined && (obj.javaGenericServices = message.javaGenericServices); + message.pyGenericServices !== undefined && (obj.pyGenericServices = message.pyGenericServices); + message.phpGenericServices !== undefined && (obj.phpGenericServices = message.phpGenericServices); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.ccEnableArenas !== undefined && (obj.ccEnableArenas = message.ccEnableArenas); + message.objcClassPrefix !== undefined && (obj.objcClassPrefix = message.objcClassPrefix); + message.csharpNamespace !== undefined && (obj.csharpNamespace = message.csharpNamespace); + message.swiftPrefix !== undefined && (obj.swiftPrefix = message.swiftPrefix); + message.phpClassPrefix !== undefined && (obj.phpClassPrefix = message.phpClassPrefix); + message.phpNamespace !== undefined && (obj.phpNamespace = message.phpNamespace); + message.phpMetadataNamespace !== undefined && (obj.phpMetadataNamespace = message.phpMetadataNamespace); + message.rubyPackage !== undefined && (obj.rubyPackage = message.rubyPackage); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): FileOptions { + const message = { ...baseFileOptions } as FileOptions; + message.uninterpretedOption = []; + if (object.javaPackage !== undefined && object.javaPackage !== null) { + message.javaPackage = object.javaPackage; + } else { + message.javaPackage = ""; + } + if (object.javaOuterClassname !== undefined && object.javaOuterClassname !== null) { + message.javaOuterClassname = object.javaOuterClassname; + } else { + message.javaOuterClassname = ""; + } + if (object.javaMultipleFiles !== undefined && object.javaMultipleFiles !== null) { + message.javaMultipleFiles = object.javaMultipleFiles; + } else { + message.javaMultipleFiles = false; + } + if (object.javaGenerateEqualsAndHash !== undefined && object.javaGenerateEqualsAndHash !== null) { + message.javaGenerateEqualsAndHash = object.javaGenerateEqualsAndHash; + } else { + message.javaGenerateEqualsAndHash = false; + } + if (object.javaStringCheckUtf8 !== undefined && object.javaStringCheckUtf8 !== null) { + message.javaStringCheckUtf8 = object.javaStringCheckUtf8; + } else { + message.javaStringCheckUtf8 = false; + } + if (object.optimizeFor !== undefined && object.optimizeFor !== null) { + message.optimizeFor = object.optimizeFor; + } else { + message.optimizeFor = 1; + } + if (object.goPackage !== undefined && object.goPackage !== null) { + message.goPackage = object.goPackage; + } else { + message.goPackage = ""; + } + if (object.ccGenericServices !== undefined && object.ccGenericServices !== null) { + message.ccGenericServices = object.ccGenericServices; + } else { + message.ccGenericServices = false; + } + if (object.javaGenericServices !== undefined && object.javaGenericServices !== null) { + message.javaGenericServices = object.javaGenericServices; + } else { + message.javaGenericServices = false; + } + if (object.pyGenericServices !== undefined && object.pyGenericServices !== null) { + message.pyGenericServices = object.pyGenericServices; + } else { + message.pyGenericServices = false; + } + if (object.phpGenericServices !== undefined && object.phpGenericServices !== null) { + message.phpGenericServices = object.phpGenericServices; + } else { + message.phpGenericServices = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.ccEnableArenas !== undefined && object.ccEnableArenas !== null) { + message.ccEnableArenas = object.ccEnableArenas; + } else { + message.ccEnableArenas = false; + } + if (object.objcClassPrefix !== undefined && object.objcClassPrefix !== null) { + message.objcClassPrefix = object.objcClassPrefix; + } else { + message.objcClassPrefix = ""; + } + if (object.csharpNamespace !== undefined && object.csharpNamespace !== null) { + message.csharpNamespace = object.csharpNamespace; + } else { + message.csharpNamespace = ""; + } + if (object.swiftPrefix !== undefined && object.swiftPrefix !== null) { + message.swiftPrefix = object.swiftPrefix; + } else { + message.swiftPrefix = ""; + } + if (object.phpClassPrefix !== undefined && object.phpClassPrefix !== null) { + message.phpClassPrefix = object.phpClassPrefix; + } else { + message.phpClassPrefix = ""; + } + if (object.phpNamespace !== undefined && object.phpNamespace !== null) { + message.phpNamespace = object.phpNamespace; + } else { + message.phpNamespace = ""; + } + if (object.phpMetadataNamespace !== undefined && object.phpMetadataNamespace !== null) { + message.phpMetadataNamespace = object.phpMetadataNamespace; + } else { + message.phpMetadataNamespace = ""; + } + if (object.rubyPackage !== undefined && object.rubyPackage !== null) { + message.rubyPackage = object.rubyPackage; + } else { + message.rubyPackage = ""; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseMessageOptions: object = { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, +}; + +export const MessageOptions = { + encode(message: MessageOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.messageSetWireFormat === true) { + writer.uint32(8).bool(message.messageSetWireFormat); + } + if (message.noStandardDescriptorAccessor === true) { + writer.uint32(16).bool(message.noStandardDescriptorAccessor); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + if (message.mapEntry === true) { + writer.uint32(56).bool(message.mapEntry); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MessageOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMessageOptions } as MessageOptions; + message.uninterpretedOption = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageSetWireFormat = reader.bool(); + break; + case 2: + message.noStandardDescriptorAccessor = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 7: + message.mapEntry = reader.bool(); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MessageOptions { + const message = { ...baseMessageOptions } as MessageOptions; + message.uninterpretedOption = []; + if (object.messageSetWireFormat !== undefined && object.messageSetWireFormat !== null) { + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + } else { + message.messageSetWireFormat = false; + } + if (object.noStandardDescriptorAccessor !== undefined && object.noStandardDescriptorAccessor !== null) { + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + } else { + message.noStandardDescriptorAccessor = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.mapEntry !== undefined && object.mapEntry !== null) { + message.mapEntry = Boolean(object.mapEntry); + } else { + message.mapEntry = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: MessageOptions): unknown { + const obj: any = {}; + message.messageSetWireFormat !== undefined && (obj.messageSetWireFormat = message.messageSetWireFormat); + message.noStandardDescriptorAccessor !== undefined && + (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): MessageOptions { + const message = { ...baseMessageOptions } as MessageOptions; + message.uninterpretedOption = []; + if (object.messageSetWireFormat !== undefined && object.messageSetWireFormat !== null) { + message.messageSetWireFormat = object.messageSetWireFormat; + } else { + message.messageSetWireFormat = false; + } + if (object.noStandardDescriptorAccessor !== undefined && object.noStandardDescriptorAccessor !== null) { + message.noStandardDescriptorAccessor = object.noStandardDescriptorAccessor; + } else { + message.noStandardDescriptorAccessor = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.mapEntry !== undefined && object.mapEntry !== null) { + message.mapEntry = object.mapEntry; + } else { + message.mapEntry = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseFieldOptions: object = { + ctype: 0, + packed: false, + jstype: 0, + lazy: false, + deprecated: false, + weak: false, +}; + +export const FieldOptions = { + encode(message: FieldOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.ctype !== 0) { + writer.uint32(8).int32(message.ctype); + } + if (message.packed === true) { + writer.uint32(16).bool(message.packed); + } + if (message.jstype !== 0) { + writer.uint32(48).int32(message.jstype); + } + if (message.lazy === true) { + writer.uint32(40).bool(message.lazy); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + if (message.weak === true) { + writer.uint32(80).bool(message.weak); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FieldOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFieldOptions } as FieldOptions; + message.uninterpretedOption = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ctype = reader.int32() as any; + break; + case 2: + message.packed = reader.bool(); + break; + case 6: + message.jstype = reader.int32() as any; + break; + case 5: + message.lazy = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 10: + message.weak = reader.bool(); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FieldOptions { + const message = { ...baseFieldOptions } as FieldOptions; + message.uninterpretedOption = []; + if (object.ctype !== undefined && object.ctype !== null) { + message.ctype = fieldOptions_CTypeFromJSON(object.ctype); + } else { + message.ctype = 0; + } + if (object.packed !== undefined && object.packed !== null) { + message.packed = Boolean(object.packed); + } else { + message.packed = false; + } + if (object.jstype !== undefined && object.jstype !== null) { + message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); + } else { + message.jstype = 0; + } + if (object.lazy !== undefined && object.lazy !== null) { + message.lazy = Boolean(object.lazy); + } else { + message.lazy = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.weak !== undefined && object.weak !== null) { + message.weak = Boolean(object.weak); + } else { + message.weak = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: FieldOptions): unknown { + const obj: any = {}; + message.ctype !== undefined && (obj.ctype = fieldOptions_CTypeToJSON(message.ctype)); + message.packed !== undefined && (obj.packed = message.packed); + message.jstype !== undefined && (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); + message.lazy !== undefined && (obj.lazy = message.lazy); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.weak !== undefined && (obj.weak = message.weak); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): FieldOptions { + const message = { ...baseFieldOptions } as FieldOptions; + message.uninterpretedOption = []; + if (object.ctype !== undefined && object.ctype !== null) { + message.ctype = object.ctype; + } else { + message.ctype = 0; + } + if (object.packed !== undefined && object.packed !== null) { + message.packed = object.packed; + } else { + message.packed = false; + } + if (object.jstype !== undefined && object.jstype !== null) { + message.jstype = object.jstype; + } else { + message.jstype = 0; + } + if (object.lazy !== undefined && object.lazy !== null) { + message.lazy = object.lazy; + } else { + message.lazy = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.weak !== undefined && object.weak !== null) { + message.weak = object.weak; + } else { + message.weak = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseOneofOptions: object = {}; + +export const OneofOptions = { + encode(message: OneofOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): OneofOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseOneofOptions } as OneofOptions; + message.uninterpretedOption = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): OneofOptions { + const message = { ...baseOneofOptions } as OneofOptions; + message.uninterpretedOption = []; + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: OneofOptions): unknown { + const obj: any = {}; + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): OneofOptions { + const message = { ...baseOneofOptions } as OneofOptions; + message.uninterpretedOption = []; + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseEnumOptions: object = { allowAlias: false, deprecated: false }; + +export const EnumOptions = { + encode(message: EnumOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.allowAlias === true) { + writer.uint32(16).bool(message.allowAlias); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EnumOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnumOptions } as EnumOptions; + message.uninterpretedOption = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allowAlias = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumOptions { + const message = { ...baseEnumOptions } as EnumOptions; + message.uninterpretedOption = []; + if (object.allowAlias !== undefined && object.allowAlias !== null) { + message.allowAlias = Boolean(object.allowAlias); + } else { + message.allowAlias = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: EnumOptions): unknown { + const obj: any = {}; + message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): EnumOptions { + const message = { ...baseEnumOptions } as EnumOptions; + message.uninterpretedOption = []; + if (object.allowAlias !== undefined && object.allowAlias !== null) { + message.allowAlias = object.allowAlias; + } else { + message.allowAlias = false; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseEnumValueOptions: object = { deprecated: false }; + +export const EnumValueOptions = { + encode(message: EnumValueOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.deprecated === true) { + writer.uint32(8).bool(message.deprecated); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EnumValueOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEnumValueOptions } as EnumValueOptions; + message.uninterpretedOption = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumValueOptions { + const message = { ...baseEnumValueOptions } as EnumValueOptions; + message.uninterpretedOption = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: EnumValueOptions): unknown { + const obj: any = {}; + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): EnumValueOptions { + const message = { ...baseEnumValueOptions } as EnumValueOptions; + message.uninterpretedOption = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseServiceOptions: object = { deprecated: false }; + +export const ServiceOptions = { + encode(message: ServiceOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.deprecated === true) { + writer.uint32(264).bool(message.deprecated); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ServiceOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseServiceOptions } as ServiceOptions; + message.uninterpretedOption = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ServiceOptions { + const message = { ...baseServiceOptions } as ServiceOptions; + message.uninterpretedOption = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: ServiceOptions): unknown { + const obj: any = {}; + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ServiceOptions { + const message = { ...baseServiceOptions } as ServiceOptions; + message.uninterpretedOption = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseMethodOptions: object = { deprecated: false, idempotencyLevel: 0 }; + +export const MethodOptions = { + encode(message: MethodOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.deprecated === true) { + writer.uint32(264).bool(message.deprecated); + } + if (message.idempotencyLevel !== 0) { + writer.uint32(272).int32(message.idempotencyLevel); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MethodOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMethodOptions } as MethodOptions; + message.uninterpretedOption = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 34: + message.idempotencyLevel = reader.int32() as any; + break; + case 999: + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MethodOptions { + const message = { ...baseMethodOptions } as MethodOptions; + message.uninterpretedOption = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = Boolean(object.deprecated); + } else { + message.deprecated = false; + } + if (object.idempotencyLevel !== undefined && object.idempotencyLevel !== null) { + message.idempotencyLevel = methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel); + } else { + message.idempotencyLevel = 0; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: MethodOptions): unknown { + const obj: any = {}; + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.idempotencyLevel !== undefined && + (obj.idempotencyLevel = methodOptions_IdempotencyLevelToJSON(message.idempotencyLevel)); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined, + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): MethodOptions { + const message = { ...baseMethodOptions } as MethodOptions; + message.uninterpretedOption = []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } else { + message.deprecated = false; + } + if (object.idempotencyLevel !== undefined && object.idempotencyLevel !== null) { + message.idempotencyLevel = object.idempotencyLevel; + } else { + message.idempotencyLevel = 0; + } + if (object.uninterpretedOption !== undefined && object.uninterpretedOption !== null) { + for (const e of object.uninterpretedOption) { + message.uninterpretedOption.push(UninterpretedOption.fromPartial(e)); + } + } + return message; + }, +}; + +const baseUninterpretedOption: object = { + identifierValue: "", + positiveIntValue: Long.UZERO, + negativeIntValue: Long.ZERO, + doubleValue: 0, + aggregateValue: "", +}; + +export const UninterpretedOption = { + encode(message: UninterpretedOption, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.name) { + UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.identifierValue !== "") { + writer.uint32(26).string(message.identifierValue); + } + if (!message.positiveIntValue.isZero()) { + writer.uint32(32).uint64(message.positiveIntValue); + } + if (!message.negativeIntValue.isZero()) { + writer.uint32(40).int64(message.negativeIntValue); + } + if (message.doubleValue !== 0) { + writer.uint32(49).double(message.doubleValue); + } + if (message.stringValue.length !== 0) { + writer.uint32(58).bytes(message.stringValue); + } + if (message.aggregateValue !== "") { + writer.uint32(66).string(message.aggregateValue); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UninterpretedOption { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUninterpretedOption } as UninterpretedOption; + message.name = []; + message.stringValue = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); + break; + case 3: + message.identifierValue = reader.string(); + break; + case 4: + message.positiveIntValue = reader.uint64() as Long; + break; + case 5: + message.negativeIntValue = reader.int64() as Long; + break; + case 6: + message.doubleValue = reader.double(); + break; + case 7: + message.stringValue = reader.bytes(); + break; + case 8: + message.aggregateValue = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UninterpretedOption { + const message = { ...baseUninterpretedOption } as UninterpretedOption; + message.name = []; + message.stringValue = new Uint8Array(); + if (object.name !== undefined && object.name !== null) { + for (const e of object.name) { + message.name.push(UninterpretedOption_NamePart.fromJSON(e)); + } + } + if (object.identifierValue !== undefined && object.identifierValue !== null) { + message.identifierValue = String(object.identifierValue); + } else { + message.identifierValue = ""; + } + if (object.positiveIntValue !== undefined && object.positiveIntValue !== null) { + message.positiveIntValue = Long.fromString(object.positiveIntValue); + } else { + message.positiveIntValue = Long.UZERO; + } + if (object.negativeIntValue !== undefined && object.negativeIntValue !== null) { + message.negativeIntValue = Long.fromString(object.negativeIntValue); + } else { + message.negativeIntValue = Long.ZERO; + } + if (object.doubleValue !== undefined && object.doubleValue !== null) { + message.doubleValue = Number(object.doubleValue); + } else { + message.doubleValue = 0; + } + if (object.stringValue !== undefined && object.stringValue !== null) { + message.stringValue = bytesFromBase64(object.stringValue); + } + if (object.aggregateValue !== undefined && object.aggregateValue !== null) { + message.aggregateValue = String(object.aggregateValue); + } else { + message.aggregateValue = ""; + } + return message; + }, + + toJSON(message: UninterpretedOption): unknown { + const obj: any = {}; + if (message.name) { + obj.name = message.name.map((e) => (e ? UninterpretedOption_NamePart.toJSON(e) : undefined)); + } else { + obj.name = []; + } + message.identifierValue !== undefined && (obj.identifierValue = message.identifierValue); + message.positiveIntValue !== undefined && + (obj.positiveIntValue = (message.positiveIntValue || Long.UZERO).toString()); + message.negativeIntValue !== undefined && + (obj.negativeIntValue = (message.negativeIntValue || Long.ZERO).toString()); + message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue); + message.stringValue !== undefined && + (obj.stringValue = base64FromBytes( + message.stringValue !== undefined ? message.stringValue : new Uint8Array(), + )); + message.aggregateValue !== undefined && (obj.aggregateValue = message.aggregateValue); + return obj; + }, + + fromPartial(object: DeepPartial): UninterpretedOption { + const message = { ...baseUninterpretedOption } as UninterpretedOption; + message.name = []; + if (object.name !== undefined && object.name !== null) { + for (const e of object.name) { + message.name.push(UninterpretedOption_NamePart.fromPartial(e)); + } + } + if (object.identifierValue !== undefined && object.identifierValue !== null) { + message.identifierValue = object.identifierValue; + } else { + message.identifierValue = ""; + } + if (object.positiveIntValue !== undefined && object.positiveIntValue !== null) { + message.positiveIntValue = object.positiveIntValue as Long; + } else { + message.positiveIntValue = Long.UZERO; + } + if (object.negativeIntValue !== undefined && object.negativeIntValue !== null) { + message.negativeIntValue = object.negativeIntValue as Long; + } else { + message.negativeIntValue = Long.ZERO; + } + if (object.doubleValue !== undefined && object.doubleValue !== null) { + message.doubleValue = object.doubleValue; + } else { + message.doubleValue = 0; + } + if (object.stringValue !== undefined && object.stringValue !== null) { + message.stringValue = object.stringValue; + } else { + message.stringValue = new Uint8Array(); + } + if (object.aggregateValue !== undefined && object.aggregateValue !== null) { + message.aggregateValue = object.aggregateValue; + } else { + message.aggregateValue = ""; + } + return message; + }, +}; + +const baseUninterpretedOption_NamePart: object = { namePart: "", isExtension: false }; + +export const UninterpretedOption_NamePart = { + encode(message: UninterpretedOption_NamePart, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.namePart !== "") { + writer.uint32(10).string(message.namePart); + } + if (message.isExtension === true) { + writer.uint32(16).bool(message.isExtension); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UninterpretedOption_NamePart { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseUninterpretedOption_NamePart } as UninterpretedOption_NamePart; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.namePart = reader.string(); + break; + case 2: + message.isExtension = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UninterpretedOption_NamePart { + const message = { ...baseUninterpretedOption_NamePart } as UninterpretedOption_NamePart; + if (object.namePart !== undefined && object.namePart !== null) { + message.namePart = String(object.namePart); + } else { + message.namePart = ""; + } + if (object.isExtension !== undefined && object.isExtension !== null) { + message.isExtension = Boolean(object.isExtension); + } else { + message.isExtension = false; + } + return message; + }, + + toJSON(message: UninterpretedOption_NamePart): unknown { + const obj: any = {}; + message.namePart !== undefined && (obj.namePart = message.namePart); + message.isExtension !== undefined && (obj.isExtension = message.isExtension); + return obj; + }, + + fromPartial(object: DeepPartial): UninterpretedOption_NamePart { + const message = { ...baseUninterpretedOption_NamePart } as UninterpretedOption_NamePart; + if (object.namePart !== undefined && object.namePart !== null) { + message.namePart = object.namePart; + } else { + message.namePart = ""; + } + if (object.isExtension !== undefined && object.isExtension !== null) { + message.isExtension = object.isExtension; + } else { + message.isExtension = false; + } + return message; + }, +}; + +const baseSourceCodeInfo: object = {}; + +export const SourceCodeInfo = { + encode(message: SourceCodeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.location) { + SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SourceCodeInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSourceCodeInfo } as SourceCodeInfo; + message.location = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SourceCodeInfo { + const message = { ...baseSourceCodeInfo } as SourceCodeInfo; + message.location = []; + if (object.location !== undefined && object.location !== null) { + for (const e of object.location) { + message.location.push(SourceCodeInfo_Location.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: SourceCodeInfo): unknown { + const obj: any = {}; + if (message.location) { + obj.location = message.location.map((e) => (e ? SourceCodeInfo_Location.toJSON(e) : undefined)); + } else { + obj.location = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): SourceCodeInfo { + const message = { ...baseSourceCodeInfo } as SourceCodeInfo; + message.location = []; + if (object.location !== undefined && object.location !== null) { + for (const e of object.location) { + message.location.push(SourceCodeInfo_Location.fromPartial(e)); + } + } + return message; + }, +}; + +const baseSourceCodeInfo_Location: object = { + path: 0, + span: 0, + leadingComments: "", + trailingComments: "", + leadingDetachedComments: "", +}; + +export const SourceCodeInfo_Location = { + encode(message: SourceCodeInfo_Location, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(18).fork(); + for (const v of message.span) { + writer.int32(v); + } + writer.ldelim(); + if (message.leadingComments !== "") { + writer.uint32(26).string(message.leadingComments); + } + if (message.trailingComments !== "") { + writer.uint32(34).string(message.trailingComments); + } + for (const v of message.leadingDetachedComments) { + writer.uint32(50).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SourceCodeInfo_Location { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSourceCodeInfo_Location } as SourceCodeInfo_Location; + message.path = []; + message.span = []; + message.leadingDetachedComments = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.span.push(reader.int32()); + } + } else { + message.span.push(reader.int32()); + } + break; + case 3: + message.leadingComments = reader.string(); + break; + case 4: + message.trailingComments = reader.string(); + break; + case 6: + message.leadingDetachedComments.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SourceCodeInfo_Location { + const message = { ...baseSourceCodeInfo_Location } as SourceCodeInfo_Location; + message.path = []; + message.span = []; + message.leadingDetachedComments = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(Number(e)); + } + } + if (object.span !== undefined && object.span !== null) { + for (const e of object.span) { + message.span.push(Number(e)); + } + } + if (object.leadingComments !== undefined && object.leadingComments !== null) { + message.leadingComments = String(object.leadingComments); + } else { + message.leadingComments = ""; + } + if (object.trailingComments !== undefined && object.trailingComments !== null) { + message.trailingComments = String(object.trailingComments); + } else { + message.trailingComments = ""; + } + if (object.leadingDetachedComments !== undefined && object.leadingDetachedComments !== null) { + for (const e of object.leadingDetachedComments) { + message.leadingDetachedComments.push(String(e)); + } + } + return message; + }, + + toJSON(message: SourceCodeInfo_Location): unknown { + const obj: any = {}; + if (message.path) { + obj.path = message.path.map((e) => e); + } else { + obj.path = []; + } + if (message.span) { + obj.span = message.span.map((e) => e); + } else { + obj.span = []; + } + message.leadingComments !== undefined && (obj.leadingComments = message.leadingComments); + message.trailingComments !== undefined && (obj.trailingComments = message.trailingComments); + if (message.leadingDetachedComments) { + obj.leadingDetachedComments = message.leadingDetachedComments.map((e) => e); + } else { + obj.leadingDetachedComments = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): SourceCodeInfo_Location { + const message = { ...baseSourceCodeInfo_Location } as SourceCodeInfo_Location; + message.path = []; + message.span = []; + message.leadingDetachedComments = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(e); + } + } + if (object.span !== undefined && object.span !== null) { + for (const e of object.span) { + message.span.push(e); + } + } + if (object.leadingComments !== undefined && object.leadingComments !== null) { + message.leadingComments = object.leadingComments; + } else { + message.leadingComments = ""; + } + if (object.trailingComments !== undefined && object.trailingComments !== null) { + message.trailingComments = object.trailingComments; + } else { + message.trailingComments = ""; + } + if (object.leadingDetachedComments !== undefined && object.leadingDetachedComments !== null) { + for (const e of object.leadingDetachedComments) { + message.leadingDetachedComments.push(e); + } + } + return message; + }, +}; + +const baseGeneratedCodeInfo: object = {}; + +export const GeneratedCodeInfo = { + encode(message: GeneratedCodeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.annotation) { + GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GeneratedCodeInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; + message.annotation = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GeneratedCodeInfo { + const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; + message.annotation = []; + if (object.annotation !== undefined && object.annotation !== null) { + for (const e of object.annotation) { + message.annotation.push(GeneratedCodeInfo_Annotation.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: GeneratedCodeInfo): unknown { + const obj: any = {}; + if (message.annotation) { + obj.annotation = message.annotation.map((e) => + e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined, + ); + } else { + obj.annotation = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): GeneratedCodeInfo { + const message = { ...baseGeneratedCodeInfo } as GeneratedCodeInfo; + message.annotation = []; + if (object.annotation !== undefined && object.annotation !== null) { + for (const e of object.annotation) { + message.annotation.push(GeneratedCodeInfo_Annotation.fromPartial(e)); + } + } + return message; + }, +}; + +const baseGeneratedCodeInfo_Annotation: object = { path: 0, sourceFile: "", begin: 0, end: 0 }; + +export const GeneratedCodeInfo_Annotation = { + encode(message: GeneratedCodeInfo_Annotation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + if (message.sourceFile !== "") { + writer.uint32(18).string(message.sourceFile); + } + if (message.begin !== 0) { + writer.uint32(24).int32(message.begin); + } + if (message.end !== 0) { + writer.uint32(32).int32(message.end); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GeneratedCodeInfo_Annotation { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGeneratedCodeInfo_Annotation } as GeneratedCodeInfo_Annotation; + message.path = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + case 2: + message.sourceFile = reader.string(); + break; + case 3: + message.begin = reader.int32(); + break; + case 4: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GeneratedCodeInfo_Annotation { + const message = { ...baseGeneratedCodeInfo_Annotation } as GeneratedCodeInfo_Annotation; + message.path = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(Number(e)); + } + } + if (object.sourceFile !== undefined && object.sourceFile !== null) { + message.sourceFile = String(object.sourceFile); + } else { + message.sourceFile = ""; + } + if (object.begin !== undefined && object.begin !== null) { + message.begin = Number(object.begin); + } else { + message.begin = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = Number(object.end); + } else { + message.end = 0; + } + return message; + }, + + toJSON(message: GeneratedCodeInfo_Annotation): unknown { + const obj: any = {}; + if (message.path) { + obj.path = message.path.map((e) => e); + } else { + obj.path = []; + } + message.sourceFile !== undefined && (obj.sourceFile = message.sourceFile); + message.begin !== undefined && (obj.begin = message.begin); + message.end !== undefined && (obj.end = message.end); + return obj; + }, + + fromPartial(object: DeepPartial): GeneratedCodeInfo_Annotation { + const message = { ...baseGeneratedCodeInfo_Annotation } as GeneratedCodeInfo_Annotation; + message.path = []; + if (object.path !== undefined && object.path !== null) { + for (const e of object.path) { + message.path.push(e); + } + } + if (object.sourceFile !== undefined && object.sourceFile !== null) { + message.sourceFile = object.sourceFile; + } else { + message.sourceFile = ""; + } + if (object.begin !== undefined && object.begin !== null) { + message.begin = object.begin; + } else { + message.begin = 0; + } + if (object.end !== undefined && object.end !== null) { + message.end = object.end; + } else { + message.end = 0; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/google/protobuf/duration.ts b/src/google/protobuf/duration.ts new file mode 100644 index 00000000..a25fdf79 --- /dev/null +++ b/src/google/protobuf/duration.ts @@ -0,0 +1,171 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "google.protobuf"; + +/** + * A Duration represents a signed, fixed-length span of time represented + * as a count of seconds and fractions of seconds at nanosecond + * resolution. It is independent of any calendar and concepts like "day" + * or "month". It is related to Timestamp in that the difference between + * two Timestamp values is a Duration and it can be added or subtracted + * from a Timestamp. Range is approximately +-10,000 years. + * + * # Examples + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (duration.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * + * Example 3: Compute Duration from datetime.timedelta in Python. + * + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * + * # JSON Mapping + * + * In JSON format, the Duration type is encoded as a string rather than an + * object, where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + * microsecond should be expressed in JSON format as "3.000001s". + */ +export interface Duration { + /** + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + */ + seconds: Long; + /** + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + */ + nanos: number; +} + +const baseDuration: object = { seconds: Long.ZERO, nanos: 0 }; + +export const Duration = { + encode(message: Duration, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.seconds.isZero()) { + writer.uint32(8).int64(message.seconds); + } + if (message.nanos !== 0) { + writer.uint32(16).int32(message.nanos); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Duration { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDuration } as Duration; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64() as Long; + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Duration { + const message = { ...baseDuration } as Duration; + if (object.seconds !== undefined && object.seconds !== null) { + message.seconds = Long.fromString(object.seconds); + } else { + message.seconds = Long.ZERO; + } + if (object.nanos !== undefined && object.nanos !== null) { + message.nanos = Number(object.nanos); + } else { + message.nanos = 0; + } + return message; + }, + + toJSON(message: Duration): unknown { + const obj: any = {}; + message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString()); + message.nanos !== undefined && (obj.nanos = message.nanos); + return obj; + }, + + fromPartial(object: DeepPartial): Duration { + const message = { ...baseDuration } as Duration; + if (object.seconds !== undefined && object.seconds !== null) { + message.seconds = object.seconds as Long; + } else { + message.seconds = Long.ZERO; + } + if (object.nanos !== undefined && object.nanos !== null) { + message.nanos = object.nanos; + } else { + message.nanos = 0; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/google/protobuf/timestamp.ts b/src/google/protobuf/timestamp.ts new file mode 100644 index 00000000..5fc7b72d --- /dev/null +++ b/src/google/protobuf/timestamp.ts @@ -0,0 +1,202 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "google.protobuf"; + +/** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * + * Example 6: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D + * ) to obtain a formatter capable of generating timestamps in this format. + */ +export interface Timestamp { + /** + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + */ + seconds: Long; + /** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + */ + nanos: number; +} + +const baseTimestamp: object = { seconds: Long.ZERO, nanos: 0 }; + +export const Timestamp = { + encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.seconds.isZero()) { + writer.uint32(8).int64(message.seconds); + } + if (message.nanos !== 0) { + writer.uint32(16).int32(message.nanos); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Timestamp { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTimestamp } as Timestamp; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64() as Long; + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Timestamp { + const message = { ...baseTimestamp } as Timestamp; + if (object.seconds !== undefined && object.seconds !== null) { + message.seconds = Long.fromString(object.seconds); + } else { + message.seconds = Long.ZERO; + } + if (object.nanos !== undefined && object.nanos !== null) { + message.nanos = Number(object.nanos); + } else { + message.nanos = 0; + } + return message; + }, + + toJSON(message: Timestamp): unknown { + const obj: any = {}; + message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString()); + message.nanos !== undefined && (obj.nanos = message.nanos); + return obj; + }, + + fromPartial(object: DeepPartial): Timestamp { + const message = { ...baseTimestamp } as Timestamp; + if (object.seconds !== undefined && object.seconds !== null) { + message.seconds = object.seconds as Long; + } else { + message.seconds = Long.ZERO; + } + if (object.nanos !== undefined && object.nanos !== null) { + message.nanos = object.nanos; + } else { + message.nanos = 0; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/ibc/applications/transfer/v1/genesis.ts b/src/ibc/applications/transfer/v1/genesis.ts new file mode 100644 index 00000000..cf5da04e --- /dev/null +++ b/src/ibc/applications/transfer/v1/genesis.ts @@ -0,0 +1,125 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Params, DenomTrace } from "../../../../ibc/applications/transfer/v1/transfer"; + +export const protobufPackage = "ibc.applications.transfer.v1"; + +/** GenesisState defines the ibc-transfer genesis state */ +export interface GenesisState { + portId: string; + denomTraces: DenomTrace[]; + params?: Params; +} + +const baseGenesisState: object = { portId: "" }; + +export const GenesisState = { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + for (const v of message.denomTraces) { + DenomTrace.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGenesisState } as GenesisState; + message.denomTraces = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.denomTraces.push(DenomTrace.decode(reader, reader.uint32())); + break; + case 3: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.denomTraces = []; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.denomTraces !== undefined && object.denomTraces !== null) { + for (const e of object.denomTraces) { + message.denomTraces.push(DenomTrace.fromJSON(e)); + } + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + return message; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + if (message.denomTraces) { + obj.denomTraces = message.denomTraces.map((e) => (e ? DenomTrace.toJSON(e) : undefined)); + } else { + obj.denomTraces = []; + } + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.denomTraces = []; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.denomTraces !== undefined && object.denomTraces !== null) { + for (const e of object.denomTraces) { + message.denomTraces.push(DenomTrace.fromPartial(e)); + } + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/ibc/applications/transfer/v1/query.ts b/src/ibc/applications/transfer/v1/query.ts new file mode 100644 index 00000000..36e86f7f --- /dev/null +++ b/src/ibc/applications/transfer/v1/query.ts @@ -0,0 +1,451 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { DenomTrace, Params } from "../../../../ibc/applications/transfer/v1/transfer"; +import { PageRequest, PageResponse } from "../../../../cosmos/base/query/v1beta1/pagination"; + +export const protobufPackage = "ibc.applications.transfer.v1"; + +/** + * QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC + * method + */ +export interface QueryDenomTraceRequest { + /** hash (in hex format) of the denomination trace information. */ + hash: string; +} + +/** + * QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC + * method. + */ +export interface QueryDenomTraceResponse { + /** denom_trace returns the requested denomination trace information. */ + denomTrace?: DenomTrace; +} + +/** + * QueryConnectionsRequest is the request type for the Query/DenomTraces RPC + * method + */ +export interface QueryDenomTracesRequest { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} + +/** + * QueryConnectionsResponse is the response type for the Query/DenomTraces RPC + * method. + */ +export interface QueryDenomTracesResponse { + /** denom_traces returns all denominations trace information. */ + denomTraces: DenomTrace[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} + +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} + +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params defines the parameters of the module. */ + params?: Params; +} + +const baseQueryDenomTraceRequest: object = { hash: "" }; + +export const QueryDenomTraceRequest = { + encode(message: QueryDenomTraceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.hash !== "") { + writer.uint32(10).string(message.hash); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomTraceRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDenomTraceRequest } as QueryDenomTraceRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDenomTraceRequest { + const message = { ...baseQueryDenomTraceRequest } as QueryDenomTraceRequest; + if (object.hash !== undefined && object.hash !== null) { + message.hash = String(object.hash); + } else { + message.hash = ""; + } + return message; + }, + + toJSON(message: QueryDenomTraceRequest): unknown { + const obj: any = {}; + message.hash !== undefined && (obj.hash = message.hash); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDenomTraceRequest { + const message = { ...baseQueryDenomTraceRequest } as QueryDenomTraceRequest; + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } else { + message.hash = ""; + } + return message; + }, +}; + +const baseQueryDenomTraceResponse: object = {}; + +export const QueryDenomTraceResponse = { + encode(message: QueryDenomTraceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.denomTrace !== undefined) { + DenomTrace.encode(message.denomTrace, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomTraceResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDenomTraceResponse } as QueryDenomTraceResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denomTrace = DenomTrace.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDenomTraceResponse { + const message = { ...baseQueryDenomTraceResponse } as QueryDenomTraceResponse; + if (object.denomTrace !== undefined && object.denomTrace !== null) { + message.denomTrace = DenomTrace.fromJSON(object.denomTrace); + } else { + message.denomTrace = undefined; + } + return message; + }, + + toJSON(message: QueryDenomTraceResponse): unknown { + const obj: any = {}; + message.denomTrace !== undefined && + (obj.denomTrace = message.denomTrace ? DenomTrace.toJSON(message.denomTrace) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDenomTraceResponse { + const message = { ...baseQueryDenomTraceResponse } as QueryDenomTraceResponse; + if (object.denomTrace !== undefined && object.denomTrace !== null) { + message.denomTrace = DenomTrace.fromPartial(object.denomTrace); + } else { + message.denomTrace = undefined; + } + return message; + }, +}; + +const baseQueryDenomTracesRequest: object = {}; + +export const QueryDenomTracesRequest = { + encode(message: QueryDenomTracesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomTracesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDenomTracesRequest } as QueryDenomTracesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDenomTracesRequest { + const message = { ...baseQueryDenomTracesRequest } as QueryDenomTracesRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryDenomTracesRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDenomTracesRequest { + const message = { ...baseQueryDenomTracesRequest } as QueryDenomTracesRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryDenomTracesResponse: object = {}; + +export const QueryDenomTracesResponse = { + encode(message: QueryDenomTracesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.denomTraces) { + DenomTrace.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomTracesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryDenomTracesResponse } as QueryDenomTracesResponse; + message.denomTraces = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denomTraces.push(DenomTrace.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryDenomTracesResponse { + const message = { ...baseQueryDenomTracesResponse } as QueryDenomTracesResponse; + message.denomTraces = []; + if (object.denomTraces !== undefined && object.denomTraces !== null) { + for (const e of object.denomTraces) { + message.denomTraces.push(DenomTrace.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryDenomTracesResponse): unknown { + const obj: any = {}; + if (message.denomTraces) { + obj.denomTraces = message.denomTraces.map((e) => (e ? DenomTrace.toJSON(e) : undefined)); + } else { + obj.denomTraces = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDenomTracesResponse { + const message = { ...baseQueryDenomTracesResponse } as QueryDenomTracesResponse; + message.denomTraces = []; + if (object.denomTraces !== undefined && object.denomTraces !== null) { + for (const e of object.denomTraces) { + message.denomTraces.push(DenomTrace.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryParamsRequest: object = {}; + +export const QueryParamsRequest = { + encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + return message; + }, + + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): QueryParamsRequest { + const message = { ...baseQueryParamsRequest } as QueryParamsRequest; + return message; + }, +}; + +const baseQueryParamsResponse: object = {}; + +export const QueryParamsResponse = { + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + return message; + }, + + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryParamsResponse { + const message = { ...baseQueryParamsResponse } as QueryParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + return message; + }, +}; + +/** Query provides defines the gRPC querier service. */ +export interface Query { + /** DenomTrace queries a denomination trace information. */ + DenomTrace(request: QueryDenomTraceRequest): Promise; + /** DenomTraces queries all denomination traces. */ + DenomTraces(request: QueryDenomTracesRequest): Promise; + /** Params queries all parameters of the ibc-transfer module. */ + Params(request: QueryParamsRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.DenomTrace = this.DenomTrace.bind(this); + this.DenomTraces = this.DenomTraces.bind(this); + this.Params = this.Params.bind(this); + } + DenomTrace(request: QueryDenomTraceRequest): Promise { + const data = QueryDenomTraceRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "DenomTrace", data); + return promise.then((data) => QueryDenomTraceResponse.decode(new _m0.Reader(data))); + } + + DenomTraces(request: QueryDenomTracesRequest): Promise { + const data = QueryDenomTracesRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "DenomTraces", data); + return promise.then((data) => QueryDenomTracesResponse.decode(new _m0.Reader(data))); + } + + Params(request: QueryParamsRequest): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "Params", data); + return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/ibc/applications/transfer/v1/transfer.ts b/src/ibc/applications/transfer/v1/transfer.ts new file mode 100644 index 00000000..e96c3beb --- /dev/null +++ b/src/ibc/applications/transfer/v1/transfer.ts @@ -0,0 +1,320 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "ibc.applications.transfer.v1"; + +/** + * FungibleTokenPacketData defines a struct for the packet payload + * See FungibleTokenPacketData spec: + * https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures + */ +export interface FungibleTokenPacketData { + /** the token denomination to be transferred */ + denom: string; + /** the token amount to be transferred */ + amount: Long; + /** the sender address */ + sender: string; + /** the recipient address on the destination chain */ + receiver: string; +} + +/** + * DenomTrace contains the base denomination for ICS20 fungible tokens and the + * source tracing information path. + */ +export interface DenomTrace { + /** + * path defines the chain of port/channel identifiers used for tracing the + * source of the fungible token. + */ + path: string; + /** base denomination of the relayed fungible token. */ + baseDenom: string; +} + +/** + * Params defines the set of IBC transfer parameters. + * NOTE: To prevent a single token from being transferred, set the + * TransfersEnabled parameter to true and then set the bank module's SendEnabled + * parameter for the denomination to false. + */ +export interface Params { + /** + * send_enabled enables or disables all cross-chain token transfers from this + * chain. + */ + sendEnabled: boolean; + /** + * receive_enabled enables or disables all cross-chain token transfers to this + * chain. + */ + receiveEnabled: boolean; +} + +const baseFungibleTokenPacketData: object = { denom: "", amount: Long.UZERO, sender: "", receiver: "" }; + +export const FungibleTokenPacketData = { + encode(message: FungibleTokenPacketData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (!message.amount.isZero()) { + writer.uint32(16).uint64(message.amount); + } + if (message.sender !== "") { + writer.uint32(26).string(message.sender); + } + if (message.receiver !== "") { + writer.uint32(34).string(message.receiver); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FungibleTokenPacketData { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFungibleTokenPacketData } as FungibleTokenPacketData; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.amount = reader.uint64() as Long; + break; + case 3: + message.sender = reader.string(); + break; + case 4: + message.receiver = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FungibleTokenPacketData { + const message = { ...baseFungibleTokenPacketData } as FungibleTokenPacketData; + if (object.denom !== undefined && object.denom !== null) { + message.denom = String(object.denom); + } else { + message.denom = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Long.fromString(object.amount); + } else { + message.amount = Long.UZERO; + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = String(object.sender); + } else { + message.sender = ""; + } + if (object.receiver !== undefined && object.receiver !== null) { + message.receiver = String(object.receiver); + } else { + message.receiver = ""; + } + return message; + }, + + toJSON(message: FungibleTokenPacketData): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.amount !== undefined && (obj.amount = (message.amount || Long.UZERO).toString()); + message.sender !== undefined && (obj.sender = message.sender); + message.receiver !== undefined && (obj.receiver = message.receiver); + return obj; + }, + + fromPartial(object: DeepPartial): FungibleTokenPacketData { + const message = { ...baseFungibleTokenPacketData } as FungibleTokenPacketData; + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } else { + message.denom = ""; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = object.amount as Long; + } else { + message.amount = Long.UZERO; + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } else { + message.sender = ""; + } + if (object.receiver !== undefined && object.receiver !== null) { + message.receiver = object.receiver; + } else { + message.receiver = ""; + } + return message; + }, +}; + +const baseDenomTrace: object = { path: "", baseDenom: "" }; + +export const DenomTrace = { + encode(message: DenomTrace, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.path !== "") { + writer.uint32(10).string(message.path); + } + if (message.baseDenom !== "") { + writer.uint32(18).string(message.baseDenom); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DenomTrace { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDenomTrace } as DenomTrace; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.string(); + break; + case 2: + message.baseDenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DenomTrace { + const message = { ...baseDenomTrace } as DenomTrace; + if (object.path !== undefined && object.path !== null) { + message.path = String(object.path); + } else { + message.path = ""; + } + if (object.baseDenom !== undefined && object.baseDenom !== null) { + message.baseDenom = String(object.baseDenom); + } else { + message.baseDenom = ""; + } + return message; + }, + + toJSON(message: DenomTrace): unknown { + const obj: any = {}; + message.path !== undefined && (obj.path = message.path); + message.baseDenom !== undefined && (obj.baseDenom = message.baseDenom); + return obj; + }, + + fromPartial(object: DeepPartial): DenomTrace { + const message = { ...baseDenomTrace } as DenomTrace; + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } else { + message.path = ""; + } + if (object.baseDenom !== undefined && object.baseDenom !== null) { + message.baseDenom = object.baseDenom; + } else { + message.baseDenom = ""; + } + return message; + }, +}; + +const baseParams: object = { sendEnabled: false, receiveEnabled: false }; + +export const Params = { + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sendEnabled === true) { + writer.uint32(8).bool(message.sendEnabled); + } + if (message.receiveEnabled === true) { + writer.uint32(16).bool(message.receiveEnabled); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseParams } as Params; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sendEnabled = reader.bool(); + break; + case 2: + message.receiveEnabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Params { + const message = { ...baseParams } as Params; + if (object.sendEnabled !== undefined && object.sendEnabled !== null) { + message.sendEnabled = Boolean(object.sendEnabled); + } else { + message.sendEnabled = false; + } + if (object.receiveEnabled !== undefined && object.receiveEnabled !== null) { + message.receiveEnabled = Boolean(object.receiveEnabled); + } else { + message.receiveEnabled = false; + } + return message; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + message.sendEnabled !== undefined && (obj.sendEnabled = message.sendEnabled); + message.receiveEnabled !== undefined && (obj.receiveEnabled = message.receiveEnabled); + return obj; + }, + + fromPartial(object: DeepPartial): Params { + const message = { ...baseParams } as Params; + if (object.sendEnabled !== undefined && object.sendEnabled !== null) { + message.sendEnabled = object.sendEnabled; + } else { + message.sendEnabled = false; + } + if (object.receiveEnabled !== undefined && object.receiveEnabled !== null) { + message.receiveEnabled = object.receiveEnabled; + } else { + message.receiveEnabled = false; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/ibc/applications/transfer/v1/tx.ts b/src/ibc/applications/transfer/v1/tx.ts new file mode 100644 index 00000000..3ec28878 --- /dev/null +++ b/src/ibc/applications/transfer/v1/tx.ts @@ -0,0 +1,280 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Coin } from "../../../../cosmos/base/v1beta1/coin"; +import { Height } from "../../../../ibc/core/client/v1/client"; + +export const protobufPackage = "ibc.applications.transfer.v1"; + +/** + * MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between + * ICS20 enabled chains. See ICS Spec here: + * https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures + */ +export interface MsgTransfer { + /** the port on which the packet will be sent */ + sourcePort: string; + /** the channel by which the packet will be sent */ + sourceChannel: string; + /** the tokens to be transferred */ + token?: Coin; + /** the sender address */ + sender: string; + /** the recipient address on the destination chain */ + receiver: string; + /** + * Timeout height relative to the current block height. + * The timeout is disabled when set to 0. + */ + timeoutHeight?: Height; + /** + * Timeout timestamp (in nanoseconds) relative to the current block timestamp. + * The timeout is disabled when set to 0. + */ + timeoutTimestamp: Long; +} + +/** MsgTransferResponse defines the Msg/Transfer response type. */ +export interface MsgTransferResponse {} + +const baseMsgTransfer: object = { + sourcePort: "", + sourceChannel: "", + sender: "", + receiver: "", + timeoutTimestamp: Long.UZERO, +}; + +export const MsgTransfer = { + encode(message: MsgTransfer, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sourcePort !== "") { + writer.uint32(10).string(message.sourcePort); + } + if (message.sourceChannel !== "") { + writer.uint32(18).string(message.sourceChannel); + } + if (message.token !== undefined) { + Coin.encode(message.token, writer.uint32(26).fork()).ldelim(); + } + if (message.sender !== "") { + writer.uint32(34).string(message.sender); + } + if (message.receiver !== "") { + writer.uint32(42).string(message.receiver); + } + if (message.timeoutHeight !== undefined) { + Height.encode(message.timeoutHeight, writer.uint32(50).fork()).ldelim(); + } + if (!message.timeoutTimestamp.isZero()) { + writer.uint32(56).uint64(message.timeoutTimestamp); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgTransfer { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgTransfer } as MsgTransfer; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sourcePort = reader.string(); + break; + case 2: + message.sourceChannel = reader.string(); + break; + case 3: + message.token = Coin.decode(reader, reader.uint32()); + break; + case 4: + message.sender = reader.string(); + break; + case 5: + message.receiver = reader.string(); + break; + case 6: + message.timeoutHeight = Height.decode(reader, reader.uint32()); + break; + case 7: + message.timeoutTimestamp = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgTransfer { + const message = { ...baseMsgTransfer } as MsgTransfer; + if (object.sourcePort !== undefined && object.sourcePort !== null) { + message.sourcePort = String(object.sourcePort); + } else { + message.sourcePort = ""; + } + if (object.sourceChannel !== undefined && object.sourceChannel !== null) { + message.sourceChannel = String(object.sourceChannel); + } else { + message.sourceChannel = ""; + } + if (object.token !== undefined && object.token !== null) { + message.token = Coin.fromJSON(object.token); + } else { + message.token = undefined; + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = String(object.sender); + } else { + message.sender = ""; + } + if (object.receiver !== undefined && object.receiver !== null) { + message.receiver = String(object.receiver); + } else { + message.receiver = ""; + } + if (object.timeoutHeight !== undefined && object.timeoutHeight !== null) { + message.timeoutHeight = Height.fromJSON(object.timeoutHeight); + } else { + message.timeoutHeight = undefined; + } + if (object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null) { + message.timeoutTimestamp = Long.fromString(object.timeoutTimestamp); + } else { + message.timeoutTimestamp = Long.UZERO; + } + return message; + }, + + toJSON(message: MsgTransfer): unknown { + const obj: any = {}; + message.sourcePort !== undefined && (obj.sourcePort = message.sourcePort); + message.sourceChannel !== undefined && (obj.sourceChannel = message.sourceChannel); + message.token !== undefined && (obj.token = message.token ? Coin.toJSON(message.token) : undefined); + message.sender !== undefined && (obj.sender = message.sender); + message.receiver !== undefined && (obj.receiver = message.receiver); + message.timeoutHeight !== undefined && + (obj.timeoutHeight = message.timeoutHeight ? Height.toJSON(message.timeoutHeight) : undefined); + message.timeoutTimestamp !== undefined && + (obj.timeoutTimestamp = (message.timeoutTimestamp || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): MsgTransfer { + const message = { ...baseMsgTransfer } as MsgTransfer; + if (object.sourcePort !== undefined && object.sourcePort !== null) { + message.sourcePort = object.sourcePort; + } else { + message.sourcePort = ""; + } + if (object.sourceChannel !== undefined && object.sourceChannel !== null) { + message.sourceChannel = object.sourceChannel; + } else { + message.sourceChannel = ""; + } + if (object.token !== undefined && object.token !== null) { + message.token = Coin.fromPartial(object.token); + } else { + message.token = undefined; + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } else { + message.sender = ""; + } + if (object.receiver !== undefined && object.receiver !== null) { + message.receiver = object.receiver; + } else { + message.receiver = ""; + } + if (object.timeoutHeight !== undefined && object.timeoutHeight !== null) { + message.timeoutHeight = Height.fromPartial(object.timeoutHeight); + } else { + message.timeoutHeight = undefined; + } + if (object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null) { + message.timeoutTimestamp = object.timeoutTimestamp as Long; + } else { + message.timeoutTimestamp = Long.UZERO; + } + return message; + }, +}; + +const baseMsgTransferResponse: object = {}; + +export const MsgTransferResponse = { + encode(_: MsgTransferResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgTransferResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgTransferResponse } as MsgTransferResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgTransferResponse { + const message = { ...baseMsgTransferResponse } as MsgTransferResponse; + return message; + }, + + toJSON(_: MsgTransferResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgTransferResponse { + const message = { ...baseMsgTransferResponse } as MsgTransferResponse; + return message; + }, +}; + +/** Msg defines the ibc/transfer Msg service. */ +export interface Msg { + /** Transfer defines a rpc handler method for MsgTransfer. */ + Transfer(request: MsgTransfer): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Transfer = this.Transfer.bind(this); + } + Transfer(request: MsgTransfer): Promise { + const data = MsgTransfer.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.transfer.v1.Msg", "Transfer", data); + return promise.then((data) => MsgTransferResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/ibc/core/channel/v1/channel.ts b/src/ibc/core/channel/v1/channel.ts new file mode 100644 index 00000000..9420ca25 --- /dev/null +++ b/src/ibc/core/channel/v1/channel.ts @@ -0,0 +1,1008 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Height } from "../../../../ibc/core/client/v1/client"; + +export const protobufPackage = "ibc.core.channel.v1"; + +/** + * State defines if a channel is in one of the following states: + * CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + */ +export enum State { + /** STATE_UNINITIALIZED_UNSPECIFIED - Default State */ + STATE_UNINITIALIZED_UNSPECIFIED = 0, + /** STATE_INIT - A channel has just started the opening handshake. */ + STATE_INIT = 1, + /** STATE_TRYOPEN - A channel has acknowledged the handshake step on the counterparty chain. */ + STATE_TRYOPEN = 2, + /** + * STATE_OPEN - A channel has completed the handshake. Open channels are + * ready to send and receive packets. + */ + STATE_OPEN = 3, + /** + * STATE_CLOSED - A channel has been closed and can no longer be used to send or receive + * packets. + */ + STATE_CLOSED = 4, + UNRECOGNIZED = -1, +} + +export function stateFromJSON(object: any): State { + switch (object) { + case 0: + case "STATE_UNINITIALIZED_UNSPECIFIED": + return State.STATE_UNINITIALIZED_UNSPECIFIED; + case 1: + case "STATE_INIT": + return State.STATE_INIT; + case 2: + case "STATE_TRYOPEN": + return State.STATE_TRYOPEN; + case 3: + case "STATE_OPEN": + return State.STATE_OPEN; + case 4: + case "STATE_CLOSED": + return State.STATE_CLOSED; + case -1: + case "UNRECOGNIZED": + default: + return State.UNRECOGNIZED; + } +} + +export function stateToJSON(object: State): string { + switch (object) { + case State.STATE_UNINITIALIZED_UNSPECIFIED: + return "STATE_UNINITIALIZED_UNSPECIFIED"; + case State.STATE_INIT: + return "STATE_INIT"; + case State.STATE_TRYOPEN: + return "STATE_TRYOPEN"; + case State.STATE_OPEN: + return "STATE_OPEN"; + case State.STATE_CLOSED: + return "STATE_CLOSED"; + default: + return "UNKNOWN"; + } +} + +/** Order defines if a channel is ORDERED or UNORDERED */ +export enum Order { + /** ORDER_NONE_UNSPECIFIED - zero-value for channel ordering */ + ORDER_NONE_UNSPECIFIED = 0, + /** + * ORDER_UNORDERED - packets can be delivered in any order, which may differ from the order in + * which they were sent. + */ + ORDER_UNORDERED = 1, + /** ORDER_ORDERED - packets are delivered exactly in the order which they were sent */ + ORDER_ORDERED = 2, + UNRECOGNIZED = -1, +} + +export function orderFromJSON(object: any): Order { + switch (object) { + case 0: + case "ORDER_NONE_UNSPECIFIED": + return Order.ORDER_NONE_UNSPECIFIED; + case 1: + case "ORDER_UNORDERED": + return Order.ORDER_UNORDERED; + case 2: + case "ORDER_ORDERED": + return Order.ORDER_ORDERED; + case -1: + case "UNRECOGNIZED": + default: + return Order.UNRECOGNIZED; + } +} + +export function orderToJSON(object: Order): string { + switch (object) { + case Order.ORDER_NONE_UNSPECIFIED: + return "ORDER_NONE_UNSPECIFIED"; + case Order.ORDER_UNORDERED: + return "ORDER_UNORDERED"; + case Order.ORDER_ORDERED: + return "ORDER_ORDERED"; + default: + return "UNKNOWN"; + } +} + +/** + * Channel defines pipeline for exactly-once packet delivery between specific + * modules on separate blockchains, which has at least one end capable of + * sending packets and one end capable of receiving packets. + */ +export interface Channel { + /** current state of the channel end */ + state: State; + /** whether the channel is ordered or unordered */ + ordering: Order; + /** counterparty channel end */ + counterparty?: Counterparty; + /** + * list of connection identifiers, in order, along which packets sent on + * this channel will travel + */ + connectionHops: string[]; + /** opaque channel version, which is agreed upon during the handshake */ + version: string; +} + +/** + * IdentifiedChannel defines a channel with additional port and channel + * identifier fields. + */ +export interface IdentifiedChannel { + /** current state of the channel end */ + state: State; + /** whether the channel is ordered or unordered */ + ordering: Order; + /** counterparty channel end */ + counterparty?: Counterparty; + /** + * list of connection identifiers, in order, along which packets sent on + * this channel will travel + */ + connectionHops: string[]; + /** opaque channel version, which is agreed upon during the handshake */ + version: string; + /** port identifier */ + portId: string; + /** channel identifier */ + channelId: string; +} + +/** Counterparty defines a channel end counterparty */ +export interface Counterparty { + /** port on the counterparty chain which owns the other end of the channel. */ + portId: string; + /** channel end on the counterparty chain */ + channelId: string; +} + +/** Packet defines a type that carries data across different chains through IBC */ +export interface Packet { + /** + * number corresponds to the order of sends and receives, where a Packet + * with an earlier sequence number must be sent and received before a Packet + * with a later sequence number. + */ + sequence: Long; + /** identifies the port on the sending chain. */ + sourcePort: string; + /** identifies the channel end on the sending chain. */ + sourceChannel: string; + /** identifies the port on the receiving chain. */ + destinationPort: string; + /** identifies the channel end on the receiving chain. */ + destinationChannel: string; + /** actual opaque bytes transferred directly to the application module */ + data: Uint8Array; + /** block height after which the packet times out */ + timeoutHeight?: Height; + /** block timestamp (in nanoseconds) after which the packet times out */ + timeoutTimestamp: Long; +} + +/** + * PacketState defines the generic type necessary to retrieve and store + * packet commitments, acknowledgements, and receipts. + * Caller is responsible for knowing the context necessary to interpret this + * state as a commitment, acknowledgement, or a receipt. + */ +export interface PacketState { + /** channel port identifier. */ + portId: string; + /** channel unique identifier. */ + channelId: string; + /** packet sequence. */ + sequence: Long; + /** embedded data that represents packet state. */ + data: Uint8Array; +} + +/** + * Acknowledgement is the recommended acknowledgement format to be used by + * app-specific protocols. + * NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental + * conflicts with other protobuf message formats used for acknowledgements. + * The first byte of any message with this format will be the non-ASCII values + * `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: + * https://github.com/cosmos/ics/tree/master/spec/ics-004-channel-and-packet-semantics#acknowledgement-envelope + */ +export interface Acknowledgement { + result: Uint8Array | undefined; + error: string | undefined; +} + +const baseChannel: object = { state: 0, ordering: 0, connectionHops: "", version: "" }; + +export const Channel = { + encode(message: Channel, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.state !== 0) { + writer.uint32(8).int32(message.state); + } + if (message.ordering !== 0) { + writer.uint32(16).int32(message.ordering); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.connectionHops) { + writer.uint32(34).string(v!); + } + if (message.version !== "") { + writer.uint32(42).string(message.version); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Channel { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseChannel } as Channel; + message.connectionHops = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32() as any; + break; + case 2: + message.ordering = reader.int32() as any; + break; + case 3: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 4: + message.connectionHops.push(reader.string()); + break; + case 5: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Channel { + const message = { ...baseChannel } as Channel; + message.connectionHops = []; + if (object.state !== undefined && object.state !== null) { + message.state = stateFromJSON(object.state); + } else { + message.state = 0; + } + if (object.ordering !== undefined && object.ordering !== null) { + message.ordering = orderFromJSON(object.ordering); + } else { + message.ordering = 0; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromJSON(object.counterparty); + } else { + message.counterparty = undefined; + } + if (object.connectionHops !== undefined && object.connectionHops !== null) { + for (const e of object.connectionHops) { + message.connectionHops.push(String(e)); + } + } + if (object.version !== undefined && object.version !== null) { + message.version = String(object.version); + } else { + message.version = ""; + } + return message; + }, + + toJSON(message: Channel): unknown { + const obj: any = {}; + message.state !== undefined && (obj.state = stateToJSON(message.state)); + message.ordering !== undefined && (obj.ordering = orderToJSON(message.ordering)); + message.counterparty !== undefined && + (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); + if (message.connectionHops) { + obj.connectionHops = message.connectionHops.map((e) => e); + } else { + obj.connectionHops = []; + } + message.version !== undefined && (obj.version = message.version); + return obj; + }, + + fromPartial(object: DeepPartial): Channel { + const message = { ...baseChannel } as Channel; + message.connectionHops = []; + if (object.state !== undefined && object.state !== null) { + message.state = object.state; + } else { + message.state = 0; + } + if (object.ordering !== undefined && object.ordering !== null) { + message.ordering = object.ordering; + } else { + message.ordering = 0; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromPartial(object.counterparty); + } else { + message.counterparty = undefined; + } + if (object.connectionHops !== undefined && object.connectionHops !== null) { + for (const e of object.connectionHops) { + message.connectionHops.push(e); + } + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } else { + message.version = ""; + } + return message; + }, +}; + +const baseIdentifiedChannel: object = { + state: 0, + ordering: 0, + connectionHops: "", + version: "", + portId: "", + channelId: "", +}; + +export const IdentifiedChannel = { + encode(message: IdentifiedChannel, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.state !== 0) { + writer.uint32(8).int32(message.state); + } + if (message.ordering !== 0) { + writer.uint32(16).int32(message.ordering); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.connectionHops) { + writer.uint32(34).string(v!); + } + if (message.version !== "") { + writer.uint32(42).string(message.version); + } + if (message.portId !== "") { + writer.uint32(50).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(58).string(message.channelId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): IdentifiedChannel { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseIdentifiedChannel } as IdentifiedChannel; + message.connectionHops = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32() as any; + break; + case 2: + message.ordering = reader.int32() as any; + break; + case 3: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 4: + message.connectionHops.push(reader.string()); + break; + case 5: + message.version = reader.string(); + break; + case 6: + message.portId = reader.string(); + break; + case 7: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): IdentifiedChannel { + const message = { ...baseIdentifiedChannel } as IdentifiedChannel; + message.connectionHops = []; + if (object.state !== undefined && object.state !== null) { + message.state = stateFromJSON(object.state); + } else { + message.state = 0; + } + if (object.ordering !== undefined && object.ordering !== null) { + message.ordering = orderFromJSON(object.ordering); + } else { + message.ordering = 0; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromJSON(object.counterparty); + } else { + message.counterparty = undefined; + } + if (object.connectionHops !== undefined && object.connectionHops !== null) { + for (const e of object.connectionHops) { + message.connectionHops.push(String(e)); + } + } + if (object.version !== undefined && object.version !== null) { + message.version = String(object.version); + } else { + message.version = ""; + } + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + return message; + }, + + toJSON(message: IdentifiedChannel): unknown { + const obj: any = {}; + message.state !== undefined && (obj.state = stateToJSON(message.state)); + message.ordering !== undefined && (obj.ordering = orderToJSON(message.ordering)); + message.counterparty !== undefined && + (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); + if (message.connectionHops) { + obj.connectionHops = message.connectionHops.map((e) => e); + } else { + obj.connectionHops = []; + } + message.version !== undefined && (obj.version = message.version); + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, + + fromPartial(object: DeepPartial): IdentifiedChannel { + const message = { ...baseIdentifiedChannel } as IdentifiedChannel; + message.connectionHops = []; + if (object.state !== undefined && object.state !== null) { + message.state = object.state; + } else { + message.state = 0; + } + if (object.ordering !== undefined && object.ordering !== null) { + message.ordering = object.ordering; + } else { + message.ordering = 0; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromPartial(object.counterparty); + } else { + message.counterparty = undefined; + } + if (object.connectionHops !== undefined && object.connectionHops !== null) { + for (const e of object.connectionHops) { + message.connectionHops.push(e); + } + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } else { + message.version = ""; + } + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + return message; + }, +}; + +const baseCounterparty: object = { portId: "", channelId: "" }; + +export const Counterparty = { + encode(message: Counterparty, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Counterparty { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCounterparty } as Counterparty; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Counterparty { + const message = { ...baseCounterparty } as Counterparty; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + return message; + }, + + toJSON(message: Counterparty): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, + + fromPartial(object: DeepPartial): Counterparty { + const message = { ...baseCounterparty } as Counterparty; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + return message; + }, +}; + +const basePacket: object = { + sequence: Long.UZERO, + sourcePort: "", + sourceChannel: "", + destinationPort: "", + destinationChannel: "", + timeoutTimestamp: Long.UZERO, +}; + +export const Packet = { + encode(message: Packet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.sequence.isZero()) { + writer.uint32(8).uint64(message.sequence); + } + if (message.sourcePort !== "") { + writer.uint32(18).string(message.sourcePort); + } + if (message.sourceChannel !== "") { + writer.uint32(26).string(message.sourceChannel); + } + if (message.destinationPort !== "") { + writer.uint32(34).string(message.destinationPort); + } + if (message.destinationChannel !== "") { + writer.uint32(42).string(message.destinationChannel); + } + if (message.data.length !== 0) { + writer.uint32(50).bytes(message.data); + } + if (message.timeoutHeight !== undefined) { + Height.encode(message.timeoutHeight, writer.uint32(58).fork()).ldelim(); + } + if (!message.timeoutTimestamp.isZero()) { + writer.uint32(64).uint64(message.timeoutTimestamp); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Packet { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePacket } as Packet; + message.data = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64() as Long; + break; + case 2: + message.sourcePort = reader.string(); + break; + case 3: + message.sourceChannel = reader.string(); + break; + case 4: + message.destinationPort = reader.string(); + break; + case 5: + message.destinationChannel = reader.string(); + break; + case 6: + message.data = reader.bytes(); + break; + case 7: + message.timeoutHeight = Height.decode(reader, reader.uint32()); + break; + case 8: + message.timeoutTimestamp = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Packet { + const message = { ...basePacket } as Packet; + message.data = new Uint8Array(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = Long.fromString(object.sequence); + } else { + message.sequence = Long.UZERO; + } + if (object.sourcePort !== undefined && object.sourcePort !== null) { + message.sourcePort = String(object.sourcePort); + } else { + message.sourcePort = ""; + } + if (object.sourceChannel !== undefined && object.sourceChannel !== null) { + message.sourceChannel = String(object.sourceChannel); + } else { + message.sourceChannel = ""; + } + if (object.destinationPort !== undefined && object.destinationPort !== null) { + message.destinationPort = String(object.destinationPort); + } else { + message.destinationPort = ""; + } + if (object.destinationChannel !== undefined && object.destinationChannel !== null) { + message.destinationChannel = String(object.destinationChannel); + } else { + message.destinationChannel = ""; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.timeoutHeight !== undefined && object.timeoutHeight !== null) { + message.timeoutHeight = Height.fromJSON(object.timeoutHeight); + } else { + message.timeoutHeight = undefined; + } + if (object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null) { + message.timeoutTimestamp = Long.fromString(object.timeoutTimestamp); + } else { + message.timeoutTimestamp = Long.UZERO; + } + return message; + }, + + toJSON(message: Packet): unknown { + const obj: any = {}; + message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + message.sourcePort !== undefined && (obj.sourcePort = message.sourcePort); + message.sourceChannel !== undefined && (obj.sourceChannel = message.sourceChannel); + message.destinationPort !== undefined && (obj.destinationPort = message.destinationPort); + message.destinationChannel !== undefined && (obj.destinationChannel = message.destinationChannel); + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.timeoutHeight !== undefined && + (obj.timeoutHeight = message.timeoutHeight ? Height.toJSON(message.timeoutHeight) : undefined); + message.timeoutTimestamp !== undefined && + (obj.timeoutTimestamp = (message.timeoutTimestamp || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): Packet { + const message = { ...basePacket } as Packet; + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = object.sequence as Long; + } else { + message.sequence = Long.UZERO; + } + if (object.sourcePort !== undefined && object.sourcePort !== null) { + message.sourcePort = object.sourcePort; + } else { + message.sourcePort = ""; + } + if (object.sourceChannel !== undefined && object.sourceChannel !== null) { + message.sourceChannel = object.sourceChannel; + } else { + message.sourceChannel = ""; + } + if (object.destinationPort !== undefined && object.destinationPort !== null) { + message.destinationPort = object.destinationPort; + } else { + message.destinationPort = ""; + } + if (object.destinationChannel !== undefined && object.destinationChannel !== null) { + message.destinationChannel = object.destinationChannel; + } else { + message.destinationChannel = ""; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + if (object.timeoutHeight !== undefined && object.timeoutHeight !== null) { + message.timeoutHeight = Height.fromPartial(object.timeoutHeight); + } else { + message.timeoutHeight = undefined; + } + if (object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null) { + message.timeoutTimestamp = object.timeoutTimestamp as Long; + } else { + message.timeoutTimestamp = Long.UZERO; + } + return message; + }, +}; + +const basePacketState: object = { portId: "", channelId: "", sequence: Long.UZERO }; + +export const PacketState = { + encode(message: PacketState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (!message.sequence.isZero()) { + writer.uint32(24).uint64(message.sequence); + } + if (message.data.length !== 0) { + writer.uint32(34).bytes(message.data); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PacketState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePacketState } as PacketState; + message.data = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.sequence = reader.uint64() as Long; + break; + case 4: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PacketState { + const message = { ...basePacketState } as PacketState; + message.data = new Uint8Array(); + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = Long.fromString(object.sequence); + } else { + message.sequence = Long.UZERO; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + + toJSON(message: PacketState): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): PacketState { + const message = { ...basePacketState } as PacketState; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = object.sequence as Long; + } else { + message.sequence = Long.UZERO; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + return message; + }, +}; + +const baseAcknowledgement: object = {}; + +export const Acknowledgement = { + encode(message: Acknowledgement, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.result !== undefined) { + writer.uint32(170).bytes(message.result); + } + if (message.error !== undefined) { + writer.uint32(178).string(message.error); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Acknowledgement { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseAcknowledgement } as Acknowledgement; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 21: + message.result = reader.bytes(); + break; + case 22: + message.error = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Acknowledgement { + const message = { ...baseAcknowledgement } as Acknowledgement; + if (object.result !== undefined && object.result !== null) { + message.result = bytesFromBase64(object.result); + } + if (object.error !== undefined && object.error !== null) { + message.error = String(object.error); + } else { + message.error = undefined; + } + return message; + }, + + toJSON(message: Acknowledgement): unknown { + const obj: any = {}; + message.result !== undefined && + (obj.result = message.result !== undefined ? base64FromBytes(message.result) : undefined); + message.error !== undefined && (obj.error = message.error); + return obj; + }, + + fromPartial(object: DeepPartial): Acknowledgement { + const message = { ...baseAcknowledgement } as Acknowledgement; + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } else { + message.result = undefined; + } + if (object.error !== undefined && object.error !== null) { + message.error = object.error; + } else { + message.error = undefined; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/ibc/core/channel/v1/genesis.ts b/src/ibc/core/channel/v1/genesis.ts new file mode 100644 index 00000000..939f30d8 --- /dev/null +++ b/src/ibc/core/channel/v1/genesis.ts @@ -0,0 +1,358 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { IdentifiedChannel, PacketState } from "../../../../ibc/core/channel/v1/channel"; + +export const protobufPackage = "ibc.core.channel.v1"; + +/** GenesisState defines the ibc channel submodule's genesis state. */ +export interface GenesisState { + channels: IdentifiedChannel[]; + acknowledgements: PacketState[]; + commitments: PacketState[]; + receipts: PacketState[]; + sendSequences: PacketSequence[]; + recvSequences: PacketSequence[]; + ackSequences: PacketSequence[]; + /** the sequence for the next generated channel identifier */ + nextChannelSequence: Long; +} + +/** + * PacketSequence defines the genesis type necessary to retrieve and store + * next send and receive sequences. + */ +export interface PacketSequence { + portId: string; + channelId: string; + sequence: Long; +} + +const baseGenesisState: object = { nextChannelSequence: Long.UZERO }; + +export const GenesisState = { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.channels) { + IdentifiedChannel.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.acknowledgements) { + PacketState.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.commitments) { + PacketState.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.receipts) { + PacketState.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.sendSequences) { + PacketSequence.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.recvSequences) { + PacketSequence.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.ackSequences) { + PacketSequence.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (!message.nextChannelSequence.isZero()) { + writer.uint32(64).uint64(message.nextChannelSequence); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGenesisState } as GenesisState; + message.channels = []; + message.acknowledgements = []; + message.commitments = []; + message.receipts = []; + message.sendSequences = []; + message.recvSequences = []; + message.ackSequences = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channels.push(IdentifiedChannel.decode(reader, reader.uint32())); + break; + case 2: + message.acknowledgements.push(PacketState.decode(reader, reader.uint32())); + break; + case 3: + message.commitments.push(PacketState.decode(reader, reader.uint32())); + break; + case 4: + message.receipts.push(PacketState.decode(reader, reader.uint32())); + break; + case 5: + message.sendSequences.push(PacketSequence.decode(reader, reader.uint32())); + break; + case 6: + message.recvSequences.push(PacketSequence.decode(reader, reader.uint32())); + break; + case 7: + message.ackSequences.push(PacketSequence.decode(reader, reader.uint32())); + break; + case 8: + message.nextChannelSequence = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.channels = []; + message.acknowledgements = []; + message.commitments = []; + message.receipts = []; + message.sendSequences = []; + message.recvSequences = []; + message.ackSequences = []; + if (object.channels !== undefined && object.channels !== null) { + for (const e of object.channels) { + message.channels.push(IdentifiedChannel.fromJSON(e)); + } + } + if (object.acknowledgements !== undefined && object.acknowledgements !== null) { + for (const e of object.acknowledgements) { + message.acknowledgements.push(PacketState.fromJSON(e)); + } + } + if (object.commitments !== undefined && object.commitments !== null) { + for (const e of object.commitments) { + message.commitments.push(PacketState.fromJSON(e)); + } + } + if (object.receipts !== undefined && object.receipts !== null) { + for (const e of object.receipts) { + message.receipts.push(PacketState.fromJSON(e)); + } + } + if (object.sendSequences !== undefined && object.sendSequences !== null) { + for (const e of object.sendSequences) { + message.sendSequences.push(PacketSequence.fromJSON(e)); + } + } + if (object.recvSequences !== undefined && object.recvSequences !== null) { + for (const e of object.recvSequences) { + message.recvSequences.push(PacketSequence.fromJSON(e)); + } + } + if (object.ackSequences !== undefined && object.ackSequences !== null) { + for (const e of object.ackSequences) { + message.ackSequences.push(PacketSequence.fromJSON(e)); + } + } + if (object.nextChannelSequence !== undefined && object.nextChannelSequence !== null) { + message.nextChannelSequence = Long.fromString(object.nextChannelSequence); + } else { + message.nextChannelSequence = Long.UZERO; + } + return message; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.channels) { + obj.channels = message.channels.map((e) => (e ? IdentifiedChannel.toJSON(e) : undefined)); + } else { + obj.channels = []; + } + if (message.acknowledgements) { + obj.acknowledgements = message.acknowledgements.map((e) => (e ? PacketState.toJSON(e) : undefined)); + } else { + obj.acknowledgements = []; + } + if (message.commitments) { + obj.commitments = message.commitments.map((e) => (e ? PacketState.toJSON(e) : undefined)); + } else { + obj.commitments = []; + } + if (message.receipts) { + obj.receipts = message.receipts.map((e) => (e ? PacketState.toJSON(e) : undefined)); + } else { + obj.receipts = []; + } + if (message.sendSequences) { + obj.sendSequences = message.sendSequences.map((e) => (e ? PacketSequence.toJSON(e) : undefined)); + } else { + obj.sendSequences = []; + } + if (message.recvSequences) { + obj.recvSequences = message.recvSequences.map((e) => (e ? PacketSequence.toJSON(e) : undefined)); + } else { + obj.recvSequences = []; + } + if (message.ackSequences) { + obj.ackSequences = message.ackSequences.map((e) => (e ? PacketSequence.toJSON(e) : undefined)); + } else { + obj.ackSequences = []; + } + message.nextChannelSequence !== undefined && + (obj.nextChannelSequence = (message.nextChannelSequence || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.channels = []; + message.acknowledgements = []; + message.commitments = []; + message.receipts = []; + message.sendSequences = []; + message.recvSequences = []; + message.ackSequences = []; + if (object.channels !== undefined && object.channels !== null) { + for (const e of object.channels) { + message.channels.push(IdentifiedChannel.fromPartial(e)); + } + } + if (object.acknowledgements !== undefined && object.acknowledgements !== null) { + for (const e of object.acknowledgements) { + message.acknowledgements.push(PacketState.fromPartial(e)); + } + } + if (object.commitments !== undefined && object.commitments !== null) { + for (const e of object.commitments) { + message.commitments.push(PacketState.fromPartial(e)); + } + } + if (object.receipts !== undefined && object.receipts !== null) { + for (const e of object.receipts) { + message.receipts.push(PacketState.fromPartial(e)); + } + } + if (object.sendSequences !== undefined && object.sendSequences !== null) { + for (const e of object.sendSequences) { + message.sendSequences.push(PacketSequence.fromPartial(e)); + } + } + if (object.recvSequences !== undefined && object.recvSequences !== null) { + for (const e of object.recvSequences) { + message.recvSequences.push(PacketSequence.fromPartial(e)); + } + } + if (object.ackSequences !== undefined && object.ackSequences !== null) { + for (const e of object.ackSequences) { + message.ackSequences.push(PacketSequence.fromPartial(e)); + } + } + if (object.nextChannelSequence !== undefined && object.nextChannelSequence !== null) { + message.nextChannelSequence = object.nextChannelSequence as Long; + } else { + message.nextChannelSequence = Long.UZERO; + } + return message; + }, +}; + +const basePacketSequence: object = { portId: "", channelId: "", sequence: Long.UZERO }; + +export const PacketSequence = { + encode(message: PacketSequence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (!message.sequence.isZero()) { + writer.uint32(24).uint64(message.sequence); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PacketSequence { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePacketSequence } as PacketSequence; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.sequence = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PacketSequence { + const message = { ...basePacketSequence } as PacketSequence; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = Long.fromString(object.sequence); + } else { + message.sequence = Long.UZERO; + } + return message; + }, + + toJSON(message: PacketSequence): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): PacketSequence { + const message = { ...basePacketSequence } as PacketSequence; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = object.sequence as Long; + } else { + message.sequence = Long.UZERO; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/ibc/core/channel/v1/query.ts b/src/ibc/core/channel/v1/query.ts new file mode 100644 index 00000000..6c278f9b --- /dev/null +++ b/src/ibc/core/channel/v1/query.ts @@ -0,0 +1,2890 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Channel, IdentifiedChannel, PacketState } from "../../../../ibc/core/channel/v1/channel"; +import { Height, IdentifiedClientState } from "../../../../ibc/core/client/v1/client"; +import { PageRequest, PageResponse } from "../../../../cosmos/base/query/v1beta1/pagination"; +import { Any } from "../../../../google/protobuf/any"; + +export const protobufPackage = "ibc.core.channel.v1"; + +/** QueryChannelRequest is the request type for the Query/Channel RPC method */ +export interface QueryChannelRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; +} + +/** + * QueryChannelResponse is the response type for the Query/Channel RPC method. + * Besides the Channel end, it includes a proof and the height from which the + * proof was retrieved. + */ +export interface QueryChannelResponse { + /** channel associated with the request identifiers */ + channel?: Channel; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight?: Height; +} + +/** QueryChannelsRequest is the request type for the Query/Channels RPC method */ +export interface QueryChannelsRequest { + /** pagination request */ + pagination?: PageRequest; +} + +/** QueryChannelsResponse is the response type for the Query/Channels RPC method. */ +export interface QueryChannelsResponse { + /** list of stored channels of the chain. */ + channels: IdentifiedChannel[]; + /** pagination response */ + pagination?: PageResponse; + /** query block height */ + height?: Height; +} + +/** + * QueryConnectionChannelsRequest is the request type for the + * Query/QueryConnectionChannels RPC method + */ +export interface QueryConnectionChannelsRequest { + /** connection unique identifier */ + connection: string; + /** pagination request */ + pagination?: PageRequest; +} + +/** + * QueryConnectionChannelsResponse is the Response type for the + * Query/QueryConnectionChannels RPC method + */ +export interface QueryConnectionChannelsResponse { + /** list of channels associated with a connection. */ + channels: IdentifiedChannel[]; + /** pagination response */ + pagination?: PageResponse; + /** query block height */ + height?: Height; +} + +/** + * QueryChannelClientStateRequest is the request type for the Query/ClientState + * RPC method + */ +export interface QueryChannelClientStateRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; +} + +/** + * QueryChannelClientStateResponse is the Response type for the + * Query/QueryChannelClientState RPC method + */ +export interface QueryChannelClientStateResponse { + /** client state associated with the channel */ + identifiedClientState?: IdentifiedClientState; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight?: Height; +} + +/** + * QueryChannelConsensusStateRequest is the request type for the + * Query/ConsensusState RPC method + */ +export interface QueryChannelConsensusStateRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** revision number of the consensus state */ + revisionNumber: Long; + /** revision height of the consensus state */ + revisionHeight: Long; +} + +/** + * QueryChannelClientStateResponse is the Response type for the + * Query/QueryChannelClientState RPC method + */ +export interface QueryChannelConsensusStateResponse { + /** consensus state associated with the channel */ + consensusState?: Any; + /** client ID associated with the consensus state */ + clientId: string; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight?: Height; +} + +/** + * QueryPacketCommitmentRequest is the request type for the + * Query/PacketCommitment RPC method + */ +export interface QueryPacketCommitmentRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** packet sequence */ + sequence: Long; +} + +/** + * QueryPacketCommitmentResponse defines the client query response for a packet + * which also includes a proof and the height from which the proof was + * retrieved + */ +export interface QueryPacketCommitmentResponse { + /** packet associated with the request fields */ + commitment: Uint8Array; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight?: Height; +} + +/** + * QueryPacketCommitmentsRequest is the request type for the + * Query/QueryPacketCommitments RPC method + */ +export interface QueryPacketCommitmentsRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** pagination request */ + pagination?: PageRequest; +} + +/** + * QueryPacketCommitmentsResponse is the request type for the + * Query/QueryPacketCommitments RPC method + */ +export interface QueryPacketCommitmentsResponse { + commitments: PacketState[]; + /** pagination response */ + pagination?: PageResponse; + /** query block height */ + height?: Height; +} + +/** + * QueryPacketReceiptRequest is the request type for the + * Query/PacketReceipt RPC method + */ +export interface QueryPacketReceiptRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** packet sequence */ + sequence: Long; +} + +/** + * QueryPacketReceiptResponse defines the client query response for a packet receipt + * which also includes a proof, and the height from which the proof was + * retrieved + */ +export interface QueryPacketReceiptResponse { + /** success flag for if receipt exists */ + received: boolean; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight?: Height; +} + +/** + * QueryPacketAcknowledgementRequest is the request type for the + * Query/PacketAcknowledgement RPC method + */ +export interface QueryPacketAcknowledgementRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** packet sequence */ + sequence: Long; +} + +/** + * QueryPacketAcknowledgementResponse defines the client query response for a + * packet which also includes a proof and the height from which the + * proof was retrieved + */ +export interface QueryPacketAcknowledgementResponse { + /** packet associated with the request fields */ + acknowledgement: Uint8Array; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight?: Height; +} + +/** + * QueryPacketAcknowledgementsRequest is the request type for the + * Query/QueryPacketCommitments RPC method + */ +export interface QueryPacketAcknowledgementsRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** pagination request */ + pagination?: PageRequest; +} + +/** + * QueryPacketAcknowledgemetsResponse is the request type for the + * Query/QueryPacketAcknowledgements RPC method + */ +export interface QueryPacketAcknowledgementsResponse { + acknowledgements: PacketState[]; + /** pagination response */ + pagination?: PageResponse; + /** query block height */ + height?: Height; +} + +/** + * QueryUnreceivedPacketsRequest is the request type for the + * Query/UnreceivedPackets RPC method + */ +export interface QueryUnreceivedPacketsRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** list of packet sequences */ + packetCommitmentSequences: Long[]; +} + +/** + * QueryUnreceivedPacketsResponse is the response type for the + * Query/UnreceivedPacketCommitments RPC method + */ +export interface QueryUnreceivedPacketsResponse { + /** list of unreceived packet sequences */ + sequences: Long[]; + /** query block height */ + height?: Height; +} + +/** + * QueryUnreceivedAcks is the request type for the + * Query/UnreceivedAcks RPC method + */ +export interface QueryUnreceivedAcksRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** list of acknowledgement sequences */ + packetAckSequences: Long[]; +} + +/** + * QueryUnreceivedAcksResponse is the response type for the + * Query/UnreceivedAcks RPC method + */ +export interface QueryUnreceivedAcksResponse { + /** list of unreceived acknowledgement sequences */ + sequences: Long[]; + /** query block height */ + height?: Height; +} + +/** + * QueryNextSequenceReceiveRequest is the request type for the + * Query/QueryNextSequenceReceiveRequest RPC method + */ +export interface QueryNextSequenceReceiveRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; +} + +/** + * QuerySequenceResponse is the request type for the + * Query/QueryNextSequenceReceiveResponse RPC method + */ +export interface QueryNextSequenceReceiveResponse { + /** next sequence receive number */ + nextSequenceReceive: Long; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight?: Height; +} + +const baseQueryChannelRequest: object = { portId: "", channelId: "" }; + +export const QueryChannelRequest = { + encode(message: QueryChannelRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryChannelRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryChannelRequest } as QueryChannelRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryChannelRequest { + const message = { ...baseQueryChannelRequest } as QueryChannelRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + return message; + }, + + toJSON(message: QueryChannelRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, + + fromPartial(object: DeepPartial): QueryChannelRequest { + const message = { ...baseQueryChannelRequest } as QueryChannelRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + return message; + }, +}; + +const baseQueryChannelResponse: object = {}; + +export const QueryChannelResponse = { + encode(message: QueryChannelResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.channel !== undefined) { + Channel.encode(message.channel, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryChannelResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryChannelResponse } as QueryChannelResponse; + message.proof = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channel = Channel.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryChannelResponse { + const message = { ...baseQueryChannelResponse } as QueryChannelResponse; + message.proof = new Uint8Array(); + if (object.channel !== undefined && object.channel !== null) { + message.channel = Channel.fromJSON(object.channel); + } else { + message.channel = undefined; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + + toJSON(message: QueryChannelResponse): unknown { + const obj: any = {}; + message.channel !== undefined && + (obj.channel = message.channel ? Channel.toJSON(message.channel) : undefined); + message.proof !== undefined && + (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryChannelResponse { + const message = { ...baseQueryChannelResponse } as QueryChannelResponse; + if (object.channel !== undefined && object.channel !== null) { + message.channel = Channel.fromPartial(object.channel); + } else { + message.channel = undefined; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = object.proof; + } else { + message.proof = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, +}; + +const baseQueryChannelsRequest: object = {}; + +export const QueryChannelsRequest = { + encode(message: QueryChannelsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryChannelsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryChannelsRequest } as QueryChannelsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryChannelsRequest { + const message = { ...baseQueryChannelsRequest } as QueryChannelsRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryChannelsRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryChannelsRequest { + const message = { ...baseQueryChannelsRequest } as QueryChannelsRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryChannelsResponse: object = {}; + +export const QueryChannelsResponse = { + encode(message: QueryChannelsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.channels) { + IdentifiedChannel.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryChannelsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryChannelsResponse } as QueryChannelsResponse; + message.channels = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channels.push(IdentifiedChannel.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + case 3: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryChannelsResponse { + const message = { ...baseQueryChannelsResponse } as QueryChannelsResponse; + message.channels = []; + if (object.channels !== undefined && object.channels !== null) { + for (const e of object.channels) { + message.channels.push(IdentifiedChannel.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromJSON(object.height); + } else { + message.height = undefined; + } + return message; + }, + + toJSON(message: QueryChannelsResponse): unknown { + const obj: any = {}; + if (message.channels) { + obj.channels = message.channels.map((e) => (e ? IdentifiedChannel.toJSON(e) : undefined)); + } else { + obj.channels = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryChannelsResponse { + const message = { ...baseQueryChannelsResponse } as QueryChannelsResponse; + message.channels = []; + if (object.channels !== undefined && object.channels !== null) { + for (const e of object.channels) { + message.channels.push(IdentifiedChannel.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromPartial(object.height); + } else { + message.height = undefined; + } + return message; + }, +}; + +const baseQueryConnectionChannelsRequest: object = { connection: "" }; + +export const QueryConnectionChannelsRequest = { + encode(message: QueryConnectionChannelsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.connection !== "") { + writer.uint32(10).string(message.connection); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionChannelsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryConnectionChannelsRequest } as QueryConnectionChannelsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connection = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConnectionChannelsRequest { + const message = { ...baseQueryConnectionChannelsRequest } as QueryConnectionChannelsRequest; + if (object.connection !== undefined && object.connection !== null) { + message.connection = String(object.connection); + } else { + message.connection = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryConnectionChannelsRequest): unknown { + const obj: any = {}; + message.connection !== undefined && (obj.connection = message.connection); + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryConnectionChannelsRequest { + const message = { ...baseQueryConnectionChannelsRequest } as QueryConnectionChannelsRequest; + if (object.connection !== undefined && object.connection !== null) { + message.connection = object.connection; + } else { + message.connection = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryConnectionChannelsResponse: object = {}; + +export const QueryConnectionChannelsResponse = { + encode(message: QueryConnectionChannelsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.channels) { + IdentifiedChannel.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionChannelsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryConnectionChannelsResponse } as QueryConnectionChannelsResponse; + message.channels = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channels.push(IdentifiedChannel.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + case 3: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConnectionChannelsResponse { + const message = { ...baseQueryConnectionChannelsResponse } as QueryConnectionChannelsResponse; + message.channels = []; + if (object.channels !== undefined && object.channels !== null) { + for (const e of object.channels) { + message.channels.push(IdentifiedChannel.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromJSON(object.height); + } else { + message.height = undefined; + } + return message; + }, + + toJSON(message: QueryConnectionChannelsResponse): unknown { + const obj: any = {}; + if (message.channels) { + obj.channels = message.channels.map((e) => (e ? IdentifiedChannel.toJSON(e) : undefined)); + } else { + obj.channels = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryConnectionChannelsResponse { + const message = { ...baseQueryConnectionChannelsResponse } as QueryConnectionChannelsResponse; + message.channels = []; + if (object.channels !== undefined && object.channels !== null) { + for (const e of object.channels) { + message.channels.push(IdentifiedChannel.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromPartial(object.height); + } else { + message.height = undefined; + } + return message; + }, +}; + +const baseQueryChannelClientStateRequest: object = { portId: "", channelId: "" }; + +export const QueryChannelClientStateRequest = { + encode(message: QueryChannelClientStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryChannelClientStateRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryChannelClientStateRequest } as QueryChannelClientStateRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryChannelClientStateRequest { + const message = { ...baseQueryChannelClientStateRequest } as QueryChannelClientStateRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + return message; + }, + + toJSON(message: QueryChannelClientStateRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, + + fromPartial(object: DeepPartial): QueryChannelClientStateRequest { + const message = { ...baseQueryChannelClientStateRequest } as QueryChannelClientStateRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + return message; + }, +}; + +const baseQueryChannelClientStateResponse: object = {}; + +export const QueryChannelClientStateResponse = { + encode(message: QueryChannelClientStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.identifiedClientState !== undefined) { + IdentifiedClientState.encode(message.identifiedClientState, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryChannelClientStateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryChannelClientStateResponse } as QueryChannelClientStateResponse; + message.proof = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identifiedClientState = IdentifiedClientState.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryChannelClientStateResponse { + const message = { ...baseQueryChannelClientStateResponse } as QueryChannelClientStateResponse; + message.proof = new Uint8Array(); + if (object.identifiedClientState !== undefined && object.identifiedClientState !== null) { + message.identifiedClientState = IdentifiedClientState.fromJSON(object.identifiedClientState); + } else { + message.identifiedClientState = undefined; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + + toJSON(message: QueryChannelClientStateResponse): unknown { + const obj: any = {}; + message.identifiedClientState !== undefined && + (obj.identifiedClientState = message.identifiedClientState + ? IdentifiedClientState.toJSON(message.identifiedClientState) + : undefined); + message.proof !== undefined && + (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryChannelClientStateResponse { + const message = { ...baseQueryChannelClientStateResponse } as QueryChannelClientStateResponse; + if (object.identifiedClientState !== undefined && object.identifiedClientState !== null) { + message.identifiedClientState = IdentifiedClientState.fromPartial(object.identifiedClientState); + } else { + message.identifiedClientState = undefined; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = object.proof; + } else { + message.proof = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, +}; + +const baseQueryChannelConsensusStateRequest: object = { + portId: "", + channelId: "", + revisionNumber: Long.UZERO, + revisionHeight: Long.UZERO, +}; + +export const QueryChannelConsensusStateRequest = { + encode(message: QueryChannelConsensusStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (!message.revisionNumber.isZero()) { + writer.uint32(24).uint64(message.revisionNumber); + } + if (!message.revisionHeight.isZero()) { + writer.uint32(32).uint64(message.revisionHeight); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryChannelConsensusStateRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryChannelConsensusStateRequest } as QueryChannelConsensusStateRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.revisionNumber = reader.uint64() as Long; + break; + case 4: + message.revisionHeight = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryChannelConsensusStateRequest { + const message = { ...baseQueryChannelConsensusStateRequest } as QueryChannelConsensusStateRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + if (object.revisionNumber !== undefined && object.revisionNumber !== null) { + message.revisionNumber = Long.fromString(object.revisionNumber); + } else { + message.revisionNumber = Long.UZERO; + } + if (object.revisionHeight !== undefined && object.revisionHeight !== null) { + message.revisionHeight = Long.fromString(object.revisionHeight); + } else { + message.revisionHeight = Long.UZERO; + } + return message; + }, + + toJSON(message: QueryChannelConsensusStateRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.revisionNumber !== undefined && + (obj.revisionNumber = (message.revisionNumber || Long.UZERO).toString()); + message.revisionHeight !== undefined && + (obj.revisionHeight = (message.revisionHeight || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): QueryChannelConsensusStateRequest { + const message = { ...baseQueryChannelConsensusStateRequest } as QueryChannelConsensusStateRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + if (object.revisionNumber !== undefined && object.revisionNumber !== null) { + message.revisionNumber = object.revisionNumber as Long; + } else { + message.revisionNumber = Long.UZERO; + } + if (object.revisionHeight !== undefined && object.revisionHeight !== null) { + message.revisionHeight = object.revisionHeight as Long; + } else { + message.revisionHeight = Long.UZERO; + } + return message; + }, +}; + +const baseQueryChannelConsensusStateResponse: object = { clientId: "" }; + +export const QueryChannelConsensusStateResponse = { + encode(message: QueryChannelConsensusStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(10).fork()).ldelim(); + } + if (message.clientId !== "") { + writer.uint32(18).string(message.clientId); + } + if (message.proof.length !== 0) { + writer.uint32(26).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryChannelConsensusStateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryChannelConsensusStateResponse } as QueryChannelConsensusStateResponse; + message.proof = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + case 2: + message.clientId = reader.string(); + break; + case 3: + message.proof = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryChannelConsensusStateResponse { + const message = { ...baseQueryChannelConsensusStateResponse } as QueryChannelConsensusStateResponse; + message.proof = new Uint8Array(); + if (object.consensusState !== undefined && object.consensusState !== null) { + message.consensusState = Any.fromJSON(object.consensusState); + } else { + message.consensusState = undefined; + } + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + + toJSON(message: QueryChannelConsensusStateResponse): unknown { + const obj: any = {}; + message.consensusState !== undefined && + (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); + message.clientId !== undefined && (obj.clientId = message.clientId); + message.proof !== undefined && + (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryChannelConsensusStateResponse { + const message = { ...baseQueryChannelConsensusStateResponse } as QueryChannelConsensusStateResponse; + if (object.consensusState !== undefined && object.consensusState !== null) { + message.consensusState = Any.fromPartial(object.consensusState); + } else { + message.consensusState = undefined; + } + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = object.proof; + } else { + message.proof = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, +}; + +const baseQueryPacketCommitmentRequest: object = { portId: "", channelId: "", sequence: Long.UZERO }; + +export const QueryPacketCommitmentRequest = { + encode(message: QueryPacketCommitmentRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (!message.sequence.isZero()) { + writer.uint32(24).uint64(message.sequence); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketCommitmentRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryPacketCommitmentRequest } as QueryPacketCommitmentRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.sequence = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPacketCommitmentRequest { + const message = { ...baseQueryPacketCommitmentRequest } as QueryPacketCommitmentRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = Long.fromString(object.sequence); + } else { + message.sequence = Long.UZERO; + } + return message; + }, + + toJSON(message: QueryPacketCommitmentRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): QueryPacketCommitmentRequest { + const message = { ...baseQueryPacketCommitmentRequest } as QueryPacketCommitmentRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = object.sequence as Long; + } else { + message.sequence = Long.UZERO; + } + return message; + }, +}; + +const baseQueryPacketCommitmentResponse: object = {}; + +export const QueryPacketCommitmentResponse = { + encode(message: QueryPacketCommitmentResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.commitment.length !== 0) { + writer.uint32(10).bytes(message.commitment); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketCommitmentResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryPacketCommitmentResponse } as QueryPacketCommitmentResponse; + message.commitment = new Uint8Array(); + message.proof = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.commitment = reader.bytes(); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPacketCommitmentResponse { + const message = { ...baseQueryPacketCommitmentResponse } as QueryPacketCommitmentResponse; + message.commitment = new Uint8Array(); + message.proof = new Uint8Array(); + if (object.commitment !== undefined && object.commitment !== null) { + message.commitment = bytesFromBase64(object.commitment); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + + toJSON(message: QueryPacketCommitmentResponse): unknown { + const obj: any = {}; + message.commitment !== undefined && + (obj.commitment = base64FromBytes( + message.commitment !== undefined ? message.commitment : new Uint8Array(), + )); + message.proof !== undefined && + (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryPacketCommitmentResponse { + const message = { ...baseQueryPacketCommitmentResponse } as QueryPacketCommitmentResponse; + if (object.commitment !== undefined && object.commitment !== null) { + message.commitment = object.commitment; + } else { + message.commitment = new Uint8Array(); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = object.proof; + } else { + message.proof = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, +}; + +const baseQueryPacketCommitmentsRequest: object = { portId: "", channelId: "" }; + +export const QueryPacketCommitmentsRequest = { + encode(message: QueryPacketCommitmentsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketCommitmentsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryPacketCommitmentsRequest } as QueryPacketCommitmentsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPacketCommitmentsRequest { + const message = { ...baseQueryPacketCommitmentsRequest } as QueryPacketCommitmentsRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryPacketCommitmentsRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryPacketCommitmentsRequest { + const message = { ...baseQueryPacketCommitmentsRequest } as QueryPacketCommitmentsRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryPacketCommitmentsResponse: object = {}; + +export const QueryPacketCommitmentsResponse = { + encode(message: QueryPacketCommitmentsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.commitments) { + PacketState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketCommitmentsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryPacketCommitmentsResponse } as QueryPacketCommitmentsResponse; + message.commitments = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.commitments.push(PacketState.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + case 3: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPacketCommitmentsResponse { + const message = { ...baseQueryPacketCommitmentsResponse } as QueryPacketCommitmentsResponse; + message.commitments = []; + if (object.commitments !== undefined && object.commitments !== null) { + for (const e of object.commitments) { + message.commitments.push(PacketState.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromJSON(object.height); + } else { + message.height = undefined; + } + return message; + }, + + toJSON(message: QueryPacketCommitmentsResponse): unknown { + const obj: any = {}; + if (message.commitments) { + obj.commitments = message.commitments.map((e) => (e ? PacketState.toJSON(e) : undefined)); + } else { + obj.commitments = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryPacketCommitmentsResponse { + const message = { ...baseQueryPacketCommitmentsResponse } as QueryPacketCommitmentsResponse; + message.commitments = []; + if (object.commitments !== undefined && object.commitments !== null) { + for (const e of object.commitments) { + message.commitments.push(PacketState.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromPartial(object.height); + } else { + message.height = undefined; + } + return message; + }, +}; + +const baseQueryPacketReceiptRequest: object = { portId: "", channelId: "", sequence: Long.UZERO }; + +export const QueryPacketReceiptRequest = { + encode(message: QueryPacketReceiptRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (!message.sequence.isZero()) { + writer.uint32(24).uint64(message.sequence); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketReceiptRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryPacketReceiptRequest } as QueryPacketReceiptRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.sequence = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPacketReceiptRequest { + const message = { ...baseQueryPacketReceiptRequest } as QueryPacketReceiptRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = Long.fromString(object.sequence); + } else { + message.sequence = Long.UZERO; + } + return message; + }, + + toJSON(message: QueryPacketReceiptRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): QueryPacketReceiptRequest { + const message = { ...baseQueryPacketReceiptRequest } as QueryPacketReceiptRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = object.sequence as Long; + } else { + message.sequence = Long.UZERO; + } + return message; + }, +}; + +const baseQueryPacketReceiptResponse: object = { received: false }; + +export const QueryPacketReceiptResponse = { + encode(message: QueryPacketReceiptResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.received === true) { + writer.uint32(16).bool(message.received); + } + if (message.proof.length !== 0) { + writer.uint32(26).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketReceiptResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryPacketReceiptResponse } as QueryPacketReceiptResponse; + message.proof = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.received = reader.bool(); + break; + case 3: + message.proof = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPacketReceiptResponse { + const message = { ...baseQueryPacketReceiptResponse } as QueryPacketReceiptResponse; + message.proof = new Uint8Array(); + if (object.received !== undefined && object.received !== null) { + message.received = Boolean(object.received); + } else { + message.received = false; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + + toJSON(message: QueryPacketReceiptResponse): unknown { + const obj: any = {}; + message.received !== undefined && (obj.received = message.received); + message.proof !== undefined && + (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryPacketReceiptResponse { + const message = { ...baseQueryPacketReceiptResponse } as QueryPacketReceiptResponse; + if (object.received !== undefined && object.received !== null) { + message.received = object.received; + } else { + message.received = false; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = object.proof; + } else { + message.proof = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, +}; + +const baseQueryPacketAcknowledgementRequest: object = { portId: "", channelId: "", sequence: Long.UZERO }; + +export const QueryPacketAcknowledgementRequest = { + encode(message: QueryPacketAcknowledgementRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (!message.sequence.isZero()) { + writer.uint32(24).uint64(message.sequence); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketAcknowledgementRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryPacketAcknowledgementRequest } as QueryPacketAcknowledgementRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.sequence = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPacketAcknowledgementRequest { + const message = { ...baseQueryPacketAcknowledgementRequest } as QueryPacketAcknowledgementRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = Long.fromString(object.sequence); + } else { + message.sequence = Long.UZERO; + } + return message; + }, + + toJSON(message: QueryPacketAcknowledgementRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): QueryPacketAcknowledgementRequest { + const message = { ...baseQueryPacketAcknowledgementRequest } as QueryPacketAcknowledgementRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = object.sequence as Long; + } else { + message.sequence = Long.UZERO; + } + return message; + }, +}; + +const baseQueryPacketAcknowledgementResponse: object = {}; + +export const QueryPacketAcknowledgementResponse = { + encode(message: QueryPacketAcknowledgementResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.acknowledgement.length !== 0) { + writer.uint32(10).bytes(message.acknowledgement); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketAcknowledgementResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryPacketAcknowledgementResponse } as QueryPacketAcknowledgementResponse; + message.acknowledgement = new Uint8Array(); + message.proof = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.acknowledgement = reader.bytes(); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPacketAcknowledgementResponse { + const message = { ...baseQueryPacketAcknowledgementResponse } as QueryPacketAcknowledgementResponse; + message.acknowledgement = new Uint8Array(); + message.proof = new Uint8Array(); + if (object.acknowledgement !== undefined && object.acknowledgement !== null) { + message.acknowledgement = bytesFromBase64(object.acknowledgement); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + + toJSON(message: QueryPacketAcknowledgementResponse): unknown { + const obj: any = {}; + message.acknowledgement !== undefined && + (obj.acknowledgement = base64FromBytes( + message.acknowledgement !== undefined ? message.acknowledgement : new Uint8Array(), + )); + message.proof !== undefined && + (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryPacketAcknowledgementResponse { + const message = { ...baseQueryPacketAcknowledgementResponse } as QueryPacketAcknowledgementResponse; + if (object.acknowledgement !== undefined && object.acknowledgement !== null) { + message.acknowledgement = object.acknowledgement; + } else { + message.acknowledgement = new Uint8Array(); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = object.proof; + } else { + message.proof = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, +}; + +const baseQueryPacketAcknowledgementsRequest: object = { portId: "", channelId: "" }; + +export const QueryPacketAcknowledgementsRequest = { + encode(message: QueryPacketAcknowledgementsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketAcknowledgementsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryPacketAcknowledgementsRequest } as QueryPacketAcknowledgementsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPacketAcknowledgementsRequest { + const message = { ...baseQueryPacketAcknowledgementsRequest } as QueryPacketAcknowledgementsRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryPacketAcknowledgementsRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryPacketAcknowledgementsRequest { + const message = { ...baseQueryPacketAcknowledgementsRequest } as QueryPacketAcknowledgementsRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryPacketAcknowledgementsResponse: object = {}; + +export const QueryPacketAcknowledgementsResponse = { + encode(message: QueryPacketAcknowledgementsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.acknowledgements) { + PacketState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketAcknowledgementsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryPacketAcknowledgementsResponse } as QueryPacketAcknowledgementsResponse; + message.acknowledgements = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.acknowledgements.push(PacketState.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + case 3: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryPacketAcknowledgementsResponse { + const message = { ...baseQueryPacketAcknowledgementsResponse } as QueryPacketAcknowledgementsResponse; + message.acknowledgements = []; + if (object.acknowledgements !== undefined && object.acknowledgements !== null) { + for (const e of object.acknowledgements) { + message.acknowledgements.push(PacketState.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromJSON(object.height); + } else { + message.height = undefined; + } + return message; + }, + + toJSON(message: QueryPacketAcknowledgementsResponse): unknown { + const obj: any = {}; + if (message.acknowledgements) { + obj.acknowledgements = message.acknowledgements.map((e) => (e ? PacketState.toJSON(e) : undefined)); + } else { + obj.acknowledgements = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryPacketAcknowledgementsResponse { + const message = { ...baseQueryPacketAcknowledgementsResponse } as QueryPacketAcknowledgementsResponse; + message.acknowledgements = []; + if (object.acknowledgements !== undefined && object.acknowledgements !== null) { + for (const e of object.acknowledgements) { + message.acknowledgements.push(PacketState.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromPartial(object.height); + } else { + message.height = undefined; + } + return message; + }, +}; + +const baseQueryUnreceivedPacketsRequest: object = { + portId: "", + channelId: "", + packetCommitmentSequences: Long.UZERO, +}; + +export const QueryUnreceivedPacketsRequest = { + encode(message: QueryUnreceivedPacketsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + writer.uint32(26).fork(); + for (const v of message.packetCommitmentSequences) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnreceivedPacketsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryUnreceivedPacketsRequest } as QueryUnreceivedPacketsRequest; + message.packetCommitmentSequences = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.packetCommitmentSequences.push(reader.uint64() as Long); + } + } else { + message.packetCommitmentSequences.push(reader.uint64() as Long); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryUnreceivedPacketsRequest { + const message = { ...baseQueryUnreceivedPacketsRequest } as QueryUnreceivedPacketsRequest; + message.packetCommitmentSequences = []; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + if (object.packetCommitmentSequences !== undefined && object.packetCommitmentSequences !== null) { + for (const e of object.packetCommitmentSequences) { + message.packetCommitmentSequences.push(Long.fromString(e)); + } + } + return message; + }, + + toJSON(message: QueryUnreceivedPacketsRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + if (message.packetCommitmentSequences) { + obj.packetCommitmentSequences = message.packetCommitmentSequences.map((e) => + (e || Long.UZERO).toString(), + ); + } else { + obj.packetCommitmentSequences = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): QueryUnreceivedPacketsRequest { + const message = { ...baseQueryUnreceivedPacketsRequest } as QueryUnreceivedPacketsRequest; + message.packetCommitmentSequences = []; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + if (object.packetCommitmentSequences !== undefined && object.packetCommitmentSequences !== null) { + for (const e of object.packetCommitmentSequences) { + message.packetCommitmentSequences.push(e); + } + } + return message; + }, +}; + +const baseQueryUnreceivedPacketsResponse: object = { sequences: Long.UZERO }; + +export const QueryUnreceivedPacketsResponse = { + encode(message: QueryUnreceivedPacketsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.sequences) { + writer.uint64(v); + } + writer.ldelim(); + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnreceivedPacketsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryUnreceivedPacketsResponse } as QueryUnreceivedPacketsResponse; + message.sequences = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.sequences.push(reader.uint64() as Long); + } + } else { + message.sequences.push(reader.uint64() as Long); + } + break; + case 2: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryUnreceivedPacketsResponse { + const message = { ...baseQueryUnreceivedPacketsResponse } as QueryUnreceivedPacketsResponse; + message.sequences = []; + if (object.sequences !== undefined && object.sequences !== null) { + for (const e of object.sequences) { + message.sequences.push(Long.fromString(e)); + } + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromJSON(object.height); + } else { + message.height = undefined; + } + return message; + }, + + toJSON(message: QueryUnreceivedPacketsResponse): unknown { + const obj: any = {}; + if (message.sequences) { + obj.sequences = message.sequences.map((e) => (e || Long.UZERO).toString()); + } else { + obj.sequences = []; + } + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryUnreceivedPacketsResponse { + const message = { ...baseQueryUnreceivedPacketsResponse } as QueryUnreceivedPacketsResponse; + message.sequences = []; + if (object.sequences !== undefined && object.sequences !== null) { + for (const e of object.sequences) { + message.sequences.push(e); + } + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromPartial(object.height); + } else { + message.height = undefined; + } + return message; + }, +}; + +const baseQueryUnreceivedAcksRequest: object = { portId: "", channelId: "", packetAckSequences: Long.UZERO }; + +export const QueryUnreceivedAcksRequest = { + encode(message: QueryUnreceivedAcksRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + writer.uint32(26).fork(); + for (const v of message.packetAckSequences) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnreceivedAcksRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryUnreceivedAcksRequest } as QueryUnreceivedAcksRequest; + message.packetAckSequences = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.packetAckSequences.push(reader.uint64() as Long); + } + } else { + message.packetAckSequences.push(reader.uint64() as Long); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryUnreceivedAcksRequest { + const message = { ...baseQueryUnreceivedAcksRequest } as QueryUnreceivedAcksRequest; + message.packetAckSequences = []; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + if (object.packetAckSequences !== undefined && object.packetAckSequences !== null) { + for (const e of object.packetAckSequences) { + message.packetAckSequences.push(Long.fromString(e)); + } + } + return message; + }, + + toJSON(message: QueryUnreceivedAcksRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + if (message.packetAckSequences) { + obj.packetAckSequences = message.packetAckSequences.map((e) => (e || Long.UZERO).toString()); + } else { + obj.packetAckSequences = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): QueryUnreceivedAcksRequest { + const message = { ...baseQueryUnreceivedAcksRequest } as QueryUnreceivedAcksRequest; + message.packetAckSequences = []; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + if (object.packetAckSequences !== undefined && object.packetAckSequences !== null) { + for (const e of object.packetAckSequences) { + message.packetAckSequences.push(e); + } + } + return message; + }, +}; + +const baseQueryUnreceivedAcksResponse: object = { sequences: Long.UZERO }; + +export const QueryUnreceivedAcksResponse = { + encode(message: QueryUnreceivedAcksResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.sequences) { + writer.uint64(v); + } + writer.ldelim(); + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnreceivedAcksResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryUnreceivedAcksResponse } as QueryUnreceivedAcksResponse; + message.sequences = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.sequences.push(reader.uint64() as Long); + } + } else { + message.sequences.push(reader.uint64() as Long); + } + break; + case 2: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryUnreceivedAcksResponse { + const message = { ...baseQueryUnreceivedAcksResponse } as QueryUnreceivedAcksResponse; + message.sequences = []; + if (object.sequences !== undefined && object.sequences !== null) { + for (const e of object.sequences) { + message.sequences.push(Long.fromString(e)); + } + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromJSON(object.height); + } else { + message.height = undefined; + } + return message; + }, + + toJSON(message: QueryUnreceivedAcksResponse): unknown { + const obj: any = {}; + if (message.sequences) { + obj.sequences = message.sequences.map((e) => (e || Long.UZERO).toString()); + } else { + obj.sequences = []; + } + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryUnreceivedAcksResponse { + const message = { ...baseQueryUnreceivedAcksResponse } as QueryUnreceivedAcksResponse; + message.sequences = []; + if (object.sequences !== undefined && object.sequences !== null) { + for (const e of object.sequences) { + message.sequences.push(e); + } + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromPartial(object.height); + } else { + message.height = undefined; + } + return message; + }, +}; + +const baseQueryNextSequenceReceiveRequest: object = { portId: "", channelId: "" }; + +export const QueryNextSequenceReceiveRequest = { + encode(message: QueryNextSequenceReceiveRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryNextSequenceReceiveRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryNextSequenceReceiveRequest } as QueryNextSequenceReceiveRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryNextSequenceReceiveRequest { + const message = { ...baseQueryNextSequenceReceiveRequest } as QueryNextSequenceReceiveRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + return message; + }, + + toJSON(message: QueryNextSequenceReceiveRequest): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, + + fromPartial(object: DeepPartial): QueryNextSequenceReceiveRequest { + const message = { ...baseQueryNextSequenceReceiveRequest } as QueryNextSequenceReceiveRequest; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + return message; + }, +}; + +const baseQueryNextSequenceReceiveResponse: object = { nextSequenceReceive: Long.UZERO }; + +export const QueryNextSequenceReceiveResponse = { + encode(message: QueryNextSequenceReceiveResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.nextSequenceReceive.isZero()) { + writer.uint32(8).uint64(message.nextSequenceReceive); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryNextSequenceReceiveResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryNextSequenceReceiveResponse } as QueryNextSequenceReceiveResponse; + message.proof = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nextSequenceReceive = reader.uint64() as Long; + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryNextSequenceReceiveResponse { + const message = { ...baseQueryNextSequenceReceiveResponse } as QueryNextSequenceReceiveResponse; + message.proof = new Uint8Array(); + if (object.nextSequenceReceive !== undefined && object.nextSequenceReceive !== null) { + message.nextSequenceReceive = Long.fromString(object.nextSequenceReceive); + } else { + message.nextSequenceReceive = Long.UZERO; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + + toJSON(message: QueryNextSequenceReceiveResponse): unknown { + const obj: any = {}; + message.nextSequenceReceive !== undefined && + (obj.nextSequenceReceive = (message.nextSequenceReceive || Long.UZERO).toString()); + message.proof !== undefined && + (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryNextSequenceReceiveResponse { + const message = { ...baseQueryNextSequenceReceiveResponse } as QueryNextSequenceReceiveResponse; + if (object.nextSequenceReceive !== undefined && object.nextSequenceReceive !== null) { + message.nextSequenceReceive = object.nextSequenceReceive as Long; + } else { + message.nextSequenceReceive = Long.UZERO; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = object.proof; + } else { + message.proof = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, +}; + +/** Query provides defines the gRPC querier service */ +export interface Query { + /** Channel queries an IBC Channel. */ + Channel(request: QueryChannelRequest): Promise; + /** Channels queries all the IBC channels of a chain. */ + Channels(request: QueryChannelsRequest): Promise; + /** + * ConnectionChannels queries all the channels associated with a connection + * end. + */ + ConnectionChannels(request: QueryConnectionChannelsRequest): Promise; + /** + * ChannelClientState queries for the client state for the channel associated + * with the provided channel identifiers. + */ + ChannelClientState(request: QueryChannelClientStateRequest): Promise; + /** + * ChannelConsensusState queries for the consensus state for the channel + * associated with the provided channel identifiers. + */ + ChannelConsensusState( + request: QueryChannelConsensusStateRequest, + ): Promise; + /** PacketCommitment queries a stored packet commitment hash. */ + PacketCommitment(request: QueryPacketCommitmentRequest): Promise; + /** + * PacketCommitments returns all the packet commitments hashes associated + * with a channel. + */ + PacketCommitments(request: QueryPacketCommitmentsRequest): Promise; + /** PacketReceipt queries if a given packet sequence has been received on the queried chain */ + PacketReceipt(request: QueryPacketReceiptRequest): Promise; + /** PacketAcknowledgement queries a stored packet acknowledgement hash. */ + PacketAcknowledgement( + request: QueryPacketAcknowledgementRequest, + ): Promise; + /** + * PacketAcknowledgements returns all the packet acknowledgements associated + * with a channel. + */ + PacketAcknowledgements( + request: QueryPacketAcknowledgementsRequest, + ): Promise; + /** + * UnreceivedPackets returns all the unreceived IBC packets associated with a + * channel and sequences. + */ + UnreceivedPackets(request: QueryUnreceivedPacketsRequest): Promise; + /** + * UnreceivedAcks returns all the unreceived IBC acknowledgements associated with a + * channel and sequences. + */ + UnreceivedAcks(request: QueryUnreceivedAcksRequest): Promise; + /** NextSequenceReceive returns the next receive sequence for a given channel. */ + NextSequenceReceive(request: QueryNextSequenceReceiveRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Channel = this.Channel.bind(this); + this.Channels = this.Channels.bind(this); + this.ConnectionChannels = this.ConnectionChannels.bind(this); + this.ChannelClientState = this.ChannelClientState.bind(this); + this.ChannelConsensusState = this.ChannelConsensusState.bind(this); + this.PacketCommitment = this.PacketCommitment.bind(this); + this.PacketCommitments = this.PacketCommitments.bind(this); + this.PacketReceipt = this.PacketReceipt.bind(this); + this.PacketAcknowledgement = this.PacketAcknowledgement.bind(this); + this.PacketAcknowledgements = this.PacketAcknowledgements.bind(this); + this.UnreceivedPackets = this.UnreceivedPackets.bind(this); + this.UnreceivedAcks = this.UnreceivedAcks.bind(this); + this.NextSequenceReceive = this.NextSequenceReceive.bind(this); + } + Channel(request: QueryChannelRequest): Promise { + const data = QueryChannelRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "Channel", data); + return promise.then((data) => QueryChannelResponse.decode(new _m0.Reader(data))); + } + + Channels(request: QueryChannelsRequest): Promise { + const data = QueryChannelsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "Channels", data); + return promise.then((data) => QueryChannelsResponse.decode(new _m0.Reader(data))); + } + + ConnectionChannels(request: QueryConnectionChannelsRequest): Promise { + const data = QueryConnectionChannelsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "ConnectionChannels", data); + return promise.then((data) => QueryConnectionChannelsResponse.decode(new _m0.Reader(data))); + } + + ChannelClientState(request: QueryChannelClientStateRequest): Promise { + const data = QueryChannelClientStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "ChannelClientState", data); + return promise.then((data) => QueryChannelClientStateResponse.decode(new _m0.Reader(data))); + } + + ChannelConsensusState( + request: QueryChannelConsensusStateRequest, + ): Promise { + const data = QueryChannelConsensusStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "ChannelConsensusState", data); + return promise.then((data) => QueryChannelConsensusStateResponse.decode(new _m0.Reader(data))); + } + + PacketCommitment(request: QueryPacketCommitmentRequest): Promise { + const data = QueryPacketCommitmentRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "PacketCommitment", data); + return promise.then((data) => QueryPacketCommitmentResponse.decode(new _m0.Reader(data))); + } + + PacketCommitments(request: QueryPacketCommitmentsRequest): Promise { + const data = QueryPacketCommitmentsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "PacketCommitments", data); + return promise.then((data) => QueryPacketCommitmentsResponse.decode(new _m0.Reader(data))); + } + + PacketReceipt(request: QueryPacketReceiptRequest): Promise { + const data = QueryPacketReceiptRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "PacketReceipt", data); + return promise.then((data) => QueryPacketReceiptResponse.decode(new _m0.Reader(data))); + } + + PacketAcknowledgement( + request: QueryPacketAcknowledgementRequest, + ): Promise { + const data = QueryPacketAcknowledgementRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "PacketAcknowledgement", data); + return promise.then((data) => QueryPacketAcknowledgementResponse.decode(new _m0.Reader(data))); + } + + PacketAcknowledgements( + request: QueryPacketAcknowledgementsRequest, + ): Promise { + const data = QueryPacketAcknowledgementsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "PacketAcknowledgements", data); + return promise.then((data) => QueryPacketAcknowledgementsResponse.decode(new _m0.Reader(data))); + } + + UnreceivedPackets(request: QueryUnreceivedPacketsRequest): Promise { + const data = QueryUnreceivedPacketsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "UnreceivedPackets", data); + return promise.then((data) => QueryUnreceivedPacketsResponse.decode(new _m0.Reader(data))); + } + + UnreceivedAcks(request: QueryUnreceivedAcksRequest): Promise { + const data = QueryUnreceivedAcksRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "UnreceivedAcks", data); + return promise.then((data) => QueryUnreceivedAcksResponse.decode(new _m0.Reader(data))); + } + + NextSequenceReceive(request: QueryNextSequenceReceiveRequest): Promise { + const data = QueryNextSequenceReceiveRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "NextSequenceReceive", data); + return promise.then((data) => QueryNextSequenceReceiveResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/ibc/core/channel/v1/tx.ts b/src/ibc/core/channel/v1/tx.ts new file mode 100644 index 00000000..cdf82b9f --- /dev/null +++ b/src/ibc/core/channel/v1/tx.ts @@ -0,0 +1,1960 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Channel, Packet } from "../../../../ibc/core/channel/v1/channel"; +import { Height } from "../../../../ibc/core/client/v1/client"; + +export const protobufPackage = "ibc.core.channel.v1"; + +/** + * MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It + * is called by a relayer on Chain A. + */ +export interface MsgChannelOpenInit { + portId: string; + channel?: Channel; + signer: string; +} + +/** MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. */ +export interface MsgChannelOpenInitResponse {} + +/** + * MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel + * on Chain B. + */ +export interface MsgChannelOpenTry { + portId: string; + /** + * in the case of crossing hello's, when both chains call OpenInit, we need the channel identifier + * of the previous channel in state INIT + */ + previousChannelId: string; + channel?: Channel; + counterpartyVersion: string; + proofInit: Uint8Array; + proofHeight?: Height; + signer: string; +} + +/** MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. */ +export interface MsgChannelOpenTryResponse {} + +/** + * MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge + * the change of channel state to TRYOPEN on Chain B. + */ +export interface MsgChannelOpenAck { + portId: string; + channelId: string; + counterpartyChannelId: string; + counterpartyVersion: string; + proofTry: Uint8Array; + proofHeight?: Height; + signer: string; +} + +/** MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. */ +export interface MsgChannelOpenAckResponse {} + +/** + * MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to + * acknowledge the change of channel state to OPEN on Chain A. + */ +export interface MsgChannelOpenConfirm { + portId: string; + channelId: string; + proofAck: Uint8Array; + proofHeight?: Height; + signer: string; +} + +/** MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response type. */ +export interface MsgChannelOpenConfirmResponse {} + +/** + * MsgChannelCloseInit defines a msg sent by a Relayer to Chain A + * to close a channel with Chain B. + */ +export interface MsgChannelCloseInit { + portId: string; + channelId: string; + signer: string; +} + +/** MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. */ +export interface MsgChannelCloseInitResponse {} + +/** + * MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B + * to acknowledge the change of channel state to CLOSED on Chain A. + */ +export interface MsgChannelCloseConfirm { + portId: string; + channelId: string; + proofInit: Uint8Array; + proofHeight?: Height; + signer: string; +} + +/** MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response type. */ +export interface MsgChannelCloseConfirmResponse {} + +/** MsgRecvPacket receives incoming IBC packet */ +export interface MsgRecvPacket { + packet?: Packet; + proofCommitment: Uint8Array; + proofHeight?: Height; + signer: string; +} + +/** MsgRecvPacketResponse defines the Msg/RecvPacket response type. */ +export interface MsgRecvPacketResponse {} + +/** MsgTimeout receives timed-out packet */ +export interface MsgTimeout { + packet?: Packet; + proofUnreceived: Uint8Array; + proofHeight?: Height; + nextSequenceRecv: Long; + signer: string; +} + +/** MsgTimeoutResponse defines the Msg/Timeout response type. */ +export interface MsgTimeoutResponse {} + +/** MsgTimeoutOnClose timed-out packet upon counterparty channel closure. */ +export interface MsgTimeoutOnClose { + packet?: Packet; + proofUnreceived: Uint8Array; + proofClose: Uint8Array; + proofHeight?: Height; + nextSequenceRecv: Long; + signer: string; +} + +/** MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. */ +export interface MsgTimeoutOnCloseResponse {} + +/** MsgAcknowledgement receives incoming IBC acknowledgement */ +export interface MsgAcknowledgement { + packet?: Packet; + acknowledgement: Uint8Array; + proofAcked: Uint8Array; + proofHeight?: Height; + signer: string; +} + +/** MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. */ +export interface MsgAcknowledgementResponse {} + +const baseMsgChannelOpenInit: object = { portId: "", signer: "" }; + +export const MsgChannelOpenInit = { + encode(message: MsgChannelOpenInit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channel !== undefined) { + Channel.encode(message.channel, writer.uint32(18).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelOpenInit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgChannelOpenInit } as MsgChannelOpenInit; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channel = Channel.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgChannelOpenInit { + const message = { ...baseMsgChannelOpenInit } as MsgChannelOpenInit; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channel !== undefined && object.channel !== null) { + message.channel = Channel.fromJSON(object.channel); + } else { + message.channel = undefined; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = String(object.signer); + } else { + message.signer = ""; + } + return message; + }, + + toJSON(message: MsgChannelOpenInit): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channel !== undefined && + (obj.channel = message.channel ? Channel.toJSON(message.channel) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial(object: DeepPartial): MsgChannelOpenInit { + const message = { ...baseMsgChannelOpenInit } as MsgChannelOpenInit; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channel !== undefined && object.channel !== null) { + message.channel = Channel.fromPartial(object.channel); + } else { + message.channel = undefined; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } else { + message.signer = ""; + } + return message; + }, +}; + +const baseMsgChannelOpenInitResponse: object = {}; + +export const MsgChannelOpenInitResponse = { + encode(_: MsgChannelOpenInitResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelOpenInitResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgChannelOpenInitResponse } as MsgChannelOpenInitResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgChannelOpenInitResponse { + const message = { ...baseMsgChannelOpenInitResponse } as MsgChannelOpenInitResponse; + return message; + }, + + toJSON(_: MsgChannelOpenInitResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgChannelOpenInitResponse { + const message = { ...baseMsgChannelOpenInitResponse } as MsgChannelOpenInitResponse; + return message; + }, +}; + +const baseMsgChannelOpenTry: object = { + portId: "", + previousChannelId: "", + counterpartyVersion: "", + signer: "", +}; + +export const MsgChannelOpenTry = { + encode(message: MsgChannelOpenTry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.previousChannelId !== "") { + writer.uint32(18).string(message.previousChannelId); + } + if (message.channel !== undefined) { + Channel.encode(message.channel, writer.uint32(26).fork()).ldelim(); + } + if (message.counterpartyVersion !== "") { + writer.uint32(34).string(message.counterpartyVersion); + } + if (message.proofInit.length !== 0) { + writer.uint32(42).bytes(message.proofInit); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(50).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(58).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelOpenTry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgChannelOpenTry } as MsgChannelOpenTry; + message.proofInit = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.previousChannelId = reader.string(); + break; + case 3: + message.channel = Channel.decode(reader, reader.uint32()); + break; + case 4: + message.counterpartyVersion = reader.string(); + break; + case 5: + message.proofInit = reader.bytes(); + break; + case 6: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 7: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgChannelOpenTry { + const message = { ...baseMsgChannelOpenTry } as MsgChannelOpenTry; + message.proofInit = new Uint8Array(); + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.previousChannelId !== undefined && object.previousChannelId !== null) { + message.previousChannelId = String(object.previousChannelId); + } else { + message.previousChannelId = ""; + } + if (object.channel !== undefined && object.channel !== null) { + message.channel = Channel.fromJSON(object.channel); + } else { + message.channel = undefined; + } + if (object.counterpartyVersion !== undefined && object.counterpartyVersion !== null) { + message.counterpartyVersion = String(object.counterpartyVersion); + } else { + message.counterpartyVersion = ""; + } + if (object.proofInit !== undefined && object.proofInit !== null) { + message.proofInit = bytesFromBase64(object.proofInit); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = String(object.signer); + } else { + message.signer = ""; + } + return message; + }, + + toJSON(message: MsgChannelOpenTry): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.previousChannelId !== undefined && (obj.previousChannelId = message.previousChannelId); + message.channel !== undefined && + (obj.channel = message.channel ? Channel.toJSON(message.channel) : undefined); + message.counterpartyVersion !== undefined && (obj.counterpartyVersion = message.counterpartyVersion); + message.proofInit !== undefined && + (obj.proofInit = base64FromBytes( + message.proofInit !== undefined ? message.proofInit : new Uint8Array(), + )); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial(object: DeepPartial): MsgChannelOpenTry { + const message = { ...baseMsgChannelOpenTry } as MsgChannelOpenTry; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.previousChannelId !== undefined && object.previousChannelId !== null) { + message.previousChannelId = object.previousChannelId; + } else { + message.previousChannelId = ""; + } + if (object.channel !== undefined && object.channel !== null) { + message.channel = Channel.fromPartial(object.channel); + } else { + message.channel = undefined; + } + if (object.counterpartyVersion !== undefined && object.counterpartyVersion !== null) { + message.counterpartyVersion = object.counterpartyVersion; + } else { + message.counterpartyVersion = ""; + } + if (object.proofInit !== undefined && object.proofInit !== null) { + message.proofInit = object.proofInit; + } else { + message.proofInit = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } else { + message.signer = ""; + } + return message; + }, +}; + +const baseMsgChannelOpenTryResponse: object = {}; + +export const MsgChannelOpenTryResponse = { + encode(_: MsgChannelOpenTryResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelOpenTryResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgChannelOpenTryResponse } as MsgChannelOpenTryResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgChannelOpenTryResponse { + const message = { ...baseMsgChannelOpenTryResponse } as MsgChannelOpenTryResponse; + return message; + }, + + toJSON(_: MsgChannelOpenTryResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgChannelOpenTryResponse { + const message = { ...baseMsgChannelOpenTryResponse } as MsgChannelOpenTryResponse; + return message; + }, +}; + +const baseMsgChannelOpenAck: object = { + portId: "", + channelId: "", + counterpartyChannelId: "", + counterpartyVersion: "", + signer: "", +}; + +export const MsgChannelOpenAck = { + encode(message: MsgChannelOpenAck, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.counterpartyChannelId !== "") { + writer.uint32(26).string(message.counterpartyChannelId); + } + if (message.counterpartyVersion !== "") { + writer.uint32(34).string(message.counterpartyVersion); + } + if (message.proofTry.length !== 0) { + writer.uint32(42).bytes(message.proofTry); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(50).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(58).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelOpenAck { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgChannelOpenAck } as MsgChannelOpenAck; + message.proofTry = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.counterpartyChannelId = reader.string(); + break; + case 4: + message.counterpartyVersion = reader.string(); + break; + case 5: + message.proofTry = reader.bytes(); + break; + case 6: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 7: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgChannelOpenAck { + const message = { ...baseMsgChannelOpenAck } as MsgChannelOpenAck; + message.proofTry = new Uint8Array(); + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + if (object.counterpartyChannelId !== undefined && object.counterpartyChannelId !== null) { + message.counterpartyChannelId = String(object.counterpartyChannelId); + } else { + message.counterpartyChannelId = ""; + } + if (object.counterpartyVersion !== undefined && object.counterpartyVersion !== null) { + message.counterpartyVersion = String(object.counterpartyVersion); + } else { + message.counterpartyVersion = ""; + } + if (object.proofTry !== undefined && object.proofTry !== null) { + message.proofTry = bytesFromBase64(object.proofTry); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = String(object.signer); + } else { + message.signer = ""; + } + return message; + }, + + toJSON(message: MsgChannelOpenAck): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.counterpartyChannelId !== undefined && + (obj.counterpartyChannelId = message.counterpartyChannelId); + message.counterpartyVersion !== undefined && (obj.counterpartyVersion = message.counterpartyVersion); + message.proofTry !== undefined && + (obj.proofTry = base64FromBytes(message.proofTry !== undefined ? message.proofTry : new Uint8Array())); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial(object: DeepPartial): MsgChannelOpenAck { + const message = { ...baseMsgChannelOpenAck } as MsgChannelOpenAck; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + if (object.counterpartyChannelId !== undefined && object.counterpartyChannelId !== null) { + message.counterpartyChannelId = object.counterpartyChannelId; + } else { + message.counterpartyChannelId = ""; + } + if (object.counterpartyVersion !== undefined && object.counterpartyVersion !== null) { + message.counterpartyVersion = object.counterpartyVersion; + } else { + message.counterpartyVersion = ""; + } + if (object.proofTry !== undefined && object.proofTry !== null) { + message.proofTry = object.proofTry; + } else { + message.proofTry = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } else { + message.signer = ""; + } + return message; + }, +}; + +const baseMsgChannelOpenAckResponse: object = {}; + +export const MsgChannelOpenAckResponse = { + encode(_: MsgChannelOpenAckResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelOpenAckResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgChannelOpenAckResponse } as MsgChannelOpenAckResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgChannelOpenAckResponse { + const message = { ...baseMsgChannelOpenAckResponse } as MsgChannelOpenAckResponse; + return message; + }, + + toJSON(_: MsgChannelOpenAckResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgChannelOpenAckResponse { + const message = { ...baseMsgChannelOpenAckResponse } as MsgChannelOpenAckResponse; + return message; + }, +}; + +const baseMsgChannelOpenConfirm: object = { portId: "", channelId: "", signer: "" }; + +export const MsgChannelOpenConfirm = { + encode(message: MsgChannelOpenConfirm, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.proofAck.length !== 0) { + writer.uint32(26).bytes(message.proofAck); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(42).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelOpenConfirm { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgChannelOpenConfirm } as MsgChannelOpenConfirm; + message.proofAck = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.proofAck = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgChannelOpenConfirm { + const message = { ...baseMsgChannelOpenConfirm } as MsgChannelOpenConfirm; + message.proofAck = new Uint8Array(); + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + if (object.proofAck !== undefined && object.proofAck !== null) { + message.proofAck = bytesFromBase64(object.proofAck); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = String(object.signer); + } else { + message.signer = ""; + } + return message; + }, + + toJSON(message: MsgChannelOpenConfirm): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.proofAck !== undefined && + (obj.proofAck = base64FromBytes(message.proofAck !== undefined ? message.proofAck : new Uint8Array())); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial(object: DeepPartial): MsgChannelOpenConfirm { + const message = { ...baseMsgChannelOpenConfirm } as MsgChannelOpenConfirm; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + if (object.proofAck !== undefined && object.proofAck !== null) { + message.proofAck = object.proofAck; + } else { + message.proofAck = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } else { + message.signer = ""; + } + return message; + }, +}; + +const baseMsgChannelOpenConfirmResponse: object = {}; + +export const MsgChannelOpenConfirmResponse = { + encode(_: MsgChannelOpenConfirmResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelOpenConfirmResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgChannelOpenConfirmResponse } as MsgChannelOpenConfirmResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgChannelOpenConfirmResponse { + const message = { ...baseMsgChannelOpenConfirmResponse } as MsgChannelOpenConfirmResponse; + return message; + }, + + toJSON(_: MsgChannelOpenConfirmResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgChannelOpenConfirmResponse { + const message = { ...baseMsgChannelOpenConfirmResponse } as MsgChannelOpenConfirmResponse; + return message; + }, +}; + +const baseMsgChannelCloseInit: object = { portId: "", channelId: "", signer: "" }; + +export const MsgChannelCloseInit = { + encode(message: MsgChannelCloseInit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelCloseInit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgChannelCloseInit } as MsgChannelCloseInit; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgChannelCloseInit { + const message = { ...baseMsgChannelCloseInit } as MsgChannelCloseInit; + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = String(object.signer); + } else { + message.signer = ""; + } + return message; + }, + + toJSON(message: MsgChannelCloseInit): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial(object: DeepPartial): MsgChannelCloseInit { + const message = { ...baseMsgChannelCloseInit } as MsgChannelCloseInit; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } else { + message.signer = ""; + } + return message; + }, +}; + +const baseMsgChannelCloseInitResponse: object = {}; + +export const MsgChannelCloseInitResponse = { + encode(_: MsgChannelCloseInitResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelCloseInitResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgChannelCloseInitResponse } as MsgChannelCloseInitResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgChannelCloseInitResponse { + const message = { ...baseMsgChannelCloseInitResponse } as MsgChannelCloseInitResponse; + return message; + }, + + toJSON(_: MsgChannelCloseInitResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgChannelCloseInitResponse { + const message = { ...baseMsgChannelCloseInitResponse } as MsgChannelCloseInitResponse; + return message; + }, +}; + +const baseMsgChannelCloseConfirm: object = { portId: "", channelId: "", signer: "" }; + +export const MsgChannelCloseConfirm = { + encode(message: MsgChannelCloseConfirm, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.proofInit.length !== 0) { + writer.uint32(26).bytes(message.proofInit); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(42).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelCloseConfirm { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgChannelCloseConfirm } as MsgChannelCloseConfirm; + message.proofInit = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.proofInit = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgChannelCloseConfirm { + const message = { ...baseMsgChannelCloseConfirm } as MsgChannelCloseConfirm; + message.proofInit = new Uint8Array(); + if (object.portId !== undefined && object.portId !== null) { + message.portId = String(object.portId); + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = String(object.channelId); + } else { + message.channelId = ""; + } + if (object.proofInit !== undefined && object.proofInit !== null) { + message.proofInit = bytesFromBase64(object.proofInit); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = String(object.signer); + } else { + message.signer = ""; + } + return message; + }, + + toJSON(message: MsgChannelCloseConfirm): unknown { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.proofInit !== undefined && + (obj.proofInit = base64FromBytes( + message.proofInit !== undefined ? message.proofInit : new Uint8Array(), + )); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial(object: DeepPartial): MsgChannelCloseConfirm { + const message = { ...baseMsgChannelCloseConfirm } as MsgChannelCloseConfirm; + if (object.portId !== undefined && object.portId !== null) { + message.portId = object.portId; + } else { + message.portId = ""; + } + if (object.channelId !== undefined && object.channelId !== null) { + message.channelId = object.channelId; + } else { + message.channelId = ""; + } + if (object.proofInit !== undefined && object.proofInit !== null) { + message.proofInit = object.proofInit; + } else { + message.proofInit = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } else { + message.signer = ""; + } + return message; + }, +}; + +const baseMsgChannelCloseConfirmResponse: object = {}; + +export const MsgChannelCloseConfirmResponse = { + encode(_: MsgChannelCloseConfirmResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelCloseConfirmResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgChannelCloseConfirmResponse } as MsgChannelCloseConfirmResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgChannelCloseConfirmResponse { + const message = { ...baseMsgChannelCloseConfirmResponse } as MsgChannelCloseConfirmResponse; + return message; + }, + + toJSON(_: MsgChannelCloseConfirmResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgChannelCloseConfirmResponse { + const message = { ...baseMsgChannelCloseConfirmResponse } as MsgChannelCloseConfirmResponse; + return message; + }, +}; + +const baseMsgRecvPacket: object = { signer: "" }; + +export const MsgRecvPacket = { + encode(message: MsgRecvPacket, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.packet !== undefined) { + Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); + } + if (message.proofCommitment.length !== 0) { + writer.uint32(18).bytes(message.proofCommitment); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(34).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgRecvPacket { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgRecvPacket } as MsgRecvPacket; + message.proofCommitment = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.packet = Packet.decode(reader, reader.uint32()); + break; + case 2: + message.proofCommitment = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 4: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgRecvPacket { + const message = { ...baseMsgRecvPacket } as MsgRecvPacket; + message.proofCommitment = new Uint8Array(); + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromJSON(object.packet); + } else { + message.packet = undefined; + } + if (object.proofCommitment !== undefined && object.proofCommitment !== null) { + message.proofCommitment = bytesFromBase64(object.proofCommitment); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = String(object.signer); + } else { + message.signer = ""; + } + return message; + }, + + toJSON(message: MsgRecvPacket): unknown { + const obj: any = {}; + message.packet !== undefined && (obj.packet = message.packet ? Packet.toJSON(message.packet) : undefined); + message.proofCommitment !== undefined && + (obj.proofCommitment = base64FromBytes( + message.proofCommitment !== undefined ? message.proofCommitment : new Uint8Array(), + )); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial(object: DeepPartial): MsgRecvPacket { + const message = { ...baseMsgRecvPacket } as MsgRecvPacket; + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromPartial(object.packet); + } else { + message.packet = undefined; + } + if (object.proofCommitment !== undefined && object.proofCommitment !== null) { + message.proofCommitment = object.proofCommitment; + } else { + message.proofCommitment = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } else { + message.signer = ""; + } + return message; + }, +}; + +const baseMsgRecvPacketResponse: object = {}; + +export const MsgRecvPacketResponse = { + encode(_: MsgRecvPacketResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgRecvPacketResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgRecvPacketResponse } as MsgRecvPacketResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgRecvPacketResponse { + const message = { ...baseMsgRecvPacketResponse } as MsgRecvPacketResponse; + return message; + }, + + toJSON(_: MsgRecvPacketResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgRecvPacketResponse { + const message = { ...baseMsgRecvPacketResponse } as MsgRecvPacketResponse; + return message; + }, +}; + +const baseMsgTimeout: object = { nextSequenceRecv: Long.UZERO, signer: "" }; + +export const MsgTimeout = { + encode(message: MsgTimeout, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.packet !== undefined) { + Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); + } + if (message.proofUnreceived.length !== 0) { + writer.uint32(18).bytes(message.proofUnreceived); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + if (!message.nextSequenceRecv.isZero()) { + writer.uint32(32).uint64(message.nextSequenceRecv); + } + if (message.signer !== "") { + writer.uint32(42).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgTimeout { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgTimeout } as MsgTimeout; + message.proofUnreceived = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.packet = Packet.decode(reader, reader.uint32()); + break; + case 2: + message.proofUnreceived = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 4: + message.nextSequenceRecv = reader.uint64() as Long; + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgTimeout { + const message = { ...baseMsgTimeout } as MsgTimeout; + message.proofUnreceived = new Uint8Array(); + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromJSON(object.packet); + } else { + message.packet = undefined; + } + if (object.proofUnreceived !== undefined && object.proofUnreceived !== null) { + message.proofUnreceived = bytesFromBase64(object.proofUnreceived); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + if (object.nextSequenceRecv !== undefined && object.nextSequenceRecv !== null) { + message.nextSequenceRecv = Long.fromString(object.nextSequenceRecv); + } else { + message.nextSequenceRecv = Long.UZERO; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = String(object.signer); + } else { + message.signer = ""; + } + return message; + }, + + toJSON(message: MsgTimeout): unknown { + const obj: any = {}; + message.packet !== undefined && (obj.packet = message.packet ? Packet.toJSON(message.packet) : undefined); + message.proofUnreceived !== undefined && + (obj.proofUnreceived = base64FromBytes( + message.proofUnreceived !== undefined ? message.proofUnreceived : new Uint8Array(), + )); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.nextSequenceRecv !== undefined && + (obj.nextSequenceRecv = (message.nextSequenceRecv || Long.UZERO).toString()); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial(object: DeepPartial): MsgTimeout { + const message = { ...baseMsgTimeout } as MsgTimeout; + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromPartial(object.packet); + } else { + message.packet = undefined; + } + if (object.proofUnreceived !== undefined && object.proofUnreceived !== null) { + message.proofUnreceived = object.proofUnreceived; + } else { + message.proofUnreceived = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + if (object.nextSequenceRecv !== undefined && object.nextSequenceRecv !== null) { + message.nextSequenceRecv = object.nextSequenceRecv as Long; + } else { + message.nextSequenceRecv = Long.UZERO; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } else { + message.signer = ""; + } + return message; + }, +}; + +const baseMsgTimeoutResponse: object = {}; + +export const MsgTimeoutResponse = { + encode(_: MsgTimeoutResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgTimeoutResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgTimeoutResponse } as MsgTimeoutResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgTimeoutResponse { + const message = { ...baseMsgTimeoutResponse } as MsgTimeoutResponse; + return message; + }, + + toJSON(_: MsgTimeoutResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgTimeoutResponse { + const message = { ...baseMsgTimeoutResponse } as MsgTimeoutResponse; + return message; + }, +}; + +const baseMsgTimeoutOnClose: object = { nextSequenceRecv: Long.UZERO, signer: "" }; + +export const MsgTimeoutOnClose = { + encode(message: MsgTimeoutOnClose, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.packet !== undefined) { + Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); + } + if (message.proofUnreceived.length !== 0) { + writer.uint32(18).bytes(message.proofUnreceived); + } + if (message.proofClose.length !== 0) { + writer.uint32(26).bytes(message.proofClose); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + if (!message.nextSequenceRecv.isZero()) { + writer.uint32(40).uint64(message.nextSequenceRecv); + } + if (message.signer !== "") { + writer.uint32(50).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgTimeoutOnClose { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgTimeoutOnClose } as MsgTimeoutOnClose; + message.proofUnreceived = new Uint8Array(); + message.proofClose = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.packet = Packet.decode(reader, reader.uint32()); + break; + case 2: + message.proofUnreceived = reader.bytes(); + break; + case 3: + message.proofClose = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 5: + message.nextSequenceRecv = reader.uint64() as Long; + break; + case 6: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgTimeoutOnClose { + const message = { ...baseMsgTimeoutOnClose } as MsgTimeoutOnClose; + message.proofUnreceived = new Uint8Array(); + message.proofClose = new Uint8Array(); + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromJSON(object.packet); + } else { + message.packet = undefined; + } + if (object.proofUnreceived !== undefined && object.proofUnreceived !== null) { + message.proofUnreceived = bytesFromBase64(object.proofUnreceived); + } + if (object.proofClose !== undefined && object.proofClose !== null) { + message.proofClose = bytesFromBase64(object.proofClose); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + if (object.nextSequenceRecv !== undefined && object.nextSequenceRecv !== null) { + message.nextSequenceRecv = Long.fromString(object.nextSequenceRecv); + } else { + message.nextSequenceRecv = Long.UZERO; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = String(object.signer); + } else { + message.signer = ""; + } + return message; + }, + + toJSON(message: MsgTimeoutOnClose): unknown { + const obj: any = {}; + message.packet !== undefined && (obj.packet = message.packet ? Packet.toJSON(message.packet) : undefined); + message.proofUnreceived !== undefined && + (obj.proofUnreceived = base64FromBytes( + message.proofUnreceived !== undefined ? message.proofUnreceived : new Uint8Array(), + )); + message.proofClose !== undefined && + (obj.proofClose = base64FromBytes( + message.proofClose !== undefined ? message.proofClose : new Uint8Array(), + )); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.nextSequenceRecv !== undefined && + (obj.nextSequenceRecv = (message.nextSequenceRecv || Long.UZERO).toString()); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial(object: DeepPartial): MsgTimeoutOnClose { + const message = { ...baseMsgTimeoutOnClose } as MsgTimeoutOnClose; + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromPartial(object.packet); + } else { + message.packet = undefined; + } + if (object.proofUnreceived !== undefined && object.proofUnreceived !== null) { + message.proofUnreceived = object.proofUnreceived; + } else { + message.proofUnreceived = new Uint8Array(); + } + if (object.proofClose !== undefined && object.proofClose !== null) { + message.proofClose = object.proofClose; + } else { + message.proofClose = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + if (object.nextSequenceRecv !== undefined && object.nextSequenceRecv !== null) { + message.nextSequenceRecv = object.nextSequenceRecv as Long; + } else { + message.nextSequenceRecv = Long.UZERO; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } else { + message.signer = ""; + } + return message; + }, +}; + +const baseMsgTimeoutOnCloseResponse: object = {}; + +export const MsgTimeoutOnCloseResponse = { + encode(_: MsgTimeoutOnCloseResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgTimeoutOnCloseResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgTimeoutOnCloseResponse } as MsgTimeoutOnCloseResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgTimeoutOnCloseResponse { + const message = { ...baseMsgTimeoutOnCloseResponse } as MsgTimeoutOnCloseResponse; + return message; + }, + + toJSON(_: MsgTimeoutOnCloseResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgTimeoutOnCloseResponse { + const message = { ...baseMsgTimeoutOnCloseResponse } as MsgTimeoutOnCloseResponse; + return message; + }, +}; + +const baseMsgAcknowledgement: object = { signer: "" }; + +export const MsgAcknowledgement = { + encode(message: MsgAcknowledgement, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.packet !== undefined) { + Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); + } + if (message.acknowledgement.length !== 0) { + writer.uint32(18).bytes(message.acknowledgement); + } + if (message.proofAcked.length !== 0) { + writer.uint32(26).bytes(message.proofAcked); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(42).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgAcknowledgement { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgAcknowledgement } as MsgAcknowledgement; + message.acknowledgement = new Uint8Array(); + message.proofAcked = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.packet = Packet.decode(reader, reader.uint32()); + break; + case 2: + message.acknowledgement = reader.bytes(); + break; + case 3: + message.proofAcked = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgAcknowledgement { + const message = { ...baseMsgAcknowledgement } as MsgAcknowledgement; + message.acknowledgement = new Uint8Array(); + message.proofAcked = new Uint8Array(); + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromJSON(object.packet); + } else { + message.packet = undefined; + } + if (object.acknowledgement !== undefined && object.acknowledgement !== null) { + message.acknowledgement = bytesFromBase64(object.acknowledgement); + } + if (object.proofAcked !== undefined && object.proofAcked !== null) { + message.proofAcked = bytesFromBase64(object.proofAcked); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = String(object.signer); + } else { + message.signer = ""; + } + return message; + }, + + toJSON(message: MsgAcknowledgement): unknown { + const obj: any = {}; + message.packet !== undefined && (obj.packet = message.packet ? Packet.toJSON(message.packet) : undefined); + message.acknowledgement !== undefined && + (obj.acknowledgement = base64FromBytes( + message.acknowledgement !== undefined ? message.acknowledgement : new Uint8Array(), + )); + message.proofAcked !== undefined && + (obj.proofAcked = base64FromBytes( + message.proofAcked !== undefined ? message.proofAcked : new Uint8Array(), + )); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial(object: DeepPartial): MsgAcknowledgement { + const message = { ...baseMsgAcknowledgement } as MsgAcknowledgement; + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromPartial(object.packet); + } else { + message.packet = undefined; + } + if (object.acknowledgement !== undefined && object.acknowledgement !== null) { + message.acknowledgement = object.acknowledgement; + } else { + message.acknowledgement = new Uint8Array(); + } + if (object.proofAcked !== undefined && object.proofAcked !== null) { + message.proofAcked = object.proofAcked; + } else { + message.proofAcked = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } else { + message.signer = ""; + } + return message; + }, +}; + +const baseMsgAcknowledgementResponse: object = {}; + +export const MsgAcknowledgementResponse = { + encode(_: MsgAcknowledgementResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgAcknowledgementResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgAcknowledgementResponse } as MsgAcknowledgementResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgAcknowledgementResponse { + const message = { ...baseMsgAcknowledgementResponse } as MsgAcknowledgementResponse; + return message; + }, + + toJSON(_: MsgAcknowledgementResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgAcknowledgementResponse { + const message = { ...baseMsgAcknowledgementResponse } as MsgAcknowledgementResponse; + return message; + }, +}; + +/** Msg defines the ibc/channel Msg service. */ +export interface Msg { + /** ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. */ + ChannelOpenInit(request: MsgChannelOpenInit): Promise; + /** ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. */ + ChannelOpenTry(request: MsgChannelOpenTry): Promise; + /** ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. */ + ChannelOpenAck(request: MsgChannelOpenAck): Promise; + /** ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. */ + ChannelOpenConfirm(request: MsgChannelOpenConfirm): Promise; + /** ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. */ + ChannelCloseInit(request: MsgChannelCloseInit): Promise; + /** ChannelCloseConfirm defines a rpc handler method for MsgChannelCloseConfirm. */ + ChannelCloseConfirm(request: MsgChannelCloseConfirm): Promise; + /** RecvPacket defines a rpc handler method for MsgRecvPacket. */ + RecvPacket(request: MsgRecvPacket): Promise; + /** Timeout defines a rpc handler method for MsgTimeout. */ + Timeout(request: MsgTimeout): Promise; + /** TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. */ + TimeoutOnClose(request: MsgTimeoutOnClose): Promise; + /** Acknowledgement defines a rpc handler method for MsgAcknowledgement. */ + Acknowledgement(request: MsgAcknowledgement): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.ChannelOpenInit = this.ChannelOpenInit.bind(this); + this.ChannelOpenTry = this.ChannelOpenTry.bind(this); + this.ChannelOpenAck = this.ChannelOpenAck.bind(this); + this.ChannelOpenConfirm = this.ChannelOpenConfirm.bind(this); + this.ChannelCloseInit = this.ChannelCloseInit.bind(this); + this.ChannelCloseConfirm = this.ChannelCloseConfirm.bind(this); + this.RecvPacket = this.RecvPacket.bind(this); + this.Timeout = this.Timeout.bind(this); + this.TimeoutOnClose = this.TimeoutOnClose.bind(this); + this.Acknowledgement = this.Acknowledgement.bind(this); + } + ChannelOpenInit(request: MsgChannelOpenInit): Promise { + const data = MsgChannelOpenInit.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelOpenInit", data); + return promise.then((data) => MsgChannelOpenInitResponse.decode(new _m0.Reader(data))); + } + + ChannelOpenTry(request: MsgChannelOpenTry): Promise { + const data = MsgChannelOpenTry.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelOpenTry", data); + return promise.then((data) => MsgChannelOpenTryResponse.decode(new _m0.Reader(data))); + } + + ChannelOpenAck(request: MsgChannelOpenAck): Promise { + const data = MsgChannelOpenAck.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelOpenAck", data); + return promise.then((data) => MsgChannelOpenAckResponse.decode(new _m0.Reader(data))); + } + + ChannelOpenConfirm(request: MsgChannelOpenConfirm): Promise { + const data = MsgChannelOpenConfirm.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelOpenConfirm", data); + return promise.then((data) => MsgChannelOpenConfirmResponse.decode(new _m0.Reader(data))); + } + + ChannelCloseInit(request: MsgChannelCloseInit): Promise { + const data = MsgChannelCloseInit.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelCloseInit", data); + return promise.then((data) => MsgChannelCloseInitResponse.decode(new _m0.Reader(data))); + } + + ChannelCloseConfirm(request: MsgChannelCloseConfirm): Promise { + const data = MsgChannelCloseConfirm.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelCloseConfirm", data); + return promise.then((data) => MsgChannelCloseConfirmResponse.decode(new _m0.Reader(data))); + } + + RecvPacket(request: MsgRecvPacket): Promise { + const data = MsgRecvPacket.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "RecvPacket", data); + return promise.then((data) => MsgRecvPacketResponse.decode(new _m0.Reader(data))); + } + + Timeout(request: MsgTimeout): Promise { + const data = MsgTimeout.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "Timeout", data); + return promise.then((data) => MsgTimeoutResponse.decode(new _m0.Reader(data))); + } + + TimeoutOnClose(request: MsgTimeoutOnClose): Promise { + const data = MsgTimeoutOnClose.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "TimeoutOnClose", data); + return promise.then((data) => MsgTimeoutOnCloseResponse.decode(new _m0.Reader(data))); + } + + Acknowledgement(request: MsgAcknowledgement): Promise { + const data = MsgAcknowledgement.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "Acknowledgement", data); + return promise.then((data) => MsgAcknowledgementResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/ibc/core/client/v1/client.ts b/src/ibc/core/client/v1/client.ts new file mode 100644 index 00000000..ebc2f4a0 --- /dev/null +++ b/src/ibc/core/client/v1/client.ts @@ -0,0 +1,561 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Any } from "../../../../google/protobuf/any"; + +export const protobufPackage = "ibc.core.client.v1"; + +/** + * IdentifiedClientState defines a client state with an additional client + * identifier field. + */ +export interface IdentifiedClientState { + /** client identifier */ + clientId: string; + /** client state */ + clientState?: Any; +} + +/** ConsensusStateWithHeight defines a consensus state with an additional height field. */ +export interface ConsensusStateWithHeight { + /** consensus state height */ + height?: Height; + /** consensus state */ + consensusState?: Any; +} + +/** + * ClientConsensusStates defines all the stored consensus states for a given + * client. + */ +export interface ClientConsensusStates { + /** client identifier */ + clientId: string; + /** consensus states and their heights associated with the client */ + consensusStates: ConsensusStateWithHeight[]; +} + +/** + * ClientUpdateProposal is a governance proposal. If it passes, the client is + * updated with the provided header. The update may fail if the header is not + * valid given certain conditions specified by the client implementation. + */ +export interface ClientUpdateProposal { + /** the title of the update proposal */ + title: string; + /** the description of the proposal */ + description: string; + /** the client identifier for the client to be updated if the proposal passes */ + clientId: string; + /** the header used to update the client if the proposal passes */ + header?: Any; +} + +/** + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping RevisionNumber + * the same. However some consensus algorithms may choose to reset the + * height in certain conditions e.g. hard forks, state-machine breaking changes + * In these cases, the RevisionNumber is incremented so that height continues to + * be monitonically increasing even as the RevisionHeight gets reset + */ +export interface Height { + /** the revision that the client is currently on */ + revisionNumber: Long; + /** the height within the given revision */ + revisionHeight: Long; +} + +/** Params defines the set of IBC light client parameters. */ +export interface Params { + /** allowed_clients defines the list of allowed client state types. */ + allowedClients: string[]; +} + +const baseIdentifiedClientState: object = { clientId: "" }; + +export const IdentifiedClientState = { + encode(message: IdentifiedClientState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): IdentifiedClientState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseIdentifiedClientState } as IdentifiedClientState; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): IdentifiedClientState { + const message = { ...baseIdentifiedClientState } as IdentifiedClientState; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.clientState !== undefined && object.clientState !== null) { + message.clientState = Any.fromJSON(object.clientState); + } else { + message.clientState = undefined; + } + return message; + }, + + toJSON(message: IdentifiedClientState): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.clientState !== undefined && + (obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): IdentifiedClientState { + const message = { ...baseIdentifiedClientState } as IdentifiedClientState; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.clientState !== undefined && object.clientState !== null) { + message.clientState = Any.fromPartial(object.clientState); + } else { + message.clientState = undefined; + } + return message; + }, +}; + +const baseConsensusStateWithHeight: object = {}; + +export const ConsensusStateWithHeight = { + encode(message: ConsensusStateWithHeight, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(10).fork()).ldelim(); + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ConsensusStateWithHeight { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseConsensusStateWithHeight } as ConsensusStateWithHeight; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = Height.decode(reader, reader.uint32()); + break; + case 2: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ConsensusStateWithHeight { + const message = { ...baseConsensusStateWithHeight } as ConsensusStateWithHeight; + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromJSON(object.height); + } else { + message.height = undefined; + } + if (object.consensusState !== undefined && object.consensusState !== null) { + message.consensusState = Any.fromJSON(object.consensusState); + } else { + message.consensusState = undefined; + } + return message; + }, + + toJSON(message: ConsensusStateWithHeight): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + message.consensusState !== undefined && + (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): ConsensusStateWithHeight { + const message = { ...baseConsensusStateWithHeight } as ConsensusStateWithHeight; + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromPartial(object.height); + } else { + message.height = undefined; + } + if (object.consensusState !== undefined && object.consensusState !== null) { + message.consensusState = Any.fromPartial(object.consensusState); + } else { + message.consensusState = undefined; + } + return message; + }, +}; + +const baseClientConsensusStates: object = { clientId: "" }; + +export const ClientConsensusStates = { + encode(message: ClientConsensusStates, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + for (const v of message.consensusStates) { + ConsensusStateWithHeight.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ClientConsensusStates { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseClientConsensusStates } as ClientConsensusStates; + message.consensusStates = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.consensusStates.push(ConsensusStateWithHeight.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ClientConsensusStates { + const message = { ...baseClientConsensusStates } as ClientConsensusStates; + message.consensusStates = []; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.consensusStates !== undefined && object.consensusStates !== null) { + for (const e of object.consensusStates) { + message.consensusStates.push(ConsensusStateWithHeight.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: ClientConsensusStates): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + if (message.consensusStates) { + obj.consensusStates = message.consensusStates.map((e) => + e ? ConsensusStateWithHeight.toJSON(e) : undefined, + ); + } else { + obj.consensusStates = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ClientConsensusStates { + const message = { ...baseClientConsensusStates } as ClientConsensusStates; + message.consensusStates = []; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.consensusStates !== undefined && object.consensusStates !== null) { + for (const e of object.consensusStates) { + message.consensusStates.push(ConsensusStateWithHeight.fromPartial(e)); + } + } + return message; + }, +}; + +const baseClientUpdateProposal: object = { title: "", description: "", clientId: "" }; + +export const ClientUpdateProposal = { + encode(message: ClientUpdateProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.clientId !== "") { + writer.uint32(26).string(message.clientId); + } + if (message.header !== undefined) { + Any.encode(message.header, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ClientUpdateProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseClientUpdateProposal } as ClientUpdateProposal; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.clientId = reader.string(); + break; + case 4: + message.header = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ClientUpdateProposal { + const message = { ...baseClientUpdateProposal } as ClientUpdateProposal; + if (object.title !== undefined && object.title !== null) { + message.title = String(object.title); + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = String(object.description); + } else { + message.description = ""; + } + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.header !== undefined && object.header !== null) { + message.header = Any.fromJSON(object.header); + } else { + message.header = undefined; + } + return message; + }, + + toJSON(message: ClientUpdateProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.clientId !== undefined && (obj.clientId = message.clientId); + message.header !== undefined && (obj.header = message.header ? Any.toJSON(message.header) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): ClientUpdateProposal { + const message = { ...baseClientUpdateProposal } as ClientUpdateProposal; + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } else { + message.title = ""; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ""; + } + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.header !== undefined && object.header !== null) { + message.header = Any.fromPartial(object.header); + } else { + message.header = undefined; + } + return message; + }, +}; + +const baseHeight: object = { revisionNumber: Long.UZERO, revisionHeight: Long.UZERO }; + +export const Height = { + encode(message: Height, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.revisionNumber.isZero()) { + writer.uint32(8).uint64(message.revisionNumber); + } + if (!message.revisionHeight.isZero()) { + writer.uint32(16).uint64(message.revisionHeight); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Height { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHeight } as Height; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.revisionNumber = reader.uint64() as Long; + break; + case 2: + message.revisionHeight = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Height { + const message = { ...baseHeight } as Height; + if (object.revisionNumber !== undefined && object.revisionNumber !== null) { + message.revisionNumber = Long.fromString(object.revisionNumber); + } else { + message.revisionNumber = Long.UZERO; + } + if (object.revisionHeight !== undefined && object.revisionHeight !== null) { + message.revisionHeight = Long.fromString(object.revisionHeight); + } else { + message.revisionHeight = Long.UZERO; + } + return message; + }, + + toJSON(message: Height): unknown { + const obj: any = {}; + message.revisionNumber !== undefined && + (obj.revisionNumber = (message.revisionNumber || Long.UZERO).toString()); + message.revisionHeight !== undefined && + (obj.revisionHeight = (message.revisionHeight || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): Height { + const message = { ...baseHeight } as Height; + if (object.revisionNumber !== undefined && object.revisionNumber !== null) { + message.revisionNumber = object.revisionNumber as Long; + } else { + message.revisionNumber = Long.UZERO; + } + if (object.revisionHeight !== undefined && object.revisionHeight !== null) { + message.revisionHeight = object.revisionHeight as Long; + } else { + message.revisionHeight = Long.UZERO; + } + return message; + }, +}; + +const baseParams: object = { allowedClients: "" }; + +export const Params = { + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.allowedClients) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseParams } as Params; + message.allowedClients = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowedClients.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Params { + const message = { ...baseParams } as Params; + message.allowedClients = []; + if (object.allowedClients !== undefined && object.allowedClients !== null) { + for (const e of object.allowedClients) { + message.allowedClients.push(String(e)); + } + } + return message; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + if (message.allowedClients) { + obj.allowedClients = message.allowedClients.map((e) => e); + } else { + obj.allowedClients = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): Params { + const message = { ...baseParams } as Params; + message.allowedClients = []; + if (object.allowedClients !== undefined && object.allowedClients !== null) { + for (const e of object.allowedClients) { + message.allowedClients.push(e); + } + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/ibc/core/client/v1/genesis.ts b/src/ibc/core/client/v1/genesis.ts new file mode 100644 index 00000000..73bc804b --- /dev/null +++ b/src/ibc/core/client/v1/genesis.ts @@ -0,0 +1,404 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Params, IdentifiedClientState, ClientConsensusStates } from "../../../../ibc/core/client/v1/client"; + +export const protobufPackage = "ibc.core.client.v1"; + +/** GenesisState defines the ibc client submodule's genesis state. */ +export interface GenesisState { + /** client states with their corresponding identifiers */ + clients: IdentifiedClientState[]; + /** consensus states from each client */ + clientsConsensus: ClientConsensusStates[]; + /** metadata from each client */ + clientsMetadata: IdentifiedGenesisMetadata[]; + params?: Params; + /** create localhost on initialization */ + createLocalhost: boolean; + /** the sequence for the next generated client identifier */ + nextClientSequence: Long; +} + +/** + * GenesisMetadata defines the genesis type for metadata that clients may return + * with ExportMetadata + */ +export interface GenesisMetadata { + /** store key of metadata without clientID-prefix */ + key: Uint8Array; + /** metadata value */ + value: Uint8Array; +} + +/** IdentifiedGenesisMetadata has the client metadata with the corresponding client id. */ +export interface IdentifiedGenesisMetadata { + clientId: string; + clientMetadata: GenesisMetadata[]; +} + +const baseGenesisState: object = { createLocalhost: false, nextClientSequence: Long.UZERO }; + +export const GenesisState = { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.clients) { + IdentifiedClientState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.clientsConsensus) { + ClientConsensusStates.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.clientsMetadata) { + IdentifiedGenesisMetadata.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(34).fork()).ldelim(); + } + if (message.createLocalhost === true) { + writer.uint32(40).bool(message.createLocalhost); + } + if (!message.nextClientSequence.isZero()) { + writer.uint32(48).uint64(message.nextClientSequence); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGenesisState } as GenesisState; + message.clients = []; + message.clientsConsensus = []; + message.clientsMetadata = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clients.push(IdentifiedClientState.decode(reader, reader.uint32())); + break; + case 2: + message.clientsConsensus.push(ClientConsensusStates.decode(reader, reader.uint32())); + break; + case 3: + message.clientsMetadata.push(IdentifiedGenesisMetadata.decode(reader, reader.uint32())); + break; + case 4: + message.params = Params.decode(reader, reader.uint32()); + break; + case 5: + message.createLocalhost = reader.bool(); + break; + case 6: + message.nextClientSequence = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.clients = []; + message.clientsConsensus = []; + message.clientsMetadata = []; + if (object.clients !== undefined && object.clients !== null) { + for (const e of object.clients) { + message.clients.push(IdentifiedClientState.fromJSON(e)); + } + } + if (object.clientsConsensus !== undefined && object.clientsConsensus !== null) { + for (const e of object.clientsConsensus) { + message.clientsConsensus.push(ClientConsensusStates.fromJSON(e)); + } + } + if (object.clientsMetadata !== undefined && object.clientsMetadata !== null) { + for (const e of object.clientsMetadata) { + message.clientsMetadata.push(IdentifiedGenesisMetadata.fromJSON(e)); + } + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + if (object.createLocalhost !== undefined && object.createLocalhost !== null) { + message.createLocalhost = Boolean(object.createLocalhost); + } else { + message.createLocalhost = false; + } + if (object.nextClientSequence !== undefined && object.nextClientSequence !== null) { + message.nextClientSequence = Long.fromString(object.nextClientSequence); + } else { + message.nextClientSequence = Long.UZERO; + } + return message; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.clients) { + obj.clients = message.clients.map((e) => (e ? IdentifiedClientState.toJSON(e) : undefined)); + } else { + obj.clients = []; + } + if (message.clientsConsensus) { + obj.clientsConsensus = message.clientsConsensus.map((e) => + e ? ClientConsensusStates.toJSON(e) : undefined, + ); + } else { + obj.clientsConsensus = []; + } + if (message.clientsMetadata) { + obj.clientsMetadata = message.clientsMetadata.map((e) => + e ? IdentifiedGenesisMetadata.toJSON(e) : undefined, + ); + } else { + obj.clientsMetadata = []; + } + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + message.createLocalhost !== undefined && (obj.createLocalhost = message.createLocalhost); + message.nextClientSequence !== undefined && + (obj.nextClientSequence = (message.nextClientSequence || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.clients = []; + message.clientsConsensus = []; + message.clientsMetadata = []; + if (object.clients !== undefined && object.clients !== null) { + for (const e of object.clients) { + message.clients.push(IdentifiedClientState.fromPartial(e)); + } + } + if (object.clientsConsensus !== undefined && object.clientsConsensus !== null) { + for (const e of object.clientsConsensus) { + message.clientsConsensus.push(ClientConsensusStates.fromPartial(e)); + } + } + if (object.clientsMetadata !== undefined && object.clientsMetadata !== null) { + for (const e of object.clientsMetadata) { + message.clientsMetadata.push(IdentifiedGenesisMetadata.fromPartial(e)); + } + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + if (object.createLocalhost !== undefined && object.createLocalhost !== null) { + message.createLocalhost = object.createLocalhost; + } else { + message.createLocalhost = false; + } + if (object.nextClientSequence !== undefined && object.nextClientSequence !== null) { + message.nextClientSequence = object.nextClientSequence as Long; + } else { + message.nextClientSequence = Long.UZERO; + } + return message; + }, +}; + +const baseGenesisMetadata: object = {}; + +export const GenesisMetadata = { + encode(message: GenesisMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGenesisMetadata } as GenesisMetadata; + message.key = new Uint8Array(); + message.value = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisMetadata { + const message = { ...baseGenesisMetadata } as GenesisMetadata; + message.key = new Uint8Array(); + message.value = new Uint8Array(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; + }, + + toJSON(message: GenesisMetadata): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.value !== undefined && + (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): GenesisMetadata { + const message = { ...baseGenesisMetadata } as GenesisMetadata; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } else { + message.value = new Uint8Array(); + } + return message; + }, +}; + +const baseIdentifiedGenesisMetadata: object = { clientId: "" }; + +export const IdentifiedGenesisMetadata = { + encode(message: IdentifiedGenesisMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + for (const v of message.clientMetadata) { + GenesisMetadata.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): IdentifiedGenesisMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseIdentifiedGenesisMetadata } as IdentifiedGenesisMetadata; + message.clientMetadata = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientMetadata.push(GenesisMetadata.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): IdentifiedGenesisMetadata { + const message = { ...baseIdentifiedGenesisMetadata } as IdentifiedGenesisMetadata; + message.clientMetadata = []; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.clientMetadata !== undefined && object.clientMetadata !== null) { + for (const e of object.clientMetadata) { + message.clientMetadata.push(GenesisMetadata.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: IdentifiedGenesisMetadata): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + if (message.clientMetadata) { + obj.clientMetadata = message.clientMetadata.map((e) => (e ? GenesisMetadata.toJSON(e) : undefined)); + } else { + obj.clientMetadata = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): IdentifiedGenesisMetadata { + const message = { ...baseIdentifiedGenesisMetadata } as IdentifiedGenesisMetadata; + message.clientMetadata = []; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.clientMetadata !== undefined && object.clientMetadata !== null) { + for (const e of object.clientMetadata) { + message.clientMetadata.push(GenesisMetadata.fromPartial(e)); + } + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/ibc/core/client/v1/query.ts b/src/ibc/core/client/v1/query.ts new file mode 100644 index 00000000..ab93e176 --- /dev/null +++ b/src/ibc/core/client/v1/query.ts @@ -0,0 +1,967 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Any } from "../../../../google/protobuf/any"; +import { + Height, + Params, + IdentifiedClientState, + ConsensusStateWithHeight, +} from "../../../../ibc/core/client/v1/client"; +import { PageRequest, PageResponse } from "../../../../cosmos/base/query/v1beta1/pagination"; + +export const protobufPackage = "ibc.core.client.v1"; + +/** + * QueryClientStateRequest is the request type for the Query/ClientState RPC + * method + */ +export interface QueryClientStateRequest { + /** client state unique identifier */ + clientId: string; +} + +/** + * QueryClientStateResponse is the response type for the Query/ClientState RPC + * method. Besides the client state, it includes a proof and the height from + * which the proof was retrieved. + */ +export interface QueryClientStateResponse { + /** client state associated with the request identifier */ + clientState?: Any; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight?: Height; +} + +/** + * QueryClientStatesRequest is the request type for the Query/ClientStates RPC + * method + */ +export interface QueryClientStatesRequest { + /** pagination request */ + pagination?: PageRequest; +} + +/** + * QueryClientStatesResponse is the response type for the Query/ClientStates RPC + * method. + */ +export interface QueryClientStatesResponse { + /** list of stored ClientStates of the chain. */ + clientStates: IdentifiedClientState[]; + /** pagination response */ + pagination?: PageResponse; +} + +/** + * QueryConsensusStateRequest is the request type for the Query/ConsensusState + * RPC method. Besides the consensus state, it includes a proof and the height + * from which the proof was retrieved. + */ +export interface QueryConsensusStateRequest { + /** client identifier */ + clientId: string; + /** consensus state revision number */ + revisionNumber: Long; + /** consensus state revision height */ + revisionHeight: Long; + /** + * latest_height overrrides the height field and queries the latest stored + * ConsensusState + */ + latestHeight: boolean; +} + +/** + * QueryConsensusStateResponse is the response type for the Query/ConsensusState + * RPC method + */ +export interface QueryConsensusStateResponse { + /** consensus state associated with the client identifier at the given height */ + consensusState?: Any; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight?: Height; +} + +/** + * QueryConsensusStatesRequest is the request type for the Query/ConsensusStates + * RPC method. + */ +export interface QueryConsensusStatesRequest { + /** client identifier */ + clientId: string; + /** pagination request */ + pagination?: PageRequest; +} + +/** + * QueryConsensusStatesResponse is the response type for the + * Query/ConsensusStates RPC method + */ +export interface QueryConsensusStatesResponse { + /** consensus states associated with the identifier */ + consensusStates: ConsensusStateWithHeight[]; + /** pagination response */ + pagination?: PageResponse; +} + +/** QueryClientParamsRequest is the request type for the Query/ClientParams RPC method. */ +export interface QueryClientParamsRequest {} + +/** QueryClientParamsResponse is the response type for the Query/ClientParams RPC method. */ +export interface QueryClientParamsResponse { + /** params defines the parameters of the module. */ + params?: Params; +} + +const baseQueryClientStateRequest: object = { clientId: "" }; + +export const QueryClientStateRequest = { + encode(message: QueryClientStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientStateRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryClientStateRequest } as QueryClientStateRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryClientStateRequest { + const message = { ...baseQueryClientStateRequest } as QueryClientStateRequest; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + return message; + }, + + toJSON(message: QueryClientStateRequest): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + return obj; + }, + + fromPartial(object: DeepPartial): QueryClientStateRequest { + const message = { ...baseQueryClientStateRequest } as QueryClientStateRequest; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + return message; + }, +}; + +const baseQueryClientStateResponse: object = {}; + +export const QueryClientStateResponse = { + encode(message: QueryClientStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientStateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryClientStateResponse } as QueryClientStateResponse; + message.proof = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientState = Any.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryClientStateResponse { + const message = { ...baseQueryClientStateResponse } as QueryClientStateResponse; + message.proof = new Uint8Array(); + if (object.clientState !== undefined && object.clientState !== null) { + message.clientState = Any.fromJSON(object.clientState); + } else { + message.clientState = undefined; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + + toJSON(message: QueryClientStateResponse): unknown { + const obj: any = {}; + message.clientState !== undefined && + (obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined); + message.proof !== undefined && + (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryClientStateResponse { + const message = { ...baseQueryClientStateResponse } as QueryClientStateResponse; + if (object.clientState !== undefined && object.clientState !== null) { + message.clientState = Any.fromPartial(object.clientState); + } else { + message.clientState = undefined; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = object.proof; + } else { + message.proof = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, +}; + +const baseQueryClientStatesRequest: object = {}; + +export const QueryClientStatesRequest = { + encode(message: QueryClientStatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientStatesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryClientStatesRequest } as QueryClientStatesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryClientStatesRequest { + const message = { ...baseQueryClientStatesRequest } as QueryClientStatesRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryClientStatesRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryClientStatesRequest { + const message = { ...baseQueryClientStatesRequest } as QueryClientStatesRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryClientStatesResponse: object = {}; + +export const QueryClientStatesResponse = { + encode(message: QueryClientStatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.clientStates) { + IdentifiedClientState.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientStatesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryClientStatesResponse } as QueryClientStatesResponse; + message.clientStates = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientStates.push(IdentifiedClientState.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryClientStatesResponse { + const message = { ...baseQueryClientStatesResponse } as QueryClientStatesResponse; + message.clientStates = []; + if (object.clientStates !== undefined && object.clientStates !== null) { + for (const e of object.clientStates) { + message.clientStates.push(IdentifiedClientState.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryClientStatesResponse): unknown { + const obj: any = {}; + if (message.clientStates) { + obj.clientStates = message.clientStates.map((e) => (e ? IdentifiedClientState.toJSON(e) : undefined)); + } else { + obj.clientStates = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryClientStatesResponse { + const message = { ...baseQueryClientStatesResponse } as QueryClientStatesResponse; + message.clientStates = []; + if (object.clientStates !== undefined && object.clientStates !== null) { + for (const e of object.clientStates) { + message.clientStates.push(IdentifiedClientState.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryConsensusStateRequest: object = { + clientId: "", + revisionNumber: Long.UZERO, + revisionHeight: Long.UZERO, + latestHeight: false, +}; + +export const QueryConsensusStateRequest = { + encode(message: QueryConsensusStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (!message.revisionNumber.isZero()) { + writer.uint32(16).uint64(message.revisionNumber); + } + if (!message.revisionHeight.isZero()) { + writer.uint32(24).uint64(message.revisionHeight); + } + if (message.latestHeight === true) { + writer.uint32(32).bool(message.latestHeight); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConsensusStateRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryConsensusStateRequest } as QueryConsensusStateRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.revisionNumber = reader.uint64() as Long; + break; + case 3: + message.revisionHeight = reader.uint64() as Long; + break; + case 4: + message.latestHeight = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConsensusStateRequest { + const message = { ...baseQueryConsensusStateRequest } as QueryConsensusStateRequest; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.revisionNumber !== undefined && object.revisionNumber !== null) { + message.revisionNumber = Long.fromString(object.revisionNumber); + } else { + message.revisionNumber = Long.UZERO; + } + if (object.revisionHeight !== undefined && object.revisionHeight !== null) { + message.revisionHeight = Long.fromString(object.revisionHeight); + } else { + message.revisionHeight = Long.UZERO; + } + if (object.latestHeight !== undefined && object.latestHeight !== null) { + message.latestHeight = Boolean(object.latestHeight); + } else { + message.latestHeight = false; + } + return message; + }, + + toJSON(message: QueryConsensusStateRequest): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.revisionNumber !== undefined && + (obj.revisionNumber = (message.revisionNumber || Long.UZERO).toString()); + message.revisionHeight !== undefined && + (obj.revisionHeight = (message.revisionHeight || Long.UZERO).toString()); + message.latestHeight !== undefined && (obj.latestHeight = message.latestHeight); + return obj; + }, + + fromPartial(object: DeepPartial): QueryConsensusStateRequest { + const message = { ...baseQueryConsensusStateRequest } as QueryConsensusStateRequest; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.revisionNumber !== undefined && object.revisionNumber !== null) { + message.revisionNumber = object.revisionNumber as Long; + } else { + message.revisionNumber = Long.UZERO; + } + if (object.revisionHeight !== undefined && object.revisionHeight !== null) { + message.revisionHeight = object.revisionHeight as Long; + } else { + message.revisionHeight = Long.UZERO; + } + if (object.latestHeight !== undefined && object.latestHeight !== null) { + message.latestHeight = object.latestHeight; + } else { + message.latestHeight = false; + } + return message; + }, +}; + +const baseQueryConsensusStateResponse: object = {}; + +export const QueryConsensusStateResponse = { + encode(message: QueryConsensusStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConsensusStateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryConsensusStateResponse } as QueryConsensusStateResponse; + message.proof = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConsensusStateResponse { + const message = { ...baseQueryConsensusStateResponse } as QueryConsensusStateResponse; + message.proof = new Uint8Array(); + if (object.consensusState !== undefined && object.consensusState !== null) { + message.consensusState = Any.fromJSON(object.consensusState); + } else { + message.consensusState = undefined; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + + toJSON(message: QueryConsensusStateResponse): unknown { + const obj: any = {}; + message.consensusState !== undefined && + (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); + message.proof !== undefined && + (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryConsensusStateResponse { + const message = { ...baseQueryConsensusStateResponse } as QueryConsensusStateResponse; + if (object.consensusState !== undefined && object.consensusState !== null) { + message.consensusState = Any.fromPartial(object.consensusState); + } else { + message.consensusState = undefined; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = object.proof; + } else { + message.proof = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, +}; + +const baseQueryConsensusStatesRequest: object = { clientId: "" }; + +export const QueryConsensusStatesRequest = { + encode(message: QueryConsensusStatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConsensusStatesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryConsensusStatesRequest } as QueryConsensusStatesRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConsensusStatesRequest { + const message = { ...baseQueryConsensusStatesRequest } as QueryConsensusStatesRequest; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryConsensusStatesRequest): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryConsensusStatesRequest { + const message = { ...baseQueryConsensusStatesRequest } as QueryConsensusStatesRequest; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryConsensusStatesResponse: object = {}; + +export const QueryConsensusStatesResponse = { + encode(message: QueryConsensusStatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.consensusStates) { + ConsensusStateWithHeight.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConsensusStatesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryConsensusStatesResponse } as QueryConsensusStatesResponse; + message.consensusStates = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusStates.push(ConsensusStateWithHeight.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConsensusStatesResponse { + const message = { ...baseQueryConsensusStatesResponse } as QueryConsensusStatesResponse; + message.consensusStates = []; + if (object.consensusStates !== undefined && object.consensusStates !== null) { + for (const e of object.consensusStates) { + message.consensusStates.push(ConsensusStateWithHeight.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryConsensusStatesResponse): unknown { + const obj: any = {}; + if (message.consensusStates) { + obj.consensusStates = message.consensusStates.map((e) => + e ? ConsensusStateWithHeight.toJSON(e) : undefined, + ); + } else { + obj.consensusStates = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryConsensusStatesResponse { + const message = { ...baseQueryConsensusStatesResponse } as QueryConsensusStatesResponse; + message.consensusStates = []; + if (object.consensusStates !== undefined && object.consensusStates !== null) { + for (const e of object.consensusStates) { + message.consensusStates.push(ConsensusStateWithHeight.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryClientParamsRequest: object = {}; + +export const QueryClientParamsRequest = { + encode(_: QueryClientParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryClientParamsRequest } as QueryClientParamsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): QueryClientParamsRequest { + const message = { ...baseQueryClientParamsRequest } as QueryClientParamsRequest; + return message; + }, + + toJSON(_: QueryClientParamsRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): QueryClientParamsRequest { + const message = { ...baseQueryClientParamsRequest } as QueryClientParamsRequest; + return message; + }, +}; + +const baseQueryClientParamsResponse: object = {}; + +export const QueryClientParamsResponse = { + encode(message: QueryClientParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryClientParamsResponse } as QueryClientParamsResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryClientParamsResponse { + const message = { ...baseQueryClientParamsResponse } as QueryClientParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromJSON(object.params); + } else { + message.params = undefined; + } + return message; + }, + + toJSON(message: QueryClientParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryClientParamsResponse { + const message = { ...baseQueryClientParamsResponse } as QueryClientParamsResponse; + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromPartial(object.params); + } else { + message.params = undefined; + } + return message; + }, +}; + +/** Query provides defines the gRPC querier service */ +export interface Query { + /** ClientState queries an IBC light client. */ + ClientState(request: QueryClientStateRequest): Promise; + /** ClientStates queries all the IBC light clients of a chain. */ + ClientStates(request: QueryClientStatesRequest): Promise; + /** + * ConsensusState queries a consensus state associated with a client state at + * a given height. + */ + ConsensusState(request: QueryConsensusStateRequest): Promise; + /** + * ConsensusStates queries all the consensus state associated with a given + * client. + */ + ConsensusStates(request: QueryConsensusStatesRequest): Promise; + /** ClientParams queries all parameters of the ibc client. */ + ClientParams(request: QueryClientParamsRequest): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.ClientState = this.ClientState.bind(this); + this.ClientStates = this.ClientStates.bind(this); + this.ConsensusState = this.ConsensusState.bind(this); + this.ConsensusStates = this.ConsensusStates.bind(this); + this.ClientParams = this.ClientParams.bind(this); + } + ClientState(request: QueryClientStateRequest): Promise { + const data = QueryClientStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "ClientState", data); + return promise.then((data) => QueryClientStateResponse.decode(new _m0.Reader(data))); + } + + ClientStates(request: QueryClientStatesRequest): Promise { + const data = QueryClientStatesRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "ClientStates", data); + return promise.then((data) => QueryClientStatesResponse.decode(new _m0.Reader(data))); + } + + ConsensusState(request: QueryConsensusStateRequest): Promise { + const data = QueryConsensusStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "ConsensusState", data); + return promise.then((data) => QueryConsensusStateResponse.decode(new _m0.Reader(data))); + } + + ConsensusStates(request: QueryConsensusStatesRequest): Promise { + const data = QueryConsensusStatesRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "ConsensusStates", data); + return promise.then((data) => QueryConsensusStatesResponse.decode(new _m0.Reader(data))); + } + + ClientParams(request: QueryClientParamsRequest): Promise { + const data = QueryClientParamsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "ClientParams", data); + return promise.then((data) => QueryClientParamsResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/ibc/core/client/v1/tx.ts b/src/ibc/core/client/v1/tx.ts new file mode 100644 index 00000000..fe711e7f --- /dev/null +++ b/src/ibc/core/client/v1/tx.ts @@ -0,0 +1,742 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Any } from "../../../../google/protobuf/any"; + +export const protobufPackage = "ibc.core.client.v1"; + +/** MsgCreateClient defines a message to create an IBC client */ +export interface MsgCreateClient { + /** light client state */ + clientState?: Any; + /** + * consensus state associated with the client that corresponds to a given + * height. + */ + consensusState?: Any; + /** signer address */ + signer: string; +} + +/** MsgCreateClientResponse defines the Msg/CreateClient response type. */ +export interface MsgCreateClientResponse {} + +/** + * MsgUpdateClient defines an sdk.Msg to update a IBC client state using + * the given header. + */ +export interface MsgUpdateClient { + /** client unique identifier */ + clientId: string; + /** header to update the light client */ + header?: Any; + /** signer address */ + signer: string; +} + +/** MsgUpdateClientResponse defines the Msg/UpdateClient response type. */ +export interface MsgUpdateClientResponse {} + +/** MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client state */ +export interface MsgUpgradeClient { + /** client unique identifier */ + clientId: string; + /** upgraded client state */ + clientState?: Any; + /** upgraded consensus state, only contains enough information to serve as a basis of trust in update logic */ + consensusState?: Any; + /** proof that old chain committed to new client */ + proofUpgradeClient: Uint8Array; + /** proof that old chain committed to new consensus state */ + proofUpgradeConsensusState: Uint8Array; + /** signer address */ + signer: string; +} + +/** MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. */ +export interface MsgUpgradeClientResponse {} + +/** + * MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for + * light client misbehaviour. + */ +export interface MsgSubmitMisbehaviour { + /** client unique identifier */ + clientId: string; + /** misbehaviour used for freezing the light client */ + misbehaviour?: Any; + /** signer address */ + signer: string; +} + +/** MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response type. */ +export interface MsgSubmitMisbehaviourResponse {} + +const baseMsgCreateClient: object = { signer: "" }; + +export const MsgCreateClient = { + encode(message: MsgCreateClient, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(10).fork()).ldelim(); + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(18).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateClient { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgCreateClient } as MsgCreateClient; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientState = Any.decode(reader, reader.uint32()); + break; + case 2: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgCreateClient { + const message = { ...baseMsgCreateClient } as MsgCreateClient; + if (object.clientState !== undefined && object.clientState !== null) { + message.clientState = Any.fromJSON(object.clientState); + } else { + message.clientState = undefined; + } + if (object.consensusState !== undefined && object.consensusState !== null) { + message.consensusState = Any.fromJSON(object.consensusState); + } else { + message.consensusState = undefined; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = String(object.signer); + } else { + message.signer = ""; + } + return message; + }, + + toJSON(message: MsgCreateClient): unknown { + const obj: any = {}; + message.clientState !== undefined && + (obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined); + message.consensusState !== undefined && + (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial(object: DeepPartial): MsgCreateClient { + const message = { ...baseMsgCreateClient } as MsgCreateClient; + if (object.clientState !== undefined && object.clientState !== null) { + message.clientState = Any.fromPartial(object.clientState); + } else { + message.clientState = undefined; + } + if (object.consensusState !== undefined && object.consensusState !== null) { + message.consensusState = Any.fromPartial(object.consensusState); + } else { + message.consensusState = undefined; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } else { + message.signer = ""; + } + return message; + }, +}; + +const baseMsgCreateClientResponse: object = {}; + +export const MsgCreateClientResponse = { + encode(_: MsgCreateClientResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateClientResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgCreateClientResponse } as MsgCreateClientResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgCreateClientResponse { + const message = { ...baseMsgCreateClientResponse } as MsgCreateClientResponse; + return message; + }, + + toJSON(_: MsgCreateClientResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgCreateClientResponse { + const message = { ...baseMsgCreateClientResponse } as MsgCreateClientResponse; + return message; + }, +}; + +const baseMsgUpdateClient: object = { clientId: "", signer: "" }; + +export const MsgUpdateClient = { + encode(message: MsgUpdateClient, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.header !== undefined) { + Any.encode(message.header, writer.uint32(18).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateClient { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgUpdateClient } as MsgUpdateClient; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.header = Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgUpdateClient { + const message = { ...baseMsgUpdateClient } as MsgUpdateClient; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.header !== undefined && object.header !== null) { + message.header = Any.fromJSON(object.header); + } else { + message.header = undefined; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = String(object.signer); + } else { + message.signer = ""; + } + return message; + }, + + toJSON(message: MsgUpdateClient): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.header !== undefined && (obj.header = message.header ? Any.toJSON(message.header) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial(object: DeepPartial): MsgUpdateClient { + const message = { ...baseMsgUpdateClient } as MsgUpdateClient; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.header !== undefined && object.header !== null) { + message.header = Any.fromPartial(object.header); + } else { + message.header = undefined; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } else { + message.signer = ""; + } + return message; + }, +}; + +const baseMsgUpdateClientResponse: object = {}; + +export const MsgUpdateClientResponse = { + encode(_: MsgUpdateClientResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateClientResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgUpdateClientResponse } as MsgUpdateClientResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgUpdateClientResponse { + const message = { ...baseMsgUpdateClientResponse } as MsgUpdateClientResponse; + return message; + }, + + toJSON(_: MsgUpdateClientResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgUpdateClientResponse { + const message = { ...baseMsgUpdateClientResponse } as MsgUpdateClientResponse; + return message; + }, +}; + +const baseMsgUpgradeClient: object = { clientId: "", signer: "" }; + +export const MsgUpgradeClient = { + encode(message: MsgUpgradeClient, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(18).fork()).ldelim(); + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(26).fork()).ldelim(); + } + if (message.proofUpgradeClient.length !== 0) { + writer.uint32(34).bytes(message.proofUpgradeClient); + } + if (message.proofUpgradeConsensusState.length !== 0) { + writer.uint32(42).bytes(message.proofUpgradeConsensusState); + } + if (message.signer !== "") { + writer.uint32(50).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpgradeClient { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgUpgradeClient } as MsgUpgradeClient; + message.proofUpgradeClient = new Uint8Array(); + message.proofUpgradeConsensusState = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientState = Any.decode(reader, reader.uint32()); + break; + case 3: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + case 4: + message.proofUpgradeClient = reader.bytes(); + break; + case 5: + message.proofUpgradeConsensusState = reader.bytes(); + break; + case 6: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgUpgradeClient { + const message = { ...baseMsgUpgradeClient } as MsgUpgradeClient; + message.proofUpgradeClient = new Uint8Array(); + message.proofUpgradeConsensusState = new Uint8Array(); + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.clientState !== undefined && object.clientState !== null) { + message.clientState = Any.fromJSON(object.clientState); + } else { + message.clientState = undefined; + } + if (object.consensusState !== undefined && object.consensusState !== null) { + message.consensusState = Any.fromJSON(object.consensusState); + } else { + message.consensusState = undefined; + } + if (object.proofUpgradeClient !== undefined && object.proofUpgradeClient !== null) { + message.proofUpgradeClient = bytesFromBase64(object.proofUpgradeClient); + } + if (object.proofUpgradeConsensusState !== undefined && object.proofUpgradeConsensusState !== null) { + message.proofUpgradeConsensusState = bytesFromBase64(object.proofUpgradeConsensusState); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = String(object.signer); + } else { + message.signer = ""; + } + return message; + }, + + toJSON(message: MsgUpgradeClient): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.clientState !== undefined && + (obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined); + message.consensusState !== undefined && + (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); + message.proofUpgradeClient !== undefined && + (obj.proofUpgradeClient = base64FromBytes( + message.proofUpgradeClient !== undefined ? message.proofUpgradeClient : new Uint8Array(), + )); + message.proofUpgradeConsensusState !== undefined && + (obj.proofUpgradeConsensusState = base64FromBytes( + message.proofUpgradeConsensusState !== undefined + ? message.proofUpgradeConsensusState + : new Uint8Array(), + )); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial(object: DeepPartial): MsgUpgradeClient { + const message = { ...baseMsgUpgradeClient } as MsgUpgradeClient; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.clientState !== undefined && object.clientState !== null) { + message.clientState = Any.fromPartial(object.clientState); + } else { + message.clientState = undefined; + } + if (object.consensusState !== undefined && object.consensusState !== null) { + message.consensusState = Any.fromPartial(object.consensusState); + } else { + message.consensusState = undefined; + } + if (object.proofUpgradeClient !== undefined && object.proofUpgradeClient !== null) { + message.proofUpgradeClient = object.proofUpgradeClient; + } else { + message.proofUpgradeClient = new Uint8Array(); + } + if (object.proofUpgradeConsensusState !== undefined && object.proofUpgradeConsensusState !== null) { + message.proofUpgradeConsensusState = object.proofUpgradeConsensusState; + } else { + message.proofUpgradeConsensusState = new Uint8Array(); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } else { + message.signer = ""; + } + return message; + }, +}; + +const baseMsgUpgradeClientResponse: object = {}; + +export const MsgUpgradeClientResponse = { + encode(_: MsgUpgradeClientResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpgradeClientResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgUpgradeClientResponse } as MsgUpgradeClientResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgUpgradeClientResponse { + const message = { ...baseMsgUpgradeClientResponse } as MsgUpgradeClientResponse; + return message; + }, + + toJSON(_: MsgUpgradeClientResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgUpgradeClientResponse { + const message = { ...baseMsgUpgradeClientResponse } as MsgUpgradeClientResponse; + return message; + }, +}; + +const baseMsgSubmitMisbehaviour: object = { clientId: "", signer: "" }; + +export const MsgSubmitMisbehaviour = { + encode(message: MsgSubmitMisbehaviour, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.misbehaviour !== undefined) { + Any.encode(message.misbehaviour, writer.uint32(18).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitMisbehaviour { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgSubmitMisbehaviour } as MsgSubmitMisbehaviour; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.misbehaviour = Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgSubmitMisbehaviour { + const message = { ...baseMsgSubmitMisbehaviour } as MsgSubmitMisbehaviour; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.misbehaviour !== undefined && object.misbehaviour !== null) { + message.misbehaviour = Any.fromJSON(object.misbehaviour); + } else { + message.misbehaviour = undefined; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = String(object.signer); + } else { + message.signer = ""; + } + return message; + }, + + toJSON(message: MsgSubmitMisbehaviour): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.misbehaviour !== undefined && + (obj.misbehaviour = message.misbehaviour ? Any.toJSON(message.misbehaviour) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial(object: DeepPartial): MsgSubmitMisbehaviour { + const message = { ...baseMsgSubmitMisbehaviour } as MsgSubmitMisbehaviour; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.misbehaviour !== undefined && object.misbehaviour !== null) { + message.misbehaviour = Any.fromPartial(object.misbehaviour); + } else { + message.misbehaviour = undefined; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } else { + message.signer = ""; + } + return message; + }, +}; + +const baseMsgSubmitMisbehaviourResponse: object = {}; + +export const MsgSubmitMisbehaviourResponse = { + encode(_: MsgSubmitMisbehaviourResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitMisbehaviourResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgSubmitMisbehaviourResponse } as MsgSubmitMisbehaviourResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgSubmitMisbehaviourResponse { + const message = { ...baseMsgSubmitMisbehaviourResponse } as MsgSubmitMisbehaviourResponse; + return message; + }, + + toJSON(_: MsgSubmitMisbehaviourResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgSubmitMisbehaviourResponse { + const message = { ...baseMsgSubmitMisbehaviourResponse } as MsgSubmitMisbehaviourResponse; + return message; + }, +}; + +/** Msg defines the ibc/client Msg service. */ +export interface Msg { + /** CreateClient defines a rpc handler method for MsgCreateClient. */ + CreateClient(request: MsgCreateClient): Promise; + /** UpdateClient defines a rpc handler method for MsgUpdateClient. */ + UpdateClient(request: MsgUpdateClient): Promise; + /** UpgradeClient defines a rpc handler method for MsgUpgradeClient. */ + UpgradeClient(request: MsgUpgradeClient): Promise; + /** SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. */ + SubmitMisbehaviour(request: MsgSubmitMisbehaviour): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.CreateClient = this.CreateClient.bind(this); + this.UpdateClient = this.UpdateClient.bind(this); + this.UpgradeClient = this.UpgradeClient.bind(this); + this.SubmitMisbehaviour = this.SubmitMisbehaviour.bind(this); + } + CreateClient(request: MsgCreateClient): Promise { + const data = MsgCreateClient.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Msg", "CreateClient", data); + return promise.then((data) => MsgCreateClientResponse.decode(new _m0.Reader(data))); + } + + UpdateClient(request: MsgUpdateClient): Promise { + const data = MsgUpdateClient.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Msg", "UpdateClient", data); + return promise.then((data) => MsgUpdateClientResponse.decode(new _m0.Reader(data))); + } + + UpgradeClient(request: MsgUpgradeClient): Promise { + const data = MsgUpgradeClient.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Msg", "UpgradeClient", data); + return promise.then((data) => MsgUpgradeClientResponse.decode(new _m0.Reader(data))); + } + + SubmitMisbehaviour(request: MsgSubmitMisbehaviour): Promise { + const data = MsgSubmitMisbehaviour.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Msg", "SubmitMisbehaviour", data); + return promise.then((data) => MsgSubmitMisbehaviourResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/ibc/core/commitment/v1/commitment.ts b/src/ibc/core/commitment/v1/commitment.ts new file mode 100644 index 00000000..7aece7b1 --- /dev/null +++ b/src/ibc/core/commitment/v1/commitment.ts @@ -0,0 +1,328 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { CommitmentProof } from "../../../../confio/proofs"; + +export const protobufPackage = "ibc.core.commitment.v1"; + +/** + * MerkleRoot defines a merkle root hash. + * In the Cosmos SDK, the AppHash of a block header becomes the root. + */ +export interface MerkleRoot { + hash: Uint8Array; +} + +/** + * MerklePrefix is merkle path prefixed to the key. + * The constructed key from the Path and the key will be append(Path.KeyPath, + * append(Path.KeyPrefix, key...)) + */ +export interface MerklePrefix { + keyPrefix: Uint8Array; +} + +/** + * MerklePath is the path used to verify commitment proofs, which can be an + * arbitrary structured object (defined by a commitment type). + * MerklePath is represented from root-to-leaf + */ +export interface MerklePath { + keyPath: string[]; +} + +/** + * MerkleProof is a wrapper type over a chain of CommitmentProofs. + * It demonstrates membership or non-membership for an element or set of + * elements, verifiable in conjunction with a known commitment root. Proofs + * should be succinct. + * MerkleProofs are ordered from leaf-to-root + */ +export interface MerkleProof { + proofs: CommitmentProof[]; +} + +const baseMerkleRoot: object = {}; + +export const MerkleRoot = { + encode(message: MerkleRoot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.hash.length !== 0) { + writer.uint32(10).bytes(message.hash); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MerkleRoot { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMerkleRoot } as MerkleRoot; + message.hash = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MerkleRoot { + const message = { ...baseMerkleRoot } as MerkleRoot; + message.hash = new Uint8Array(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + return message; + }, + + toJSON(message: MerkleRoot): unknown { + const obj: any = {}; + message.hash !== undefined && + (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): MerkleRoot { + const message = { ...baseMerkleRoot } as MerkleRoot; + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } else { + message.hash = new Uint8Array(); + } + return message; + }, +}; + +const baseMerklePrefix: object = {}; + +export const MerklePrefix = { + encode(message: MerklePrefix, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.keyPrefix.length !== 0) { + writer.uint32(10).bytes(message.keyPrefix); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MerklePrefix { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMerklePrefix } as MerklePrefix; + message.keyPrefix = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.keyPrefix = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MerklePrefix { + const message = { ...baseMerklePrefix } as MerklePrefix; + message.keyPrefix = new Uint8Array(); + if (object.keyPrefix !== undefined && object.keyPrefix !== null) { + message.keyPrefix = bytesFromBase64(object.keyPrefix); + } + return message; + }, + + toJSON(message: MerklePrefix): unknown { + const obj: any = {}; + message.keyPrefix !== undefined && + (obj.keyPrefix = base64FromBytes( + message.keyPrefix !== undefined ? message.keyPrefix : new Uint8Array(), + )); + return obj; + }, + + fromPartial(object: DeepPartial): MerklePrefix { + const message = { ...baseMerklePrefix } as MerklePrefix; + if (object.keyPrefix !== undefined && object.keyPrefix !== null) { + message.keyPrefix = object.keyPrefix; + } else { + message.keyPrefix = new Uint8Array(); + } + return message; + }, +}; + +const baseMerklePath: object = { keyPath: "" }; + +export const MerklePath = { + encode(message: MerklePath, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.keyPath) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MerklePath { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMerklePath } as MerklePath; + message.keyPath = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.keyPath.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MerklePath { + const message = { ...baseMerklePath } as MerklePath; + message.keyPath = []; + if (object.keyPath !== undefined && object.keyPath !== null) { + for (const e of object.keyPath) { + message.keyPath.push(String(e)); + } + } + return message; + }, + + toJSON(message: MerklePath): unknown { + const obj: any = {}; + if (message.keyPath) { + obj.keyPath = message.keyPath.map((e) => e); + } else { + obj.keyPath = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): MerklePath { + const message = { ...baseMerklePath } as MerklePath; + message.keyPath = []; + if (object.keyPath !== undefined && object.keyPath !== null) { + for (const e of object.keyPath) { + message.keyPath.push(e); + } + } + return message; + }, +}; + +const baseMerkleProof: object = {}; + +export const MerkleProof = { + encode(message: MerkleProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.proofs) { + CommitmentProof.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MerkleProof { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMerkleProof } as MerkleProof; + message.proofs = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proofs.push(CommitmentProof.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MerkleProof { + const message = { ...baseMerkleProof } as MerkleProof; + message.proofs = []; + if (object.proofs !== undefined && object.proofs !== null) { + for (const e of object.proofs) { + message.proofs.push(CommitmentProof.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: MerkleProof): unknown { + const obj: any = {}; + if (message.proofs) { + obj.proofs = message.proofs.map((e) => (e ? CommitmentProof.toJSON(e) : undefined)); + } else { + obj.proofs = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): MerkleProof { + const message = { ...baseMerkleProof } as MerkleProof; + message.proofs = []; + if (object.proofs !== undefined && object.proofs !== null) { + for (const e of object.proofs) { + message.proofs.push(CommitmentProof.fromPartial(e)); + } + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/ibc/core/connection/v1/connection.ts b/src/ibc/core/connection/v1/connection.ts new file mode 100644 index 00000000..476f6cd0 --- /dev/null +++ b/src/ibc/core/connection/v1/connection.ts @@ -0,0 +1,754 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { MerklePrefix } from "../../../../ibc/core/commitment/v1/commitment"; + +export const protobufPackage = "ibc.core.connection.v1"; + +/** + * State defines if a connection is in one of the following states: + * INIT, TRYOPEN, OPEN or UNINITIALIZED. + */ +export enum State { + /** STATE_UNINITIALIZED_UNSPECIFIED - Default State */ + STATE_UNINITIALIZED_UNSPECIFIED = 0, + /** STATE_INIT - A connection end has just started the opening handshake. */ + STATE_INIT = 1, + /** + * STATE_TRYOPEN - A connection end has acknowledged the handshake step on the counterparty + * chain. + */ + STATE_TRYOPEN = 2, + /** STATE_OPEN - A connection end has completed the handshake. */ + STATE_OPEN = 3, + UNRECOGNIZED = -1, +} + +export function stateFromJSON(object: any): State { + switch (object) { + case 0: + case "STATE_UNINITIALIZED_UNSPECIFIED": + return State.STATE_UNINITIALIZED_UNSPECIFIED; + case 1: + case "STATE_INIT": + return State.STATE_INIT; + case 2: + case "STATE_TRYOPEN": + return State.STATE_TRYOPEN; + case 3: + case "STATE_OPEN": + return State.STATE_OPEN; + case -1: + case "UNRECOGNIZED": + default: + return State.UNRECOGNIZED; + } +} + +export function stateToJSON(object: State): string { + switch (object) { + case State.STATE_UNINITIALIZED_UNSPECIFIED: + return "STATE_UNINITIALIZED_UNSPECIFIED"; + case State.STATE_INIT: + return "STATE_INIT"; + case State.STATE_TRYOPEN: + return "STATE_TRYOPEN"; + case State.STATE_OPEN: + return "STATE_OPEN"; + default: + return "UNKNOWN"; + } +} + +/** + * ConnectionEnd defines a stateful object on a chain connected to another + * separate one. + * NOTE: there must only be 2 defined ConnectionEnds to establish + * a connection between two chains. + */ +export interface ConnectionEnd { + /** client associated with this connection. */ + clientId: string; + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection. + */ + versions: Version[]; + /** current state of the connection end. */ + state: State; + /** counterparty chain associated with this connection. */ + counterparty?: Counterparty; + /** + * delay period that must pass before a consensus state can be used for packet-verification + * NOTE: delay period logic is only implemented by some clients. + */ + delayPeriod: Long; +} + +/** + * IdentifiedConnection defines a connection with additional connection + * identifier field. + */ +export interface IdentifiedConnection { + /** connection identifier. */ + id: string; + /** client associated with this connection. */ + clientId: string; + /** + * IBC version which can be utilised to determine encodings or protocols for + * channels or packets utilising this connection + */ + versions: Version[]; + /** current state of the connection end. */ + state: State; + /** counterparty chain associated with this connection. */ + counterparty?: Counterparty; + /** delay period associated with this connection. */ + delayPeriod: Long; +} + +/** Counterparty defines the counterparty chain associated with a connection end. */ +export interface Counterparty { + /** + * identifies the client on the counterparty chain associated with a given + * connection. + */ + clientId: string; + /** + * identifies the connection end on the counterparty chain associated with a + * given connection. + */ + connectionId: string; + /** commitment merkle prefix of the counterparty chain. */ + prefix?: MerklePrefix; +} + +/** ClientPaths define all the connection paths for a client state. */ +export interface ClientPaths { + /** list of connection paths */ + paths: string[]; +} + +/** ConnectionPaths define all the connection paths for a given client state. */ +export interface ConnectionPaths { + /** client state unique identifier */ + clientId: string; + /** list of connection paths */ + paths: string[]; +} + +/** + * Version defines the versioning scheme used to negotiate the IBC verison in + * the connection handshake. + */ +export interface Version { + /** unique version identifier */ + identifier: string; + /** list of features compatible with the specified identifier */ + features: string[]; +} + +const baseConnectionEnd: object = { clientId: "", state: 0, delayPeriod: Long.UZERO }; + +export const ConnectionEnd = { + encode(message: ConnectionEnd, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + for (const v of message.versions) { + Version.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.state !== 0) { + writer.uint32(24).int32(message.state); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(34).fork()).ldelim(); + } + if (!message.delayPeriod.isZero()) { + writer.uint32(40).uint64(message.delayPeriod); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ConnectionEnd { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseConnectionEnd } as ConnectionEnd; + message.versions = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.versions.push(Version.decode(reader, reader.uint32())); + break; + case 3: + message.state = reader.int32() as any; + break; + case 4: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 5: + message.delayPeriod = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ConnectionEnd { + const message = { ...baseConnectionEnd } as ConnectionEnd; + message.versions = []; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.versions !== undefined && object.versions !== null) { + for (const e of object.versions) { + message.versions.push(Version.fromJSON(e)); + } + } + if (object.state !== undefined && object.state !== null) { + message.state = stateFromJSON(object.state); + } else { + message.state = 0; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromJSON(object.counterparty); + } else { + message.counterparty = undefined; + } + if (object.delayPeriod !== undefined && object.delayPeriod !== null) { + message.delayPeriod = Long.fromString(object.delayPeriod); + } else { + message.delayPeriod = Long.UZERO; + } + return message; + }, + + toJSON(message: ConnectionEnd): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + if (message.versions) { + obj.versions = message.versions.map((e) => (e ? Version.toJSON(e) : undefined)); + } else { + obj.versions = []; + } + message.state !== undefined && (obj.state = stateToJSON(message.state)); + message.counterparty !== undefined && + (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); + message.delayPeriod !== undefined && (obj.delayPeriod = (message.delayPeriod || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): ConnectionEnd { + const message = { ...baseConnectionEnd } as ConnectionEnd; + message.versions = []; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.versions !== undefined && object.versions !== null) { + for (const e of object.versions) { + message.versions.push(Version.fromPartial(e)); + } + } + if (object.state !== undefined && object.state !== null) { + message.state = object.state; + } else { + message.state = 0; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromPartial(object.counterparty); + } else { + message.counterparty = undefined; + } + if (object.delayPeriod !== undefined && object.delayPeriod !== null) { + message.delayPeriod = object.delayPeriod as Long; + } else { + message.delayPeriod = Long.UZERO; + } + return message; + }, +}; + +const baseIdentifiedConnection: object = { id: "", clientId: "", state: 0, delayPeriod: Long.UZERO }; + +export const IdentifiedConnection = { + encode(message: IdentifiedConnection, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.clientId !== "") { + writer.uint32(18).string(message.clientId); + } + for (const v of message.versions) { + Version.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.state !== 0) { + writer.uint32(32).int32(message.state); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(42).fork()).ldelim(); + } + if (!message.delayPeriod.isZero()) { + writer.uint32(48).uint64(message.delayPeriod); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): IdentifiedConnection { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseIdentifiedConnection } as IdentifiedConnection; + message.versions = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.clientId = reader.string(); + break; + case 3: + message.versions.push(Version.decode(reader, reader.uint32())); + break; + case 4: + message.state = reader.int32() as any; + break; + case 5: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 6: + message.delayPeriod = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): IdentifiedConnection { + const message = { ...baseIdentifiedConnection } as IdentifiedConnection; + message.versions = []; + if (object.id !== undefined && object.id !== null) { + message.id = String(object.id); + } else { + message.id = ""; + } + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.versions !== undefined && object.versions !== null) { + for (const e of object.versions) { + message.versions.push(Version.fromJSON(e)); + } + } + if (object.state !== undefined && object.state !== null) { + message.state = stateFromJSON(object.state); + } else { + message.state = 0; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromJSON(object.counterparty); + } else { + message.counterparty = undefined; + } + if (object.delayPeriod !== undefined && object.delayPeriod !== null) { + message.delayPeriod = Long.fromString(object.delayPeriod); + } else { + message.delayPeriod = Long.UZERO; + } + return message; + }, + + toJSON(message: IdentifiedConnection): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.clientId !== undefined && (obj.clientId = message.clientId); + if (message.versions) { + obj.versions = message.versions.map((e) => (e ? Version.toJSON(e) : undefined)); + } else { + obj.versions = []; + } + message.state !== undefined && (obj.state = stateToJSON(message.state)); + message.counterparty !== undefined && + (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); + message.delayPeriod !== undefined && (obj.delayPeriod = (message.delayPeriod || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): IdentifiedConnection { + const message = { ...baseIdentifiedConnection } as IdentifiedConnection; + message.versions = []; + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } else { + message.id = ""; + } + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.versions !== undefined && object.versions !== null) { + for (const e of object.versions) { + message.versions.push(Version.fromPartial(e)); + } + } + if (object.state !== undefined && object.state !== null) { + message.state = object.state; + } else { + message.state = 0; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromPartial(object.counterparty); + } else { + message.counterparty = undefined; + } + if (object.delayPeriod !== undefined && object.delayPeriod !== null) { + message.delayPeriod = object.delayPeriod as Long; + } else { + message.delayPeriod = Long.UZERO; + } + return message; + }, +}; + +const baseCounterparty: object = { clientId: "", connectionId: "" }; + +export const Counterparty = { + encode(message: Counterparty, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.connectionId !== "") { + writer.uint32(18).string(message.connectionId); + } + if (message.prefix !== undefined) { + MerklePrefix.encode(message.prefix, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Counterparty { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCounterparty } as Counterparty; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.connectionId = reader.string(); + break; + case 3: + message.prefix = MerklePrefix.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Counterparty { + const message = { ...baseCounterparty } as Counterparty; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.connectionId !== undefined && object.connectionId !== null) { + message.connectionId = String(object.connectionId); + } else { + message.connectionId = ""; + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = MerklePrefix.fromJSON(object.prefix); + } else { + message.prefix = undefined; + } + return message; + }, + + toJSON(message: Counterparty): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + message.prefix !== undefined && + (obj.prefix = message.prefix ? MerklePrefix.toJSON(message.prefix) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): Counterparty { + const message = { ...baseCounterparty } as Counterparty; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.connectionId !== undefined && object.connectionId !== null) { + message.connectionId = object.connectionId; + } else { + message.connectionId = ""; + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = MerklePrefix.fromPartial(object.prefix); + } else { + message.prefix = undefined; + } + return message; + }, +}; + +const baseClientPaths: object = { paths: "" }; + +export const ClientPaths = { + encode(message: ClientPaths, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.paths) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ClientPaths { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseClientPaths } as ClientPaths; + message.paths = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.paths.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ClientPaths { + const message = { ...baseClientPaths } as ClientPaths; + message.paths = []; + if (object.paths !== undefined && object.paths !== null) { + for (const e of object.paths) { + message.paths.push(String(e)); + } + } + return message; + }, + + toJSON(message: ClientPaths): unknown { + const obj: any = {}; + if (message.paths) { + obj.paths = message.paths.map((e) => e); + } else { + obj.paths = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ClientPaths { + const message = { ...baseClientPaths } as ClientPaths; + message.paths = []; + if (object.paths !== undefined && object.paths !== null) { + for (const e of object.paths) { + message.paths.push(e); + } + } + return message; + }, +}; + +const baseConnectionPaths: object = { clientId: "", paths: "" }; + +export const ConnectionPaths = { + encode(message: ConnectionPaths, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + for (const v of message.paths) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ConnectionPaths { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseConnectionPaths } as ConnectionPaths; + message.paths = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.paths.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ConnectionPaths { + const message = { ...baseConnectionPaths } as ConnectionPaths; + message.paths = []; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.paths !== undefined && object.paths !== null) { + for (const e of object.paths) { + message.paths.push(String(e)); + } + } + return message; + }, + + toJSON(message: ConnectionPaths): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + if (message.paths) { + obj.paths = message.paths.map((e) => e); + } else { + obj.paths = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ConnectionPaths { + const message = { ...baseConnectionPaths } as ConnectionPaths; + message.paths = []; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.paths !== undefined && object.paths !== null) { + for (const e of object.paths) { + message.paths.push(e); + } + } + return message; + }, +}; + +const baseVersion: object = { identifier: "", features: "" }; + +export const Version = { + encode(message: Version, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.identifier !== "") { + writer.uint32(10).string(message.identifier); + } + for (const v of message.features) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Version { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseVersion } as Version; + message.features = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identifier = reader.string(); + break; + case 2: + message.features.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Version { + const message = { ...baseVersion } as Version; + message.features = []; + if (object.identifier !== undefined && object.identifier !== null) { + message.identifier = String(object.identifier); + } else { + message.identifier = ""; + } + if (object.features !== undefined && object.features !== null) { + for (const e of object.features) { + message.features.push(String(e)); + } + } + return message; + }, + + toJSON(message: Version): unknown { + const obj: any = {}; + message.identifier !== undefined && (obj.identifier = message.identifier); + if (message.features) { + obj.features = message.features.map((e) => e); + } else { + obj.features = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): Version { + const message = { ...baseVersion } as Version; + message.features = []; + if (object.identifier !== undefined && object.identifier !== null) { + message.identifier = object.identifier; + } else { + message.identifier = ""; + } + if (object.features !== undefined && object.features !== null) { + for (const e of object.features) { + message.features.push(e); + } + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/ibc/core/connection/v1/genesis.ts b/src/ibc/core/connection/v1/genesis.ts new file mode 100644 index 00000000..65d97979 --- /dev/null +++ b/src/ibc/core/connection/v1/genesis.ts @@ -0,0 +1,136 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { IdentifiedConnection, ConnectionPaths } from "../../../../ibc/core/connection/v1/connection"; + +export const protobufPackage = "ibc.core.connection.v1"; + +/** GenesisState defines the ibc connection submodule's genesis state. */ +export interface GenesisState { + connections: IdentifiedConnection[]; + clientConnectionPaths: ConnectionPaths[]; + /** the sequence for the next generated connection identifier */ + nextConnectionSequence: Long; +} + +const baseGenesisState: object = { nextConnectionSequence: Long.UZERO }; + +export const GenesisState = { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.connections) { + IdentifiedConnection.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.clientConnectionPaths) { + ConnectionPaths.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (!message.nextConnectionSequence.isZero()) { + writer.uint32(24).uint64(message.nextConnectionSequence); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGenesisState } as GenesisState; + message.connections = []; + message.clientConnectionPaths = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connections.push(IdentifiedConnection.decode(reader, reader.uint32())); + break; + case 2: + message.clientConnectionPaths.push(ConnectionPaths.decode(reader, reader.uint32())); + break; + case 3: + message.nextConnectionSequence = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.connections = []; + message.clientConnectionPaths = []; + if (object.connections !== undefined && object.connections !== null) { + for (const e of object.connections) { + message.connections.push(IdentifiedConnection.fromJSON(e)); + } + } + if (object.clientConnectionPaths !== undefined && object.clientConnectionPaths !== null) { + for (const e of object.clientConnectionPaths) { + message.clientConnectionPaths.push(ConnectionPaths.fromJSON(e)); + } + } + if (object.nextConnectionSequence !== undefined && object.nextConnectionSequence !== null) { + message.nextConnectionSequence = Long.fromString(object.nextConnectionSequence); + } else { + message.nextConnectionSequence = Long.UZERO; + } + return message; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + if (message.connections) { + obj.connections = message.connections.map((e) => (e ? IdentifiedConnection.toJSON(e) : undefined)); + } else { + obj.connections = []; + } + if (message.clientConnectionPaths) { + obj.clientConnectionPaths = message.clientConnectionPaths.map((e) => + e ? ConnectionPaths.toJSON(e) : undefined, + ); + } else { + obj.clientConnectionPaths = []; + } + message.nextConnectionSequence !== undefined && + (obj.nextConnectionSequence = (message.nextConnectionSequence || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + message.connections = []; + message.clientConnectionPaths = []; + if (object.connections !== undefined && object.connections !== null) { + for (const e of object.connections) { + message.connections.push(IdentifiedConnection.fromPartial(e)); + } + } + if (object.clientConnectionPaths !== undefined && object.clientConnectionPaths !== null) { + for (const e of object.clientConnectionPaths) { + message.clientConnectionPaths.push(ConnectionPaths.fromPartial(e)); + } + } + if (object.nextConnectionSequence !== undefined && object.nextConnectionSequence !== null) { + message.nextConnectionSequence = object.nextConnectionSequence as Long; + } else { + message.nextConnectionSequence = Long.UZERO; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/ibc/core/connection/v1/query.ts b/src/ibc/core/connection/v1/query.ts new file mode 100644 index 00000000..fe509945 --- /dev/null +++ b/src/ibc/core/connection/v1/query.ts @@ -0,0 +1,1062 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { ConnectionEnd, IdentifiedConnection } from "../../../../ibc/core/connection/v1/connection"; +import { Height, IdentifiedClientState } from "../../../../ibc/core/client/v1/client"; +import { PageRequest, PageResponse } from "../../../../cosmos/base/query/v1beta1/pagination"; +import { Any } from "../../../../google/protobuf/any"; + +export const protobufPackage = "ibc.core.connection.v1"; + +/** + * QueryConnectionRequest is the request type for the Query/Connection RPC + * method + */ +export interface QueryConnectionRequest { + /** connection unique identifier */ + connectionId: string; +} + +/** + * QueryConnectionResponse is the response type for the Query/Connection RPC + * method. Besides the connection end, it includes a proof and the height from + * which the proof was retrieved. + */ +export interface QueryConnectionResponse { + /** connection associated with the request identifier */ + connection?: ConnectionEnd; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight?: Height; +} + +/** + * QueryConnectionsRequest is the request type for the Query/Connections RPC + * method + */ +export interface QueryConnectionsRequest { + pagination?: PageRequest; +} + +/** + * QueryConnectionsResponse is the response type for the Query/Connections RPC + * method. + */ +export interface QueryConnectionsResponse { + /** list of stored connections of the chain. */ + connections: IdentifiedConnection[]; + /** pagination response */ + pagination?: PageResponse; + /** query block height */ + height?: Height; +} + +/** + * QueryClientConnectionsRequest is the request type for the + * Query/ClientConnections RPC method + */ +export interface QueryClientConnectionsRequest { + /** client identifier associated with a connection */ + clientId: string; +} + +/** + * QueryClientConnectionsResponse is the response type for the + * Query/ClientConnections RPC method + */ +export interface QueryClientConnectionsResponse { + /** slice of all the connection paths associated with a client. */ + connectionPaths: string[]; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was generated */ + proofHeight?: Height; +} + +/** + * QueryConnectionClientStateRequest is the request type for the + * Query/ConnectionClientState RPC method + */ +export interface QueryConnectionClientStateRequest { + /** connection identifier */ + connectionId: string; +} + +/** + * QueryConnectionClientStateResponse is the response type for the + * Query/ConnectionClientState RPC method + */ +export interface QueryConnectionClientStateResponse { + /** client state associated with the channel */ + identifiedClientState?: IdentifiedClientState; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight?: Height; +} + +/** + * QueryConnectionConsensusStateRequest is the request type for the + * Query/ConnectionConsensusState RPC method + */ +export interface QueryConnectionConsensusStateRequest { + /** connection identifier */ + connectionId: string; + revisionNumber: Long; + revisionHeight: Long; +} + +/** + * QueryConnectionConsensusStateResponse is the response type for the + * Query/ConnectionConsensusState RPC method + */ +export interface QueryConnectionConsensusStateResponse { + /** consensus state associated with the channel */ + consensusState?: Any; + /** client ID associated with the consensus state */ + clientId: string; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight?: Height; +} + +const baseQueryConnectionRequest: object = { connectionId: "" }; + +export const QueryConnectionRequest = { + encode(message: QueryConnectionRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.connectionId !== "") { + writer.uint32(10).string(message.connectionId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryConnectionRequest } as QueryConnectionRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConnectionRequest { + const message = { ...baseQueryConnectionRequest } as QueryConnectionRequest; + if (object.connectionId !== undefined && object.connectionId !== null) { + message.connectionId = String(object.connectionId); + } else { + message.connectionId = ""; + } + return message; + }, + + toJSON(message: QueryConnectionRequest): unknown { + const obj: any = {}; + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + return obj; + }, + + fromPartial(object: DeepPartial): QueryConnectionRequest { + const message = { ...baseQueryConnectionRequest } as QueryConnectionRequest; + if (object.connectionId !== undefined && object.connectionId !== null) { + message.connectionId = object.connectionId; + } else { + message.connectionId = ""; + } + return message; + }, +}; + +const baseQueryConnectionResponse: object = {}; + +export const QueryConnectionResponse = { + encode(message: QueryConnectionResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.connection !== undefined) { + ConnectionEnd.encode(message.connection, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryConnectionResponse } as QueryConnectionResponse; + message.proof = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connection = ConnectionEnd.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConnectionResponse { + const message = { ...baseQueryConnectionResponse } as QueryConnectionResponse; + message.proof = new Uint8Array(); + if (object.connection !== undefined && object.connection !== null) { + message.connection = ConnectionEnd.fromJSON(object.connection); + } else { + message.connection = undefined; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + + toJSON(message: QueryConnectionResponse): unknown { + const obj: any = {}; + message.connection !== undefined && + (obj.connection = message.connection ? ConnectionEnd.toJSON(message.connection) : undefined); + message.proof !== undefined && + (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryConnectionResponse { + const message = { ...baseQueryConnectionResponse } as QueryConnectionResponse; + if (object.connection !== undefined && object.connection !== null) { + message.connection = ConnectionEnd.fromPartial(object.connection); + } else { + message.connection = undefined; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = object.proof; + } else { + message.proof = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, +}; + +const baseQueryConnectionsRequest: object = {}; + +export const QueryConnectionsRequest = { + encode(message: QueryConnectionsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryConnectionsRequest } as QueryConnectionsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConnectionsRequest { + const message = { ...baseQueryConnectionsRequest } as QueryConnectionsRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, + + toJSON(message: QueryConnectionsRequest): unknown { + const obj: any = {}; + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryConnectionsRequest { + const message = { ...baseQueryConnectionsRequest } as QueryConnectionsRequest; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + return message; + }, +}; + +const baseQueryConnectionsResponse: object = {}; + +export const QueryConnectionsResponse = { + encode(message: QueryConnectionsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.connections) { + IdentifiedConnection.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryConnectionsResponse } as QueryConnectionsResponse; + message.connections = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connections.push(IdentifiedConnection.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + case 3: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConnectionsResponse { + const message = { ...baseQueryConnectionsResponse } as QueryConnectionsResponse; + message.connections = []; + if (object.connections !== undefined && object.connections !== null) { + for (const e of object.connections) { + message.connections.push(IdentifiedConnection.fromJSON(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromJSON(object.pagination); + } else { + message.pagination = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromJSON(object.height); + } else { + message.height = undefined; + } + return message; + }, + + toJSON(message: QueryConnectionsResponse): unknown { + const obj: any = {}; + if (message.connections) { + obj.connections = message.connections.map((e) => (e ? IdentifiedConnection.toJSON(e) : undefined)); + } else { + obj.connections = []; + } + message.pagination !== undefined && + (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryConnectionsResponse { + const message = { ...baseQueryConnectionsResponse } as QueryConnectionsResponse; + message.connections = []; + if (object.connections !== undefined && object.connections !== null) { + for (const e of object.connections) { + message.connections.push(IdentifiedConnection.fromPartial(e)); + } + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromPartial(object.pagination); + } else { + message.pagination = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromPartial(object.height); + } else { + message.height = undefined; + } + return message; + }, +}; + +const baseQueryClientConnectionsRequest: object = { clientId: "" }; + +export const QueryClientConnectionsRequest = { + encode(message: QueryClientConnectionsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientConnectionsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryClientConnectionsRequest } as QueryClientConnectionsRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryClientConnectionsRequest { + const message = { ...baseQueryClientConnectionsRequest } as QueryClientConnectionsRequest; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + return message; + }, + + toJSON(message: QueryClientConnectionsRequest): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + return obj; + }, + + fromPartial(object: DeepPartial): QueryClientConnectionsRequest { + const message = { ...baseQueryClientConnectionsRequest } as QueryClientConnectionsRequest; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + return message; + }, +}; + +const baseQueryClientConnectionsResponse: object = { connectionPaths: "" }; + +export const QueryClientConnectionsResponse = { + encode(message: QueryClientConnectionsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.connectionPaths) { + writer.uint32(10).string(v!); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientConnectionsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryClientConnectionsResponse } as QueryClientConnectionsResponse; + message.connectionPaths = []; + message.proof = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionPaths.push(reader.string()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryClientConnectionsResponse { + const message = { ...baseQueryClientConnectionsResponse } as QueryClientConnectionsResponse; + message.connectionPaths = []; + message.proof = new Uint8Array(); + if (object.connectionPaths !== undefined && object.connectionPaths !== null) { + for (const e of object.connectionPaths) { + message.connectionPaths.push(String(e)); + } + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + + toJSON(message: QueryClientConnectionsResponse): unknown { + const obj: any = {}; + if (message.connectionPaths) { + obj.connectionPaths = message.connectionPaths.map((e) => e); + } else { + obj.connectionPaths = []; + } + message.proof !== undefined && + (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryClientConnectionsResponse { + const message = { ...baseQueryClientConnectionsResponse } as QueryClientConnectionsResponse; + message.connectionPaths = []; + if (object.connectionPaths !== undefined && object.connectionPaths !== null) { + for (const e of object.connectionPaths) { + message.connectionPaths.push(e); + } + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = object.proof; + } else { + message.proof = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, +}; + +const baseQueryConnectionClientStateRequest: object = { connectionId: "" }; + +export const QueryConnectionClientStateRequest = { + encode(message: QueryConnectionClientStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.connectionId !== "") { + writer.uint32(10).string(message.connectionId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionClientStateRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryConnectionClientStateRequest } as QueryConnectionClientStateRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConnectionClientStateRequest { + const message = { ...baseQueryConnectionClientStateRequest } as QueryConnectionClientStateRequest; + if (object.connectionId !== undefined && object.connectionId !== null) { + message.connectionId = String(object.connectionId); + } else { + message.connectionId = ""; + } + return message; + }, + + toJSON(message: QueryConnectionClientStateRequest): unknown { + const obj: any = {}; + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + return obj; + }, + + fromPartial(object: DeepPartial): QueryConnectionClientStateRequest { + const message = { ...baseQueryConnectionClientStateRequest } as QueryConnectionClientStateRequest; + if (object.connectionId !== undefined && object.connectionId !== null) { + message.connectionId = object.connectionId; + } else { + message.connectionId = ""; + } + return message; + }, +}; + +const baseQueryConnectionClientStateResponse: object = {}; + +export const QueryConnectionClientStateResponse = { + encode(message: QueryConnectionClientStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.identifiedClientState !== undefined) { + IdentifiedClientState.encode(message.identifiedClientState, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionClientStateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryConnectionClientStateResponse } as QueryConnectionClientStateResponse; + message.proof = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identifiedClientState = IdentifiedClientState.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConnectionClientStateResponse { + const message = { ...baseQueryConnectionClientStateResponse } as QueryConnectionClientStateResponse; + message.proof = new Uint8Array(); + if (object.identifiedClientState !== undefined && object.identifiedClientState !== null) { + message.identifiedClientState = IdentifiedClientState.fromJSON(object.identifiedClientState); + } else { + message.identifiedClientState = undefined; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + + toJSON(message: QueryConnectionClientStateResponse): unknown { + const obj: any = {}; + message.identifiedClientState !== undefined && + (obj.identifiedClientState = message.identifiedClientState + ? IdentifiedClientState.toJSON(message.identifiedClientState) + : undefined); + message.proof !== undefined && + (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryConnectionClientStateResponse { + const message = { ...baseQueryConnectionClientStateResponse } as QueryConnectionClientStateResponse; + if (object.identifiedClientState !== undefined && object.identifiedClientState !== null) { + message.identifiedClientState = IdentifiedClientState.fromPartial(object.identifiedClientState); + } else { + message.identifiedClientState = undefined; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = object.proof; + } else { + message.proof = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, +}; + +const baseQueryConnectionConsensusStateRequest: object = { + connectionId: "", + revisionNumber: Long.UZERO, + revisionHeight: Long.UZERO, +}; + +export const QueryConnectionConsensusStateRequest = { + encode( + message: QueryConnectionConsensusStateRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.connectionId !== "") { + writer.uint32(10).string(message.connectionId); + } + if (!message.revisionNumber.isZero()) { + writer.uint32(16).uint64(message.revisionNumber); + } + if (!message.revisionHeight.isZero()) { + writer.uint32(24).uint64(message.revisionHeight); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionConsensusStateRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryConnectionConsensusStateRequest } as QueryConnectionConsensusStateRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + case 2: + message.revisionNumber = reader.uint64() as Long; + break; + case 3: + message.revisionHeight = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConnectionConsensusStateRequest { + const message = { ...baseQueryConnectionConsensusStateRequest } as QueryConnectionConsensusStateRequest; + if (object.connectionId !== undefined && object.connectionId !== null) { + message.connectionId = String(object.connectionId); + } else { + message.connectionId = ""; + } + if (object.revisionNumber !== undefined && object.revisionNumber !== null) { + message.revisionNumber = Long.fromString(object.revisionNumber); + } else { + message.revisionNumber = Long.UZERO; + } + if (object.revisionHeight !== undefined && object.revisionHeight !== null) { + message.revisionHeight = Long.fromString(object.revisionHeight); + } else { + message.revisionHeight = Long.UZERO; + } + return message; + }, + + toJSON(message: QueryConnectionConsensusStateRequest): unknown { + const obj: any = {}; + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + message.revisionNumber !== undefined && + (obj.revisionNumber = (message.revisionNumber || Long.UZERO).toString()); + message.revisionHeight !== undefined && + (obj.revisionHeight = (message.revisionHeight || Long.UZERO).toString()); + return obj; + }, + + fromPartial( + object: DeepPartial, + ): QueryConnectionConsensusStateRequest { + const message = { ...baseQueryConnectionConsensusStateRequest } as QueryConnectionConsensusStateRequest; + if (object.connectionId !== undefined && object.connectionId !== null) { + message.connectionId = object.connectionId; + } else { + message.connectionId = ""; + } + if (object.revisionNumber !== undefined && object.revisionNumber !== null) { + message.revisionNumber = object.revisionNumber as Long; + } else { + message.revisionNumber = Long.UZERO; + } + if (object.revisionHeight !== undefined && object.revisionHeight !== null) { + message.revisionHeight = object.revisionHeight as Long; + } else { + message.revisionHeight = Long.UZERO; + } + return message; + }, +}; + +const baseQueryConnectionConsensusStateResponse: object = { clientId: "" }; + +export const QueryConnectionConsensusStateResponse = { + encode( + message: QueryConnectionConsensusStateResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(10).fork()).ldelim(); + } + if (message.clientId !== "") { + writer.uint32(18).string(message.clientId); + } + if (message.proof.length !== 0) { + writer.uint32(26).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionConsensusStateResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseQueryConnectionConsensusStateResponse } as QueryConnectionConsensusStateResponse; + message.proof = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + case 2: + message.clientId = reader.string(); + break; + case 3: + message.proof = reader.bytes(); + break; + case 4: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryConnectionConsensusStateResponse { + const message = { ...baseQueryConnectionConsensusStateResponse } as QueryConnectionConsensusStateResponse; + message.proof = new Uint8Array(); + if (object.consensusState !== undefined && object.consensusState !== null) { + message.consensusState = Any.fromJSON(object.consensusState); + } else { + message.consensusState = undefined; + } + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, + + toJSON(message: QueryConnectionConsensusStateResponse): unknown { + const obj: any = {}; + message.consensusState !== undefined && + (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); + message.clientId !== undefined && (obj.clientId = message.clientId); + message.proof !== undefined && + (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + return obj; + }, + + fromPartial( + object: DeepPartial, + ): QueryConnectionConsensusStateResponse { + const message = { ...baseQueryConnectionConsensusStateResponse } as QueryConnectionConsensusStateResponse; + if (object.consensusState !== undefined && object.consensusState !== null) { + message.consensusState = Any.fromPartial(object.consensusState); + } else { + message.consensusState = undefined; + } + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = object.proof; + } else { + message.proof = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + return message; + }, +}; + +/** Query provides defines the gRPC querier service */ +export interface Query { + /** Connection queries an IBC connection end. */ + Connection(request: QueryConnectionRequest): Promise; + /** Connections queries all the IBC connections of a chain. */ + Connections(request: QueryConnectionsRequest): Promise; + /** + * ClientConnections queries the connection paths associated with a client + * state. + */ + ClientConnections(request: QueryClientConnectionsRequest): Promise; + /** + * ConnectionClientState queries the client state associated with the + * connection. + */ + ConnectionClientState( + request: QueryConnectionClientStateRequest, + ): Promise; + /** + * ConnectionConsensusState queries the consensus state associated with the + * connection. + */ + ConnectionConsensusState( + request: QueryConnectionConsensusStateRequest, + ): Promise; +} + +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Connection = this.Connection.bind(this); + this.Connections = this.Connections.bind(this); + this.ClientConnections = this.ClientConnections.bind(this); + this.ConnectionClientState = this.ConnectionClientState.bind(this); + this.ConnectionConsensusState = this.ConnectionConsensusState.bind(this); + } + Connection(request: QueryConnectionRequest): Promise { + const data = QueryConnectionRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "Connection", data); + return promise.then((data) => QueryConnectionResponse.decode(new _m0.Reader(data))); + } + + Connections(request: QueryConnectionsRequest): Promise { + const data = QueryConnectionsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "Connections", data); + return promise.then((data) => QueryConnectionsResponse.decode(new _m0.Reader(data))); + } + + ClientConnections(request: QueryClientConnectionsRequest): Promise { + const data = QueryClientConnectionsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "ClientConnections", data); + return promise.then((data) => QueryClientConnectionsResponse.decode(new _m0.Reader(data))); + } + + ConnectionClientState( + request: QueryConnectionClientStateRequest, + ): Promise { + const data = QueryConnectionClientStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "ConnectionClientState", data); + return promise.then((data) => QueryConnectionClientStateResponse.decode(new _m0.Reader(data))); + } + + ConnectionConsensusState( + request: QueryConnectionConsensusStateRequest, + ): Promise { + const data = QueryConnectionConsensusStateRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "ConnectionConsensusState", data); + return promise.then((data) => QueryConnectionConsensusStateResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/ibc/core/connection/v1/tx.ts b/src/ibc/core/connection/v1/tx.ts new file mode 100644 index 00000000..2df9fdd1 --- /dev/null +++ b/src/ibc/core/connection/v1/tx.ts @@ -0,0 +1,1065 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Counterparty, Version } from "../../../../ibc/core/connection/v1/connection"; +import { Any } from "../../../../google/protobuf/any"; +import { Height } from "../../../../ibc/core/client/v1/client"; + +export const protobufPackage = "ibc.core.connection.v1"; + +/** + * MsgConnectionOpenInit defines the msg sent by an account on Chain A to + * initialize a connection with Chain B. + */ +export interface MsgConnectionOpenInit { + clientId: string; + counterparty?: Counterparty; + version?: Version; + delayPeriod: Long; + signer: string; +} + +/** MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response type. */ +export interface MsgConnectionOpenInitResponse {} + +/** + * MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a + * connection on Chain B. + */ +export interface MsgConnectionOpenTry { + clientId: string; + /** + * in the case of crossing hello's, when both chains call OpenInit, we need the connection identifier + * of the previous connection in state INIT + */ + previousConnectionId: string; + clientState?: Any; + counterparty?: Counterparty; + delayPeriod: Long; + counterpartyVersions: Version[]; + proofHeight?: Height; + /** + * proof of the initialization the connection on Chain A: `UNITIALIZED -> + * INIT` + */ + proofInit: Uint8Array; + /** proof of client state included in message */ + proofClient: Uint8Array; + /** proof of client consensus state */ + proofConsensus: Uint8Array; + consensusHeight?: Height; + signer: string; +} + +/** MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. */ +export interface MsgConnectionOpenTryResponse {} + +/** + * MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to + * acknowledge the change of connection state to TRYOPEN on Chain B. + */ +export interface MsgConnectionOpenAck { + connectionId: string; + counterpartyConnectionId: string; + version?: Version; + clientState?: Any; + proofHeight?: Height; + /** + * proof of the initialization the connection on Chain B: `UNITIALIZED -> + * TRYOPEN` + */ + proofTry: Uint8Array; + /** proof of client state included in message */ + proofClient: Uint8Array; + /** proof of client consensus state */ + proofConsensus: Uint8Array; + consensusHeight?: Height; + signer: string; +} + +/** MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. */ +export interface MsgConnectionOpenAckResponse {} + +/** + * MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to + * acknowledge the change of connection state to OPEN on Chain A. + */ +export interface MsgConnectionOpenConfirm { + connectionId: string; + /** proof for the change of the connection state on Chain A: `INIT -> OPEN` */ + proofAck: Uint8Array; + proofHeight?: Height; + signer: string; +} + +/** MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm response type. */ +export interface MsgConnectionOpenConfirmResponse {} + +const baseMsgConnectionOpenInit: object = { clientId: "", delayPeriod: Long.UZERO, signer: "" }; + +export const MsgConnectionOpenInit = { + encode(message: MsgConnectionOpenInit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(18).fork()).ldelim(); + } + if (message.version !== undefined) { + Version.encode(message.version, writer.uint32(26).fork()).ldelim(); + } + if (!message.delayPeriod.isZero()) { + writer.uint32(32).uint64(message.delayPeriod); + } + if (message.signer !== "") { + writer.uint32(42).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgConnectionOpenInit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgConnectionOpenInit } as MsgConnectionOpenInit; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 3: + message.version = Version.decode(reader, reader.uint32()); + break; + case 4: + message.delayPeriod = reader.uint64() as Long; + break; + case 5: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgConnectionOpenInit { + const message = { ...baseMsgConnectionOpenInit } as MsgConnectionOpenInit; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromJSON(object.counterparty); + } else { + message.counterparty = undefined; + } + if (object.version !== undefined && object.version !== null) { + message.version = Version.fromJSON(object.version); + } else { + message.version = undefined; + } + if (object.delayPeriod !== undefined && object.delayPeriod !== null) { + message.delayPeriod = Long.fromString(object.delayPeriod); + } else { + message.delayPeriod = Long.UZERO; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = String(object.signer); + } else { + message.signer = ""; + } + return message; + }, + + toJSON(message: MsgConnectionOpenInit): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.counterparty !== undefined && + (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); + message.version !== undefined && + (obj.version = message.version ? Version.toJSON(message.version) : undefined); + message.delayPeriod !== undefined && (obj.delayPeriod = (message.delayPeriod || Long.UZERO).toString()); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial(object: DeepPartial): MsgConnectionOpenInit { + const message = { ...baseMsgConnectionOpenInit } as MsgConnectionOpenInit; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromPartial(object.counterparty); + } else { + message.counterparty = undefined; + } + if (object.version !== undefined && object.version !== null) { + message.version = Version.fromPartial(object.version); + } else { + message.version = undefined; + } + if (object.delayPeriod !== undefined && object.delayPeriod !== null) { + message.delayPeriod = object.delayPeriod as Long; + } else { + message.delayPeriod = Long.UZERO; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } else { + message.signer = ""; + } + return message; + }, +}; + +const baseMsgConnectionOpenInitResponse: object = {}; + +export const MsgConnectionOpenInitResponse = { + encode(_: MsgConnectionOpenInitResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgConnectionOpenInitResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgConnectionOpenInitResponse } as MsgConnectionOpenInitResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgConnectionOpenInitResponse { + const message = { ...baseMsgConnectionOpenInitResponse } as MsgConnectionOpenInitResponse; + return message; + }, + + toJSON(_: MsgConnectionOpenInitResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgConnectionOpenInitResponse { + const message = { ...baseMsgConnectionOpenInitResponse } as MsgConnectionOpenInitResponse; + return message; + }, +}; + +const baseMsgConnectionOpenTry: object = { + clientId: "", + previousConnectionId: "", + delayPeriod: Long.UZERO, + signer: "", +}; + +export const MsgConnectionOpenTry = { + encode(message: MsgConnectionOpenTry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.previousConnectionId !== "") { + writer.uint32(18).string(message.previousConnectionId); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(26).fork()).ldelim(); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(34).fork()).ldelim(); + } + if (!message.delayPeriod.isZero()) { + writer.uint32(40).uint64(message.delayPeriod); + } + for (const v of message.counterpartyVersions) { + Version.encode(v!, writer.uint32(50).fork()).ldelim(); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(58).fork()).ldelim(); + } + if (message.proofInit.length !== 0) { + writer.uint32(66).bytes(message.proofInit); + } + if (message.proofClient.length !== 0) { + writer.uint32(74).bytes(message.proofClient); + } + if (message.proofConsensus.length !== 0) { + writer.uint32(82).bytes(message.proofConsensus); + } + if (message.consensusHeight !== undefined) { + Height.encode(message.consensusHeight, writer.uint32(90).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(98).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgConnectionOpenTry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgConnectionOpenTry } as MsgConnectionOpenTry; + message.counterpartyVersions = []; + message.proofInit = new Uint8Array(); + message.proofClient = new Uint8Array(); + message.proofConsensus = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.previousConnectionId = reader.string(); + break; + case 3: + message.clientState = Any.decode(reader, reader.uint32()); + break; + case 4: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 5: + message.delayPeriod = reader.uint64() as Long; + break; + case 6: + message.counterpartyVersions.push(Version.decode(reader, reader.uint32())); + break; + case 7: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 8: + message.proofInit = reader.bytes(); + break; + case 9: + message.proofClient = reader.bytes(); + break; + case 10: + message.proofConsensus = reader.bytes(); + break; + case 11: + message.consensusHeight = Height.decode(reader, reader.uint32()); + break; + case 12: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgConnectionOpenTry { + const message = { ...baseMsgConnectionOpenTry } as MsgConnectionOpenTry; + message.counterpartyVersions = []; + message.proofInit = new Uint8Array(); + message.proofClient = new Uint8Array(); + message.proofConsensus = new Uint8Array(); + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.previousConnectionId !== undefined && object.previousConnectionId !== null) { + message.previousConnectionId = String(object.previousConnectionId); + } else { + message.previousConnectionId = ""; + } + if (object.clientState !== undefined && object.clientState !== null) { + message.clientState = Any.fromJSON(object.clientState); + } else { + message.clientState = undefined; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromJSON(object.counterparty); + } else { + message.counterparty = undefined; + } + if (object.delayPeriod !== undefined && object.delayPeriod !== null) { + message.delayPeriod = Long.fromString(object.delayPeriod); + } else { + message.delayPeriod = Long.UZERO; + } + if (object.counterpartyVersions !== undefined && object.counterpartyVersions !== null) { + for (const e of object.counterpartyVersions) { + message.counterpartyVersions.push(Version.fromJSON(e)); + } + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + if (object.proofInit !== undefined && object.proofInit !== null) { + message.proofInit = bytesFromBase64(object.proofInit); + } + if (object.proofClient !== undefined && object.proofClient !== null) { + message.proofClient = bytesFromBase64(object.proofClient); + } + if (object.proofConsensus !== undefined && object.proofConsensus !== null) { + message.proofConsensus = bytesFromBase64(object.proofConsensus); + } + if (object.consensusHeight !== undefined && object.consensusHeight !== null) { + message.consensusHeight = Height.fromJSON(object.consensusHeight); + } else { + message.consensusHeight = undefined; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = String(object.signer); + } else { + message.signer = ""; + } + return message; + }, + + toJSON(message: MsgConnectionOpenTry): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.previousConnectionId !== undefined && (obj.previousConnectionId = message.previousConnectionId); + message.clientState !== undefined && + (obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined); + message.counterparty !== undefined && + (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); + message.delayPeriod !== undefined && (obj.delayPeriod = (message.delayPeriod || Long.UZERO).toString()); + if (message.counterpartyVersions) { + obj.counterpartyVersions = message.counterpartyVersions.map((e) => (e ? Version.toJSON(e) : undefined)); + } else { + obj.counterpartyVersions = []; + } + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.proofInit !== undefined && + (obj.proofInit = base64FromBytes( + message.proofInit !== undefined ? message.proofInit : new Uint8Array(), + )); + message.proofClient !== undefined && + (obj.proofClient = base64FromBytes( + message.proofClient !== undefined ? message.proofClient : new Uint8Array(), + )); + message.proofConsensus !== undefined && + (obj.proofConsensus = base64FromBytes( + message.proofConsensus !== undefined ? message.proofConsensus : new Uint8Array(), + )); + message.consensusHeight !== undefined && + (obj.consensusHeight = message.consensusHeight ? Height.toJSON(message.consensusHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial(object: DeepPartial): MsgConnectionOpenTry { + const message = { ...baseMsgConnectionOpenTry } as MsgConnectionOpenTry; + message.counterpartyVersions = []; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.previousConnectionId !== undefined && object.previousConnectionId !== null) { + message.previousConnectionId = object.previousConnectionId; + } else { + message.previousConnectionId = ""; + } + if (object.clientState !== undefined && object.clientState !== null) { + message.clientState = Any.fromPartial(object.clientState); + } else { + message.clientState = undefined; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromPartial(object.counterparty); + } else { + message.counterparty = undefined; + } + if (object.delayPeriod !== undefined && object.delayPeriod !== null) { + message.delayPeriod = object.delayPeriod as Long; + } else { + message.delayPeriod = Long.UZERO; + } + if (object.counterpartyVersions !== undefined && object.counterpartyVersions !== null) { + for (const e of object.counterpartyVersions) { + message.counterpartyVersions.push(Version.fromPartial(e)); + } + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + if (object.proofInit !== undefined && object.proofInit !== null) { + message.proofInit = object.proofInit; + } else { + message.proofInit = new Uint8Array(); + } + if (object.proofClient !== undefined && object.proofClient !== null) { + message.proofClient = object.proofClient; + } else { + message.proofClient = new Uint8Array(); + } + if (object.proofConsensus !== undefined && object.proofConsensus !== null) { + message.proofConsensus = object.proofConsensus; + } else { + message.proofConsensus = new Uint8Array(); + } + if (object.consensusHeight !== undefined && object.consensusHeight !== null) { + message.consensusHeight = Height.fromPartial(object.consensusHeight); + } else { + message.consensusHeight = undefined; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } else { + message.signer = ""; + } + return message; + }, +}; + +const baseMsgConnectionOpenTryResponse: object = {}; + +export const MsgConnectionOpenTryResponse = { + encode(_: MsgConnectionOpenTryResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgConnectionOpenTryResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgConnectionOpenTryResponse } as MsgConnectionOpenTryResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgConnectionOpenTryResponse { + const message = { ...baseMsgConnectionOpenTryResponse } as MsgConnectionOpenTryResponse; + return message; + }, + + toJSON(_: MsgConnectionOpenTryResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgConnectionOpenTryResponse { + const message = { ...baseMsgConnectionOpenTryResponse } as MsgConnectionOpenTryResponse; + return message; + }, +}; + +const baseMsgConnectionOpenAck: object = { connectionId: "", counterpartyConnectionId: "", signer: "" }; + +export const MsgConnectionOpenAck = { + encode(message: MsgConnectionOpenAck, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.connectionId !== "") { + writer.uint32(10).string(message.connectionId); + } + if (message.counterpartyConnectionId !== "") { + writer.uint32(18).string(message.counterpartyConnectionId); + } + if (message.version !== undefined) { + Version.encode(message.version, writer.uint32(26).fork()).ldelim(); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(34).fork()).ldelim(); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(42).fork()).ldelim(); + } + if (message.proofTry.length !== 0) { + writer.uint32(50).bytes(message.proofTry); + } + if (message.proofClient.length !== 0) { + writer.uint32(58).bytes(message.proofClient); + } + if (message.proofConsensus.length !== 0) { + writer.uint32(66).bytes(message.proofConsensus); + } + if (message.consensusHeight !== undefined) { + Height.encode(message.consensusHeight, writer.uint32(74).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(82).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgConnectionOpenAck { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgConnectionOpenAck } as MsgConnectionOpenAck; + message.proofTry = new Uint8Array(); + message.proofClient = new Uint8Array(); + message.proofConsensus = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + case 2: + message.counterpartyConnectionId = reader.string(); + break; + case 3: + message.version = Version.decode(reader, reader.uint32()); + break; + case 4: + message.clientState = Any.decode(reader, reader.uint32()); + break; + case 5: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 6: + message.proofTry = reader.bytes(); + break; + case 7: + message.proofClient = reader.bytes(); + break; + case 8: + message.proofConsensus = reader.bytes(); + break; + case 9: + message.consensusHeight = Height.decode(reader, reader.uint32()); + break; + case 10: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgConnectionOpenAck { + const message = { ...baseMsgConnectionOpenAck } as MsgConnectionOpenAck; + message.proofTry = new Uint8Array(); + message.proofClient = new Uint8Array(); + message.proofConsensus = new Uint8Array(); + if (object.connectionId !== undefined && object.connectionId !== null) { + message.connectionId = String(object.connectionId); + } else { + message.connectionId = ""; + } + if (object.counterpartyConnectionId !== undefined && object.counterpartyConnectionId !== null) { + message.counterpartyConnectionId = String(object.counterpartyConnectionId); + } else { + message.counterpartyConnectionId = ""; + } + if (object.version !== undefined && object.version !== null) { + message.version = Version.fromJSON(object.version); + } else { + message.version = undefined; + } + if (object.clientState !== undefined && object.clientState !== null) { + message.clientState = Any.fromJSON(object.clientState); + } else { + message.clientState = undefined; + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + if (object.proofTry !== undefined && object.proofTry !== null) { + message.proofTry = bytesFromBase64(object.proofTry); + } + if (object.proofClient !== undefined && object.proofClient !== null) { + message.proofClient = bytesFromBase64(object.proofClient); + } + if (object.proofConsensus !== undefined && object.proofConsensus !== null) { + message.proofConsensus = bytesFromBase64(object.proofConsensus); + } + if (object.consensusHeight !== undefined && object.consensusHeight !== null) { + message.consensusHeight = Height.fromJSON(object.consensusHeight); + } else { + message.consensusHeight = undefined; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = String(object.signer); + } else { + message.signer = ""; + } + return message; + }, + + toJSON(message: MsgConnectionOpenAck): unknown { + const obj: any = {}; + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + message.counterpartyConnectionId !== undefined && + (obj.counterpartyConnectionId = message.counterpartyConnectionId); + message.version !== undefined && + (obj.version = message.version ? Version.toJSON(message.version) : undefined); + message.clientState !== undefined && + (obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.proofTry !== undefined && + (obj.proofTry = base64FromBytes(message.proofTry !== undefined ? message.proofTry : new Uint8Array())); + message.proofClient !== undefined && + (obj.proofClient = base64FromBytes( + message.proofClient !== undefined ? message.proofClient : new Uint8Array(), + )); + message.proofConsensus !== undefined && + (obj.proofConsensus = base64FromBytes( + message.proofConsensus !== undefined ? message.proofConsensus : new Uint8Array(), + )); + message.consensusHeight !== undefined && + (obj.consensusHeight = message.consensusHeight ? Height.toJSON(message.consensusHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial(object: DeepPartial): MsgConnectionOpenAck { + const message = { ...baseMsgConnectionOpenAck } as MsgConnectionOpenAck; + if (object.connectionId !== undefined && object.connectionId !== null) { + message.connectionId = object.connectionId; + } else { + message.connectionId = ""; + } + if (object.counterpartyConnectionId !== undefined && object.counterpartyConnectionId !== null) { + message.counterpartyConnectionId = object.counterpartyConnectionId; + } else { + message.counterpartyConnectionId = ""; + } + if (object.version !== undefined && object.version !== null) { + message.version = Version.fromPartial(object.version); + } else { + message.version = undefined; + } + if (object.clientState !== undefined && object.clientState !== null) { + message.clientState = Any.fromPartial(object.clientState); + } else { + message.clientState = undefined; + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + if (object.proofTry !== undefined && object.proofTry !== null) { + message.proofTry = object.proofTry; + } else { + message.proofTry = new Uint8Array(); + } + if (object.proofClient !== undefined && object.proofClient !== null) { + message.proofClient = object.proofClient; + } else { + message.proofClient = new Uint8Array(); + } + if (object.proofConsensus !== undefined && object.proofConsensus !== null) { + message.proofConsensus = object.proofConsensus; + } else { + message.proofConsensus = new Uint8Array(); + } + if (object.consensusHeight !== undefined && object.consensusHeight !== null) { + message.consensusHeight = Height.fromPartial(object.consensusHeight); + } else { + message.consensusHeight = undefined; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } else { + message.signer = ""; + } + return message; + }, +}; + +const baseMsgConnectionOpenAckResponse: object = {}; + +export const MsgConnectionOpenAckResponse = { + encode(_: MsgConnectionOpenAckResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgConnectionOpenAckResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgConnectionOpenAckResponse } as MsgConnectionOpenAckResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgConnectionOpenAckResponse { + const message = { ...baseMsgConnectionOpenAckResponse } as MsgConnectionOpenAckResponse; + return message; + }, + + toJSON(_: MsgConnectionOpenAckResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgConnectionOpenAckResponse { + const message = { ...baseMsgConnectionOpenAckResponse } as MsgConnectionOpenAckResponse; + return message; + }, +}; + +const baseMsgConnectionOpenConfirm: object = { connectionId: "", signer: "" }; + +export const MsgConnectionOpenConfirm = { + encode(message: MsgConnectionOpenConfirm, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.connectionId !== "") { + writer.uint32(10).string(message.connectionId); + } + if (message.proofAck.length !== 0) { + writer.uint32(18).bytes(message.proofAck); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(34).string(message.signer); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgConnectionOpenConfirm { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgConnectionOpenConfirm } as MsgConnectionOpenConfirm; + message.proofAck = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + case 2: + message.proofAck = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 4: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MsgConnectionOpenConfirm { + const message = { ...baseMsgConnectionOpenConfirm } as MsgConnectionOpenConfirm; + message.proofAck = new Uint8Array(); + if (object.connectionId !== undefined && object.connectionId !== null) { + message.connectionId = String(object.connectionId); + } else { + message.connectionId = ""; + } + if (object.proofAck !== undefined && object.proofAck !== null) { + message.proofAck = bytesFromBase64(object.proofAck); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromJSON(object.proofHeight); + } else { + message.proofHeight = undefined; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = String(object.signer); + } else { + message.signer = ""; + } + return message; + }, + + toJSON(message: MsgConnectionOpenConfirm): unknown { + const obj: any = {}; + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + message.proofAck !== undefined && + (obj.proofAck = base64FromBytes(message.proofAck !== undefined ? message.proofAck : new Uint8Array())); + message.proofHeight !== undefined && + (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); + message.signer !== undefined && (obj.signer = message.signer); + return obj; + }, + + fromPartial(object: DeepPartial): MsgConnectionOpenConfirm { + const message = { ...baseMsgConnectionOpenConfirm } as MsgConnectionOpenConfirm; + if (object.connectionId !== undefined && object.connectionId !== null) { + message.connectionId = object.connectionId; + } else { + message.connectionId = ""; + } + if (object.proofAck !== undefined && object.proofAck !== null) { + message.proofAck = object.proofAck; + } else { + message.proofAck = new Uint8Array(); + } + if (object.proofHeight !== undefined && object.proofHeight !== null) { + message.proofHeight = Height.fromPartial(object.proofHeight); + } else { + message.proofHeight = undefined; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } else { + message.signer = ""; + } + return message; + }, +}; + +const baseMsgConnectionOpenConfirmResponse: object = {}; + +export const MsgConnectionOpenConfirmResponse = { + encode(_: MsgConnectionOpenConfirmResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgConnectionOpenConfirmResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMsgConnectionOpenConfirmResponse } as MsgConnectionOpenConfirmResponse; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): MsgConnectionOpenConfirmResponse { + const message = { ...baseMsgConnectionOpenConfirmResponse } as MsgConnectionOpenConfirmResponse; + return message; + }, + + toJSON(_: MsgConnectionOpenConfirmResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgConnectionOpenConfirmResponse { + const message = { ...baseMsgConnectionOpenConfirmResponse } as MsgConnectionOpenConfirmResponse; + return message; + }, +}; + +/** Msg defines the ibc/connection Msg service. */ +export interface Msg { + /** ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. */ + ConnectionOpenInit(request: MsgConnectionOpenInit): Promise; + /** ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. */ + ConnectionOpenTry(request: MsgConnectionOpenTry): Promise; + /** ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. */ + ConnectionOpenAck(request: MsgConnectionOpenAck): Promise; + /** ConnectionOpenConfirm defines a rpc handler method for MsgConnectionOpenConfirm. */ + ConnectionOpenConfirm(request: MsgConnectionOpenConfirm): Promise; +} + +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.ConnectionOpenInit = this.ConnectionOpenInit.bind(this); + this.ConnectionOpenTry = this.ConnectionOpenTry.bind(this); + this.ConnectionOpenAck = this.ConnectionOpenAck.bind(this); + this.ConnectionOpenConfirm = this.ConnectionOpenConfirm.bind(this); + } + ConnectionOpenInit(request: MsgConnectionOpenInit): Promise { + const data = MsgConnectionOpenInit.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Msg", "ConnectionOpenInit", data); + return promise.then((data) => MsgConnectionOpenInitResponse.decode(new _m0.Reader(data))); + } + + ConnectionOpenTry(request: MsgConnectionOpenTry): Promise { + const data = MsgConnectionOpenTry.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Msg", "ConnectionOpenTry", data); + return promise.then((data) => MsgConnectionOpenTryResponse.decode(new _m0.Reader(data))); + } + + ConnectionOpenAck(request: MsgConnectionOpenAck): Promise { + const data = MsgConnectionOpenAck.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Msg", "ConnectionOpenAck", data); + return promise.then((data) => MsgConnectionOpenAckResponse.decode(new _m0.Reader(data))); + } + + ConnectionOpenConfirm(request: MsgConnectionOpenConfirm): Promise { + const data = MsgConnectionOpenConfirm.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Msg", "ConnectionOpenConfirm", data); + return promise.then((data) => MsgConnectionOpenConfirmResponse.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/ibc/core/types/v1/genesis.ts b/src/ibc/core/types/v1/genesis.ts new file mode 100644 index 00000000..b315dde8 --- /dev/null +++ b/src/ibc/core/types/v1/genesis.ts @@ -0,0 +1,130 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { GenesisState as GenesisState1 } from "../../../../ibc/core/client/v1/genesis"; +import { GenesisState as GenesisState2 } from "../../../../ibc/core/connection/v1/genesis"; +import { GenesisState as GenesisState3 } from "../../../../ibc/core/channel/v1/genesis"; + +export const protobufPackage = "ibc.core.types.v1"; + +/** GenesisState defines the ibc module's genesis state. */ +export interface GenesisState { + /** ICS002 - Clients genesis state */ + clientGenesis?: GenesisState1; + /** ICS003 - Connections genesis state */ + connectionGenesis?: GenesisState2; + /** ICS004 - Channel genesis state */ + channelGenesis?: GenesisState3; +} + +const baseGenesisState: object = {}; + +export const GenesisState = { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientGenesis !== undefined) { + GenesisState1.encode(message.clientGenesis, writer.uint32(10).fork()).ldelim(); + } + if (message.connectionGenesis !== undefined) { + GenesisState2.encode(message.connectionGenesis, writer.uint32(18).fork()).ldelim(); + } + if (message.channelGenesis !== undefined) { + GenesisState3.encode(message.channelGenesis, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGenesisState } as GenesisState; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientGenesis = GenesisState1.decode(reader, reader.uint32()); + break; + case 2: + message.connectionGenesis = GenesisState2.decode(reader, reader.uint32()); + break; + case 3: + message.channelGenesis = GenesisState3.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + if (object.clientGenesis !== undefined && object.clientGenesis !== null) { + message.clientGenesis = GenesisState1.fromJSON(object.clientGenesis); + } else { + message.clientGenesis = undefined; + } + if (object.connectionGenesis !== undefined && object.connectionGenesis !== null) { + message.connectionGenesis = GenesisState2.fromJSON(object.connectionGenesis); + } else { + message.connectionGenesis = undefined; + } + if (object.channelGenesis !== undefined && object.channelGenesis !== null) { + message.channelGenesis = GenesisState3.fromJSON(object.channelGenesis); + } else { + message.channelGenesis = undefined; + } + return message; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.clientGenesis !== undefined && + (obj.clientGenesis = message.clientGenesis ? GenesisState1.toJSON(message.clientGenesis) : undefined); + message.connectionGenesis !== undefined && + (obj.connectionGenesis = message.connectionGenesis + ? GenesisState2.toJSON(message.connectionGenesis) + : undefined); + message.channelGenesis !== undefined && + (obj.channelGenesis = message.channelGenesis + ? GenesisState3.toJSON(message.channelGenesis) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): GenesisState { + const message = { ...baseGenesisState } as GenesisState; + if (object.clientGenesis !== undefined && object.clientGenesis !== null) { + message.clientGenesis = GenesisState1.fromPartial(object.clientGenesis); + } else { + message.clientGenesis = undefined; + } + if (object.connectionGenesis !== undefined && object.connectionGenesis !== null) { + message.connectionGenesis = GenesisState2.fromPartial(object.connectionGenesis); + } else { + message.connectionGenesis = undefined; + } + if (object.channelGenesis !== undefined && object.channelGenesis !== null) { + message.channelGenesis = GenesisState3.fromPartial(object.channelGenesis); + } else { + message.channelGenesis = undefined; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/ibc/lightclients/localhost/v1/localhost.ts b/src/ibc/lightclients/localhost/v1/localhost.ts new file mode 100644 index 00000000..e3466829 --- /dev/null +++ b/src/ibc/lightclients/localhost/v1/localhost.ts @@ -0,0 +1,105 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Height } from "../../../../ibc/core/client/v1/client"; + +export const protobufPackage = "ibc.lightclients.localhost.v1"; + +/** + * ClientState defines a loopback (localhost) client. It requires (read-only) + * access to keys outside the client prefix. + */ +export interface ClientState { + /** self chain ID */ + chainId: string; + /** self latest block height */ + height?: Height; +} + +const baseClientState: object = { chainId: "" }; + +export const ClientState = { + encode(message: ClientState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.chainId !== "") { + writer.uint32(10).string(message.chainId); + } + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ClientState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseClientState } as ClientState; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainId = reader.string(); + break; + case 2: + message.height = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ClientState { + const message = { ...baseClientState } as ClientState; + if (object.chainId !== undefined && object.chainId !== null) { + message.chainId = String(object.chainId); + } else { + message.chainId = ""; + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromJSON(object.height); + } else { + message.height = undefined; + } + return message; + }, + + toJSON(message: ClientState): unknown { + const obj: any = {}; + message.chainId !== undefined && (obj.chainId = message.chainId); + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): ClientState { + const message = { ...baseClientState } as ClientState; + if (object.chainId !== undefined && object.chainId !== null) { + message.chainId = object.chainId; + } else { + message.chainId = ""; + } + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromPartial(object.height); + } else { + message.height = undefined; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/ibc/lightclients/solomachine/v1/solomachine.ts b/src/ibc/lightclients/solomachine/v1/solomachine.ts new file mode 100644 index 00000000..a7b4092b --- /dev/null +++ b/src/ibc/lightclients/solomachine/v1/solomachine.ts @@ -0,0 +1,1708 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Any } from "../../../../google/protobuf/any"; +import { ConnectionEnd } from "../../../../ibc/core/connection/v1/connection"; +import { Channel } from "../../../../ibc/core/channel/v1/channel"; + +export const protobufPackage = "ibc.lightclients.solomachine.v1"; + +/** + * DataType defines the type of solo machine proof being created. This is done to preserve uniqueness of different + * data sign byte encodings. + */ +export enum DataType { + /** DATA_TYPE_UNINITIALIZED_UNSPECIFIED - Default State */ + DATA_TYPE_UNINITIALIZED_UNSPECIFIED = 0, + /** DATA_TYPE_CLIENT_STATE - Data type for client state verification */ + DATA_TYPE_CLIENT_STATE = 1, + /** DATA_TYPE_CONSENSUS_STATE - Data type for consensus state verification */ + DATA_TYPE_CONSENSUS_STATE = 2, + /** DATA_TYPE_CONNECTION_STATE - Data type for connection state verification */ + DATA_TYPE_CONNECTION_STATE = 3, + /** DATA_TYPE_CHANNEL_STATE - Data type for channel state verification */ + DATA_TYPE_CHANNEL_STATE = 4, + /** DATA_TYPE_PACKET_COMMITMENT - Data type for packet commitment verification */ + DATA_TYPE_PACKET_COMMITMENT = 5, + /** DATA_TYPE_PACKET_ACKNOWLEDGEMENT - Data type for packet acknowledgement verification */ + DATA_TYPE_PACKET_ACKNOWLEDGEMENT = 6, + /** DATA_TYPE_PACKET_RECEIPT_ABSENCE - Data type for packet receipt absence verification */ + DATA_TYPE_PACKET_RECEIPT_ABSENCE = 7, + /** DATA_TYPE_NEXT_SEQUENCE_RECV - Data type for next sequence recv verification */ + DATA_TYPE_NEXT_SEQUENCE_RECV = 8, + /** DATA_TYPE_HEADER - Data type for header verification */ + DATA_TYPE_HEADER = 9, + UNRECOGNIZED = -1, +} + +export function dataTypeFromJSON(object: any): DataType { + switch (object) { + case 0: + case "DATA_TYPE_UNINITIALIZED_UNSPECIFIED": + return DataType.DATA_TYPE_UNINITIALIZED_UNSPECIFIED; + case 1: + case "DATA_TYPE_CLIENT_STATE": + return DataType.DATA_TYPE_CLIENT_STATE; + case 2: + case "DATA_TYPE_CONSENSUS_STATE": + return DataType.DATA_TYPE_CONSENSUS_STATE; + case 3: + case "DATA_TYPE_CONNECTION_STATE": + return DataType.DATA_TYPE_CONNECTION_STATE; + case 4: + case "DATA_TYPE_CHANNEL_STATE": + return DataType.DATA_TYPE_CHANNEL_STATE; + case 5: + case "DATA_TYPE_PACKET_COMMITMENT": + return DataType.DATA_TYPE_PACKET_COMMITMENT; + case 6: + case "DATA_TYPE_PACKET_ACKNOWLEDGEMENT": + return DataType.DATA_TYPE_PACKET_ACKNOWLEDGEMENT; + case 7: + case "DATA_TYPE_PACKET_RECEIPT_ABSENCE": + return DataType.DATA_TYPE_PACKET_RECEIPT_ABSENCE; + case 8: + case "DATA_TYPE_NEXT_SEQUENCE_RECV": + return DataType.DATA_TYPE_NEXT_SEQUENCE_RECV; + case 9: + case "DATA_TYPE_HEADER": + return DataType.DATA_TYPE_HEADER; + case -1: + case "UNRECOGNIZED": + default: + return DataType.UNRECOGNIZED; + } +} + +export function dataTypeToJSON(object: DataType): string { + switch (object) { + case DataType.DATA_TYPE_UNINITIALIZED_UNSPECIFIED: + return "DATA_TYPE_UNINITIALIZED_UNSPECIFIED"; + case DataType.DATA_TYPE_CLIENT_STATE: + return "DATA_TYPE_CLIENT_STATE"; + case DataType.DATA_TYPE_CONSENSUS_STATE: + return "DATA_TYPE_CONSENSUS_STATE"; + case DataType.DATA_TYPE_CONNECTION_STATE: + return "DATA_TYPE_CONNECTION_STATE"; + case DataType.DATA_TYPE_CHANNEL_STATE: + return "DATA_TYPE_CHANNEL_STATE"; + case DataType.DATA_TYPE_PACKET_COMMITMENT: + return "DATA_TYPE_PACKET_COMMITMENT"; + case DataType.DATA_TYPE_PACKET_ACKNOWLEDGEMENT: + return "DATA_TYPE_PACKET_ACKNOWLEDGEMENT"; + case DataType.DATA_TYPE_PACKET_RECEIPT_ABSENCE: + return "DATA_TYPE_PACKET_RECEIPT_ABSENCE"; + case DataType.DATA_TYPE_NEXT_SEQUENCE_RECV: + return "DATA_TYPE_NEXT_SEQUENCE_RECV"; + case DataType.DATA_TYPE_HEADER: + return "DATA_TYPE_HEADER"; + default: + return "UNKNOWN"; + } +} + +/** + * ClientState defines a solo machine client that tracks the current consensus + * state and if the client is frozen. + */ +export interface ClientState { + /** latest sequence of the client state */ + sequence: Long; + /** frozen sequence of the solo machine */ + frozenSequence: Long; + consensusState?: ConsensusState; + /** + * when set to true, will allow governance to update a solo machine client. + * The client will be unfrozen if it is frozen. + */ + allowUpdateAfterProposal: boolean; +} + +/** + * ConsensusState defines a solo machine consensus state. The sequence of a consensus state + * is contained in the "height" key used in storing the consensus state. + */ +export interface ConsensusState { + /** public key of the solo machine */ + publicKey?: Any; + /** + * diversifier allows the same public key to be re-used across different solo machine clients + * (potentially on different chains) without being considered misbehaviour. + */ + diversifier: string; + timestamp: Long; +} + +/** Header defines a solo machine consensus header */ +export interface Header { + /** sequence to update solo machine public key at */ + sequence: Long; + timestamp: Long; + signature: Uint8Array; + newPublicKey?: Any; + newDiversifier: string; +} + +/** + * Misbehaviour defines misbehaviour for a solo machine which consists + * of a sequence and two signatures over different messages at that sequence. + */ +export interface Misbehaviour { + clientId: string; + sequence: Long; + signatureOne?: SignatureAndData; + signatureTwo?: SignatureAndData; +} + +/** + * SignatureAndData contains a signature and the data signed over to create that + * signature. + */ +export interface SignatureAndData { + signature: Uint8Array; + dataType: DataType; + data: Uint8Array; + timestamp: Long; +} + +/** + * TimestampedSignatureData contains the signature data and the timestamp of the + * signature. + */ +export interface TimestampedSignatureData { + signatureData: Uint8Array; + timestamp: Long; +} + +/** SignBytes defines the signed bytes used for signature verification. */ +export interface SignBytes { + sequence: Long; + timestamp: Long; + diversifier: string; + /** type of the data used */ + dataType: DataType; + /** marshaled data */ + data: Uint8Array; +} + +/** HeaderData returns the SignBytes data for update verification. */ +export interface HeaderData { + /** header public key */ + newPubKey?: Any; + /** header diversifier */ + newDiversifier: string; +} + +/** ClientStateData returns the SignBytes data for client state verification. */ +export interface ClientStateData { + path: Uint8Array; + clientState?: Any; +} + +/** + * ConsensusStateData returns the SignBytes data for consensus state + * verification. + */ +export interface ConsensusStateData { + path: Uint8Array; + consensusState?: Any; +} + +/** + * ConnectionStateData returns the SignBytes data for connection state + * verification. + */ +export interface ConnectionStateData { + path: Uint8Array; + connection?: ConnectionEnd; +} + +/** + * ChannelStateData returns the SignBytes data for channel state + * verification. + */ +export interface ChannelStateData { + path: Uint8Array; + channel?: Channel; +} + +/** + * PacketCommitmentData returns the SignBytes data for packet commitment + * verification. + */ +export interface PacketCommitmentData { + path: Uint8Array; + commitment: Uint8Array; +} + +/** + * PacketAcknowledgementData returns the SignBytes data for acknowledgement + * verification. + */ +export interface PacketAcknowledgementData { + path: Uint8Array; + acknowledgement: Uint8Array; +} + +/** + * PacketReceiptAbsenceData returns the SignBytes data for + * packet receipt absence verification. + */ +export interface PacketReceiptAbsenceData { + path: Uint8Array; +} + +/** + * NextSequenceRecvData returns the SignBytes data for verification of the next + * sequence to be received. + */ +export interface NextSequenceRecvData { + path: Uint8Array; + nextSeqRecv: Long; +} + +const baseClientState: object = { + sequence: Long.UZERO, + frozenSequence: Long.UZERO, + allowUpdateAfterProposal: false, +}; + +export const ClientState = { + encode(message: ClientState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.sequence.isZero()) { + writer.uint32(8).uint64(message.sequence); + } + if (!message.frozenSequence.isZero()) { + writer.uint32(16).uint64(message.frozenSequence); + } + if (message.consensusState !== undefined) { + ConsensusState.encode(message.consensusState, writer.uint32(26).fork()).ldelim(); + } + if (message.allowUpdateAfterProposal === true) { + writer.uint32(32).bool(message.allowUpdateAfterProposal); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ClientState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseClientState } as ClientState; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64() as Long; + break; + case 2: + message.frozenSequence = reader.uint64() as Long; + break; + case 3: + message.consensusState = ConsensusState.decode(reader, reader.uint32()); + break; + case 4: + message.allowUpdateAfterProposal = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ClientState { + const message = { ...baseClientState } as ClientState; + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = Long.fromString(object.sequence); + } else { + message.sequence = Long.UZERO; + } + if (object.frozenSequence !== undefined && object.frozenSequence !== null) { + message.frozenSequence = Long.fromString(object.frozenSequence); + } else { + message.frozenSequence = Long.UZERO; + } + if (object.consensusState !== undefined && object.consensusState !== null) { + message.consensusState = ConsensusState.fromJSON(object.consensusState); + } else { + message.consensusState = undefined; + } + if (object.allowUpdateAfterProposal !== undefined && object.allowUpdateAfterProposal !== null) { + message.allowUpdateAfterProposal = Boolean(object.allowUpdateAfterProposal); + } else { + message.allowUpdateAfterProposal = false; + } + return message; + }, + + toJSON(message: ClientState): unknown { + const obj: any = {}; + message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + message.frozenSequence !== undefined && + (obj.frozenSequence = (message.frozenSequence || Long.UZERO).toString()); + message.consensusState !== undefined && + (obj.consensusState = message.consensusState + ? ConsensusState.toJSON(message.consensusState) + : undefined); + message.allowUpdateAfterProposal !== undefined && + (obj.allowUpdateAfterProposal = message.allowUpdateAfterProposal); + return obj; + }, + + fromPartial(object: DeepPartial): ClientState { + const message = { ...baseClientState } as ClientState; + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = object.sequence as Long; + } else { + message.sequence = Long.UZERO; + } + if (object.frozenSequence !== undefined && object.frozenSequence !== null) { + message.frozenSequence = object.frozenSequence as Long; + } else { + message.frozenSequence = Long.UZERO; + } + if (object.consensusState !== undefined && object.consensusState !== null) { + message.consensusState = ConsensusState.fromPartial(object.consensusState); + } else { + message.consensusState = undefined; + } + if (object.allowUpdateAfterProposal !== undefined && object.allowUpdateAfterProposal !== null) { + message.allowUpdateAfterProposal = object.allowUpdateAfterProposal; + } else { + message.allowUpdateAfterProposal = false; + } + return message; + }, +}; + +const baseConsensusState: object = { diversifier: "", timestamp: Long.UZERO }; + +export const ConsensusState = { + encode(message: ConsensusState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.publicKey !== undefined) { + Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); + } + if (message.diversifier !== "") { + writer.uint32(18).string(message.diversifier); + } + if (!message.timestamp.isZero()) { + writer.uint32(24).uint64(message.timestamp); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ConsensusState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseConsensusState } as ConsensusState; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicKey = Any.decode(reader, reader.uint32()); + break; + case 2: + message.diversifier = reader.string(); + break; + case 3: + message.timestamp = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ConsensusState { + const message = { ...baseConsensusState } as ConsensusState; + if (object.publicKey !== undefined && object.publicKey !== null) { + message.publicKey = Any.fromJSON(object.publicKey); + } else { + message.publicKey = undefined; + } + if (object.diversifier !== undefined && object.diversifier !== null) { + message.diversifier = String(object.diversifier); + } else { + message.diversifier = ""; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = Long.fromString(object.timestamp); + } else { + message.timestamp = Long.UZERO; + } + return message; + }, + + toJSON(message: ConsensusState): unknown { + const obj: any = {}; + message.publicKey !== undefined && + (obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined); + message.diversifier !== undefined && (obj.diversifier = message.diversifier); + message.timestamp !== undefined && (obj.timestamp = (message.timestamp || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): ConsensusState { + const message = { ...baseConsensusState } as ConsensusState; + if (object.publicKey !== undefined && object.publicKey !== null) { + message.publicKey = Any.fromPartial(object.publicKey); + } else { + message.publicKey = undefined; + } + if (object.diversifier !== undefined && object.diversifier !== null) { + message.diversifier = object.diversifier; + } else { + message.diversifier = ""; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = object.timestamp as Long; + } else { + message.timestamp = Long.UZERO; + } + return message; + }, +}; + +const baseHeader: object = { sequence: Long.UZERO, timestamp: Long.UZERO, newDiversifier: "" }; + +export const Header = { + encode(message: Header, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.sequence.isZero()) { + writer.uint32(8).uint64(message.sequence); + } + if (!message.timestamp.isZero()) { + writer.uint32(16).uint64(message.timestamp); + } + if (message.signature.length !== 0) { + writer.uint32(26).bytes(message.signature); + } + if (message.newPublicKey !== undefined) { + Any.encode(message.newPublicKey, writer.uint32(34).fork()).ldelim(); + } + if (message.newDiversifier !== "") { + writer.uint32(42).string(message.newDiversifier); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Header { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHeader } as Header; + message.signature = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64() as Long; + break; + case 2: + message.timestamp = reader.uint64() as Long; + break; + case 3: + message.signature = reader.bytes(); + break; + case 4: + message.newPublicKey = Any.decode(reader, reader.uint32()); + break; + case 5: + message.newDiversifier = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Header { + const message = { ...baseHeader } as Header; + message.signature = new Uint8Array(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = Long.fromString(object.sequence); + } else { + message.sequence = Long.UZERO; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = Long.fromString(object.timestamp); + } else { + message.timestamp = Long.UZERO; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + if (object.newPublicKey !== undefined && object.newPublicKey !== null) { + message.newPublicKey = Any.fromJSON(object.newPublicKey); + } else { + message.newPublicKey = undefined; + } + if (object.newDiversifier !== undefined && object.newDiversifier !== null) { + message.newDiversifier = String(object.newDiversifier); + } else { + message.newDiversifier = ""; + } + return message; + }, + + toJSON(message: Header): unknown { + const obj: any = {}; + message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + message.timestamp !== undefined && (obj.timestamp = (message.timestamp || Long.UZERO).toString()); + message.signature !== undefined && + (obj.signature = base64FromBytes( + message.signature !== undefined ? message.signature : new Uint8Array(), + )); + message.newPublicKey !== undefined && + (obj.newPublicKey = message.newPublicKey ? Any.toJSON(message.newPublicKey) : undefined); + message.newDiversifier !== undefined && (obj.newDiversifier = message.newDiversifier); + return obj; + }, + + fromPartial(object: DeepPartial

): Header { + const message = { ...baseHeader } as Header; + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = object.sequence as Long; + } else { + message.sequence = Long.UZERO; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = object.timestamp as Long; + } else { + message.timestamp = Long.UZERO; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = object.signature; + } else { + message.signature = new Uint8Array(); + } + if (object.newPublicKey !== undefined && object.newPublicKey !== null) { + message.newPublicKey = Any.fromPartial(object.newPublicKey); + } else { + message.newPublicKey = undefined; + } + if (object.newDiversifier !== undefined && object.newDiversifier !== null) { + message.newDiversifier = object.newDiversifier; + } else { + message.newDiversifier = ""; + } + return message; + }, +}; + +const baseMisbehaviour: object = { clientId: "", sequence: Long.UZERO }; + +export const Misbehaviour = { + encode(message: Misbehaviour, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (!message.sequence.isZero()) { + writer.uint32(16).uint64(message.sequence); + } + if (message.signatureOne !== undefined) { + SignatureAndData.encode(message.signatureOne, writer.uint32(26).fork()).ldelim(); + } + if (message.signatureTwo !== undefined) { + SignatureAndData.encode(message.signatureTwo, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Misbehaviour { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMisbehaviour } as Misbehaviour; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.sequence = reader.uint64() as Long; + break; + case 3: + message.signatureOne = SignatureAndData.decode(reader, reader.uint32()); + break; + case 4: + message.signatureTwo = SignatureAndData.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Misbehaviour { + const message = { ...baseMisbehaviour } as Misbehaviour; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = Long.fromString(object.sequence); + } else { + message.sequence = Long.UZERO; + } + if (object.signatureOne !== undefined && object.signatureOne !== null) { + message.signatureOne = SignatureAndData.fromJSON(object.signatureOne); + } else { + message.signatureOne = undefined; + } + if (object.signatureTwo !== undefined && object.signatureTwo !== null) { + message.signatureTwo = SignatureAndData.fromJSON(object.signatureTwo); + } else { + message.signatureTwo = undefined; + } + return message; + }, + + toJSON(message: Misbehaviour): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + message.signatureOne !== undefined && + (obj.signatureOne = message.signatureOne ? SignatureAndData.toJSON(message.signatureOne) : undefined); + message.signatureTwo !== undefined && + (obj.signatureTwo = message.signatureTwo ? SignatureAndData.toJSON(message.signatureTwo) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): Misbehaviour { + const message = { ...baseMisbehaviour } as Misbehaviour; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = object.sequence as Long; + } else { + message.sequence = Long.UZERO; + } + if (object.signatureOne !== undefined && object.signatureOne !== null) { + message.signatureOne = SignatureAndData.fromPartial(object.signatureOne); + } else { + message.signatureOne = undefined; + } + if (object.signatureTwo !== undefined && object.signatureTwo !== null) { + message.signatureTwo = SignatureAndData.fromPartial(object.signatureTwo); + } else { + message.signatureTwo = undefined; + } + return message; + }, +}; + +const baseSignatureAndData: object = { dataType: 0, timestamp: Long.UZERO }; + +export const SignatureAndData = { + encode(message: SignatureAndData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.signature.length !== 0) { + writer.uint32(10).bytes(message.signature); + } + if (message.dataType !== 0) { + writer.uint32(16).int32(message.dataType); + } + if (message.data.length !== 0) { + writer.uint32(26).bytes(message.data); + } + if (!message.timestamp.isZero()) { + writer.uint32(32).uint64(message.timestamp); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SignatureAndData { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSignatureAndData } as SignatureAndData; + message.signature = new Uint8Array(); + message.data = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signature = reader.bytes(); + break; + case 2: + message.dataType = reader.int32() as any; + break; + case 3: + message.data = reader.bytes(); + break; + case 4: + message.timestamp = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SignatureAndData { + const message = { ...baseSignatureAndData } as SignatureAndData; + message.signature = new Uint8Array(); + message.data = new Uint8Array(); + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + if (object.dataType !== undefined && object.dataType !== null) { + message.dataType = dataTypeFromJSON(object.dataType); + } else { + message.dataType = 0; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = Long.fromString(object.timestamp); + } else { + message.timestamp = Long.UZERO; + } + return message; + }, + + toJSON(message: SignatureAndData): unknown { + const obj: any = {}; + message.signature !== undefined && + (obj.signature = base64FromBytes( + message.signature !== undefined ? message.signature : new Uint8Array(), + )); + message.dataType !== undefined && (obj.dataType = dataTypeToJSON(message.dataType)); + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.timestamp !== undefined && (obj.timestamp = (message.timestamp || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): SignatureAndData { + const message = { ...baseSignatureAndData } as SignatureAndData; + if (object.signature !== undefined && object.signature !== null) { + message.signature = object.signature; + } else { + message.signature = new Uint8Array(); + } + if (object.dataType !== undefined && object.dataType !== null) { + message.dataType = object.dataType; + } else { + message.dataType = 0; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = object.timestamp as Long; + } else { + message.timestamp = Long.UZERO; + } + return message; + }, +}; + +const baseTimestampedSignatureData: object = { timestamp: Long.UZERO }; + +export const TimestampedSignatureData = { + encode(message: TimestampedSignatureData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.signatureData.length !== 0) { + writer.uint32(10).bytes(message.signatureData); + } + if (!message.timestamp.isZero()) { + writer.uint32(16).uint64(message.timestamp); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TimestampedSignatureData { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTimestampedSignatureData } as TimestampedSignatureData; + message.signatureData = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signatureData = reader.bytes(); + break; + case 2: + message.timestamp = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TimestampedSignatureData { + const message = { ...baseTimestampedSignatureData } as TimestampedSignatureData; + message.signatureData = new Uint8Array(); + if (object.signatureData !== undefined && object.signatureData !== null) { + message.signatureData = bytesFromBase64(object.signatureData); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = Long.fromString(object.timestamp); + } else { + message.timestamp = Long.UZERO; + } + return message; + }, + + toJSON(message: TimestampedSignatureData): unknown { + const obj: any = {}; + message.signatureData !== undefined && + (obj.signatureData = base64FromBytes( + message.signatureData !== undefined ? message.signatureData : new Uint8Array(), + )); + message.timestamp !== undefined && (obj.timestamp = (message.timestamp || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): TimestampedSignatureData { + const message = { ...baseTimestampedSignatureData } as TimestampedSignatureData; + if (object.signatureData !== undefined && object.signatureData !== null) { + message.signatureData = object.signatureData; + } else { + message.signatureData = new Uint8Array(); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = object.timestamp as Long; + } else { + message.timestamp = Long.UZERO; + } + return message; + }, +}; + +const baseSignBytes: object = { sequence: Long.UZERO, timestamp: Long.UZERO, diversifier: "", dataType: 0 }; + +export const SignBytes = { + encode(message: SignBytes, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.sequence.isZero()) { + writer.uint32(8).uint64(message.sequence); + } + if (!message.timestamp.isZero()) { + writer.uint32(16).uint64(message.timestamp); + } + if (message.diversifier !== "") { + writer.uint32(26).string(message.diversifier); + } + if (message.dataType !== 0) { + writer.uint32(32).int32(message.dataType); + } + if (message.data.length !== 0) { + writer.uint32(42).bytes(message.data); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SignBytes { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSignBytes } as SignBytes; + message.data = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64() as Long; + break; + case 2: + message.timestamp = reader.uint64() as Long; + break; + case 3: + message.diversifier = reader.string(); + break; + case 4: + message.dataType = reader.int32() as any; + break; + case 5: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SignBytes { + const message = { ...baseSignBytes } as SignBytes; + message.data = new Uint8Array(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = Long.fromString(object.sequence); + } else { + message.sequence = Long.UZERO; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = Long.fromString(object.timestamp); + } else { + message.timestamp = Long.UZERO; + } + if (object.diversifier !== undefined && object.diversifier !== null) { + message.diversifier = String(object.diversifier); + } else { + message.diversifier = ""; + } + if (object.dataType !== undefined && object.dataType !== null) { + message.dataType = dataTypeFromJSON(object.dataType); + } else { + message.dataType = 0; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + + toJSON(message: SignBytes): unknown { + const obj: any = {}; + message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + message.timestamp !== undefined && (obj.timestamp = (message.timestamp || Long.UZERO).toString()); + message.diversifier !== undefined && (obj.diversifier = message.diversifier); + message.dataType !== undefined && (obj.dataType = dataTypeToJSON(message.dataType)); + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): SignBytes { + const message = { ...baseSignBytes } as SignBytes; + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = object.sequence as Long; + } else { + message.sequence = Long.UZERO; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = object.timestamp as Long; + } else { + message.timestamp = Long.UZERO; + } + if (object.diversifier !== undefined && object.diversifier !== null) { + message.diversifier = object.diversifier; + } else { + message.diversifier = ""; + } + if (object.dataType !== undefined && object.dataType !== null) { + message.dataType = object.dataType; + } else { + message.dataType = 0; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + return message; + }, +}; + +const baseHeaderData: object = { newDiversifier: "" }; + +export const HeaderData = { + encode(message: HeaderData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.newPubKey !== undefined) { + Any.encode(message.newPubKey, writer.uint32(10).fork()).ldelim(); + } + if (message.newDiversifier !== "") { + writer.uint32(18).string(message.newDiversifier); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): HeaderData { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHeaderData } as HeaderData; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.newPubKey = Any.decode(reader, reader.uint32()); + break; + case 2: + message.newDiversifier = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): HeaderData { + const message = { ...baseHeaderData } as HeaderData; + if (object.newPubKey !== undefined && object.newPubKey !== null) { + message.newPubKey = Any.fromJSON(object.newPubKey); + } else { + message.newPubKey = undefined; + } + if (object.newDiversifier !== undefined && object.newDiversifier !== null) { + message.newDiversifier = String(object.newDiversifier); + } else { + message.newDiversifier = ""; + } + return message; + }, + + toJSON(message: HeaderData): unknown { + const obj: any = {}; + message.newPubKey !== undefined && + (obj.newPubKey = message.newPubKey ? Any.toJSON(message.newPubKey) : undefined); + message.newDiversifier !== undefined && (obj.newDiversifier = message.newDiversifier); + return obj; + }, + + fromPartial(object: DeepPartial): HeaderData { + const message = { ...baseHeaderData } as HeaderData; + if (object.newPubKey !== undefined && object.newPubKey !== null) { + message.newPubKey = Any.fromPartial(object.newPubKey); + } else { + message.newPubKey = undefined; + } + if (object.newDiversifier !== undefined && object.newDiversifier !== null) { + message.newDiversifier = object.newDiversifier; + } else { + message.newDiversifier = ""; + } + return message; + }, +}; + +const baseClientStateData: object = {}; + +export const ClientStateData = { + encode(message: ClientStateData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.path.length !== 0) { + writer.uint32(10).bytes(message.path); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ClientStateData { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseClientStateData } as ClientStateData; + message.path = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.bytes(); + break; + case 2: + message.clientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ClientStateData { + const message = { ...baseClientStateData } as ClientStateData; + message.path = new Uint8Array(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.clientState !== undefined && object.clientState !== null) { + message.clientState = Any.fromJSON(object.clientState); + } else { + message.clientState = undefined; + } + return message; + }, + + toJSON(message: ClientStateData): unknown { + const obj: any = {}; + message.path !== undefined && + (obj.path = base64FromBytes(message.path !== undefined ? message.path : new Uint8Array())); + message.clientState !== undefined && + (obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): ClientStateData { + const message = { ...baseClientStateData } as ClientStateData; + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } else { + message.path = new Uint8Array(); + } + if (object.clientState !== undefined && object.clientState !== null) { + message.clientState = Any.fromPartial(object.clientState); + } else { + message.clientState = undefined; + } + return message; + }, +}; + +const baseConsensusStateData: object = {}; + +export const ConsensusStateData = { + encode(message: ConsensusStateData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.path.length !== 0) { + writer.uint32(10).bytes(message.path); + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ConsensusStateData { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseConsensusStateData } as ConsensusStateData; + message.path = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.bytes(); + break; + case 2: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ConsensusStateData { + const message = { ...baseConsensusStateData } as ConsensusStateData; + message.path = new Uint8Array(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.consensusState !== undefined && object.consensusState !== null) { + message.consensusState = Any.fromJSON(object.consensusState); + } else { + message.consensusState = undefined; + } + return message; + }, + + toJSON(message: ConsensusStateData): unknown { + const obj: any = {}; + message.path !== undefined && + (obj.path = base64FromBytes(message.path !== undefined ? message.path : new Uint8Array())); + message.consensusState !== undefined && + (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): ConsensusStateData { + const message = { ...baseConsensusStateData } as ConsensusStateData; + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } else { + message.path = new Uint8Array(); + } + if (object.consensusState !== undefined && object.consensusState !== null) { + message.consensusState = Any.fromPartial(object.consensusState); + } else { + message.consensusState = undefined; + } + return message; + }, +}; + +const baseConnectionStateData: object = {}; + +export const ConnectionStateData = { + encode(message: ConnectionStateData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.path.length !== 0) { + writer.uint32(10).bytes(message.path); + } + if (message.connection !== undefined) { + ConnectionEnd.encode(message.connection, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ConnectionStateData { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseConnectionStateData } as ConnectionStateData; + message.path = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.bytes(); + break; + case 2: + message.connection = ConnectionEnd.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ConnectionStateData { + const message = { ...baseConnectionStateData } as ConnectionStateData; + message.path = new Uint8Array(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.connection !== undefined && object.connection !== null) { + message.connection = ConnectionEnd.fromJSON(object.connection); + } else { + message.connection = undefined; + } + return message; + }, + + toJSON(message: ConnectionStateData): unknown { + const obj: any = {}; + message.path !== undefined && + (obj.path = base64FromBytes(message.path !== undefined ? message.path : new Uint8Array())); + message.connection !== undefined && + (obj.connection = message.connection ? ConnectionEnd.toJSON(message.connection) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): ConnectionStateData { + const message = { ...baseConnectionStateData } as ConnectionStateData; + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } else { + message.path = new Uint8Array(); + } + if (object.connection !== undefined && object.connection !== null) { + message.connection = ConnectionEnd.fromPartial(object.connection); + } else { + message.connection = undefined; + } + return message; + }, +}; + +const baseChannelStateData: object = {}; + +export const ChannelStateData = { + encode(message: ChannelStateData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.path.length !== 0) { + writer.uint32(10).bytes(message.path); + } + if (message.channel !== undefined) { + Channel.encode(message.channel, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ChannelStateData { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseChannelStateData } as ChannelStateData; + message.path = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.bytes(); + break; + case 2: + message.channel = Channel.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ChannelStateData { + const message = { ...baseChannelStateData } as ChannelStateData; + message.path = new Uint8Array(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.channel !== undefined && object.channel !== null) { + message.channel = Channel.fromJSON(object.channel); + } else { + message.channel = undefined; + } + return message; + }, + + toJSON(message: ChannelStateData): unknown { + const obj: any = {}; + message.path !== undefined && + (obj.path = base64FromBytes(message.path !== undefined ? message.path : new Uint8Array())); + message.channel !== undefined && + (obj.channel = message.channel ? Channel.toJSON(message.channel) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): ChannelStateData { + const message = { ...baseChannelStateData } as ChannelStateData; + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } else { + message.path = new Uint8Array(); + } + if (object.channel !== undefined && object.channel !== null) { + message.channel = Channel.fromPartial(object.channel); + } else { + message.channel = undefined; + } + return message; + }, +}; + +const basePacketCommitmentData: object = {}; + +export const PacketCommitmentData = { + encode(message: PacketCommitmentData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.path.length !== 0) { + writer.uint32(10).bytes(message.path); + } + if (message.commitment.length !== 0) { + writer.uint32(18).bytes(message.commitment); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PacketCommitmentData { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePacketCommitmentData } as PacketCommitmentData; + message.path = new Uint8Array(); + message.commitment = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.bytes(); + break; + case 2: + message.commitment = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PacketCommitmentData { + const message = { ...basePacketCommitmentData } as PacketCommitmentData; + message.path = new Uint8Array(); + message.commitment = new Uint8Array(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.commitment !== undefined && object.commitment !== null) { + message.commitment = bytesFromBase64(object.commitment); + } + return message; + }, + + toJSON(message: PacketCommitmentData): unknown { + const obj: any = {}; + message.path !== undefined && + (obj.path = base64FromBytes(message.path !== undefined ? message.path : new Uint8Array())); + message.commitment !== undefined && + (obj.commitment = base64FromBytes( + message.commitment !== undefined ? message.commitment : new Uint8Array(), + )); + return obj; + }, + + fromPartial(object: DeepPartial): PacketCommitmentData { + const message = { ...basePacketCommitmentData } as PacketCommitmentData; + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } else { + message.path = new Uint8Array(); + } + if (object.commitment !== undefined && object.commitment !== null) { + message.commitment = object.commitment; + } else { + message.commitment = new Uint8Array(); + } + return message; + }, +}; + +const basePacketAcknowledgementData: object = {}; + +export const PacketAcknowledgementData = { + encode(message: PacketAcknowledgementData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.path.length !== 0) { + writer.uint32(10).bytes(message.path); + } + if (message.acknowledgement.length !== 0) { + writer.uint32(18).bytes(message.acknowledgement); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PacketAcknowledgementData { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePacketAcknowledgementData } as PacketAcknowledgementData; + message.path = new Uint8Array(); + message.acknowledgement = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.bytes(); + break; + case 2: + message.acknowledgement = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PacketAcknowledgementData { + const message = { ...basePacketAcknowledgementData } as PacketAcknowledgementData; + message.path = new Uint8Array(); + message.acknowledgement = new Uint8Array(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.acknowledgement !== undefined && object.acknowledgement !== null) { + message.acknowledgement = bytesFromBase64(object.acknowledgement); + } + return message; + }, + + toJSON(message: PacketAcknowledgementData): unknown { + const obj: any = {}; + message.path !== undefined && + (obj.path = base64FromBytes(message.path !== undefined ? message.path : new Uint8Array())); + message.acknowledgement !== undefined && + (obj.acknowledgement = base64FromBytes( + message.acknowledgement !== undefined ? message.acknowledgement : new Uint8Array(), + )); + return obj; + }, + + fromPartial(object: DeepPartial): PacketAcknowledgementData { + const message = { ...basePacketAcknowledgementData } as PacketAcknowledgementData; + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } else { + message.path = new Uint8Array(); + } + if (object.acknowledgement !== undefined && object.acknowledgement !== null) { + message.acknowledgement = object.acknowledgement; + } else { + message.acknowledgement = new Uint8Array(); + } + return message; + }, +}; + +const basePacketReceiptAbsenceData: object = {}; + +export const PacketReceiptAbsenceData = { + encode(message: PacketReceiptAbsenceData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.path.length !== 0) { + writer.uint32(10).bytes(message.path); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PacketReceiptAbsenceData { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePacketReceiptAbsenceData } as PacketReceiptAbsenceData; + message.path = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PacketReceiptAbsenceData { + const message = { ...basePacketReceiptAbsenceData } as PacketReceiptAbsenceData; + message.path = new Uint8Array(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + return message; + }, + + toJSON(message: PacketReceiptAbsenceData): unknown { + const obj: any = {}; + message.path !== undefined && + (obj.path = base64FromBytes(message.path !== undefined ? message.path : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): PacketReceiptAbsenceData { + const message = { ...basePacketReceiptAbsenceData } as PacketReceiptAbsenceData; + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } else { + message.path = new Uint8Array(); + } + return message; + }, +}; + +const baseNextSequenceRecvData: object = { nextSeqRecv: Long.UZERO }; + +export const NextSequenceRecvData = { + encode(message: NextSequenceRecvData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.path.length !== 0) { + writer.uint32(10).bytes(message.path); + } + if (!message.nextSeqRecv.isZero()) { + writer.uint32(16).uint64(message.nextSeqRecv); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): NextSequenceRecvData { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseNextSequenceRecvData } as NextSequenceRecvData; + message.path = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.bytes(); + break; + case 2: + message.nextSeqRecv = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): NextSequenceRecvData { + const message = { ...baseNextSequenceRecvData } as NextSequenceRecvData; + message.path = new Uint8Array(); + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.nextSeqRecv !== undefined && object.nextSeqRecv !== null) { + message.nextSeqRecv = Long.fromString(object.nextSeqRecv); + } else { + message.nextSeqRecv = Long.UZERO; + } + return message; + }, + + toJSON(message: NextSequenceRecvData): unknown { + const obj: any = {}; + message.path !== undefined && + (obj.path = base64FromBytes(message.path !== undefined ? message.path : new Uint8Array())); + message.nextSeqRecv !== undefined && (obj.nextSeqRecv = (message.nextSeqRecv || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): NextSequenceRecvData { + const message = { ...baseNextSequenceRecvData } as NextSequenceRecvData; + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } else { + message.path = new Uint8Array(); + } + if (object.nextSeqRecv !== undefined && object.nextSeqRecv !== null) { + message.nextSeqRecv = object.nextSeqRecv as Long; + } else { + message.nextSeqRecv = Long.UZERO; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/ibc/lightclients/tendermint/v1/tendermint.ts b/src/ibc/lightclients/tendermint/v1/tendermint.ts new file mode 100644 index 00000000..583a8fad --- /dev/null +++ b/src/ibc/lightclients/tendermint/v1/tendermint.ts @@ -0,0 +1,795 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Duration } from "../../../../google/protobuf/duration"; +import { Height } from "../../../../ibc/core/client/v1/client"; +import { MerkleRoot } from "../../../../ibc/core/commitment/v1/commitment"; +import { SignedHeader } from "../../../../tendermint/types/types"; +import { ValidatorSet } from "../../../../tendermint/types/validator"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; +import { ProofSpec } from "../../../../confio/proofs"; + +export const protobufPackage = "ibc.lightclients.tendermint.v1"; + +/** + * ClientState from Tendermint tracks the current validator set, latest height, + * and a possible frozen height. + */ +export interface ClientState { + chainId: string; + trustLevel?: Fraction; + /** + * duration of the period since the LastestTimestamp during which the + * submitted headers are valid for upgrade + */ + trustingPeriod?: Duration; + /** duration of the staking unbonding period */ + unbondingPeriod?: Duration; + /** defines how much new (untrusted) header's Time can drift into the future. */ + maxClockDrift?: Duration; + /** Block height when the client was frozen due to a misbehaviour */ + frozenHeight?: Height; + /** Latest height the client was updated to */ + latestHeight?: Height; + /** Proof specifications used in verifying counterparty state */ + proofSpecs: ProofSpec[]; + /** + * Path at which next upgraded client will be committed. + * Each element corresponds to the key for a single CommitmentProof in the chained proof. + * NOTE: ClientState must stored under `{upgradePath}/{upgradeHeight}/clientState` + * ConsensusState must be stored under `{upgradepath}/{upgradeHeight}/consensusState` + * For SDK chains using the default upgrade module, upgrade_path should be []string{"upgrade", "upgradedIBCState"}` + */ + upgradePath: string[]; + /** + * This flag, when set to true, will allow governance to recover a client + * which has expired + */ + allowUpdateAfterExpiry: boolean; + /** + * This flag, when set to true, will allow governance to unfreeze a client + * whose chain has experienced a misbehaviour event + */ + allowUpdateAfterMisbehaviour: boolean; +} + +/** ConsensusState defines the consensus state from Tendermint. */ +export interface ConsensusState { + /** + * timestamp that corresponds to the block height in which the ConsensusState + * was stored. + */ + timestamp?: Date; + /** commitment root (i.e app hash) */ + root?: MerkleRoot; + nextValidatorsHash: Uint8Array; +} + +/** + * Misbehaviour is a wrapper over two conflicting Headers + * that implements Misbehaviour interface expected by ICS-02 + */ +export interface Misbehaviour { + clientId: string; + header1?: Header; + header2?: Header; +} + +/** + * Header defines the Tendermint client consensus Header. + * It encapsulates all the information necessary to update from a trusted + * Tendermint ConsensusState. The inclusion of TrustedHeight and + * TrustedValidators allows this update to process correctly, so long as the + * ConsensusState for the TrustedHeight exists, this removes race conditions + * among relayers The SignedHeader and ValidatorSet are the new untrusted update + * fields for the client. The TrustedHeight is the height of a stored + * ConsensusState on the client that will be used to verify the new untrusted + * header. The Trusted ConsensusState must be within the unbonding period of + * current time in order to correctly verify, and the TrustedValidators must + * hash to TrustedConsensusState.NextValidatorsHash since that is the last + * trusted validator set at the TrustedHeight. + */ +export interface Header { + signedHeader?: SignedHeader; + validatorSet?: ValidatorSet; + trustedHeight?: Height; + trustedValidators?: ValidatorSet; +} + +/** Fraction defines the protobuf message type for tmmath.Fraction that only supports positive values. */ +export interface Fraction { + numerator: Long; + denominator: Long; +} + +const baseClientState: object = { + chainId: "", + upgradePath: "", + allowUpdateAfterExpiry: false, + allowUpdateAfterMisbehaviour: false, +}; + +export const ClientState = { + encode(message: ClientState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.chainId !== "") { + writer.uint32(10).string(message.chainId); + } + if (message.trustLevel !== undefined) { + Fraction.encode(message.trustLevel, writer.uint32(18).fork()).ldelim(); + } + if (message.trustingPeriod !== undefined) { + Duration.encode(message.trustingPeriod, writer.uint32(26).fork()).ldelim(); + } + if (message.unbondingPeriod !== undefined) { + Duration.encode(message.unbondingPeriod, writer.uint32(34).fork()).ldelim(); + } + if (message.maxClockDrift !== undefined) { + Duration.encode(message.maxClockDrift, writer.uint32(42).fork()).ldelim(); + } + if (message.frozenHeight !== undefined) { + Height.encode(message.frozenHeight, writer.uint32(50).fork()).ldelim(); + } + if (message.latestHeight !== undefined) { + Height.encode(message.latestHeight, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.proofSpecs) { + ProofSpec.encode(v!, writer.uint32(66).fork()).ldelim(); + } + for (const v of message.upgradePath) { + writer.uint32(74).string(v!); + } + if (message.allowUpdateAfterExpiry === true) { + writer.uint32(80).bool(message.allowUpdateAfterExpiry); + } + if (message.allowUpdateAfterMisbehaviour === true) { + writer.uint32(88).bool(message.allowUpdateAfterMisbehaviour); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ClientState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseClientState } as ClientState; + message.proofSpecs = []; + message.upgradePath = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chainId = reader.string(); + break; + case 2: + message.trustLevel = Fraction.decode(reader, reader.uint32()); + break; + case 3: + message.trustingPeriod = Duration.decode(reader, reader.uint32()); + break; + case 4: + message.unbondingPeriod = Duration.decode(reader, reader.uint32()); + break; + case 5: + message.maxClockDrift = Duration.decode(reader, reader.uint32()); + break; + case 6: + message.frozenHeight = Height.decode(reader, reader.uint32()); + break; + case 7: + message.latestHeight = Height.decode(reader, reader.uint32()); + break; + case 8: + message.proofSpecs.push(ProofSpec.decode(reader, reader.uint32())); + break; + case 9: + message.upgradePath.push(reader.string()); + break; + case 10: + message.allowUpdateAfterExpiry = reader.bool(); + break; + case 11: + message.allowUpdateAfterMisbehaviour = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ClientState { + const message = { ...baseClientState } as ClientState; + message.proofSpecs = []; + message.upgradePath = []; + if (object.chainId !== undefined && object.chainId !== null) { + message.chainId = String(object.chainId); + } else { + message.chainId = ""; + } + if (object.trustLevel !== undefined && object.trustLevel !== null) { + message.trustLevel = Fraction.fromJSON(object.trustLevel); + } else { + message.trustLevel = undefined; + } + if (object.trustingPeriod !== undefined && object.trustingPeriod !== null) { + message.trustingPeriod = Duration.fromJSON(object.trustingPeriod); + } else { + message.trustingPeriod = undefined; + } + if (object.unbondingPeriod !== undefined && object.unbondingPeriod !== null) { + message.unbondingPeriod = Duration.fromJSON(object.unbondingPeriod); + } else { + message.unbondingPeriod = undefined; + } + if (object.maxClockDrift !== undefined && object.maxClockDrift !== null) { + message.maxClockDrift = Duration.fromJSON(object.maxClockDrift); + } else { + message.maxClockDrift = undefined; + } + if (object.frozenHeight !== undefined && object.frozenHeight !== null) { + message.frozenHeight = Height.fromJSON(object.frozenHeight); + } else { + message.frozenHeight = undefined; + } + if (object.latestHeight !== undefined && object.latestHeight !== null) { + message.latestHeight = Height.fromJSON(object.latestHeight); + } else { + message.latestHeight = undefined; + } + if (object.proofSpecs !== undefined && object.proofSpecs !== null) { + for (const e of object.proofSpecs) { + message.proofSpecs.push(ProofSpec.fromJSON(e)); + } + } + if (object.upgradePath !== undefined && object.upgradePath !== null) { + for (const e of object.upgradePath) { + message.upgradePath.push(String(e)); + } + } + if (object.allowUpdateAfterExpiry !== undefined && object.allowUpdateAfterExpiry !== null) { + message.allowUpdateAfterExpiry = Boolean(object.allowUpdateAfterExpiry); + } else { + message.allowUpdateAfterExpiry = false; + } + if (object.allowUpdateAfterMisbehaviour !== undefined && object.allowUpdateAfterMisbehaviour !== null) { + message.allowUpdateAfterMisbehaviour = Boolean(object.allowUpdateAfterMisbehaviour); + } else { + message.allowUpdateAfterMisbehaviour = false; + } + return message; + }, + + toJSON(message: ClientState): unknown { + const obj: any = {}; + message.chainId !== undefined && (obj.chainId = message.chainId); + message.trustLevel !== undefined && + (obj.trustLevel = message.trustLevel ? Fraction.toJSON(message.trustLevel) : undefined); + message.trustingPeriod !== undefined && + (obj.trustingPeriod = message.trustingPeriod ? Duration.toJSON(message.trustingPeriod) : undefined); + message.unbondingPeriod !== undefined && + (obj.unbondingPeriod = message.unbondingPeriod ? Duration.toJSON(message.unbondingPeriod) : undefined); + message.maxClockDrift !== undefined && + (obj.maxClockDrift = message.maxClockDrift ? Duration.toJSON(message.maxClockDrift) : undefined); + message.frozenHeight !== undefined && + (obj.frozenHeight = message.frozenHeight ? Height.toJSON(message.frozenHeight) : undefined); + message.latestHeight !== undefined && + (obj.latestHeight = message.latestHeight ? Height.toJSON(message.latestHeight) : undefined); + if (message.proofSpecs) { + obj.proofSpecs = message.proofSpecs.map((e) => (e ? ProofSpec.toJSON(e) : undefined)); + } else { + obj.proofSpecs = []; + } + if (message.upgradePath) { + obj.upgradePath = message.upgradePath.map((e) => e); + } else { + obj.upgradePath = []; + } + message.allowUpdateAfterExpiry !== undefined && + (obj.allowUpdateAfterExpiry = message.allowUpdateAfterExpiry); + message.allowUpdateAfterMisbehaviour !== undefined && + (obj.allowUpdateAfterMisbehaviour = message.allowUpdateAfterMisbehaviour); + return obj; + }, + + fromPartial(object: DeepPartial): ClientState { + const message = { ...baseClientState } as ClientState; + message.proofSpecs = []; + message.upgradePath = []; + if (object.chainId !== undefined && object.chainId !== null) { + message.chainId = object.chainId; + } else { + message.chainId = ""; + } + if (object.trustLevel !== undefined && object.trustLevel !== null) { + message.trustLevel = Fraction.fromPartial(object.trustLevel); + } else { + message.trustLevel = undefined; + } + if (object.trustingPeriod !== undefined && object.trustingPeriod !== null) { + message.trustingPeriod = Duration.fromPartial(object.trustingPeriod); + } else { + message.trustingPeriod = undefined; + } + if (object.unbondingPeriod !== undefined && object.unbondingPeriod !== null) { + message.unbondingPeriod = Duration.fromPartial(object.unbondingPeriod); + } else { + message.unbondingPeriod = undefined; + } + if (object.maxClockDrift !== undefined && object.maxClockDrift !== null) { + message.maxClockDrift = Duration.fromPartial(object.maxClockDrift); + } else { + message.maxClockDrift = undefined; + } + if (object.frozenHeight !== undefined && object.frozenHeight !== null) { + message.frozenHeight = Height.fromPartial(object.frozenHeight); + } else { + message.frozenHeight = undefined; + } + if (object.latestHeight !== undefined && object.latestHeight !== null) { + message.latestHeight = Height.fromPartial(object.latestHeight); + } else { + message.latestHeight = undefined; + } + if (object.proofSpecs !== undefined && object.proofSpecs !== null) { + for (const e of object.proofSpecs) { + message.proofSpecs.push(ProofSpec.fromPartial(e)); + } + } + if (object.upgradePath !== undefined && object.upgradePath !== null) { + for (const e of object.upgradePath) { + message.upgradePath.push(e); + } + } + if (object.allowUpdateAfterExpiry !== undefined && object.allowUpdateAfterExpiry !== null) { + message.allowUpdateAfterExpiry = object.allowUpdateAfterExpiry; + } else { + message.allowUpdateAfterExpiry = false; + } + if (object.allowUpdateAfterMisbehaviour !== undefined && object.allowUpdateAfterMisbehaviour !== null) { + message.allowUpdateAfterMisbehaviour = object.allowUpdateAfterMisbehaviour; + } else { + message.allowUpdateAfterMisbehaviour = false; + } + return message; + }, +}; + +const baseConsensusState: object = {}; + +export const ConsensusState = { + encode(message: ConsensusState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(10).fork()).ldelim(); + } + if (message.root !== undefined) { + MerkleRoot.encode(message.root, writer.uint32(18).fork()).ldelim(); + } + if (message.nextValidatorsHash.length !== 0) { + writer.uint32(26).bytes(message.nextValidatorsHash); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ConsensusState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseConsensusState } as ConsensusState; + message.nextValidatorsHash = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 2: + message.root = MerkleRoot.decode(reader, reader.uint32()); + break; + case 3: + message.nextValidatorsHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ConsensusState { + const message = { ...baseConsensusState } as ConsensusState; + message.nextValidatorsHash = new Uint8Array(); + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromJsonTimestamp(object.timestamp); + } else { + message.timestamp = undefined; + } + if (object.root !== undefined && object.root !== null) { + message.root = MerkleRoot.fromJSON(object.root); + } else { + message.root = undefined; + } + if (object.nextValidatorsHash !== undefined && object.nextValidatorsHash !== null) { + message.nextValidatorsHash = bytesFromBase64(object.nextValidatorsHash); + } + return message; + }, + + toJSON(message: ConsensusState): unknown { + const obj: any = {}; + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); + message.root !== undefined && (obj.root = message.root ? MerkleRoot.toJSON(message.root) : undefined); + message.nextValidatorsHash !== undefined && + (obj.nextValidatorsHash = base64FromBytes( + message.nextValidatorsHash !== undefined ? message.nextValidatorsHash : new Uint8Array(), + )); + return obj; + }, + + fromPartial(object: DeepPartial): ConsensusState { + const message = { ...baseConsensusState } as ConsensusState; + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = object.timestamp; + } else { + message.timestamp = undefined; + } + if (object.root !== undefined && object.root !== null) { + message.root = MerkleRoot.fromPartial(object.root); + } else { + message.root = undefined; + } + if (object.nextValidatorsHash !== undefined && object.nextValidatorsHash !== null) { + message.nextValidatorsHash = object.nextValidatorsHash; + } else { + message.nextValidatorsHash = new Uint8Array(); + } + return message; + }, +}; + +const baseMisbehaviour: object = { clientId: "" }; + +export const Misbehaviour = { + encode(message: Misbehaviour, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.header1 !== undefined) { + Header.encode(message.header1, writer.uint32(18).fork()).ldelim(); + } + if (message.header2 !== undefined) { + Header.encode(message.header2, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Misbehaviour { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMisbehaviour } as Misbehaviour; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.header1 = Header.decode(reader, reader.uint32()); + break; + case 3: + message.header2 = Header.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Misbehaviour { + const message = { ...baseMisbehaviour } as Misbehaviour; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = String(object.clientId); + } else { + message.clientId = ""; + } + if (object.header1 !== undefined && object.header1 !== null) { + message.header1 = Header.fromJSON(object.header1); + } else { + message.header1 = undefined; + } + if (object.header2 !== undefined && object.header2 !== null) { + message.header2 = Header.fromJSON(object.header2); + } else { + message.header2 = undefined; + } + return message; + }, + + toJSON(message: Misbehaviour): unknown { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.header1 !== undefined && + (obj.header1 = message.header1 ? Header.toJSON(message.header1) : undefined); + message.header2 !== undefined && + (obj.header2 = message.header2 ? Header.toJSON(message.header2) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): Misbehaviour { + const message = { ...baseMisbehaviour } as Misbehaviour; + if (object.clientId !== undefined && object.clientId !== null) { + message.clientId = object.clientId; + } else { + message.clientId = ""; + } + if (object.header1 !== undefined && object.header1 !== null) { + message.header1 = Header.fromPartial(object.header1); + } else { + message.header1 = undefined; + } + if (object.header2 !== undefined && object.header2 !== null) { + message.header2 = Header.fromPartial(object.header2); + } else { + message.header2 = undefined; + } + return message; + }, +}; + +const baseHeader: object = {}; + +export const Header = { + encode(message: Header, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.signedHeader !== undefined) { + SignedHeader.encode(message.signedHeader, writer.uint32(10).fork()).ldelim(); + } + if (message.validatorSet !== undefined) { + ValidatorSet.encode(message.validatorSet, writer.uint32(18).fork()).ldelim(); + } + if (message.trustedHeight !== undefined) { + Height.encode(message.trustedHeight, writer.uint32(26).fork()).ldelim(); + } + if (message.trustedValidators !== undefined) { + ValidatorSet.encode(message.trustedValidators, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Header { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHeader } as Header; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signedHeader = SignedHeader.decode(reader, reader.uint32()); + break; + case 2: + message.validatorSet = ValidatorSet.decode(reader, reader.uint32()); + break; + case 3: + message.trustedHeight = Height.decode(reader, reader.uint32()); + break; + case 4: + message.trustedValidators = ValidatorSet.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Header { + const message = { ...baseHeader } as Header; + if (object.signedHeader !== undefined && object.signedHeader !== null) { + message.signedHeader = SignedHeader.fromJSON(object.signedHeader); + } else { + message.signedHeader = undefined; + } + if (object.validatorSet !== undefined && object.validatorSet !== null) { + message.validatorSet = ValidatorSet.fromJSON(object.validatorSet); + } else { + message.validatorSet = undefined; + } + if (object.trustedHeight !== undefined && object.trustedHeight !== null) { + message.trustedHeight = Height.fromJSON(object.trustedHeight); + } else { + message.trustedHeight = undefined; + } + if (object.trustedValidators !== undefined && object.trustedValidators !== null) { + message.trustedValidators = ValidatorSet.fromJSON(object.trustedValidators); + } else { + message.trustedValidators = undefined; + } + return message; + }, + + toJSON(message: Header): unknown { + const obj: any = {}; + message.signedHeader !== undefined && + (obj.signedHeader = message.signedHeader ? SignedHeader.toJSON(message.signedHeader) : undefined); + message.validatorSet !== undefined && + (obj.validatorSet = message.validatorSet ? ValidatorSet.toJSON(message.validatorSet) : undefined); + message.trustedHeight !== undefined && + (obj.trustedHeight = message.trustedHeight ? Height.toJSON(message.trustedHeight) : undefined); + message.trustedValidators !== undefined && + (obj.trustedValidators = message.trustedValidators + ? ValidatorSet.toJSON(message.trustedValidators) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial
): Header { + const message = { ...baseHeader } as Header; + if (object.signedHeader !== undefined && object.signedHeader !== null) { + message.signedHeader = SignedHeader.fromPartial(object.signedHeader); + } else { + message.signedHeader = undefined; + } + if (object.validatorSet !== undefined && object.validatorSet !== null) { + message.validatorSet = ValidatorSet.fromPartial(object.validatorSet); + } else { + message.validatorSet = undefined; + } + if (object.trustedHeight !== undefined && object.trustedHeight !== null) { + message.trustedHeight = Height.fromPartial(object.trustedHeight); + } else { + message.trustedHeight = undefined; + } + if (object.trustedValidators !== undefined && object.trustedValidators !== null) { + message.trustedValidators = ValidatorSet.fromPartial(object.trustedValidators); + } else { + message.trustedValidators = undefined; + } + return message; + }, +}; + +const baseFraction: object = { numerator: Long.UZERO, denominator: Long.UZERO }; + +export const Fraction = { + encode(message: Fraction, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.numerator.isZero()) { + writer.uint32(8).uint64(message.numerator); + } + if (!message.denominator.isZero()) { + writer.uint32(16).uint64(message.denominator); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Fraction { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseFraction } as Fraction; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.numerator = reader.uint64() as Long; + break; + case 2: + message.denominator = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Fraction { + const message = { ...baseFraction } as Fraction; + if (object.numerator !== undefined && object.numerator !== null) { + message.numerator = Long.fromString(object.numerator); + } else { + message.numerator = Long.UZERO; + } + if (object.denominator !== undefined && object.denominator !== null) { + message.denominator = Long.fromString(object.denominator); + } else { + message.denominator = Long.UZERO; + } + return message; + }, + + toJSON(message: Fraction): unknown { + const obj: any = {}; + message.numerator !== undefined && (obj.numerator = (message.numerator || Long.UZERO).toString()); + message.denominator !== undefined && (obj.denominator = (message.denominator || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): Fraction { + const message = { ...baseFraction } as Fraction; + if (object.numerator !== undefined && object.numerator !== null) { + message.numerator = object.numerator as Long; + } else { + message.numerator = Long.UZERO; + } + if (object.denominator !== undefined && object.denominator !== null) { + message.denominator = object.denominator as Long; + } else { + message.denominator = Long.UZERO; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function toTimestamp(date: Date): Timestamp { + const seconds = numberToLong(date.getTime() / 1_000); + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds.toNumber() * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function numberToLong(number: number) { + return Long.fromNumber(number); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/tendermint/abci/types.ts b/src/tendermint/abci/types.ts new file mode 100644 index 00000000..b785c0b0 --- /dev/null +++ b/src/tendermint/abci/types.ts @@ -0,0 +1,5114 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Header } from "../../tendermint/types/types"; +import { ProofOps } from "../../tendermint/crypto/proof"; +import { EvidenceParams, ValidatorParams, VersionParams } from "../../tendermint/types/params"; +import { PublicKey } from "../../tendermint/crypto/keys"; +import { Timestamp } from "../../google/protobuf/timestamp"; + +export const protobufPackage = "tendermint.abci"; + +export enum CheckTxType { + NEW = 0, + RECHECK = 1, + UNRECOGNIZED = -1, +} + +export function checkTxTypeFromJSON(object: any): CheckTxType { + switch (object) { + case 0: + case "NEW": + return CheckTxType.NEW; + case 1: + case "RECHECK": + return CheckTxType.RECHECK; + case -1: + case "UNRECOGNIZED": + default: + return CheckTxType.UNRECOGNIZED; + } +} + +export function checkTxTypeToJSON(object: CheckTxType): string { + switch (object) { + case CheckTxType.NEW: + return "NEW"; + case CheckTxType.RECHECK: + return "RECHECK"; + default: + return "UNKNOWN"; + } +} + +export enum EvidenceType { + UNKNOWN = 0, + DUPLICATE_VOTE = 1, + LIGHT_CLIENT_ATTACK = 2, + UNRECOGNIZED = -1, +} + +export function evidenceTypeFromJSON(object: any): EvidenceType { + switch (object) { + case 0: + case "UNKNOWN": + return EvidenceType.UNKNOWN; + case 1: + case "DUPLICATE_VOTE": + return EvidenceType.DUPLICATE_VOTE; + case 2: + case "LIGHT_CLIENT_ATTACK": + return EvidenceType.LIGHT_CLIENT_ATTACK; + case -1: + case "UNRECOGNIZED": + default: + return EvidenceType.UNRECOGNIZED; + } +} + +export function evidenceTypeToJSON(object: EvidenceType): string { + switch (object) { + case EvidenceType.UNKNOWN: + return "UNKNOWN"; + case EvidenceType.DUPLICATE_VOTE: + return "DUPLICATE_VOTE"; + case EvidenceType.LIGHT_CLIENT_ATTACK: + return "LIGHT_CLIENT_ATTACK"; + default: + return "UNKNOWN"; + } +} + +export interface Request { + echo?: RequestEcho | undefined; + flush?: RequestFlush | undefined; + info?: RequestInfo | undefined; + setOption?: RequestSetOption | undefined; + initChain?: RequestInitChain | undefined; + query?: RequestQuery | undefined; + beginBlock?: RequestBeginBlock | undefined; + checkTx?: RequestCheckTx | undefined; + deliverTx?: RequestDeliverTx | undefined; + endBlock?: RequestEndBlock | undefined; + commit?: RequestCommit | undefined; + listSnapshots?: RequestListSnapshots | undefined; + offerSnapshot?: RequestOfferSnapshot | undefined; + loadSnapshotChunk?: RequestLoadSnapshotChunk | undefined; + applySnapshotChunk?: RequestApplySnapshotChunk | undefined; +} + +export interface RequestEcho { + message: string; +} + +export interface RequestFlush {} + +export interface RequestInfo { + version: string; + blockVersion: Long; + p2pVersion: Long; +} + +/** nondeterministic */ +export interface RequestSetOption { + key: string; + value: string; +} + +export interface RequestInitChain { + time?: Date; + chainId: string; + consensusParams?: ConsensusParams; + validators: ValidatorUpdate[]; + appStateBytes: Uint8Array; + initialHeight: Long; +} + +export interface RequestQuery { + data: Uint8Array; + path: string; + height: Long; + prove: boolean; +} + +export interface RequestBeginBlock { + hash: Uint8Array; + header?: Header; + lastCommitInfo?: LastCommitInfo; + byzantineValidators: Evidence[]; +} + +export interface RequestCheckTx { + tx: Uint8Array; + type: CheckTxType; +} + +export interface RequestDeliverTx { + tx: Uint8Array; +} + +export interface RequestEndBlock { + height: Long; +} + +export interface RequestCommit {} + +/** lists available snapshots */ +export interface RequestListSnapshots {} + +/** offers a snapshot to the application */ +export interface RequestOfferSnapshot { + /** snapshot offered by peers */ + snapshot?: Snapshot; + /** light client-verified app hash for snapshot height */ + appHash: Uint8Array; +} + +/** loads a snapshot chunk */ +export interface RequestLoadSnapshotChunk { + height: Long; + format: number; + chunk: number; +} + +/** Applies a snapshot chunk */ +export interface RequestApplySnapshotChunk { + index: number; + chunk: Uint8Array; + sender: string; +} + +export interface Response { + exception?: ResponseException | undefined; + echo?: ResponseEcho | undefined; + flush?: ResponseFlush | undefined; + info?: ResponseInfo | undefined; + setOption?: ResponseSetOption | undefined; + initChain?: ResponseInitChain | undefined; + query?: ResponseQuery | undefined; + beginBlock?: ResponseBeginBlock | undefined; + checkTx?: ResponseCheckTx | undefined; + deliverTx?: ResponseDeliverTx | undefined; + endBlock?: ResponseEndBlock | undefined; + commit?: ResponseCommit | undefined; + listSnapshots?: ResponseListSnapshots | undefined; + offerSnapshot?: ResponseOfferSnapshot | undefined; + loadSnapshotChunk?: ResponseLoadSnapshotChunk | undefined; + applySnapshotChunk?: ResponseApplySnapshotChunk | undefined; +} + +/** nondeterministic */ +export interface ResponseException { + error: string; +} + +export interface ResponseEcho { + message: string; +} + +export interface ResponseFlush {} + +export interface ResponseInfo { + data: string; + version: string; + appVersion: Long; + lastBlockHeight: Long; + lastBlockAppHash: Uint8Array; +} + +/** nondeterministic */ +export interface ResponseSetOption { + code: number; + /** bytes data = 2; */ + log: string; + info: string; +} + +export interface ResponseInitChain { + consensusParams?: ConsensusParams; + validators: ValidatorUpdate[]; + appHash: Uint8Array; +} + +export interface ResponseQuery { + code: number; + /** bytes data = 2; // use "value" instead. */ + log: string; + /** nondeterministic */ + info: string; + index: Long; + key: Uint8Array; + value: Uint8Array; + proofOps?: ProofOps; + height: Long; + codespace: string; +} + +export interface ResponseBeginBlock { + events: Event[]; +} + +export interface ResponseCheckTx { + code: number; + data: Uint8Array; + /** nondeterministic */ + log: string; + /** nondeterministic */ + info: string; + gasWanted: Long; + gasUsed: Long; + events: Event[]; + codespace: string; +} + +export interface ResponseDeliverTx { + code: number; + data: Uint8Array; + /** nondeterministic */ + log: string; + /** nondeterministic */ + info: string; + gasWanted: Long; + gasUsed: Long; + events: Event[]; + codespace: string; +} + +export interface ResponseEndBlock { + validatorUpdates: ValidatorUpdate[]; + consensusParamUpdates?: ConsensusParams; + events: Event[]; +} + +export interface ResponseCommit { + /** reserve 1 */ + data: Uint8Array; + retainHeight: Long; +} + +export interface ResponseListSnapshots { + snapshots: Snapshot[]; +} + +export interface ResponseOfferSnapshot { + result: ResponseOfferSnapshot_Result; +} + +export enum ResponseOfferSnapshot_Result { + /** UNKNOWN - Unknown result, abort all snapshot restoration */ + UNKNOWN = 0, + /** ACCEPT - Snapshot accepted, apply chunks */ + ACCEPT = 1, + /** ABORT - Abort all snapshot restoration */ + ABORT = 2, + /** REJECT - Reject this specific snapshot, try others */ + REJECT = 3, + /** REJECT_FORMAT - Reject all snapshots of this format, try others */ + REJECT_FORMAT = 4, + /** REJECT_SENDER - Reject all snapshots from the sender(s), try others */ + REJECT_SENDER = 5, + UNRECOGNIZED = -1, +} + +export function responseOfferSnapshot_ResultFromJSON(object: any): ResponseOfferSnapshot_Result { + switch (object) { + case 0: + case "UNKNOWN": + return ResponseOfferSnapshot_Result.UNKNOWN; + case 1: + case "ACCEPT": + return ResponseOfferSnapshot_Result.ACCEPT; + case 2: + case "ABORT": + return ResponseOfferSnapshot_Result.ABORT; + case 3: + case "REJECT": + return ResponseOfferSnapshot_Result.REJECT; + case 4: + case "REJECT_FORMAT": + return ResponseOfferSnapshot_Result.REJECT_FORMAT; + case 5: + case "REJECT_SENDER": + return ResponseOfferSnapshot_Result.REJECT_SENDER; + case -1: + case "UNRECOGNIZED": + default: + return ResponseOfferSnapshot_Result.UNRECOGNIZED; + } +} + +export function responseOfferSnapshot_ResultToJSON(object: ResponseOfferSnapshot_Result): string { + switch (object) { + case ResponseOfferSnapshot_Result.UNKNOWN: + return "UNKNOWN"; + case ResponseOfferSnapshot_Result.ACCEPT: + return "ACCEPT"; + case ResponseOfferSnapshot_Result.ABORT: + return "ABORT"; + case ResponseOfferSnapshot_Result.REJECT: + return "REJECT"; + case ResponseOfferSnapshot_Result.REJECT_FORMAT: + return "REJECT_FORMAT"; + case ResponseOfferSnapshot_Result.REJECT_SENDER: + return "REJECT_SENDER"; + default: + return "UNKNOWN"; + } +} + +export interface ResponseLoadSnapshotChunk { + chunk: Uint8Array; +} + +export interface ResponseApplySnapshotChunk { + result: ResponseApplySnapshotChunk_Result; + /** Chunks to refetch and reapply */ + refetchChunks: number[]; + /** Chunk senders to reject and ban */ + rejectSenders: string[]; +} + +export enum ResponseApplySnapshotChunk_Result { + /** UNKNOWN - Unknown result, abort all snapshot restoration */ + UNKNOWN = 0, + /** ACCEPT - Chunk successfully accepted */ + ACCEPT = 1, + /** ABORT - Abort all snapshot restoration */ + ABORT = 2, + /** RETRY - Retry chunk (combine with refetch and reject) */ + RETRY = 3, + /** RETRY_SNAPSHOT - Retry snapshot (combine with refetch and reject) */ + RETRY_SNAPSHOT = 4, + /** REJECT_SNAPSHOT - Reject this snapshot, try others */ + REJECT_SNAPSHOT = 5, + UNRECOGNIZED = -1, +} + +export function responseApplySnapshotChunk_ResultFromJSON(object: any): ResponseApplySnapshotChunk_Result { + switch (object) { + case 0: + case "UNKNOWN": + return ResponseApplySnapshotChunk_Result.UNKNOWN; + case 1: + case "ACCEPT": + return ResponseApplySnapshotChunk_Result.ACCEPT; + case 2: + case "ABORT": + return ResponseApplySnapshotChunk_Result.ABORT; + case 3: + case "RETRY": + return ResponseApplySnapshotChunk_Result.RETRY; + case 4: + case "RETRY_SNAPSHOT": + return ResponseApplySnapshotChunk_Result.RETRY_SNAPSHOT; + case 5: + case "REJECT_SNAPSHOT": + return ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT; + case -1: + case "UNRECOGNIZED": + default: + return ResponseApplySnapshotChunk_Result.UNRECOGNIZED; + } +} + +export function responseApplySnapshotChunk_ResultToJSON(object: ResponseApplySnapshotChunk_Result): string { + switch (object) { + case ResponseApplySnapshotChunk_Result.UNKNOWN: + return "UNKNOWN"; + case ResponseApplySnapshotChunk_Result.ACCEPT: + return "ACCEPT"; + case ResponseApplySnapshotChunk_Result.ABORT: + return "ABORT"; + case ResponseApplySnapshotChunk_Result.RETRY: + return "RETRY"; + case ResponseApplySnapshotChunk_Result.RETRY_SNAPSHOT: + return "RETRY_SNAPSHOT"; + case ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT: + return "REJECT_SNAPSHOT"; + default: + return "UNKNOWN"; + } +} + +/** + * ConsensusParams contains all consensus-relevant parameters + * that can be adjusted by the abci app + */ +export interface ConsensusParams { + block?: BlockParams; + evidence?: EvidenceParams; + validator?: ValidatorParams; + version?: VersionParams; +} + +/** BlockParams contains limits on the block size. */ +export interface BlockParams { + /** Note: must be greater than 0 */ + maxBytes: Long; + /** Note: must be greater or equal to -1 */ + maxGas: Long; +} + +export interface LastCommitInfo { + round: number; + votes: VoteInfo[]; +} + +/** + * Event allows application developers to attach additional information to + * ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. + * Later, transactions may be queried using these events. + */ +export interface Event { + type: string; + attributes: EventAttribute[]; +} + +/** EventAttribute is a single key-value pair, associated with an event. */ +export interface EventAttribute { + key: Uint8Array; + value: Uint8Array; + /** nondeterministic */ + index: boolean; +} + +/** + * TxResult contains results of executing the transaction. + * + * One usage is indexing transaction results. + */ +export interface TxResult { + height: Long; + index: number; + tx: Uint8Array; + result?: ResponseDeliverTx; +} + +/** Validator */ +export interface Validator { + /** The first 20 bytes of SHA256(public key) */ + address: Uint8Array; + /** PubKey pub_key = 2 [(gogoproto.nullable)=false]; */ + power: Long; +} + +/** ValidatorUpdate */ +export interface ValidatorUpdate { + pubKey?: PublicKey; + power: Long; +} + +/** VoteInfo */ +export interface VoteInfo { + validator?: Validator; + signedLastBlock: boolean; +} + +export interface Evidence { + type: EvidenceType; + /** The offending validator */ + validator?: Validator; + /** The height when the offense occurred */ + height: Long; + /** The corresponding time where the offense occurred */ + time?: Date; + /** + * Total voting power of the validator set in case the ABCI application does + * not store historical validators. + * https://github.com/tendermint/tendermint/issues/4581 + */ + totalVotingPower: Long; +} + +export interface Snapshot { + /** The height at which the snapshot was taken */ + height: Long; + /** The application-specific snapshot format */ + format: number; + /** Number of chunks in the snapshot */ + chunks: number; + /** Arbitrary snapshot hash, equal only if identical */ + hash: Uint8Array; + /** Arbitrary application metadata */ + metadata: Uint8Array; +} + +const baseRequest: object = {}; + +export const Request = { + encode(message: Request, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.echo !== undefined) { + RequestEcho.encode(message.echo, writer.uint32(10).fork()).ldelim(); + } + if (message.flush !== undefined) { + RequestFlush.encode(message.flush, writer.uint32(18).fork()).ldelim(); + } + if (message.info !== undefined) { + RequestInfo.encode(message.info, writer.uint32(26).fork()).ldelim(); + } + if (message.setOption !== undefined) { + RequestSetOption.encode(message.setOption, writer.uint32(34).fork()).ldelim(); + } + if (message.initChain !== undefined) { + RequestInitChain.encode(message.initChain, writer.uint32(42).fork()).ldelim(); + } + if (message.query !== undefined) { + RequestQuery.encode(message.query, writer.uint32(50).fork()).ldelim(); + } + if (message.beginBlock !== undefined) { + RequestBeginBlock.encode(message.beginBlock, writer.uint32(58).fork()).ldelim(); + } + if (message.checkTx !== undefined) { + RequestCheckTx.encode(message.checkTx, writer.uint32(66).fork()).ldelim(); + } + if (message.deliverTx !== undefined) { + RequestDeliverTx.encode(message.deliverTx, writer.uint32(74).fork()).ldelim(); + } + if (message.endBlock !== undefined) { + RequestEndBlock.encode(message.endBlock, writer.uint32(82).fork()).ldelim(); + } + if (message.commit !== undefined) { + RequestCommit.encode(message.commit, writer.uint32(90).fork()).ldelim(); + } + if (message.listSnapshots !== undefined) { + RequestListSnapshots.encode(message.listSnapshots, writer.uint32(98).fork()).ldelim(); + } + if (message.offerSnapshot !== undefined) { + RequestOfferSnapshot.encode(message.offerSnapshot, writer.uint32(106).fork()).ldelim(); + } + if (message.loadSnapshotChunk !== undefined) { + RequestLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(114).fork()).ldelim(); + } + if (message.applySnapshotChunk !== undefined) { + RequestApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(122).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Request { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRequest } as Request; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.echo = RequestEcho.decode(reader, reader.uint32()); + break; + case 2: + message.flush = RequestFlush.decode(reader, reader.uint32()); + break; + case 3: + message.info = RequestInfo.decode(reader, reader.uint32()); + break; + case 4: + message.setOption = RequestSetOption.decode(reader, reader.uint32()); + break; + case 5: + message.initChain = RequestInitChain.decode(reader, reader.uint32()); + break; + case 6: + message.query = RequestQuery.decode(reader, reader.uint32()); + break; + case 7: + message.beginBlock = RequestBeginBlock.decode(reader, reader.uint32()); + break; + case 8: + message.checkTx = RequestCheckTx.decode(reader, reader.uint32()); + break; + case 9: + message.deliverTx = RequestDeliverTx.decode(reader, reader.uint32()); + break; + case 10: + message.endBlock = RequestEndBlock.decode(reader, reader.uint32()); + break; + case 11: + message.commit = RequestCommit.decode(reader, reader.uint32()); + break; + case 12: + message.listSnapshots = RequestListSnapshots.decode(reader, reader.uint32()); + break; + case 13: + message.offerSnapshot = RequestOfferSnapshot.decode(reader, reader.uint32()); + break; + case 14: + message.loadSnapshotChunk = RequestLoadSnapshotChunk.decode(reader, reader.uint32()); + break; + case 15: + message.applySnapshotChunk = RequestApplySnapshotChunk.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Request { + const message = { ...baseRequest } as Request; + if (object.echo !== undefined && object.echo !== null) { + message.echo = RequestEcho.fromJSON(object.echo); + } else { + message.echo = undefined; + } + if (object.flush !== undefined && object.flush !== null) { + message.flush = RequestFlush.fromJSON(object.flush); + } else { + message.flush = undefined; + } + if (object.info !== undefined && object.info !== null) { + message.info = RequestInfo.fromJSON(object.info); + } else { + message.info = undefined; + } + if (object.setOption !== undefined && object.setOption !== null) { + message.setOption = RequestSetOption.fromJSON(object.setOption); + } else { + message.setOption = undefined; + } + if (object.initChain !== undefined && object.initChain !== null) { + message.initChain = RequestInitChain.fromJSON(object.initChain); + } else { + message.initChain = undefined; + } + if (object.query !== undefined && object.query !== null) { + message.query = RequestQuery.fromJSON(object.query); + } else { + message.query = undefined; + } + if (object.beginBlock !== undefined && object.beginBlock !== null) { + message.beginBlock = RequestBeginBlock.fromJSON(object.beginBlock); + } else { + message.beginBlock = undefined; + } + if (object.checkTx !== undefined && object.checkTx !== null) { + message.checkTx = RequestCheckTx.fromJSON(object.checkTx); + } else { + message.checkTx = undefined; + } + if (object.deliverTx !== undefined && object.deliverTx !== null) { + message.deliverTx = RequestDeliverTx.fromJSON(object.deliverTx); + } else { + message.deliverTx = undefined; + } + if (object.endBlock !== undefined && object.endBlock !== null) { + message.endBlock = RequestEndBlock.fromJSON(object.endBlock); + } else { + message.endBlock = undefined; + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = RequestCommit.fromJSON(object.commit); + } else { + message.commit = undefined; + } + if (object.listSnapshots !== undefined && object.listSnapshots !== null) { + message.listSnapshots = RequestListSnapshots.fromJSON(object.listSnapshots); + } else { + message.listSnapshots = undefined; + } + if (object.offerSnapshot !== undefined && object.offerSnapshot !== null) { + message.offerSnapshot = RequestOfferSnapshot.fromJSON(object.offerSnapshot); + } else { + message.offerSnapshot = undefined; + } + if (object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null) { + message.loadSnapshotChunk = RequestLoadSnapshotChunk.fromJSON(object.loadSnapshotChunk); + } else { + message.loadSnapshotChunk = undefined; + } + if (object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null) { + message.applySnapshotChunk = RequestApplySnapshotChunk.fromJSON(object.applySnapshotChunk); + } else { + message.applySnapshotChunk = undefined; + } + return message; + }, + + toJSON(message: Request): unknown { + const obj: any = {}; + message.echo !== undefined && (obj.echo = message.echo ? RequestEcho.toJSON(message.echo) : undefined); + message.flush !== undefined && + (obj.flush = message.flush ? RequestFlush.toJSON(message.flush) : undefined); + message.info !== undefined && (obj.info = message.info ? RequestInfo.toJSON(message.info) : undefined); + message.setOption !== undefined && + (obj.setOption = message.setOption ? RequestSetOption.toJSON(message.setOption) : undefined); + message.initChain !== undefined && + (obj.initChain = message.initChain ? RequestInitChain.toJSON(message.initChain) : undefined); + message.query !== undefined && + (obj.query = message.query ? RequestQuery.toJSON(message.query) : undefined); + message.beginBlock !== undefined && + (obj.beginBlock = message.beginBlock ? RequestBeginBlock.toJSON(message.beginBlock) : undefined); + message.checkTx !== undefined && + (obj.checkTx = message.checkTx ? RequestCheckTx.toJSON(message.checkTx) : undefined); + message.deliverTx !== undefined && + (obj.deliverTx = message.deliverTx ? RequestDeliverTx.toJSON(message.deliverTx) : undefined); + message.endBlock !== undefined && + (obj.endBlock = message.endBlock ? RequestEndBlock.toJSON(message.endBlock) : undefined); + message.commit !== undefined && + (obj.commit = message.commit ? RequestCommit.toJSON(message.commit) : undefined); + message.listSnapshots !== undefined && + (obj.listSnapshots = message.listSnapshots + ? RequestListSnapshots.toJSON(message.listSnapshots) + : undefined); + message.offerSnapshot !== undefined && + (obj.offerSnapshot = message.offerSnapshot + ? RequestOfferSnapshot.toJSON(message.offerSnapshot) + : undefined); + message.loadSnapshotChunk !== undefined && + (obj.loadSnapshotChunk = message.loadSnapshotChunk + ? RequestLoadSnapshotChunk.toJSON(message.loadSnapshotChunk) + : undefined); + message.applySnapshotChunk !== undefined && + (obj.applySnapshotChunk = message.applySnapshotChunk + ? RequestApplySnapshotChunk.toJSON(message.applySnapshotChunk) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): Request { + const message = { ...baseRequest } as Request; + if (object.echo !== undefined && object.echo !== null) { + message.echo = RequestEcho.fromPartial(object.echo); + } else { + message.echo = undefined; + } + if (object.flush !== undefined && object.flush !== null) { + message.flush = RequestFlush.fromPartial(object.flush); + } else { + message.flush = undefined; + } + if (object.info !== undefined && object.info !== null) { + message.info = RequestInfo.fromPartial(object.info); + } else { + message.info = undefined; + } + if (object.setOption !== undefined && object.setOption !== null) { + message.setOption = RequestSetOption.fromPartial(object.setOption); + } else { + message.setOption = undefined; + } + if (object.initChain !== undefined && object.initChain !== null) { + message.initChain = RequestInitChain.fromPartial(object.initChain); + } else { + message.initChain = undefined; + } + if (object.query !== undefined && object.query !== null) { + message.query = RequestQuery.fromPartial(object.query); + } else { + message.query = undefined; + } + if (object.beginBlock !== undefined && object.beginBlock !== null) { + message.beginBlock = RequestBeginBlock.fromPartial(object.beginBlock); + } else { + message.beginBlock = undefined; + } + if (object.checkTx !== undefined && object.checkTx !== null) { + message.checkTx = RequestCheckTx.fromPartial(object.checkTx); + } else { + message.checkTx = undefined; + } + if (object.deliverTx !== undefined && object.deliverTx !== null) { + message.deliverTx = RequestDeliverTx.fromPartial(object.deliverTx); + } else { + message.deliverTx = undefined; + } + if (object.endBlock !== undefined && object.endBlock !== null) { + message.endBlock = RequestEndBlock.fromPartial(object.endBlock); + } else { + message.endBlock = undefined; + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = RequestCommit.fromPartial(object.commit); + } else { + message.commit = undefined; + } + if (object.listSnapshots !== undefined && object.listSnapshots !== null) { + message.listSnapshots = RequestListSnapshots.fromPartial(object.listSnapshots); + } else { + message.listSnapshots = undefined; + } + if (object.offerSnapshot !== undefined && object.offerSnapshot !== null) { + message.offerSnapshot = RequestOfferSnapshot.fromPartial(object.offerSnapshot); + } else { + message.offerSnapshot = undefined; + } + if (object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null) { + message.loadSnapshotChunk = RequestLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk); + } else { + message.loadSnapshotChunk = undefined; + } + if (object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null) { + message.applySnapshotChunk = RequestApplySnapshotChunk.fromPartial(object.applySnapshotChunk); + } else { + message.applySnapshotChunk = undefined; + } + return message; + }, +}; + +const baseRequestEcho: object = { message: "" }; + +export const RequestEcho = { + encode(message: RequestEcho, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.message !== "") { + writer.uint32(10).string(message.message); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestEcho { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRequestEcho } as RequestEcho; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RequestEcho { + const message = { ...baseRequestEcho } as RequestEcho; + if (object.message !== undefined && object.message !== null) { + message.message = String(object.message); + } else { + message.message = ""; + } + return message; + }, + + toJSON(message: RequestEcho): unknown { + const obj: any = {}; + message.message !== undefined && (obj.message = message.message); + return obj; + }, + + fromPartial(object: DeepPartial): RequestEcho { + const message = { ...baseRequestEcho } as RequestEcho; + if (object.message !== undefined && object.message !== null) { + message.message = object.message; + } else { + message.message = ""; + } + return message; + }, +}; + +const baseRequestFlush: object = {}; + +export const RequestFlush = { + encode(_: RequestFlush, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestFlush { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRequestFlush } as RequestFlush; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): RequestFlush { + const message = { ...baseRequestFlush } as RequestFlush; + return message; + }, + + toJSON(_: RequestFlush): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): RequestFlush { + const message = { ...baseRequestFlush } as RequestFlush; + return message; + }, +}; + +const baseRequestInfo: object = { version: "", blockVersion: Long.UZERO, p2pVersion: Long.UZERO }; + +export const RequestInfo = { + encode(message: RequestInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.version !== "") { + writer.uint32(10).string(message.version); + } + if (!message.blockVersion.isZero()) { + writer.uint32(16).uint64(message.blockVersion); + } + if (!message.p2pVersion.isZero()) { + writer.uint32(24).uint64(message.p2pVersion); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRequestInfo } as RequestInfo; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.string(); + break; + case 2: + message.blockVersion = reader.uint64() as Long; + break; + case 3: + message.p2pVersion = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RequestInfo { + const message = { ...baseRequestInfo } as RequestInfo; + if (object.version !== undefined && object.version !== null) { + message.version = String(object.version); + } else { + message.version = ""; + } + if (object.blockVersion !== undefined && object.blockVersion !== null) { + message.blockVersion = Long.fromString(object.blockVersion); + } else { + message.blockVersion = Long.UZERO; + } + if (object.p2pVersion !== undefined && object.p2pVersion !== null) { + message.p2pVersion = Long.fromString(object.p2pVersion); + } else { + message.p2pVersion = Long.UZERO; + } + return message; + }, + + toJSON(message: RequestInfo): unknown { + const obj: any = {}; + message.version !== undefined && (obj.version = message.version); + message.blockVersion !== undefined && + (obj.blockVersion = (message.blockVersion || Long.UZERO).toString()); + message.p2pVersion !== undefined && (obj.p2pVersion = (message.p2pVersion || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): RequestInfo { + const message = { ...baseRequestInfo } as RequestInfo; + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } else { + message.version = ""; + } + if (object.blockVersion !== undefined && object.blockVersion !== null) { + message.blockVersion = object.blockVersion as Long; + } else { + message.blockVersion = Long.UZERO; + } + if (object.p2pVersion !== undefined && object.p2pVersion !== null) { + message.p2pVersion = object.p2pVersion as Long; + } else { + message.p2pVersion = Long.UZERO; + } + return message; + }, +}; + +const baseRequestSetOption: object = { key: "", value: "" }; + +export const RequestSetOption = { + encode(message: RequestSetOption, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestSetOption { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRequestSetOption } as RequestSetOption; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RequestSetOption { + const message = { ...baseRequestSetOption } as RequestSetOption; + if (object.key !== undefined && object.key !== null) { + message.key = String(object.key); + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = String(object.value); + } else { + message.value = ""; + } + return message; + }, + + toJSON(message: RequestSetOption): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + fromPartial(object: DeepPartial): RequestSetOption { + const message = { ...baseRequestSetOption } as RequestSetOption; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = ""; + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } else { + message.value = ""; + } + return message; + }, +}; + +const baseRequestInitChain: object = { chainId: "", initialHeight: Long.ZERO }; + +export const RequestInitChain = { + encode(message: RequestInitChain, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(10).fork()).ldelim(); + } + if (message.chainId !== "") { + writer.uint32(18).string(message.chainId); + } + if (message.consensusParams !== undefined) { + ConsensusParams.encode(message.consensusParams, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.validators) { + ValidatorUpdate.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.appStateBytes.length !== 0) { + writer.uint32(42).bytes(message.appStateBytes); + } + if (!message.initialHeight.isZero()) { + writer.uint32(48).int64(message.initialHeight); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestInitChain { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRequestInitChain } as RequestInitChain; + message.validators = []; + message.appStateBytes = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 2: + message.chainId = reader.string(); + break; + case 3: + message.consensusParams = ConsensusParams.decode(reader, reader.uint32()); + break; + case 4: + message.validators.push(ValidatorUpdate.decode(reader, reader.uint32())); + break; + case 5: + message.appStateBytes = reader.bytes(); + break; + case 6: + message.initialHeight = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RequestInitChain { + const message = { ...baseRequestInitChain } as RequestInitChain; + message.validators = []; + message.appStateBytes = new Uint8Array(); + if (object.time !== undefined && object.time !== null) { + message.time = fromJsonTimestamp(object.time); + } else { + message.time = undefined; + } + if (object.chainId !== undefined && object.chainId !== null) { + message.chainId = String(object.chainId); + } else { + message.chainId = ""; + } + if (object.consensusParams !== undefined && object.consensusParams !== null) { + message.consensusParams = ConsensusParams.fromJSON(object.consensusParams); + } else { + message.consensusParams = undefined; + } + if (object.validators !== undefined && object.validators !== null) { + for (const e of object.validators) { + message.validators.push(ValidatorUpdate.fromJSON(e)); + } + } + if (object.appStateBytes !== undefined && object.appStateBytes !== null) { + message.appStateBytes = bytesFromBase64(object.appStateBytes); + } + if (object.initialHeight !== undefined && object.initialHeight !== null) { + message.initialHeight = Long.fromString(object.initialHeight); + } else { + message.initialHeight = Long.ZERO; + } + return message; + }, + + toJSON(message: RequestInitChain): unknown { + const obj: any = {}; + message.time !== undefined && (obj.time = message.time.toISOString()); + message.chainId !== undefined && (obj.chainId = message.chainId); + message.consensusParams !== undefined && + (obj.consensusParams = message.consensusParams + ? ConsensusParams.toJSON(message.consensusParams) + : undefined); + if (message.validators) { + obj.validators = message.validators.map((e) => (e ? ValidatorUpdate.toJSON(e) : undefined)); + } else { + obj.validators = []; + } + message.appStateBytes !== undefined && + (obj.appStateBytes = base64FromBytes( + message.appStateBytes !== undefined ? message.appStateBytes : new Uint8Array(), + )); + message.initialHeight !== undefined && + (obj.initialHeight = (message.initialHeight || Long.ZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): RequestInitChain { + const message = { ...baseRequestInitChain } as RequestInitChain; + message.validators = []; + if (object.time !== undefined && object.time !== null) { + message.time = object.time; + } else { + message.time = undefined; + } + if (object.chainId !== undefined && object.chainId !== null) { + message.chainId = object.chainId; + } else { + message.chainId = ""; + } + if (object.consensusParams !== undefined && object.consensusParams !== null) { + message.consensusParams = ConsensusParams.fromPartial(object.consensusParams); + } else { + message.consensusParams = undefined; + } + if (object.validators !== undefined && object.validators !== null) { + for (const e of object.validators) { + message.validators.push(ValidatorUpdate.fromPartial(e)); + } + } + if (object.appStateBytes !== undefined && object.appStateBytes !== null) { + message.appStateBytes = object.appStateBytes; + } else { + message.appStateBytes = new Uint8Array(); + } + if (object.initialHeight !== undefined && object.initialHeight !== null) { + message.initialHeight = object.initialHeight as Long; + } else { + message.initialHeight = Long.ZERO; + } + return message; + }, +}; + +const baseRequestQuery: object = { path: "", height: Long.ZERO, prove: false }; + +export const RequestQuery = { + encode(message: RequestQuery, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + if (message.path !== "") { + writer.uint32(18).string(message.path); + } + if (!message.height.isZero()) { + writer.uint32(24).int64(message.height); + } + if (message.prove === true) { + writer.uint32(32).bool(message.prove); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestQuery { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRequestQuery } as RequestQuery; + message.data = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + case 2: + message.path = reader.string(); + break; + case 3: + message.height = reader.int64() as Long; + break; + case 4: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RequestQuery { + const message = { ...baseRequestQuery } as RequestQuery; + message.data = new Uint8Array(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.path !== undefined && object.path !== null) { + message.path = String(object.path); + } else { + message.path = ""; + } + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.ZERO; + } + if (object.prove !== undefined && object.prove !== null) { + message.prove = Boolean(object.prove); + } else { + message.prove = false; + } + return message; + }, + + toJSON(message: RequestQuery): unknown { + const obj: any = {}; + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.path !== undefined && (obj.path = message.path); + message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.prove !== undefined && (obj.prove = message.prove); + return obj; + }, + + fromPartial(object: DeepPartial): RequestQuery { + const message = { ...baseRequestQuery } as RequestQuery; + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } else { + message.path = ""; + } + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.ZERO; + } + if (object.prove !== undefined && object.prove !== null) { + message.prove = object.prove; + } else { + message.prove = false; + } + return message; + }, +}; + +const baseRequestBeginBlock: object = {}; + +export const RequestBeginBlock = { + encode(message: RequestBeginBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.hash.length !== 0) { + writer.uint32(10).bytes(message.hash); + } + if (message.header !== undefined) { + Header.encode(message.header, writer.uint32(18).fork()).ldelim(); + } + if (message.lastCommitInfo !== undefined) { + LastCommitInfo.encode(message.lastCommitInfo, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.byzantineValidators) { + Evidence.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestBeginBlock { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRequestBeginBlock } as RequestBeginBlock; + message.byzantineValidators = []; + message.hash = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.bytes(); + break; + case 2: + message.header = Header.decode(reader, reader.uint32()); + break; + case 3: + message.lastCommitInfo = LastCommitInfo.decode(reader, reader.uint32()); + break; + case 4: + message.byzantineValidators.push(Evidence.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RequestBeginBlock { + const message = { ...baseRequestBeginBlock } as RequestBeginBlock; + message.byzantineValidators = []; + message.hash = new Uint8Array(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromJSON(object.header); + } else { + message.header = undefined; + } + if (object.lastCommitInfo !== undefined && object.lastCommitInfo !== null) { + message.lastCommitInfo = LastCommitInfo.fromJSON(object.lastCommitInfo); + } else { + message.lastCommitInfo = undefined; + } + if (object.byzantineValidators !== undefined && object.byzantineValidators !== null) { + for (const e of object.byzantineValidators) { + message.byzantineValidators.push(Evidence.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: RequestBeginBlock): unknown { + const obj: any = {}; + message.hash !== undefined && + (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); + message.lastCommitInfo !== undefined && + (obj.lastCommitInfo = message.lastCommitInfo + ? LastCommitInfo.toJSON(message.lastCommitInfo) + : undefined); + if (message.byzantineValidators) { + obj.byzantineValidators = message.byzantineValidators.map((e) => (e ? Evidence.toJSON(e) : undefined)); + } else { + obj.byzantineValidators = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): RequestBeginBlock { + const message = { ...baseRequestBeginBlock } as RequestBeginBlock; + message.byzantineValidators = []; + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } else { + message.hash = new Uint8Array(); + } + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromPartial(object.header); + } else { + message.header = undefined; + } + if (object.lastCommitInfo !== undefined && object.lastCommitInfo !== null) { + message.lastCommitInfo = LastCommitInfo.fromPartial(object.lastCommitInfo); + } else { + message.lastCommitInfo = undefined; + } + if (object.byzantineValidators !== undefined && object.byzantineValidators !== null) { + for (const e of object.byzantineValidators) { + message.byzantineValidators.push(Evidence.fromPartial(e)); + } + } + return message; + }, +}; + +const baseRequestCheckTx: object = { type: 0 }; + +export const RequestCheckTx = { + encode(message: RequestCheckTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.tx.length !== 0) { + writer.uint32(10).bytes(message.tx); + } + if (message.type !== 0) { + writer.uint32(16).int32(message.type); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestCheckTx { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRequestCheckTx } as RequestCheckTx; + message.tx = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = reader.bytes(); + break; + case 2: + message.type = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RequestCheckTx { + const message = { ...baseRequestCheckTx } as RequestCheckTx; + message.tx = new Uint8Array(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = bytesFromBase64(object.tx); + } + if (object.type !== undefined && object.type !== null) { + message.type = checkTxTypeFromJSON(object.type); + } else { + message.type = 0; + } + return message; + }, + + toJSON(message: RequestCheckTx): unknown { + const obj: any = {}; + message.tx !== undefined && + (obj.tx = base64FromBytes(message.tx !== undefined ? message.tx : new Uint8Array())); + message.type !== undefined && (obj.type = checkTxTypeToJSON(message.type)); + return obj; + }, + + fromPartial(object: DeepPartial): RequestCheckTx { + const message = { ...baseRequestCheckTx } as RequestCheckTx; + if (object.tx !== undefined && object.tx !== null) { + message.tx = object.tx; + } else { + message.tx = new Uint8Array(); + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = 0; + } + return message; + }, +}; + +const baseRequestDeliverTx: object = {}; + +export const RequestDeliverTx = { + encode(message: RequestDeliverTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.tx.length !== 0) { + writer.uint32(10).bytes(message.tx); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestDeliverTx { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRequestDeliverTx } as RequestDeliverTx; + message.tx = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RequestDeliverTx { + const message = { ...baseRequestDeliverTx } as RequestDeliverTx; + message.tx = new Uint8Array(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = bytesFromBase64(object.tx); + } + return message; + }, + + toJSON(message: RequestDeliverTx): unknown { + const obj: any = {}; + message.tx !== undefined && + (obj.tx = base64FromBytes(message.tx !== undefined ? message.tx : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): RequestDeliverTx { + const message = { ...baseRequestDeliverTx } as RequestDeliverTx; + if (object.tx !== undefined && object.tx !== null) { + message.tx = object.tx; + } else { + message.tx = new Uint8Array(); + } + return message; + }, +}; + +const baseRequestEndBlock: object = { height: Long.ZERO }; + +export const RequestEndBlock = { + encode(message: RequestEndBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.height.isZero()) { + writer.uint32(8).int64(message.height); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestEndBlock { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRequestEndBlock } as RequestEndBlock; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RequestEndBlock { + const message = { ...baseRequestEndBlock } as RequestEndBlock; + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.ZERO; + } + return message; + }, + + toJSON(message: RequestEndBlock): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): RequestEndBlock { + const message = { ...baseRequestEndBlock } as RequestEndBlock; + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.ZERO; + } + return message; + }, +}; + +const baseRequestCommit: object = {}; + +export const RequestCommit = { + encode(_: RequestCommit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestCommit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRequestCommit } as RequestCommit; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): RequestCommit { + const message = { ...baseRequestCommit } as RequestCommit; + return message; + }, + + toJSON(_: RequestCommit): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): RequestCommit { + const message = { ...baseRequestCommit } as RequestCommit; + return message; + }, +}; + +const baseRequestListSnapshots: object = {}; + +export const RequestListSnapshots = { + encode(_: RequestListSnapshots, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestListSnapshots { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRequestListSnapshots } as RequestListSnapshots; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): RequestListSnapshots { + const message = { ...baseRequestListSnapshots } as RequestListSnapshots; + return message; + }, + + toJSON(_: RequestListSnapshots): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): RequestListSnapshots { + const message = { ...baseRequestListSnapshots } as RequestListSnapshots; + return message; + }, +}; + +const baseRequestOfferSnapshot: object = {}; + +export const RequestOfferSnapshot = { + encode(message: RequestOfferSnapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.snapshot !== undefined) { + Snapshot.encode(message.snapshot, writer.uint32(10).fork()).ldelim(); + } + if (message.appHash.length !== 0) { + writer.uint32(18).bytes(message.appHash); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestOfferSnapshot { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRequestOfferSnapshot } as RequestOfferSnapshot; + message.appHash = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.snapshot = Snapshot.decode(reader, reader.uint32()); + break; + case 2: + message.appHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RequestOfferSnapshot { + const message = { ...baseRequestOfferSnapshot } as RequestOfferSnapshot; + message.appHash = new Uint8Array(); + if (object.snapshot !== undefined && object.snapshot !== null) { + message.snapshot = Snapshot.fromJSON(object.snapshot); + } else { + message.snapshot = undefined; + } + if (object.appHash !== undefined && object.appHash !== null) { + message.appHash = bytesFromBase64(object.appHash); + } + return message; + }, + + toJSON(message: RequestOfferSnapshot): unknown { + const obj: any = {}; + message.snapshot !== undefined && + (obj.snapshot = message.snapshot ? Snapshot.toJSON(message.snapshot) : undefined); + message.appHash !== undefined && + (obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): RequestOfferSnapshot { + const message = { ...baseRequestOfferSnapshot } as RequestOfferSnapshot; + if (object.snapshot !== undefined && object.snapshot !== null) { + message.snapshot = Snapshot.fromPartial(object.snapshot); + } else { + message.snapshot = undefined; + } + if (object.appHash !== undefined && object.appHash !== null) { + message.appHash = object.appHash; + } else { + message.appHash = new Uint8Array(); + } + return message; + }, +}; + +const baseRequestLoadSnapshotChunk: object = { height: Long.UZERO, format: 0, chunk: 0 }; + +export const RequestLoadSnapshotChunk = { + encode(message: RequestLoadSnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.height.isZero()) { + writer.uint32(8).uint64(message.height); + } + if (message.format !== 0) { + writer.uint32(16).uint32(message.format); + } + if (message.chunk !== 0) { + writer.uint32(24).uint32(message.chunk); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestLoadSnapshotChunk { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRequestLoadSnapshotChunk } as RequestLoadSnapshotChunk; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.uint64() as Long; + break; + case 2: + message.format = reader.uint32(); + break; + case 3: + message.chunk = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RequestLoadSnapshotChunk { + const message = { ...baseRequestLoadSnapshotChunk } as RequestLoadSnapshotChunk; + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.UZERO; + } + if (object.format !== undefined && object.format !== null) { + message.format = Number(object.format); + } else { + message.format = 0; + } + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = Number(object.chunk); + } else { + message.chunk = 0; + } + return message; + }, + + toJSON(message: RequestLoadSnapshotChunk): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = (message.height || Long.UZERO).toString()); + message.format !== undefined && (obj.format = message.format); + message.chunk !== undefined && (obj.chunk = message.chunk); + return obj; + }, + + fromPartial(object: DeepPartial): RequestLoadSnapshotChunk { + const message = { ...baseRequestLoadSnapshotChunk } as RequestLoadSnapshotChunk; + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.UZERO; + } + if (object.format !== undefined && object.format !== null) { + message.format = object.format; + } else { + message.format = 0; + } + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = object.chunk; + } else { + message.chunk = 0; + } + return message; + }, +}; + +const baseRequestApplySnapshotChunk: object = { index: 0, sender: "" }; + +export const RequestApplySnapshotChunk = { + encode(message: RequestApplySnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.index !== 0) { + writer.uint32(8).uint32(message.index); + } + if (message.chunk.length !== 0) { + writer.uint32(18).bytes(message.chunk); + } + if (message.sender !== "") { + writer.uint32(26).string(message.sender); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RequestApplySnapshotChunk { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseRequestApplySnapshotChunk } as RequestApplySnapshotChunk; + message.chunk = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint32(); + break; + case 2: + message.chunk = reader.bytes(); + break; + case 3: + message.sender = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RequestApplySnapshotChunk { + const message = { ...baseRequestApplySnapshotChunk } as RequestApplySnapshotChunk; + message.chunk = new Uint8Array(); + if (object.index !== undefined && object.index !== null) { + message.index = Number(object.index); + } else { + message.index = 0; + } + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = bytesFromBase64(object.chunk); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = String(object.sender); + } else { + message.sender = ""; + } + return message; + }, + + toJSON(message: RequestApplySnapshotChunk): unknown { + const obj: any = {}; + message.index !== undefined && (obj.index = message.index); + message.chunk !== undefined && + (obj.chunk = base64FromBytes(message.chunk !== undefined ? message.chunk : new Uint8Array())); + message.sender !== undefined && (obj.sender = message.sender); + return obj; + }, + + fromPartial(object: DeepPartial): RequestApplySnapshotChunk { + const message = { ...baseRequestApplySnapshotChunk } as RequestApplySnapshotChunk; + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } else { + message.index = 0; + } + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = object.chunk; + } else { + message.chunk = new Uint8Array(); + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } else { + message.sender = ""; + } + return message; + }, +}; + +const baseResponse: object = {}; + +export const Response = { + encode(message: Response, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.exception !== undefined) { + ResponseException.encode(message.exception, writer.uint32(10).fork()).ldelim(); + } + if (message.echo !== undefined) { + ResponseEcho.encode(message.echo, writer.uint32(18).fork()).ldelim(); + } + if (message.flush !== undefined) { + ResponseFlush.encode(message.flush, writer.uint32(26).fork()).ldelim(); + } + if (message.info !== undefined) { + ResponseInfo.encode(message.info, writer.uint32(34).fork()).ldelim(); + } + if (message.setOption !== undefined) { + ResponseSetOption.encode(message.setOption, writer.uint32(42).fork()).ldelim(); + } + if (message.initChain !== undefined) { + ResponseInitChain.encode(message.initChain, writer.uint32(50).fork()).ldelim(); + } + if (message.query !== undefined) { + ResponseQuery.encode(message.query, writer.uint32(58).fork()).ldelim(); + } + if (message.beginBlock !== undefined) { + ResponseBeginBlock.encode(message.beginBlock, writer.uint32(66).fork()).ldelim(); + } + if (message.checkTx !== undefined) { + ResponseCheckTx.encode(message.checkTx, writer.uint32(74).fork()).ldelim(); + } + if (message.deliverTx !== undefined) { + ResponseDeliverTx.encode(message.deliverTx, writer.uint32(82).fork()).ldelim(); + } + if (message.endBlock !== undefined) { + ResponseEndBlock.encode(message.endBlock, writer.uint32(90).fork()).ldelim(); + } + if (message.commit !== undefined) { + ResponseCommit.encode(message.commit, writer.uint32(98).fork()).ldelim(); + } + if (message.listSnapshots !== undefined) { + ResponseListSnapshots.encode(message.listSnapshots, writer.uint32(106).fork()).ldelim(); + } + if (message.offerSnapshot !== undefined) { + ResponseOfferSnapshot.encode(message.offerSnapshot, writer.uint32(114).fork()).ldelim(); + } + if (message.loadSnapshotChunk !== undefined) { + ResponseLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(122).fork()).ldelim(); + } + if (message.applySnapshotChunk !== undefined) { + ResponseApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(130).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Response { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseResponse } as Response; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exception = ResponseException.decode(reader, reader.uint32()); + break; + case 2: + message.echo = ResponseEcho.decode(reader, reader.uint32()); + break; + case 3: + message.flush = ResponseFlush.decode(reader, reader.uint32()); + break; + case 4: + message.info = ResponseInfo.decode(reader, reader.uint32()); + break; + case 5: + message.setOption = ResponseSetOption.decode(reader, reader.uint32()); + break; + case 6: + message.initChain = ResponseInitChain.decode(reader, reader.uint32()); + break; + case 7: + message.query = ResponseQuery.decode(reader, reader.uint32()); + break; + case 8: + message.beginBlock = ResponseBeginBlock.decode(reader, reader.uint32()); + break; + case 9: + message.checkTx = ResponseCheckTx.decode(reader, reader.uint32()); + break; + case 10: + message.deliverTx = ResponseDeliverTx.decode(reader, reader.uint32()); + break; + case 11: + message.endBlock = ResponseEndBlock.decode(reader, reader.uint32()); + break; + case 12: + message.commit = ResponseCommit.decode(reader, reader.uint32()); + break; + case 13: + message.listSnapshots = ResponseListSnapshots.decode(reader, reader.uint32()); + break; + case 14: + message.offerSnapshot = ResponseOfferSnapshot.decode(reader, reader.uint32()); + break; + case 15: + message.loadSnapshotChunk = ResponseLoadSnapshotChunk.decode(reader, reader.uint32()); + break; + case 16: + message.applySnapshotChunk = ResponseApplySnapshotChunk.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Response { + const message = { ...baseResponse } as Response; + if (object.exception !== undefined && object.exception !== null) { + message.exception = ResponseException.fromJSON(object.exception); + } else { + message.exception = undefined; + } + if (object.echo !== undefined && object.echo !== null) { + message.echo = ResponseEcho.fromJSON(object.echo); + } else { + message.echo = undefined; + } + if (object.flush !== undefined && object.flush !== null) { + message.flush = ResponseFlush.fromJSON(object.flush); + } else { + message.flush = undefined; + } + if (object.info !== undefined && object.info !== null) { + message.info = ResponseInfo.fromJSON(object.info); + } else { + message.info = undefined; + } + if (object.setOption !== undefined && object.setOption !== null) { + message.setOption = ResponseSetOption.fromJSON(object.setOption); + } else { + message.setOption = undefined; + } + if (object.initChain !== undefined && object.initChain !== null) { + message.initChain = ResponseInitChain.fromJSON(object.initChain); + } else { + message.initChain = undefined; + } + if (object.query !== undefined && object.query !== null) { + message.query = ResponseQuery.fromJSON(object.query); + } else { + message.query = undefined; + } + if (object.beginBlock !== undefined && object.beginBlock !== null) { + message.beginBlock = ResponseBeginBlock.fromJSON(object.beginBlock); + } else { + message.beginBlock = undefined; + } + if (object.checkTx !== undefined && object.checkTx !== null) { + message.checkTx = ResponseCheckTx.fromJSON(object.checkTx); + } else { + message.checkTx = undefined; + } + if (object.deliverTx !== undefined && object.deliverTx !== null) { + message.deliverTx = ResponseDeliverTx.fromJSON(object.deliverTx); + } else { + message.deliverTx = undefined; + } + if (object.endBlock !== undefined && object.endBlock !== null) { + message.endBlock = ResponseEndBlock.fromJSON(object.endBlock); + } else { + message.endBlock = undefined; + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = ResponseCommit.fromJSON(object.commit); + } else { + message.commit = undefined; + } + if (object.listSnapshots !== undefined && object.listSnapshots !== null) { + message.listSnapshots = ResponseListSnapshots.fromJSON(object.listSnapshots); + } else { + message.listSnapshots = undefined; + } + if (object.offerSnapshot !== undefined && object.offerSnapshot !== null) { + message.offerSnapshot = ResponseOfferSnapshot.fromJSON(object.offerSnapshot); + } else { + message.offerSnapshot = undefined; + } + if (object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null) { + message.loadSnapshotChunk = ResponseLoadSnapshotChunk.fromJSON(object.loadSnapshotChunk); + } else { + message.loadSnapshotChunk = undefined; + } + if (object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null) { + message.applySnapshotChunk = ResponseApplySnapshotChunk.fromJSON(object.applySnapshotChunk); + } else { + message.applySnapshotChunk = undefined; + } + return message; + }, + + toJSON(message: Response): unknown { + const obj: any = {}; + message.exception !== undefined && + (obj.exception = message.exception ? ResponseException.toJSON(message.exception) : undefined); + message.echo !== undefined && (obj.echo = message.echo ? ResponseEcho.toJSON(message.echo) : undefined); + message.flush !== undefined && + (obj.flush = message.flush ? ResponseFlush.toJSON(message.flush) : undefined); + message.info !== undefined && (obj.info = message.info ? ResponseInfo.toJSON(message.info) : undefined); + message.setOption !== undefined && + (obj.setOption = message.setOption ? ResponseSetOption.toJSON(message.setOption) : undefined); + message.initChain !== undefined && + (obj.initChain = message.initChain ? ResponseInitChain.toJSON(message.initChain) : undefined); + message.query !== undefined && + (obj.query = message.query ? ResponseQuery.toJSON(message.query) : undefined); + message.beginBlock !== undefined && + (obj.beginBlock = message.beginBlock ? ResponseBeginBlock.toJSON(message.beginBlock) : undefined); + message.checkTx !== undefined && + (obj.checkTx = message.checkTx ? ResponseCheckTx.toJSON(message.checkTx) : undefined); + message.deliverTx !== undefined && + (obj.deliverTx = message.deliverTx ? ResponseDeliverTx.toJSON(message.deliverTx) : undefined); + message.endBlock !== undefined && + (obj.endBlock = message.endBlock ? ResponseEndBlock.toJSON(message.endBlock) : undefined); + message.commit !== undefined && + (obj.commit = message.commit ? ResponseCommit.toJSON(message.commit) : undefined); + message.listSnapshots !== undefined && + (obj.listSnapshots = message.listSnapshots + ? ResponseListSnapshots.toJSON(message.listSnapshots) + : undefined); + message.offerSnapshot !== undefined && + (obj.offerSnapshot = message.offerSnapshot + ? ResponseOfferSnapshot.toJSON(message.offerSnapshot) + : undefined); + message.loadSnapshotChunk !== undefined && + (obj.loadSnapshotChunk = message.loadSnapshotChunk + ? ResponseLoadSnapshotChunk.toJSON(message.loadSnapshotChunk) + : undefined); + message.applySnapshotChunk !== undefined && + (obj.applySnapshotChunk = message.applySnapshotChunk + ? ResponseApplySnapshotChunk.toJSON(message.applySnapshotChunk) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): Response { + const message = { ...baseResponse } as Response; + if (object.exception !== undefined && object.exception !== null) { + message.exception = ResponseException.fromPartial(object.exception); + } else { + message.exception = undefined; + } + if (object.echo !== undefined && object.echo !== null) { + message.echo = ResponseEcho.fromPartial(object.echo); + } else { + message.echo = undefined; + } + if (object.flush !== undefined && object.flush !== null) { + message.flush = ResponseFlush.fromPartial(object.flush); + } else { + message.flush = undefined; + } + if (object.info !== undefined && object.info !== null) { + message.info = ResponseInfo.fromPartial(object.info); + } else { + message.info = undefined; + } + if (object.setOption !== undefined && object.setOption !== null) { + message.setOption = ResponseSetOption.fromPartial(object.setOption); + } else { + message.setOption = undefined; + } + if (object.initChain !== undefined && object.initChain !== null) { + message.initChain = ResponseInitChain.fromPartial(object.initChain); + } else { + message.initChain = undefined; + } + if (object.query !== undefined && object.query !== null) { + message.query = ResponseQuery.fromPartial(object.query); + } else { + message.query = undefined; + } + if (object.beginBlock !== undefined && object.beginBlock !== null) { + message.beginBlock = ResponseBeginBlock.fromPartial(object.beginBlock); + } else { + message.beginBlock = undefined; + } + if (object.checkTx !== undefined && object.checkTx !== null) { + message.checkTx = ResponseCheckTx.fromPartial(object.checkTx); + } else { + message.checkTx = undefined; + } + if (object.deliverTx !== undefined && object.deliverTx !== null) { + message.deliverTx = ResponseDeliverTx.fromPartial(object.deliverTx); + } else { + message.deliverTx = undefined; + } + if (object.endBlock !== undefined && object.endBlock !== null) { + message.endBlock = ResponseEndBlock.fromPartial(object.endBlock); + } else { + message.endBlock = undefined; + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = ResponseCommit.fromPartial(object.commit); + } else { + message.commit = undefined; + } + if (object.listSnapshots !== undefined && object.listSnapshots !== null) { + message.listSnapshots = ResponseListSnapshots.fromPartial(object.listSnapshots); + } else { + message.listSnapshots = undefined; + } + if (object.offerSnapshot !== undefined && object.offerSnapshot !== null) { + message.offerSnapshot = ResponseOfferSnapshot.fromPartial(object.offerSnapshot); + } else { + message.offerSnapshot = undefined; + } + if (object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null) { + message.loadSnapshotChunk = ResponseLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk); + } else { + message.loadSnapshotChunk = undefined; + } + if (object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null) { + message.applySnapshotChunk = ResponseApplySnapshotChunk.fromPartial(object.applySnapshotChunk); + } else { + message.applySnapshotChunk = undefined; + } + return message; + }, +}; + +const baseResponseException: object = { error: "" }; + +export const ResponseException = { + encode(message: ResponseException, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.error !== "") { + writer.uint32(10).string(message.error); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseException { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseResponseException } as ResponseException; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.error = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseException { + const message = { ...baseResponseException } as ResponseException; + if (object.error !== undefined && object.error !== null) { + message.error = String(object.error); + } else { + message.error = ""; + } + return message; + }, + + toJSON(message: ResponseException): unknown { + const obj: any = {}; + message.error !== undefined && (obj.error = message.error); + return obj; + }, + + fromPartial(object: DeepPartial): ResponseException { + const message = { ...baseResponseException } as ResponseException; + if (object.error !== undefined && object.error !== null) { + message.error = object.error; + } else { + message.error = ""; + } + return message; + }, +}; + +const baseResponseEcho: object = { message: "" }; + +export const ResponseEcho = { + encode(message: ResponseEcho, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.message !== "") { + writer.uint32(10).string(message.message); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseEcho { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseResponseEcho } as ResponseEcho; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseEcho { + const message = { ...baseResponseEcho } as ResponseEcho; + if (object.message !== undefined && object.message !== null) { + message.message = String(object.message); + } else { + message.message = ""; + } + return message; + }, + + toJSON(message: ResponseEcho): unknown { + const obj: any = {}; + message.message !== undefined && (obj.message = message.message); + return obj; + }, + + fromPartial(object: DeepPartial): ResponseEcho { + const message = { ...baseResponseEcho } as ResponseEcho; + if (object.message !== undefined && object.message !== null) { + message.message = object.message; + } else { + message.message = ""; + } + return message; + }, +}; + +const baseResponseFlush: object = {}; + +export const ResponseFlush = { + encode(_: ResponseFlush, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseFlush { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseResponseFlush } as ResponseFlush; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(_: any): ResponseFlush { + const message = { ...baseResponseFlush } as ResponseFlush; + return message; + }, + + toJSON(_: ResponseFlush): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): ResponseFlush { + const message = { ...baseResponseFlush } as ResponseFlush; + return message; + }, +}; + +const baseResponseInfo: object = { + data: "", + version: "", + appVersion: Long.UZERO, + lastBlockHeight: Long.ZERO, +}; + +export const ResponseInfo = { + encode(message: ResponseInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.data !== "") { + writer.uint32(10).string(message.data); + } + if (message.version !== "") { + writer.uint32(18).string(message.version); + } + if (!message.appVersion.isZero()) { + writer.uint32(24).uint64(message.appVersion); + } + if (!message.lastBlockHeight.isZero()) { + writer.uint32(32).int64(message.lastBlockHeight); + } + if (message.lastBlockAppHash.length !== 0) { + writer.uint32(42).bytes(message.lastBlockAppHash); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseResponseInfo } as ResponseInfo; + message.lastBlockAppHash = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.string(); + break; + case 2: + message.version = reader.string(); + break; + case 3: + message.appVersion = reader.uint64() as Long; + break; + case 4: + message.lastBlockHeight = reader.int64() as Long; + break; + case 5: + message.lastBlockAppHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseInfo { + const message = { ...baseResponseInfo } as ResponseInfo; + message.lastBlockAppHash = new Uint8Array(); + if (object.data !== undefined && object.data !== null) { + message.data = String(object.data); + } else { + message.data = ""; + } + if (object.version !== undefined && object.version !== null) { + message.version = String(object.version); + } else { + message.version = ""; + } + if (object.appVersion !== undefined && object.appVersion !== null) { + message.appVersion = Long.fromString(object.appVersion); + } else { + message.appVersion = Long.UZERO; + } + if (object.lastBlockHeight !== undefined && object.lastBlockHeight !== null) { + message.lastBlockHeight = Long.fromString(object.lastBlockHeight); + } else { + message.lastBlockHeight = Long.ZERO; + } + if (object.lastBlockAppHash !== undefined && object.lastBlockAppHash !== null) { + message.lastBlockAppHash = bytesFromBase64(object.lastBlockAppHash); + } + return message; + }, + + toJSON(message: ResponseInfo): unknown { + const obj: any = {}; + message.data !== undefined && (obj.data = message.data); + message.version !== undefined && (obj.version = message.version); + message.appVersion !== undefined && (obj.appVersion = (message.appVersion || Long.UZERO).toString()); + message.lastBlockHeight !== undefined && + (obj.lastBlockHeight = (message.lastBlockHeight || Long.ZERO).toString()); + message.lastBlockAppHash !== undefined && + (obj.lastBlockAppHash = base64FromBytes( + message.lastBlockAppHash !== undefined ? message.lastBlockAppHash : new Uint8Array(), + )); + return obj; + }, + + fromPartial(object: DeepPartial): ResponseInfo { + const message = { ...baseResponseInfo } as ResponseInfo; + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = ""; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } else { + message.version = ""; + } + if (object.appVersion !== undefined && object.appVersion !== null) { + message.appVersion = object.appVersion as Long; + } else { + message.appVersion = Long.UZERO; + } + if (object.lastBlockHeight !== undefined && object.lastBlockHeight !== null) { + message.lastBlockHeight = object.lastBlockHeight as Long; + } else { + message.lastBlockHeight = Long.ZERO; + } + if (object.lastBlockAppHash !== undefined && object.lastBlockAppHash !== null) { + message.lastBlockAppHash = object.lastBlockAppHash; + } else { + message.lastBlockAppHash = new Uint8Array(); + } + return message; + }, +}; + +const baseResponseSetOption: object = { code: 0, log: "", info: "" }; + +export const ResponseSetOption = { + encode(message: ResponseSetOption, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.code !== 0) { + writer.uint32(8).uint32(message.code); + } + if (message.log !== "") { + writer.uint32(26).string(message.log); + } + if (message.info !== "") { + writer.uint32(34).string(message.info); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseSetOption { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseResponseSetOption } as ResponseSetOption; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseSetOption { + const message = { ...baseResponseSetOption } as ResponseSetOption; + if (object.code !== undefined && object.code !== null) { + message.code = Number(object.code); + } else { + message.code = 0; + } + if (object.log !== undefined && object.log !== null) { + message.log = String(object.log); + } else { + message.log = ""; + } + if (object.info !== undefined && object.info !== null) { + message.info = String(object.info); + } else { + message.info = ""; + } + return message; + }, + + toJSON(message: ResponseSetOption): unknown { + const obj: any = {}; + message.code !== undefined && (obj.code = message.code); + message.log !== undefined && (obj.log = message.log); + message.info !== undefined && (obj.info = message.info); + return obj; + }, + + fromPartial(object: DeepPartial): ResponseSetOption { + const message = { ...baseResponseSetOption } as ResponseSetOption; + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } else { + message.code = 0; + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } else { + message.log = ""; + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } else { + message.info = ""; + } + return message; + }, +}; + +const baseResponseInitChain: object = {}; + +export const ResponseInitChain = { + encode(message: ResponseInitChain, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.consensusParams !== undefined) { + ConsensusParams.encode(message.consensusParams, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.validators) { + ValidatorUpdate.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.appHash.length !== 0) { + writer.uint32(26).bytes(message.appHash); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseInitChain { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseResponseInitChain } as ResponseInitChain; + message.validators = []; + message.appHash = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.consensusParams = ConsensusParams.decode(reader, reader.uint32()); + break; + case 2: + message.validators.push(ValidatorUpdate.decode(reader, reader.uint32())); + break; + case 3: + message.appHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseInitChain { + const message = { ...baseResponseInitChain } as ResponseInitChain; + message.validators = []; + message.appHash = new Uint8Array(); + if (object.consensusParams !== undefined && object.consensusParams !== null) { + message.consensusParams = ConsensusParams.fromJSON(object.consensusParams); + } else { + message.consensusParams = undefined; + } + if (object.validators !== undefined && object.validators !== null) { + for (const e of object.validators) { + message.validators.push(ValidatorUpdate.fromJSON(e)); + } + } + if (object.appHash !== undefined && object.appHash !== null) { + message.appHash = bytesFromBase64(object.appHash); + } + return message; + }, + + toJSON(message: ResponseInitChain): unknown { + const obj: any = {}; + message.consensusParams !== undefined && + (obj.consensusParams = message.consensusParams + ? ConsensusParams.toJSON(message.consensusParams) + : undefined); + if (message.validators) { + obj.validators = message.validators.map((e) => (e ? ValidatorUpdate.toJSON(e) : undefined)); + } else { + obj.validators = []; + } + message.appHash !== undefined && + (obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): ResponseInitChain { + const message = { ...baseResponseInitChain } as ResponseInitChain; + message.validators = []; + if (object.consensusParams !== undefined && object.consensusParams !== null) { + message.consensusParams = ConsensusParams.fromPartial(object.consensusParams); + } else { + message.consensusParams = undefined; + } + if (object.validators !== undefined && object.validators !== null) { + for (const e of object.validators) { + message.validators.push(ValidatorUpdate.fromPartial(e)); + } + } + if (object.appHash !== undefined && object.appHash !== null) { + message.appHash = object.appHash; + } else { + message.appHash = new Uint8Array(); + } + return message; + }, +}; + +const baseResponseQuery: object = { + code: 0, + log: "", + info: "", + index: Long.ZERO, + height: Long.ZERO, + codespace: "", +}; + +export const ResponseQuery = { + encode(message: ResponseQuery, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.code !== 0) { + writer.uint32(8).uint32(message.code); + } + if (message.log !== "") { + writer.uint32(26).string(message.log); + } + if (message.info !== "") { + writer.uint32(34).string(message.info); + } + if (!message.index.isZero()) { + writer.uint32(40).int64(message.index); + } + if (message.key.length !== 0) { + writer.uint32(50).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(58).bytes(message.value); + } + if (message.proofOps !== undefined) { + ProofOps.encode(message.proofOps, writer.uint32(66).fork()).ldelim(); + } + if (!message.height.isZero()) { + writer.uint32(72).int64(message.height); + } + if (message.codespace !== "") { + writer.uint32(82).string(message.codespace); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseQuery { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseResponseQuery } as ResponseQuery; + message.key = new Uint8Array(); + message.value = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.index = reader.int64() as Long; + break; + case 6: + message.key = reader.bytes(); + break; + case 7: + message.value = reader.bytes(); + break; + case 8: + message.proofOps = ProofOps.decode(reader, reader.uint32()); + break; + case 9: + message.height = reader.int64() as Long; + break; + case 10: + message.codespace = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseQuery { + const message = { ...baseResponseQuery } as ResponseQuery; + message.key = new Uint8Array(); + message.value = new Uint8Array(); + if (object.code !== undefined && object.code !== null) { + message.code = Number(object.code); + } else { + message.code = 0; + } + if (object.log !== undefined && object.log !== null) { + message.log = String(object.log); + } else { + message.log = ""; + } + if (object.info !== undefined && object.info !== null) { + message.info = String(object.info); + } else { + message.info = ""; + } + if (object.index !== undefined && object.index !== null) { + message.index = Long.fromString(object.index); + } else { + message.index = Long.ZERO; + } + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.proofOps !== undefined && object.proofOps !== null) { + message.proofOps = ProofOps.fromJSON(object.proofOps); + } else { + message.proofOps = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.ZERO; + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = String(object.codespace); + } else { + message.codespace = ""; + } + return message; + }, + + toJSON(message: ResponseQuery): unknown { + const obj: any = {}; + message.code !== undefined && (obj.code = message.code); + message.log !== undefined && (obj.log = message.log); + message.info !== undefined && (obj.info = message.info); + message.index !== undefined && (obj.index = (message.index || Long.ZERO).toString()); + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.value !== undefined && + (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + message.proofOps !== undefined && + (obj.proofOps = message.proofOps ? ProofOps.toJSON(message.proofOps) : undefined); + message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.codespace !== undefined && (obj.codespace = message.codespace); + return obj; + }, + + fromPartial(object: DeepPartial): ResponseQuery { + const message = { ...baseResponseQuery } as ResponseQuery; + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } else { + message.code = 0; + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } else { + message.log = ""; + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } else { + message.info = ""; + } + if (object.index !== undefined && object.index !== null) { + message.index = object.index as Long; + } else { + message.index = Long.ZERO; + } + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } else { + message.value = new Uint8Array(); + } + if (object.proofOps !== undefined && object.proofOps !== null) { + message.proofOps = ProofOps.fromPartial(object.proofOps); + } else { + message.proofOps = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.ZERO; + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } else { + message.codespace = ""; + } + return message; + }, +}; + +const baseResponseBeginBlock: object = {}; + +export const ResponseBeginBlock = { + encode(message: ResponseBeginBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.events) { + Event.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseBeginBlock { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseResponseBeginBlock } as ResponseBeginBlock; + message.events = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.events.push(Event.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseBeginBlock { + const message = { ...baseResponseBeginBlock } as ResponseBeginBlock; + message.events = []; + if (object.events !== undefined && object.events !== null) { + for (const e of object.events) { + message.events.push(Event.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: ResponseBeginBlock): unknown { + const obj: any = {}; + if (message.events) { + obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)); + } else { + obj.events = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ResponseBeginBlock { + const message = { ...baseResponseBeginBlock } as ResponseBeginBlock; + message.events = []; + if (object.events !== undefined && object.events !== null) { + for (const e of object.events) { + message.events.push(Event.fromPartial(e)); + } + } + return message; + }, +}; + +const baseResponseCheckTx: object = { + code: 0, + log: "", + info: "", + gasWanted: Long.ZERO, + gasUsed: Long.ZERO, + codespace: "", +}; + +export const ResponseCheckTx = { + encode(message: ResponseCheckTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.code !== 0) { + writer.uint32(8).uint32(message.code); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + if (message.log !== "") { + writer.uint32(26).string(message.log); + } + if (message.info !== "") { + writer.uint32(34).string(message.info); + } + if (!message.gasWanted.isZero()) { + writer.uint32(40).int64(message.gasWanted); + } + if (!message.gasUsed.isZero()) { + writer.uint32(48).int64(message.gasUsed); + } + for (const v of message.events) { + Event.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.codespace !== "") { + writer.uint32(66).string(message.codespace); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseCheckTx { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseResponseCheckTx } as ResponseCheckTx; + message.events = []; + message.data = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 2: + message.data = reader.bytes(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.gasWanted = reader.int64() as Long; + break; + case 6: + message.gasUsed = reader.int64() as Long; + break; + case 7: + message.events.push(Event.decode(reader, reader.uint32())); + break; + case 8: + message.codespace = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseCheckTx { + const message = { ...baseResponseCheckTx } as ResponseCheckTx; + message.events = []; + message.data = new Uint8Array(); + if (object.code !== undefined && object.code !== null) { + message.code = Number(object.code); + } else { + message.code = 0; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.log !== undefined && object.log !== null) { + message.log = String(object.log); + } else { + message.log = ""; + } + if (object.info !== undefined && object.info !== null) { + message.info = String(object.info); + } else { + message.info = ""; + } + if (object.gasWanted !== undefined && object.gasWanted !== null) { + message.gasWanted = Long.fromString(object.gasWanted); + } else { + message.gasWanted = Long.ZERO; + } + if (object.gasUsed !== undefined && object.gasUsed !== null) { + message.gasUsed = Long.fromString(object.gasUsed); + } else { + message.gasUsed = Long.ZERO; + } + if (object.events !== undefined && object.events !== null) { + for (const e of object.events) { + message.events.push(Event.fromJSON(e)); + } + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = String(object.codespace); + } else { + message.codespace = ""; + } + return message; + }, + + toJSON(message: ResponseCheckTx): unknown { + const obj: any = {}; + message.code !== undefined && (obj.code = message.code); + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.log !== undefined && (obj.log = message.log); + message.info !== undefined && (obj.info = message.info); + message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || Long.ZERO).toString()); + message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || Long.ZERO).toString()); + if (message.events) { + obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)); + } else { + obj.events = []; + } + message.codespace !== undefined && (obj.codespace = message.codespace); + return obj; + }, + + fromPartial(object: DeepPartial): ResponseCheckTx { + const message = { ...baseResponseCheckTx } as ResponseCheckTx; + message.events = []; + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } else { + message.code = 0; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } else { + message.log = ""; + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } else { + message.info = ""; + } + if (object.gasWanted !== undefined && object.gasWanted !== null) { + message.gasWanted = object.gasWanted as Long; + } else { + message.gasWanted = Long.ZERO; + } + if (object.gasUsed !== undefined && object.gasUsed !== null) { + message.gasUsed = object.gasUsed as Long; + } else { + message.gasUsed = Long.ZERO; + } + if (object.events !== undefined && object.events !== null) { + for (const e of object.events) { + message.events.push(Event.fromPartial(e)); + } + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } else { + message.codespace = ""; + } + return message; + }, +}; + +const baseResponseDeliverTx: object = { + code: 0, + log: "", + info: "", + gasWanted: Long.ZERO, + gasUsed: Long.ZERO, + codespace: "", +}; + +export const ResponseDeliverTx = { + encode(message: ResponseDeliverTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.code !== 0) { + writer.uint32(8).uint32(message.code); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + if (message.log !== "") { + writer.uint32(26).string(message.log); + } + if (message.info !== "") { + writer.uint32(34).string(message.info); + } + if (!message.gasWanted.isZero()) { + writer.uint32(40).int64(message.gasWanted); + } + if (!message.gasUsed.isZero()) { + writer.uint32(48).int64(message.gasUsed); + } + for (const v of message.events) { + Event.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.codespace !== "") { + writer.uint32(66).string(message.codespace); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseDeliverTx { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseResponseDeliverTx } as ResponseDeliverTx; + message.events = []; + message.data = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 2: + message.data = reader.bytes(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.gasWanted = reader.int64() as Long; + break; + case 6: + message.gasUsed = reader.int64() as Long; + break; + case 7: + message.events.push(Event.decode(reader, reader.uint32())); + break; + case 8: + message.codespace = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseDeliverTx { + const message = { ...baseResponseDeliverTx } as ResponseDeliverTx; + message.events = []; + message.data = new Uint8Array(); + if (object.code !== undefined && object.code !== null) { + message.code = Number(object.code); + } else { + message.code = 0; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.log !== undefined && object.log !== null) { + message.log = String(object.log); + } else { + message.log = ""; + } + if (object.info !== undefined && object.info !== null) { + message.info = String(object.info); + } else { + message.info = ""; + } + if (object.gasWanted !== undefined && object.gasWanted !== null) { + message.gasWanted = Long.fromString(object.gasWanted); + } else { + message.gasWanted = Long.ZERO; + } + if (object.gasUsed !== undefined && object.gasUsed !== null) { + message.gasUsed = Long.fromString(object.gasUsed); + } else { + message.gasUsed = Long.ZERO; + } + if (object.events !== undefined && object.events !== null) { + for (const e of object.events) { + message.events.push(Event.fromJSON(e)); + } + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = String(object.codespace); + } else { + message.codespace = ""; + } + return message; + }, + + toJSON(message: ResponseDeliverTx): unknown { + const obj: any = {}; + message.code !== undefined && (obj.code = message.code); + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.log !== undefined && (obj.log = message.log); + message.info !== undefined && (obj.info = message.info); + message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || Long.ZERO).toString()); + message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || Long.ZERO).toString()); + if (message.events) { + obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)); + } else { + obj.events = []; + } + message.codespace !== undefined && (obj.codespace = message.codespace); + return obj; + }, + + fromPartial(object: DeepPartial): ResponseDeliverTx { + const message = { ...baseResponseDeliverTx } as ResponseDeliverTx; + message.events = []; + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } else { + message.code = 0; + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } else { + message.log = ""; + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } else { + message.info = ""; + } + if (object.gasWanted !== undefined && object.gasWanted !== null) { + message.gasWanted = object.gasWanted as Long; + } else { + message.gasWanted = Long.ZERO; + } + if (object.gasUsed !== undefined && object.gasUsed !== null) { + message.gasUsed = object.gasUsed as Long; + } else { + message.gasUsed = Long.ZERO; + } + if (object.events !== undefined && object.events !== null) { + for (const e of object.events) { + message.events.push(Event.fromPartial(e)); + } + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } else { + message.codespace = ""; + } + return message; + }, +}; + +const baseResponseEndBlock: object = {}; + +export const ResponseEndBlock = { + encode(message: ResponseEndBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.validatorUpdates) { + ValidatorUpdate.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.consensusParamUpdates !== undefined) { + ConsensusParams.encode(message.consensusParamUpdates, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.events) { + Event.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseEndBlock { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseResponseEndBlock } as ResponseEndBlock; + message.validatorUpdates = []; + message.events = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorUpdates.push(ValidatorUpdate.decode(reader, reader.uint32())); + break; + case 2: + message.consensusParamUpdates = ConsensusParams.decode(reader, reader.uint32()); + break; + case 3: + message.events.push(Event.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseEndBlock { + const message = { ...baseResponseEndBlock } as ResponseEndBlock; + message.validatorUpdates = []; + message.events = []; + if (object.validatorUpdates !== undefined && object.validatorUpdates !== null) { + for (const e of object.validatorUpdates) { + message.validatorUpdates.push(ValidatorUpdate.fromJSON(e)); + } + } + if (object.consensusParamUpdates !== undefined && object.consensusParamUpdates !== null) { + message.consensusParamUpdates = ConsensusParams.fromJSON(object.consensusParamUpdates); + } else { + message.consensusParamUpdates = undefined; + } + if (object.events !== undefined && object.events !== null) { + for (const e of object.events) { + message.events.push(Event.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: ResponseEndBlock): unknown { + const obj: any = {}; + if (message.validatorUpdates) { + obj.validatorUpdates = message.validatorUpdates.map((e) => (e ? ValidatorUpdate.toJSON(e) : undefined)); + } else { + obj.validatorUpdates = []; + } + message.consensusParamUpdates !== undefined && + (obj.consensusParamUpdates = message.consensusParamUpdates + ? ConsensusParams.toJSON(message.consensusParamUpdates) + : undefined); + if (message.events) { + obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)); + } else { + obj.events = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ResponseEndBlock { + const message = { ...baseResponseEndBlock } as ResponseEndBlock; + message.validatorUpdates = []; + message.events = []; + if (object.validatorUpdates !== undefined && object.validatorUpdates !== null) { + for (const e of object.validatorUpdates) { + message.validatorUpdates.push(ValidatorUpdate.fromPartial(e)); + } + } + if (object.consensusParamUpdates !== undefined && object.consensusParamUpdates !== null) { + message.consensusParamUpdates = ConsensusParams.fromPartial(object.consensusParamUpdates); + } else { + message.consensusParamUpdates = undefined; + } + if (object.events !== undefined && object.events !== null) { + for (const e of object.events) { + message.events.push(Event.fromPartial(e)); + } + } + return message; + }, +}; + +const baseResponseCommit: object = { retainHeight: Long.ZERO }; + +export const ResponseCommit = { + encode(message: ResponseCommit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + if (!message.retainHeight.isZero()) { + writer.uint32(24).int64(message.retainHeight); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseCommit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseResponseCommit } as ResponseCommit; + message.data = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.data = reader.bytes(); + break; + case 3: + message.retainHeight = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseCommit { + const message = { ...baseResponseCommit } as ResponseCommit; + message.data = new Uint8Array(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.retainHeight !== undefined && object.retainHeight !== null) { + message.retainHeight = Long.fromString(object.retainHeight); + } else { + message.retainHeight = Long.ZERO; + } + return message; + }, + + toJSON(message: ResponseCommit): unknown { + const obj: any = {}; + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.retainHeight !== undefined && (obj.retainHeight = (message.retainHeight || Long.ZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): ResponseCommit { + const message = { ...baseResponseCommit } as ResponseCommit; + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + if (object.retainHeight !== undefined && object.retainHeight !== null) { + message.retainHeight = object.retainHeight as Long; + } else { + message.retainHeight = Long.ZERO; + } + return message; + }, +}; + +const baseResponseListSnapshots: object = {}; + +export const ResponseListSnapshots = { + encode(message: ResponseListSnapshots, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.snapshots) { + Snapshot.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseListSnapshots { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseResponseListSnapshots } as ResponseListSnapshots; + message.snapshots = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.snapshots.push(Snapshot.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseListSnapshots { + const message = { ...baseResponseListSnapshots } as ResponseListSnapshots; + message.snapshots = []; + if (object.snapshots !== undefined && object.snapshots !== null) { + for (const e of object.snapshots) { + message.snapshots.push(Snapshot.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: ResponseListSnapshots): unknown { + const obj: any = {}; + if (message.snapshots) { + obj.snapshots = message.snapshots.map((e) => (e ? Snapshot.toJSON(e) : undefined)); + } else { + obj.snapshots = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ResponseListSnapshots { + const message = { ...baseResponseListSnapshots } as ResponseListSnapshots; + message.snapshots = []; + if (object.snapshots !== undefined && object.snapshots !== null) { + for (const e of object.snapshots) { + message.snapshots.push(Snapshot.fromPartial(e)); + } + } + return message; + }, +}; + +const baseResponseOfferSnapshot: object = { result: 0 }; + +export const ResponseOfferSnapshot = { + encode(message: ResponseOfferSnapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseOfferSnapshot { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseResponseOfferSnapshot } as ResponseOfferSnapshot; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseOfferSnapshot { + const message = { ...baseResponseOfferSnapshot } as ResponseOfferSnapshot; + if (object.result !== undefined && object.result !== null) { + message.result = responseOfferSnapshot_ResultFromJSON(object.result); + } else { + message.result = 0; + } + return message; + }, + + toJSON(message: ResponseOfferSnapshot): unknown { + const obj: any = {}; + message.result !== undefined && (obj.result = responseOfferSnapshot_ResultToJSON(message.result)); + return obj; + }, + + fromPartial(object: DeepPartial): ResponseOfferSnapshot { + const message = { ...baseResponseOfferSnapshot } as ResponseOfferSnapshot; + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } else { + message.result = 0; + } + return message; + }, +}; + +const baseResponseLoadSnapshotChunk: object = {}; + +export const ResponseLoadSnapshotChunk = { + encode(message: ResponseLoadSnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.chunk.length !== 0) { + writer.uint32(10).bytes(message.chunk); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseLoadSnapshotChunk { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseResponseLoadSnapshotChunk } as ResponseLoadSnapshotChunk; + message.chunk = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chunk = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseLoadSnapshotChunk { + const message = { ...baseResponseLoadSnapshotChunk } as ResponseLoadSnapshotChunk; + message.chunk = new Uint8Array(); + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = bytesFromBase64(object.chunk); + } + return message; + }, + + toJSON(message: ResponseLoadSnapshotChunk): unknown { + const obj: any = {}; + message.chunk !== undefined && + (obj.chunk = base64FromBytes(message.chunk !== undefined ? message.chunk : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): ResponseLoadSnapshotChunk { + const message = { ...baseResponseLoadSnapshotChunk } as ResponseLoadSnapshotChunk; + if (object.chunk !== undefined && object.chunk !== null) { + message.chunk = object.chunk; + } else { + message.chunk = new Uint8Array(); + } + return message; + }, +}; + +const baseResponseApplySnapshotChunk: object = { result: 0, refetchChunks: 0, rejectSenders: "" }; + +export const ResponseApplySnapshotChunk = { + encode(message: ResponseApplySnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + writer.uint32(18).fork(); + for (const v of message.refetchChunks) { + writer.uint32(v); + } + writer.ldelim(); + for (const v of message.rejectSenders) { + writer.uint32(26).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResponseApplySnapshotChunk { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseResponseApplySnapshotChunk } as ResponseApplySnapshotChunk; + message.refetchChunks = []; + message.rejectSenders = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = reader.int32() as any; + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.refetchChunks.push(reader.uint32()); + } + } else { + message.refetchChunks.push(reader.uint32()); + } + break; + case 3: + message.rejectSenders.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResponseApplySnapshotChunk { + const message = { ...baseResponseApplySnapshotChunk } as ResponseApplySnapshotChunk; + message.refetchChunks = []; + message.rejectSenders = []; + if (object.result !== undefined && object.result !== null) { + message.result = responseApplySnapshotChunk_ResultFromJSON(object.result); + } else { + message.result = 0; + } + if (object.refetchChunks !== undefined && object.refetchChunks !== null) { + for (const e of object.refetchChunks) { + message.refetchChunks.push(Number(e)); + } + } + if (object.rejectSenders !== undefined && object.rejectSenders !== null) { + for (const e of object.rejectSenders) { + message.rejectSenders.push(String(e)); + } + } + return message; + }, + + toJSON(message: ResponseApplySnapshotChunk): unknown { + const obj: any = {}; + message.result !== undefined && (obj.result = responseApplySnapshotChunk_ResultToJSON(message.result)); + if (message.refetchChunks) { + obj.refetchChunks = message.refetchChunks.map((e) => e); + } else { + obj.refetchChunks = []; + } + if (message.rejectSenders) { + obj.rejectSenders = message.rejectSenders.map((e) => e); + } else { + obj.rejectSenders = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ResponseApplySnapshotChunk { + const message = { ...baseResponseApplySnapshotChunk } as ResponseApplySnapshotChunk; + message.refetchChunks = []; + message.rejectSenders = []; + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } else { + message.result = 0; + } + if (object.refetchChunks !== undefined && object.refetchChunks !== null) { + for (const e of object.refetchChunks) { + message.refetchChunks.push(e); + } + } + if (object.rejectSenders !== undefined && object.rejectSenders !== null) { + for (const e of object.rejectSenders) { + message.rejectSenders.push(e); + } + } + return message; + }, +}; + +const baseConsensusParams: object = {}; + +export const ConsensusParams = { + encode(message: ConsensusParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.block !== undefined) { + BlockParams.encode(message.block, writer.uint32(10).fork()).ldelim(); + } + if (message.evidence !== undefined) { + EvidenceParams.encode(message.evidence, writer.uint32(18).fork()).ldelim(); + } + if (message.validator !== undefined) { + ValidatorParams.encode(message.validator, writer.uint32(26).fork()).ldelim(); + } + if (message.version !== undefined) { + VersionParams.encode(message.version, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ConsensusParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseConsensusParams } as ConsensusParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = BlockParams.decode(reader, reader.uint32()); + break; + case 2: + message.evidence = EvidenceParams.decode(reader, reader.uint32()); + break; + case 3: + message.validator = ValidatorParams.decode(reader, reader.uint32()); + break; + case 4: + message.version = VersionParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ConsensusParams { + const message = { ...baseConsensusParams } as ConsensusParams; + if (object.block !== undefined && object.block !== null) { + message.block = BlockParams.fromJSON(object.block); + } else { + message.block = undefined; + } + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = EvidenceParams.fromJSON(object.evidence); + } else { + message.evidence = undefined; + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = ValidatorParams.fromJSON(object.validator); + } else { + message.validator = undefined; + } + if (object.version !== undefined && object.version !== null) { + message.version = VersionParams.fromJSON(object.version); + } else { + message.version = undefined; + } + return message; + }, + + toJSON(message: ConsensusParams): unknown { + const obj: any = {}; + message.block !== undefined && + (obj.block = message.block ? BlockParams.toJSON(message.block) : undefined); + message.evidence !== undefined && + (obj.evidence = message.evidence ? EvidenceParams.toJSON(message.evidence) : undefined); + message.validator !== undefined && + (obj.validator = message.validator ? ValidatorParams.toJSON(message.validator) : undefined); + message.version !== undefined && + (obj.version = message.version ? VersionParams.toJSON(message.version) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): ConsensusParams { + const message = { ...baseConsensusParams } as ConsensusParams; + if (object.block !== undefined && object.block !== null) { + message.block = BlockParams.fromPartial(object.block); + } else { + message.block = undefined; + } + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = EvidenceParams.fromPartial(object.evidence); + } else { + message.evidence = undefined; + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = ValidatorParams.fromPartial(object.validator); + } else { + message.validator = undefined; + } + if (object.version !== undefined && object.version !== null) { + message.version = VersionParams.fromPartial(object.version); + } else { + message.version = undefined; + } + return message; + }, +}; + +const baseBlockParams: object = { maxBytes: Long.ZERO, maxGas: Long.ZERO }; + +export const BlockParams = { + encode(message: BlockParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.maxBytes.isZero()) { + writer.uint32(8).int64(message.maxBytes); + } + if (!message.maxGas.isZero()) { + writer.uint32(16).int64(message.maxGas); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BlockParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseBlockParams } as BlockParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxBytes = reader.int64() as Long; + break; + case 2: + message.maxGas = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): BlockParams { + const message = { ...baseBlockParams } as BlockParams; + if (object.maxBytes !== undefined && object.maxBytes !== null) { + message.maxBytes = Long.fromString(object.maxBytes); + } else { + message.maxBytes = Long.ZERO; + } + if (object.maxGas !== undefined && object.maxGas !== null) { + message.maxGas = Long.fromString(object.maxGas); + } else { + message.maxGas = Long.ZERO; + } + return message; + }, + + toJSON(message: BlockParams): unknown { + const obj: any = {}; + message.maxBytes !== undefined && (obj.maxBytes = (message.maxBytes || Long.ZERO).toString()); + message.maxGas !== undefined && (obj.maxGas = (message.maxGas || Long.ZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): BlockParams { + const message = { ...baseBlockParams } as BlockParams; + if (object.maxBytes !== undefined && object.maxBytes !== null) { + message.maxBytes = object.maxBytes as Long; + } else { + message.maxBytes = Long.ZERO; + } + if (object.maxGas !== undefined && object.maxGas !== null) { + message.maxGas = object.maxGas as Long; + } else { + message.maxGas = Long.ZERO; + } + return message; + }, +}; + +const baseLastCommitInfo: object = { round: 0 }; + +export const LastCommitInfo = { + encode(message: LastCommitInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.round !== 0) { + writer.uint32(8).int32(message.round); + } + for (const v of message.votes) { + VoteInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LastCommitInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseLastCommitInfo } as LastCommitInfo; + message.votes = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.round = reader.int32(); + break; + case 2: + message.votes.push(VoteInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LastCommitInfo { + const message = { ...baseLastCommitInfo } as LastCommitInfo; + message.votes = []; + if (object.round !== undefined && object.round !== null) { + message.round = Number(object.round); + } else { + message.round = 0; + } + if (object.votes !== undefined && object.votes !== null) { + for (const e of object.votes) { + message.votes.push(VoteInfo.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: LastCommitInfo): unknown { + const obj: any = {}; + message.round !== undefined && (obj.round = message.round); + if (message.votes) { + obj.votes = message.votes.map((e) => (e ? VoteInfo.toJSON(e) : undefined)); + } else { + obj.votes = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): LastCommitInfo { + const message = { ...baseLastCommitInfo } as LastCommitInfo; + message.votes = []; + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } else { + message.round = 0; + } + if (object.votes !== undefined && object.votes !== null) { + for (const e of object.votes) { + message.votes.push(VoteInfo.fromPartial(e)); + } + } + return message; + }, +}; + +const baseEvent: object = { type: "" }; + +export const Event = { + encode(message: Event, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.type !== "") { + writer.uint32(10).string(message.type); + } + for (const v of message.attributes) { + EventAttribute.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Event { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEvent } as Event; + message.attributes = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.attributes.push(EventAttribute.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Event { + const message = { ...baseEvent } as Event; + message.attributes = []; + if (object.type !== undefined && object.type !== null) { + message.type = String(object.type); + } else { + message.type = ""; + } + if (object.attributes !== undefined && object.attributes !== null) { + for (const e of object.attributes) { + message.attributes.push(EventAttribute.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: Event): unknown { + const obj: any = {}; + message.type !== undefined && (obj.type = message.type); + if (message.attributes) { + obj.attributes = message.attributes.map((e) => (e ? EventAttribute.toJSON(e) : undefined)); + } else { + obj.attributes = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): Event { + const message = { ...baseEvent } as Event; + message.attributes = []; + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = ""; + } + if (object.attributes !== undefined && object.attributes !== null) { + for (const e of object.attributes) { + message.attributes.push(EventAttribute.fromPartial(e)); + } + } + return message; + }, +}; + +const baseEventAttribute: object = { index: false }; + +export const EventAttribute = { + encode(message: EventAttribute, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + if (message.index === true) { + writer.uint32(24).bool(message.index); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EventAttribute { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEventAttribute } as EventAttribute; + message.key = new Uint8Array(); + message.value = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + case 3: + message.index = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EventAttribute { + const message = { ...baseEventAttribute } as EventAttribute; + message.key = new Uint8Array(); + message.value = new Uint8Array(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.index !== undefined && object.index !== null) { + message.index = Boolean(object.index); + } else { + message.index = false; + } + return message; + }, + + toJSON(message: EventAttribute): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.value !== undefined && + (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); + message.index !== undefined && (obj.index = message.index); + return obj; + }, + + fromPartial(object: DeepPartial): EventAttribute { + const message = { ...baseEventAttribute } as EventAttribute; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + if (object.value !== undefined && object.value !== null) { + message.value = object.value; + } else { + message.value = new Uint8Array(); + } + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } else { + message.index = false; + } + return message; + }, +}; + +const baseTxResult: object = { height: Long.ZERO, index: 0 }; + +export const TxResult = { + encode(message: TxResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.height.isZero()) { + writer.uint32(8).int64(message.height); + } + if (message.index !== 0) { + writer.uint32(16).uint32(message.index); + } + if (message.tx.length !== 0) { + writer.uint32(26).bytes(message.tx); + } + if (message.result !== undefined) { + ResponseDeliverTx.encode(message.result, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TxResult { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTxResult } as TxResult; + message.tx = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64() as Long; + break; + case 2: + message.index = reader.uint32(); + break; + case 3: + message.tx = reader.bytes(); + break; + case 4: + message.result = ResponseDeliverTx.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TxResult { + const message = { ...baseTxResult } as TxResult; + message.tx = new Uint8Array(); + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.ZERO; + } + if (object.index !== undefined && object.index !== null) { + message.index = Number(object.index); + } else { + message.index = 0; + } + if (object.tx !== undefined && object.tx !== null) { + message.tx = bytesFromBase64(object.tx); + } + if (object.result !== undefined && object.result !== null) { + message.result = ResponseDeliverTx.fromJSON(object.result); + } else { + message.result = undefined; + } + return message; + }, + + toJSON(message: TxResult): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.index !== undefined && (obj.index = message.index); + message.tx !== undefined && + (obj.tx = base64FromBytes(message.tx !== undefined ? message.tx : new Uint8Array())); + message.result !== undefined && + (obj.result = message.result ? ResponseDeliverTx.toJSON(message.result) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): TxResult { + const message = { ...baseTxResult } as TxResult; + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.ZERO; + } + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } else { + message.index = 0; + } + if (object.tx !== undefined && object.tx !== null) { + message.tx = object.tx; + } else { + message.tx = new Uint8Array(); + } + if (object.result !== undefined && object.result !== null) { + message.result = ResponseDeliverTx.fromPartial(object.result); + } else { + message.result = undefined; + } + return message; + }, +}; + +const baseValidator: object = { power: Long.ZERO }; + +export const Validator = { + encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address.length !== 0) { + writer.uint32(10).bytes(message.address); + } + if (!message.power.isZero()) { + writer.uint32(24).int64(message.power); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Validator { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseValidator } as Validator; + message.address = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.bytes(); + break; + case 3: + message.power = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Validator { + const message = { ...baseValidator } as Validator; + message.address = new Uint8Array(); + if (object.address !== undefined && object.address !== null) { + message.address = bytesFromBase64(object.address); + } + if (object.power !== undefined && object.power !== null) { + message.power = Long.fromString(object.power); + } else { + message.power = Long.ZERO; + } + return message; + }, + + toJSON(message: Validator): unknown { + const obj: any = {}; + message.address !== undefined && + (obj.address = base64FromBytes(message.address !== undefined ? message.address : new Uint8Array())); + message.power !== undefined && (obj.power = (message.power || Long.ZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): Validator { + const message = { ...baseValidator } as Validator; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = new Uint8Array(); + } + if (object.power !== undefined && object.power !== null) { + message.power = object.power as Long; + } else { + message.power = Long.ZERO; + } + return message; + }, +}; + +const baseValidatorUpdate: object = { power: Long.ZERO }; + +export const ValidatorUpdate = { + encode(message: ValidatorUpdate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pubKey !== undefined) { + PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim(); + } + if (!message.power.isZero()) { + writer.uint32(16).int64(message.power); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorUpdate { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseValidatorUpdate } as ValidatorUpdate; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pubKey = PublicKey.decode(reader, reader.uint32()); + break; + case 2: + message.power = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ValidatorUpdate { + const message = { ...baseValidatorUpdate } as ValidatorUpdate; + if (object.pubKey !== undefined && object.pubKey !== null) { + message.pubKey = PublicKey.fromJSON(object.pubKey); + } else { + message.pubKey = undefined; + } + if (object.power !== undefined && object.power !== null) { + message.power = Long.fromString(object.power); + } else { + message.power = Long.ZERO; + } + return message; + }, + + toJSON(message: ValidatorUpdate): unknown { + const obj: any = {}; + message.pubKey !== undefined && + (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined); + message.power !== undefined && (obj.power = (message.power || Long.ZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): ValidatorUpdate { + const message = { ...baseValidatorUpdate } as ValidatorUpdate; + if (object.pubKey !== undefined && object.pubKey !== null) { + message.pubKey = PublicKey.fromPartial(object.pubKey); + } else { + message.pubKey = undefined; + } + if (object.power !== undefined && object.power !== null) { + message.power = object.power as Long; + } else { + message.power = Long.ZERO; + } + return message; + }, +}; + +const baseVoteInfo: object = { signedLastBlock: false }; + +export const VoteInfo = { + encode(message: VoteInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); + } + if (message.signedLastBlock === true) { + writer.uint32(16).bool(message.signedLastBlock); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): VoteInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseVoteInfo } as VoteInfo; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = Validator.decode(reader, reader.uint32()); + break; + case 2: + message.signedLastBlock = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): VoteInfo { + const message = { ...baseVoteInfo } as VoteInfo; + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromJSON(object.validator); + } else { + message.validator = undefined; + } + if (object.signedLastBlock !== undefined && object.signedLastBlock !== null) { + message.signedLastBlock = Boolean(object.signedLastBlock); + } else { + message.signedLastBlock = false; + } + return message; + }, + + toJSON(message: VoteInfo): unknown { + const obj: any = {}; + message.validator !== undefined && + (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined); + message.signedLastBlock !== undefined && (obj.signedLastBlock = message.signedLastBlock); + return obj; + }, + + fromPartial(object: DeepPartial): VoteInfo { + const message = { ...baseVoteInfo } as VoteInfo; + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromPartial(object.validator); + } else { + message.validator = undefined; + } + if (object.signedLastBlock !== undefined && object.signedLastBlock !== null) { + message.signedLastBlock = object.signedLastBlock; + } else { + message.signedLastBlock = false; + } + return message; + }, +}; + +const baseEvidence: object = { type: 0, height: Long.ZERO, totalVotingPower: Long.ZERO }; + +export const Evidence = { + encode(message: Evidence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.type !== 0) { + writer.uint32(8).int32(message.type); + } + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(18).fork()).ldelim(); + } + if (!message.height.isZero()) { + writer.uint32(24).int64(message.height); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(34).fork()).ldelim(); + } + if (!message.totalVotingPower.isZero()) { + writer.uint32(40).int64(message.totalVotingPower); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Evidence { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEvidence } as Evidence; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32() as any; + break; + case 2: + message.validator = Validator.decode(reader, reader.uint32()); + break; + case 3: + message.height = reader.int64() as Long; + break; + case 4: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 5: + message.totalVotingPower = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Evidence { + const message = { ...baseEvidence } as Evidence; + if (object.type !== undefined && object.type !== null) { + message.type = evidenceTypeFromJSON(object.type); + } else { + message.type = 0; + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromJSON(object.validator); + } else { + message.validator = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.ZERO; + } + if (object.time !== undefined && object.time !== null) { + message.time = fromJsonTimestamp(object.time); + } else { + message.time = undefined; + } + if (object.totalVotingPower !== undefined && object.totalVotingPower !== null) { + message.totalVotingPower = Long.fromString(object.totalVotingPower); + } else { + message.totalVotingPower = Long.ZERO; + } + return message; + }, + + toJSON(message: Evidence): unknown { + const obj: any = {}; + message.type !== undefined && (obj.type = evidenceTypeToJSON(message.type)); + message.validator !== undefined && + (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined); + message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.time !== undefined && (obj.time = message.time.toISOString()); + message.totalVotingPower !== undefined && + (obj.totalVotingPower = (message.totalVotingPower || Long.ZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): Evidence { + const message = { ...baseEvidence } as Evidence; + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = 0; + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromPartial(object.validator); + } else { + message.validator = undefined; + } + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.ZERO; + } + if (object.time !== undefined && object.time !== null) { + message.time = object.time; + } else { + message.time = undefined; + } + if (object.totalVotingPower !== undefined && object.totalVotingPower !== null) { + message.totalVotingPower = object.totalVotingPower as Long; + } else { + message.totalVotingPower = Long.ZERO; + } + return message; + }, +}; + +const baseSnapshot: object = { height: Long.UZERO, format: 0, chunks: 0 }; + +export const Snapshot = { + encode(message: Snapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.height.isZero()) { + writer.uint32(8).uint64(message.height); + } + if (message.format !== 0) { + writer.uint32(16).uint32(message.format); + } + if (message.chunks !== 0) { + writer.uint32(24).uint32(message.chunks); + } + if (message.hash.length !== 0) { + writer.uint32(34).bytes(message.hash); + } + if (message.metadata.length !== 0) { + writer.uint32(42).bytes(message.metadata); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Snapshot { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSnapshot } as Snapshot; + message.hash = new Uint8Array(); + message.metadata = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.uint64() as Long; + break; + case 2: + message.format = reader.uint32(); + break; + case 3: + message.chunks = reader.uint32(); + break; + case 4: + message.hash = reader.bytes(); + break; + case 5: + message.metadata = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Snapshot { + const message = { ...baseSnapshot } as Snapshot; + message.hash = new Uint8Array(); + message.metadata = new Uint8Array(); + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.UZERO; + } + if (object.format !== undefined && object.format !== null) { + message.format = Number(object.format); + } else { + message.format = 0; + } + if (object.chunks !== undefined && object.chunks !== null) { + message.chunks = Number(object.chunks); + } else { + message.chunks = 0; + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = bytesFromBase64(object.metadata); + } + return message; + }, + + toJSON(message: Snapshot): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = (message.height || Long.UZERO).toString()); + message.format !== undefined && (obj.format = message.format); + message.chunks !== undefined && (obj.chunks = message.chunks); + message.hash !== undefined && + (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + message.metadata !== undefined && + (obj.metadata = base64FromBytes(message.metadata !== undefined ? message.metadata : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): Snapshot { + const message = { ...baseSnapshot } as Snapshot; + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.UZERO; + } + if (object.format !== undefined && object.format !== null) { + message.format = object.format; + } else { + message.format = 0; + } + if (object.chunks !== undefined && object.chunks !== null) { + message.chunks = object.chunks; + } else { + message.chunks = 0; + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } else { + message.hash = new Uint8Array(); + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } else { + message.metadata = new Uint8Array(); + } + return message; + }, +}; + +export interface ABCIApplication { + Echo(request: RequestEcho): Promise; + Flush(request: RequestFlush): Promise; + Info(request: RequestInfo): Promise; + SetOption(request: RequestSetOption): Promise; + DeliverTx(request: RequestDeliverTx): Promise; + CheckTx(request: RequestCheckTx): Promise; + Query(request: RequestQuery): Promise; + Commit(request: RequestCommit): Promise; + InitChain(request: RequestInitChain): Promise; + BeginBlock(request: RequestBeginBlock): Promise; + EndBlock(request: RequestEndBlock): Promise; + ListSnapshots(request: RequestListSnapshots): Promise; + OfferSnapshot(request: RequestOfferSnapshot): Promise; + LoadSnapshotChunk(request: RequestLoadSnapshotChunk): Promise; + ApplySnapshotChunk(request: RequestApplySnapshotChunk): Promise; +} + +export class ABCIApplicationClientImpl implements ABCIApplication { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Echo = this.Echo.bind(this); + this.Flush = this.Flush.bind(this); + this.Info = this.Info.bind(this); + this.SetOption = this.SetOption.bind(this); + this.DeliverTx = this.DeliverTx.bind(this); + this.CheckTx = this.CheckTx.bind(this); + this.Query = this.Query.bind(this); + this.Commit = this.Commit.bind(this); + this.InitChain = this.InitChain.bind(this); + this.BeginBlock = this.BeginBlock.bind(this); + this.EndBlock = this.EndBlock.bind(this); + this.ListSnapshots = this.ListSnapshots.bind(this); + this.OfferSnapshot = this.OfferSnapshot.bind(this); + this.LoadSnapshotChunk = this.LoadSnapshotChunk.bind(this); + this.ApplySnapshotChunk = this.ApplySnapshotChunk.bind(this); + } + Echo(request: RequestEcho): Promise { + const data = RequestEcho.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Echo", data); + return promise.then((data) => ResponseEcho.decode(new _m0.Reader(data))); + } + + Flush(request: RequestFlush): Promise { + const data = RequestFlush.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Flush", data); + return promise.then((data) => ResponseFlush.decode(new _m0.Reader(data))); + } + + Info(request: RequestInfo): Promise { + const data = RequestInfo.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Info", data); + return promise.then((data) => ResponseInfo.decode(new _m0.Reader(data))); + } + + SetOption(request: RequestSetOption): Promise { + const data = RequestSetOption.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "SetOption", data); + return promise.then((data) => ResponseSetOption.decode(new _m0.Reader(data))); + } + + DeliverTx(request: RequestDeliverTx): Promise { + const data = RequestDeliverTx.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "DeliverTx", data); + return promise.then((data) => ResponseDeliverTx.decode(new _m0.Reader(data))); + } + + CheckTx(request: RequestCheckTx): Promise { + const data = RequestCheckTx.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "CheckTx", data); + return promise.then((data) => ResponseCheckTx.decode(new _m0.Reader(data))); + } + + Query(request: RequestQuery): Promise { + const data = RequestQuery.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Query", data); + return promise.then((data) => ResponseQuery.decode(new _m0.Reader(data))); + } + + Commit(request: RequestCommit): Promise { + const data = RequestCommit.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Commit", data); + return promise.then((data) => ResponseCommit.decode(new _m0.Reader(data))); + } + + InitChain(request: RequestInitChain): Promise { + const data = RequestInitChain.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "InitChain", data); + return promise.then((data) => ResponseInitChain.decode(new _m0.Reader(data))); + } + + BeginBlock(request: RequestBeginBlock): Promise { + const data = RequestBeginBlock.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "BeginBlock", data); + return promise.then((data) => ResponseBeginBlock.decode(new _m0.Reader(data))); + } + + EndBlock(request: RequestEndBlock): Promise { + const data = RequestEndBlock.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "EndBlock", data); + return promise.then((data) => ResponseEndBlock.decode(new _m0.Reader(data))); + } + + ListSnapshots(request: RequestListSnapshots): Promise { + const data = RequestListSnapshots.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "ListSnapshots", data); + return promise.then((data) => ResponseListSnapshots.decode(new _m0.Reader(data))); + } + + OfferSnapshot(request: RequestOfferSnapshot): Promise { + const data = RequestOfferSnapshot.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "OfferSnapshot", data); + return promise.then((data) => ResponseOfferSnapshot.decode(new _m0.Reader(data))); + } + + LoadSnapshotChunk(request: RequestLoadSnapshotChunk): Promise { + const data = RequestLoadSnapshotChunk.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "LoadSnapshotChunk", data); + return promise.then((data) => ResponseLoadSnapshotChunk.decode(new _m0.Reader(data))); + } + + ApplySnapshotChunk(request: RequestApplySnapshotChunk): Promise { + const data = RequestApplySnapshotChunk.encode(request).finish(); + const promise = this.rpc.request("tendermint.abci.ABCIApplication", "ApplySnapshotChunk", data); + return promise.then((data) => ResponseApplySnapshotChunk.decode(new _m0.Reader(data))); + } +} + +interface Rpc { + request(service: string, method: string, data: Uint8Array): Promise; +} + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function toTimestamp(date: Date): Timestamp { + const seconds = numberToLong(date.getTime() / 1_000); + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds.toNumber() * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function numberToLong(number: number) { + return Long.fromNumber(number); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/tendermint/crypto/keys.ts b/src/tendermint/crypto/keys.ts new file mode 100644 index 00000000..bee26a64 --- /dev/null +++ b/src/tendermint/crypto/keys.ts @@ -0,0 +1,128 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "tendermint.crypto"; + +/** PublicKey defines the keys available for use with Tendermint Validators */ +export interface PublicKey { + ed25519: Uint8Array | undefined; + secp256k1: Uint8Array | undefined; +} + +const basePublicKey: object = {}; + +export const PublicKey = { + encode(message: PublicKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.ed25519 !== undefined) { + writer.uint32(10).bytes(message.ed25519); + } + if (message.secp256k1 !== undefined) { + writer.uint32(18).bytes(message.secp256k1); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PublicKey { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePublicKey } as PublicKey; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ed25519 = reader.bytes(); + break; + case 2: + message.secp256k1 = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PublicKey { + const message = { ...basePublicKey } as PublicKey; + if (object.ed25519 !== undefined && object.ed25519 !== null) { + message.ed25519 = bytesFromBase64(object.ed25519); + } + if (object.secp256k1 !== undefined && object.secp256k1 !== null) { + message.secp256k1 = bytesFromBase64(object.secp256k1); + } + return message; + }, + + toJSON(message: PublicKey): unknown { + const obj: any = {}; + message.ed25519 !== undefined && + (obj.ed25519 = message.ed25519 !== undefined ? base64FromBytes(message.ed25519) : undefined); + message.secp256k1 !== undefined && + (obj.secp256k1 = message.secp256k1 !== undefined ? base64FromBytes(message.secp256k1) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): PublicKey { + const message = { ...basePublicKey } as PublicKey; + if (object.ed25519 !== undefined && object.ed25519 !== null) { + message.ed25519 = object.ed25519; + } else { + message.ed25519 = undefined; + } + if (object.secp256k1 !== undefined && object.secp256k1 !== null) { + message.secp256k1 = object.secp256k1; + } else { + message.secp256k1 = undefined; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/tendermint/crypto/proof.ts b/src/tendermint/crypto/proof.ts new file mode 100644 index 00000000..89f06568 --- /dev/null +++ b/src/tendermint/crypto/proof.ts @@ -0,0 +1,517 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "tendermint.crypto"; + +export interface Proof { + total: Long; + index: Long; + leafHash: Uint8Array; + aunts: Uint8Array[]; +} + +export interface ValueOp { + /** Encoded in ProofOp.Key. */ + key: Uint8Array; + /** To encode in ProofOp.Data */ + proof?: Proof; +} + +export interface DominoOp { + key: string; + input: string; + output: string; +} + +/** + * ProofOp defines an operation used for calculating Merkle root + * The data could be arbitrary format, providing nessecary data + * for example neighbouring node hash + */ +export interface ProofOp { + type: string; + key: Uint8Array; + data: Uint8Array; +} + +/** ProofOps is Merkle proof defined by the list of ProofOps */ +export interface ProofOps { + ops: ProofOp[]; +} + +const baseProof: object = { total: Long.ZERO, index: Long.ZERO }; + +export const Proof = { + encode(message: Proof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.total.isZero()) { + writer.uint32(8).int64(message.total); + } + if (!message.index.isZero()) { + writer.uint32(16).int64(message.index); + } + if (message.leafHash.length !== 0) { + writer.uint32(26).bytes(message.leafHash); + } + for (const v of message.aunts) { + writer.uint32(34).bytes(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Proof { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseProof } as Proof; + message.aunts = []; + message.leafHash = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.total = reader.int64() as Long; + break; + case 2: + message.index = reader.int64() as Long; + break; + case 3: + message.leafHash = reader.bytes(); + break; + case 4: + message.aunts.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Proof { + const message = { ...baseProof } as Proof; + message.aunts = []; + message.leafHash = new Uint8Array(); + if (object.total !== undefined && object.total !== null) { + message.total = Long.fromString(object.total); + } else { + message.total = Long.ZERO; + } + if (object.index !== undefined && object.index !== null) { + message.index = Long.fromString(object.index); + } else { + message.index = Long.ZERO; + } + if (object.leafHash !== undefined && object.leafHash !== null) { + message.leafHash = bytesFromBase64(object.leafHash); + } + if (object.aunts !== undefined && object.aunts !== null) { + for (const e of object.aunts) { + message.aunts.push(bytesFromBase64(e)); + } + } + return message; + }, + + toJSON(message: Proof): unknown { + const obj: any = {}; + message.total !== undefined && (obj.total = (message.total || Long.ZERO).toString()); + message.index !== undefined && (obj.index = (message.index || Long.ZERO).toString()); + message.leafHash !== undefined && + (obj.leafHash = base64FromBytes(message.leafHash !== undefined ? message.leafHash : new Uint8Array())); + if (message.aunts) { + obj.aunts = message.aunts.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.aunts = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): Proof { + const message = { ...baseProof } as Proof; + message.aunts = []; + if (object.total !== undefined && object.total !== null) { + message.total = object.total as Long; + } else { + message.total = Long.ZERO; + } + if (object.index !== undefined && object.index !== null) { + message.index = object.index as Long; + } else { + message.index = Long.ZERO; + } + if (object.leafHash !== undefined && object.leafHash !== null) { + message.leafHash = object.leafHash; + } else { + message.leafHash = new Uint8Array(); + } + if (object.aunts !== undefined && object.aunts !== null) { + for (const e of object.aunts) { + message.aunts.push(e); + } + } + return message; + }, +}; + +const baseValueOp: object = {}; + +export const ValueOp = { + encode(message: ValueOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.proof !== undefined) { + Proof.encode(message.proof, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ValueOp { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseValueOp } as ValueOp; + message.key = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.proof = Proof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ValueOp { + const message = { ...baseValueOp } as ValueOp; + message.key = new Uint8Array(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromJSON(object.proof); + } else { + message.proof = undefined; + } + return message; + }, + + toJSON(message: ValueOp): unknown { + const obj: any = {}; + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.proof !== undefined && (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): ValueOp { + const message = { ...baseValueOp } as ValueOp; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromPartial(object.proof); + } else { + message.proof = undefined; + } + return message; + }, +}; + +const baseDominoOp: object = { key: "", input: "", output: "" }; + +export const DominoOp = { + encode(message: DominoOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.input !== "") { + writer.uint32(18).string(message.input); + } + if (message.output !== "") { + writer.uint32(26).string(message.output); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DominoOp { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDominoOp } as DominoOp; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.input = reader.string(); + break; + case 3: + message.output = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DominoOp { + const message = { ...baseDominoOp } as DominoOp; + if (object.key !== undefined && object.key !== null) { + message.key = String(object.key); + } else { + message.key = ""; + } + if (object.input !== undefined && object.input !== null) { + message.input = String(object.input); + } else { + message.input = ""; + } + if (object.output !== undefined && object.output !== null) { + message.output = String(object.output); + } else { + message.output = ""; + } + return message; + }, + + toJSON(message: DominoOp): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = message.key); + message.input !== undefined && (obj.input = message.input); + message.output !== undefined && (obj.output = message.output); + return obj; + }, + + fromPartial(object: DeepPartial): DominoOp { + const message = { ...baseDominoOp } as DominoOp; + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = ""; + } + if (object.input !== undefined && object.input !== null) { + message.input = object.input; + } else { + message.input = ""; + } + if (object.output !== undefined && object.output !== null) { + message.output = object.output; + } else { + message.output = ""; + } + return message; + }, +}; + +const baseProofOp: object = { type: "" }; + +export const ProofOp = { + encode(message: ProofOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.type !== "") { + writer.uint32(10).string(message.type); + } + if (message.key.length !== 0) { + writer.uint32(18).bytes(message.key); + } + if (message.data.length !== 0) { + writer.uint32(26).bytes(message.data); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ProofOp { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseProofOp } as ProofOp; + message.key = new Uint8Array(); + message.data = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.key = reader.bytes(); + break; + case 3: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ProofOp { + const message = { ...baseProofOp } as ProofOp; + message.key = new Uint8Array(); + message.data = new Uint8Array(); + if (object.type !== undefined && object.type !== null) { + message.type = String(object.type); + } else { + message.type = ""; + } + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + + toJSON(message: ProofOp): unknown { + const obj: any = {}; + message.type !== undefined && (obj.type = message.type); + message.key !== undefined && + (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): ProofOp { + const message = { ...baseProofOp } as ProofOp; + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = ""; + } + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } else { + message.key = new Uint8Array(); + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + return message; + }, +}; + +const baseProofOps: object = {}; + +export const ProofOps = { + encode(message: ProofOps, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.ops) { + ProofOp.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ProofOps { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseProofOps } as ProofOps; + message.ops = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ops.push(ProofOp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ProofOps { + const message = { ...baseProofOps } as ProofOps; + message.ops = []; + if (object.ops !== undefined && object.ops !== null) { + for (const e of object.ops) { + message.ops.push(ProofOp.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: ProofOps): unknown { + const obj: any = {}; + if (message.ops) { + obj.ops = message.ops.map((e) => (e ? ProofOp.toJSON(e) : undefined)); + } else { + obj.ops = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ProofOps { + const message = { ...baseProofOps } as ProofOps; + message.ops = []; + if (object.ops !== undefined && object.ops !== null) { + for (const e of object.ops) { + message.ops.push(ProofOp.fromPartial(e)); + } + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/tendermint/p2p/types.ts b/src/tendermint/p2p/types.ts new file mode 100644 index 00000000..0197e044 --- /dev/null +++ b/src/tendermint/p2p/types.ts @@ -0,0 +1,515 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "tendermint.p2p"; + +export interface NetAddress { + id: string; + ip: string; + port: number; +} + +export interface ProtocolVersion { + p2p: Long; + block: Long; + app: Long; +} + +export interface DefaultNodeInfo { + protocolVersion?: ProtocolVersion; + defaultNodeId: string; + listenAddr: string; + network: string; + version: string; + channels: Uint8Array; + moniker: string; + other?: DefaultNodeInfoOther; +} + +export interface DefaultNodeInfoOther { + txIndex: string; + rpcAddress: string; +} + +const baseNetAddress: object = { id: "", ip: "", port: 0 }; + +export const NetAddress = { + encode(message: NetAddress, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.ip !== "") { + writer.uint32(18).string(message.ip); + } + if (message.port !== 0) { + writer.uint32(24).uint32(message.port); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): NetAddress { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseNetAddress } as NetAddress; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.ip = reader.string(); + break; + case 3: + message.port = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): NetAddress { + const message = { ...baseNetAddress } as NetAddress; + if (object.id !== undefined && object.id !== null) { + message.id = String(object.id); + } else { + message.id = ""; + } + if (object.ip !== undefined && object.ip !== null) { + message.ip = String(object.ip); + } else { + message.ip = ""; + } + if (object.port !== undefined && object.port !== null) { + message.port = Number(object.port); + } else { + message.port = 0; + } + return message; + }, + + toJSON(message: NetAddress): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.ip !== undefined && (obj.ip = message.ip); + message.port !== undefined && (obj.port = message.port); + return obj; + }, + + fromPartial(object: DeepPartial): NetAddress { + const message = { ...baseNetAddress } as NetAddress; + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } else { + message.id = ""; + } + if (object.ip !== undefined && object.ip !== null) { + message.ip = object.ip; + } else { + message.ip = ""; + } + if (object.port !== undefined && object.port !== null) { + message.port = object.port; + } else { + message.port = 0; + } + return message; + }, +}; + +const baseProtocolVersion: object = { p2p: Long.UZERO, block: Long.UZERO, app: Long.UZERO }; + +export const ProtocolVersion = { + encode(message: ProtocolVersion, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.p2p.isZero()) { + writer.uint32(8).uint64(message.p2p); + } + if (!message.block.isZero()) { + writer.uint32(16).uint64(message.block); + } + if (!message.app.isZero()) { + writer.uint32(24).uint64(message.app); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ProtocolVersion { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseProtocolVersion } as ProtocolVersion; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.p2p = reader.uint64() as Long; + break; + case 2: + message.block = reader.uint64() as Long; + break; + case 3: + message.app = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ProtocolVersion { + const message = { ...baseProtocolVersion } as ProtocolVersion; + if (object.p2p !== undefined && object.p2p !== null) { + message.p2p = Long.fromString(object.p2p); + } else { + message.p2p = Long.UZERO; + } + if (object.block !== undefined && object.block !== null) { + message.block = Long.fromString(object.block); + } else { + message.block = Long.UZERO; + } + if (object.app !== undefined && object.app !== null) { + message.app = Long.fromString(object.app); + } else { + message.app = Long.UZERO; + } + return message; + }, + + toJSON(message: ProtocolVersion): unknown { + const obj: any = {}; + message.p2p !== undefined && (obj.p2p = (message.p2p || Long.UZERO).toString()); + message.block !== undefined && (obj.block = (message.block || Long.UZERO).toString()); + message.app !== undefined && (obj.app = (message.app || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): ProtocolVersion { + const message = { ...baseProtocolVersion } as ProtocolVersion; + if (object.p2p !== undefined && object.p2p !== null) { + message.p2p = object.p2p as Long; + } else { + message.p2p = Long.UZERO; + } + if (object.block !== undefined && object.block !== null) { + message.block = object.block as Long; + } else { + message.block = Long.UZERO; + } + if (object.app !== undefined && object.app !== null) { + message.app = object.app as Long; + } else { + message.app = Long.UZERO; + } + return message; + }, +}; + +const baseDefaultNodeInfo: object = { + defaultNodeId: "", + listenAddr: "", + network: "", + version: "", + moniker: "", +}; + +export const DefaultNodeInfo = { + encode(message: DefaultNodeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.protocolVersion !== undefined) { + ProtocolVersion.encode(message.protocolVersion, writer.uint32(10).fork()).ldelim(); + } + if (message.defaultNodeId !== "") { + writer.uint32(18).string(message.defaultNodeId); + } + if (message.listenAddr !== "") { + writer.uint32(26).string(message.listenAddr); + } + if (message.network !== "") { + writer.uint32(34).string(message.network); + } + if (message.version !== "") { + writer.uint32(42).string(message.version); + } + if (message.channels.length !== 0) { + writer.uint32(50).bytes(message.channels); + } + if (message.moniker !== "") { + writer.uint32(58).string(message.moniker); + } + if (message.other !== undefined) { + DefaultNodeInfoOther.encode(message.other, writer.uint32(66).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DefaultNodeInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDefaultNodeInfo } as DefaultNodeInfo; + message.channels = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.protocolVersion = ProtocolVersion.decode(reader, reader.uint32()); + break; + case 2: + message.defaultNodeId = reader.string(); + break; + case 3: + message.listenAddr = reader.string(); + break; + case 4: + message.network = reader.string(); + break; + case 5: + message.version = reader.string(); + break; + case 6: + message.channels = reader.bytes(); + break; + case 7: + message.moniker = reader.string(); + break; + case 8: + message.other = DefaultNodeInfoOther.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DefaultNodeInfo { + const message = { ...baseDefaultNodeInfo } as DefaultNodeInfo; + message.channels = new Uint8Array(); + if (object.protocolVersion !== undefined && object.protocolVersion !== null) { + message.protocolVersion = ProtocolVersion.fromJSON(object.protocolVersion); + } else { + message.protocolVersion = undefined; + } + if (object.defaultNodeId !== undefined && object.defaultNodeId !== null) { + message.defaultNodeId = String(object.defaultNodeId); + } else { + message.defaultNodeId = ""; + } + if (object.listenAddr !== undefined && object.listenAddr !== null) { + message.listenAddr = String(object.listenAddr); + } else { + message.listenAddr = ""; + } + if (object.network !== undefined && object.network !== null) { + message.network = String(object.network); + } else { + message.network = ""; + } + if (object.version !== undefined && object.version !== null) { + message.version = String(object.version); + } else { + message.version = ""; + } + if (object.channels !== undefined && object.channels !== null) { + message.channels = bytesFromBase64(object.channels); + } + if (object.moniker !== undefined && object.moniker !== null) { + message.moniker = String(object.moniker); + } else { + message.moniker = ""; + } + if (object.other !== undefined && object.other !== null) { + message.other = DefaultNodeInfoOther.fromJSON(object.other); + } else { + message.other = undefined; + } + return message; + }, + + toJSON(message: DefaultNodeInfo): unknown { + const obj: any = {}; + message.protocolVersion !== undefined && + (obj.protocolVersion = message.protocolVersion + ? ProtocolVersion.toJSON(message.protocolVersion) + : undefined); + message.defaultNodeId !== undefined && (obj.defaultNodeId = message.defaultNodeId); + message.listenAddr !== undefined && (obj.listenAddr = message.listenAddr); + message.network !== undefined && (obj.network = message.network); + message.version !== undefined && (obj.version = message.version); + message.channels !== undefined && + (obj.channels = base64FromBytes(message.channels !== undefined ? message.channels : new Uint8Array())); + message.moniker !== undefined && (obj.moniker = message.moniker); + message.other !== undefined && + (obj.other = message.other ? DefaultNodeInfoOther.toJSON(message.other) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): DefaultNodeInfo { + const message = { ...baseDefaultNodeInfo } as DefaultNodeInfo; + if (object.protocolVersion !== undefined && object.protocolVersion !== null) { + message.protocolVersion = ProtocolVersion.fromPartial(object.protocolVersion); + } else { + message.protocolVersion = undefined; + } + if (object.defaultNodeId !== undefined && object.defaultNodeId !== null) { + message.defaultNodeId = object.defaultNodeId; + } else { + message.defaultNodeId = ""; + } + if (object.listenAddr !== undefined && object.listenAddr !== null) { + message.listenAddr = object.listenAddr; + } else { + message.listenAddr = ""; + } + if (object.network !== undefined && object.network !== null) { + message.network = object.network; + } else { + message.network = ""; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } else { + message.version = ""; + } + if (object.channels !== undefined && object.channels !== null) { + message.channels = object.channels; + } else { + message.channels = new Uint8Array(); + } + if (object.moniker !== undefined && object.moniker !== null) { + message.moniker = object.moniker; + } else { + message.moniker = ""; + } + if (object.other !== undefined && object.other !== null) { + message.other = DefaultNodeInfoOther.fromPartial(object.other); + } else { + message.other = undefined; + } + return message; + }, +}; + +const baseDefaultNodeInfoOther: object = { txIndex: "", rpcAddress: "" }; + +export const DefaultNodeInfoOther = { + encode(message: DefaultNodeInfoOther, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.txIndex !== "") { + writer.uint32(10).string(message.txIndex); + } + if (message.rpcAddress !== "") { + writer.uint32(18).string(message.rpcAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DefaultNodeInfoOther { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDefaultNodeInfoOther } as DefaultNodeInfoOther; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txIndex = reader.string(); + break; + case 2: + message.rpcAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DefaultNodeInfoOther { + const message = { ...baseDefaultNodeInfoOther } as DefaultNodeInfoOther; + if (object.txIndex !== undefined && object.txIndex !== null) { + message.txIndex = String(object.txIndex); + } else { + message.txIndex = ""; + } + if (object.rpcAddress !== undefined && object.rpcAddress !== null) { + message.rpcAddress = String(object.rpcAddress); + } else { + message.rpcAddress = ""; + } + return message; + }, + + toJSON(message: DefaultNodeInfoOther): unknown { + const obj: any = {}; + message.txIndex !== undefined && (obj.txIndex = message.txIndex); + message.rpcAddress !== undefined && (obj.rpcAddress = message.rpcAddress); + return obj; + }, + + fromPartial(object: DeepPartial): DefaultNodeInfoOther { + const message = { ...baseDefaultNodeInfoOther } as DefaultNodeInfoOther; + if (object.txIndex !== undefined && object.txIndex !== null) { + message.txIndex = object.txIndex; + } else { + message.txIndex = ""; + } + if (object.rpcAddress !== undefined && object.rpcAddress !== null) { + message.rpcAddress = object.rpcAddress; + } else { + message.rpcAddress = ""; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/tendermint/types/block.ts b/src/tendermint/types/block.ts new file mode 100644 index 00000000..52f17e2e --- /dev/null +++ b/src/tendermint/types/block.ts @@ -0,0 +1,138 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Header, Data, Commit } from "../../tendermint/types/types"; +import { EvidenceList } from "../../tendermint/types/evidence"; + +export const protobufPackage = "tendermint.types"; + +export interface Block { + header?: Header; + data?: Data; + evidence?: EvidenceList; + lastCommit?: Commit; +} + +const baseBlock: object = {}; + +export const Block = { + encode(message: Block, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.header !== undefined) { + Header.encode(message.header, writer.uint32(10).fork()).ldelim(); + } + if (message.data !== undefined) { + Data.encode(message.data, writer.uint32(18).fork()).ldelim(); + } + if (message.evidence !== undefined) { + EvidenceList.encode(message.evidence, writer.uint32(26).fork()).ldelim(); + } + if (message.lastCommit !== undefined) { + Commit.encode(message.lastCommit, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Block { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseBlock } as Block; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = Header.decode(reader, reader.uint32()); + break; + case 2: + message.data = Data.decode(reader, reader.uint32()); + break; + case 3: + message.evidence = EvidenceList.decode(reader, reader.uint32()); + break; + case 4: + message.lastCommit = Commit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Block { + const message = { ...baseBlock } as Block; + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromJSON(object.header); + } else { + message.header = undefined; + } + if (object.data !== undefined && object.data !== null) { + message.data = Data.fromJSON(object.data); + } else { + message.data = undefined; + } + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = EvidenceList.fromJSON(object.evidence); + } else { + message.evidence = undefined; + } + if (object.lastCommit !== undefined && object.lastCommit !== null) { + message.lastCommit = Commit.fromJSON(object.lastCommit); + } else { + message.lastCommit = undefined; + } + return message; + }, + + toJSON(message: Block): unknown { + const obj: any = {}; + message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); + message.data !== undefined && (obj.data = message.data ? Data.toJSON(message.data) : undefined); + message.evidence !== undefined && + (obj.evidence = message.evidence ? EvidenceList.toJSON(message.evidence) : undefined); + message.lastCommit !== undefined && + (obj.lastCommit = message.lastCommit ? Commit.toJSON(message.lastCommit) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): Block { + const message = { ...baseBlock } as Block; + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromPartial(object.header); + } else { + message.header = undefined; + } + if (object.data !== undefined && object.data !== null) { + message.data = Data.fromPartial(object.data); + } else { + message.data = undefined; + } + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = EvidenceList.fromPartial(object.evidence); + } else { + message.evidence = undefined; + } + if (object.lastCommit !== undefined && object.lastCommit !== null) { + message.lastCommit = Commit.fromPartial(object.lastCommit); + } else { + message.lastCommit = undefined; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/tendermint/types/evidence.ts b/src/tendermint/types/evidence.ts new file mode 100644 index 00000000..b89a12d4 --- /dev/null +++ b/src/tendermint/types/evidence.ts @@ -0,0 +1,480 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Vote, LightBlock } from "../../tendermint/types/types"; +import { Timestamp } from "../../google/protobuf/timestamp"; +import { Validator } from "../../tendermint/types/validator"; + +export const protobufPackage = "tendermint.types"; + +export interface Evidence { + duplicateVoteEvidence?: DuplicateVoteEvidence | undefined; + lightClientAttackEvidence?: LightClientAttackEvidence | undefined; +} + +/** DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. */ +export interface DuplicateVoteEvidence { + voteA?: Vote; + voteB?: Vote; + totalVotingPower: Long; + validatorPower: Long; + timestamp?: Date; +} + +/** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ +export interface LightClientAttackEvidence { + conflictingBlock?: LightBlock; + commonHeight: Long; + byzantineValidators: Validator[]; + totalVotingPower: Long; + timestamp?: Date; +} + +export interface EvidenceList { + evidence: Evidence[]; +} + +const baseEvidence: object = {}; + +export const Evidence = { + encode(message: Evidence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.duplicateVoteEvidence !== undefined) { + DuplicateVoteEvidence.encode(message.duplicateVoteEvidence, writer.uint32(10).fork()).ldelim(); + } + if (message.lightClientAttackEvidence !== undefined) { + LightClientAttackEvidence.encode(message.lightClientAttackEvidence, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Evidence { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEvidence } as Evidence; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.duplicateVoteEvidence = DuplicateVoteEvidence.decode(reader, reader.uint32()); + break; + case 2: + message.lightClientAttackEvidence = LightClientAttackEvidence.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Evidence { + const message = { ...baseEvidence } as Evidence; + if (object.duplicateVoteEvidence !== undefined && object.duplicateVoteEvidence !== null) { + message.duplicateVoteEvidence = DuplicateVoteEvidence.fromJSON(object.duplicateVoteEvidence); + } else { + message.duplicateVoteEvidence = undefined; + } + if (object.lightClientAttackEvidence !== undefined && object.lightClientAttackEvidence !== null) { + message.lightClientAttackEvidence = LightClientAttackEvidence.fromJSON( + object.lightClientAttackEvidence, + ); + } else { + message.lightClientAttackEvidence = undefined; + } + return message; + }, + + toJSON(message: Evidence): unknown { + const obj: any = {}; + message.duplicateVoteEvidence !== undefined && + (obj.duplicateVoteEvidence = message.duplicateVoteEvidence + ? DuplicateVoteEvidence.toJSON(message.duplicateVoteEvidence) + : undefined); + message.lightClientAttackEvidence !== undefined && + (obj.lightClientAttackEvidence = message.lightClientAttackEvidence + ? LightClientAttackEvidence.toJSON(message.lightClientAttackEvidence) + : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): Evidence { + const message = { ...baseEvidence } as Evidence; + if (object.duplicateVoteEvidence !== undefined && object.duplicateVoteEvidence !== null) { + message.duplicateVoteEvidence = DuplicateVoteEvidence.fromPartial(object.duplicateVoteEvidence); + } else { + message.duplicateVoteEvidence = undefined; + } + if (object.lightClientAttackEvidence !== undefined && object.lightClientAttackEvidence !== null) { + message.lightClientAttackEvidence = LightClientAttackEvidence.fromPartial( + object.lightClientAttackEvidence, + ); + } else { + message.lightClientAttackEvidence = undefined; + } + return message; + }, +}; + +const baseDuplicateVoteEvidence: object = { totalVotingPower: Long.ZERO, validatorPower: Long.ZERO }; + +export const DuplicateVoteEvidence = { + encode(message: DuplicateVoteEvidence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.voteA !== undefined) { + Vote.encode(message.voteA, writer.uint32(10).fork()).ldelim(); + } + if (message.voteB !== undefined) { + Vote.encode(message.voteB, writer.uint32(18).fork()).ldelim(); + } + if (!message.totalVotingPower.isZero()) { + writer.uint32(24).int64(message.totalVotingPower); + } + if (!message.validatorPower.isZero()) { + writer.uint32(32).int64(message.validatorPower); + } + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DuplicateVoteEvidence { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDuplicateVoteEvidence } as DuplicateVoteEvidence; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.voteA = Vote.decode(reader, reader.uint32()); + break; + case 2: + message.voteB = Vote.decode(reader, reader.uint32()); + break; + case 3: + message.totalVotingPower = reader.int64() as Long; + break; + case 4: + message.validatorPower = reader.int64() as Long; + break; + case 5: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DuplicateVoteEvidence { + const message = { ...baseDuplicateVoteEvidence } as DuplicateVoteEvidence; + if (object.voteA !== undefined && object.voteA !== null) { + message.voteA = Vote.fromJSON(object.voteA); + } else { + message.voteA = undefined; + } + if (object.voteB !== undefined && object.voteB !== null) { + message.voteB = Vote.fromJSON(object.voteB); + } else { + message.voteB = undefined; + } + if (object.totalVotingPower !== undefined && object.totalVotingPower !== null) { + message.totalVotingPower = Long.fromString(object.totalVotingPower); + } else { + message.totalVotingPower = Long.ZERO; + } + if (object.validatorPower !== undefined && object.validatorPower !== null) { + message.validatorPower = Long.fromString(object.validatorPower); + } else { + message.validatorPower = Long.ZERO; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromJsonTimestamp(object.timestamp); + } else { + message.timestamp = undefined; + } + return message; + }, + + toJSON(message: DuplicateVoteEvidence): unknown { + const obj: any = {}; + message.voteA !== undefined && (obj.voteA = message.voteA ? Vote.toJSON(message.voteA) : undefined); + message.voteB !== undefined && (obj.voteB = message.voteB ? Vote.toJSON(message.voteB) : undefined); + message.totalVotingPower !== undefined && + (obj.totalVotingPower = (message.totalVotingPower || Long.ZERO).toString()); + message.validatorPower !== undefined && + (obj.validatorPower = (message.validatorPower || Long.ZERO).toString()); + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); + return obj; + }, + + fromPartial(object: DeepPartial): DuplicateVoteEvidence { + const message = { ...baseDuplicateVoteEvidence } as DuplicateVoteEvidence; + if (object.voteA !== undefined && object.voteA !== null) { + message.voteA = Vote.fromPartial(object.voteA); + } else { + message.voteA = undefined; + } + if (object.voteB !== undefined && object.voteB !== null) { + message.voteB = Vote.fromPartial(object.voteB); + } else { + message.voteB = undefined; + } + if (object.totalVotingPower !== undefined && object.totalVotingPower !== null) { + message.totalVotingPower = object.totalVotingPower as Long; + } else { + message.totalVotingPower = Long.ZERO; + } + if (object.validatorPower !== undefined && object.validatorPower !== null) { + message.validatorPower = object.validatorPower as Long; + } else { + message.validatorPower = Long.ZERO; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = object.timestamp; + } else { + message.timestamp = undefined; + } + return message; + }, +}; + +const baseLightClientAttackEvidence: object = { commonHeight: Long.ZERO, totalVotingPower: Long.ZERO }; + +export const LightClientAttackEvidence = { + encode(message: LightClientAttackEvidence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.conflictingBlock !== undefined) { + LightBlock.encode(message.conflictingBlock, writer.uint32(10).fork()).ldelim(); + } + if (!message.commonHeight.isZero()) { + writer.uint32(16).int64(message.commonHeight); + } + for (const v of message.byzantineValidators) { + Validator.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (!message.totalVotingPower.isZero()) { + writer.uint32(32).int64(message.totalVotingPower); + } + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LightClientAttackEvidence { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseLightClientAttackEvidence } as LightClientAttackEvidence; + message.byzantineValidators = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.conflictingBlock = LightBlock.decode(reader, reader.uint32()); + break; + case 2: + message.commonHeight = reader.int64() as Long; + break; + case 3: + message.byzantineValidators.push(Validator.decode(reader, reader.uint32())); + break; + case 4: + message.totalVotingPower = reader.int64() as Long; + break; + case 5: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LightClientAttackEvidence { + const message = { ...baseLightClientAttackEvidence } as LightClientAttackEvidence; + message.byzantineValidators = []; + if (object.conflictingBlock !== undefined && object.conflictingBlock !== null) { + message.conflictingBlock = LightBlock.fromJSON(object.conflictingBlock); + } else { + message.conflictingBlock = undefined; + } + if (object.commonHeight !== undefined && object.commonHeight !== null) { + message.commonHeight = Long.fromString(object.commonHeight); + } else { + message.commonHeight = Long.ZERO; + } + if (object.byzantineValidators !== undefined && object.byzantineValidators !== null) { + for (const e of object.byzantineValidators) { + message.byzantineValidators.push(Validator.fromJSON(e)); + } + } + if (object.totalVotingPower !== undefined && object.totalVotingPower !== null) { + message.totalVotingPower = Long.fromString(object.totalVotingPower); + } else { + message.totalVotingPower = Long.ZERO; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromJsonTimestamp(object.timestamp); + } else { + message.timestamp = undefined; + } + return message; + }, + + toJSON(message: LightClientAttackEvidence): unknown { + const obj: any = {}; + message.conflictingBlock !== undefined && + (obj.conflictingBlock = message.conflictingBlock + ? LightBlock.toJSON(message.conflictingBlock) + : undefined); + message.commonHeight !== undefined && (obj.commonHeight = (message.commonHeight || Long.ZERO).toString()); + if (message.byzantineValidators) { + obj.byzantineValidators = message.byzantineValidators.map((e) => (e ? Validator.toJSON(e) : undefined)); + } else { + obj.byzantineValidators = []; + } + message.totalVotingPower !== undefined && + (obj.totalVotingPower = (message.totalVotingPower || Long.ZERO).toString()); + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); + return obj; + }, + + fromPartial(object: DeepPartial): LightClientAttackEvidence { + const message = { ...baseLightClientAttackEvidence } as LightClientAttackEvidence; + message.byzantineValidators = []; + if (object.conflictingBlock !== undefined && object.conflictingBlock !== null) { + message.conflictingBlock = LightBlock.fromPartial(object.conflictingBlock); + } else { + message.conflictingBlock = undefined; + } + if (object.commonHeight !== undefined && object.commonHeight !== null) { + message.commonHeight = object.commonHeight as Long; + } else { + message.commonHeight = Long.ZERO; + } + if (object.byzantineValidators !== undefined && object.byzantineValidators !== null) { + for (const e of object.byzantineValidators) { + message.byzantineValidators.push(Validator.fromPartial(e)); + } + } + if (object.totalVotingPower !== undefined && object.totalVotingPower !== null) { + message.totalVotingPower = object.totalVotingPower as Long; + } else { + message.totalVotingPower = Long.ZERO; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = object.timestamp; + } else { + message.timestamp = undefined; + } + return message; + }, +}; + +const baseEvidenceList: object = {}; + +export const EvidenceList = { + encode(message: EvidenceList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.evidence) { + Evidence.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EvidenceList { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEvidenceList } as EvidenceList; + message.evidence = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.evidence.push(Evidence.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EvidenceList { + const message = { ...baseEvidenceList } as EvidenceList; + message.evidence = []; + if (object.evidence !== undefined && object.evidence !== null) { + for (const e of object.evidence) { + message.evidence.push(Evidence.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: EvidenceList): unknown { + const obj: any = {}; + if (message.evidence) { + obj.evidence = message.evidence.map((e) => (e ? Evidence.toJSON(e) : undefined)); + } else { + obj.evidence = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): EvidenceList { + const message = { ...baseEvidenceList } as EvidenceList; + message.evidence = []; + if (object.evidence !== undefined && object.evidence !== null) { + for (const e of object.evidence) { + message.evidence.push(Evidence.fromPartial(e)); + } + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function toTimestamp(date: Date): Timestamp { + const seconds = numberToLong(date.getTime() / 1_000); + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds.toNumber() * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function numberToLong(number: number) { + return Long.fromNumber(number); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/tendermint/types/params.ts b/src/tendermint/types/params.ts new file mode 100644 index 00000000..84545121 --- /dev/null +++ b/src/tendermint/types/params.ts @@ -0,0 +1,582 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Duration } from "../../google/protobuf/duration"; + +export const protobufPackage = "tendermint.types"; + +/** + * ConsensusParams contains consensus critical parameters that determine the + * validity of blocks. + */ +export interface ConsensusParams { + block?: BlockParams; + evidence?: EvidenceParams; + validator?: ValidatorParams; + version?: VersionParams; +} + +/** BlockParams contains limits on the block size. */ +export interface BlockParams { + /** + * Max block size, in bytes. + * Note: must be greater than 0 + */ + maxBytes: Long; + /** + * Max gas per block. + * Note: must be greater or equal to -1 + */ + maxGas: Long; + /** + * Minimum time increment between consecutive blocks (in milliseconds) If the + * block header timestamp is ahead of the system clock, decrease this value. + * + * Not exposed to the application. + */ + timeIotaMs: Long; +} + +/** EvidenceParams determine how we handle evidence of malfeasance. */ +export interface EvidenceParams { + /** + * Max age of evidence, in blocks. + * + * The basic formula for calculating this is: MaxAgeDuration / {average block + * time}. + */ + maxAgeNumBlocks: Long; + /** + * Max age of evidence, in time. + * + * It should correspond with an app's "unbonding period" or other similar + * mechanism for handling [Nothing-At-Stake + * attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). + */ + maxAgeDuration?: Duration; + /** + * This sets the maximum size of total evidence in bytes that can be committed in a single block. + * and should fall comfortably under the max block bytes. + * Default is 1048576 or 1MB + */ + maxBytes: Long; +} + +/** + * ValidatorParams restrict the public key types validators can use. + * NOTE: uses ABCI pubkey naming, not Amino names. + */ +export interface ValidatorParams { + pubKeyTypes: string[]; +} + +/** VersionParams contains the ABCI application version. */ +export interface VersionParams { + appVersion: Long; +} + +/** + * HashedParams is a subset of ConsensusParams. + * + * It is hashed into the Header.ConsensusHash. + */ +export interface HashedParams { + blockMaxBytes: Long; + blockMaxGas: Long; +} + +const baseConsensusParams: object = {}; + +export const ConsensusParams = { + encode(message: ConsensusParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.block !== undefined) { + BlockParams.encode(message.block, writer.uint32(10).fork()).ldelim(); + } + if (message.evidence !== undefined) { + EvidenceParams.encode(message.evidence, writer.uint32(18).fork()).ldelim(); + } + if (message.validator !== undefined) { + ValidatorParams.encode(message.validator, writer.uint32(26).fork()).ldelim(); + } + if (message.version !== undefined) { + VersionParams.encode(message.version, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ConsensusParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseConsensusParams } as ConsensusParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = BlockParams.decode(reader, reader.uint32()); + break; + case 2: + message.evidence = EvidenceParams.decode(reader, reader.uint32()); + break; + case 3: + message.validator = ValidatorParams.decode(reader, reader.uint32()); + break; + case 4: + message.version = VersionParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ConsensusParams { + const message = { ...baseConsensusParams } as ConsensusParams; + if (object.block !== undefined && object.block !== null) { + message.block = BlockParams.fromJSON(object.block); + } else { + message.block = undefined; + } + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = EvidenceParams.fromJSON(object.evidence); + } else { + message.evidence = undefined; + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = ValidatorParams.fromJSON(object.validator); + } else { + message.validator = undefined; + } + if (object.version !== undefined && object.version !== null) { + message.version = VersionParams.fromJSON(object.version); + } else { + message.version = undefined; + } + return message; + }, + + toJSON(message: ConsensusParams): unknown { + const obj: any = {}; + message.block !== undefined && + (obj.block = message.block ? BlockParams.toJSON(message.block) : undefined); + message.evidence !== undefined && + (obj.evidence = message.evidence ? EvidenceParams.toJSON(message.evidence) : undefined); + message.validator !== undefined && + (obj.validator = message.validator ? ValidatorParams.toJSON(message.validator) : undefined); + message.version !== undefined && + (obj.version = message.version ? VersionParams.toJSON(message.version) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): ConsensusParams { + const message = { ...baseConsensusParams } as ConsensusParams; + if (object.block !== undefined && object.block !== null) { + message.block = BlockParams.fromPartial(object.block); + } else { + message.block = undefined; + } + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = EvidenceParams.fromPartial(object.evidence); + } else { + message.evidence = undefined; + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = ValidatorParams.fromPartial(object.validator); + } else { + message.validator = undefined; + } + if (object.version !== undefined && object.version !== null) { + message.version = VersionParams.fromPartial(object.version); + } else { + message.version = undefined; + } + return message; + }, +}; + +const baseBlockParams: object = { maxBytes: Long.ZERO, maxGas: Long.ZERO, timeIotaMs: Long.ZERO }; + +export const BlockParams = { + encode(message: BlockParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.maxBytes.isZero()) { + writer.uint32(8).int64(message.maxBytes); + } + if (!message.maxGas.isZero()) { + writer.uint32(16).int64(message.maxGas); + } + if (!message.timeIotaMs.isZero()) { + writer.uint32(24).int64(message.timeIotaMs); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BlockParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseBlockParams } as BlockParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxBytes = reader.int64() as Long; + break; + case 2: + message.maxGas = reader.int64() as Long; + break; + case 3: + message.timeIotaMs = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): BlockParams { + const message = { ...baseBlockParams } as BlockParams; + if (object.maxBytes !== undefined && object.maxBytes !== null) { + message.maxBytes = Long.fromString(object.maxBytes); + } else { + message.maxBytes = Long.ZERO; + } + if (object.maxGas !== undefined && object.maxGas !== null) { + message.maxGas = Long.fromString(object.maxGas); + } else { + message.maxGas = Long.ZERO; + } + if (object.timeIotaMs !== undefined && object.timeIotaMs !== null) { + message.timeIotaMs = Long.fromString(object.timeIotaMs); + } else { + message.timeIotaMs = Long.ZERO; + } + return message; + }, + + toJSON(message: BlockParams): unknown { + const obj: any = {}; + message.maxBytes !== undefined && (obj.maxBytes = (message.maxBytes || Long.ZERO).toString()); + message.maxGas !== undefined && (obj.maxGas = (message.maxGas || Long.ZERO).toString()); + message.timeIotaMs !== undefined && (obj.timeIotaMs = (message.timeIotaMs || Long.ZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): BlockParams { + const message = { ...baseBlockParams } as BlockParams; + if (object.maxBytes !== undefined && object.maxBytes !== null) { + message.maxBytes = object.maxBytes as Long; + } else { + message.maxBytes = Long.ZERO; + } + if (object.maxGas !== undefined && object.maxGas !== null) { + message.maxGas = object.maxGas as Long; + } else { + message.maxGas = Long.ZERO; + } + if (object.timeIotaMs !== undefined && object.timeIotaMs !== null) { + message.timeIotaMs = object.timeIotaMs as Long; + } else { + message.timeIotaMs = Long.ZERO; + } + return message; + }, +}; + +const baseEvidenceParams: object = { maxAgeNumBlocks: Long.ZERO, maxBytes: Long.ZERO }; + +export const EvidenceParams = { + encode(message: EvidenceParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.maxAgeNumBlocks.isZero()) { + writer.uint32(8).int64(message.maxAgeNumBlocks); + } + if (message.maxAgeDuration !== undefined) { + Duration.encode(message.maxAgeDuration, writer.uint32(18).fork()).ldelim(); + } + if (!message.maxBytes.isZero()) { + writer.uint32(24).int64(message.maxBytes); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EvidenceParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEvidenceParams } as EvidenceParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxAgeNumBlocks = reader.int64() as Long; + break; + case 2: + message.maxAgeDuration = Duration.decode(reader, reader.uint32()); + break; + case 3: + message.maxBytes = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EvidenceParams { + const message = { ...baseEvidenceParams } as EvidenceParams; + if (object.maxAgeNumBlocks !== undefined && object.maxAgeNumBlocks !== null) { + message.maxAgeNumBlocks = Long.fromString(object.maxAgeNumBlocks); + } else { + message.maxAgeNumBlocks = Long.ZERO; + } + if (object.maxAgeDuration !== undefined && object.maxAgeDuration !== null) { + message.maxAgeDuration = Duration.fromJSON(object.maxAgeDuration); + } else { + message.maxAgeDuration = undefined; + } + if (object.maxBytes !== undefined && object.maxBytes !== null) { + message.maxBytes = Long.fromString(object.maxBytes); + } else { + message.maxBytes = Long.ZERO; + } + return message; + }, + + toJSON(message: EvidenceParams): unknown { + const obj: any = {}; + message.maxAgeNumBlocks !== undefined && + (obj.maxAgeNumBlocks = (message.maxAgeNumBlocks || Long.ZERO).toString()); + message.maxAgeDuration !== undefined && + (obj.maxAgeDuration = message.maxAgeDuration ? Duration.toJSON(message.maxAgeDuration) : undefined); + message.maxBytes !== undefined && (obj.maxBytes = (message.maxBytes || Long.ZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): EvidenceParams { + const message = { ...baseEvidenceParams } as EvidenceParams; + if (object.maxAgeNumBlocks !== undefined && object.maxAgeNumBlocks !== null) { + message.maxAgeNumBlocks = object.maxAgeNumBlocks as Long; + } else { + message.maxAgeNumBlocks = Long.ZERO; + } + if (object.maxAgeDuration !== undefined && object.maxAgeDuration !== null) { + message.maxAgeDuration = Duration.fromPartial(object.maxAgeDuration); + } else { + message.maxAgeDuration = undefined; + } + if (object.maxBytes !== undefined && object.maxBytes !== null) { + message.maxBytes = object.maxBytes as Long; + } else { + message.maxBytes = Long.ZERO; + } + return message; + }, +}; + +const baseValidatorParams: object = { pubKeyTypes: "" }; + +export const ValidatorParams = { + encode(message: ValidatorParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.pubKeyTypes) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseValidatorParams } as ValidatorParams; + message.pubKeyTypes = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pubKeyTypes.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ValidatorParams { + const message = { ...baseValidatorParams } as ValidatorParams; + message.pubKeyTypes = []; + if (object.pubKeyTypes !== undefined && object.pubKeyTypes !== null) { + for (const e of object.pubKeyTypes) { + message.pubKeyTypes.push(String(e)); + } + } + return message; + }, + + toJSON(message: ValidatorParams): unknown { + const obj: any = {}; + if (message.pubKeyTypes) { + obj.pubKeyTypes = message.pubKeyTypes.map((e) => e); + } else { + obj.pubKeyTypes = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): ValidatorParams { + const message = { ...baseValidatorParams } as ValidatorParams; + message.pubKeyTypes = []; + if (object.pubKeyTypes !== undefined && object.pubKeyTypes !== null) { + for (const e of object.pubKeyTypes) { + message.pubKeyTypes.push(e); + } + } + return message; + }, +}; + +const baseVersionParams: object = { appVersion: Long.UZERO }; + +export const VersionParams = { + encode(message: VersionParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.appVersion.isZero()) { + writer.uint32(8).uint64(message.appVersion); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): VersionParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseVersionParams } as VersionParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.appVersion = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): VersionParams { + const message = { ...baseVersionParams } as VersionParams; + if (object.appVersion !== undefined && object.appVersion !== null) { + message.appVersion = Long.fromString(object.appVersion); + } else { + message.appVersion = Long.UZERO; + } + return message; + }, + + toJSON(message: VersionParams): unknown { + const obj: any = {}; + message.appVersion !== undefined && (obj.appVersion = (message.appVersion || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): VersionParams { + const message = { ...baseVersionParams } as VersionParams; + if (object.appVersion !== undefined && object.appVersion !== null) { + message.appVersion = object.appVersion as Long; + } else { + message.appVersion = Long.UZERO; + } + return message; + }, +}; + +const baseHashedParams: object = { blockMaxBytes: Long.ZERO, blockMaxGas: Long.ZERO }; + +export const HashedParams = { + encode(message: HashedParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.blockMaxBytes.isZero()) { + writer.uint32(8).int64(message.blockMaxBytes); + } + if (!message.blockMaxGas.isZero()) { + writer.uint32(16).int64(message.blockMaxGas); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): HashedParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHashedParams } as HashedParams; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockMaxBytes = reader.int64() as Long; + break; + case 2: + message.blockMaxGas = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): HashedParams { + const message = { ...baseHashedParams } as HashedParams; + if (object.blockMaxBytes !== undefined && object.blockMaxBytes !== null) { + message.blockMaxBytes = Long.fromString(object.blockMaxBytes); + } else { + message.blockMaxBytes = Long.ZERO; + } + if (object.blockMaxGas !== undefined && object.blockMaxGas !== null) { + message.blockMaxGas = Long.fromString(object.blockMaxGas); + } else { + message.blockMaxGas = Long.ZERO; + } + return message; + }, + + toJSON(message: HashedParams): unknown { + const obj: any = {}; + message.blockMaxBytes !== undefined && + (obj.blockMaxBytes = (message.blockMaxBytes || Long.ZERO).toString()); + message.blockMaxGas !== undefined && (obj.blockMaxGas = (message.blockMaxGas || Long.ZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): HashedParams { + const message = { ...baseHashedParams } as HashedParams; + if (object.blockMaxBytes !== undefined && object.blockMaxBytes !== null) { + message.blockMaxBytes = object.blockMaxBytes as Long; + } else { + message.blockMaxBytes = Long.ZERO; + } + if (object.blockMaxGas !== undefined && object.blockMaxGas !== null) { + message.blockMaxGas = object.blockMaxGas as Long; + } else { + message.blockMaxGas = Long.ZERO; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/tendermint/types/types.ts b/src/tendermint/types/types.ts new file mode 100644 index 00000000..86ea18ac --- /dev/null +++ b/src/tendermint/types/types.ts @@ -0,0 +1,1809 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { Proof } from "../../tendermint/crypto/proof"; +import { Consensus } from "../../tendermint/version/types"; +import { ValidatorSet } from "../../tendermint/types/validator"; +import { Timestamp } from "../../google/protobuf/timestamp"; + +export const protobufPackage = "tendermint.types"; + +/** BlockIdFlag indicates which BlcokID the signature is for */ +export enum BlockIDFlag { + BLOCK_ID_FLAG_UNKNOWN = 0, + BLOCK_ID_FLAG_ABSENT = 1, + BLOCK_ID_FLAG_COMMIT = 2, + BLOCK_ID_FLAG_NIL = 3, + UNRECOGNIZED = -1, +} + +export function blockIDFlagFromJSON(object: any): BlockIDFlag { + switch (object) { + case 0: + case "BLOCK_ID_FLAG_UNKNOWN": + return BlockIDFlag.BLOCK_ID_FLAG_UNKNOWN; + case 1: + case "BLOCK_ID_FLAG_ABSENT": + return BlockIDFlag.BLOCK_ID_FLAG_ABSENT; + case 2: + case "BLOCK_ID_FLAG_COMMIT": + return BlockIDFlag.BLOCK_ID_FLAG_COMMIT; + case 3: + case "BLOCK_ID_FLAG_NIL": + return BlockIDFlag.BLOCK_ID_FLAG_NIL; + case -1: + case "UNRECOGNIZED": + default: + return BlockIDFlag.UNRECOGNIZED; + } +} + +export function blockIDFlagToJSON(object: BlockIDFlag): string { + switch (object) { + case BlockIDFlag.BLOCK_ID_FLAG_UNKNOWN: + return "BLOCK_ID_FLAG_UNKNOWN"; + case BlockIDFlag.BLOCK_ID_FLAG_ABSENT: + return "BLOCK_ID_FLAG_ABSENT"; + case BlockIDFlag.BLOCK_ID_FLAG_COMMIT: + return "BLOCK_ID_FLAG_COMMIT"; + case BlockIDFlag.BLOCK_ID_FLAG_NIL: + return "BLOCK_ID_FLAG_NIL"; + default: + return "UNKNOWN"; + } +} + +/** SignedMsgType is a type of signed message in the consensus. */ +export enum SignedMsgType { + SIGNED_MSG_TYPE_UNKNOWN = 0, + /** SIGNED_MSG_TYPE_PREVOTE - Votes */ + SIGNED_MSG_TYPE_PREVOTE = 1, + SIGNED_MSG_TYPE_PRECOMMIT = 2, + /** SIGNED_MSG_TYPE_PROPOSAL - Proposals */ + SIGNED_MSG_TYPE_PROPOSAL = 32, + UNRECOGNIZED = -1, +} + +export function signedMsgTypeFromJSON(object: any): SignedMsgType { + switch (object) { + case 0: + case "SIGNED_MSG_TYPE_UNKNOWN": + return SignedMsgType.SIGNED_MSG_TYPE_UNKNOWN; + case 1: + case "SIGNED_MSG_TYPE_PREVOTE": + return SignedMsgType.SIGNED_MSG_TYPE_PREVOTE; + case 2: + case "SIGNED_MSG_TYPE_PRECOMMIT": + return SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT; + case 32: + case "SIGNED_MSG_TYPE_PROPOSAL": + return SignedMsgType.SIGNED_MSG_TYPE_PROPOSAL; + case -1: + case "UNRECOGNIZED": + default: + return SignedMsgType.UNRECOGNIZED; + } +} + +export function signedMsgTypeToJSON(object: SignedMsgType): string { + switch (object) { + case SignedMsgType.SIGNED_MSG_TYPE_UNKNOWN: + return "SIGNED_MSG_TYPE_UNKNOWN"; + case SignedMsgType.SIGNED_MSG_TYPE_PREVOTE: + return "SIGNED_MSG_TYPE_PREVOTE"; + case SignedMsgType.SIGNED_MSG_TYPE_PRECOMMIT: + return "SIGNED_MSG_TYPE_PRECOMMIT"; + case SignedMsgType.SIGNED_MSG_TYPE_PROPOSAL: + return "SIGNED_MSG_TYPE_PROPOSAL"; + default: + return "UNKNOWN"; + } +} + +/** PartsetHeader */ +export interface PartSetHeader { + total: number; + hash: Uint8Array; +} + +export interface Part { + index: number; + bytes: Uint8Array; + proof?: Proof; +} + +/** BlockID */ +export interface BlockID { + hash: Uint8Array; + partSetHeader?: PartSetHeader; +} + +/** Header defines the structure of a Tendermint block header. */ +export interface Header { + /** basic block info */ + version?: Consensus; + chainId: string; + height: Long; + time?: Date; + /** prev block info */ + lastBlockId?: BlockID; + /** hashes of block data */ + lastCommitHash: Uint8Array; + /** transactions */ + dataHash: Uint8Array; + /** hashes from the app output from the prev block */ + validatorsHash: Uint8Array; + /** validators for the next block */ + nextValidatorsHash: Uint8Array; + /** consensus params for current block */ + consensusHash: Uint8Array; + /** state after txs from the previous block */ + appHash: Uint8Array; + /** root hash of all results from the txs from the previous block */ + lastResultsHash: Uint8Array; + /** consensus info */ + evidenceHash: Uint8Array; + /** original proposer of the block */ + proposerAddress: Uint8Array; +} + +/** Data contains the set of transactions included in the block */ +export interface Data { + /** + * Txs that will be applied by state @ block.Height+1. + * NOTE: not all txs here are valid. We're just agreeing on the order first. + * This means that block.AppHash does not include these txs. + */ + txs: Uint8Array[]; +} + +/** + * Vote represents a prevote, precommit, or commit vote from validators for + * consensus. + */ +export interface Vote { + type: SignedMsgType; + height: Long; + round: number; + /** zero if vote is nil. */ + blockId?: BlockID; + timestamp?: Date; + validatorAddress: Uint8Array; + validatorIndex: number; + signature: Uint8Array; +} + +/** Commit contains the evidence that a block was committed by a set of validators. */ +export interface Commit { + height: Long; + round: number; + blockId?: BlockID; + signatures: CommitSig[]; +} + +/** CommitSig is a part of the Vote included in a Commit. */ +export interface CommitSig { + blockIdFlag: BlockIDFlag; + validatorAddress: Uint8Array; + timestamp?: Date; + signature: Uint8Array; +} + +export interface Proposal { + type: SignedMsgType; + height: Long; + round: number; + polRound: number; + blockId?: BlockID; + timestamp?: Date; + signature: Uint8Array; +} + +export interface SignedHeader { + header?: Header; + commit?: Commit; +} + +export interface LightBlock { + signedHeader?: SignedHeader; + validatorSet?: ValidatorSet; +} + +export interface BlockMeta { + blockId?: BlockID; + blockSize: Long; + header?: Header; + numTxs: Long; +} + +/** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */ +export interface TxProof { + rootHash: Uint8Array; + data: Uint8Array; + proof?: Proof; +} + +const basePartSetHeader: object = { total: 0 }; + +export const PartSetHeader = { + encode(message: PartSetHeader, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.total !== 0) { + writer.uint32(8).uint32(message.total); + } + if (message.hash.length !== 0) { + writer.uint32(18).bytes(message.hash); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PartSetHeader { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePartSetHeader } as PartSetHeader; + message.hash = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.total = reader.uint32(); + break; + case 2: + message.hash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PartSetHeader { + const message = { ...basePartSetHeader } as PartSetHeader; + message.hash = new Uint8Array(); + if (object.total !== undefined && object.total !== null) { + message.total = Number(object.total); + } else { + message.total = 0; + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + return message; + }, + + toJSON(message: PartSetHeader): unknown { + const obj: any = {}; + message.total !== undefined && (obj.total = message.total); + message.hash !== undefined && + (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + return obj; + }, + + fromPartial(object: DeepPartial): PartSetHeader { + const message = { ...basePartSetHeader } as PartSetHeader; + if (object.total !== undefined && object.total !== null) { + message.total = object.total; + } else { + message.total = 0; + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } else { + message.hash = new Uint8Array(); + } + return message; + }, +}; + +const basePart: object = { index: 0 }; + +export const Part = { + encode(message: Part, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.index !== 0) { + writer.uint32(8).uint32(message.index); + } + if (message.bytes.length !== 0) { + writer.uint32(18).bytes(message.bytes); + } + if (message.proof !== undefined) { + Proof.encode(message.proof, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Part { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...basePart } as Part; + message.bytes = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint32(); + break; + case 2: + message.bytes = reader.bytes(); + break; + case 3: + message.proof = Proof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Part { + const message = { ...basePart } as Part; + message.bytes = new Uint8Array(); + if (object.index !== undefined && object.index !== null) { + message.index = Number(object.index); + } else { + message.index = 0; + } + if (object.bytes !== undefined && object.bytes !== null) { + message.bytes = bytesFromBase64(object.bytes); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromJSON(object.proof); + } else { + message.proof = undefined; + } + return message; + }, + + toJSON(message: Part): unknown { + const obj: any = {}; + message.index !== undefined && (obj.index = message.index); + message.bytes !== undefined && + (obj.bytes = base64FromBytes(message.bytes !== undefined ? message.bytes : new Uint8Array())); + message.proof !== undefined && (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): Part { + const message = { ...basePart } as Part; + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } else { + message.index = 0; + } + if (object.bytes !== undefined && object.bytes !== null) { + message.bytes = object.bytes; + } else { + message.bytes = new Uint8Array(); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromPartial(object.proof); + } else { + message.proof = undefined; + } + return message; + }, +}; + +const baseBlockID: object = {}; + +export const BlockID = { + encode(message: BlockID, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.hash.length !== 0) { + writer.uint32(10).bytes(message.hash); + } + if (message.partSetHeader !== undefined) { + PartSetHeader.encode(message.partSetHeader, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BlockID { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseBlockID } as BlockID; + message.hash = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.bytes(); + break; + case 2: + message.partSetHeader = PartSetHeader.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): BlockID { + const message = { ...baseBlockID } as BlockID; + message.hash = new Uint8Array(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.partSetHeader !== undefined && object.partSetHeader !== null) { + message.partSetHeader = PartSetHeader.fromJSON(object.partSetHeader); + } else { + message.partSetHeader = undefined; + } + return message; + }, + + toJSON(message: BlockID): unknown { + const obj: any = {}; + message.hash !== undefined && + (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); + message.partSetHeader !== undefined && + (obj.partSetHeader = message.partSetHeader ? PartSetHeader.toJSON(message.partSetHeader) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): BlockID { + const message = { ...baseBlockID } as BlockID; + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } else { + message.hash = new Uint8Array(); + } + if (object.partSetHeader !== undefined && object.partSetHeader !== null) { + message.partSetHeader = PartSetHeader.fromPartial(object.partSetHeader); + } else { + message.partSetHeader = undefined; + } + return message; + }, +}; + +const baseHeader: object = { chainId: "", height: Long.ZERO }; + +export const Header = { + encode(message: Header, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.version !== undefined) { + Consensus.encode(message.version, writer.uint32(10).fork()).ldelim(); + } + if (message.chainId !== "") { + writer.uint32(18).string(message.chainId); + } + if (!message.height.isZero()) { + writer.uint32(24).int64(message.height); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(34).fork()).ldelim(); + } + if (message.lastBlockId !== undefined) { + BlockID.encode(message.lastBlockId, writer.uint32(42).fork()).ldelim(); + } + if (message.lastCommitHash.length !== 0) { + writer.uint32(50).bytes(message.lastCommitHash); + } + if (message.dataHash.length !== 0) { + writer.uint32(58).bytes(message.dataHash); + } + if (message.validatorsHash.length !== 0) { + writer.uint32(66).bytes(message.validatorsHash); + } + if (message.nextValidatorsHash.length !== 0) { + writer.uint32(74).bytes(message.nextValidatorsHash); + } + if (message.consensusHash.length !== 0) { + writer.uint32(82).bytes(message.consensusHash); + } + if (message.appHash.length !== 0) { + writer.uint32(90).bytes(message.appHash); + } + if (message.lastResultsHash.length !== 0) { + writer.uint32(98).bytes(message.lastResultsHash); + } + if (message.evidenceHash.length !== 0) { + writer.uint32(106).bytes(message.evidenceHash); + } + if (message.proposerAddress.length !== 0) { + writer.uint32(114).bytes(message.proposerAddress); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Header { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseHeader } as Header; + message.lastCommitHash = new Uint8Array(); + message.dataHash = new Uint8Array(); + message.validatorsHash = new Uint8Array(); + message.nextValidatorsHash = new Uint8Array(); + message.consensusHash = new Uint8Array(); + message.appHash = new Uint8Array(); + message.lastResultsHash = new Uint8Array(); + message.evidenceHash = new Uint8Array(); + message.proposerAddress = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = Consensus.decode(reader, reader.uint32()); + break; + case 2: + message.chainId = reader.string(); + break; + case 3: + message.height = reader.int64() as Long; + break; + case 4: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 5: + message.lastBlockId = BlockID.decode(reader, reader.uint32()); + break; + case 6: + message.lastCommitHash = reader.bytes(); + break; + case 7: + message.dataHash = reader.bytes(); + break; + case 8: + message.validatorsHash = reader.bytes(); + break; + case 9: + message.nextValidatorsHash = reader.bytes(); + break; + case 10: + message.consensusHash = reader.bytes(); + break; + case 11: + message.appHash = reader.bytes(); + break; + case 12: + message.lastResultsHash = reader.bytes(); + break; + case 13: + message.evidenceHash = reader.bytes(); + break; + case 14: + message.proposerAddress = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Header { + const message = { ...baseHeader } as Header; + message.lastCommitHash = new Uint8Array(); + message.dataHash = new Uint8Array(); + message.validatorsHash = new Uint8Array(); + message.nextValidatorsHash = new Uint8Array(); + message.consensusHash = new Uint8Array(); + message.appHash = new Uint8Array(); + message.lastResultsHash = new Uint8Array(); + message.evidenceHash = new Uint8Array(); + message.proposerAddress = new Uint8Array(); + if (object.version !== undefined && object.version !== null) { + message.version = Consensus.fromJSON(object.version); + } else { + message.version = undefined; + } + if (object.chainId !== undefined && object.chainId !== null) { + message.chainId = String(object.chainId); + } else { + message.chainId = ""; + } + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.ZERO; + } + if (object.time !== undefined && object.time !== null) { + message.time = fromJsonTimestamp(object.time); + } else { + message.time = undefined; + } + if (object.lastBlockId !== undefined && object.lastBlockId !== null) { + message.lastBlockId = BlockID.fromJSON(object.lastBlockId); + } else { + message.lastBlockId = undefined; + } + if (object.lastCommitHash !== undefined && object.lastCommitHash !== null) { + message.lastCommitHash = bytesFromBase64(object.lastCommitHash); + } + if (object.dataHash !== undefined && object.dataHash !== null) { + message.dataHash = bytesFromBase64(object.dataHash); + } + if (object.validatorsHash !== undefined && object.validatorsHash !== null) { + message.validatorsHash = bytesFromBase64(object.validatorsHash); + } + if (object.nextValidatorsHash !== undefined && object.nextValidatorsHash !== null) { + message.nextValidatorsHash = bytesFromBase64(object.nextValidatorsHash); + } + if (object.consensusHash !== undefined && object.consensusHash !== null) { + message.consensusHash = bytesFromBase64(object.consensusHash); + } + if (object.appHash !== undefined && object.appHash !== null) { + message.appHash = bytesFromBase64(object.appHash); + } + if (object.lastResultsHash !== undefined && object.lastResultsHash !== null) { + message.lastResultsHash = bytesFromBase64(object.lastResultsHash); + } + if (object.evidenceHash !== undefined && object.evidenceHash !== null) { + message.evidenceHash = bytesFromBase64(object.evidenceHash); + } + if (object.proposerAddress !== undefined && object.proposerAddress !== null) { + message.proposerAddress = bytesFromBase64(object.proposerAddress); + } + return message; + }, + + toJSON(message: Header): unknown { + const obj: any = {}; + message.version !== undefined && + (obj.version = message.version ? Consensus.toJSON(message.version) : undefined); + message.chainId !== undefined && (obj.chainId = message.chainId); + message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.time !== undefined && (obj.time = message.time.toISOString()); + message.lastBlockId !== undefined && + (obj.lastBlockId = message.lastBlockId ? BlockID.toJSON(message.lastBlockId) : undefined); + message.lastCommitHash !== undefined && + (obj.lastCommitHash = base64FromBytes( + message.lastCommitHash !== undefined ? message.lastCommitHash : new Uint8Array(), + )); + message.dataHash !== undefined && + (obj.dataHash = base64FromBytes(message.dataHash !== undefined ? message.dataHash : new Uint8Array())); + message.validatorsHash !== undefined && + (obj.validatorsHash = base64FromBytes( + message.validatorsHash !== undefined ? message.validatorsHash : new Uint8Array(), + )); + message.nextValidatorsHash !== undefined && + (obj.nextValidatorsHash = base64FromBytes( + message.nextValidatorsHash !== undefined ? message.nextValidatorsHash : new Uint8Array(), + )); + message.consensusHash !== undefined && + (obj.consensusHash = base64FromBytes( + message.consensusHash !== undefined ? message.consensusHash : new Uint8Array(), + )); + message.appHash !== undefined && + (obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array())); + message.lastResultsHash !== undefined && + (obj.lastResultsHash = base64FromBytes( + message.lastResultsHash !== undefined ? message.lastResultsHash : new Uint8Array(), + )); + message.evidenceHash !== undefined && + (obj.evidenceHash = base64FromBytes( + message.evidenceHash !== undefined ? message.evidenceHash : new Uint8Array(), + )); + message.proposerAddress !== undefined && + (obj.proposerAddress = base64FromBytes( + message.proposerAddress !== undefined ? message.proposerAddress : new Uint8Array(), + )); + return obj; + }, + + fromPartial(object: DeepPartial
): Header { + const message = { ...baseHeader } as Header; + if (object.version !== undefined && object.version !== null) { + message.version = Consensus.fromPartial(object.version); + } else { + message.version = undefined; + } + if (object.chainId !== undefined && object.chainId !== null) { + message.chainId = object.chainId; + } else { + message.chainId = ""; + } + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.ZERO; + } + if (object.time !== undefined && object.time !== null) { + message.time = object.time; + } else { + message.time = undefined; + } + if (object.lastBlockId !== undefined && object.lastBlockId !== null) { + message.lastBlockId = BlockID.fromPartial(object.lastBlockId); + } else { + message.lastBlockId = undefined; + } + if (object.lastCommitHash !== undefined && object.lastCommitHash !== null) { + message.lastCommitHash = object.lastCommitHash; + } else { + message.lastCommitHash = new Uint8Array(); + } + if (object.dataHash !== undefined && object.dataHash !== null) { + message.dataHash = object.dataHash; + } else { + message.dataHash = new Uint8Array(); + } + if (object.validatorsHash !== undefined && object.validatorsHash !== null) { + message.validatorsHash = object.validatorsHash; + } else { + message.validatorsHash = new Uint8Array(); + } + if (object.nextValidatorsHash !== undefined && object.nextValidatorsHash !== null) { + message.nextValidatorsHash = object.nextValidatorsHash; + } else { + message.nextValidatorsHash = new Uint8Array(); + } + if (object.consensusHash !== undefined && object.consensusHash !== null) { + message.consensusHash = object.consensusHash; + } else { + message.consensusHash = new Uint8Array(); + } + if (object.appHash !== undefined && object.appHash !== null) { + message.appHash = object.appHash; + } else { + message.appHash = new Uint8Array(); + } + if (object.lastResultsHash !== undefined && object.lastResultsHash !== null) { + message.lastResultsHash = object.lastResultsHash; + } else { + message.lastResultsHash = new Uint8Array(); + } + if (object.evidenceHash !== undefined && object.evidenceHash !== null) { + message.evidenceHash = object.evidenceHash; + } else { + message.evidenceHash = new Uint8Array(); + } + if (object.proposerAddress !== undefined && object.proposerAddress !== null) { + message.proposerAddress = object.proposerAddress; + } else { + message.proposerAddress = new Uint8Array(); + } + return message; + }, +}; + +const baseData: object = {}; + +export const Data = { + encode(message: Data, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.txs) { + writer.uint32(10).bytes(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Data { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseData } as Data; + message.txs = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txs.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Data { + const message = { ...baseData } as Data; + message.txs = []; + if (object.txs !== undefined && object.txs !== null) { + for (const e of object.txs) { + message.txs.push(bytesFromBase64(e)); + } + } + return message; + }, + + toJSON(message: Data): unknown { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + } else { + obj.txs = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): Data { + const message = { ...baseData } as Data; + message.txs = []; + if (object.txs !== undefined && object.txs !== null) { + for (const e of object.txs) { + message.txs.push(e); + } + } + return message; + }, +}; + +const baseVote: object = { type: 0, height: Long.ZERO, round: 0, validatorIndex: 0 }; + +export const Vote = { + encode(message: Vote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.type !== 0) { + writer.uint32(8).int32(message.type); + } + if (!message.height.isZero()) { + writer.uint32(16).int64(message.height); + } + if (message.round !== 0) { + writer.uint32(24).int32(message.round); + } + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(34).fork()).ldelim(); + } + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(42).fork()).ldelim(); + } + if (message.validatorAddress.length !== 0) { + writer.uint32(50).bytes(message.validatorAddress); + } + if (message.validatorIndex !== 0) { + writer.uint32(56).int32(message.validatorIndex); + } + if (message.signature.length !== 0) { + writer.uint32(66).bytes(message.signature); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Vote { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseVote } as Vote; + message.validatorAddress = new Uint8Array(); + message.signature = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32() as any; + break; + case 2: + message.height = reader.int64() as Long; + break; + case 3: + message.round = reader.int32(); + break; + case 4: + message.blockId = BlockID.decode(reader, reader.uint32()); + break; + case 5: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 6: + message.validatorAddress = reader.bytes(); + break; + case 7: + message.validatorIndex = reader.int32(); + break; + case 8: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Vote { + const message = { ...baseVote } as Vote; + message.validatorAddress = new Uint8Array(); + message.signature = new Uint8Array(); + if (object.type !== undefined && object.type !== null) { + message.type = signedMsgTypeFromJSON(object.type); + } else { + message.type = 0; + } + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.ZERO; + } + if (object.round !== undefined && object.round !== null) { + message.round = Number(object.round); + } else { + message.round = 0; + } + if (object.blockId !== undefined && object.blockId !== null) { + message.blockId = BlockID.fromJSON(object.blockId); + } else { + message.blockId = undefined; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromJsonTimestamp(object.timestamp); + } else { + message.timestamp = undefined; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = bytesFromBase64(object.validatorAddress); + } + if (object.validatorIndex !== undefined && object.validatorIndex !== null) { + message.validatorIndex = Number(object.validatorIndex); + } else { + message.validatorIndex = 0; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; + }, + + toJSON(message: Vote): unknown { + const obj: any = {}; + message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type)); + message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.round !== undefined && (obj.round = message.round); + message.blockId !== undefined && + (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); + message.validatorAddress !== undefined && + (obj.validatorAddress = base64FromBytes( + message.validatorAddress !== undefined ? message.validatorAddress : new Uint8Array(), + )); + message.validatorIndex !== undefined && (obj.validatorIndex = message.validatorIndex); + message.signature !== undefined && + (obj.signature = base64FromBytes( + message.signature !== undefined ? message.signature : new Uint8Array(), + )); + return obj; + }, + + fromPartial(object: DeepPartial): Vote { + const message = { ...baseVote } as Vote; + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = 0; + } + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.ZERO; + } + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } else { + message.round = 0; + } + if (object.blockId !== undefined && object.blockId !== null) { + message.blockId = BlockID.fromPartial(object.blockId); + } else { + message.blockId = undefined; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = object.timestamp; + } else { + message.timestamp = undefined; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = new Uint8Array(); + } + if (object.validatorIndex !== undefined && object.validatorIndex !== null) { + message.validatorIndex = object.validatorIndex; + } else { + message.validatorIndex = 0; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = object.signature; + } else { + message.signature = new Uint8Array(); + } + return message; + }, +}; + +const baseCommit: object = { height: Long.ZERO, round: 0 }; + +export const Commit = { + encode(message: Commit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.height.isZero()) { + writer.uint32(8).int64(message.height); + } + if (message.round !== 0) { + writer.uint32(16).int32(message.round); + } + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.signatures) { + CommitSig.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Commit { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCommit } as Commit; + message.signatures = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64() as Long; + break; + case 2: + message.round = reader.int32(); + break; + case 3: + message.blockId = BlockID.decode(reader, reader.uint32()); + break; + case 4: + message.signatures.push(CommitSig.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Commit { + const message = { ...baseCommit } as Commit; + message.signatures = []; + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.ZERO; + } + if (object.round !== undefined && object.round !== null) { + message.round = Number(object.round); + } else { + message.round = 0; + } + if (object.blockId !== undefined && object.blockId !== null) { + message.blockId = BlockID.fromJSON(object.blockId); + } else { + message.blockId = undefined; + } + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(CommitSig.fromJSON(e)); + } + } + return message; + }, + + toJSON(message: Commit): unknown { + const obj: any = {}; + message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.round !== undefined && (obj.round = message.round); + message.blockId !== undefined && + (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); + if (message.signatures) { + obj.signatures = message.signatures.map((e) => (e ? CommitSig.toJSON(e) : undefined)); + } else { + obj.signatures = []; + } + return obj; + }, + + fromPartial(object: DeepPartial): Commit { + const message = { ...baseCommit } as Commit; + message.signatures = []; + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.ZERO; + } + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } else { + message.round = 0; + } + if (object.blockId !== undefined && object.blockId !== null) { + message.blockId = BlockID.fromPartial(object.blockId); + } else { + message.blockId = undefined; + } + if (object.signatures !== undefined && object.signatures !== null) { + for (const e of object.signatures) { + message.signatures.push(CommitSig.fromPartial(e)); + } + } + return message; + }, +}; + +const baseCommitSig: object = { blockIdFlag: 0 }; + +export const CommitSig = { + encode(message: CommitSig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.blockIdFlag !== 0) { + writer.uint32(8).int32(message.blockIdFlag); + } + if (message.validatorAddress.length !== 0) { + writer.uint32(18).bytes(message.validatorAddress); + } + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(26).fork()).ldelim(); + } + if (message.signature.length !== 0) { + writer.uint32(34).bytes(message.signature); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CommitSig { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCommitSig } as CommitSig; + message.validatorAddress = new Uint8Array(); + message.signature = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockIdFlag = reader.int32() as any; + break; + case 2: + message.validatorAddress = reader.bytes(); + break; + case 3: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 4: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CommitSig { + const message = { ...baseCommitSig } as CommitSig; + message.validatorAddress = new Uint8Array(); + message.signature = new Uint8Array(); + if (object.blockIdFlag !== undefined && object.blockIdFlag !== null) { + message.blockIdFlag = blockIDFlagFromJSON(object.blockIdFlag); + } else { + message.blockIdFlag = 0; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = bytesFromBase64(object.validatorAddress); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromJsonTimestamp(object.timestamp); + } else { + message.timestamp = undefined; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; + }, + + toJSON(message: CommitSig): unknown { + const obj: any = {}; + message.blockIdFlag !== undefined && (obj.blockIdFlag = blockIDFlagToJSON(message.blockIdFlag)); + message.validatorAddress !== undefined && + (obj.validatorAddress = base64FromBytes( + message.validatorAddress !== undefined ? message.validatorAddress : new Uint8Array(), + )); + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); + message.signature !== undefined && + (obj.signature = base64FromBytes( + message.signature !== undefined ? message.signature : new Uint8Array(), + )); + return obj; + }, + + fromPartial(object: DeepPartial): CommitSig { + const message = { ...baseCommitSig } as CommitSig; + if (object.blockIdFlag !== undefined && object.blockIdFlag !== null) { + message.blockIdFlag = object.blockIdFlag; + } else { + message.blockIdFlag = 0; + } + if (object.validatorAddress !== undefined && object.validatorAddress !== null) { + message.validatorAddress = object.validatorAddress; + } else { + message.validatorAddress = new Uint8Array(); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = object.timestamp; + } else { + message.timestamp = undefined; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = object.signature; + } else { + message.signature = new Uint8Array(); + } + return message; + }, +}; + +const baseProposal: object = { type: 0, height: Long.ZERO, round: 0, polRound: 0 }; + +export const Proposal = { + encode(message: Proposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.type !== 0) { + writer.uint32(8).int32(message.type); + } + if (!message.height.isZero()) { + writer.uint32(16).int64(message.height); + } + if (message.round !== 0) { + writer.uint32(24).int32(message.round); + } + if (message.polRound !== 0) { + writer.uint32(32).int32(message.polRound); + } + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(42).fork()).ldelim(); + } + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(50).fork()).ldelim(); + } + if (message.signature.length !== 0) { + writer.uint32(58).bytes(message.signature); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Proposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseProposal } as Proposal; + message.signature = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32() as any; + break; + case 2: + message.height = reader.int64() as Long; + break; + case 3: + message.round = reader.int32(); + break; + case 4: + message.polRound = reader.int32(); + break; + case 5: + message.blockId = BlockID.decode(reader, reader.uint32()); + break; + case 6: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 7: + message.signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Proposal { + const message = { ...baseProposal } as Proposal; + message.signature = new Uint8Array(); + if (object.type !== undefined && object.type !== null) { + message.type = signedMsgTypeFromJSON(object.type); + } else { + message.type = 0; + } + if (object.height !== undefined && object.height !== null) { + message.height = Long.fromString(object.height); + } else { + message.height = Long.ZERO; + } + if (object.round !== undefined && object.round !== null) { + message.round = Number(object.round); + } else { + message.round = 0; + } + if (object.polRound !== undefined && object.polRound !== null) { + message.polRound = Number(object.polRound); + } else { + message.polRound = 0; + } + if (object.blockId !== undefined && object.blockId !== null) { + message.blockId = BlockID.fromJSON(object.blockId); + } else { + message.blockId = undefined; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromJsonTimestamp(object.timestamp); + } else { + message.timestamp = undefined; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + return message; + }, + + toJSON(message: Proposal): unknown { + const obj: any = {}; + message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type)); + message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.round !== undefined && (obj.round = message.round); + message.polRound !== undefined && (obj.polRound = message.polRound); + message.blockId !== undefined && + (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); + message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); + message.signature !== undefined && + (obj.signature = base64FromBytes( + message.signature !== undefined ? message.signature : new Uint8Array(), + )); + return obj; + }, + + fromPartial(object: DeepPartial): Proposal { + const message = { ...baseProposal } as Proposal; + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = 0; + } + if (object.height !== undefined && object.height !== null) { + message.height = object.height as Long; + } else { + message.height = Long.ZERO; + } + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } else { + message.round = 0; + } + if (object.polRound !== undefined && object.polRound !== null) { + message.polRound = object.polRound; + } else { + message.polRound = 0; + } + if (object.blockId !== undefined && object.blockId !== null) { + message.blockId = BlockID.fromPartial(object.blockId); + } else { + message.blockId = undefined; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = object.timestamp; + } else { + message.timestamp = undefined; + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = object.signature; + } else { + message.signature = new Uint8Array(); + } + return message; + }, +}; + +const baseSignedHeader: object = {}; + +export const SignedHeader = { + encode(message: SignedHeader, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.header !== undefined) { + Header.encode(message.header, writer.uint32(10).fork()).ldelim(); + } + if (message.commit !== undefined) { + Commit.encode(message.commit, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SignedHeader { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSignedHeader } as SignedHeader; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = Header.decode(reader, reader.uint32()); + break; + case 2: + message.commit = Commit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SignedHeader { + const message = { ...baseSignedHeader } as SignedHeader; + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromJSON(object.header); + } else { + message.header = undefined; + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = Commit.fromJSON(object.commit); + } else { + message.commit = undefined; + } + return message; + }, + + toJSON(message: SignedHeader): unknown { + const obj: any = {}; + message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); + message.commit !== undefined && (obj.commit = message.commit ? Commit.toJSON(message.commit) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): SignedHeader { + const message = { ...baseSignedHeader } as SignedHeader; + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromPartial(object.header); + } else { + message.header = undefined; + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = Commit.fromPartial(object.commit); + } else { + message.commit = undefined; + } + return message; + }, +}; + +const baseLightBlock: object = {}; + +export const LightBlock = { + encode(message: LightBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.signedHeader !== undefined) { + SignedHeader.encode(message.signedHeader, writer.uint32(10).fork()).ldelim(); + } + if (message.validatorSet !== undefined) { + ValidatorSet.encode(message.validatorSet, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LightBlock { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseLightBlock } as LightBlock; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signedHeader = SignedHeader.decode(reader, reader.uint32()); + break; + case 2: + message.validatorSet = ValidatorSet.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LightBlock { + const message = { ...baseLightBlock } as LightBlock; + if (object.signedHeader !== undefined && object.signedHeader !== null) { + message.signedHeader = SignedHeader.fromJSON(object.signedHeader); + } else { + message.signedHeader = undefined; + } + if (object.validatorSet !== undefined && object.validatorSet !== null) { + message.validatorSet = ValidatorSet.fromJSON(object.validatorSet); + } else { + message.validatorSet = undefined; + } + return message; + }, + + toJSON(message: LightBlock): unknown { + const obj: any = {}; + message.signedHeader !== undefined && + (obj.signedHeader = message.signedHeader ? SignedHeader.toJSON(message.signedHeader) : undefined); + message.validatorSet !== undefined && + (obj.validatorSet = message.validatorSet ? ValidatorSet.toJSON(message.validatorSet) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): LightBlock { + const message = { ...baseLightBlock } as LightBlock; + if (object.signedHeader !== undefined && object.signedHeader !== null) { + message.signedHeader = SignedHeader.fromPartial(object.signedHeader); + } else { + message.signedHeader = undefined; + } + if (object.validatorSet !== undefined && object.validatorSet !== null) { + message.validatorSet = ValidatorSet.fromPartial(object.validatorSet); + } else { + message.validatorSet = undefined; + } + return message; + }, +}; + +const baseBlockMeta: object = { blockSize: Long.ZERO, numTxs: Long.ZERO }; + +export const BlockMeta = { + encode(message: BlockMeta, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); + } + if (!message.blockSize.isZero()) { + writer.uint32(16).int64(message.blockSize); + } + if (message.header !== undefined) { + Header.encode(message.header, writer.uint32(26).fork()).ldelim(); + } + if (!message.numTxs.isZero()) { + writer.uint32(32).int64(message.numTxs); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BlockMeta { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseBlockMeta } as BlockMeta; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockId = BlockID.decode(reader, reader.uint32()); + break; + case 2: + message.blockSize = reader.int64() as Long; + break; + case 3: + message.header = Header.decode(reader, reader.uint32()); + break; + case 4: + message.numTxs = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): BlockMeta { + const message = { ...baseBlockMeta } as BlockMeta; + if (object.blockId !== undefined && object.blockId !== null) { + message.blockId = BlockID.fromJSON(object.blockId); + } else { + message.blockId = undefined; + } + if (object.blockSize !== undefined && object.blockSize !== null) { + message.blockSize = Long.fromString(object.blockSize); + } else { + message.blockSize = Long.ZERO; + } + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromJSON(object.header); + } else { + message.header = undefined; + } + if (object.numTxs !== undefined && object.numTxs !== null) { + message.numTxs = Long.fromString(object.numTxs); + } else { + message.numTxs = Long.ZERO; + } + return message; + }, + + toJSON(message: BlockMeta): unknown { + const obj: any = {}; + message.blockId !== undefined && + (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); + message.blockSize !== undefined && (obj.blockSize = (message.blockSize || Long.ZERO).toString()); + message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); + message.numTxs !== undefined && (obj.numTxs = (message.numTxs || Long.ZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): BlockMeta { + const message = { ...baseBlockMeta } as BlockMeta; + if (object.blockId !== undefined && object.blockId !== null) { + message.blockId = BlockID.fromPartial(object.blockId); + } else { + message.blockId = undefined; + } + if (object.blockSize !== undefined && object.blockSize !== null) { + message.blockSize = object.blockSize as Long; + } else { + message.blockSize = Long.ZERO; + } + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromPartial(object.header); + } else { + message.header = undefined; + } + if (object.numTxs !== undefined && object.numTxs !== null) { + message.numTxs = object.numTxs as Long; + } else { + message.numTxs = Long.ZERO; + } + return message; + }, +}; + +const baseTxProof: object = {}; + +export const TxProof = { + encode(message: TxProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.rootHash.length !== 0) { + writer.uint32(10).bytes(message.rootHash); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + if (message.proof !== undefined) { + Proof.encode(message.proof, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): TxProof { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseTxProof } as TxProof; + message.rootHash = new Uint8Array(); + message.data = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rootHash = reader.bytes(); + break; + case 2: + message.data = reader.bytes(); + break; + case 3: + message.proof = Proof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): TxProof { + const message = { ...baseTxProof } as TxProof; + message.rootHash = new Uint8Array(); + message.data = new Uint8Array(); + if (object.rootHash !== undefined && object.rootHash !== null) { + message.rootHash = bytesFromBase64(object.rootHash); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromJSON(object.proof); + } else { + message.proof = undefined; + } + return message; + }, + + toJSON(message: TxProof): unknown { + const obj: any = {}; + message.rootHash !== undefined && + (obj.rootHash = base64FromBytes(message.rootHash !== undefined ? message.rootHash : new Uint8Array())); + message.data !== undefined && + (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.proof !== undefined && (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): TxProof { + const message = { ...baseTxProof } as TxProof; + if (object.rootHash !== undefined && object.rootHash !== null) { + message.rootHash = object.rootHash; + } else { + message.rootHash = new Uint8Array(); + } + if (object.data !== undefined && object.data !== null) { + message.data = object.data; + } else { + message.data = new Uint8Array(); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = Proof.fromPartial(object.proof); + } else { + message.proof = undefined; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function toTimestamp(date: Date): Timestamp { + const seconds = numberToLong(date.getTime() / 1_000); + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = t.seconds.toNumber() * 1_000; + millis += t.nanos / 1_000_000; + return new Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof Date) { + return o; + } else if (typeof o === "string") { + return new Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function numberToLong(number: number) { + return Long.fromNumber(number); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/tendermint/types/validator.ts b/src/tendermint/types/validator.ts new file mode 100644 index 00000000..18656d1a --- /dev/null +++ b/src/tendermint/types/validator.ts @@ -0,0 +1,351 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { PublicKey } from "../../tendermint/crypto/keys"; + +export const protobufPackage = "tendermint.types"; + +export interface ValidatorSet { + validators: Validator[]; + proposer?: Validator; + totalVotingPower: Long; +} + +export interface Validator { + address: Uint8Array; + pubKey?: PublicKey; + votingPower: Long; + proposerPriority: Long; +} + +export interface SimpleValidator { + pubKey?: PublicKey; + votingPower: Long; +} + +const baseValidatorSet: object = { totalVotingPower: Long.ZERO }; + +export const ValidatorSet = { + encode(message: ValidatorSet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.validators) { + Validator.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.proposer !== undefined) { + Validator.encode(message.proposer, writer.uint32(18).fork()).ldelim(); + } + if (!message.totalVotingPower.isZero()) { + writer.uint32(24).int64(message.totalVotingPower); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSet { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseValidatorSet } as ValidatorSet; + message.validators = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validators.push(Validator.decode(reader, reader.uint32())); + break; + case 2: + message.proposer = Validator.decode(reader, reader.uint32()); + break; + case 3: + message.totalVotingPower = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ValidatorSet { + const message = { ...baseValidatorSet } as ValidatorSet; + message.validators = []; + if (object.validators !== undefined && object.validators !== null) { + for (const e of object.validators) { + message.validators.push(Validator.fromJSON(e)); + } + } + if (object.proposer !== undefined && object.proposer !== null) { + message.proposer = Validator.fromJSON(object.proposer); + } else { + message.proposer = undefined; + } + if (object.totalVotingPower !== undefined && object.totalVotingPower !== null) { + message.totalVotingPower = Long.fromString(object.totalVotingPower); + } else { + message.totalVotingPower = Long.ZERO; + } + return message; + }, + + toJSON(message: ValidatorSet): unknown { + const obj: any = {}; + if (message.validators) { + obj.validators = message.validators.map((e) => (e ? Validator.toJSON(e) : undefined)); + } else { + obj.validators = []; + } + message.proposer !== undefined && + (obj.proposer = message.proposer ? Validator.toJSON(message.proposer) : undefined); + message.totalVotingPower !== undefined && + (obj.totalVotingPower = (message.totalVotingPower || Long.ZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): ValidatorSet { + const message = { ...baseValidatorSet } as ValidatorSet; + message.validators = []; + if (object.validators !== undefined && object.validators !== null) { + for (const e of object.validators) { + message.validators.push(Validator.fromPartial(e)); + } + } + if (object.proposer !== undefined && object.proposer !== null) { + message.proposer = Validator.fromPartial(object.proposer); + } else { + message.proposer = undefined; + } + if (object.totalVotingPower !== undefined && object.totalVotingPower !== null) { + message.totalVotingPower = object.totalVotingPower as Long; + } else { + message.totalVotingPower = Long.ZERO; + } + return message; + }, +}; + +const baseValidator: object = { votingPower: Long.ZERO, proposerPriority: Long.ZERO }; + +export const Validator = { + encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address.length !== 0) { + writer.uint32(10).bytes(message.address); + } + if (message.pubKey !== undefined) { + PublicKey.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); + } + if (!message.votingPower.isZero()) { + writer.uint32(24).int64(message.votingPower); + } + if (!message.proposerPriority.isZero()) { + writer.uint32(32).int64(message.proposerPriority); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Validator { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseValidator } as Validator; + message.address = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.bytes(); + break; + case 2: + message.pubKey = PublicKey.decode(reader, reader.uint32()); + break; + case 3: + message.votingPower = reader.int64() as Long; + break; + case 4: + message.proposerPriority = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Validator { + const message = { ...baseValidator } as Validator; + message.address = new Uint8Array(); + if (object.address !== undefined && object.address !== null) { + message.address = bytesFromBase64(object.address); + } + if (object.pubKey !== undefined && object.pubKey !== null) { + message.pubKey = PublicKey.fromJSON(object.pubKey); + } else { + message.pubKey = undefined; + } + if (object.votingPower !== undefined && object.votingPower !== null) { + message.votingPower = Long.fromString(object.votingPower); + } else { + message.votingPower = Long.ZERO; + } + if (object.proposerPriority !== undefined && object.proposerPriority !== null) { + message.proposerPriority = Long.fromString(object.proposerPriority); + } else { + message.proposerPriority = Long.ZERO; + } + return message; + }, + + toJSON(message: Validator): unknown { + const obj: any = {}; + message.address !== undefined && + (obj.address = base64FromBytes(message.address !== undefined ? message.address : new Uint8Array())); + message.pubKey !== undefined && + (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined); + message.votingPower !== undefined && (obj.votingPower = (message.votingPower || Long.ZERO).toString()); + message.proposerPriority !== undefined && + (obj.proposerPriority = (message.proposerPriority || Long.ZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): Validator { + const message = { ...baseValidator } as Validator; + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } else { + message.address = new Uint8Array(); + } + if (object.pubKey !== undefined && object.pubKey !== null) { + message.pubKey = PublicKey.fromPartial(object.pubKey); + } else { + message.pubKey = undefined; + } + if (object.votingPower !== undefined && object.votingPower !== null) { + message.votingPower = object.votingPower as Long; + } else { + message.votingPower = Long.ZERO; + } + if (object.proposerPriority !== undefined && object.proposerPriority !== null) { + message.proposerPriority = object.proposerPriority as Long; + } else { + message.proposerPriority = Long.ZERO; + } + return message; + }, +}; + +const baseSimpleValidator: object = { votingPower: Long.ZERO }; + +export const SimpleValidator = { + encode(message: SimpleValidator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pubKey !== undefined) { + PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim(); + } + if (!message.votingPower.isZero()) { + writer.uint32(16).int64(message.votingPower); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SimpleValidator { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseSimpleValidator } as SimpleValidator; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pubKey = PublicKey.decode(reader, reader.uint32()); + break; + case 2: + message.votingPower = reader.int64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SimpleValidator { + const message = { ...baseSimpleValidator } as SimpleValidator; + if (object.pubKey !== undefined && object.pubKey !== null) { + message.pubKey = PublicKey.fromJSON(object.pubKey); + } else { + message.pubKey = undefined; + } + if (object.votingPower !== undefined && object.votingPower !== null) { + message.votingPower = Long.fromString(object.votingPower); + } else { + message.votingPower = Long.ZERO; + } + return message; + }, + + toJSON(message: SimpleValidator): unknown { + const obj: any = {}; + message.pubKey !== undefined && + (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined); + message.votingPower !== undefined && (obj.votingPower = (message.votingPower || Long.ZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): SimpleValidator { + const message = { ...baseSimpleValidator } as SimpleValidator; + if (object.pubKey !== undefined && object.pubKey !== null) { + message.pubKey = PublicKey.fromPartial(object.pubKey); + } else { + message.pubKey = undefined; + } + if (object.votingPower !== undefined && object.votingPower !== null) { + message.votingPower = object.votingPower as Long; + } else { + message.votingPower = Long.ZERO; + } + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (let i = 0; i < arr.byteLength; ++i) { + bin.push(String.fromCharCode(arr[i])); + } + return btoa(bin.join("")); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/src/tendermint/version/types.ts b/src/tendermint/version/types.ts new file mode 100644 index 00000000..095b16b2 --- /dev/null +++ b/src/tendermint/version/types.ts @@ -0,0 +1,185 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "tendermint.version"; + +/** + * App includes the protocol and software version for the application. + * This information is included in ResponseInfo. The App.Protocol can be + * updated in ResponseEndBlock. + */ +export interface App { + protocol: Long; + software: string; +} + +/** + * Consensus captures the consensus rules for processing a block in the blockchain, + * including all blockchain data structures and the rules of the application's + * state transition machine. + */ +export interface Consensus { + block: Long; + app: Long; +} + +const baseApp: object = { protocol: Long.UZERO, software: "" }; + +export const App = { + encode(message: App, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.protocol.isZero()) { + writer.uint32(8).uint64(message.protocol); + } + if (message.software !== "") { + writer.uint32(18).string(message.software); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): App { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseApp } as App; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.protocol = reader.uint64() as Long; + break; + case 2: + message.software = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): App { + const message = { ...baseApp } as App; + if (object.protocol !== undefined && object.protocol !== null) { + message.protocol = Long.fromString(object.protocol); + } else { + message.protocol = Long.UZERO; + } + if (object.software !== undefined && object.software !== null) { + message.software = String(object.software); + } else { + message.software = ""; + } + return message; + }, + + toJSON(message: App): unknown { + const obj: any = {}; + message.protocol !== undefined && (obj.protocol = (message.protocol || Long.UZERO).toString()); + message.software !== undefined && (obj.software = message.software); + return obj; + }, + + fromPartial(object: DeepPartial): App { + const message = { ...baseApp } as App; + if (object.protocol !== undefined && object.protocol !== null) { + message.protocol = object.protocol as Long; + } else { + message.protocol = Long.UZERO; + } + if (object.software !== undefined && object.software !== null) { + message.software = object.software; + } else { + message.software = ""; + } + return message; + }, +}; + +const baseConsensus: object = { block: Long.UZERO, app: Long.UZERO }; + +export const Consensus = { + encode(message: Consensus, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.block.isZero()) { + writer.uint32(8).uint64(message.block); + } + if (!message.app.isZero()) { + writer.uint32(16).uint64(message.app); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Consensus { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseConsensus } as Consensus; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = reader.uint64() as Long; + break; + case 2: + message.app = reader.uint64() as Long; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Consensus { + const message = { ...baseConsensus } as Consensus; + if (object.block !== undefined && object.block !== null) { + message.block = Long.fromString(object.block); + } else { + message.block = Long.UZERO; + } + if (object.app !== undefined && object.app !== null) { + message.app = Long.fromString(object.app); + } else { + message.app = Long.UZERO; + } + return message; + }, + + toJSON(message: Consensus): unknown { + const obj: any = {}; + message.block !== undefined && (obj.block = (message.block || Long.UZERO).toString()); + message.app !== undefined && (obj.app = (message.app || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): Consensus { + const message = { ...baseConsensus } as Consensus; + if (object.block !== undefined && object.block !== null) { + message.block = object.block as Long; + } else { + message.block = Long.UZERO; + } + if (object.app !== undefined && object.app !== null) { + message.app = object.app as Long; + } else { + message.app = Long.UZERO; + } + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..6125e94e --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "declaration": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "lib": ["es2017"], + "module": "commonjs", + "moduleResolution": "node", + "newLine": "LF", + "noEmitOnError": true, + "noFallthroughCasesInSwitch": true, + "noImplicitReturns": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "outDir": "build", + "pretty": true, + "removeComments": false, + "resolveJsonModule": true, + "rootDir": "src", + "sourceMap": true, + "strict": true, + "target": "es2017" + }, + "include": ["src/**/*"] +} diff --git a/wasmd-0.16 b/wasmd-0.16 new file mode 160000 index 00000000..5eb3ae79 --- /dev/null +++ b/wasmd-0.16 @@ -0,0 +1 @@ +Subproject commit 5eb3ae79ca31548bcf1eba730e4bd0e7fa51010b diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 00000000..2d90de03 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,277 @@ +# This file is generated by running "yarn install" inside your project. +# Manual changes might be lost - proceed with caution! + +__metadata: + version: 4 + cacheKey: 7 + +"@protobufjs/aspromise@npm:^1.1.1, @protobufjs/aspromise@npm:^1.1.2": + version: 1.1.2 + resolution: "@protobufjs/aspromise@npm:1.1.2" + checksum: 83ced0798abea0c30ed07dc6338605ddfd8dc7b8b15d84586d155980f90476a8f049e7695d7de79d35dcada29a01710d24d0aa2104e8466412c0cbc6c14d9173 + languageName: node + linkType: hard + +"@protobufjs/base64@npm:^1.1.2": + version: 1.1.2 + resolution: "@protobufjs/base64@npm:1.1.2" + checksum: ae9e84aaf69f5e6aedfb346153c236e6f6ca0e97612c680251fc3e48e6c60746ed553062ea97fdde9f0592fb085e467b9de377a848a224d990a4f0a5e7212fa4 + languageName: node + linkType: hard + +"@protobufjs/codegen@npm:^2.0.4": + version: 2.0.4 + resolution: "@protobufjs/codegen@npm:2.0.4" + checksum: a05d5f8892eeb7696c73f7585a9c3a89eea293b37a582cd1a5d650908393287b0ca068dc55e7bbecd3ec146b2f61afaff2f61e3cb488ea67b900114247b1b717 + languageName: node + linkType: hard + +"@protobufjs/eventemitter@npm:^1.1.0": + version: 1.1.0 + resolution: "@protobufjs/eventemitter@npm:1.1.0" + checksum: 32a84e33f191a3ddc0ca4f8975484c0afaf10c2b27e0cb2008dabe267791420447c25d77b1409595aa6be660a908ada306d40cccb675aee7912c4bc82a9f512e + languageName: node + linkType: hard + +"@protobufjs/fetch@npm:^1.1.0": + version: 1.1.0 + resolution: "@protobufjs/fetch@npm:1.1.0" + dependencies: + "@protobufjs/aspromise": ^1.1.1 + "@protobufjs/inquire": ^1.1.0 + checksum: d682e5d8a164d096d71b05866eb0852d4e1fc024900e3af96a57d9f6396402b96d81b7bd77cda6b983ebcbfd715ec12dd1c1582760b7658a9438c530f5f6f4db + languageName: node + linkType: hard + +"@protobufjs/float@npm:^1.0.2": + version: 1.0.2 + resolution: "@protobufjs/float@npm:1.0.2" + checksum: eee7278de2c4550fac7ec156cba3d4227226a08470426cba6eb04671be9aea035bdf79b7839fdad624171451a4d66e1cdf01e4980e57223ba4f1e34ccd187563 + languageName: node + linkType: hard + +"@protobufjs/inquire@npm:^1.1.0": + version: 1.1.0 + resolution: "@protobufjs/inquire@npm:1.1.0" + checksum: 3541518cca945c2a95e2dcacacdc243fd64abc4cc51c2b691bd0534bd8a1b945c90368f57ba3fed1d6632e1e68d6dac6a7761738f89ccf60bb352b6624c8aacb + languageName: node + linkType: hard + +"@protobufjs/path@npm:^1.1.2": + version: 1.1.2 + resolution: "@protobufjs/path@npm:1.1.2" + checksum: 22f10c5c22e5b3f7bb3e7f0af15bafa1fe42bad3705f27448464c6221d956d10c6c9dad96a48650ec5acba7b072a64ab94da52e21f00e6cd9612da761f02b845 + languageName: node + linkType: hard + +"@protobufjs/pool@npm:^1.1.0": + version: 1.1.0 + resolution: "@protobufjs/pool@npm:1.1.0" + checksum: 5fc4af9e069b58cc39cfd6fded3bfe3de7113d35c1bc3458bfc6699fa42e90c2c6d96b5ae7c274470f272135122a9ab94c708eacfd81e1b0a593917841b07ec4 + languageName: node + linkType: hard + +"@protobufjs/utf8@npm:^1.1.0": + version: 1.1.0 + resolution: "@protobufjs/utf8@npm:1.1.0" + checksum: 5b3fa7425fe2852f6e5643d9a53c6cfb4491630667176c0fc35ddb7a71101559241bafb6b80486144ed75da3d3624095d037c802b578dbdb4cce131cf1bcb7cf + languageName: node + linkType: hard + +"@types/long@npm:^4.0.1": + version: 4.0.1 + resolution: "@types/long@npm:4.0.1" + checksum: ed2a125330dbf2b425b2e58b1e1151a37106ceeec973f9f191fba0bda83ed00fae6d858254022e8b6e7165fec5f0c3872b7cb5f425c753383fed54699fb63b38 + languageName: node + linkType: hard + +"@types/node@npm:>=13.7.0": + version: 15.6.1 + resolution: "@types/node@npm:15.6.1" + checksum: 07b3855bc0a1ba2215455a3ef4ed5e88711321b3cdc0ba1ea0286f6facbdf61530970b9fa7eec79eb1d46231f986c21ef3b7c1f1e0c365cf1b887d76b0addb86 + languageName: node + linkType: hard + +"@types/node@npm:^13.7.0": + version: 13.13.52 + resolution: "@types/node@npm:13.13.52" + checksum: 702db7930d333cc56e38d1ffb0ac394c2ccaae3be41ad6d92d84e5225f2ccf7a69fc19bd9eceafd0c00189876add6464460c5fd47ce4bdc14f6f9b0a7212aee0 + languageName: node + linkType: hard + +"@types/node@npm:^15.6.2": + version: 15.6.2 + resolution: "@types/node@npm:15.6.2" + checksum: e65d6d4750c8bff0d7ecaba1b552118f17b163f3dae8007f6112c54bd591b7087b506c20bb03ce802dc895ef1c2565a750c5246bddab6ffa7d308c2d5f301571 + languageName: node + linkType: hard + +"@types/object-hash@npm:^1.3.0": + version: 1.3.4 + resolution: "@types/object-hash@npm:1.3.4" + checksum: 2ae12c7b341bcefb8f5e163527ab6afb911b3fdcdb2aeacac3231b13d5d5ddd4f75bde48268dd01727bac3488222b629808b20b6650364d011bb3c6692dd38e2 + languageName: node + linkType: hard + +"@types/prettier@npm:^1.19.0": + version: 1.19.1 + resolution: "@types/prettier@npm:1.19.1" + checksum: 394a4364ce5e3364bd230eaeed16cfa816b686bb05fc71968188f6a29b1f69abc235ccd4fd0aef4c4eec124480a6e3420962e99406e2bf2f552c9aae46073546 + languageName: node + linkType: hard + +"cosmjs-types@workspace:.": + version: 0.0.0-use.local + resolution: "cosmjs-types@workspace:." + dependencies: + "@types/long": ^4.0.1 + "@types/node": ^15.6.2 + long: ^4.0.0 + prettier: ^2.3.0 + protobufjs: ~6.10.2 + ts-proto: ^1.81.1 + typescript: ~4.0 + languageName: unknown + linkType: soft + +"dataloader@npm:^1.4.0": + version: 1.4.0 + resolution: "dataloader@npm:1.4.0" + checksum: 1c698b6d4734b66ba1cf445eb89de92474f04d836d906555038d2839b8ec61f67df0abd1b5f798248235c2e4c01a791345d62c292a0bbe63251efc3b0dba3bca + languageName: node + linkType: hard + +"lodash@npm:^4.17.15": + version: 4.17.21 + resolution: "lodash@npm:4.17.21" + checksum: 4983720b9abca930a4a46f18db163d7dad8dd00dbed6db0cc7b499b33b717cce69f80928b27bbb1ff2cbd3b19d251ee90669a8b5ea466072ca81c2ebe91e7468 + languageName: node + linkType: hard + +"long@npm:^4.0.0": + version: 4.0.0 + resolution: "long@npm:4.0.0" + checksum: 9cebc1ee8b9ea15278c977f61250ac41becdf7216104905f0d198c147ed2a7a090a2d83bb212878d3dc3ccb0199e6428862f848ec4b0ecfeab4dfe24eccf21b3 + languageName: node + linkType: hard + +"object-hash@npm:^1.3.1": + version: 1.3.1 + resolution: "object-hash@npm:1.3.1" + checksum: 035cb0b0e66b34611ec5a6bf723380b7f4b3b1292ef44aa9ba93258334a2dca8cf91be28021e9ffa5edf737f97fc54b66d0605bf62db3a63f05191b0002be7bf + languageName: node + linkType: hard + +"prettier@npm:^2.0.2, prettier@npm:^2.3.0": + version: 2.3.0 + resolution: "prettier@npm:2.3.0" + bin: + prettier: bin-prettier.js + checksum: 652640cc8b71bc5277cfb8bf6f161783ca588efcf683c3d630837b39da8d57fef35c9e00ae5855a8e3c75136c42274046c913cc2b2d2968558315f31c6a26981 + languageName: node + linkType: hard + +"protobufjs@npm:^6.8.8": + version: 6.11.2 + resolution: "protobufjs@npm:6.11.2" + dependencies: + "@protobufjs/aspromise": ^1.1.2 + "@protobufjs/base64": ^1.1.2 + "@protobufjs/codegen": ^2.0.4 + "@protobufjs/eventemitter": ^1.1.0 + "@protobufjs/fetch": ^1.1.0 + "@protobufjs/float": ^1.0.2 + "@protobufjs/inquire": ^1.1.0 + "@protobufjs/path": ^1.1.2 + "@protobufjs/pool": ^1.1.0 + "@protobufjs/utf8": ^1.1.0 + "@types/long": ^4.0.1 + "@types/node": ">=13.7.0" + long: ^4.0.0 + bin: + pbjs: bin/pbjs + pbts: bin/pbts + checksum: 3c7c6875ca794ae9c31c532f42368b6fd6d446b20d696f261946feb3f3a9afe482a142afdca7c5bf0cf958b2d79cdbb8bbd56f55bd13b221920267d3332a062e + languageName: node + linkType: hard + +"protobufjs@npm:~6.10.2": + version: 6.10.2 + resolution: "protobufjs@npm:6.10.2" + dependencies: + "@protobufjs/aspromise": ^1.1.2 + "@protobufjs/base64": ^1.1.2 + "@protobufjs/codegen": ^2.0.4 + "@protobufjs/eventemitter": ^1.1.0 + "@protobufjs/fetch": ^1.1.0 + "@protobufjs/float": ^1.0.2 + "@protobufjs/inquire": ^1.1.0 + "@protobufjs/path": ^1.1.2 + "@protobufjs/pool": ^1.1.0 + "@protobufjs/utf8": ^1.1.0 + "@types/long": ^4.0.1 + "@types/node": ^13.7.0 + long: ^4.0.0 + bin: + pbjs: bin/pbjs + pbts: bin/pbts + checksum: 09d629236243465a501b390742e3d0c4429a8801539116b4a3e33a833a3f95359a03adf55121fbe42323e5128e4689a9727efd5293164384104dc4057bf720a5 + languageName: node + linkType: hard + +"ts-poet@npm:^4.5.0": + version: 4.5.0 + resolution: "ts-poet@npm:4.5.0" + dependencies: + "@types/prettier": ^1.19.0 + lodash: ^4.17.15 + prettier: ^2.0.2 + checksum: 8d8e59a29d8ff3d693cb970df1bd294946ee560ee19ed7eb405cf4b2871c51a4de861988be1b65fc03dc2fb4b60f7d41917dd05cfad79cb48a18c137336a297c + languageName: node + linkType: hard + +"ts-proto-descriptors@npm:^1.2.1": + version: 1.2.1 + resolution: "ts-proto-descriptors@npm:1.2.1" + dependencies: + long: ^4.0.0 + protobufjs: ^6.8.8 + checksum: ad62bdf0a3b86a71e6e76d12f89601b9e037df7430225181dfd4546cd62740a9284ba0f94a4bec69fed6a4c938e35ba52089c85edfeebb119d568193d90ba8f5 + languageName: node + linkType: hard + +"ts-proto@npm:^1.81.1": + version: 1.81.1 + resolution: "ts-proto@npm:1.81.1" + dependencies: + "@types/object-hash": ^1.3.0 + dataloader: ^1.4.0 + object-hash: ^1.3.1 + protobufjs: ^6.8.8 + ts-poet: ^4.5.0 + ts-proto-descriptors: ^1.2.1 + bin: + protoc-gen-ts_proto: protoc-gen-ts_proto + checksum: 7d6f3387ea5d6663533260e8f7d9ad0ed0a26cc3563d36c0cc81b29180124d6adba485a3999da944f10faaa34e0f8f0f3c413c03fc44fdc0b411901864164f04 + languageName: node + linkType: hard + +"typescript@patch:typescript@~4.0#builtin": + version: 4.0.7 + resolution: "typescript@patch:typescript@npm%3A4.0.7#builtin::version=4.0.7&hash=a45b0e" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: f234923fbef722077d00ee008aa3492b02adbfe5a67b1c31687a0f7c6cb9946b759665ea643ffc1174298ffb1c59de0cc2abe1a91e57415d51951589eff12446 + languageName: node + linkType: hard + +typescript@~4.0: + version: 4.0.7 + resolution: "typescript@npm:4.0.7" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 1b4c63a228efd6ceec80382b6001dad2c27c9bd46022f965dab907a13275c9ceb7b4b4de8be8902457bd644d2b0f9ddd8cf03b561e35d7cd2d793cf7554afd2d + languageName: node + linkType: hard

>>0):0)?((u|i)&3|0)==0:0){p=i>>>2;d=u>>>2;f=0;while(1){s=a>>>1;c=f+s|0;l=c<<1;u=l+p|0;i=OT(o[e+(u<<2)>>2]|0,h)|0;u=OT(o[e+(u+1<<2)>>2]|0,h)|0;if(!(u>>>0>>0&i>>>0<(t-u|0)>>>0)){i=0;break e}if(r[e+(u+i)>>0]|0){i=0;break e}i=rT(n,e+u|0)|0;if(!i)break;i=(i|0)<0;if((a|0)==1){i=0;break e}else{f=i?f:c;a=i?s:a-s|0}}i=l+d|0;u=OT(o[e+(i<<2)>>2]|0,h)|0;i=OT(o[e+(i+1<<2)>>2]|0,h)|0;if(i>>>0>>0&u>>>0<(t-i|0)>>>0)i=(r[e+(i+u)>>0]|0)==0?e+i|0:0;else i=0}else i=0}while(0);return i|0}function OT(e,t){e=e|0;t=t|0;var n=0;n=fx(e|0)|0;return((t|0)==0?e:n)|0}function PT(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,u=0,a=0,l=0,s=0;i=n+16|0;u=o[i>>2]|0;if(!u){if(!(IT(n)|0)){u=o[i>>2]|0;a=5}else i=0}else a=5;e:do{if((a|0)==5){s=n+20|0;l=o[s>>2]|0;i=l;if((u-l|0)>>>0>>0){i=_A[o[n+36>>2]&7](n,e,t)|0;break}t:do{if((r[n+75>>0]|0)>-1){l=t;while(1){if(!l){a=0;u=e;break t}u=l+-1|0;if((r[e+u>>0]|0)==10)break;else l=u}i=_A[o[n+36>>2]&7](n,e,l)|0;if(i>>>0>>0)break e;a=l;u=e+l|0;t=t-l|0;i=o[s>>2]|0}else{a=0;u=e}}while(0);ix(i|0,u|0,t|0)|0;o[s>>2]=(o[s>>2]|0)+t;i=a+t|0}}while(0);return i|0}function IT(e){e=e|0;var t=0,n=0;t=e+74|0;n=r[t>>0]|0;r[t>>0]=n+255|n;t=o[e>>2]|0;if(!(t&8)){o[e+8>>2]=0;o[e+4>>2]=0;n=o[e+44>>2]|0;o[e+28>>2]=n;o[e+20>>2]=n;o[e+16>>2]=n+(o[e+48>>2]|0);e=0}else{o[e>>2]=t|32;e=-1}return e|0}function NT(e,t){e=Y(e);t=Y(t);var n=0,r=0;n=MT(e)|0;do{if((n&2147483647)>>>0<=2139095040){r=MT(t)|0;if((r&2147483647)>>>0<=2139095040)if((r^n|0)<0){e=(n|0)<0?t:e;break}else{e=e>2]=e,o[d>>2]|0)|0}function RT(e,t){e=Y(e);t=Y(t);var n=0,r=0;n=FT(e)|0;do{if((n&2147483647)>>>0<=2139095040){r=FT(t)|0;if((r&2147483647)>>>0<=2139095040)if((r^n|0)<0){e=(n|0)<0?e:t;break}else{e=e>2]=e,o[d>>2]|0)|0}function LT(e,t){e=Y(e);t=Y(t);var n=0,r=0,i=0,u=0,a=0,l=0,c=0,f=0;u=(s[d>>2]=e,o[d>>2]|0);l=(s[d>>2]=t,o[d>>2]|0);n=u>>>23&255;a=l>>>23&255;c=u&-2147483648;i=l<<1;e:do{if((i|0)!=0?!((n|0)==255|((BT(t)|0)&2147483647)>>>0>2139095040):0){r=u<<1;if(r>>>0<=i>>>0){t=Y(e*Y(0.0));return Y((r|0)==(i|0)?t:e)}if(!n){n=u<<9;if((n|0)>-1){r=n;n=0;do{n=n+-1|0;r=r<<1}while((r|0)>-1)}else n=0;r=u<<1-n}else r=u&8388607|8388608;if(!a){u=l<<9;if((u|0)>-1){i=0;do{i=i+-1|0;u=u<<1}while((u|0)>-1)}else i=0;a=i;l=l<<1-i}else l=l&8388607|8388608;i=r-l|0;u=(i|0)>-1;t:do{if((n|0)>(a|0)){while(1){if(u)if(!i)break;else r=i;r=r<<1;n=n+-1|0;i=r-l|0;u=(i|0)>-1;if((n|0)<=(a|0))break t}t=Y(e*Y(0.0));break e}}while(0);if(u)if(!i){t=Y(e*Y(0.0));break}else r=i;if(r>>>0<8388608)do{r=r<<1;n=n+-1|0}while(r>>>0<8388608);if((n|0)>0)n=r+-8388608|n<<23;else n=r>>>(1-n|0);t=(o[d>>2]=n|c,Y(s[d>>2]))}else f=3}while(0);if((f|0)==3){t=Y(e*t);t=Y(t/t)}return Y(t)}function BT(e){e=Y(e);return(s[d>>2]=e,o[d>>2]|0)|0}function jT(e,t){e=e|0;t=t|0;return oT(o[582]|0,e,t)|0}function UT(e){e=e|0;Ye()}function zT(e){e=e|0;return}function WT(e,t){e=e|0;t=t|0;return 0}function HT(e){e=e|0;if((VT(e+4|0)|0)==-1){hA[o[(o[e>>2]|0)+8>>2]&127](e);e=1}else e=0;return e|0}function VT(e){e=e|0;var t=0;t=o[e>>2]|0;o[e>>2]=t+-1;return t+-1|0}function qT(e){e=e|0;if(HT(e)|0)GT(e);return}function GT(e){e=e|0;var t=0;t=e+8|0;if(!((o[t>>2]|0)!=0?(VT(t)|0)!=-1:0))hA[o[(o[e>>2]|0)+16>>2]&127](e);return}function $T(e){e=e|0;var t=0;t=(e|0)==0?1:e;while(1){e=qk(t)|0;if(e|0)break;e=QT()|0;if(!e){e=0;break}IA[e&0]()}return e|0}function YT(e){e=e|0;return $T(e)|0}function KT(e){e=e|0;Gk(e);return}function XT(e){e=e|0;if((r[e+11>>0]|0)<0)KT(o[e>>2]|0);return}function QT(){var e=0;e=o[2923]|0;o[2923]=e+0;return e|0}function JT(){}function ZT(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;r=t-r-(n>>>0>e>>>0|0)>>>0;return(A=r,e-n>>>0|0)|0}function ex(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;n=e+n>>>0;return(A=t+r+(n>>>0>>0|0)>>>0,n|0)|0}function tx(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,u=0,a=0,l=0;a=e+n|0;t=t&255;if((n|0)>=67){while(e&3){r[e>>0]=t;e=e+1|0}i=a&-4|0;u=i-64|0;l=t|t<<8|t<<16|t<<24;while((e|0)<=(u|0)){o[e>>2]=l;o[e+4>>2]=l;o[e+8>>2]=l;o[e+12>>2]=l;o[e+16>>2]=l;o[e+20>>2]=l;o[e+24>>2]=l;o[e+28>>2]=l;o[e+32>>2]=l;o[e+36>>2]=l;o[e+40>>2]=l;o[e+44>>2]=l;o[e+48>>2]=l;o[e+52>>2]=l;o[e+56>>2]=l;o[e+60>>2]=l;e=e+64|0}while((e|0)<(i|0)){o[e>>2]=l;e=e+4|0}}while((e|0)<(a|0)){r[e>>0]=t;e=e+1|0}return a-n|0}function nx(e,t,n){e=e|0;t=t|0;n=n|0;if((n|0)<32){A=t<>>32-n;return e<>>n;return e>>>n|(t&(1<>>n-32|0}function ix(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,u=0,a=0;if((n|0)>=8192)return He(e|0,t|0,n|0)|0;a=e|0;u=e+n|0;if((e&3)==(t&3)){while(e&3){if(!n)return a|0;r[e>>0]=r[t>>0]|0;e=e+1|0;t=t+1|0;n=n-1|0}n=u&-4|0;i=n-64|0;while((e|0)<=(i|0)){o[e>>2]=o[t>>2];o[e+4>>2]=o[t+4>>2];o[e+8>>2]=o[t+8>>2];o[e+12>>2]=o[t+12>>2];o[e+16>>2]=o[t+16>>2];o[e+20>>2]=o[t+20>>2];o[e+24>>2]=o[t+24>>2];o[e+28>>2]=o[t+28>>2];o[e+32>>2]=o[t+32>>2];o[e+36>>2]=o[t+36>>2];o[e+40>>2]=o[t+40>>2];o[e+44>>2]=o[t+44>>2];o[e+48>>2]=o[t+48>>2];o[e+52>>2]=o[t+52>>2];o[e+56>>2]=o[t+56>>2];o[e+60>>2]=o[t+60>>2];e=e+64|0;t=t+64|0}while((e|0)<(n|0)){o[e>>2]=o[t>>2];e=e+4|0;t=t+4|0}}else{n=u-4|0;while((e|0)<(n|0)){r[e>>0]=r[t>>0]|0;r[e+1>>0]=r[t+1>>0]|0;r[e+2>>0]=r[t+2>>0]|0;r[e+3>>0]=r[t+3>>0]|0;e=e+4|0;t=t+4|0}}while((e|0)<(u|0)){r[e>>0]=r[t>>0]|0;e=e+1|0;t=t+1|0}return a|0}function ox(e){e=e|0;var t=0;t=r[m+(e&255)>>0]|0;if((t|0)<8)return t|0;t=r[m+(e>>8&255)>>0]|0;if((t|0)<8)return t+8|0;t=r[m+(e>>16&255)>>0]|0;if((t|0)<8)return t+16|0;return(r[m+(e>>>24)>>0]|0)+24|0}function ux(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;var u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,h=0,v=0;f=e;s=t;c=s;a=n;p=r;l=p;if(!c){u=(i|0)!=0;if(!l){if(u){o[i>>2]=(f>>>0)%(a>>>0);o[i+4>>2]=0}p=0;i=(f>>>0)/(a>>>0)>>>0;return(A=p,i)|0}else{if(!u){p=0;i=0;return(A=p,i)|0}o[i>>2]=e|0;o[i+4>>2]=t&0;p=0;i=0;return(A=p,i)|0}}u=(l|0)==0;do{if(a){if(!u){u=($(l|0)|0)-($(c|0)|0)|0;if(u>>>0<=31){d=u+1|0;l=31-u|0;t=u-31>>31;a=d;e=f>>>(d>>>0)&t|c<>>(d>>>0)&t;u=0;l=f<>2]=e|0;o[i+4>>2]=s|t&0;p=0;i=0;return(A=p,i)|0}u=a-1|0;if(u&a|0){l=($(a|0)|0)+33-($(c|0)|0)|0;v=64-l|0;d=32-l|0;s=d>>31;h=l-32|0;t=h>>31;a=l;e=d-1>>31&c>>>(h>>>0)|(c<>>(l>>>0))&t;t=t&c>>>(l>>>0);u=f<>>(h>>>0))&s|f<>31;break}if(i|0){o[i>>2]=u&f;o[i+4>>2]=0}if((a|0)==1){h=s|t&0;v=e|0|0;return(A=h,v)|0}else{v=ox(a|0)|0;h=c>>>(v>>>0)|0;v=c<<32-v|f>>>(v>>>0)|0;return(A=h,v)|0}}else{if(u){if(i|0){o[i>>2]=(c>>>0)%(a>>>0);o[i+4>>2]=0}h=0;v=(c>>>0)/(a>>>0)>>>0;return(A=h,v)|0}if(!f){if(i|0){o[i>>2]=0;o[i+4>>2]=(c>>>0)%(l>>>0)}h=0;v=(c>>>0)/(l>>>0)>>>0;return(A=h,v)|0}u=l-1|0;if(!(u&l)){if(i|0){o[i>>2]=e|0;o[i+4>>2]=u&c|t&0}h=0;v=c>>>((ox(l|0)|0)>>>0);return(A=h,v)|0}u=($(l|0)|0)-($(c|0)|0)|0;if(u>>>0<=30){t=u+1|0;l=31-u|0;a=t;e=c<>>(t>>>0);t=c>>>(t>>>0);u=0;l=f<>2]=e|0;o[i+4>>2]=s|t&0;h=0;v=0;return(A=h,v)|0}}while(0);if(!a){c=l;s=0;l=0}else{d=n|0|0;f=p|r&0;c=ex(d|0,f|0,-1,-1)|0;n=A;s=l;l=0;do{r=s;s=u>>>31|s<<1;u=l|u<<1;r=e<<1|r>>>31|0;p=e>>>31|t<<1|0;ZT(c|0,n|0,r|0,p|0)|0;v=A;h=v>>31|((v|0)<0?-1:0)<<1;l=h&1;e=ZT(r|0,p|0,h&d|0,(((v|0)<0?-1:0)>>31|((v|0)<0?-1:0)<<1)&f|0)|0;t=A;a=a-1|0}while((a|0)!=0);c=s;s=0}a=0;if(i|0){o[i>>2]=e;o[i+4>>2]=t}h=(u|0)>>>31|(c|a)<<1|(a<<1|u>>>31)&0|s;v=(u<<1|0>>>31)&-2|l;return(A=h,v)|0}function ax(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;return ux(e,t,n,r,0)|0}function lx(e){e=e|0;var t=0,n=0;n=e+15&-16|0;t=o[f>>2]|0;e=t+n|0;if((n|0)>0&(e|0)<(t|0)|(e|0)<0){Z()|0;qe(12);return-1}o[f>>2]=e;if((e|0)>(J()|0)?(Q()|0)==0:0){o[f>>2]=t;qe(12);return-1}return t|0}function sx(e,t,n){e=e|0;t=t|0;n=n|0;var i=0;if((t|0)<(e|0)&(e|0)<(t+n|0)){i=e;t=t+n|0;e=e+n|0;while((n|0)>0){e=e-1|0;t=t-1|0;n=n-1|0;r[e>>0]=r[t>>0]|0}e=i}else ix(e,t,n)|0;return e|0}function cx(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0;u=h;h=h+16|0;i=u|0;ux(e,t,n,r,i)|0;h=u;return(A=o[i+4>>2]|0,o[i>>2]|0)|0}function fx(e){e=e|0;return(e&255)<<24|(e>>8&255)<<16|(e>>16&255)<<8|e>>>24|0}function dx(e,t,n,r,i,o){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;o=o|0;cA[e&1](t|0,n|0,r|0,i|0,o|0)}function px(e,t,n){e=e|0;t=t|0;n=Y(n);fA[e&1](t|0,Y(n))}function hx(e,t,n){e=e|0;t=t|0;n=+n;dA[e&31](t|0,+n)}function vx(e,t,n,r){e=e|0;t=t|0;n=Y(n);r=Y(r);return Y(pA[e&0](t|0,Y(n),Y(r)))}function mx(e,t){e=e|0;t=t|0;hA[e&127](t|0)}function gx(e,t,n){e=e|0;t=t|0;n=n|0;vA[e&31](t|0,n|0)}function yx(e,t){e=e|0;t=t|0;return mA[e&31](t|0)|0}function _x(e,t,n,r,i){e=e|0;t=t|0;n=+n;r=+r;i=i|0;gA[e&1](t|0,+n,+r,i|0)}function bx(e,t,n,r){e=e|0;t=t|0;n=+n;r=+r;yA[e&1](t|0,+n,+r)}function wx(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;return _A[e&7](t|0,n|0,r|0)|0}function Ex(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;return+bA[e&1](t|0,n|0,r|0)}function Dx(e,t){e=e|0;t=t|0;return+wA[e&15](t|0)}function Sx(e,t,n){e=e|0;t=t|0;n=+n;return EA[e&1](t|0,+n)|0}function Cx(e,t,n){e=e|0;t=t|0;n=n|0;return DA[e&15](t|0,n|0)|0}function kx(e,t,n,r,i,o){e=e|0;t=t|0;n=n|0;r=+r;i=+i;o=o|0;SA[e&1](t|0,n|0,+r,+i,o|0)}function Tx(e,t,n,r,i,o,u){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;o=o|0;u=u|0;CA[e&1](t|0,n|0,r|0,i|0,o|0,u|0)}function xx(e,t,n){e=e|0;t=t|0;n=n|0;return+kA[e&7](t|0,n|0)}function Ax(e){e=e|0;return TA[e&7]()|0}function Ox(e,t,n,r,i,o){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;o=o|0;return xA[e&1](t|0,n|0,r|0,i|0,o|0)|0}function Px(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=+i;AA[e&1](t|0,n|0,r|0,+i)}function Ix(e,t,n,r,i,o,u){e=e|0;t=t|0;n=n|0;r=Y(r);i=i|0;o=Y(o);u=u|0;OA[e&1](t|0,n|0,Y(r),i|0,Y(o),u|0)}function Nx(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;PA[e&15](t|0,n|0,r|0)}function Mx(e){e=e|0;IA[e&0]()}function Rx(e,t,n,r){e=e|0;t=t|0;n=n|0;r=+r;NA[e&15](t|0,n|0,+r)}function Fx(e,t,n){e=e|0;t=+t;n=+n;return MA[e&1](+t,+n)|0}function Lx(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;RA[e&15](t|0,n|0,r|0,i|0)}function Bx(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;K(0)}function jx(e,t){e=e|0;t=Y(t);K(1)}function Ux(e,t){e=e|0;t=+t;K(2)}function zx(e,t,n){e=e|0;t=Y(t);n=Y(n);K(3);return ft}function Wx(e){e=e|0;K(4)}function Hx(e,t){e=e|0;t=t|0;K(5)}function Vx(e){e=e|0;K(6);return 0}function qx(e,t,n,r){e=e|0;t=+t;n=+n;r=r|0;K(7)}function Gx(e,t,n){e=e|0;t=+t;n=+n;K(8)}function $x(e,t,n){e=e|0;t=t|0;n=n|0;K(9);return 0}function Yx(e,t,n){e=e|0;t=t|0;n=n|0;K(10);return 0.0}function Kx(e){e=e|0;K(11);return 0.0}function Xx(e,t){e=e|0;t=+t;K(12);return 0}function Qx(e,t){e=e|0;t=t|0;K(13);return 0}function Jx(e,t,n,r,i){e=e|0;t=t|0;n=+n;r=+r;i=i|0;K(14)}function Zx(e,t,n,r,i,o){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;o=o|0;K(15)}function eA(e,t){e=e|0;t=t|0;K(16);return 0.0}function tA(){K(17);return 0}function nA(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;K(18);return 0}function rA(e,t,n,r){e=e|0;t=t|0;n=n|0;r=+r;K(19)}function iA(e,t,n,r,i,o){e=e|0;t=t|0;n=Y(n);r=r|0;i=Y(i);o=o|0;K(20)}function oA(e,t,n){e=e|0;t=t|0;n=n|0;K(21)}function uA(){K(22)}function aA(e,t,n){e=e|0;t=t|0;n=+n;K(23)}function lA(e,t){e=+e;t=+t;K(24);return 0}function sA(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;K(25)}var cA=[Bx,DE];var fA=[jx,qi];var dA=[Ux,yo,_o,bo,wo,Eo,Do,So,ko,To,Ao,Oo,Po,Io,No,Mo,Ro,Fo,Lo,Ux,Ux,Ux,Ux,Ux,Ux,Ux,Ux,Ux,Ux,Ux,Ux,Ux];var pA=[zx];var hA=[Wx,zT,hl,vl,ml,Kd,Xd,Qd,yb,_b,bb,oE,uE,aE,uk,ak,lk,bt,Xi,to,Co,xo,ju,Uu,Ka,Sl,Wl,ps,Ns,rc,kc,qc,df,Mf,Zf,yd,Ld,gp,Fp,th,bh,jh,iv,kv,Vv,am,xm,Wi,cg,Ag,Qg,yy,Fy,o_,g_,b_,U_,H_,ab,Db,kb,Gb,pw,Cl,OD,pS,PS,KS,bC,BC,XC,ZC,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx,Wx];var vA=[Hx,no,ro,uo,ao,lo,so,co,fo,vo,mo,go,eu,ru,iu,ou,uu,au,lu,pu,gu,Ku,Ov,$v,Ey,ND,ww,eS,Hx,Hx,Hx,Hx];var mA=[Vx,Yk,Ki,zo,qo,Go,$o,Yo,Ko,Xo,Jo,Zo,hu,vu,zu,Pm,Uy,Kb,BD,UD,Vx,Vx,Vx,Vx,Vx,Vx,Vx,Vx,Vx,Vx,Vx,Vx];var gA=[qx,Wu];var yA=[Gx,cb];var _A=[$x,Kk,Xk,nT,ac,wp,hg,ZS];var bA=[Yx,rd];var wA=[Kx,tu,nu,su,Hu,Vu,qu,Gu,$u,Yu,Kx,Kx,Kx,Kx,Kx,Kx];var EA=[Xx,p_];var DA=[Qx,WT,mu,tl,gs,Oc,Kc,zd,Up,fm,Gi,RS,Qx,Qx,Qx,Qx];var SA=[Jx,Gl];var CA=[Zx,SC];var kA=[eA,cu,Xu,Qu,Ju,Ed,eA,eA];var TA=[tA,Zu,$i,Ui,C_,$_,Pb,rk];var xA=[nA,Fr];var AA=[rA,Sh];var OA=[iA,_u];var PA=[oA,Wo,Qo,fu,du,Ls,mf,Hh,lv,Vi,JE,gS,WC,oA,oA,oA];var IA=[uA];var NA=[aA,io,oo,po,ho,Bo,jo,Uo,oh,Ng,l_,aA,aA,aA,aA,aA];var MA=[lA,vb];var RA=[sA,Bf,jm,ty,Ky,P_,Z_,Bb,yw,qD,hk,sA,sA,sA,sA,sA];return{_llvm_bswap_i32:fx,dynCall_idd:Fx,dynCall_i:Ax,_i64Subtract:ZT,___udivdi3:ax,dynCall_vif:px,setThrew:mt,dynCall_viii:Nx,_bitshift64Lshr:rx,_bitshift64Shl:nx,dynCall_vi:mx,dynCall_viiddi:kx,dynCall_diii:Ex,dynCall_iii:Cx,_memset:tx,_sbrk:lx,_memcpy:ix,__GLOBAL__sub_I_Yoga_cpp:ji,dynCall_vii:gx,___uremdi3:cx,dynCall_vid:hx,stackAlloc:dt,_nbind_init:Ak,getTempRet0:yt,dynCall_di:Dx,dynCall_iid:Sx,setTempRet0:gt,_i64Add:ex,dynCall_fiff:vx,dynCall_iiii:wx,_emscripten_get_global_libc:$k,dynCall_viid:Rx,dynCall_viiid:Px,dynCall_viififi:Ix,dynCall_ii:yx,__GLOBAL__sub_I_Binding_cc:wD,dynCall_viiii:Lx,dynCall_iiiiii:Ox,stackSave:pt,dynCall_viiiii:dx,__GLOBAL__sub_I_nbind_cc:ea,dynCall_vidd:bx,_free:Gk,runPostSets:JT,dynCall_viiiiii:Tx,establishStackSpace:vt,_memmove:sx,stackRestore:ht,_malloc:qk,__GLOBAL__sub_I_common_cc:iw,dynCall_viddi:_x,dynCall_dii:xx,dynCall_v:Mx}}(Module.asmGlobalArg,Module.asmLibraryArg,buffer),_llvm_bswap_i32=Module._llvm_bswap_i32=asm._llvm_bswap_i32,getTempRet0=Module.getTempRet0=asm.getTempRet0,___udivdi3=Module.___udivdi3=asm.___udivdi3,setThrew=Module.setThrew=asm.setThrew,_bitshift64Lshr=Module._bitshift64Lshr=asm._bitshift64Lshr,_bitshift64Shl=Module._bitshift64Shl=asm._bitshift64Shl,_memset=Module._memset=asm._memset,_sbrk=Module._sbrk=asm._sbrk,_memcpy=Module._memcpy=asm._memcpy,stackAlloc=Module.stackAlloc=asm.stackAlloc,___uremdi3=Module.___uremdi3=asm.___uremdi3,_nbind_init=Module._nbind_init=asm._nbind_init,_i64Subtract=Module._i64Subtract=asm._i64Subtract,setTempRet0=Module.setTempRet0=asm.setTempRet0,_i64Add=Module._i64Add=asm._i64Add,_emscripten_get_global_libc=Module._emscripten_get_global_libc=asm._emscripten_get_global_libc,__GLOBAL__sub_I_Yoga_cpp=Module.__GLOBAL__sub_I_Yoga_cpp=asm.__GLOBAL__sub_I_Yoga_cpp,__GLOBAL__sub_I_Binding_cc=Module.__GLOBAL__sub_I_Binding_cc=asm.__GLOBAL__sub_I_Binding_cc,stackSave=Module.stackSave=asm.stackSave,__GLOBAL__sub_I_nbind_cc=Module.__GLOBAL__sub_I_nbind_cc=asm.__GLOBAL__sub_I_nbind_cc,_free=Module._free=asm._free,runPostSets=Module.runPostSets=asm.runPostSets,establishStackSpace=Module.establishStackSpace=asm.establishStackSpace,_memmove=Module._memmove=asm._memmove,stackRestore=Module.stackRestore=asm.stackRestore,_malloc=Module._malloc=asm._malloc,__GLOBAL__sub_I_common_cc=Module.__GLOBAL__sub_I_common_cc=asm.__GLOBAL__sub_I_common_cc,dynCall_viiiii=Module.dynCall_viiiii=asm.dynCall_viiiii,dynCall_vif=Module.dynCall_vif=asm.dynCall_vif,dynCall_vid=Module.dynCall_vid=asm.dynCall_vid,dynCall_fiff=Module.dynCall_fiff=asm.dynCall_fiff,dynCall_vi=Module.dynCall_vi=asm.dynCall_vi,dynCall_vii=Module.dynCall_vii=asm.dynCall_vii,dynCall_ii=Module.dynCall_ii=asm.dynCall_ii,dynCall_viddi=Module.dynCall_viddi=asm.dynCall_viddi,dynCall_vidd=Module.dynCall_vidd=asm.dynCall_vidd,dynCall_iiii=Module.dynCall_iiii=asm.dynCall_iiii,dynCall_diii=Module.dynCall_diii=asm.dynCall_diii,dynCall_di=Module.dynCall_di=asm.dynCall_di,dynCall_iid=Module.dynCall_iid=asm.dynCall_iid,dynCall_iii=Module.dynCall_iii=asm.dynCall_iii,dynCall_viiddi=Module.dynCall_viiddi=asm.dynCall_viiddi,dynCall_viiiiii=Module.dynCall_viiiiii=asm.dynCall_viiiiii,dynCall_dii=Module.dynCall_dii=asm.dynCall_dii,dynCall_i=Module.dynCall_i=asm.dynCall_i,dynCall_iiiiii=Module.dynCall_iiiiii=asm.dynCall_iiiiii,dynCall_viiid=Module.dynCall_viiid=asm.dynCall_viiid,dynCall_viififi=Module.dynCall_viififi=asm.dynCall_viififi,dynCall_viii=Module.dynCall_viii=asm.dynCall_viii,dynCall_v=Module.dynCall_v=asm.dynCall_v,dynCall_viid=Module.dynCall_viid=asm.dynCall_viid,dynCall_idd=Module.dynCall_idd=asm.dynCall_idd,dynCall_viiii=Module.dynCall_viiii=asm.dynCall_viiii,initialStackTop;function ExitStatus(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}Runtime.stackAlloc=Module.stackAlloc,Runtime.stackSave=Module.stackSave,Runtime.stackRestore=Module.stackRestore,Runtime.establishStackSpace=Module.establishStackSpace,Runtime.setTempRet0=Module.setTempRet0,Runtime.getTempRet0=Module.getTempRet0,Module.asm=asm,ExitStatus.prototype=new Error,ExitStatus.prototype.constructor=ExitStatus;var preloadStartTime=null,calledMain=!1;function run(e){function t(){Module.calledRun||(Module.calledRun=!0,ABORT||(ensureInitRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),Module._main&&shouldRunNow&&Module.callMain(e),postRun()))}e=e||Module.arguments,null===preloadStartTime&&(preloadStartTime=Date.now()),runDependencies>0||(preRun(),runDependencies>0||Module.calledRun||(Module.setStatus?(Module.setStatus("Running..."),setTimeout((function(){setTimeout((function(){Module.setStatus("")}),1),t()}),1)):t()))}function exit(e,t){t&&Module.noExitRuntime||(Module.noExitRuntime||(ABORT=!0,EXITSTATUS=e,STACKTOP=initialStackTop,exitRuntime(),Module.onExit&&Module.onExit(e)),ENVIRONMENT_IS_NODE&&process.exit(e),Module.quit(e,new ExitStatus(e)))}dependenciesFulfilled=function e(){Module.calledRun||run(),Module.calledRun||(dependenciesFulfilled=e)},Module.callMain=Module.callMain=function(e){e=e||[],ensureInitRuntime();var t=e.length+1;function n(){for(var e=0;e<3;e++)r.push(0)}var r=[allocate(intArrayFromString(Module.thisProgram),"i8",ALLOC_NORMAL)];n();for(var i=0;i0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run()},void 0===(__WEBPACK_AMD_DEFINE_RESULT__=function(){return wrapper}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__=[]))||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)},3019:e=>{"use strict";e.exports={ALIGN_COUNT:8,ALIGN_AUTO:0,ALIGN_FLEX_START:1,ALIGN_CENTER:2,ALIGN_FLEX_END:3,ALIGN_STRETCH:4,ALIGN_BASELINE:5,ALIGN_SPACE_BETWEEN:6,ALIGN_SPACE_AROUND:7,DIMENSION_COUNT:2,DIMENSION_WIDTH:0,DIMENSION_HEIGHT:1,DIRECTION_COUNT:3,DIRECTION_INHERIT:0,DIRECTION_LTR:1,DIRECTION_RTL:2,DISPLAY_COUNT:2,DISPLAY_FLEX:0,DISPLAY_NONE:1,EDGE_COUNT:9,EDGE_LEFT:0,EDGE_TOP:1,EDGE_RIGHT:2,EDGE_BOTTOM:3,EDGE_START:4,EDGE_END:5,EDGE_HORIZONTAL:6,EDGE_VERTICAL:7,EDGE_ALL:8,EXPERIMENTAL_FEATURE_COUNT:1,EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS:0,FLEX_DIRECTION_COUNT:4,FLEX_DIRECTION_COLUMN:0,FLEX_DIRECTION_COLUMN_REVERSE:1,FLEX_DIRECTION_ROW:2,FLEX_DIRECTION_ROW_REVERSE:3,JUSTIFY_COUNT:6,JUSTIFY_FLEX_START:0,JUSTIFY_CENTER:1,JUSTIFY_FLEX_END:2,JUSTIFY_SPACE_BETWEEN:3,JUSTIFY_SPACE_AROUND:4,JUSTIFY_SPACE_EVENLY:5,LOG_LEVEL_COUNT:6,LOG_LEVEL_ERROR:0,LOG_LEVEL_WARN:1,LOG_LEVEL_INFO:2,LOG_LEVEL_DEBUG:3,LOG_LEVEL_VERBOSE:4,LOG_LEVEL_FATAL:5,MEASURE_MODE_COUNT:3,MEASURE_MODE_UNDEFINED:0,MEASURE_MODE_EXACTLY:1,MEASURE_MODE_AT_MOST:2,NODE_TYPE_COUNT:2,NODE_TYPE_DEFAULT:0,NODE_TYPE_TEXT:1,OVERFLOW_COUNT:3,OVERFLOW_VISIBLE:0,OVERFLOW_HIDDEN:1,OVERFLOW_SCROLL:2,POSITION_TYPE_COUNT:2,POSITION_TYPE_RELATIVE:0,POSITION_TYPE_ABSOLUTE:1,PRINT_OPTIONS_COUNT:3,PRINT_OPTIONS_LAYOUT:1,PRINT_OPTIONS_STYLE:2,PRINT_OPTIONS_CHILDREN:4,UNIT_COUNT:4,UNIT_UNDEFINED:0,UNIT_POINT:1,UNIT_PERCENT:2,UNIT_AUTO:3,WRAP_COUNT:3,WRAP_NO_WRAP:0,WRAP_WRAP:1,WRAP_WRAP_REVERSE:2}},6401:(e,t,n)=>{"use strict";var r=n(7180),i=n(3354),o=!1,u=null;if(i({},(function(e,t){if(!o){if(o=!0,e)throw e;u=t}})),!o)throw new Error("Failed to load the yoga module - it needed to be loaded synchronously, but didn't");e.exports=r(u.bind,u.lib)},7180:(e,t,n)=>{"use strict";var r=Object.assign||function(e){for(var t=1;t"}}]),e}(),s=function(){function e(t,n){u(this,e),this.width=t,this.height=n}return i(e,null,[{key:"fromJS",value:function(t){return new e(t.width,t.height)}}]),i(e,[{key:"fromJS",value:function(e){e(this.width,this.height)}},{key:"toString",value:function(){return""}}]),e}(),c=function(){function e(t,n){u(this,e),this.unit=t,this.value=n}return i(e,[{key:"fromJS",value:function(e){e(this.unit,this.value)}},{key:"toString",value:function(){switch(this.unit){case a.UNIT_POINT:return String(this.value);case a.UNIT_PERCENT:return this.value+"%";case a.UNIT_AUTO:return"auto";default:return this.value+"?"}}},{key:"valueOf",value:function(){return this.value}}]),e}();e.exports=function(e,t){function n(e,t,n){var r=e[t];e[t]=function(){for(var e=arguments.length,t=Array(e),i=0;i1?t-1:0),i=1;i1&&void 0!==arguments[1]?arguments[1]:NaN,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:NaN,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.DIRECTION_LTR;return e.call(this,t,n,r)})),r({Config:t.Config,Node:t.Node,Layout:e("Layout",l),Size:e("Size",s),Value:e("Value",c),getInstanceCount:function(){return t.getInstanceCount.apply(t,arguments)}},a)}},2357:e=>{"use strict";e.exports=require("assert")},6417:e=>{"use strict";e.exports=require("crypto")},8614:e=>{"use strict";e.exports=require("events")},5747:e=>{"use strict";e.exports=require("fs")},8605:e=>{"use strict";e.exports=require("http")},7211:e=>{"use strict";e.exports=require("https")},2282:e=>{"use strict";e.exports=require("module")},1631:e=>{"use strict";e.exports=require("net")},2087:e=>{"use strict";e.exports=require("os")},2413:e=>{"use strict";e.exports=require("stream")},4016:e=>{"use strict";e.exports=require("tls")},3867:e=>{"use strict";e.exports=require("tty")},8835:e=>{"use strict";e.exports=require("url")},8761:e=>{"use strict";e.exports=require("zlib")}},__webpack_module_cache__={};function __webpack_require__(e){if(__webpack_module_cache__[e])return __webpack_module_cache__[e].exports;var t=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(t.exports,t,t.exports,__webpack_require__),t.loaded=!0,t.exports}return __webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),__webpack_require__(7560)})(); +return plugin; +} +}; \ No newline at end of file diff --git a/.yarn/plugins/@yarnpkg/plugin-version.cjs b/.yarn/plugins/@yarnpkg/plugin-version.cjs new file mode 100644 index 00000000..617c852c --- /dev/null +++ b/.yarn/plugins/@yarnpkg/plugin-version.cjs @@ -0,0 +1,77 @@ +/* eslint-disable */ +module.exports = { +name: "@yarnpkg/plugin-version", +factory: function (require) { +var plugin;plugin=(()=>{var __webpack_modules__={4952:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>R});const r=require("@yarnpkg/core");function i(e,t,n,r){var i,o=arguments.length,u=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(u=(o<3?i(u):o>3?i(t,n,u):i(t,n))||u);return o>3&&u&&Object.defineProperty(t,n,u),u}const o=require("@yarnpkg/cli"),u=require("clipanion"),a=require("@yarnpkg/fslib"),l=require("@yarnpkg/parsers"),s=require("semver");var c=n.n(s);const f=/^(>=|[~^]|)(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\+[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)?$/;var d;async function p(e){const t=new Map,n=e.configuration.get("deferredVersionFolder");if(!a.xfs.existsSync(n))return new Map;const i=await a.xfs.readdirPromise(n);for(const o of i){if(!o.endsWith(".yml"))continue;const i=a.ppath.join(n,o),u=await a.xfs.readFilePromise(i,"utf8"),s=(0,l.parseSyml)(u);for(const[n,o]of Object.entries(s.releases||{})){const u=r.structUtils.parseIdent(n),l=e.tryWorkspaceByIdent(u);if(null===l)throw new Error(`Assertion failed: Expected a release definition file to only reference existing workspaces (${a.ppath.basename(i)} references ${n})`);if(null===l.manifest.version)throw new Error(`Assertion failed: Expected the workspace to have a version (${r.structUtils.prettyLocator(e.configuration,l.anchoredLocator)})`);const s=t.get(l),f=g(l.manifest.version,o);if(null===f)throw new Error(`Assertion failed: Expected ${l.manifest.version} to support being bumped via strategy ${o}`);const d=void 0!==s?c().gt(f,s)?f:s:f;t.set(l,d)}}return t}async function h(e,{allowEmpty:t=!1}={}){const n=e.configuration;if(null===n.projectCwd)throw new u.UsageError("This command can only be run from within a Yarn project");const i=await async function(e){let t,n=null,r=e;do{t=r,await a.xfs.existsPromise(a.ppath.join(t,".git"))&&(n=t),r=a.ppath.dirname(t)}while(null===n&&r!==t);return n}(n.projectCwd),o=null!==i?await async function(e,{baseRefs:t}){if(0===t.length)throw new u.UsageError("Can't run this command with zero base refs specified.");const n=[];for(const i of t){const{code:t}=await r.execUtils.execvp("git",["merge-base",i,"HEAD"],{cwd:e});0===t&&n.push(i)}if(0===n.length)throw new u.UsageError("No ancestor could be found between any of HEAD and "+t.join(", "));const{stdout:i}=await r.execUtils.execvp("git",["merge-base","HEAD",...n],{cwd:e,strict:!0}),o=i.trim(),{stdout:a}=await r.execUtils.execvp("git",["show","--quiet","--pretty=format:%s",o],{cwd:e,strict:!0});return{hash:o,title:a.trim()}}(i,{baseRefs:n.get("changesetBaseRefs")}):null,s=null!==i?await async function(e,{base:t,project:n}){const i=r.miscUtils.buildIgnorePattern(n.configuration.get("changesetIgnorePatterns")),{stdout:o}=await r.execUtils.execvp("git",["diff","--name-only",""+t],{cwd:e,strict:!0}),u=o.split(/\r\n|\r|\n/).filter(e=>e.length>0).map(t=>a.ppath.resolve(e,a.npath.toPortablePath(t))),{stdout:l}=await r.execUtils.execvp("git",["ls-files","--others","--exclude-standard"],{cwd:e,strict:!0}),s=l.split(/\r\n|\r|\n/).filter(e=>e.length>0).map(t=>a.ppath.resolve(e,a.npath.toPortablePath(t))),c=[...new Set([...u,...s].sort())];return i?c.filter(e=>!a.ppath.relative(n.cwd,e).match(i)):c}(i,{base:o.hash,project:e}):[],c=n.get("deferredVersionFolder"),f=s.filter(e=>null!==a.ppath.contains(c,e));if(f.length>1)throw new u.UsageError("Your current branch contains multiple versioning files; this isn't supported:\n- "+f.join("\n- "));const p=new Set(r.miscUtils.mapAndFilter(s,t=>{const n=e.tryWorkspaceByFilePath(t);return null===n?r.miscUtils.mapAndFilter.skip:n}));if(0===f.length&&0===p.size&&!t)return null;const h=1===f.length?f[0]:a.ppath.join(c,r.hashUtils.makeHash(Math.random().toString()).slice(0,8)+".yml"),v=a.xfs.existsSync(h)?await a.xfs.readFilePromise(h,"utf8"):"{}",m=(0,l.parseSyml)(v),g=new Map;for(const t of m.declined||[]){const n=r.structUtils.parseIdent(t),i=e.getWorkspaceByIdent(n);g.set(i,d.DECLINE)}for(const[t,n]of Object.entries(m.releases||{})){const i=r.structUtils.parseIdent(t),o=e.getWorkspaceByIdent(i);g.set(o,n)}return{project:e,root:i,baseHash:null!==o?o.hash:null,baseTitle:null!==o?o.title:null,changedFiles:new Set(s),changedWorkspaces:p,releaseRoots:new Set([...p].filter(e=>null!==e.manifest.version)),releases:g,async saveAll(){const t={},n=[],i=[];for(const o of e.workspaces){if(null===o.manifest.version)continue;const e=r.structUtils.stringifyIdent(o.locator),u=g.get(o);u===d.DECLINE?n.push(e):void 0!==u?t[e]=u:p.has(o)&&i.push(e)}await a.xfs.mkdirPromise(a.ppath.dirname(h),{recursive:!0}),await a.xfs.changeFilePromise(h,(0,l.stringifySyml)(new l.stringifySyml.PreserveOrdering({releases:Object.keys(t).length>0?t:void 0,declined:n.length>0?n:void 0,undecided:i.length>0?i:void 0})))}}}function v(e){const t=new Set;for(const n of e.changedWorkspaces)null!==n.manifest.version&&(e.releases.has(n)||t.add(n));return t}function m(e,{include:t=new Set}={}){const n=[],i=new Map(r.miscUtils.mapAndFilter([...e.releases],([e,t])=>t===d.DECLINE?r.miscUtils.mapAndFilter.skip:[e.anchoredLocator.locatorHash,e])),o=new Map(r.miscUtils.mapAndFilter([...e.releases],([e,t])=>t!==d.DECLINE?r.miscUtils.mapAndFilter.skip:[e.anchoredLocator.locatorHash,e]));for(const u of e.project.workspaces){if(!t.has(u)){if(o.has(u.anchoredLocator.locatorHash))continue;if(i.has(u.anchoredLocator.locatorHash))continue}if(null!==u.manifest.version)for(const t of r.Manifest.hardDependencies)for(const r of u.manifest.getForScope(t).values()){const t=e.project.tryWorkspaceByDescriptor(r);null!==t&&(i.has(t.anchoredLocator.locatorHash)&&n.push([u,t]))}}return n}function g(e,t){if(c().valid(t))return t;if(null===e)throw new u.UsageError(`Cannot apply the release strategy "${t}" unless the workspace already has a valid version`);if(!c().valid(e))throw new u.UsageError(`Cannot apply the release strategy "${t}" on a non-semver version (${e})`);const n=c().inc(e,t);if(null===n)throw new u.UsageError(`Cannot apply the release strategy "${t}" on the specified version (${e})`);return n}!function(e){e.UNDECIDED="undecided",e.DECLINE="decline",e.MAJOR="major",e.MINOR="minor",e.PATCH="patch",e.PRERELEASE="prerelease"}(d||(d={}));class _ extends o.BaseCommand{constructor(){super(...arguments),this.all=!1,this.json=!1}async execute(){const e=await r.Configuration.find(this.context.cwd,this.context.plugins),{project:t,workspace:n}=await r.Project.find(e,this.context.cwd),i=await r.Cache.find(e);if(!n)throw new o.WorkspaceRequiredError(t.cwd,this.context.cwd);return(await r.StreamReport.start({configuration:e,json:this.json,stdout:this.context.stdout},async e=>{let o=await p(t);if(!this.all){const e=o.get(n);if(void 0===e)return;o=new Map([[n,e]])}await function(e,t,{report:n}){const i=new Map;for(const n of e.workspaces)for(const o of r.Manifest.allDependencies)for(const u of n.manifest[o].values()){const a=e.tryWorkspaceByDescriptor(u);if(null===a)continue;if(!t.has(a))continue;r.miscUtils.getArrayWithDefault(i,a).push([n,o,u.identHash])}for(const[o,u]of t){const t=o.manifest.version;o.manifest.version=u;const a=null!==o.manifest.name?r.structUtils.stringifyIdent(o.manifest.name):null;n.reportInfo(r.MessageName.UNNAMED,`${r.structUtils.prettyLocator(e.configuration,o.anchoredLocator)}: Bumped to ${u}`),n.reportJson({cwd:o.cwd,ident:a,oldVersion:t,newVersion:u});const l=i.get(o);if(void 0!==l)for(const[t,i,a]of l){const l=t.manifest[i].get(a);if(void 0===l)throw new Error("Assertion failed: The dependency should have existed");let s=l.range,c=!1;if(s.startsWith(r.WorkspaceResolver.protocol)&&(s=s.slice(r.WorkspaceResolver.protocol.length),c=!0,s===o.relativeCwd))continue;const d=s.match(f);if(!d){n.reportWarning(r.MessageName.UNNAMED,`Couldn't auto-upgrade range ${s} (in ${r.structUtils.prettyLocator(e.configuration,o.anchoredLocator)})`);continue}let p=`${d[1]}${u}`;c&&(p=`${r.WorkspaceResolver.protocol}${p}`);const h=r.structUtils.makeDescriptor(l,p);t.manifest[i].set(a,h)}}}(t,o,{report:e}),this.all?await async function(e){const t=e.configuration.get("deferredVersionFolder");a.xfs.existsSync(t)&&await a.xfs.removePromise(t)}(t):await async function(e){const t=e.configuration.get("deferredVersionFolder");if(!a.xfs.existsSync(t))return;const n=await a.xfs.readdirPromise(t);for(const i of n){if(!i.endsWith(".yml"))continue;const n=a.ppath.join(t,i),o=await a.xfs.readFilePromise(n,"utf8"),u=(0,l.parseSyml)(o),s=null==u?void 0:u.releases;if(s){for(const t of Object.keys(s)){const n=r.structUtils.parseLocator(t);null===e.tryWorkspaceByLocator(n)&&delete u.releases[t]}await a.xfs.changeFilePromise(n,(0,l.stringifySyml)(new l.stringifySyml.PreserveOrdering(u)))}}}(t),await t.install({cache:i,report:e})})).exitCode()}}_.usage=u.Command.Usage({category:"Release-related commands",description:"apply all the deferred version bumps at once",details:"\n This command will apply the deferred version changes (scheduled via `yarn version major|minor|patch`) on the current workspace (or all of them if `--all`) is specified.\n\n It will also update the `workspace:` references across all your local workspaces so that they keep refering to the same workspace even after the version bump.\n ",examples:[["Apply the version change to the local workspace","yarn version apply"],["Apply the version change to all the workspaces in the local workspace","yarn version apply --all"]]}),i([u.Command.Boolean("--all",{description:"Apply the deferred version changes on all workspaces"})],_.prototype,"all",void 0),i([u.Command.Boolean("--json",{description:"Format the output as an NDJSON stream"})],_.prototype,"json",void 0),i([u.Command.Path("version","apply")],_.prototype,"execute",null);var y=n(9245),b=n(7382);const w=(0,b.memo)(({active:e})=>{const t=(0,b.useMemo)(()=>e?"◉":"◯",[e]),n=(0,b.useMemo)(()=>e?"green":"yellow",[e]);return b.createElement(y.xv,{color:n},t)});function E({active:e},t,n){const{stdin:r}=(0,y.lM)(),i=(0,b.useCallback)((e,n)=>t(e,n),n);(0,b.useEffect)(()=>{if(e&&r)return r.on("keypress",i),()=>{r.off("keypress",i)}},[e,i,r])}var D;!function(e){e.BEFORE="before",e.AFTER="after"}(D||(D={}));const C=function(e,t,{active:n,minus:r,plus:i,set:o,loop:u=!0}){E({active:n},(n,a)=>{const l=t.indexOf(e);switch(a.name){case r:{const e=l-1;if(u)return void o(t[(t.length+e)%t.length]);if(e<0)return;o(t[e])}break;case i:{const e=l+1;if(u)return void o(t[e%t.length]);if(e>=t.length)return;o(t[e])}}},[t,e,i,o,u])},k=({active:e=!0,children:t=[],radius:n=10,size:r=1,loop:i=!0,onFocusRequest:o,willReachEnd:u})=>{const a=b.Children.map(t,e=>(e=>{if(null===e.key)throw new Error("Expected all children to have a key");return e.key})(e)),l=a[0],[s,c]=(0,b.useState)(l),f=a.indexOf(s);(0,b.useEffect)(()=>{a.includes(s)||c(l)},[t]),(0,b.useEffect)(()=>{u&&f>=a.length-2&&u()},[f]),function({active:e},t,n){E({active:e},(e,n)=>{"tab"===n.name&&(n.shift?t(D.BEFORE):t(D.AFTER))},n)}({active:e&&!!o},e=>{null==o||o(e)},[o]),C(s,a,{active:e,minus:"up",plus:"down",set:c,loop:i});let d=f-n,p=f+n;p>a.length&&(d-=p-a.length,p=a.length),d<0&&(p+=-d,d=0),p>=a.length&&(p=a.length-1);const h=[];for(let n=d;n<=p;++n){const i=a[n],o=e&&i===s;h.push(b.createElement(y.xu,{key:i,height:r},b.createElement(y.xu,{marginLeft:1,marginRight:1},b.createElement(y.xv,null,o?b.createElement(y.xv,{color:"cyan",bold:!0},">"):" ")),b.createElement(y.xu,null,b.cloneElement(t[n],{active:o}))))}return b.createElement(y.xu,{flexDirection:"column",width:"100%"},h)},S=require("readline"),T=b.createContext(null),x=({children:e})=>{const{stdin:t,setRawMode:n}=(0,y.lM)();(0,b.useEffect)(()=>{n&&n(!0),t&&(0,S.emitKeypressEvents)(t)},[t,n]);const[r,i]=(0,b.useState)(new Map),o=(0,b.useMemo)(()=>({getAll:()=>r,get:e=>r.get(e),set:(e,t)=>i(new Map([...r,[e,t]]))}),[r,i]);return b.createElement(T.Provider,{value:o,children:e})};class A extends u.Command{async execute(){return this.interactive?await this.executeInteractive():await this.executeStandard()}async executeInteractive(){const e=await r.Configuration.find(this.context.cwd,this.context.plugins),{project:t,workspace:n}=await r.Project.find(e,this.context.cwd);if(!n)throw new o.WorkspaceRequiredError(t.cwd,this.context.cwd);await t.restoreInstallState();const i=await h(t);if(null===i||0===i.releaseRoots.size)return 0;if(null===i.root)throw new u.UsageError("This command can only be run on Git repositories");const l=()=>b.createElement(y.xu,{flexDirection:"row",paddingBottom:1},b.createElement(y.xu,{flexDirection:"column",width:60},b.createElement(y.xu,null,b.createElement(y.xv,null,"Press ",b.createElement(y.xv,{bold:!0,color:"cyanBright"},""),"/",b.createElement(y.xv,{bold:!0,color:"cyanBright"},"")," to select workspaces.")),b.createElement(y.xu,null,b.createElement(y.xv,null,"Press ",b.createElement(y.xv,{bold:!0,color:"cyanBright"},""),"/",b.createElement(y.xv,{bold:!0,color:"cyanBright"},"")," to select release strategies."))),b.createElement(y.xu,{flexDirection:"column"},b.createElement(y.xu,{marginLeft:1},b.createElement(y.xv,null,"Press ",b.createElement(y.xv,{bold:!0,color:"cyanBright"},"")," to save.")),b.createElement(y.xu,{marginLeft:1},b.createElement(y.xv,null,"Press ",b.createElement(y.xv,{bold:!0,color:"cyanBright"},"")," to abort.")))),s=({workspace:t,active:n,decision:i,setDecision:o})=>{const u=t.manifest.version;if(null===u)throw new Error(`Assertion failed: The version should have been set (${r.structUtils.prettyLocator(e,t.anchoredLocator)})`);const a=null===c().prerelease(u)?[d.UNDECIDED,d.DECLINE,d.PATCH,d.MINOR,d.MAJOR,d.PRERELEASE]:[d.UNDECIDED,d.DECLINE,d.PRERELEASE,d.MAJOR];C(i,a,{active:n,minus:"left",plus:"right",set:o});const l=i===d.UNDECIDED?b.createElement(y.xv,{color:"yellow"},u):i===d.DECLINE?b.createElement(y.xv,{color:"green"},u):b.createElement(y.xv,null,b.createElement(y.xv,{color:"magenta"},u)," → ",b.createElement(y.xv,{color:"green"},c().inc(u,i)));return b.createElement(y.xu,{flexDirection:"column"},b.createElement(y.xu,null,b.createElement(y.xv,null,r.structUtils.prettyLocator(e,t.anchoredLocator)," - ",l)),b.createElement(y.xu,null,a.map(e=>{const t=e===i;return b.createElement(y.xu,{key:e,paddingLeft:2},b.createElement(y.xv,null,b.createElement(w,{active:t})," ",e))})))},f=e=>{const t=new Set(i.releaseRoots),n=new Map([...e].filter(([e])=>t.has(e)));for(;;){const r=m({project:i.project,releases:n});let o=!1;if(r.length>0)for(const[i]of r)if(!t.has(i)){t.add(i),o=!0;const r=e.get(i);void 0!==r&&n.set(i,r)}if(!o)break}return{relevantWorkspaces:t,relevantReleases:n}},p=({workspaces:e,releases:t})=>{const n=[];n.push(e.size+" total");let r=0,i=0;for(const n of e){const e=t.get(n);void 0===e?i+=1:e!==d.DECLINE&&(r+=1)}return n.push(`${r} release${1===r?"":"s"}`),n.push(i+" remaining"),b.createElement(y.xv,{color:"yellow"},n.join(", "))},v=await async function(e,t){let n;const{waitUntilExit:r}=(0,y.sY)(b.createElement(x,null,b.createElement(e,Object.assign({},t,{useSubmit:e=>{const{exit:t}=(0,y.qD)();E({active:!0},(r,i)=>{"return"===i.name&&(n=e,t())},[t,e])}}))));return await r(),n}(({useSubmit:e})=>{const[t,n]=(()=>{const[e,t]=(0,b.useState)(i.releases),n=(0,b.useCallback)((n,r)=>{const i=new Map(e);r!==d.UNDECIDED?i.set(n,r):i.delete(n);const{relevantReleases:o}=f(i);t(o)},[e,t]);return[e,n]})();e(t);const{relevantWorkspaces:r}=f(t),o=new Set([...r].filter(e=>!i.releaseRoots.has(e))),[u,c]=(0,b.useState)(0),h=(0,b.useCallback)(e=>{switch(e){case D.BEFORE:c(u-1);break;case D.AFTER:c(u+1)}},[u,c]);return b.createElement(y.xu,{flexDirection:"column"},b.createElement(l,null),b.createElement(y.xu,null,b.createElement(y.xv,{wrap:"wrap"},"The following files have been modified in your local checkout.")),b.createElement(y.xu,{flexDirection:"column",marginTop:1,paddingLeft:2},[...i.changedFiles].map(e=>b.createElement(y.xu,{key:e},b.createElement(y.xv,null,b.createElement(y.xv,{color:"grey"},i.root),"/",a.ppath.relative(i.root,e))))),i.releaseRoots.size>0&&b.createElement(b.Fragment,null,b.createElement(y.xu,{marginTop:1},b.createElement(y.xv,{wrap:"wrap"},"Because of those files having been modified, the following workspaces may need to be released again (note that private workspaces are also shown here, because even though they won't be published, releasing them will allow us to flag their dependents for potential re-release):")),o.size>3?b.createElement(y.xu,{marginTop:1},b.createElement(p,{workspaces:i.releaseRoots,releases:t})):null,b.createElement(y.xu,{marginTop:1,flexDirection:"column"},b.createElement(k,{active:u%2==0,radius:1,size:2,onFocusRequest:h},[...i.releaseRoots].map(e=>b.createElement(s,{key:e.cwd,workspace:e,decision:t.get(e)||d.UNDECIDED,setDecision:t=>n(e,t)}))))),o.size>0?b.createElement(b.Fragment,null,b.createElement(y.xu,{marginTop:1},b.createElement(y.xv,{wrap:"wrap"},"The following workspaces depend on other workspaces that have been marked for release, and thus may need to be released as well:")),b.createElement(y.xu,null,b.createElement(y.xv,null,"(Press ",b.createElement(y.xv,{bold:!0,color:"cyanBright"},"")," to move the focus between the workspace groups.)")),o.size>5?b.createElement(y.xu,{marginTop:1},b.createElement(p,{workspaces:o,releases:t})):null,b.createElement(y.xu,{marginTop:1,flexDirection:"column"},b.createElement(k,{active:u%2==1,radius:2,size:2,onFocusRequest:h},[...o].map(e=>b.createElement(s,{key:e.cwd,workspace:e,decision:t.get(e)||d.UNDECIDED,setDecision:t=>n(e,t)}))))):null)},{versionFile:i});if(void 0===v)return 1;i.releases.clear();for(const[e,t]of v)i.releases.set(e,t);await i.saveAll()}async executeStandard(){const e=await r.Configuration.find(this.context.cwd,this.context.plugins),{project:t,workspace:n}=await r.Project.find(e,this.context.cwd);if(!n)throw new o.WorkspaceRequiredError(t.cwd,this.context.cwd);await t.restoreInstallState();return(await r.StreamReport.start({configuration:e,stdout:this.context.stdout},async n=>{const i=await h(t);if(null===i||0===i.releaseRoots.size)return;if(null===i.root)throw new u.UsageError("This command can only be run on Git repositories");if(n.reportInfo(r.MessageName.UNNAMED,`Your PR was started right after ${r.formatUtils.pretty(e,i.baseHash.slice(0,7),"yellow")} ${r.formatUtils.pretty(e,i.baseTitle,"magenta")}`),i.changedFiles.size>0){n.reportInfo(r.MessageName.UNNAMED,"You have changed the following files since then:"),n.reportSeparator();for(const t of i.changedFiles)n.reportInfo(null,`${r.formatUtils.pretty(e,i.root,"gray")}/${a.ppath.relative(i.root,t)}`)}let o=!1,l=!1;const s=v(i);if(s.size>0){o||n.reportSeparator();for(const t of s)n.reportError(r.MessageName.UNNAMED,r.structUtils.prettyLocator(e,t.anchoredLocator)+" has been modified but doesn't have a release strategy attached");o=!0}const c=m(i);for(const[t,i]of c)l||n.reportSeparator(),n.reportError(r.MessageName.UNNAMED,`${r.structUtils.prettyLocator(e,t.anchoredLocator)} doesn't have a release strategy attached, but depends on ${r.structUtils.prettyWorkspace(e,i)} which is planned for release.`),l=!0;(o||l)&&(n.reportSeparator(),n.reportInfo(r.MessageName.UNNAMED,"This command detected that at least some workspaces have received modifications without explicit instructions as to how they had to be released (if needed)."),n.reportInfo(r.MessageName.UNNAMED,"To correct these errors, run `yarn version check --interactive` then follow the instructions."))})).exitCode()}}A.usage=u.Command.Usage({category:"Release-related commands",description:"check that all the relevant packages have been bumped",details:"\n **Warning:** This command currently requires Git.\n\n This command will check that all the packages covered by the files listed in argument have been properly bumped or declined to bump.\n\n In the case of a bump, the check will also cover transitive packages - meaning that should `Foo` be bumped, a package `Bar` depending on `Foo` will require a decision as to whether `Bar` will need to be bumped. This check doesn't cross packages that have declined to bump.\n\n In case no arguments are passed to the function, the list of modified files will be generated by comparing the HEAD against `master`.\n ",examples:[["Check whether the modified packages need a bump","yarn version check"]]}),i([u.Command.Boolean("-i,--interactive",{description:"Open an interactive interface used to set version bumps"})],A.prototype,"interactive",void 0),i([u.Command.Path("version","check")],A.prototype,"execute",null);const O=require("yup"),M=new Set(Object.values(d).filter(e=>e!==d.UNDECIDED));class I extends o.BaseCommand{async execute(){const e=await r.Configuration.find(this.context.cwd,this.context.plugins),{project:t,workspace:n}=await r.Project.find(e,this.context.cwd);if(!n)throw new o.WorkspaceRequiredError(t.cwd,this.context.cwd);let i=e.get("preferDeferredVersions");this.deferred&&(i=!0),this.immediate&&(i=!1);const a=c().valid(this.strategy),l=this.strategy===d.DECLINE;let s;if(a)if(null!==n.manifest.version){const e=function(e,t){const n=c().clean(t);for(const t of Object.values(d))if(t!==d.UNDECIDED&&t!==d.DECLINE&&c().inc(e,t)===n)return t;return null}(n.manifest.version,this.strategy);s=null!==e?e:this.strategy}else s=this.strategy;else{const e=n.manifest.version;if(!l){if(null===e)throw new u.UsageError("Can't bump the version if there wasn't a version to begin with - use 0.0.0 as initial version then run the command again.");if("string"!=typeof e||!c().valid(e))throw new u.UsageError(`Can't bump the version (${e}) if it's not valid semver`)}s=this.strategy}if(!i){const e=(await p(t)).get(n);if(void 0!==e){const t=g(n.manifest.version,s);if(c().lt(t,e))throw new u.UsageError(`Can't bump the version to one that would be lower than the current deferred one (${e})`)}}const f=await h(t,{allowEmpty:!0});f.releases.set(n,s),await f.saveAll(),i||await this.cli.run(["version","apply"])}}I.schema=O.object().shape({strategy:O.string().test({name:"strategy",message:"${path} must be a semver range or one of ${strategies}",params:{strategies:[...M].join(", ")},test:e=>null!==c().valid(e)||M.has(e)})}),I.usage=u.Command.Usage({category:"Release-related commands",description:"apply a new version to the current package",details:'\n This command will bump the version number for the given package, following the specified strategy:\n\n - If `major`, the first number from the semver range will be increased (`X.0.0`).\n - If `minor`, the second number from the semver range will be increased (`0.X.0`).\n - If `patch`, the third number from the semver range will be increased (`0.0.X`).\n - If prefixed by `pre` (`premajor`, ...), a `-0` suffix will be set (`0.0.0-0`).\n - If `prerelease`, the suffix will be increased (`0.0.0-X`); the third number from the semver range will also be increased if there was no suffix in the previous version.\n - If `decline`, the nonce will be increased for `yarn version check` to pass without version bump.\n - If a valid semver range, it will be used as new version.\n - If unspecified, Yarn will ask you for guidance.\n\n For more information about the `--deferred` flag, consult our documentation ("Managing Releases").\n ',examples:[["Immediately bump the version to the next major","yarn version major"],["Prepare the version to be bumped to the next major","yarn version major --deferred"]]}),i([u.Command.String()],I.prototype,"strategy",void 0),i([u.Command.Boolean("-d,--deferred",{description:"Prepare the version to be bumped during the next release cycle"})],I.prototype,"deferred",void 0),i([u.Command.Boolean("-i,--immediate",{description:"Bump the version immediately"})],I.prototype,"immediate",void 0),i([u.Command.Path("version")],I.prototype,"execute",null);const R={configuration:{changesetBaseRefs:{description:"The base git refs that the current HEAD is compared against when detecting changes. Supports git branches, tags, and commits.",type:r.SettingsType.STRING,isArray:!0,isNullable:!1,default:["master","origin/master","upstream/master"]},changesetIgnorePatterns:{description:"Array of glob patterns; files matching them will be ignored when fetching the changed files",type:r.SettingsType.STRING,default:[],isArray:!0},deferredVersionFolder:{description:"Folder where are stored the versioning files",type:r.SettingsType.ABSOLUTE_PATH,default:"./.yarn/versions"},preferDeferredVersions:{description:"If true, running `yarn version` will assume the `--deferred` flag unless `--immediate` is set",type:r.SettingsType.BOOLEAN,default:!1}},commands:[_,A,I]}},9902:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(1525)),o=/^(rgb|hsl|hsv|hwb)\(\s?(\d+),\s?(\d+),\s?(\d+)\s?\)$/,u=/^(ansi|ansi256)\(\s?(\d+)\s?\)$/,a=(e,t)=>"foreground"===t?e:"bg"+e[0].toUpperCase()+e.slice(1);t.default=(e,t,n)=>{if(!t)return e;if(t in i.default){const r=a(t,n);return i.default[r](e)}if(t.startsWith("#")){const r=a("hex",n);return i.default[r](t)(e)}if(t.startsWith("ansi")){const r=u.exec(t);if(!r)return e;const o=a(r[1],n),l=Number(r[2]);return i.default[o](l)(e)}if(t.startsWith("rgb")||t.startsWith("hsl")||t.startsWith("hsv")||t.startsWith("hwb")){const r=o.exec(t);if(!r)return e;const u=a(r[1],n),l=Number(r[2]),s=Number(r[3]),c=Number(r[4]);return i.default[u](l,s,c)(e)}return e}},2773:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(n(7382)),l=u(n(1696)),s=u(n(5512)),c=u(n(1489)),f=u(n(6834)),d=u(n(5001)),p=u(n(2560)),h=u(n(9052));class v extends a.PureComponent{constructor(){super(...arguments),this.state={isFocusEnabled:!0,activeFocusId:void 0,focusables:[],error:void 0},this.rawModeEnabledCount=0,this.handleSetRawMode=e=>{const{stdin:t}=this.props;if(!this.isRawModeSupported())throw t===process.stdin?new Error("Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.\nRead about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported"):new Error("Raw mode is not supported on the stdin provided to Ink.\nRead about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported");if(t.setEncoding("utf8"),e)return 0===this.rawModeEnabledCount&&(t.addListener("data",this.handleInput),t.resume(),t.setRawMode(!0)),void this.rawModeEnabledCount++;0==--this.rawModeEnabledCount&&(t.setRawMode(!1),t.removeListener("data",this.handleInput),t.pause())},this.handleInput=e=>{""===e&&this.props.exitOnCtrlC&&this.handleExit(),""===e&&this.state.activeFocusId&&this.setState({activeFocusId:void 0}),this.state.isFocusEnabled&&this.state.focusables.length>0&&("\t"===e&&this.focusNext(),""===e&&this.focusPrevious())},this.handleExit=e=>{this.isRawModeSupported()&&this.handleSetRawMode(!1),this.props.onExit(e)},this.enableFocus=()=>{this.setState({isFocusEnabled:!0})},this.disableFocus=()=>{this.setState({isFocusEnabled:!1})},this.focusNext=()=>{this.setState(e=>{const t=e.focusables[0].id;return{activeFocusId:this.findNextFocusable(e)||t}})},this.focusPrevious=()=>{this.setState(e=>{const t=e.focusables[e.focusables.length-1].id;return{activeFocusId:this.findPreviousFocusable(e)||t}})},this.addFocusable=(e,{autoFocus:t})=>{this.setState(n=>{let r=n.activeFocusId;return!r&&t&&(r=e),{activeFocusId:r,focusables:[...n.focusables,{id:e,isActive:!0}]}})},this.removeFocusable=e=>{this.setState(t=>({activeFocusId:t.activeFocusId===e?void 0:t.activeFocusId,focusables:t.focusables.filter(t=>t.id!==e)}))},this.activateFocusable=e=>{this.setState(t=>({focusables:t.focusables.map(t=>t.id!==e?t:{id:e,isActive:!0})}))},this.deactivateFocusable=e=>{this.setState(t=>({activeFocusId:t.activeFocusId===e?void 0:t.activeFocusId,focusables:t.focusables.map(t=>t.id!==e?t:{id:e,isActive:!1})}))},this.findNextFocusable=e=>{for(let t=e.focusables.findIndex(t=>t.id===e.activeFocusId)+1;t{for(let t=e.focusables.findIndex(t=>t.id===e.activeFocusId)-1;t>=0;t--)if(e.focusables[t].isActive)return e.focusables[t].id}}static getDerivedStateFromError(e){return{error:e}}isRawModeSupported(){return this.props.stdin.isTTY}render(){return a.default.createElement(s.default.Provider,{value:{exit:this.handleExit}},a.default.createElement(c.default.Provider,{value:{stdin:this.props.stdin,setRawMode:this.handleSetRawMode,isRawModeSupported:this.isRawModeSupported(),internal_exitOnCtrlC:this.props.exitOnCtrlC}},a.default.createElement(f.default.Provider,{value:{stdout:this.props.stdout,write:this.props.writeToStdout}},a.default.createElement(d.default.Provider,{value:{stderr:this.props.stderr,write:this.props.writeToStderr}},a.default.createElement(p.default.Provider,{value:{activeId:this.state.activeFocusId,add:this.addFocusable,remove:this.removeFocusable,activate:this.activateFocusable,deactivate:this.deactivateFocusable,enableFocus:this.enableFocus,disableFocus:this.disableFocus,focusNext:this.focusNext,focusPrevious:this.focusPrevious}},this.state.error?a.default.createElement(h.default,{error:this.state.error}):this.props.children)))))}componentDidMount(){l.default.hide(this.props.stdout)}componentWillUnmount(){l.default.show(this.props.stdout),this.isRawModeSupported()&&this.handleSetRawMode(!1)}componentDidCatch(e){this.handleExit(e)}}t.default=v,v.displayName="InternalApp"},5512:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7382).createContext({exit:()=>{}});r.displayName="InternalAppContext",t.default=r},5277:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},u=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i{var{children:n}=e,r=u(e,["children"]);const i=Object.assign(Object.assign({},r),{marginLeft:r.marginLeft||r.marginX||r.margin||0,marginRight:r.marginRight||r.marginX||r.margin||0,marginTop:r.marginTop||r.marginY||r.margin||0,marginBottom:r.marginBottom||r.marginY||r.margin||0,paddingLeft:r.paddingLeft||r.paddingX||r.padding||0,paddingRight:r.paddingRight||r.paddingX||r.padding||0,paddingTop:r.paddingTop||r.paddingY||r.padding||0,paddingBottom:r.paddingBottom||r.paddingY||r.padding||0});return a.default.createElement("ink-box",{ref:t,style:i},n)});l.displayName="Box",l.defaultProps={flexDirection:"row",flexGrow:0,flexShrink:1},t.default=l},9052:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(n(5747)),l=u(n(7382)),s=u(n(9796)),c=u(n(9908)),f=u(n(5277)),d=u(n(9146)),p=new s.default({cwd:process.cwd(),internals:s.default.nodeInternals()});t.default=({error:e})=>{const t=e.stack?e.stack.split("\n").slice(1):void 0,n=t?p.parseLine(t[0]):void 0;let r,i=0;if((null==n?void 0:n.file)&&(null==n?void 0:n.line)&&a.existsSync(n.file)){const e=a.readFileSync(n.file,"utf8");if(r=c.default(e,n.line),r)for(const{line:e}of r)i=Math.max(i,String(e).length)}return l.default.createElement(f.default,{flexDirection:"column",padding:1},l.default.createElement(f.default,null,l.default.createElement(d.default,{backgroundColor:"red",color:"white"}," ","ERROR"," "),l.default.createElement(d.default,null," ",e.message)),n&&l.default.createElement(f.default,{marginTop:1},l.default.createElement(d.default,{dimColor:!0},n.file,":",n.line,":",n.column)),n&&r&&l.default.createElement(f.default,{marginTop:1,flexDirection:"column"},r.map(({line:e,value:t})=>l.default.createElement(f.default,{key:e},l.default.createElement(f.default,{width:i+1},l.default.createElement(d.default,{dimColor:e!==n.line,backgroundColor:e===n.line?"red":void 0,color:e===n.line?"white":void 0},String(e).padStart(i," "),":")),l.default.createElement(d.default,{key:e,backgroundColor:e===n.line?"red":void 0,color:e===n.line?"white":void 0}," "+t)))),e.stack&&l.default.createElement(f.default,{marginTop:1,flexDirection:"column"},e.stack.split("\n").slice(1).map(e=>{const t=p.parseLine(e);return t?l.default.createElement(f.default,{key:e},l.default.createElement(d.default,{dimColor:!0},"- "),l.default.createElement(d.default,{dimColor:!0,bold:!0},t.function),l.default.createElement(d.default,{dimColor:!0,color:"gray"}," ","(",t.file,":",t.line,":",t.column,")")):l.default.createElement(f.default,{key:e},l.default.createElement(d.default,{dimColor:!0},"- "),l.default.createElement(d.default,{dimColor:!0,bold:!0},e))})))}},2560:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7382).createContext({activeId:void 0,add:()=>{},remove:()=>{},activate:()=>{},deactivate:()=>{},enableFocus:()=>{},disableFocus:()=>{},focusNext:()=>{},focusPrevious:()=>{}});r.displayName="InternalFocusContext",t.default=r},8200:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(7382)),o=({count:e=1})=>i.default.createElement("ink-text",null,"\n".repeat(e));o.displayName="Newline",t.default=o},2198:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(7382)),o=r(n(5277)),u=()=>i.default.createElement(o.default,{flexGrow:1});u.displayName="Spacer",t.default=u},8915:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const u=o(n(7382)),a=e=>{const{items:t,children:n,style:r}=e,[i,o]=u.useState(0),a=u.useMemo(()=>t.slice(i),[t,i]);u.useLayoutEffect(()=>{o(t.length)},[t.length]);const l=a.map((e,t)=>n(e,i+t)),s=u.useMemo(()=>Object.assign({position:"absolute",flexDirection:"column"},r),[r]);return u.default.createElement("ink-box",{internal_static:!0,style:s},l)};a.displayName="Static",t.default=a},5001:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7382).createContext({stderr:void 0,write:()=>{}});r.displayName="InternalStderrContext",t.default=r},1489:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7382).createContext({stdin:void 0,setRawMode:()=>{},isRawModeSupported:!1,internal_exitOnCtrlC:!0});r.displayName="InternalStdinContext",t.default=r},6834:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7382).createContext({stdout:void 0,write:()=>{}});r.displayName="InternalStdoutContext",t.default=r},9146:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(7382)),o=r(n(1525)),u=r(n(9902)),a=({color:e,backgroundColor:t,dimColor:n,bold:r,italic:a,underline:l,strikethrough:s,inverse:c,wrap:f,children:d})=>{if(null==d)return null;return i.default.createElement("ink-text",{style:{flexGrow:0,flexShrink:1,flexDirection:"row",textWrap:f},internal_transform:i=>(n&&(i=o.default.dim(i)),e&&(i=u.default(i,e,"foreground")),t&&(i=u.default(i,t,"background")),r&&(i=o.default.bold(i)),a&&(i=o.default.italic(i)),l&&(i=o.default.underline(i)),s&&(i=o.default.strikethrough(i)),c&&(i=o.default.inverse(i)),i)},d)};a.displayName="Text",a.defaultProps={dimColor:!1,bold:!1,italic:!1,underline:!1,strikethrough:!1,wrap:"wrap"},t.default=a},4592:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(7382)),o=({children:e,transform:t})=>null==e?null:i.default.createElement("ink-text",{style:{flexGrow:0,flexShrink:1,flexDirection:"row"},internal_transform:t},e);o.displayName="Transform",t.default=o},146:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(3296)),o=n(5187),u=global;u.WebSocket||(u.WebSocket=i.default),u.window||(u.window=global),u.window.__REACT_DEVTOOLS_COMPONENT_FILTERS__=[{type:1,value:7,isEnabled:!0},{type:2,value:"InternalApp",isEnabled:!0,isValid:!0},{type:2,value:"InternalAppContext",isEnabled:!0,isValid:!0},{type:2,value:"InternalStdoutContext",isEnabled:!0,isValid:!0},{type:2,value:"InternalStderrContext",isEnabled:!0,isValid:!0},{type:2,value:"InternalStdinContext",isEnabled:!0,isValid:!0},{type:2,value:"InternalFocusContext",isEnabled:!0,isValid:!0}],o.connectToDevTools()},9864:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.setTextNodeValue=t.createTextNode=t.setStyle=t.setAttribute=t.removeChildNode=t.insertBeforeNode=t.appendChildNode=t.createNode=t.TEXT_NAME=void 0;const i=r(n(6401)),o=r(n(8113)),u=r(n(5809)),a=r(n(2030)),l=r(n(9099));t.TEXT_NAME="#text",t.createNode=e=>{var t;const n={nodeName:e,style:{},attributes:{},childNodes:[],parentNode:null,yogaNode:"ink-virtual-text"===e?void 0:i.default.Node.create()};return"ink-text"===e&&(null===(t=n.yogaNode)||void 0===t||t.setMeasureFunc(s.bind(null,n))),n},t.appendChildNode=(e,n)=>{var r;n.parentNode&&t.removeChildNode(n.parentNode,n),n.parentNode=e,e.childNodes.push(n),n.yogaNode&&(null===(r=e.yogaNode)||void 0===r||r.insertChild(n.yogaNode,e.yogaNode.getChildCount())),"ink-text"!==e.nodeName&&"ink-virtual-text"!==e.nodeName||f(e)},t.insertBeforeNode=(e,n,r)=>{var i,o;n.parentNode&&t.removeChildNode(n.parentNode,n),n.parentNode=e;const u=e.childNodes.indexOf(r);if(u>=0)return e.childNodes.splice(u,0,n),void(n.yogaNode&&(null===(i=e.yogaNode)||void 0===i||i.insertChild(n.yogaNode,u)));e.childNodes.push(n),n.yogaNode&&(null===(o=e.yogaNode)||void 0===o||o.insertChild(n.yogaNode,e.yogaNode.getChildCount())),"ink-text"!==e.nodeName&&"ink-virtual-text"!==e.nodeName||f(e)},t.removeChildNode=(e,t)=>{var n,r;t.yogaNode&&(null===(r=null===(n=t.parentNode)||void 0===n?void 0:n.yogaNode)||void 0===r||r.removeChild(t.yogaNode)),t.parentNode=null;const i=e.childNodes.indexOf(t);i>=0&&e.childNodes.splice(i,1),"ink-text"!==e.nodeName&&"ink-virtual-text"!==e.nodeName||f(e)},t.setAttribute=(e,t,n)=>{e.attributes[t]=n},t.setStyle=(e,t)=>{e.style=t,e.yogaNode&&u.default(e.yogaNode,t)},t.createTextNode=e=>{const n={nodeName:"#text",nodeValue:e,yogaNode:void 0,parentNode:null,style:{}};return t.setTextNodeValue(n,e),n};const s=function(e,t){var n,r;const i="#text"===e.nodeName?e.nodeValue:l.default(e),u=o.default(i);if(u.width<=t)return u;if(u.width>=1&&t>0&&t<1)return u;const s=null!==(r=null===(n=e.style)||void 0===n?void 0:n.textWrap)&&void 0!==r?r:"wrap",c=a.default(i,t,s);return o.default(c)},c=e=>{var t;if(e&&e.parentNode)return null!==(t=e.yogaNode)&&void 0!==t?t:c(e.parentNode)},f=e=>{const t=c(e);null==t||t.markDirty()};t.setTextNodeValue=(e,t)=>{"string"!=typeof t&&(t=String(t)),e.nodeValue=t,f(e)}},317:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(6401));t.default=e=>e.getComputedWidth()-e.getComputedPadding(i.default.EDGE_LEFT)-e.getComputedPadding(i.default.EDGE_RIGHT)-e.getComputedBorder(i.default.EDGE_LEFT)-e.getComputedBorder(i.default.EDGE_RIGHT)},4699:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(7382),o=r(n(5512));t.default=()=>i.useContext(o.default)},5442:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(7382),o=r(n(2560));t.default=()=>{const e=i.useContext(o.default);return{enableFocus:e.enableFocus,disableFocus:e.disableFocus,focusNext:e.focusNext,focusPrevious:e.focusPrevious}}},8230:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(7382),o=r(n(2560)),u=r(n(1541));t.default=({isActive:e=!0,autoFocus:t=!1}={})=>{const{isRawModeSupported:n,setRawMode:r}=u.default(),{activeId:a,add:l,remove:s,activate:c,deactivate:f}=i.useContext(o.default),d=i.useMemo(()=>Math.random().toString().slice(2,7),[]);return i.useEffect(()=>(l(d,{autoFocus:t}),()=>{s(d)}),[d,t]),i.useEffect(()=>{e?c(d):f(d)},[e,d]),i.useEffect(()=>{if(n&&e)return r(!0),()=>{r(!1)}},[e]),{isFocused:Boolean(d)&&a===d}}},4495:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(7382),o=r(n(1541));t.default=(e,t={})=>{const{stdin:n,setRawMode:r,internal_exitOnCtrlC:u}=o.default();i.useEffect(()=>{if(!1!==t.isActive)return r(!0),()=>{r(!1)}},[t.isActive,r]),i.useEffect(()=>{if(!1===t.isActive)return;const r=t=>{let n=String(t);const r={upArrow:""===n,downArrow:""===n,leftArrow:""===n,rightArrow:""===n,pageDown:"[6~"===n,pageUp:"[5~"===n,return:"\r"===n,escape:""===n,ctrl:!1,shift:!1,tab:"\t"===n||""===n,backspace:"\b"===n,delete:""===n||"[3~"===n,meta:!1};n<=""&&!r.return&&(n=String.fromCharCode(n.charCodeAt(0)+"a".charCodeAt(0)-1),r.ctrl=!0),n.startsWith("")&&(n=n.slice(1),r.meta=!0);const i=n>="A"&&n<="Z",o=n>="А"&&n<="Я";1===n.length&&(i||o)&&(r.shift=!0),r.tab&&"[Z"===n&&(r.shift=!0),(r.tab||r.backspace||r.delete)&&(n=""),"c"===n&&r.ctrl&&u||e(n,r)};return null==n||n.on("data",r),()=>{null==n||n.off("data",r)}},[t.isActive,n,u,e])}},1686:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(7382),o=r(n(5001));t.default=()=>i.useContext(o.default)},1541:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(7382),o=r(n(1489));t.default=()=>i.useContext(o.default)},9890:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(7382),o=r(n(6834));t.default=()=>i.useContext(o.default)},9245:(e,t,n)=>{"use strict";var r=n(9417);Object.defineProperty(t,"sY",{enumerable:!0,get:function(){return r.default}});var i=n(5277);Object.defineProperty(t,"xu",{enumerable:!0,get:function(){return i.default}});var o=n(9146);Object.defineProperty(t,"xv",{enumerable:!0,get:function(){return o.default}});var u=n(8915);var a=n(4592);var l=n(8200);var s=n(2198);var c=n(4495);var f=n(4699);Object.defineProperty(t,"qD",{enumerable:!0,get:function(){return f.default}});var d=n(1541);Object.defineProperty(t,"lM",{enumerable:!0,get:function(){return d.default}});var p=n(9890);var h=n(1686);var v=n(8230);var m=n(5442);var g=n(3887)},3206:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=u(n(7382)),l=n(464),s=u(n(503)),c=u(n(7589)),f=u(n(2738)),d=u(n(2633)),p=u(n(5117)),h=u(n(5691)),v=u(n(6458)),m=u(n(8070)),g=o(n(9864)),_=u(n(9679)),y=u(n(2773)),b="false"!==process.env.CI&&f.default,w=()=>{};t.default=class{constructor(e){this.resolveExitPromise=()=>{},this.rejectExitPromise=()=>{},this.unsubscribeExit=()=>{},this.onRender=()=>{if(this.isUnmounted)return;const{output:e,outputHeight:t,staticOutput:n}=h.default(this.rootNode,this.options.stdout.columns||80),r=n&&"\n"!==n;return this.options.debug?(r&&(this.fullStaticOutput+=n),void this.options.stdout.write(this.fullStaticOutput+e)):b?(r&&this.options.stdout.write(n),void(this.lastOutput=e)):(r&&(this.fullStaticOutput+=n),t>=this.options.stdout.rows?(this.options.stdout.write(c.default.clearTerminal+this.fullStaticOutput+e),void(this.lastOutput=e)):(r&&(this.log.clear(),this.options.stdout.write(n),this.log(e)),r||e===this.lastOutput||this.throttledLog(e),void(this.lastOutput=e)))},d.default(this),this.options=e,this.rootNode=g.createNode("ink-root"),this.rootNode.onRender=e.debug?this.onRender:l.throttle(this.onRender,32,{leading:!0,trailing:!0}),this.rootNode.onImmediateRender=this.onRender,this.log=s.default.create(e.stdout),this.throttledLog=e.debug?this.log:l.throttle(this.log,void 0,{leading:!0,trailing:!0}),this.isUnmounted=!1,this.lastOutput="",this.fullStaticOutput="",this.container=p.default.createContainer(this.rootNode,!1,!1),this.unsubscribeExit=v.default(this.unmount,{alwaysLast:!1}),"true"===process.env.DEV&&p.default.injectIntoDevTools({bundleType:0,version:"16.13.1",rendererPackageName:"ink"}),e.patchConsole&&this.patchConsole(),b||(e.stdout.on("resize",this.onRender),this.unsubscribeResize=()=>{e.stdout.off("resize",this.onRender)})}render(e){const t=a.default.createElement(y.default,{stdin:this.options.stdin,stdout:this.options.stdout,stderr:this.options.stderr,writeToStdout:this.writeToStdout,writeToStderr:this.writeToStderr,exitOnCtrlC:this.options.exitOnCtrlC,onExit:this.unmount},e);p.default.updateContainer(t,this.container,null,w)}writeToStdout(e){this.isUnmounted||(this.options.debug?this.options.stdout.write(e+this.fullStaticOutput+this.lastOutput):b?this.options.stdout.write(e):(this.log.clear(),this.options.stdout.write(e),this.log(this.lastOutput)))}writeToStderr(e){if(!this.isUnmounted)return this.options.debug?(this.options.stderr.write(e),void this.options.stdout.write(this.fullStaticOutput+this.lastOutput)):void(b?this.options.stderr.write(e):(this.log.clear(),this.options.stderr.write(e),this.log(this.lastOutput)))}unmount(e){this.isUnmounted||(this.onRender(),this.unsubscribeExit(),"function"==typeof this.restoreConsole&&this.restoreConsole(),"function"==typeof this.unsubscribeResize&&this.unsubscribeResize(),b?this.options.stdout.write(this.lastOutput+"\n"):this.options.debug||this.log.done(),this.isUnmounted=!0,p.default.updateContainer(null,this.container,null,w),_.default.delete(this.options.stdout),e instanceof Error?this.rejectExitPromise(e):this.resolveExitPromise())}waitUntilExit(){return this.exitPromise||(this.exitPromise=new Promise((e,t)=>{this.resolveExitPromise=e,this.rejectExitPromise=t})),this.exitPromise}clear(){b||this.options.debug||this.log.clear()}patchConsole(){this.options.debug||(this.restoreConsole=m.default((e,t)=>{if("stdout"===e&&this.writeToStdout(t),"stderr"===e){t.startsWith("The above error occurred")||this.writeToStderr(t)}}))}}},9679:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=new WeakMap},503:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(7589)),o=r(n(1696));t.default={create:(e,{showCursor:t=!1}={})=>{let n=0,r="",u=!1;const a=a=>{t||u||(o.default.hide(),u=!0);const l=a+"\n";l!==r&&(r=l,e.write(i.default.eraseLines(n)+l),n=l.split("\n").length)};return a.clear=()=>{e.write(i.default.eraseLines(n)),r="",n=0},a.done=()=>{r="",n=0,t||(o.default.show(),u=!1)},a}}},3887:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=e=>{var t,n,r,i;return{width:null!==(n=null===(t=e.yogaNode)||void 0===t?void 0:t.getComputedWidth())&&void 0!==n?n:0,height:null!==(i=null===(r=e.yogaNode)||void 0===r?void 0:r.getComputedHeight())&&void 0!==i?i:0}}},8113:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(8949)),o={};t.default=e=>{if(0===e.length)return{width:0,height:0};if(o[e])return o[e];const t=i.default(e),n=e.split("\n").length;return o[e]={width:t,height:n},{width:t,height:n}}},4110:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(1566)),o=r(n(3262));t.default=class{constructor(e){this.writes=[];const{width:t,height:n}=e;this.width=t,this.height=n}write(e,t,n,r){const{transformers:i}=r;n&&this.writes.push({x:e,y:t,text:n,transformers:i})}get(){const e=[];for(let t=0;te.trimRight()).join("\n"),height:e.length}}}},5117:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(7181),o=r(n(7714)),u=r(n(6401)),a=n(9864);"true"===process.env.DEV&&n(146);const l=e=>{null==e||e.unsetMeasureFunc(),null==e||e.freeRecursive()};t.default=o.default({schedulePassiveEffects:i.unstable_scheduleCallback,cancelPassiveEffects:i.unstable_cancelCallback,now:Date.now,getRootHostContext:()=>({isInsideText:!1}),prepareForCommit:()=>{},resetAfterCommit:e=>{if(e.isStaticDirty)return e.isStaticDirty=!1,void("function"==typeof e.onImmediateRender&&e.onImmediateRender());"function"==typeof e.onRender&&e.onRender()},getChildHostContext:(e,t)=>{const n="ink-text"===t||"ink-virtual-text"===t;return e.isInsideText===n?e:{isInsideText:n}},shouldSetTextContent:()=>!1,createInstance:(e,t,n,r)=>{if(r.isInsideText&&"ink-box"===e)throw new Error(" can’t be nested inside component");const i="ink-text"===e&&r.isInsideText?"ink-virtual-text":e,o=a.createNode(i);for(const[e,n]of Object.entries(t))"children"!==e&&("style"===e?a.setStyle(o,n):"internal_transform"===e?o.internal_transform=n:"internal_static"===e?o.internal_static=!0:a.setAttribute(o,e,n));return o},createTextInstance:(e,t,n)=>{if(!n.isInsideText)throw new Error(`Text string "${e}" must be rendered inside component`);return a.createTextNode(e)},resetTextContent:()=>{},hideTextInstance:e=>{a.setTextNodeValue(e,"")},unhideTextInstance:(e,t)=>{a.setTextNodeValue(e,t)},getPublicInstance:e=>e,hideInstance:e=>{var t;null===(t=e.yogaNode)||void 0===t||t.setDisplay(u.default.DISPLAY_NONE)},unhideInstance:e=>{var t;null===(t=e.yogaNode)||void 0===t||t.setDisplay(u.default.DISPLAY_FLEX)},appendInitialChild:a.appendChildNode,appendChild:a.appendChildNode,insertBefore:a.insertBeforeNode,finalizeInitialChildren:(e,t,n,r)=>(e.internal_static&&(r.isStaticDirty=!0,r.staticNode=e),!1),supportsMutation:!0,appendChildToContainer:a.appendChildNode,insertInContainerBefore:a.insertBeforeNode,removeChildFromContainer:(e,t)=>{a.removeChildNode(e,t),l(t.yogaNode)},prepareUpdate:(e,t,n,r,i)=>{e.internal_static&&(i.isStaticDirty=!0);const o={},u=Object.keys(r);for(const e of u)if(r[e]!==n[e]){if("style"===e&&"object"==typeof r.style&&"object"==typeof n.style){const e=r.style,t=n.style,i=Object.keys(e);for(const n of i){if("borderStyle"===n||"borderColor"===n){if("object"!=typeof o.style){const e={};o.style=e}o.style.borderStyle=e.borderStyle,o.style.borderColor=e.borderColor}if(e[n]!==t[n]){if("object"!=typeof o.style){const e={};o.style=e}o.style[n]=e[n]}}continue}o[e]=r[e]}return o},commitUpdate:(e,t)=>{for(const[n,r]of Object.entries(t))"children"!==n&&("style"===n?a.setStyle(e,r):"internal_transform"===n?e.internal_transform=r:"internal_static"===n?e.internal_static=!0:a.setAttribute(e,n,r))},commitTextUpdate:(e,t,n)=>{a.setTextNodeValue(e,n)},removeChild:(e,t)=>{a.removeChildNode(e,t),l(t.yogaNode)}})},4907:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(4097)),o=r(n(9902));t.default=(e,t,n,r)=>{if("string"==typeof n.style.borderStyle){const u=n.yogaNode.getComputedWidth(),a=n.yogaNode.getComputedHeight(),l=n.style.borderColor,s=i.default[n.style.borderStyle],c=o.default(s.topLeft+s.horizontal.repeat(u-2)+s.topRight,l,"foreground"),f=(o.default(s.vertical,l,"foreground")+"\n").repeat(a-2),d=o.default(s.bottomLeft+s.horizontal.repeat(u-2)+s.bottomRight,l,"foreground");r.write(e,t,c,{transformers:[]}),r.write(e,t+1,f,{transformers:[]}),r.write(e+u-1,t+1,f,{transformers:[]}),r.write(e,t+a-1,d,{transformers:[]})}}},3782:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(6401)),o=r(n(8949)),u=r(n(9646)),a=r(n(2030)),l=r(n(317)),s=r(n(9099)),c=r(n(4907)),f=(e,t,n)=>{var r;const{offsetX:d=0,offsetY:p=0,transformers:h=[],skipStaticElements:v}=n;if(v&&e.internal_static)return;const{yogaNode:m}=e;if(m){if(m.getDisplay()===i.default.DISPLAY_NONE)return;const n=d+m.getComputedLeft(),g=p+m.getComputedTop();let _=h;if("function"==typeof e.internal_transform&&(_=[e.internal_transform,...h]),"ink-text"===e.nodeName){let i=s.default(e);if(i.length>0){const s=o.default(i),c=l.default(m);if(s>c){const t=null!==(r=e.style.textWrap)&&void 0!==r?r:"wrap";i=a.default(i,c,t)}i=((e,t)=>{var n;const r=null===(n=e.childNodes[0])||void 0===n?void 0:n.yogaNode;if(r){const e=r.getComputedLeft(),n=r.getComputedTop();t="\n".repeat(n)+u.default(t,e)}return t})(e,i),t.write(n,g,i,{transformers:_})}return}if("ink-box"===e.nodeName&&c.default(n,g,e,t),"ink-root"===e.nodeName||"ink-box"===e.nodeName)for(const r of e.childNodes)f(r,t,{offsetX:n,offsetY:g,transformers:_,skipStaticElements:v})}};t.default=f},9417:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(3206)),o=r(n(9679)),u=n(2413);t.default=(e,t)=>{const n=Object.assign({stdout:process.stdout,stdin:process.stdin,stderr:process.stderr,debug:!1,exitOnCtrlC:!0,patchConsole:!0},a(t)),r=l(n.stdout,()=>new i.default(n));return r.render(e),{rerender:r.render,unmount:()=>r.unmount(),waitUntilExit:r.waitUntilExit,cleanup:()=>o.default.delete(n.stdout),clear:r.clear}};const a=(e={})=>e instanceof u.Stream?{stdout:e,stdin:process.stdin}:e,l=(e,t)=>{let n;return o.default.has(e)?n=o.default.get(e):(n=t(),o.default.set(e,n)),n}},5691:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(6401)),o=r(n(3782)),u=r(n(4110));t.default=(e,t)=>{var n;if(e.yogaNode.setWidth(t),e.yogaNode){e.yogaNode.calculateLayout(void 0,void 0,i.default.DIRECTION_LTR);const t=new u.default({width:e.yogaNode.getComputedWidth(),height:e.yogaNode.getComputedHeight()});let r;o.default(e,t,{skipStaticElements:!0}),(null===(n=e.staticNode)||void 0===n?void 0:n.yogaNode)&&(r=new u.default({width:e.staticNode.yogaNode.getComputedWidth(),height:e.staticNode.yogaNode.getComputedHeight()}),o.default(e.staticNode,r,{skipStaticElements:!1}));const{output:a,height:l}=t.get();return{output:a,outputHeight:l,staticOutput:r?r.get().output+"\n":""}}return{output:"",outputHeight:0,staticOutput:""}}},9099:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e=>{let t="";if(e.childNodes.length>0)for(const r of e.childNodes){let e="";"#text"===r.nodeName?e=r.nodeValue:("ink-text"!==r.nodeName&&"ink-virtual-text"!==r.nodeName||(e=n(r)),e.length>0&&"function"==typeof r.internal_transform&&(e=r.internal_transform(e))),t+=e}return t};t.default=n},5809:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(6401));t.default=(e,t={})=>{((e,t)=>{"position"in t&&e.setPositionType("absolute"===t.position?i.default.POSITION_TYPE_ABSOLUTE:i.default.POSITION_TYPE_RELATIVE)})(e,t),((e,t)=>{"marginLeft"in t&&e.setMargin(i.default.EDGE_START,t.marginLeft||0),"marginRight"in t&&e.setMargin(i.default.EDGE_END,t.marginRight||0),"marginTop"in t&&e.setMargin(i.default.EDGE_TOP,t.marginTop||0),"marginBottom"in t&&e.setMargin(i.default.EDGE_BOTTOM,t.marginBottom||0)})(e,t),((e,t)=>{"paddingLeft"in t&&e.setPadding(i.default.EDGE_LEFT,t.paddingLeft||0),"paddingRight"in t&&e.setPadding(i.default.EDGE_RIGHT,t.paddingRight||0),"paddingTop"in t&&e.setPadding(i.default.EDGE_TOP,t.paddingTop||0),"paddingBottom"in t&&e.setPadding(i.default.EDGE_BOTTOM,t.paddingBottom||0)})(e,t),((e,t)=>{var n;"flexGrow"in t&&e.setFlexGrow(null!==(n=t.flexGrow)&&void 0!==n?n:0),"flexShrink"in t&&e.setFlexShrink("number"==typeof t.flexShrink?t.flexShrink:1),"flexDirection"in t&&("row"===t.flexDirection&&e.setFlexDirection(i.default.FLEX_DIRECTION_ROW),"row-reverse"===t.flexDirection&&e.setFlexDirection(i.default.FLEX_DIRECTION_ROW_REVERSE),"column"===t.flexDirection&&e.setFlexDirection(i.default.FLEX_DIRECTION_COLUMN),"column-reverse"===t.flexDirection&&e.setFlexDirection(i.default.FLEX_DIRECTION_COLUMN_REVERSE)),"flexBasis"in t&&("number"==typeof t.flexBasis?e.setFlexBasis(t.flexBasis):"string"==typeof t.flexBasis?e.setFlexBasisPercent(Number.parseInt(t.flexBasis,10)):e.setFlexBasis(NaN)),"alignItems"in t&&("stretch"!==t.alignItems&&t.alignItems||e.setAlignItems(i.default.ALIGN_STRETCH),"flex-start"===t.alignItems&&e.setAlignItems(i.default.ALIGN_FLEX_START),"center"===t.alignItems&&e.setAlignItems(i.default.ALIGN_CENTER),"flex-end"===t.alignItems&&e.setAlignItems(i.default.ALIGN_FLEX_END)),"alignSelf"in t&&("auto"!==t.alignSelf&&t.alignSelf||e.setAlignSelf(i.default.ALIGN_AUTO),"flex-start"===t.alignSelf&&e.setAlignSelf(i.default.ALIGN_FLEX_START),"center"===t.alignSelf&&e.setAlignSelf(i.default.ALIGN_CENTER),"flex-end"===t.alignSelf&&e.setAlignSelf(i.default.ALIGN_FLEX_END)),"justifyContent"in t&&("flex-start"!==t.justifyContent&&t.justifyContent||e.setJustifyContent(i.default.JUSTIFY_FLEX_START),"center"===t.justifyContent&&e.setJustifyContent(i.default.JUSTIFY_CENTER),"flex-end"===t.justifyContent&&e.setJustifyContent(i.default.JUSTIFY_FLEX_END),"space-between"===t.justifyContent&&e.setJustifyContent(i.default.JUSTIFY_SPACE_BETWEEN),"space-around"===t.justifyContent&&e.setJustifyContent(i.default.JUSTIFY_SPACE_AROUND))})(e,t),((e,t)=>{var n,r;"width"in t&&("number"==typeof t.width?e.setWidth(t.width):"string"==typeof t.width?e.setWidthPercent(Number.parseInt(t.width,10)):e.setWidthAuto()),"height"in t&&("number"==typeof t.height?e.setHeight(t.height):"string"==typeof t.height?e.setHeightPercent(Number.parseInt(t.height,10)):e.setHeightAuto()),"minWidth"in t&&("string"==typeof t.minWidth?e.setMinWidthPercent(Number.parseInt(t.minWidth,10)):e.setMinWidth(null!==(n=t.minWidth)&&void 0!==n?n:0)),"minHeight"in t&&("string"==typeof t.minHeight?e.setMinHeightPercent(Number.parseInt(t.minHeight,10)):e.setMinHeight(null!==(r=t.minHeight)&&void 0!==r?r:0))})(e,t),((e,t)=>{"display"in t&&e.setDisplay("flex"===t.display?i.default.DISPLAY_FLEX:i.default.DISPLAY_NONE)})(e,t),((e,t)=>{if("borderStyle"in t){const n="string"==typeof t.borderStyle?1:0;e.setBorder(i.default.EDGE_TOP,n),e.setBorder(i.default.EDGE_BOTTOM,n),e.setBorder(i.default.EDGE_LEFT,n),e.setBorder(i.default.EDGE_RIGHT,n)}})(e,t)}},2030:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(4332)),o=r(n(5301)),u={};t.default=(e,t,n)=>{const r=e+String(t)+String(n);if(u[r])return u[r];let a=e;if("wrap"===n&&(a=i.default(e,t,{trim:!1,hard:!0})),n.startsWith("truncate")){let r="end";"truncate-middle"===n&&(r="middle"),"truncate-start"===n&&(r="start"),a=o.default(e,t,{position:r})}return u[r]=a,a}},5767:(e,t,n)=>{ +/** @license React v0.24.0 + * react-reconciler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +e.exports=function t(r){"use strict";var i=n(9381),o=n(7382),u=n(7181);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nOe||(e.current=Ae[Oe],Ae[Oe]=null,Oe--)}function Ie(e,t){Oe++,Ae[Oe]=e.current,e.current=t}var Re={},Ne={current:Re},Pe={current:!1},Fe=Re;function Le(e,t){var n=e.type.contextTypes;if(!n)return Re;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Be(e){return null!=(e=e.childContextTypes)}function Ue(e){Me(Pe),Me(Ne)}function je(e){Me(Pe),Me(Ne)}function ze(e,t,n){if(Ne.current!==Re)throw Error(a(168));Ie(Ne,t),Ie(Pe,n)}function We(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var o in r=r.getChildContext())if(!(o in e))throw Error(a(108,k(t)||"Unknown",o));return i({},n,{},r)}function He(e){var t=e.stateNode;return t=t&&t.__reactInternalMemoizedMergedChildContext||Re,Fe=Ne.current,Ie(Ne,t),Ie(Pe,Pe.current),!0}function Ve(e,t,n){var r=e.stateNode;if(!r)throw Error(a(169));n?(t=We(e,t,Fe),r.__reactInternalMemoizedMergedChildContext=t,Me(Pe),Me(Ne),Ie(Ne,t)):Me(Pe),Ie(Pe,n)}var $e=u.unstable_runWithPriority,Ge=u.unstable_scheduleCallback,qe=u.unstable_cancelCallback,Ye=u.unstable_shouldYield,Xe=u.unstable_requestPaint,Ke=u.unstable_now,Je=u.unstable_getCurrentPriorityLevel,Qe=u.unstable_ImmediatePriority,Ze=u.unstable_UserBlockingPriority,et=u.unstable_NormalPriority,tt=u.unstable_LowPriority,nt=u.unstable_IdlePriority,rt={},it=void 0!==Xe?Xe:function(){},ot=null,ut=null,at=!1,lt=Ke(),st=1e4>lt?Ke:function(){return Ke()-lt};function ct(){switch(Je()){case Qe:return 99;case Ze:return 98;case et:return 97;case tt:return 96;case nt:return 95;default:throw Error(a(332))}}function ft(e){switch(e){case 99:return Qe;case 98:return Ze;case 97:return et;case 96:return tt;case 95:return nt;default:throw Error(a(332))}}function dt(e,t){return e=ft(e),$e(e,t)}function pt(e,t,n){return e=ft(e),Ge(e,t,n)}function ht(e){return null===ot?(ot=[e],ut=Ge(Qe,mt)):ot.push(e),rt}function vt(){if(null!==ut){var e=ut;ut=null,qe(e)}mt()}function mt(){if(!at&&null!==ot){at=!0;var e=0;try{var t=ot;dt(99,(function(){for(;e=t&&(dr=!0),e.firstContext=null)}function It(e,t){if(St!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(St=e,t=1073741823),t={context:e,observedBits:t,next:null},null===kt){if(null===Ct)throw Error(a(308));kt=t,Ct.dependencies={expirationTime:0,firstContext:t,responders:null}}else kt=kt.next=t;return $?e._currentValue:e._currentValue2}var Rt=!1;function Nt(e){return{baseState:e,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Pt(e){return{baseState:e.baseState,firstUpdate:e.firstUpdate,lastUpdate:e.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Ft(e,t){return{expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null,nextEffect:null}}function Lt(e,t){null===e.lastUpdate?e.firstUpdate=e.lastUpdate=t:(e.lastUpdate.next=t,e.lastUpdate=t)}function Bt(e,t){var n=e.alternate;if(null===n){var r=e.updateQueue,i=null;null===r&&(r=e.updateQueue=Nt(e.memoizedState))}else r=e.updateQueue,i=n.updateQueue,null===r?null===i?(r=e.updateQueue=Nt(e.memoizedState),i=n.updateQueue=Nt(n.memoizedState)):r=e.updateQueue=Pt(i):null===i&&(i=n.updateQueue=Pt(r));null===i||r===i?Lt(r,t):null===r.lastUpdate||null===i.lastUpdate?(Lt(r,t),Lt(i,t)):(Lt(r,t),i.lastUpdate=t)}function Ut(e,t){var n=e.updateQueue;null===(n=null===n?e.updateQueue=Nt(e.memoizedState):jt(e,n)).lastCapturedUpdate?n.firstCapturedUpdate=n.lastCapturedUpdate=t:(n.lastCapturedUpdate.next=t,n.lastCapturedUpdate=t)}function jt(e,t){var n=e.alternate;return null!==n&&t===n.updateQueue&&(t=e.updateQueue=Pt(t)),t}function zt(e,t,n,r,o,u){switch(n.tag){case 1:return"function"==typeof(e=n.payload)?e.call(u,r,o):e;case 3:e.effectTag=-4097&e.effectTag|64;case 0:if(null==(o="function"==typeof(e=n.payload)?e.call(u,r,o):e))break;return i({},r,o);case 2:Rt=!0}return r}function Wt(e,t,n,r,i){Rt=!1;for(var o=(t=jt(e,t)).baseState,u=null,a=0,l=t.firstUpdate,s=o;null!==l;){var c=l.expirationTime;cd?(p=f,f=null):p=f.sibling;var h=m(i,f,a[d],l);if(null===h){null===f&&(f=p);break}e&&f&&null===h.alternate&&t(i,f),u=o(h,u,d),null===c?s=h:c.sibling=h,c=h,f=p}if(d===a.length)return n(i,f),s;if(null===f){for(;dp?(h=d,d=null):h=d.sibling;var y=m(i,d,_.value,s);if(null===y){null===d&&(d=h);break}e&&d&&null===y.alternate&&t(i,d),u=o(y,u,p),null===f?c=y:f.sibling=y,f=y,d=h}if(_.done)return n(i,d),c;if(null===d){for(;!_.done;p++,_=l.next())null!==(_=v(i,_.value,s))&&(u=o(_,u,p),null===f?c=_:f.sibling=_,f=_);return c}for(d=r(i,d);!_.done;p++,_=l.next())null!==(_=g(d,i,p,_.value,s))&&(e&&null!==_.alternate&&d.delete(null===_.key?p:_.key),u=o(_,u,p),null===f?c=_:f.sibling=_,f=_);return e&&d.forEach((function(e){return t(i,e)})),c}return function(e,r,o,l){var s="object"==typeof o&&null!==o&&o.type===d&&null===o.key;s&&(o=o.props.children);var p="object"==typeof o&&null!==o;if(p)switch(o.$$typeof){case c:e:{for(p=o.key,s=r;null!==s;){if(s.key===p){if(7===s.tag?o.type===d:s.elementType===o.type){n(e,s.sibling),(r=i(s,o.type===d?o.props.children:o.props)).ref=en(e,s,o),r.return=e,e=r;break e}n(e,s);break}t(e,s),s=s.sibling}o.type===d?((r=so(o.props.children,e.mode,l,o.key)).return=e,e=r):((l=lo(o.type,o.key,o.props,null,e.mode,l)).ref=en(e,r,o),l.return=e,e=l)}return u(e);case f:e:{for(s=o.key;null!==r;){if(r.key===s){if(4===r.tag&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),(r=i(r,o.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=fo(o,e.mode,l)).return=e,e=r}return u(e)}if("string"==typeof o||"number"==typeof o)return o=""+o,null!==r&&6===r.tag?(n(e,r.sibling),(r=i(r,o)).return=e,e=r):(n(e,r),(r=co(o,e.mode,l)).return=e,e=r),u(e);if(Zt(o))return _(e,r,o,l);if(C(o))return y(e,r,o,l);if(p&&tn(e,o),void 0===o&&!s)switch(e.tag){case 1:case 0:throw e=e.type,Error(a(152,e.displayName||e.name||"Component"))}return n(e,r)}}var rn=nn(!0),on=nn(!1),un={},an={current:un},ln={current:un},sn={current:un};function cn(e){if(e===un)throw Error(a(174));return e}function fn(e,t){Ie(sn,t),Ie(ln,e),Ie(an,un),t=M(t),Me(an),Ie(an,t)}function dn(e){Me(an),Me(ln),Me(sn)}function pn(e){var t=cn(sn.current),n=cn(an.current);n!==(t=I(n,e.type,t))&&(Ie(ln,e),Ie(an,t))}function hn(e){ln.current===e&&(Me(an),Me(ln))}var vn={current:0};function mn(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||_e(n)||ye(n)))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.effectTag))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function gn(e,t){return{responder:e,props:t}}var _n=l.ReactCurrentDispatcher,yn=l.ReactCurrentBatchConfig,bn=0,wn=null,En=null,Dn=null,Cn=null,kn=null,Sn=null,Tn=0,xn=null,An=0,On=!1,Mn=null,In=0;function Rn(){throw Error(a(321))}function Nn(e,t){if(null===t)return!1;for(var n=0;nTn&&zi(Tn=f)):(ji(f,s.suspenseConfig),o=s.eagerReducer===e?s.eagerState:e(o,s.action)),u=s,s=s.next}while(null!==s&&s!==r);c||(l=u,i=o),yt(o,t.memoizedState)||(dr=!0),t.memoizedState=o,t.baseUpdate=l,t.baseState=i,n.lastRenderedState=o}return[t.memoizedState,n.dispatch]}function zn(e){var t=Ln();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={last:null,dispatch:null,lastRenderedReducer:Un,lastRenderedState:e}).dispatch=Qn.bind(null,wn,e),[t.memoizedState,e]}function Wn(e){return jn(Un)}function Hn(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===xn?(xn={lastEffect:null}).lastEffect=e.next=e:null===(t=xn.lastEffect)?xn.lastEffect=e.next=e:(n=t.next,t.next=e,e.next=n,xn.lastEffect=e),e}function Vn(e,t,n,r){var i=Ln();An|=e,i.memoizedState=Hn(t,n,void 0,void 0===r?null:r)}function $n(e,t,n,r){var i=Bn();r=void 0===r?null:r;var o=void 0;if(null!==En){var u=En.memoizedState;if(o=u.destroy,null!==r&&Nn(r,u.deps))return void Hn(0,n,o,r)}An|=e,i.memoizedState=Hn(t,n,o,r)}function Gn(e,t){return Vn(516,192,e,t)}function qn(e,t){return $n(516,192,e,t)}function Yn(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Xn(){}function Kn(e,t){return Ln().memoizedState=[e,void 0===t?null:t],e}function Jn(e,t){var n=Bn();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Nn(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Qn(e,t,n){if(!(25>In))throw Error(a(301));var r=e.alternate;if(e===wn||null!==r&&r===wn)if(On=!0,e={expirationTime:bn,suspenseConfig:null,action:n,eagerReducer:null,eagerState:null,next:null},null===Mn&&(Mn=new Map),void 0===(n=Mn.get(t)))Mn.set(t,e);else{for(t=n;null!==t.next;)t=t.next;t.next=e}else{var i=xi(),o=$t.suspense;o={expirationTime:i=Ai(i,e,o),suspenseConfig:o,action:n,eagerReducer:null,eagerState:null,next:null};var u=t.last;if(null===u)o.next=o;else{var l=u.next;null!==l&&(o.next=l),u.next=o}if(t.last=o,0===e.expirationTime&&(null===r||0===r.expirationTime)&&null!==(r=t.lastRenderedReducer))try{var s=t.lastRenderedState,c=r(s,n);if(o.eagerReducer=r,o.eagerState=c,yt(c,s))return}catch(e){}Oi(e,i)}}var Zn={readContext:It,useCallback:Rn,useContext:Rn,useEffect:Rn,useImperativeHandle:Rn,useLayoutEffect:Rn,useMemo:Rn,useReducer:Rn,useRef:Rn,useState:Rn,useDebugValue:Rn,useResponder:Rn,useDeferredValue:Rn,useTransition:Rn},er={readContext:It,useCallback:Kn,useContext:It,useEffect:Gn,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Vn(4,36,Yn.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Vn(4,36,e,t)},useMemo:function(e,t){var n=Ln();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ln();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={last:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=Qn.bind(null,wn,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Ln().memoizedState=e},useState:zn,useDebugValue:Xn,useResponder:gn,useDeferredValue:function(e,t){var n=zn(e),r=n[0],i=n[1];return Gn((function(){u.unstable_next((function(){var n=yn.suspense;yn.suspense=void 0===t?null:t;try{i(e)}finally{yn.suspense=n}}))}),[e,t]),r},useTransition:function(e){var t=zn(!1),n=t[0],r=t[1];return[Kn((function(t){r(!0),u.unstable_next((function(){var n=yn.suspense;yn.suspense=void 0===e?null:e;try{r(!1),t()}finally{yn.suspense=n}}))}),[e,n]),n]}},tr={readContext:It,useCallback:Jn,useContext:It,useEffect:qn,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,$n(4,36,Yn.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $n(4,36,e,t)},useMemo:function(e,t){var n=Bn();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Nn(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)},useReducer:jn,useRef:function(){return Bn().memoizedState},useState:Wn,useDebugValue:Xn,useResponder:gn,useDeferredValue:function(e,t){var n=Wn(),r=n[0],i=n[1];return qn((function(){u.unstable_next((function(){var n=yn.suspense;yn.suspense=void 0===t?null:t;try{i(e)}finally{yn.suspense=n}}))}),[e,t]),r},useTransition:function(e){var t=Wn(),n=t[0],r=t[1];return[Jn((function(t){r(!0),u.unstable_next((function(){var n=yn.suspense;yn.suspense=void 0===e?null:e;try{r(!1),t()}finally{yn.suspense=n}}))}),[e,n]),n]}},nr=null,rr=null,ir=!1;function or(e,t){var n=oo(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function ur(e,t){switch(e.tag){case 5:return null!==(t=me(t,e.type,e.pendingProps))&&(e.stateNode=t,!0);case 6:return null!==(t=ge(t,e.pendingProps))&&(e.stateNode=t,!0);case 13:default:return!1}}function ar(e){if(ir){var t=rr;if(t){var n=t;if(!ur(e,t)){if(!(t=be(n))||!ur(e,t))return e.effectTag=-1025&e.effectTag|2,ir=!1,void(nr=e);or(nr,n)}nr=e,rr=we(t)}else e.effectTag=-1025&e.effectTag|2,ir=!1,nr=e}}function lr(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;nr=e}function sr(e){if(!Y||e!==nr)return!1;if(!ir)return lr(e),ir=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!U(t,e.memoizedProps))for(t=rr;t;)or(e,t),t=be(t);if(lr(e),13===e.tag){if(!Y)throw Error(a(316));if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(a(317));rr=Ce(e)}else rr=nr?be(e.stateNode):null;return!0}function cr(){Y&&(rr=nr=null,ir=!1)}var fr=l.ReactCurrentOwner,dr=!1;function pr(e,t,n,r){t.child=null===e?on(t,null,n,r):rn(t,e.child,n,r)}function hr(e,t,n,r,i){n=n.render;var o=t.ref;return Mt(t,i),r=Pn(e,t,n,r,o,i),null===e||dr?(t.effectTag|=1,pr(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=i&&(e.expirationTime=0),Mr(e,t,i))}function vr(e,t,n,r,i,o){if(null===e){var u=n.type;return"function"!=typeof u||uo(u)||void 0!==u.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=lo(n.type,null,r,null,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=u,mr(e,t,u,r,i,o))}return u=e.child,it)&&Ci.set(e,t))}}function Mi(e,t){e.expirationTime(e=e.nextKnownPendingLevel)?t:e:t}function Ri(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=ht(Pi.bind(null,e));else{var t=Ii(e),n=e.callbackNode;if(0===t)null!==n&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var r=xi();if(1073741823===t?r=99:1===t||2===t?r=95:r=0>=(r=10*(1073741821-t)-10*(1073741821-r))?99:250>=r?98:5250>=r?97:95,null!==n){var i=e.callbackPriority;if(e.callbackExpirationTime===t&&i>=r)return;n!==rt&&qe(n)}e.callbackExpirationTime=t,e.callbackPriority=r,t=1073741823===t?ht(Pi.bind(null,e)):pt(r,Ni.bind(null,e),{timeout:10*(1073741821-t)-st()}),e.callbackNode=t}}}function Ni(e,t){if(Ti=0,t)return go(e,t=xi()),Ri(e),null;var n=Ii(e);if(0!==n){if(t=e.callbackNode,0!=(48&oi))throw Error(a(327));if(Ki(),e===ui&&n===li||Li(e,n),null!==ai){var r=oi;oi|=ii;for(var i=Ui();;)try{Hi();break}catch(t){Bi(e,t)}if(Tt(),oi=r,ni.current=i,1===si)throw t=ci,Li(e,n),vo(e,n),Ri(e),t;if(null===ai)switch(i=e.finishedWork=e.current.alternate,e.finishedExpirationTime=n,r=si,ui=null,r){case 0:case 1:throw Error(a(345));case 2:go(e,2=n){e.lastPingedTime=n,Li(e,n);break}}if(0!==(o=Ii(e))&&o!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}e.timeoutHandle=W(qi.bind(null,e),i);break}qi(e);break;case 4:if(vo(e,n),n===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=Gi(i)),vi&&(0===(i=e.lastPingedTime)||i>=n)){e.lastPingedTime=n,Li(e,n);break}if(0!==(i=Ii(e))&&i!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}if(1073741823!==di?r=10*(1073741821-di)-st():1073741823===fi?r=0:(r=10*(1073741821-fi)-5e3,0>(r=(i=st())-r)&&(r=0),(n=10*(1073741821-n)-i)<(r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ti(r/1960))-r)&&(r=n)),10=(r=0|u.busyMinDurationMs)?r=0:(i=0|u.busyDelayMs,r=(o=st()-(10*(1073741821-o)-(0|u.timeoutMs||5e3)))<=i?0:i+r-o),10 component higher in the tree to provide a loading indicator or placeholder to display."+xe(i))}5!==si&&(si=2),o=Fr(o,i),l=r;do{switch(l.tag){case 3:u=o,l.effectTag|=4096,l.expirationTime=t,Ut(l,Qr(l,u,t));break e;case 1:u=o;var g=l.type,_=l.stateNode;if(0==(64&l.effectTag)&&("function"==typeof g.getDerivedStateFromError||null!==_&&"function"==typeof _.componentDidCatch&&(null===bi||!bi.has(_)))){l.effectTag|=4096,l.expirationTime=t,Ut(l,Zr(l,u,t));break e}}l=l.return}while(null!==l)}ai=$i(ai)}catch(e){t=e;continue}break}}function Ui(){var e=ni.current;return ni.current=Zn,null===e?Zn:e}function ji(e,t){ehi&&(hi=e)}function Wi(){for(;null!==ai;)ai=Vi(ai)}function Hi(){for(;null!==ai&&!Ye();)ai=Vi(ai)}function Vi(e){var t=ei(e.alternate,e,li);return e.memoizedProps=e.pendingProps,null===t&&(t=$i(e)),ri.current=null,t}function $i(e){ai=e;do{var t=ai.alternate;if(e=ai.return,0==(2048&ai.effectTag)){e:{var n=t,r=li,i=(t=ai).pendingProps;switch(t.tag){case 2:case 16:break;case 15:case 0:break;case 1:Be(t.type)&&Ue();break;case 3:dn(),je(),(i=t.stateNode).pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(null===n||null===n.child)&&sr(t)&&Ir(t),Dr(t);break;case 5:hn(t);var o=cn(sn.current);if(r=t.type,null!==n&&null!=t.stateNode)Cr(n,t,r,i,o),n.ref!==t.ref&&(t.effectTag|=128);else if(i){if(n=cn(an.current),sr(t)){if(i=t,!Y)throw Error(a(175));n=Ee(i.stateNode,i.type,i.memoizedProps,o,n,i),i.updateQueue=n,(n=null!==n)&&Ir(t)}else{var u=P(r,i,o,n,t);Er(u,t,!1,!1),t.stateNode=u,L(u,r,i,o,n)&&Ir(t)}null!==t.ref&&(t.effectTag|=128)}else if(null===t.stateNode)throw Error(a(166));break;case 6:if(n&&null!=t.stateNode)kr(n,t,n.memoizedProps,i);else{if("string"!=typeof i&&null===t.stateNode)throw Error(a(166));if(n=cn(sn.current),o=cn(an.current),sr(t)){if(n=t,!Y)throw Error(a(176));(n=De(n.stateNode,n.memoizedProps,n))&&Ir(t)}else t.stateNode=z(i,n,o,t)}break;case 11:break;case 13:if(Me(vn),i=t.memoizedState,0!=(64&t.effectTag)){t.expirationTime=r;break e}i=null!==i,o=!1,null===n?void 0!==t.memoizedProps.fallback&&sr(t):(o=null!==(r=n.memoizedState),i||null===r||null!==(r=n.child.sibling)&&(null!==(u=t.firstEffect)?(t.firstEffect=r,r.nextEffect=u):(t.firstEffect=t.lastEffect=r,r.nextEffect=null),r.effectTag=8)),i&&!o&&0!=(2&t.mode)&&(null===n&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&vn.current)?0===si&&(si=3):(0!==si&&3!==si||(si=4),0!==hi&&null!==ui&&(vo(ui,li),mo(ui,hi)))),q&&i&&(t.effectTag|=4),G&&(i||o)&&(t.effectTag|=4);break;case 7:case 8:case 12:break;case 4:dn(),Dr(t);break;case 10:At(t);break;case 9:case 14:break;case 17:Be(t.type)&&Ue();break;case 19:if(Me(vn),null===(i=t.memoizedState))break;if(o=0!=(64&t.effectTag),null===(u=i.rendering)){if(o)Nr(i,!1);else if(0!==si||null!==n&&0!=(64&n.effectTag))for(n=t.child;null!==n;){if(null!==(u=mn(n))){for(t.effectTag|=64,Nr(i,!1),null!==(n=u.updateQueue)&&(t.updateQueue=n,t.effectTag|=4),null===i.lastEffect&&(t.firstEffect=null),t.lastEffect=i.lastEffect,n=r,i=t.child;null!==i;)r=n,(o=i).effectTag&=2,o.nextEffect=null,o.firstEffect=null,o.lastEffect=null,null===(u=o.alternate)?(o.childExpirationTime=0,o.expirationTime=r,o.child=null,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null):(o.childExpirationTime=u.childExpirationTime,o.expirationTime=u.expirationTime,o.child=u.child,o.memoizedProps=u.memoizedProps,o.memoizedState=u.memoizedState,o.updateQueue=u.updateQueue,r=u.dependencies,o.dependencies=null===r?null:{expirationTime:r.expirationTime,firstContext:r.firstContext,responders:r.responders}),i=i.sibling;Ie(vn,1&vn.current|2),t=t.child;break e}n=n.sibling}}else{if(!o)if(null!==(n=mn(u))){if(t.effectTag|=64,o=!0,null!==(n=n.updateQueue)&&(t.updateQueue=n,t.effectTag|=4),Nr(i,!0),null===i.tail&&"hidden"===i.tailMode&&!u.alternate){null!==(t=t.lastEffect=i.lastEffect)&&(t.nextEffect=null);break}}else st()>i.tailExpiration&&1i&&(i=r),(u=o.childExpirationTime)>i&&(i=u),o=o.sibling;n.childExpirationTime=i}if(null!==t)return t;null!==e&&0==(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=ai.firstEffect),null!==ai.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=ai.firstEffect),e.lastEffect=ai.lastEffect),1(e=e.childExpirationTime)?t:e}function qi(e){var t=ct();return dt(99,Yi.bind(null,e,t)),null}function Yi(e,t){do{Ki()}while(null!==Ei);if(0!=(48&oi))throw Error(a(327));var n=e.finishedWork,r=e.finishedExpirationTime;if(null===n)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,n===e.current)throw Error(a(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var i=Gi(n);if(e.firstPendingTime=i,r<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:r<=e.firstSuspendedTime&&(e.firstSuspendedTime=r-1),r<=e.lastPingedTime&&(e.lastPingedTime=0),r<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===ui&&(ai=ui=null,li=0),1=n?Tr(e,t,n):(Ie(vn,1&vn.current),null!==(t=Mr(e,t,n))?t.sibling:null);Ie(vn,1&vn.current);break;case 19:if(r=t.childExpirationTime>=n,0!=(64&e.effectTag)){if(r)return Or(e,t,n);t.effectTag|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null),Ie(vn,vn.current),!r)return null}return Mr(e,t,n)}dr=!1}}else dr=!1;switch(t.expirationTime=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,i=Le(t,Ne.current),Mt(t,n),i=Pn(null,t,r,e,i,n),t.effectTag|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,Fn(),Be(r)){var o=!0;He(t)}else o=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null;var u=r.getDerivedStateFromProps;"function"==typeof u&&qt(t,r,u,e),i.updater=Yt,t.stateNode=i,i._reactInternalFiber=t,Qt(t,r,e,n),t=br(null,t,r,!0,o,n)}else t.tag=0,pr(null,t,i,n),t=t.child;return t;case 16:if(i=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,function(e){if(-1===e._status){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}}(i),1!==i._status)throw i._result;switch(i=i._result,t.type=i,o=t.tag=function(e){if("function"==typeof e)return uo(e)?1:0;if(null!=e){if((e=e.$$typeof)===_)return 11;if(e===w)return 14}return 2}(i),e=Et(i,e),o){case 0:t=_r(null,t,i,e,n);break;case 1:t=yr(null,t,i,e,n);break;case 11:t=hr(null,t,i,e,n);break;case 14:t=vr(null,t,i,Et(i.type,e),r,n);break;default:throw Error(a(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,_r(e,t,r,i=t.elementType===r?i:Et(r,i),n);case 1:return r=t.type,i=t.pendingProps,yr(e,t,r,i=t.elementType===r?i:Et(r,i),n);case 3:if(wr(t),null===(r=t.updateQueue))throw Error(a(282));if(i=null!==(i=t.memoizedState)?i.element:null,Wt(t,r,t.pendingProps,null,n),(r=t.memoizedState.element)===i)cr(),t=Mr(e,t,n);else{if((i=t.stateNode.hydrate)&&(Y?(rr=we(t.stateNode.containerInfo),nr=t,i=ir=!0):i=!1),i)for(n=on(t,null,r,n),t.child=n;n;)n.effectTag=-3&n.effectTag|1024,n=n.sibling;else pr(e,t,r,n),cr();t=t.child}return t;case 5:return pn(t),null===e&&ar(t),r=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,u=i.children,U(r,i)?u=null:null!==o&&U(r,o)&&(t.effectTag|=16),gr(e,t),4&t.mode&&1!==n&&j(r,i)?(t.expirationTime=t.childExpirationTime=1,t=null):(pr(e,t,u,n),t=t.child),t;case 6:return null===e&&ar(t),null;case 13:return Tr(e,t,n);case 4:return fn(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=rn(t,null,r,n):pr(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,hr(e,t,r,i=t.elementType===r?i:Et(r,i),n);case 7:return pr(e,t,t.pendingProps,n),t.child;case 8:case 12:return pr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,u=t.memoizedProps,xt(t,o=i.value),null!==u){var l=u.value;if(0===(o=yt(l,o)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(l,o):1073741823))){if(u.children===i.children&&!Pe.current){t=Mr(e,t,n);break e}}else for(null!==(l=t.child)&&(l.return=t);null!==l;){var s=l.dependencies;if(null!==s){u=l.child;for(var c=s.firstContext;null!==c;){if(c.context===r&&0!=(c.observedBits&o)){1===l.tag&&((c=Ft(n,null)).tag=2,Bt(l,c)),l.expirationTime=t&&e<=t}function vo(e,t){var n=e.firstSuspendedTime,r=e.lastSuspendedTime;nt||0===n)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function mo(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var n=e.firstSuspendedTime;0!==n&&(t>=n?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function go(e,t){var n=e.lastExpiredTime;(0===n||n>t)&&(e.lastExpiredTime=t)}function _o(e){var t=e._reactInternalFiber;if(void 0===t){if("function"==typeof e.render)throw Error(a(188));throw Error(a(268,Object.keys(e)))}return null===(e=A(t))?null:e.stateNode}function yo(e,t){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime{"use strict";e.exports=n(5767)},3296:(e,t,n)=>{"use strict";const r=n(5760);r.createWebSocketStream=n(6387),r.Server=n(43),r.Receiver=n(1762),r.Sender=n(9576),e.exports=r},8716:(e,t,n)=>{"use strict";const{EMPTY_BUFFER:r}=n(5739);function i(e,t){if(0===e.length)return r;if(1===e.length)return e[0];const n=Buffer.allocUnsafe(t);let i=0;for(let t=0;t{"use strict";e.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),EMPTY_BUFFER:Buffer.alloc(0),NOOP:()=>{}}},7002:e=>{"use strict";class t{constructor(e,t){this.target=t,this.type=e}}class n extends t{constructor(e,t){super("message",t),this.data=e}}class r extends t{constructor(e,t,n){super("close",n),this.wasClean=n._closeFrameReceived&&n._closeFrameSent,this.reason=t,this.code=e}}class i extends t{constructor(e){super("open",e)}}class o extends t{constructor(e,t){super("error",t),this.message=e.message,this.error=e}}const u={addEventListener(e,t,u){if("function"!=typeof t)return;function a(e){t.call(this,new n(e,this))}function l(e,n){t.call(this,new r(e,n,this))}function s(e){t.call(this,new o(e,this))}function c(){t.call(this,new i(this))}const f=u&&u.once?"once":"on";"message"===e?(a._listener=t,this[f](e,a)):"close"===e?(l._listener=t,this[f](e,l)):"error"===e?(s._listener=t,this[f](e,s)):"open"===e?(c._listener=t,this[f](e,c)):this[f](e,t)},removeEventListener(e,t){const n=this.listeners(e);for(let r=0;r{"use strict";const t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function n(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}e.exports={format:function(e){return Object.keys(e).map(t=>{let n=e[t];return Array.isArray(n)||(n=[n]),n.map(e=>[t].concat(Object.keys(e).map(t=>{let n=e[t];return Array.isArray(n)||(n=[n]),n.map(e=>!0===e?t:`${t}=${e}`).join("; ")})).join("; ")).join(", ")}).join(", ")},parse:function(e){const r=Object.create(null);if(void 0===e||""===e)return r;let i,o,u=Object.create(null),a=!1,l=!1,s=!1,c=-1,f=-1,d=0;for(;d{"use strict";const t=Symbol("kDone"),n=Symbol("kRun");e.exports=class{constructor(e){this[t]=()=>{this.pending--,this[n]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[n]()}[n](){if(this.pending!==this.concurrency&&this.jobs.length){const e=this.jobs.shift();this.pending++,e(this[t])}}}},2309:(e,t,n)=>{"use strict";const r=n(8761),i=n(8716),o=n(1390),{kStatusCode:u,NOOP:a}=n(5739),l=Buffer.from([0,0,255,255]),s=Symbol("permessage-deflate"),c=Symbol("total-length"),f=Symbol("callback"),d=Symbol("buffers"),p=Symbol("error");let h;function v(e){this[d].push(e),this[c]+=e.length}function m(e){this[c]+=e.length,this[s]._maxPayload<1||this[c]<=this[s]._maxPayload?this[d].push(e):(this[p]=new RangeError("Max payload size exceeded"),this[p][u]=1009,this.removeListener("data",m),this.reset())}function g(e){this[s]._inflate=null,e[u]=1007,this[f](e)}e.exports=class{constructor(e,t,n){if(this._maxPayload=0|n,this._options=e||{},this._threshold=void 0!==this._options.threshold?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!h){const e=void 0!==this._options.concurrencyLimit?this._options.concurrencyLimit:10;h=new o(e)}}static get extensionName(){return"permessage-deflate"}offer(){const e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:null==this._options.clientMaxWindowBits&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){const e=this._deflate[f];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){const t=this._options,n=e.find(e=>!(!1===t.serverNoContextTakeover&&e.server_no_context_takeover||e.server_max_window_bits&&(!1===t.serverMaxWindowBits||"number"==typeof t.serverMaxWindowBits&&t.serverMaxWindowBits>e.server_max_window_bits)||"number"==typeof t.clientMaxWindowBits&&!e.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(n.server_no_context_takeover=!0),t.clientNoContextTakeover&&(n.client_no_context_takeover=!0),"number"==typeof t.serverMaxWindowBits&&(n.server_max_window_bits=t.serverMaxWindowBits),"number"==typeof t.clientMaxWindowBits?n.client_max_window_bits=t.clientMaxWindowBits:!0!==n.client_max_window_bits&&!1!==t.clientMaxWindowBits||delete n.client_max_window_bits,n}acceptAsClient(e){const t=e[0];if(!1===this._options.clientNoContextTakeover&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(t.client_max_window_bits){if(!1===this._options.clientMaxWindowBits||"number"==typeof this._options.clientMaxWindowBits&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"')}else"number"==typeof this._options.clientMaxWindowBits&&(t.client_max_window_bits=this._options.clientMaxWindowBits);return t}normalizeParams(e){return e.forEach(e=>{Object.keys(e).forEach(t=>{let n=e[t];if(n.length>1)throw new Error(`Parameter "${t}" must have only a single value`);if(n=n[0],"client_max_window_bits"===t){if(!0!==n){const e=+n;if(!Number.isInteger(e)||e<8||e>15)throw new TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${t}": ${n}`)}else if("server_max_window_bits"===t){const e=+n;if(!Number.isInteger(e)||e<8||e>15)throw new TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else{if("client_no_context_takeover"!==t&&"server_no_context_takeover"!==t)throw new Error(`Unknown parameter "${t}"`);if(!0!==n)throw new TypeError(`Invalid value for parameter "${t}": ${n}`)}e[t]=n})}),e}decompress(e,t,n){h.add(r=>{this._decompress(e,t,(e,t)=>{r(),n(e,t)})})}compress(e,t,n){h.add(r=>{this._compress(e,t,(e,t)=>{r(),n(e,t)})})}_decompress(e,t,n){const o=this._isServer?"client":"server";if(!this._inflate){const e=o+"_max_window_bits",t="number"!=typeof this.params[e]?r.Z_DEFAULT_WINDOWBITS:this.params[e];this._inflate=r.createInflateRaw({...this._options.zlibInflateOptions,windowBits:t}),this._inflate[s]=this,this._inflate[c]=0,this._inflate[d]=[],this._inflate.on("error",g),this._inflate.on("data",m)}this._inflate[f]=n,this._inflate.write(e),t&&this._inflate.write(l),this._inflate.flush(()=>{const e=this._inflate[p];if(e)return this._inflate.close(),this._inflate=null,void n(e);const r=i.concat(this._inflate[d],this._inflate[c]);t&&this.params[o+"_no_context_takeover"]?(this._inflate.close(),this._inflate=null):(this._inflate[c]=0,this._inflate[d]=[]),n(null,r)})}_compress(e,t,n){const o=this._isServer?"server":"client";if(!this._deflate){const e=o+"_max_window_bits",t="number"!=typeof this.params[e]?r.Z_DEFAULT_WINDOWBITS:this.params[e];this._deflate=r.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:t}),this._deflate[c]=0,this._deflate[d]=[],this._deflate.on("error",a),this._deflate.on("data",v)}this._deflate[f]=n,this._deflate.write(e),this._deflate.flush(r.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let e=i.concat(this._deflate[d],this._deflate[c]);t&&(e=e.slice(0,e.length-4)),this._deflate[f]=null,t&&this.params[o+"_no_context_takeover"]?(this._deflate.close(),this._deflate=null):(this._deflate[c]=0,this._deflate[d]=[]),n(null,e)})}}},1762:(e,t,n)=>{"use strict";const{Writable:r}=n(2413),i=n(2309),{BINARY_TYPES:o,EMPTY_BUFFER:u,kStatusCode:a,kWebSocket:l}=n(5739),{concat:s,toArrayBuffer:c,unmask:f}=n(8716),{isValidStatusCode:d,isValidUTF8:p}=n(9498);function h(e,t,n,r){const i=new e(n?"Invalid WebSocket frame: "+t:t);return Error.captureStackTrace(i,h),i[a]=r,i}e.exports=class extends r{constructor(e,t,n,r){super(),this._binaryType=e||o[0],this[l]=void 0,this._extensions=t||{},this._isServer=!!n,this._maxPayload=0|r,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._state=0,this._loop=!1}_write(e,t,n){if(8===this._opcode&&0==this._state)return n();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e=n.length?t.set(this._buffers.shift(),r):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),r),this._buffers[0]=n.slice(e)),e-=n.length}while(e>0);return t}startLoop(e){let t;this._loop=!0;do{switch(this._state){case 0:t=this.getInfo();break;case 1:t=this.getPayloadLength16();break;case 2:t=this.getPayloadLength64();break;case 3:this.getMask();break;case 4:t=this.getData(e);break;default:return void(this._loop=!1)}}while(this._loop);e(t)}getInfo(){if(this._bufferedBytes<2)return void(this._loop=!1);const e=this.consume(2);if(0!=(48&e[0]))return this._loop=!1,h(RangeError,"RSV2 and RSV3 must be clear",!0,1002);const t=64==(64&e[0]);if(t&&!this._extensions[i.extensionName])return this._loop=!1,h(RangeError,"RSV1 must be clear",!0,1002);if(this._fin=128==(128&e[0]),this._opcode=15&e[0],this._payloadLength=127&e[1],0===this._opcode){if(t)return this._loop=!1,h(RangeError,"RSV1 must be clear",!0,1002);if(!this._fragmented)return this._loop=!1,h(RangeError,"invalid opcode 0",!0,1002);this._opcode=this._fragmented}else if(1===this._opcode||2===this._opcode){if(this._fragmented)return this._loop=!1,h(RangeError,"invalid opcode "+this._opcode,!0,1002);this._compressed=t}else{if(!(this._opcode>7&&this._opcode<11))return this._loop=!1,h(RangeError,"invalid opcode "+this._opcode,!0,1002);if(!this._fin)return this._loop=!1,h(RangeError,"FIN must be set",!0,1002);if(t)return this._loop=!1,h(RangeError,"RSV1 must be clear",!0,1002);if(this._payloadLength>125)return this._loop=!1,h(RangeError,"invalid payload length "+this._payloadLength,!0,1002)}if(this._fin||this._fragmented||(this._fragmented=this._opcode),this._masked=128==(128&e[1]),this._isServer){if(!this._masked)return this._loop=!1,h(RangeError,"MASK must be set",!0,1002)}else if(this._masked)return this._loop=!1,h(RangeError,"MASK must be clear",!0,1002);if(126===this._payloadLength)this._state=1;else{if(127!==this._payloadLength)return this.haveLength();this._state=2}}getPayloadLength16(){if(!(this._bufferedBytes<2))return this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength();this._loop=!1}getPayloadLength64(){if(this._bufferedBytes<8)return void(this._loop=!1);const e=this.consume(8),t=e.readUInt32BE(0);return t>Math.pow(2,21)-1?(this._loop=!1,h(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009)):(this._payloadLength=t*Math.pow(2,32)+e.readUInt32BE(4),this.haveLength())}haveLength(){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0))return this._loop=!1,h(RangeError,"Max payload size exceeded",!1,1009);this._masked?this._state=3:this._state=4}getMask(){this._bufferedBytes<4?this._loop=!1:(this._mask=this.consume(4),this._state=4)}getData(e){let t=u;if(this._payloadLength){if(this._bufferedBytes7?this.controlMessage(t):this._compressed?(this._state=5,void this.decompress(t,e)):(t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage())}decompress(e,t){this._extensions[i.extensionName].decompress(e,this._fin,(e,n)=>{if(e)return t(e);if(n.length){if(this._messageLength+=n.length,this._messageLength>this._maxPayload&&this._maxPayload>0)return t(h(RangeError,"Max payload size exceeded",!1,1009));this._fragments.push(n)}const r=this.dataMessage();if(r)return t(r);this.startLoop(t)})}dataMessage(){if(this._fin){const e=this._messageLength,t=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],2===this._opcode){let n;n="nodebuffer"===this._binaryType?s(t,e):"arraybuffer"===this._binaryType?c(s(t,e)):t,this.emit("message",n)}else{const n=s(t,e);if(!p(n))return this._loop=!1,h(Error,"invalid UTF-8 sequence",!0,1007);this.emit("message",n.toString())}}this._state=0}controlMessage(e){if(8===this._opcode)if(this._loop=!1,0===e.length)this.emit("conclude",1005,""),this.end();else{if(1===e.length)return h(RangeError,"invalid payload length 1",!0,1002);{const t=e.readUInt16BE(0);if(!d(t))return h(RangeError,"invalid status code "+t,!0,1002);const n=e.slice(2);if(!p(n))return h(Error,"invalid UTF-8 sequence",!0,1007);this.emit("conclude",t,n.toString()),this.end()}}else 9===this._opcode?this.emit("ping",e):this.emit("pong",e);this._state=0}}},9576:(e,t,n)=>{"use strict";const{randomFillSync:r}=n(6417),i=n(2309),{EMPTY_BUFFER:o}=n(5739),{isValidStatusCode:u}=n(9498),{mask:a,toBuffer:l}=n(8716),s=Buffer.alloc(4);class c{constructor(e,t){this._extensions=t||{},this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(e,t){const n=t.mask&&t.readOnly;let i=t.mask?6:2,o=e.length;e.length>=65536?(i+=8,o=127):e.length>125&&(i+=2,o=126);const u=Buffer.allocUnsafe(n?e.length+i:i);return u[0]=t.fin?128|t.opcode:t.opcode,t.rsv1&&(u[0]|=64),u[1]=o,126===o?u.writeUInt16BE(e.length,2):127===o&&(u.writeUInt32BE(0,2),u.writeUInt32BE(e.length,6)),t.mask?(r(s,0,4),u[1]|=128,u[i-4]=s[0],u[i-3]=s[1],u[i-2]=s[2],u[i-1]=s[3],n?(a(e,s,u,i,e.length),[u]):(a(e,s,e,0,e.length),[u,e])):[u,e]}close(e,t,n,r){let i;if(void 0===e)i=o;else{if("number"!=typeof e||!u(e))throw new TypeError("First argument must be a valid error code number");if(void 0===t||""===t)i=Buffer.allocUnsafe(2),i.writeUInt16BE(e,0);else{const n=Buffer.byteLength(t);if(n>123)throw new RangeError("The message must not be greater than 123 bytes");i=Buffer.allocUnsafe(2+n),i.writeUInt16BE(e,0),i.write(t,2)}}this._deflating?this.enqueue([this.doClose,i,n,r]):this.doClose(i,n,r)}doClose(e,t,n){this.sendFrame(c.frame(e,{fin:!0,rsv1:!1,opcode:8,mask:t,readOnly:!1}),n)}ping(e,t,n){const r=l(e);if(r.length>125)throw new RangeError("The data size must not be greater than 125 bytes");this._deflating?this.enqueue([this.doPing,r,t,l.readOnly,n]):this.doPing(r,t,l.readOnly,n)}doPing(e,t,n,r){this.sendFrame(c.frame(e,{fin:!0,rsv1:!1,opcode:9,mask:t,readOnly:n}),r)}pong(e,t,n){const r=l(e);if(r.length>125)throw new RangeError("The data size must not be greater than 125 bytes");this._deflating?this.enqueue([this.doPong,r,t,l.readOnly,n]):this.doPong(r,t,l.readOnly,n)}doPong(e,t,n,r){this.sendFrame(c.frame(e,{fin:!0,rsv1:!1,opcode:10,mask:t,readOnly:n}),r)}send(e,t,n){const r=l(e),o=this._extensions[i.extensionName];let u=t.binary?2:1,a=t.compress;if(this._firstFragment?(this._firstFragment=!1,a&&o&&(a=r.length>=o._threshold),this._compress=a):(a=!1,u=0),t.fin&&(this._firstFragment=!0),o){const e={fin:t.fin,rsv1:a,opcode:u,mask:t.mask,readOnly:l.readOnly};this._deflating?this.enqueue([this.dispatch,r,this._compress,e,n]):this.dispatch(r,this._compress,e,n)}else this.sendFrame(c.frame(r,{fin:t.fin,rsv1:!1,opcode:u,mask:t.mask,readOnly:l.readOnly}),n)}dispatch(e,t,n,r){if(!t)return void this.sendFrame(c.frame(e,n),r);const o=this._extensions[i.extensionName];this._bufferedBytes+=e.length,this._deflating=!0,o.compress(e,n.fin,(t,i)=>{if(this._socket.destroyed){const e=new Error("The socket was closed while data was being compressed");"function"==typeof r&&r(e);for(let t=0;t{"use strict";const{Duplex:r}=n(2413);function i(e){e.emit("close")}function o(){!this.destroyed&&this._writableState.finished&&this.destroy()}function u(e){this.removeListener("error",u),this.destroy(),0===this.listenerCount("error")&&this.emit("error",e)}e.exports=function(e,t){let n=!0;function a(){n&&e._socket.resume()}e.readyState===e.CONNECTING?e.once("open",(function(){e._receiver.removeAllListeners("drain"),e._receiver.on("drain",a)})):(e._receiver.removeAllListeners("drain"),e._receiver.on("drain",a));const l=new r({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",(function(t){l.push(t)||(n=!1,e._socket.pause())})),e.once("error",(function(e){l.destroyed||l.destroy(e)})),e.once("close",(function(){l.destroyed||l.push(null)})),l._destroy=function(t,n){if(e.readyState===e.CLOSED)return n(t),void process.nextTick(i,l);let r=!1;e.once("error",(function(e){r=!0,n(e)})),e.once("close",(function(){r||n(t),process.nextTick(i,l)})),e.terminate()},l._final=function(t){e.readyState!==e.CONNECTING?null!==e._socket&&(e._socket._writableState.finished?(t(),l._readableState.endEmitted&&l.destroy()):(e._socket.once("finish",(function(){t()})),e.close())):e.once("open",(function(){l._final(t)}))},l._read=function(){e.readyState!==e.OPEN||n||(n=!0,e._receiver._writableState.needDrain||e._socket.resume())},l._write=function(t,n,r){e.readyState!==e.CONNECTING?e.send(t,r):e.once("open",(function(){l._write(t,n,r)}))},l.on("end",o),l.on("error",u),l}},9498:(e,t,n)=>{"use strict";try{const e=n(Object(function(){var e=new Error("Cannot find module 'utf-8-validate'");throw e.code="MODULE_NOT_FOUND",e}()));t.isValidUTF8="object"==typeof e?e.Validation.isValidUTF8:e}catch(e){t.isValidUTF8=()=>!0}t.isValidStatusCode=e=>e>=1e3&&e<=1014&&1004!==e&&1005!==e&&1006!==e||e>=3e3&&e<=4999},43:(e,t,n)=>{"use strict";const r=n(8614),{createHash:i}=n(6417),{createServer:o,STATUS_CODES:u}=n(8605),a=n(2309),l=n(5760),{format:s,parse:c}=n(8162),{GUID:f,kWebSocket:d}=n(5739),p=/^[+/0-9A-Za-z]{22}==$/;function h(e){e.emit("close")}function v(){this.destroy()}function m(e,t,n,r){e.writable&&(n=n||u[t],r={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(n),...r},e.write(`HTTP/1.1 ${t} ${u[t]}\r\n`+Object.keys(r).map(e=>`${e}: ${r[e]}`).join("\r\n")+"\r\n\r\n"+n)),e.removeListener("error",v),e.destroy()}e.exports=class extends r{constructor(e,t){if(super(),null==(e={maxPayload:104857600,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,...e}).port&&!e.server&&!e.noServer)throw new TypeError('One of the "port", "server", or "noServer" options must be specified');null!=e.port?(this._server=o((e,t)=>{const n=u[426];t.writeHead(426,{"Content-Length":n.length,"Content-Type":"text/plain"}),t.end(n)}),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server&&(this._removeListeners=function(e,t){for(const n of Object.keys(t))e.on(n,t[n]);return function(){for(const n of Object.keys(t))e.removeListener(n,t[n])}}(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(e,t,n)=>{this.handleUpgrade(e,t,n,t=>{this.emit("connection",t,e)})}})),!0===e.perMessageDeflate&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set),this.options=e}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(e&&this.once("close",e),this.clients)for(const e of this.clients)e.terminate();const t=this._server;t&&(this._removeListeners(),this._removeListeners=this._server=null,null!=this.options.port)?t.close(()=>this.emit("close")):process.nextTick(h,this)}shouldHandle(e){if(this.options.path){const t=e.url.indexOf("?");if((-1!==t?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,n,r){t.on("error",v);const i=void 0!==e.headers["sec-websocket-key"]&&e.headers["sec-websocket-key"].trim(),o=+e.headers["sec-websocket-version"],u={};if("GET"!==e.method||"websocket"!==e.headers.upgrade.toLowerCase()||!i||!p.test(i)||8!==o&&13!==o||!this.shouldHandle(e))return m(t,400);if(this.options.perMessageDeflate){const n=new a(this.options.perMessageDeflate,!0,this.options.maxPayload);try{const t=c(e.headers["sec-websocket-extensions"]);t[a.extensionName]&&(n.accept(t[a.extensionName]),u[a.extensionName]=n)}catch(e){return m(t,400)}}if(this.options.verifyClient){const a={origin:e.headers[""+(8===o?"sec-websocket-origin":"origin")],secure:!(!e.connection.authorized&&!e.connection.encrypted),req:e};if(2===this.options.verifyClient.length)return void this.options.verifyClient(a,(o,a,l,s)=>{if(!o)return m(t,a||401,l,s);this.completeUpgrade(i,u,e,t,n,r)});if(!this.options.verifyClient(a))return m(t,401)}this.completeUpgrade(i,u,e,t,n,r)}completeUpgrade(e,t,n,r,o,u){if(!r.readable||!r.writable)return r.destroy();if(r[d])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");const c=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade","Sec-WebSocket-Accept: "+i("sha1").update(e+f).digest("base64")],p=new l(null);let h=n.headers["sec-websocket-protocol"];if(h&&(h=h.trim().split(/ *, */),h=this.options.handleProtocols?this.options.handleProtocols(h,n):h[0],h&&(c.push("Sec-WebSocket-Protocol: "+h),p.protocol=h)),t[a.extensionName]){const e=t[a.extensionName].params,n=s({[a.extensionName]:[e]});c.push("Sec-WebSocket-Extensions: "+n),p._extensions=t}this.emit("headers",c,n),r.write(c.concat("\r\n").join("\r\n")),r.removeListener("error",v),p.setSocket(r,o,this.options.maxPayload),this.clients&&(this.clients.add(p),p.on("close",()=>this.clients.delete(p))),u(p)}}},5760:(e,t,n)=>{"use strict";const r=n(8614),i=n(7211),o=n(8605),u=n(1631),a=n(4016),{randomBytes:l,createHash:s}=n(6417),{URL:c}=n(8835),f=n(2309),d=n(1762),p=n(9576),{BINARY_TYPES:h,EMPTY_BUFFER:v,GUID:m,kStatusCode:g,kWebSocket:_,NOOP:y}=n(5739),{addEventListener:b,removeEventListener:w}=n(7002),{format:E,parse:D}=n(8162),{toBuffer:C}=n(8716),k=["CONNECTING","OPEN","CLOSING","CLOSED"],S=[8,13];class T extends r{constructor(e,t,n){super(),this.readyState=T.CONNECTING,this.protocol="",this._binaryType=h[0],this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage="",this._closeTimer=null,this._closeCode=1006,this._extensions={},this._receiver=null,this._sender=null,this._socket=null,null!==e?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,Array.isArray(t)?t=t.join(", "):"object"==typeof t&&null!==t&&(n=t,t=void 0),function e(t,n,r,u){const a={protocolVersion:S[1],maxPayload:104857600,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...u,createConnection:void 0,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:void 0,host:void 0,path:void 0,port:void 0};if(!S.includes(a.protocolVersion))throw new RangeError(`Unsupported protocol version: ${a.protocolVersion} (supported versions: ${S.join(", ")})`);let d;n instanceof c?(d=n,t.url=n.href):(d=new c(n),t.url=n);const p="ws+unix:"===d.protocol;if(!(d.host||p&&d.pathname))throw new Error("Invalid URL: "+t.url);const h="wss:"===d.protocol||"https:"===d.protocol,v=h?443:80,g=l(16).toString("base64"),_=h?i.get:o.get;let y;a.createConnection=h?A:x,a.defaultPort=a.defaultPort||v,a.port=d.port||v,a.host=d.hostname.startsWith("[")?d.hostname.slice(1,-1):d.hostname,a.headers={"Sec-WebSocket-Version":a.protocolVersion,"Sec-WebSocket-Key":g,Connection:"Upgrade",Upgrade:"websocket",...a.headers},a.path=d.pathname+d.search,a.timeout=a.handshakeTimeout,a.perMessageDeflate&&(y=new f(!0!==a.perMessageDeflate?a.perMessageDeflate:{},!1,a.maxPayload),a.headers["Sec-WebSocket-Extensions"]=E({[f.extensionName]:y.offer()}));r&&(a.headers["Sec-WebSocket-Protocol"]=r);a.origin&&(a.protocolVersion<13?a.headers["Sec-WebSocket-Origin"]=a.origin:a.headers.Origin=a.origin);(d.username||d.password)&&(a.auth=`${d.username}:${d.password}`);if(p){const e=a.path.split(":");a.socketPath=e[0],a.path=e[1]}let b=t._req=_(a);a.timeout&&b.on("timeout",()=>{O(t,b,"Opening handshake has timed out")});b.on("error",e=>{t._req.aborted||(b=t._req=null,t.readyState=T.CLOSING,t.emit("error",e),t.emitClose())}),b.on("response",i=>{const o=i.headers.location,l=i.statusCode;if(o&&a.followRedirects&&l>=300&&l<400){if(++t._redirects>a.maxRedirects)return void O(t,b,"Maximum redirects exceeded");b.abort();const i=new c(o,n);e(t,i,r,u)}else t.emit("unexpected-response",b,i)||O(t,b,"Unexpected server response: "+i.statusCode)}),b.on("upgrade",(e,n,i)=>{if(t.emit("upgrade",e),t.readyState!==T.CONNECTING)return;b=t._req=null;const o=s("sha1").update(g+m).digest("base64");if(e.headers["sec-websocket-accept"]!==o)return void O(t,n,"Invalid Sec-WebSocket-Accept header");const u=e.headers["sec-websocket-protocol"],l=(r||"").split(/, */);let c;if(!r&&u?c="Server sent a subprotocol but none was requested":r&&!u?c="Server sent no subprotocol":u&&!l.includes(u)&&(c="Server sent an invalid subprotocol"),c)O(t,n,c);else{if(u&&(t.protocol=u),y)try{const n=D(e.headers["sec-websocket-extensions"]);n[f.extensionName]&&(y.accept(n[f.extensionName]),t._extensions[f.extensionName]=y)}catch(e){return void O(t,n,"Invalid Sec-WebSocket-Extensions header")}t.setSocket(n,i,a.maxPayload)}})}(this,e,t,n)):this._isServer=!0}get CONNECTING(){return T.CONNECTING}get CLOSING(){return T.CLOSING}get CLOSED(){return T.CLOSED}get OPEN(){return T.OPEN}get binaryType(){return this._binaryType}set binaryType(e){h.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}setSocket(e,t,n){const r=new d(this._binaryType,this._extensions,this._isServer,n);this._sender=new p(e,this._extensions),this._receiver=r,this._socket=e,r[_]=this,e[_]=this,r.on("conclude",I),r.on("drain",R),r.on("error",N),r.on("message",F),r.on("ping",L),r.on("pong",B),e.setTimeout(0),e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",U),e.on("data",j),e.on("end",z),e.on("error",W),this.readyState=T.OPEN,this.emit("open")}emitClose(){if(!this._socket)return this.readyState=T.CLOSED,void this.emit("close",this._closeCode,this._closeMessage);this._extensions[f.extensionName]&&this._extensions[f.extensionName].cleanup(),this._receiver.removeAllListeners(),this.readyState=T.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==T.CLOSED){if(this.readyState===T.CONNECTING){const e="WebSocket was closed before the connection was established";return O(this,this._req,e)}this.readyState!==T.CLOSING?(this.readyState=T.CLOSING,this._sender.close(e,t,!this._isServer,e=>{e||(this._closeFrameSent=!0,this._closeFrameReceived&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),3e4)):this._closeFrameSent&&this._closeFrameReceived&&this._socket.end()}}ping(e,t,n){if(this.readyState===T.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof e?(n=e,e=t=void 0):"function"==typeof t&&(n=t,t=void 0),"number"==typeof e&&(e=e.toString()),this.readyState===T.OPEN?(void 0===t&&(t=!this._isServer),this._sender.ping(e||v,t,n)):M(this,e,n)}pong(e,t,n){if(this.readyState===T.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof e?(n=e,e=t=void 0):"function"==typeof t&&(n=t,t=void 0),"number"==typeof e&&(e=e.toString()),this.readyState===T.OPEN?(void 0===t&&(t=!this._isServer),this._sender.pong(e||v,t,n)):M(this,e,n)}send(e,t,n){if(this.readyState===T.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if("function"==typeof t&&(n=t,t={}),"number"==typeof e&&(e=e.toString()),this.readyState!==T.OPEN)return void M(this,e,n);const r={binary:"string"!=typeof e,mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[f.extensionName]||(r.compress=!1),this._sender.send(e||v,r,n)}terminate(){if(this.readyState!==T.CLOSED){if(this.readyState===T.CONNECTING){const e="WebSocket was closed before the connection was established";return O(this,this._req,e)}this._socket&&(this.readyState=T.CLOSING,this._socket.destroy())}}}function x(e){return e.path=e.socketPath,u.connect(e)}function A(e){return e.path=void 0,e.servername||""===e.servername||(e.servername=e.host),a.connect(e)}function O(e,t,n){e.readyState=T.CLOSING;const r=new Error(n);Error.captureStackTrace(r,O),t.setHeader?(t.abort(),t.once("abort",e.emitClose.bind(e)),e.emit("error",r)):(t.destroy(r),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function M(e,t,n){if(t){const n=C(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(n){n(new Error(`WebSocket is not open: readyState ${e.readyState} (${k[e.readyState]})`))}}function I(e,t){const n=this[_];n._socket.removeListener("data",j),n._socket.resume(),n._closeFrameReceived=!0,n._closeMessage=t,n._closeCode=e,1005===e?n.close():n.close(e,t)}function R(){this[_]._socket.resume()}function N(e){const t=this[_];t._socket.removeListener("data",j),t.readyState=T.CLOSING,t._closeCode=e[g],t.emit("error",e),t._socket.destroy()}function P(){this[_].emitClose()}function F(e){this[_].emit("message",e)}function L(e){const t=this[_];t.pong(e,!t._isServer,y),t.emit("ping",e)}function B(e){this[_].emit("pong",e)}function U(){const e=this[_];this.removeListener("close",U),this.removeListener("end",z),e.readyState=T.CLOSING,e._socket.read(),e._receiver.end(),this.removeListener("data",j),this[_]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",P),e._receiver.on("finish",P))}function j(e){this[_]._receiver.write(e)||this.pause()}function z(){const e=this[_];e.readyState=T.CLOSING,e._receiver.end(),this.end()}function W(){const e=this[_];this.removeListener("error",W),this.on("error",y),e&&(e.readyState=T.CLOSING,this.destroy())}k.forEach((e,t)=>{T[e]=t}),["open","error","close","message"].forEach(e=>{Object.defineProperty(T.prototype,"on"+e,{get(){const t=this.listeners(e);for(let e=0;e{"use strict";const t=e.exports;e.exports.default=t;const n="[",r="]",i="",o=";",u="Apple_Terminal"===process.env.TERM_PROGRAM;t.cursorTo=(e,t)=>{if("number"!=typeof e)throw new TypeError("The `x` argument is required");return"number"!=typeof t?n+(e+1)+"G":n+(t+1)+";"+(e+1)+"H"},t.cursorMove=(e,t)=>{if("number"!=typeof e)throw new TypeError("The `x` argument is required");let r="";return e<0?r+=n+-e+"D":e>0&&(r+=n+e+"C"),t<0?r+=n+-t+"A":t>0&&(r+=n+t+"B"),r},t.cursorUp=(e=1)=>n+e+"A",t.cursorDown=(e=1)=>n+e+"B",t.cursorForward=(e=1)=>n+e+"C",t.cursorBackward=(e=1)=>n+e+"D",t.cursorLeft="",t.cursorSavePosition=u?"7":"",t.cursorRestorePosition=u?"8":"",t.cursorGetPosition="",t.cursorNextLine="",t.cursorPrevLine="",t.cursorHide="[?25l",t.cursorShow="[?25h",t.eraseLines=e=>{let n="";for(let r=0;r[r,"8",o,o,t,i,e,r,"8",o,o,i].join(""),t.image=(e,t={})=>{let n=r+"1337;File=inline=1";return t.width&&(n+=";width="+t.width),t.height&&(n+=";height="+t.height),!1===t.preserveAspectRatio&&(n+=";preserveAspectRatio=0"),n+":"+e.toString("base64")+i},t.iTerm={setCwd:(e=process.cwd())=>`${r}50;CurrentDir=${e}${i}`,annotation:(e,t={})=>{let n=r+"1337;";const o=void 0!==t.x,u=void 0!==t.y;if((o||u)&&(!o||!u||void 0===t.length))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replace(/\|/g,""),n+=t.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",t.length>0?n+=(o?[e,t.length,t.x,t.y]:[t.length,e]).join("|"):n+=e,n+i}}},5378:e=>{"use strict";e.exports=e=>{e=Object.assign({onlyFirst:!1},e);const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e.onlyFirst?void 0:"g")}},1337:e=>{"use strict";e.exports=({onlyFirst:e=!1}={})=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}},8483:(e,t,n)=>{"use strict";e=n.nmd(e);const r=(e,t)=>(...n)=>`[${e(...n)+t}m`,i=(e,t)=>(...n)=>{const r=e(...n);return`[${38+t};5;${r}m`},o=(e,t)=>(...n)=>{const r=e(...n);return`[${38+t};2;${r[0]};${r[1]};${r[2]}m`},u=e=>e,a=(e,t,n)=>[e,t,n],l=(e,t,n)=>{Object.defineProperty(e,t,{get:()=>{const r=n();return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0}),r},enumerable:!0,configurable:!0})};let s;const c=(e,t,r,i)=>{void 0===s&&(s=n(2744));const o=i?10:0,u={};for(const[n,i]of Object.entries(s)){const a="ansi16"===n?"ansi":n;n===t?u[a]=e(r,o):"object"==typeof i&&(u[a]=e(i[t],o))}return u};Object.defineProperty(e,"exports",{enumerable:!0,get:function(){const e=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.gray=t.color.blackBright,t.bgColor.bgGray=t.bgColor.bgBlackBright,t.color.grey=t.color.blackBright,t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(const[n,r]of Object.entries(t)){for(const[n,i]of Object.entries(r))t[n]={open:`[${i[0]}m`,close:`[${i[1]}m`},r[n]=t[n],e.set(i[0],i[1]);Object.defineProperty(t,n,{value:r,enumerable:!1})}return Object.defineProperty(t,"codes",{value:e,enumerable:!1}),t.color.close="",t.bgColor.close="",l(t.color,"ansi",()=>c(r,"ansi16",u,!1)),l(t.color,"ansi256",()=>c(i,"ansi256",u,!1)),l(t.color,"ansi16m",()=>c(o,"rgb",a,!1)),l(t.bgColor,"ansi",()=>c(r,"ansi16",u,!0)),l(t.bgColor,"ansi256",()=>c(i,"ansi256",u,!0)),l(t.bgColor,"ansi16m",()=>c(o,"rgb",a,!0)),t}})},5640:e=>{"use strict";e.exports=e=>e&&e.exact?new RegExp("^[\ud800-\udbff][\udc00-\udfff]$"):new RegExp("[\ud800-\udbff][\udc00-\udfff]","g")},409:e=>{"use strict";e.exports=e=>e&&e.exact?new RegExp("^[\ud800-\udbff][\udc00-\udfff]$"):new RegExp("[\ud800-\udbff][\udc00-\udfff]","g")},2633:e=>{"use strict";e.exports=(e,{include:t,exclude:n}={})=>{const r=e=>{const r=t=>"string"==typeof t?e===t:t.test(e);return t?t.some(r):!n||!n.some(r)};for(const[t,n]of(e=>{const t=new Set;do{for(const n of Reflect.ownKeys(e))t.add([e,n])}while((e=Reflect.getPrototypeOf(e))&&e!==Object.prototype);return t})(e.constructor.prototype)){if("constructor"===n||!r(n))continue;const i=Reflect.getOwnPropertyDescriptor(t,n);i&&"function"==typeof i.value&&(e[n]=e[n].bind(e))}return e}},1525:(e,t,n)=>{"use strict";const r=n(8483),{stdout:i,stderr:o}=n(9428),{stringReplaceAll:u,stringEncaseCRLFWithFirstIndex:a}=n(6539),{isArray:l}=Array,s=["ansi","ansi","ansi256","ansi16m"],c=Object.create(null);class f{constructor(e){return d(e)}}const d=e=>{const t={};return((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const n=i?i.level:0;e.level=void 0===t.level?n:t.level})(t,e),t.template=(...e)=>b(t.template,...e),Object.setPrototypeOf(t,p.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=f,t.template};function p(e){return d(e)}for(const[e,t]of Object.entries(r))c[e]={get(){const n=g(this,m(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:n}),n}};c.visible={get(){const e=g(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};const h=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const e of h)c[e]={get(){const{level:t}=this;return function(...n){const i=m(r.color[s[t]][e](...n),r.color.close,this._styler);return g(this,i,this._isEmpty)}}};for(const e of h){c["bg"+e[0].toUpperCase()+e.slice(1)]={get(){const{level:t}=this;return function(...n){const i=m(r.bgColor[s[t]][e](...n),r.bgColor.close,this._styler);return g(this,i,this._isEmpty)}}}}const v=Object.defineProperties(()=>{},{...c,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),m=(e,t,n)=>{let r,i;return void 0===n?(r=e,i=t):(r=n.openAll+e,i=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:n}},g=(e,t,n)=>{const r=(...e)=>l(e[0])&&l(e[0].raw)?_(r,b(r,...e)):_(r,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(r,v),r._generator=e,r._styler=t,r._isEmpty=n,r},_=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let n=e._styler;if(void 0===n)return t;const{openAll:r,closeAll:i}=n;if(-1!==t.indexOf(""))for(;void 0!==n;)t=u(t,n.close,n.open),n=n.parent;const o=t.indexOf("\n");return-1!==o&&(t=a(t,i,r,o)),r+t+i};let y;const b=(e,...t)=>{const[r]=t;if(!l(r)||!l(r.raw))return t.join(" ");const i=t.slice(1),o=[r.raw[0]];for(let e=1;e{"use strict";const t=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,n=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,r=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,i=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,o=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function u(e){const t="u"===e[0],n="{"===e[1];return t&&!n&&5===e.length||"x"===e[0]&&3===e.length?String.fromCharCode(parseInt(e.slice(1),16)):t&&n?String.fromCodePoint(parseInt(e.slice(2,-1),16)):o.get(e)||e}function a(e,t){const n=[],o=t.trim().split(/\s*,\s*/g);let a;for(const t of o){const o=Number(t);if(Number.isNaN(o)){if(!(a=t.match(r)))throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`);n.push(a[2].replace(i,(e,t,n)=>t?u(t):n))}else n.push(o)}return n}function l(e){n.lastIndex=0;const t=[];let r;for(;null!==(r=n.exec(e));){const e=r[1];if(r[2]){const n=a(e,r[2]);t.push([e].concat(n))}else t.push([e])}return t}function s(e,t){const n={};for(const e of t)for(const t of e.styles)n[t[0]]=e.inverse?null:t.slice(1);let r=e;for(const[e,t]of Object.entries(n))if(Array.isArray(t)){if(!(e in r))throw new Error("Unknown Chalk style: "+e);r=t.length>0?r[e](...t):r[e]}return r}e.exports=(e,n)=>{const r=[],i=[];let o=[];if(n.replace(t,(t,n,a,c,f,d)=>{if(n)o.push(u(n));else if(c){const t=o.join("");o=[],i.push(0===r.length?t:s(e,r)(t)),r.push({inverse:a,styles:l(c)})}else if(f){if(0===r.length)throw new Error("Found extraneous } in Chalk template literal");i.push(s(e,r)(o.join(""))),o=[],r.pop()}else o.push(d)}),i.push(o.join("")),r.length>0){const e=`Chalk template literal is missing ${r.length} closing bracket${1===r.length?"":"s"} (\`}\`)`;throw new Error(e)}return i.join("")}},6539:e=>{"use strict";e.exports={stringReplaceAll:(e,t,n)=>{let r=e.indexOf(t);if(-1===r)return e;const i=t.length;let o=0,u="";do{u+=e.substr(o,r-o)+t+n,o=r+i,r=e.indexOf(t,o)}while(-1!==r);return u+=e.substr(o),u},stringEncaseCRLFWithFirstIndex:(e,t,n,r)=>{let i=0,o="";do{const u="\r"===e[r-1];o+=e.substr(i,(u?r-1:r)-i)+t+(u?"\r\n":"\n")+n,i=r+1,r=e.indexOf("\n",i)}while(-1!==r);return o+=e.substr(i),o}}},5864:(e,t,n)=>{"use strict";var r=n(5832),i=process.env;function o(e){return"string"==typeof e?!!i[e]:Object.keys(e).every((function(t){return i[t]===e[t]}))}Object.defineProperty(t,"_vendors",{value:r.map((function(e){return e.constant}))}),t.name=null,t.isPR=null,r.forEach((function(e){var n=(Array.isArray(e.env)?e.env:[e.env]).every((function(e){return o(e)}));if(t[e.constant]=n,n)switch(t.name=e.name,typeof e.pr){case"string":t.isPR=!!i[e.pr];break;case"object":"env"in e.pr?t.isPR=e.pr.env in i&&i[e.pr.env]!==e.pr.ne:"any"in e.pr?t.isPR=e.pr.any.some((function(e){return!!i[e]})):t.isPR=o(e.pr);break;default:t.isPR=null}})),t.isCI=!!(i.CI||i.CONTINUOUS_INTEGRATION||i.BUILD_NUMBER||i.RUN_ID||t.name)},5832:e=>{"use strict";e.exports=JSON.parse('[{"name":"AppVeyor","constant":"APPVEYOR","env":"APPVEYOR","pr":"APPVEYOR_PULL_REQUEST_NUMBER"},{"name":"Azure Pipelines","constant":"AZURE_PIPELINES","env":"SYSTEM_TEAMFOUNDATIONCOLLECTIONURI","pr":"SYSTEM_PULLREQUEST_PULLREQUESTID"},{"name":"Bamboo","constant":"BAMBOO","env":"bamboo_planKey"},{"name":"Bitbucket Pipelines","constant":"BITBUCKET","env":"BITBUCKET_COMMIT","pr":"BITBUCKET_PR_ID"},{"name":"Bitrise","constant":"BITRISE","env":"BITRISE_IO","pr":"BITRISE_PULL_REQUEST"},{"name":"Buddy","constant":"BUDDY","env":"BUDDY_WORKSPACE_ID","pr":"BUDDY_EXECUTION_PULL_REQUEST_ID"},{"name":"Buildkite","constant":"BUILDKITE","env":"BUILDKITE","pr":{"env":"BUILDKITE_PULL_REQUEST","ne":"false"}},{"name":"CircleCI","constant":"CIRCLE","env":"CIRCLECI","pr":"CIRCLE_PULL_REQUEST"},{"name":"Cirrus CI","constant":"CIRRUS","env":"CIRRUS_CI","pr":"CIRRUS_PR"},{"name":"AWS CodeBuild","constant":"CODEBUILD","env":"CODEBUILD_BUILD_ARN"},{"name":"Codeship","constant":"CODESHIP","env":{"CI_NAME":"codeship"}},{"name":"Drone","constant":"DRONE","env":"DRONE","pr":{"DRONE_BUILD_EVENT":"pull_request"}},{"name":"dsari","constant":"DSARI","env":"DSARI"},{"name":"GitLab CI","constant":"GITLAB","env":"GITLAB_CI"},{"name":"GoCD","constant":"GOCD","env":"GO_PIPELINE_LABEL"},{"name":"Hudson","constant":"HUDSON","env":"HUDSON_URL"},{"name":"Jenkins","constant":"JENKINS","env":["JENKINS_URL","BUILD_ID"],"pr":{"any":["ghprbPullId","CHANGE_ID"]}},{"name":"Magnum CI","constant":"MAGNUM","env":"MAGNUM"},{"name":"Netlify CI","constant":"NETLIFY","env":"NETLIFY_BUILD_BASE","pr":{"env":"PULL_REQUEST","ne":"false"}},{"name":"Sail CI","constant":"SAIL","env":"SAILCI","pr":"SAIL_PULL_REQUEST_NUMBER"},{"name":"Semaphore","constant":"SEMAPHORE","env":"SEMAPHORE","pr":"PULL_REQUEST_NUMBER"},{"name":"Shippable","constant":"SHIPPABLE","env":"SHIPPABLE","pr":{"IS_PULL_REQUEST":"true"}},{"name":"Solano CI","constant":"SOLANO","env":"TDDIUM","pr":"TDDIUM_PR_ID"},{"name":"Strider CD","constant":"STRIDER","env":"STRIDER"},{"name":"TaskCluster","constant":"TASKCLUSTER","env":["TASK_ID","RUN_ID"]},{"name":"TeamCity","constant":"TEAMCITY","env":"TEAMCITY_VERSION"},{"name":"Travis CI","constant":"TRAVIS","env":"TRAVIS","pr":{"env":"TRAVIS_PULL_REQUEST","ne":"false"}}]')},4163:e=>{"use strict";e.exports=JSON.parse('{"single":{"topLeft":"┌","topRight":"┐","bottomRight":"┘","bottomLeft":"└","vertical":"│","horizontal":"─"},"double":{"topLeft":"╔","topRight":"╗","bottomRight":"╝","bottomLeft":"╚","vertical":"║","horizontal":"═"},"round":{"topLeft":"╭","topRight":"╮","bottomRight":"╯","bottomLeft":"╰","vertical":"│","horizontal":"─"},"bold":{"topLeft":"┏","topRight":"┓","bottomRight":"┛","bottomLeft":"┗","vertical":"┃","horizontal":"━"},"singleDouble":{"topLeft":"╓","topRight":"╖","bottomRight":"╜","bottomLeft":"╙","vertical":"║","horizontal":"─"},"doubleSingle":{"topLeft":"╒","topRight":"╕","bottomRight":"╛","bottomLeft":"╘","vertical":"│","horizontal":"═"},"classic":{"topLeft":"+","topRight":"+","bottomRight":"+","bottomLeft":"+","vertical":"|","horizontal":"-"}}')},4097:(e,t,n)=>{"use strict";const r=n(4163);e.exports=r,e.exports.default=r},1696:(e,t,n)=>{"use strict";const r=n(3390);let i=!1;t.show=(e=process.stderr)=>{e.isTTY&&(i=!1,e.write("[?25h"))},t.hide=(e=process.stderr)=>{e.isTTY&&(r(),i=!0,e.write("[?25l"))},t.toggle=(e,n)=>{void 0!==e&&(i=e),i?t.show(n):t.hide(n)}},5301:(e,t,n)=>{"use strict";const r=n(1566),i=n(5043);function o(e,t,n){if(" "===e.charAt(t))return t;for(let r=1;r<=3;r++)if(n){if(" "===e.charAt(t+r))return t+r}else if(" "===e.charAt(t-r))return t-r;return t}e.exports=(e,t,n)=>{n={position:"end",preferTruncationOnSpace:!1,...n};const{position:u,space:a,preferTruncationOnSpace:l}=n;let s="…",c=1;if("string"!=typeof e)throw new TypeError("Expected `input` to be a string, got "+typeof e);if("number"!=typeof t)throw new TypeError("Expected `columns` to be a number, got "+typeof t);if(t<1)return"";if(1===t)return s;const f=i(e);if(f<=t)return e;if("start"===u){if(l){const n=o(e,f-t+1,!0);return s+r(e,n,f).trim()}return!0===a&&(s+=" ",c=2),s+r(e,f-t+c,f)}if("middle"===u){!0===a&&(s=" "+s+" ",c=3);const n=Math.floor(t/2);if(l){const i=o(e,n),u=o(e,f-(t-n)+1,!0);return r(e,0,i)+s+r(e,u,f).trim()}return r(e,0,n)+s+r(e,f-(t-n)+c,f)}if("end"===u){if(l){const n=o(e,t-1);return r(e,0,n)+s}return!0===a&&(s=" "+s,c=2),r(e,0,t-c)+s}throw new Error("Expected `options.position` to be either `start`, `middle` or `end`, got "+u)}},9908:(e,t,n)=>{"use strict";const r=n(3287);e.exports=(e,t,n)=>{if("string"!=typeof e)throw new TypeError("Source code is missing.");if(!t||t<1)throw new TypeError("Line number must start from `1`.");if(!(t>(e=r(e).split(/\r?\n/)).length))return((e,t)=>{const n=[],r=e+t;for(let i=e-t;i<=r;i++)n.push(i);return n})(t,(n={around:3,...n}).around).filter(t=>void 0!==e[t-1]).map(t=>({line:t,value:e[t-1]}))}},5311:(e,t,n)=>{const r=n(3300),i={};for(const e of Object.keys(r))i[r[e]]=e;const o={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};e.exports=o;for(const e of Object.keys(o)){if(!("channels"in o[e]))throw new Error("missing channels property: "+e);if(!("labels"in o[e]))throw new Error("missing channel labels property: "+e);if(o[e].labels.length!==o[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=o[e];delete o[e].channels,delete o[e].labels,Object.defineProperty(o[e],"channels",{value:t}),Object.defineProperty(o[e],"labels",{value:n})}o.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),o=Math.max(t,n,r),u=o-i;let a,l;o===i?a=0:t===o?a=(n-r)/u:n===o?a=2+(r-t)/u:r===o&&(a=4+(t-n)/u),a=Math.min(60*a,360),a<0&&(a+=360);const s=(i+o)/2;return l=o===i?0:s<=.5?u/(o+i):u/(2-o-i),[a,100*l,100*s]},o.rgb.hsv=function(e){let t,n,r,i,o;const u=e[0]/255,a=e[1]/255,l=e[2]/255,s=Math.max(u,a,l),c=s-Math.min(u,a,l),f=function(e){return(s-e)/6/c+.5};return 0===c?(i=0,o=0):(o=c/s,t=f(u),n=f(a),r=f(l),u===s?i=r-n:a===s?i=1/3+t-r:l===s&&(i=2/3+n-t),i<0?i+=1:i>1&&(i-=1)),[360*i,100*o,100*s]},o.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const i=o.rgb.hsl(e)[0],u=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[i,100*u,100*r]},o.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r);return[100*((1-t-i)/(1-i)||0),100*((1-n-i)/(1-i)||0),100*((1-r-i)/(1-i)||0),100*i]},o.rgb.keyword=function(e){const t=i[e];if(t)return t;let n,o=1/0;for(const t of Object.keys(r)){const i=r[t],l=(a=i,((u=e)[0]-a[0])**2+(u[1]-a[1])**2+(u[2]-a[2])**2);l.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;return[100*(.4124*t+.3576*n+.1805*r),100*(.2126*t+.7152*n+.0722*r),100*(.0193*t+.1192*n+.9505*r)]},o.rgb.lab=function(e){const t=o.rgb.xyz(e);let n=t[0],r=t[1],i=t[2];n/=95.047,r/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;return[116*r-16,500*(n-r),200*(r-i)]},o.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let i,o,u;if(0===n)return u=255*r,[u,u,u];i=r<.5?r*(1+n):r+n-r*n;const a=2*r-i,l=[0,0,0];for(let e=0;e<3;e++)o=t+1/3*-(e-1),o<0&&o++,o>1&&o--,u=6*o<1?a+6*(i-a)*o:2*o<1?i:3*o<2?a+(i-a)*(2/3-o)*6:a,l[e]=255*u;return l},o.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,i=n;const o=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=o<=1?o:2-o;return[t,100*(0===r?2*i/(o+i):2*n/(r+n)),100*((r+n)/2)]},o.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const i=Math.floor(t)%6,o=t-Math.floor(t),u=255*r*(1-n),a=255*r*(1-n*o),l=255*r*(1-n*(1-o));switch(r*=255,i){case 0:return[r,l,u];case 1:return[a,r,u];case 2:return[u,r,l];case 3:return[u,a,r];case 4:return[l,u,r];case 5:return[r,u,a]}},o.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01);let o,u;u=(2-n)*r;const a=(2-n)*i;return o=n*i,o/=a<=1?a:2-a,o=o||0,u/=2,[t,100*o,100*u]},o.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const i=n+r;let o;i>1&&(n/=i,r/=i);const u=Math.floor(6*t),a=1-r;o=6*t-u,0!=(1&u)&&(o=1-o);const l=n+o*(a-n);let s,c,f;switch(u){default:case 6:case 0:s=a,c=l,f=n;break;case 1:s=l,c=a,f=n;break;case 2:s=n,c=a,f=l;break;case 3:s=n,c=l,f=a;break;case 4:s=l,c=n,f=a;break;case 5:s=a,c=n,f=l}return[255*s,255*c,255*f]},o.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},o.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let i,o,u;return i=3.2406*t+-1.5372*n+-.4986*r,o=-.9689*t+1.8758*n+.0415*r,u=.0557*t+-.204*n+1.057*r,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,u=u>.0031308?1.055*u**(1/2.4)-.055:12.92*u,i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),u=Math.min(Math.max(0,u),1),[255*i,255*o,255*u]},o.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;return[116*n-16,500*(t-n),200*(n-r)]},o.lab.xyz=function(e){let t,n,r;n=(e[0]+16)/116,t=e[1]/500+n,r=n-e[2]/200;const i=n**3,o=t**3,u=r**3;return n=i>.008856?i:(n-16/116)/7.787,t=o>.008856?o:(t-16/116)/7.787,r=u>.008856?u:(r-16/116)/7.787,t*=95.047,n*=100,r*=108.883,[t,n,r]},o.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let i;i=360*Math.atan2(r,n)/2/Math.PI,i<0&&(i+=360);return[t,Math.sqrt(n*n+r*r),i]},o.lch.lab=function(e){const t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},o.rgb.ansi16=function(e,t=null){const[n,r,i]=e;let u=null===t?o.rgb.hsv(e)[2]:t;if(u=Math.round(u/50),0===u)return 30;let a=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return 2===u&&(a+=60),a},o.hsv.ansi16=function(e){return o.rgb.ansi16(o.hsv.rgb(e),e[2])},o.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];if(t===n&&n===r)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;return 16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},o.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},o.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;e-=16;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},o.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},o.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];3===t[0].length&&(n=n.split("").map(e=>e+e).join(""));const r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},o.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),o=Math.min(Math.min(t,n),r),u=i-o;let a,l;return a=u<1?o/(1-u):0,l=u<=0?0:i===t?(n-r)/u%6:i===n?2+(r-t)/u:4+(t-n)/u,l/=6,l%=1,[360*l,100*u,100*a]},o.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],100*r,100*i]},o.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},o.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(0===n)return[255*r,255*r,255*r];const i=[0,0,0],o=t%1*6,u=o%1,a=1-u;let l=0;switch(Math.floor(o)){case 0:i[0]=1,i[1]=u,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=u;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=u,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return l=(1-n)*r,[255*(n*i[0]+l),255*(n*i[1]+l),255*(n*i[2]+l)]},o.hcg.hsv=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);let r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},o.hcg.hsl=function(e){const t=e[1]/100,n=e[2]/100*(1-t)+.5*t;let r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},o.hcg.hwb=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},o.hwb.hcg=function(e){const t=e[1]/100,n=1-e[2]/100,r=n-t;let i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},o.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},o.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},o.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},o.gray.hsl=function(e){return[0,0,e[0]]},o.gray.hsv=o.gray.hsl,o.gray.hwb=function(e){return[0,100,e[0]]},o.gray.cmyk=function(e){return[0,0,0,e[0]]},o.gray.lab=function(e){return[e[0],0,0]},o.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},o.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},2744:(e,t,n)=>{const r=n(5311),i=n(8577),o={};Object.keys(r).forEach(e=>{o[e]={},Object.defineProperty(o[e],"channels",{value:r[e].channels}),Object.defineProperty(o[e],"labels",{value:r[e].labels});const t=i(e);Object.keys(t).forEach(n=>{const r=t[n];o[e][n]=function(e){const t=function(...t){const n=t[0];if(null==n)return n;n.length>1&&(t=n);const r=e(t);if("object"==typeof r)for(let e=r.length,t=0;t1&&(t=n),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(r)})}),e.exports=o},8577:(e,t,n)=>{const r=n(5311);function i(e){const t=function(){const e={},t=Object.keys(r);for(let n=t.length,r=0;r{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},3287:e=>{"use strict";e.exports=(e,t)=>e.replace(/^\t+/gm,e=>" ".repeat(e.length*(t||2)))},1013:e=>{"use strict";e.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}},8759:e=>{"use strict";const t=/[|\\{}()[\]^$+*?.-]/g;e.exports=e=>{if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(t,"\\$&")}},2918:e=>{"use strict";e.exports=(e,t=process.argv)=>{const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),i=t.indexOf("--");return-1!==r&&(-1===i||r{"use strict";e.exports=(e,t=1,n)=>{if(n={indent:" ",includeEmptyLines:!1,...n},"string"!=typeof e)throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if("number"!=typeof t)throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if("string"!=typeof n.indent)throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n.indent}\``);if(0===t)return e;const r=n.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(r,n.indent.repeat(t))}},2738:(e,t,n)=>{"use strict";e.exports=n(5864).isCI},7347:e=>{"use strict";const t=e=>!Number.isNaN(e)&&(e>=4352&&(e<=4447||9001===e||9002===e||11904<=e&&e<=12871&&12351!==e||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141));e.exports=t,e.exports.default=t},464:function(e,t,n){var r; +/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */e=n.nmd(e),function(){var i="Expected a function",o="__lodash_placeholder__",u=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],a="[object Arguments]",l="[object Array]",s="[object Boolean]",c="[object Date]",f="[object Error]",d="[object Function]",p="[object GeneratorFunction]",h="[object Map]",v="[object Number]",m="[object Object]",g="[object RegExp]",_="[object Set]",y="[object String]",b="[object Symbol]",w="[object WeakMap]",E="[object ArrayBuffer]",D="[object DataView]",C="[object Float32Array]",k="[object Float64Array]",S="[object Int8Array]",T="[object Int16Array]",x="[object Int32Array]",A="[object Uint8Array]",O="[object Uint16Array]",M="[object Uint32Array]",I=/\b__p \+= '';/g,R=/\b(__p \+=) '' \+/g,N=/(__e\(.*?\)|\b__t\)) \+\n'';/g,P=/&(?:amp|lt|gt|quot|#39);/g,F=/[&<>"']/g,L=RegExp(P.source),B=RegExp(F.source),U=/<%-([\s\S]+?)%>/g,j=/<%([\s\S]+?)%>/g,z=/<%=([\s\S]+?)%>/g,W=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,H=/^\w*$/,V=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$=/[\\^$.*+?()[\]{}|]/g,G=RegExp($.source),q=/^\s+|\s+$/g,Y=/^\s+/,X=/\s+$/,K=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,J=/\{\n\/\* \[wrapped with (.+)\] \*/,Q=/,? & /,Z=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ee=/\\(\\)?/g,te=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ne=/\w*$/,re=/^[-+]0x[0-9a-f]+$/i,ie=/^0b[01]+$/i,oe=/^\[object .+?Constructor\]$/,ue=/^0o[0-7]+$/i,ae=/^(?:0|[1-9]\d*)$/,le=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,se=/($^)/,ce=/['\n\r\u2028\u2029\\]/g,fe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pe="[\\ud800-\\udfff]",he="["+de+"]",ve="["+fe+"]",me="\\d+",ge="[\\u2700-\\u27bf]",_e="[a-z\\xdf-\\xf6\\xf8-\\xff]",ye="[^\\ud800-\\udfff"+de+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",be="\\ud83c[\\udffb-\\udfff]",we="[^\\ud800-\\udfff]",Ee="(?:\\ud83c[\\udde6-\\uddff]){2}",De="[\\ud800-\\udbff][\\udc00-\\udfff]",Ce="[A-Z\\xc0-\\xd6\\xd8-\\xde]",ke="(?:"+_e+"|"+ye+")",Se="(?:"+Ce+"|"+ye+")",Te="(?:"+ve+"|"+be+")"+"?",xe="[\\ufe0e\\ufe0f]?"+Te+("(?:\\u200d(?:"+[we,Ee,De].join("|")+")[\\ufe0e\\ufe0f]?"+Te+")*"),Ae="(?:"+[ge,Ee,De].join("|")+")"+xe,Oe="(?:"+[we+ve+"?",ve,Ee,De,pe].join("|")+")",Me=RegExp("['’]","g"),Ie=RegExp(ve,"g"),Re=RegExp(be+"(?="+be+")|"+Oe+xe,"g"),Ne=RegExp([Ce+"?"+_e+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[he,Ce,"$"].join("|")+")",Se+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[he,Ce+ke,"$"].join("|")+")",Ce+"?"+ke+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Ce+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",me,Ae].join("|"),"g"),Pe=RegExp("[\\u200d\\ud800-\\udfff"+fe+"\\ufe0e\\ufe0f]"),Fe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Le=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Be=-1,Ue={};Ue[C]=Ue[k]=Ue[S]=Ue[T]=Ue[x]=Ue[A]=Ue["[object Uint8ClampedArray]"]=Ue[O]=Ue[M]=!0,Ue[a]=Ue[l]=Ue[E]=Ue[s]=Ue[D]=Ue[c]=Ue[f]=Ue[d]=Ue[h]=Ue[v]=Ue[m]=Ue[g]=Ue[_]=Ue[y]=Ue[w]=!1;var je={};je[a]=je[l]=je[E]=je[D]=je[s]=je[c]=je[C]=je[k]=je[S]=je[T]=je[x]=je[h]=je[v]=je[m]=je[g]=je[_]=je[y]=je[b]=je[A]=je["[object Uint8ClampedArray]"]=je[O]=je[M]=!0,je[f]=je[d]=je[w]=!1;var ze={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},We=parseFloat,He=parseInt,Ve="object"==typeof global&&global&&global.Object===Object&&global,$e="object"==typeof self&&self&&self.Object===Object&&self,Ge=Ve||$e||Function("return this")(),qe=t&&!t.nodeType&&t,Ye=qe&&e&&!e.nodeType&&e,Xe=Ye&&Ye.exports===qe,Ke=Xe&&Ve.process,Je=function(){try{var e=Ye&&Ye.require&&Ye.require("util").types;return e||Ke&&Ke.binding&&Ke.binding("util")}catch(e){}}(),Qe=Je&&Je.isArrayBuffer,Ze=Je&&Je.isDate,et=Je&&Je.isMap,tt=Je&&Je.isRegExp,nt=Je&&Je.isSet,rt=Je&&Je.isTypedArray;function it(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function ot(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i-1}function ft(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function Rt(e,t){for(var n=e.length;n--&&bt(t,e[n],0)>-1;);return n}function Nt(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var Pt=kt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Ft=kt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Lt(e){return"\\"+ze[e]}function Bt(e){return Pe.test(e)}function Ut(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function jt(e,t){return function(n){return e(t(n))}}function zt(e,t){for(var n=-1,r=e.length,i=0,u=[];++n",""":'"',"'":"'"});var qt=function e(t){var n,r=(t=null==t?Ge:qt.defaults(Ge.Object(),t,qt.pick(Ge,Le))).Array,fe=t.Date,de=t.Error,pe=t.Function,he=t.Math,ve=t.Object,me=t.RegExp,ge=t.String,_e=t.TypeError,ye=r.prototype,be=pe.prototype,we=ve.prototype,Ee=t["__core-js_shared__"],De=be.toString,Ce=we.hasOwnProperty,ke=0,Se=(n=/[^.]+$/.exec(Ee&&Ee.keys&&Ee.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Te=we.toString,xe=De.call(ve),Ae=Ge._,Oe=me("^"+De.call(Ce).replace($,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Re=Xe?t.Buffer:void 0,Pe=t.Symbol,ze=t.Uint8Array,Ve=Re?Re.allocUnsafe:void 0,$e=jt(ve.getPrototypeOf,ve),qe=ve.create,Ye=we.propertyIsEnumerable,Ke=ye.splice,Je=Pe?Pe.isConcatSpreadable:void 0,gt=Pe?Pe.iterator:void 0,kt=Pe?Pe.toStringTag:void 0,Yt=function(){try{var e=Zi(ve,"defineProperty");return e({},"",{}),e}catch(e){}}(),Xt=t.clearTimeout!==Ge.clearTimeout&&t.clearTimeout,Kt=fe&&fe.now!==Ge.Date.now&&fe.now,Jt=t.setTimeout!==Ge.setTimeout&&t.setTimeout,Qt=he.ceil,Zt=he.floor,en=ve.getOwnPropertySymbols,tn=Re?Re.isBuffer:void 0,nn=t.isFinite,rn=ye.join,on=jt(ve.keys,ve),un=he.max,an=he.min,ln=fe.now,sn=t.parseInt,cn=he.random,fn=ye.reverse,dn=Zi(t,"DataView"),pn=Zi(t,"Map"),hn=Zi(t,"Promise"),vn=Zi(t,"Set"),mn=Zi(t,"WeakMap"),gn=Zi(ve,"create"),_n=mn&&new mn,yn={},bn=To(dn),wn=To(pn),En=To(hn),Dn=To(vn),Cn=To(mn),kn=Pe?Pe.prototype:void 0,Sn=kn?kn.valueOf:void 0,Tn=kn?kn.toString:void 0;function xn(e){if(Vu(e)&&!Ru(e)&&!(e instanceof In)){if(e instanceof Mn)return e;if(Ce.call(e,"__wrapped__"))return xo(e)}return new Mn(e)}var An=function(){function e(){}return function(t){if(!Hu(t))return{};if(qe)return qe(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function On(){}function Mn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function In(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Rn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function Kn(e,t,n,r,i,o){var u,l=1&t,f=2&t,w=4&t;if(n&&(u=i?n(e,r,i,o):n(e)),void 0!==u)return u;if(!Hu(e))return e;var I=Ru(e);if(I){if(u=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Ce.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return gi(e,u)}else{var R=no(e),N=R==d||R==p;if(Lu(e))return fi(e,l);if(R==m||R==a||N&&!i){if(u=f||N?{}:io(e),!l)return f?function(e,t){return _i(e,to(e),t)}(e,function(e,t){return e&&_i(t,wa(t),e)}(u,e)):function(e,t){return _i(e,eo(e),t)}(e,Gn(u,e))}else{if(!je[R])return i?e:{};u=function(e,t,n){var r=e.constructor;switch(t){case E:return di(e);case s:case c:return new r(+e);case D:return function(e,t){var n=t?di(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case C:case k:case S:case T:case x:case A:case"[object Uint8ClampedArray]":case O:case M:return pi(e,n);case h:return new r;case v:case y:return new r(e);case g:return function(e){var t=new e.constructor(e.source,ne.exec(e));return t.lastIndex=e.lastIndex,t}(e);case _:return new r;case b:return i=e,Sn?ve(Sn.call(i)):{}}var i}(e,R,l)}}o||(o=new Ln);var P=o.get(e);if(P)return P;o.set(e,u),Xu(e)?e.forEach((function(r){u.add(Kn(r,t,n,r,e,o))})):$u(e)&&e.forEach((function(r,i){u.set(i,Kn(r,t,n,i,e,o))}));var F=I?void 0:(w?f?Gi:$i:f?wa:ba)(e);return ut(F||e,(function(r,i){F&&(r=e[i=r]),Hn(u,i,Kn(r,t,n,i,e,o))})),u}function Jn(e,t,n){var r=n.length;if(null==e)return!r;for(e=ve(e);r--;){var i=n[r],o=t[i],u=e[i];if(void 0===u&&!(i in e)||!o(u))return!1}return!0}function Qn(e,t,n){if("function"!=typeof e)throw new _e(i);return bo((function(){e.apply(void 0,n)}),t)}function Zn(e,t,n,r){var i=-1,o=ct,u=!0,a=e.length,l=[],s=t.length;if(!a)return l;n&&(t=dt(t,At(n))),r?(o=ft,u=!1):t.length>=200&&(o=Mt,u=!1,t=new Fn(t));e:for(;++i-1},Nn.prototype.set=function(e,t){var n=this.__data__,r=Vn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Pn.prototype.clear=function(){this.size=0,this.__data__={hash:new Rn,map:new(pn||Nn),string:new Rn}},Pn.prototype.delete=function(e){var t=Ji(this,e).delete(e);return this.size-=t?1:0,t},Pn.prototype.get=function(e){return Ji(this,e).get(e)},Pn.prototype.has=function(e){return Ji(this,e).has(e)},Pn.prototype.set=function(e,t){var n=Ji(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Fn.prototype.add=Fn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Fn.prototype.has=function(e){return this.__data__.has(e)},Ln.prototype.clear=function(){this.__data__=new Nn,this.size=0},Ln.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Ln.prototype.get=function(e){return this.__data__.get(e)},Ln.prototype.has=function(e){return this.__data__.has(e)},Ln.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Nn){var r=n.__data__;if(!pn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Pn(r)}return n.set(e,t),this.size=n.size,this};var er=wi(lr),tr=wi(sr,!0);function nr(e,t){var n=!0;return er(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function rr(e,t,n){for(var r=-1,i=e.length;++r0&&n(a)?t>1?or(a,t-1,n,r,i):pt(i,a):r||(i[i.length]=a)}return i}var ur=Ei(),ar=Ei(!0);function lr(e,t){return e&&ur(e,t,ba)}function sr(e,t){return e&&ar(e,t,ba)}function cr(e,t){return st(t,(function(t){return ju(e[t])}))}function fr(e,t){for(var n=0,r=(t=ai(t,e)).length;null!=e&&nt}function vr(e,t){return null!=e&&Ce.call(e,t)}function mr(e,t){return null!=e&&t in ve(e)}function gr(e,t,n){for(var i=n?ft:ct,o=e[0].length,u=e.length,a=u,l=r(u),s=1/0,c=[];a--;){var f=e[a];a&&t&&(f=dt(f,At(t))),s=an(f.length,s),l[a]=!n&&(t||o>=120&&f.length>=120)?new Fn(a&&f):void 0}f=e[0];var d=-1,p=l[0];e:for(;++d=a)return l;var s=n[r];return l*("desc"==s?-1:1)}}return e.index-t.index}(e,t,n)}))}function Rr(e,t,n){for(var r=-1,i=t.length,o={};++r-1;)a!==e&&Ke.call(a,l,1),Ke.call(e,l,1);return e}function Pr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;uo(i)?Ke.call(e,i,1):Zr(e,i)}}return e}function Fr(e,t){return e+Zt(cn()*(t-e+1))}function Lr(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Zt(t/2))&&(e+=e)}while(t);return n}function Br(e,t){return wo(vo(e,t,Ga),e+"")}function Ur(e){return Un(Aa(e))}function jr(e,t){var n=Aa(e);return Co(n,Xn(t,0,n.length))}function zr(e,t,n,r){if(!Hu(e))return e;for(var i=-1,o=(t=ai(t,e)).length,u=o-1,a=e;null!=a&&++io?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var u=r(o);++i>>1,u=e[o];null!==u&&!Ju(u)&&(n?u<=t:u=200){var s=t?null:Li(e);if(s)return Wt(s);u=!1,i=Mt,l=new Fn}else l=t?[]:a;e:for(;++r=r?e:$r(e,t,n)}var ci=Xt||function(e){return Ge.clearTimeout(e)};function fi(e,t){if(t)return e.slice();var n=e.length,r=Ve?Ve(n):new e.constructor(n);return e.copy(r),r}function di(e){var t=new e.constructor(e.byteLength);return new ze(t).set(new ze(e)),t}function pi(e,t){var n=t?di(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function hi(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=e==e,o=Ju(e),u=void 0!==t,a=null===t,l=t==t,s=Ju(t);if(!a&&!s&&!o&&e>t||o&&u&&l&&!a&&!s||r&&u&&l||!n&&l||!i)return 1;if(!r&&!o&&!s&&e1?n[i-1]:void 0,u=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,u&&ao(n[0],n[1],u)&&(o=i<3?void 0:o,i=1),t=ve(t);++r-1?i[o?t[u]:u]:void 0}}function Ti(e){return Vi((function(t){var n=t.length,r=n,o=Mn.prototype.thru;for(e&&t.reverse();r--;){var u=t[r];if("function"!=typeof u)throw new _e(i);if(o&&!a&&"wrapper"==Yi(u))var a=new Mn([],!0)}for(r=a?r:n;++r1&&y.reverse(),f&&s<_&&(y.length=s),this&&this!==Ge&&this instanceof g&&(k=m||ki(k)),k.apply(C,y)}}function Ai(e,t){return function(n,r){return function(e,t,n,r){return lr(e,(function(e,i,o){t(r,n(e),i,o)})),r}(n,e,t(r),{})}}function Oi(e,t){return function(n,r){var i;if(void 0===n&&void 0===r)return t;if(void 0!==n&&(i=n),void 0!==r){if(void 0===i)return r;"string"==typeof n||"string"==typeof r?(n=Jr(n),r=Jr(r)):(n=Kr(n),r=Kr(r)),i=e(n,r)}return i}}function Mi(e){return Vi((function(t){return t=dt(t,At(Ki())),Br((function(n){var r=this;return e(t,(function(e){return it(e,r,n)}))}))}))}function Ii(e,t){var n=(t=void 0===t?" ":Jr(t)).length;if(n<2)return n?Lr(t,e):t;var r=Lr(t,Qt(e/Vt(t)));return Bt(t)?si($t(r),0,e).join(""):r.slice(0,e)}function Ri(e){return function(t,n,i){return i&&"number"!=typeof i&&ao(t,n,i)&&(n=i=void 0),t=na(t),void 0===n?(n=t,t=0):n=na(n),function(e,t,n,i){for(var o=-1,u=un(Qt((t-e)/(n||1)),0),a=r(u);u--;)a[i?u:++o]=e,e+=n;return a}(t,n,i=void 0===i?ta))return!1;var s=o.get(e),c=o.get(t);if(s&&c)return s==t&&c==e;var f=-1,d=!0,p=2&n?new Fn:void 0;for(o.set(e,t),o.set(t,e);++f-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(K,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return ut(u,(function(n){var r="_."+n[0];t&n[1]&&!ct(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(J);return t?t[1].split(Q):[]}(r),n)))}function Do(e){var t=0,n=0;return function(){var r=ln(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Co(e,t){var n=-1,r=e.length,i=r-1;for(t=void 0===t?r:t;++n1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Yo(e,n)}));function tu(e){var t=xn(e);return t.__chain__=!0,t}function nu(e,t){return t(e)}var ru=Vi((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,i=function(t){return Yn(t,e)};return!(t>1||this.__actions__.length)&&r instanceof In&&uo(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:nu,args:[i],thisArg:void 0}),new Mn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(void 0),e}))):this.thru(i)}));var iu=yi((function(e,t,n){Ce.call(e,n)?++e[n]:qn(e,n,1)}));var ou=Si(Io),uu=Si(Ro);function au(e,t){return(Ru(e)?ut:er)(e,Ki(t,3))}function lu(e,t){return(Ru(e)?at:tr)(e,Ki(t,3))}var su=yi((function(e,t,n){Ce.call(e,n)?e[n].push(t):qn(e,n,[t])}));var cu=Br((function(e,t,n){var i=-1,o="function"==typeof t,u=Pu(e)?r(e.length):[];return er(e,(function(e){u[++i]=o?it(t,e,n):_r(e,t,n)})),u})),fu=yi((function(e,t,n){qn(e,n,t)}));function du(e,t){return(Ru(e)?dt:Tr)(e,Ki(t,3))}var pu=yi((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var hu=Br((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ao(e,t[0],t[1])?t=[]:n>2&&ao(t[0],t[1],t[2])&&(t=[t[0]]),Ir(e,or(t,1),[])})),vu=Kt||function(){return Ge.Date.now()};function mu(e,t,n){return t=n?void 0:t,Ui(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function gu(e,t){var n;if("function"!=typeof t)throw new _e(i);return e=ra(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var _u=Br((function(e,t,n){var r=1;if(n.length){var i=zt(n,Xi(_u));r|=32}return Ui(e,r,t,n,i)})),yu=Br((function(e,t,n){var r=3;if(n.length){var i=zt(n,Xi(yu));r|=32}return Ui(t,r,e,n,i)}));function bu(e,t,n){var r,o,u,a,l,s,c=0,f=!1,d=!1,p=!0;if("function"!=typeof e)throw new _e(i);function h(t){var n=r,i=o;return r=o=void 0,c=t,a=e.apply(i,n)}function v(e){return c=e,l=bo(g,t),f?h(e):a}function m(e){var n=e-s;return void 0===s||n>=t||n<0||d&&e-c>=u}function g(){var e=vu();if(m(e))return _(e);l=bo(g,function(e){var n=t-(e-s);return d?an(n,u-(e-c)):n}(e))}function _(e){return l=void 0,p&&r?h(e):(r=o=void 0,a)}function y(){var e=vu(),n=m(e);if(r=arguments,o=this,s=e,n){if(void 0===l)return v(s);if(d)return ci(l),l=bo(g,t),h(s)}return void 0===l&&(l=bo(g,t)),a}return t=oa(t)||0,Hu(n)&&(f=!!n.leading,u=(d="maxWait"in n)?un(oa(n.maxWait)||0,t):u,p="trailing"in n?!!n.trailing:p),y.cancel=function(){void 0!==l&&ci(l),c=0,r=s=o=l=void 0},y.flush=function(){return void 0===l?a:_(vu())},y}var wu=Br((function(e,t){return Qn(e,1,t)})),Eu=Br((function(e,t,n){return Qn(e,oa(t)||0,n)}));function Du(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new _e(i);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var u=e.apply(this,r);return n.cache=o.set(i,u)||o,u};return n.cache=new(Du.Cache||Pn),n}function Cu(e){if("function"!=typeof e)throw new _e(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Du.Cache=Pn;var ku=li((function(e,t){var n=(t=1==t.length&&Ru(t[0])?dt(t[0],At(Ki())):dt(or(t,1),At(Ki()))).length;return Br((function(r){for(var i=-1,o=an(r.length,n);++i=t})),Iu=yr(function(){return arguments}())?yr:function(e){return Vu(e)&&Ce.call(e,"callee")&&!Ye.call(e,"callee")},Ru=r.isArray,Nu=Qe?At(Qe):function(e){return Vu(e)&&pr(e)==E};function Pu(e){return null!=e&&Wu(e.length)&&!ju(e)}function Fu(e){return Vu(e)&&Pu(e)}var Lu=tn||ol,Bu=Ze?At(Ze):function(e){return Vu(e)&&pr(e)==c};function Uu(e){if(!Vu(e))return!1;var t=pr(e);return t==f||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!qu(e)}function ju(e){if(!Hu(e))return!1;var t=pr(e);return t==d||t==p||"[object AsyncFunction]"==t||"[object Proxy]"==t}function zu(e){return"number"==typeof e&&e==ra(e)}function Wu(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Hu(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Vu(e){return null!=e&&"object"==typeof e}var $u=et?At(et):function(e){return Vu(e)&&no(e)==h};function Gu(e){return"number"==typeof e||Vu(e)&&pr(e)==v}function qu(e){if(!Vu(e)||pr(e)!=m)return!1;var t=$e(e);if(null===t)return!0;var n=Ce.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&De.call(n)==xe}var Yu=tt?At(tt):function(e){return Vu(e)&&pr(e)==g};var Xu=nt?At(nt):function(e){return Vu(e)&&no(e)==_};function Ku(e){return"string"==typeof e||!Ru(e)&&Vu(e)&&pr(e)==y}function Ju(e){return"symbol"==typeof e||Vu(e)&&pr(e)==b}var Qu=rt?At(rt):function(e){return Vu(e)&&Wu(e.length)&&!!Ue[pr(e)]};var Zu=Ni(Sr),ea=Ni((function(e,t){return e<=t}));function ta(e){if(!e)return[];if(Pu(e))return Ku(e)?$t(e):gi(e);if(gt&&e[gt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[gt]());var t=no(e);return(t==h?Ut:t==_?Wt:Aa)(e)}function na(e){return e?(e=oa(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ra(e){var t=na(e),n=t%1;return t==t?n?t-n:t:0}function ia(e){return e?Xn(ra(e),0,4294967295):0}function oa(e){if("number"==typeof e)return e;if(Ju(e))return NaN;if(Hu(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Hu(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(q,"");var n=ie.test(e);return n||ue.test(e)?He(e.slice(2),n?2:8):re.test(e)?NaN:+e}function ua(e){return _i(e,wa(e))}function aa(e){return null==e?"":Jr(e)}var la=bi((function(e,t){if(fo(t)||Pu(t))_i(t,ba(t),e);else for(var n in t)Ce.call(t,n)&&Hn(e,n,t[n])})),sa=bi((function(e,t){_i(t,wa(t),e)})),ca=bi((function(e,t,n,r){_i(t,wa(t),e,r)})),fa=bi((function(e,t,n,r){_i(t,ba(t),e,r)})),da=Vi(Yn);var pa=Br((function(e,t){e=ve(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&ao(t[0],t[1],i)&&(r=1);++n1),t})),_i(e,Gi(e),n),r&&(n=Kn(n,7,Wi));for(var i=t.length;i--;)Zr(n,t[i]);return n}));var ka=Vi((function(e,t){return null==e?{}:function(e,t){return Rr(e,t,(function(t,n){return ma(e,n)}))}(e,t)}));function Sa(e,t){if(null==e)return{};var n=dt(Gi(e),(function(e){return[e]}));return t=Ki(t),Rr(e,n,(function(e,n){return t(e,n[0])}))}var Ta=Bi(ba),xa=Bi(wa);function Aa(e){return null==e?[]:Ot(e,ba(e))}var Oa=Ci((function(e,t,n){return t=t.toLowerCase(),e+(n?Ma(t):t)}));function Ma(e){return Ua(aa(e).toLowerCase())}function Ia(e){return(e=aa(e))&&e.replace(le,Pt).replace(Ie,"")}var Ra=Ci((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Na=Ci((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Pa=Di("toLowerCase");var Fa=Ci((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var La=Ci((function(e,t,n){return e+(n?" ":"")+Ua(t)}));var Ba=Ci((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Ua=Di("toUpperCase");function ja(e,t,n){return e=aa(e),void 0===(t=n?void 0:t)?function(e){return Fe.test(e)}(e)?function(e){return e.match(Ne)||[]}(e):function(e){return e.match(Z)||[]}(e):e.match(t)||[]}var za=Br((function(e,t){try{return it(e,void 0,t)}catch(e){return Uu(e)?e:new de(e)}})),Wa=Vi((function(e,t){return ut(t,(function(t){t=So(t),qn(e,t,_u(e[t],e))})),e}));function Ha(e){return function(){return e}}var Va=Ti(),$a=Ti(!0);function Ga(e){return e}function qa(e){return Dr("function"==typeof e?e:Kn(e,1))}var Ya=Br((function(e,t){return function(n){return _r(n,e,t)}})),Xa=Br((function(e,t){return function(n){return _r(e,n,t)}}));function Ka(e,t,n){var r=ba(t),i=cr(t,r);null!=n||Hu(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=cr(t,ba(t)));var o=!(Hu(n)&&"chain"in n&&!n.chain),u=ju(e);return ut(i,(function(n){var r=t[n];e[n]=r,u&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=gi(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,pt([this.value()],arguments))})})),e}function Ja(){}var Qa=Mi(dt),Za=Mi(lt),el=Mi(mt);function tl(e){return lo(e)?Ct(So(e)):function(e){return function(t){return fr(t,e)}}(e)}var nl=Ri(),rl=Ri(!0);function il(){return[]}function ol(){return!1}var ul=Oi((function(e,t){return e+t}),0),al=Fi("ceil"),ll=Oi((function(e,t){return e/t}),1),sl=Fi("floor");var cl,fl=Oi((function(e,t){return e*t}),1),dl=Fi("round"),pl=Oi((function(e,t){return e-t}),0);return xn.after=function(e,t){if("function"!=typeof t)throw new _e(i);return e=ra(e),function(){if(--e<1)return t.apply(this,arguments)}},xn.ary=mu,xn.assign=la,xn.assignIn=sa,xn.assignInWith=ca,xn.assignWith=fa,xn.at=da,xn.before=gu,xn.bind=_u,xn.bindAll=Wa,xn.bindKey=yu,xn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ru(e)?e:[e]},xn.chain=tu,xn.chunk=function(e,t,n){t=(n?ao(e,t,n):void 0===t)?1:un(ra(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,u=0,a=r(Qt(i/t));oi?0:i+n),(r=void 0===r||r>i?i:ra(r))<0&&(r+=i),r=n>r?0:ia(r);n>>0)?(e=aa(e))&&("string"==typeof t||null!=t&&!Yu(t))&&!(t=Jr(t))&&Bt(e)?si($t(e),0,n):e.split(t,n):[]},xn.spread=function(e,t){if("function"!=typeof e)throw new _e(i);return t=null==t?0:un(ra(t),0),Br((function(n){var r=n[t],i=si(n,0,t);return r&&pt(i,r),it(e,this,i)}))},xn.tail=function(e){var t=null==e?0:e.length;return t?$r(e,1,t):[]},xn.take=function(e,t,n){return e&&e.length?$r(e,0,(t=n||void 0===t?1:ra(t))<0?0:t):[]},xn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?$r(e,(t=r-(t=n||void 0===t?1:ra(t)))<0?0:t,r):[]},xn.takeRightWhile=function(e,t){return e&&e.length?ti(e,Ki(t,3),!1,!0):[]},xn.takeWhile=function(e,t){return e&&e.length?ti(e,Ki(t,3)):[]},xn.tap=function(e,t){return t(e),e},xn.throttle=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new _e(i);return Hu(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),bu(e,t,{leading:r,maxWait:t,trailing:o})},xn.thru=nu,xn.toArray=ta,xn.toPairs=Ta,xn.toPairsIn=xa,xn.toPath=function(e){return Ru(e)?dt(e,So):Ju(e)?[e]:gi(ko(aa(e)))},xn.toPlainObject=ua,xn.transform=function(e,t,n){var r=Ru(e),i=r||Lu(e)||Qu(e);if(t=Ki(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Hu(e)&&ju(o)?An($e(e)):{}}return(i?ut:lr)(e,(function(e,r,i){return t(n,e,r,i)})),n},xn.unary=function(e){return mu(e,1)},xn.union=Vo,xn.unionBy=$o,xn.unionWith=Go,xn.uniq=function(e){return e&&e.length?Qr(e):[]},xn.uniqBy=function(e,t){return e&&e.length?Qr(e,Ki(t,2)):[]},xn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Qr(e,void 0,t):[]},xn.unset=function(e,t){return null==e||Zr(e,t)},xn.unzip=qo,xn.unzipWith=Yo,xn.update=function(e,t,n){return null==e?e:ei(e,t,ui(n))},xn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:ei(e,t,ui(n),r)},xn.values=Aa,xn.valuesIn=function(e){return null==e?[]:Ot(e,wa(e))},xn.without=Xo,xn.words=ja,xn.wrap=function(e,t){return Su(ui(t),e)},xn.xor=Ko,xn.xorBy=Jo,xn.xorWith=Qo,xn.zip=Zo,xn.zipObject=function(e,t){return ii(e||[],t||[],Hn)},xn.zipObjectDeep=function(e,t){return ii(e||[],t||[],zr)},xn.zipWith=eu,xn.entries=Ta,xn.entriesIn=xa,xn.extend=sa,xn.extendWith=ca,Ka(xn,xn),xn.add=ul,xn.attempt=za,xn.camelCase=Oa,xn.capitalize=Ma,xn.ceil=al,xn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=oa(n))==n?n:0),void 0!==t&&(t=(t=oa(t))==t?t:0),Xn(oa(e),t,n)},xn.clone=function(e){return Kn(e,4)},xn.cloneDeep=function(e){return Kn(e,5)},xn.cloneDeepWith=function(e,t){return Kn(e,5,t="function"==typeof t?t:void 0)},xn.cloneWith=function(e,t){return Kn(e,4,t="function"==typeof t?t:void 0)},xn.conformsTo=function(e,t){return null==t||Jn(e,t,ba(t))},xn.deburr=Ia,xn.defaultTo=function(e,t){return null==e||e!=e?t:e},xn.divide=ll,xn.endsWith=function(e,t,n){e=aa(e),t=Jr(t);var r=e.length,i=n=void 0===n?r:Xn(ra(n),0,r);return(n-=t.length)>=0&&e.slice(n,i)==t},xn.eq=Au,xn.escape=function(e){return(e=aa(e))&&B.test(e)?e.replace(F,Ft):e},xn.escapeRegExp=function(e){return(e=aa(e))&&G.test(e)?e.replace($,"\\$&"):e},xn.every=function(e,t,n){var r=Ru(e)?lt:nr;return n&&ao(e,t,n)&&(t=void 0),r(e,Ki(t,3))},xn.find=ou,xn.findIndex=Io,xn.findKey=function(e,t){return _t(e,Ki(t,3),lr)},xn.findLast=uu,xn.findLastIndex=Ro,xn.findLastKey=function(e,t){return _t(e,Ki(t,3),sr)},xn.floor=sl,xn.forEach=au,xn.forEachRight=lu,xn.forIn=function(e,t){return null==e?e:ur(e,Ki(t,3),wa)},xn.forInRight=function(e,t){return null==e?e:ar(e,Ki(t,3),wa)},xn.forOwn=function(e,t){return e&&lr(e,Ki(t,3))},xn.forOwnRight=function(e,t){return e&&sr(e,Ki(t,3))},xn.get=va,xn.gt=Ou,xn.gte=Mu,xn.has=function(e,t){return null!=e&&ro(e,t,vr)},xn.hasIn=ma,xn.head=Po,xn.identity=Ga,xn.includes=function(e,t,n,r){e=Pu(e)?e:Aa(e),n=n&&!r?ra(n):0;var i=e.length;return n<0&&(n=un(i+n,0)),Ku(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&bt(e,t,n)>-1},xn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:ra(n);return i<0&&(i=un(r+i,0)),bt(e,t,i)},xn.inRange=function(e,t,n){return t=na(t),void 0===n?(n=t,t=0):n=na(n),function(e,t,n){return e>=an(t,n)&&e=-9007199254740991&&e<=9007199254740991},xn.isSet=Xu,xn.isString=Ku,xn.isSymbol=Ju,xn.isTypedArray=Qu,xn.isUndefined=function(e){return void 0===e},xn.isWeakMap=function(e){return Vu(e)&&no(e)==w},xn.isWeakSet=function(e){return Vu(e)&&"[object WeakSet]"==pr(e)},xn.join=function(e,t){return null==e?"":rn.call(e,t)},xn.kebabCase=Ra,xn.last=Uo,xn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=ra(n))<0?un(r+i,0):an(i,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):yt(e,Et,i,!0)},xn.lowerCase=Na,xn.lowerFirst=Pa,xn.lt=Zu,xn.lte=ea,xn.max=function(e){return e&&e.length?rr(e,Ga,hr):void 0},xn.maxBy=function(e,t){return e&&e.length?rr(e,Ki(t,2),hr):void 0},xn.mean=function(e){return Dt(e,Ga)},xn.meanBy=function(e,t){return Dt(e,Ki(t,2))},xn.min=function(e){return e&&e.length?rr(e,Ga,Sr):void 0},xn.minBy=function(e,t){return e&&e.length?rr(e,Ki(t,2),Sr):void 0},xn.stubArray=il,xn.stubFalse=ol,xn.stubObject=function(){return{}},xn.stubString=function(){return""},xn.stubTrue=function(){return!0},xn.multiply=fl,xn.nth=function(e,t){return e&&e.length?Mr(e,ra(t)):void 0},xn.noConflict=function(){return Ge._===this&&(Ge._=Ae),this},xn.noop=Ja,xn.now=vu,xn.pad=function(e,t,n){e=aa(e);var r=(t=ra(t))?Vt(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Ii(Zt(i),n)+e+Ii(Qt(i),n)},xn.padEnd=function(e,t,n){e=aa(e);var r=(t=ra(t))?Vt(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var i=cn();return an(e+i*(t-e+We("1e-"+((i+"").length-1))),t)}return Fr(e,t)},xn.reduce=function(e,t,n){var r=Ru(e)?ht:St,i=arguments.length<3;return r(e,Ki(t,4),n,i,er)},xn.reduceRight=function(e,t,n){var r=Ru(e)?vt:St,i=arguments.length<3;return r(e,Ki(t,4),n,i,tr)},xn.repeat=function(e,t,n){return t=(n?ao(e,t,n):void 0===t)?1:ra(t),Lr(aa(e),t)},xn.replace=function(){var e=arguments,t=aa(e[0]);return e.length<3?t:t.replace(e[1],e[2])},xn.result=function(e,t,n){var r=-1,i=(t=ai(t,e)).length;for(i||(i=1,e=void 0);++r9007199254740991)return[];var n=4294967295,r=an(e,4294967295);e-=4294967295;for(var i=xt(r,t=Ki(t));++n=o)return e;var a=n-Vt(r);if(a<1)return r;var l=u?si(u,0,a).join(""):e.slice(0,a);if(void 0===i)return l+r;if(u&&(a+=l.length-a),Yu(i)){if(e.slice(a).search(i)){var s,c=l;for(i.global||(i=me(i.source,aa(ne.exec(i))+"g")),i.lastIndex=0;s=i.exec(c);)var f=s.index;l=l.slice(0,void 0===f?a:f)}}else if(e.indexOf(Jr(i),a)!=a){var d=l.lastIndexOf(i);d>-1&&(l=l.slice(0,d))}return l+r},xn.unescape=function(e){return(e=aa(e))&&L.test(e)?e.replace(P,Gt):e},xn.uniqueId=function(e){var t=++ke;return aa(e)+t},xn.upperCase=Ba,xn.upperFirst=Ua,xn.each=au,xn.eachRight=lu,xn.first=Po,Ka(xn,(cl={},lr(xn,(function(e,t){Ce.call(xn.prototype,t)||(cl[t]=e)})),cl),{chain:!1}),xn.VERSION="4.17.20",ut(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){xn[e].placeholder=xn})),ut(["drop","take"],(function(e,t){In.prototype[e]=function(n){n=void 0===n?1:un(ra(n),0);var r=this.__filtered__&&!t?new In(this):this.clone();return r.__filtered__?r.__takeCount__=an(n,r.__takeCount__):r.__views__.push({size:an(n,4294967295),type:e+(r.__dir__<0?"Right":"")}),r},In.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),ut(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;In.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Ki(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),ut(["head","last"],(function(e,t){var n="take"+(t?"Right":"");In.prototype[e]=function(){return this[n](1).value()[0]}})),ut(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");In.prototype[e]=function(){return this.__filtered__?new In(this):this[n](1)}})),In.prototype.compact=function(){return this.filter(Ga)},In.prototype.find=function(e){return this.filter(e).head()},In.prototype.findLast=function(e){return this.reverse().find(e)},In.prototype.invokeMap=Br((function(e,t){return"function"==typeof e?new In(this):this.map((function(n){return _r(n,e,t)}))})),In.prototype.reject=function(e){return this.filter(Cu(Ki(e)))},In.prototype.slice=function(e,t){e=ra(e);var n=this;return n.__filtered__&&(e>0||t<0)?new In(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=ra(t))<0?n.dropRight(-t):n.take(t-e)),n)},In.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},In.prototype.toArray=function(){return this.take(4294967295)},lr(In.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=xn[r?"take"+("last"==t?"Right":""):t],o=r||/^find/.test(t);i&&(xn.prototype[t]=function(){var t=this.__wrapped__,u=r?[1]:arguments,a=t instanceof In,l=u[0],s=a||Ru(t),c=function(e){var t=i.apply(xn,pt([e],u));return r&&f?t[0]:t};s&&n&&"function"==typeof l&&1!=l.length&&(a=s=!1);var f=this.__chain__,d=!!this.__actions__.length,p=o&&!f,h=a&&!d;if(!o&&s){t=h?t:new In(this);var v=e.apply(t,u);return v.__actions__.push({func:nu,args:[c],thisArg:void 0}),new Mn(v,f)}return p&&h?e.apply(this,u):(v=this.thru(c),p?r?v.value()[0]:v.value():v)})})),ut(["pop","push","shift","sort","splice","unshift"],(function(e){var t=ye[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);xn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ru(i)?i:[],e)}return this[n]((function(n){return t.apply(Ru(n)?n:[],e)}))}})),lr(In.prototype,(function(e,t){var n=xn[t];if(n){var r=n.name+"";Ce.call(yn,r)||(yn[r]=[]),yn[r].push({name:t,func:n})}})),yn[xi(void 0,2).name]=[{name:"wrapper",func:void 0}],In.prototype.clone=function(){var e=new In(this.__wrapped__);return e.__actions__=gi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=gi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=gi(this.__views__),e},In.prototype.reverse=function(){if(this.__filtered__){var e=new In(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},In.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ru(e),r=t<0,i=n?e.length:0,o=function(e,t,n){var r=-1,i=n.length;for(;++r=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},xn.prototype.plant=function(e){for(var t,n=this;n instanceof On;){var r=xo(n);r.__index__=0,r.__values__=void 0,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t},xn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof In){var t=e;return this.__actions__.length&&(t=new In(this)),(t=t.reverse()).__actions__.push({func:nu,args:[Ho],thisArg:void 0}),new Mn(t,this.__chain__)}return this.thru(Ho)},xn.prototype.toJSON=xn.prototype.valueOf=xn.prototype.value=function(){return ni(this.__wrapped__,this.__actions__)},xn.prototype.first=xn.prototype.head,gt&&(xn.prototype[gt]=function(){return this}),xn}();Ge._=qt,void 0===(r=function(){return qt}.call(t,n,t,e))||(e.exports=r)}.call(this)},1573:e=>{"use strict";const t=(e,t)=>{for(const n of Reflect.ownKeys(t))Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n));return e};e.exports=t,e.exports.default=t},9381:e=>{"use strict"; +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,o){for(var u,a,l=i(e),s=1;s{"use strict";const r=n(1573),i=new WeakMap,o=(e,t={})=>{if("function"!=typeof e)throw new TypeError("Expected a function");let n,o=!1,u=0;const a=e.displayName||e.name||"",l=function(...r){if(i.set(l,++u),o){if(!0===t.throw)throw new Error(`Function \`${a}\` can only be called once`);return n}return o=!0,n=e.apply(this,r),e=null,n};return r(l,e),i.set(l,u),l};e.exports=o,e.exports.default=o,e.exports.callCount=e=>{if(!i.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return i.get(e)}},8070:(e,t,n)=>{"use strict";const r=n(2413),i=["assert","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"];let o={};e.exports=e=>{const t=new r.PassThrough,n=new r.PassThrough;t.write=t=>e("stdout",t),n.write=t=>e("stderr",t);const u=new console.Console(t,n);for(const e of i)o[e]=console[e],console[e]=u[e];return()=>{for(const e of i)console[e]=o[e];o={}}}},5187:e=>{window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=20)}([function(e,t,n){"use strict";e.exports=n(12)},function(e,t,n){"use strict"; +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function u(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,l=u(e),s=1;s=t||n<0||f&&e-s>=o}function w(){var e=h();if(b(e))return E(e);a=setTimeout(w,function(e){var n=t-(e-l);return f?p(n,o-(e-s)):n}(e))}function E(e){return a=void 0,m&&r?_(e):(r=i=void 0,u)}function D(){var e=h(),n=b(e);if(r=arguments,i=this,l=e,n){if(void 0===a)return y(l);if(f)return a=setTimeout(w,t),_(l)}return void 0===a&&(a=setTimeout(w,t)),u}return t=g(t)||0,v(n)&&(c=!!n.leading,o=(f="maxWait"in n)?d(g(n.maxWait)||0,t):o,m="trailing"in n?!!n.trailing:m),D.cancel=function(){void 0!==a&&clearTimeout(a),s=0,r=l=i=a=void 0},D.flush=function(){return void 0===a?u:E(h())},D}(e,t,{leading:r,maxWait:t,trailing:i})}}).call(this,n(4))},function(e,t,n){(function(n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i;t=e.exports=p,i="object"===(void 0===n?"undefined":r(n))&&n.env&&n.env.NODE_DEBUG&&/\bsemver\b/i.test(n.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var o=Number.MAX_SAFE_INTEGER||9007199254740991,u=t.re=[],a=t.src=[],l=t.tokens={},s=0;function c(e){l[e]=s++}c("NUMERICIDENTIFIER"),a[l.NUMERICIDENTIFIER]="0|[1-9]\\d*",c("NUMERICIDENTIFIERLOOSE"),a[l.NUMERICIDENTIFIERLOOSE]="[0-9]+",c("NONNUMERICIDENTIFIER"),a[l.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*",c("MAINVERSION"),a[l.MAINVERSION]="("+a[l.NUMERICIDENTIFIER]+")\\.("+a[l.NUMERICIDENTIFIER]+")\\.("+a[l.NUMERICIDENTIFIER]+")",c("MAINVERSIONLOOSE"),a[l.MAINVERSIONLOOSE]="("+a[l.NUMERICIDENTIFIERLOOSE]+")\\.("+a[l.NUMERICIDENTIFIERLOOSE]+")\\.("+a[l.NUMERICIDENTIFIERLOOSE]+")",c("PRERELEASEIDENTIFIER"),a[l.PRERELEASEIDENTIFIER]="(?:"+a[l.NUMERICIDENTIFIER]+"|"+a[l.NONNUMERICIDENTIFIER]+")",c("PRERELEASEIDENTIFIERLOOSE"),a[l.PRERELEASEIDENTIFIERLOOSE]="(?:"+a[l.NUMERICIDENTIFIERLOOSE]+"|"+a[l.NONNUMERICIDENTIFIER]+")",c("PRERELEASE"),a[l.PRERELEASE]="(?:-("+a[l.PRERELEASEIDENTIFIER]+"(?:\\."+a[l.PRERELEASEIDENTIFIER]+")*))",c("PRERELEASELOOSE"),a[l.PRERELEASELOOSE]="(?:-?("+a[l.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+a[l.PRERELEASEIDENTIFIERLOOSE]+")*))",c("BUILDIDENTIFIER"),a[l.BUILDIDENTIFIER]="[0-9A-Za-z-]+",c("BUILD"),a[l.BUILD]="(?:\\+("+a[l.BUILDIDENTIFIER]+"(?:\\."+a[l.BUILDIDENTIFIER]+")*))",c("FULL"),c("FULLPLAIN"),a[l.FULLPLAIN]="v?"+a[l.MAINVERSION]+a[l.PRERELEASE]+"?"+a[l.BUILD]+"?",a[l.FULL]="^"+a[l.FULLPLAIN]+"$",c("LOOSEPLAIN"),a[l.LOOSEPLAIN]="[v=\\s]*"+a[l.MAINVERSIONLOOSE]+a[l.PRERELEASELOOSE]+"?"+a[l.BUILD]+"?",c("LOOSE"),a[l.LOOSE]="^"+a[l.LOOSEPLAIN]+"$",c("GTLT"),a[l.GTLT]="((?:<|>)?=?)",c("XRANGEIDENTIFIERLOOSE"),a[l.XRANGEIDENTIFIERLOOSE]=a[l.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",c("XRANGEIDENTIFIER"),a[l.XRANGEIDENTIFIER]=a[l.NUMERICIDENTIFIER]+"|x|X|\\*",c("XRANGEPLAIN"),a[l.XRANGEPLAIN]="[v=\\s]*("+a[l.XRANGEIDENTIFIER]+")(?:\\.("+a[l.XRANGEIDENTIFIER]+")(?:\\.("+a[l.XRANGEIDENTIFIER]+")(?:"+a[l.PRERELEASE]+")?"+a[l.BUILD]+"?)?)?",c("XRANGEPLAINLOOSE"),a[l.XRANGEPLAINLOOSE]="[v=\\s]*("+a[l.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+a[l.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+a[l.XRANGEIDENTIFIERLOOSE]+")(?:"+a[l.PRERELEASELOOSE]+")?"+a[l.BUILD]+"?)?)?",c("XRANGE"),a[l.XRANGE]="^"+a[l.GTLT]+"\\s*"+a[l.XRANGEPLAIN]+"$",c("XRANGELOOSE"),a[l.XRANGELOOSE]="^"+a[l.GTLT]+"\\s*"+a[l.XRANGEPLAINLOOSE]+"$",c("COERCE"),a[l.COERCE]="(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])",c("COERCERTL"),u[l.COERCERTL]=new RegExp(a[l.COERCE],"g"),c("LONETILDE"),a[l.LONETILDE]="(?:~>?)",c("TILDETRIM"),a[l.TILDETRIM]="(\\s*)"+a[l.LONETILDE]+"\\s+",u[l.TILDETRIM]=new RegExp(a[l.TILDETRIM],"g"),c("TILDE"),a[l.TILDE]="^"+a[l.LONETILDE]+a[l.XRANGEPLAIN]+"$",c("TILDELOOSE"),a[l.TILDELOOSE]="^"+a[l.LONETILDE]+a[l.XRANGEPLAINLOOSE]+"$",c("LONECARET"),a[l.LONECARET]="(?:\\^)",c("CARETTRIM"),a[l.CARETTRIM]="(\\s*)"+a[l.LONECARET]+"\\s+",u[l.CARETTRIM]=new RegExp(a[l.CARETTRIM],"g"),c("CARET"),a[l.CARET]="^"+a[l.LONECARET]+a[l.XRANGEPLAIN]+"$",c("CARETLOOSE"),a[l.CARETLOOSE]="^"+a[l.LONECARET]+a[l.XRANGEPLAINLOOSE]+"$",c("COMPARATORLOOSE"),a[l.COMPARATORLOOSE]="^"+a[l.GTLT]+"\\s*("+a[l.LOOSEPLAIN]+")$|^$",c("COMPARATOR"),a[l.COMPARATOR]="^"+a[l.GTLT]+"\\s*("+a[l.FULLPLAIN]+")$|^$",c("COMPARATORTRIM"),a[l.COMPARATORTRIM]="(\\s*)"+a[l.GTLT]+"\\s*("+a[l.LOOSEPLAIN]+"|"+a[l.XRANGEPLAIN]+")",u[l.COMPARATORTRIM]=new RegExp(a[l.COMPARATORTRIM],"g"),c("HYPHENRANGE"),a[l.HYPHENRANGE]="^\\s*("+a[l.XRANGEPLAIN]+")\\s+-\\s+("+a[l.XRANGEPLAIN]+")\\s*$",c("HYPHENRANGELOOSE"),a[l.HYPHENRANGELOOSE]="^\\s*("+a[l.XRANGEPLAINLOOSE]+")\\s+-\\s+("+a[l.XRANGEPLAINLOOSE]+")\\s*$",c("STAR"),a[l.STAR]="(<|>)?=?\\s*\\*";for(var f=0;f256)return null;if(!(t.loose?u[l.LOOSE]:u[l.FULL]).test(e))return null;try{return new p(e,t)}catch(e){return null}}function p(e,t){if(t&&"object"===r(t)||(t={loose:!!t,includePrerelease:!1}),e instanceof p){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof p))return new p(e,t);i("SemVer",e,t),this.options=t,this.loose=!!t.loose;var n=e.trim().match(t.loose?u[l.LOOSE]:u[l.FULL]);if(!n)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,n,r){"string"==typeof n&&(r=n,n=void 0);try{return new p(e,n).inc(t,r).version}catch(e){return null}},t.diff=function(e,t){if(y(e,t))return null;var n=d(e),r=d(t),i="";if(n.prerelease.length||r.prerelease.length){i="pre";var o="prerelease"}for(var u in n)if(("major"===u||"minor"===u||"patch"===u)&&n[u]!==r[u])return i+u;return o},t.compareIdentifiers=v;var h=/^[0-9]+$/;function v(e,t){var n=h.test(e),r=h.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e0}function _(e,t,n){return m(e,t,n)<0}function y(e,t,n){return 0===m(e,t,n)}function b(e,t,n){return 0!==m(e,t,n)}function w(e,t,n){return m(e,t,n)>=0}function E(e,t,n){return m(e,t,n)<=0}function D(e,t,n,i){switch(t){case"===":return"object"===r(e)&&(e=e.version),"object"===r(n)&&(n=n.version),e===n;case"!==":return"object"===r(e)&&(e=e.version),"object"===r(n)&&(n=n.version),e!==n;case"":case"=":case"==":return y(e,n,i);case"!=":return b(e,n,i);case">":return g(e,n,i);case">=":return w(e,n,i);case"<":return _(e,n,i);case"<=":return E(e,n,i);default:throw new TypeError("Invalid operator: "+t)}}function C(e,t){if(t&&"object"===r(t)||(t={loose:!!t,includePrerelease:!1}),e instanceof C){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof C))return new C(e,t);i("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===k?this.value="":this.value=this.operator+this.semver.version,i("comp",this)}t.rcompareIdentifiers=function(e,t){return v(t,e)},t.major=function(e,t){return new p(e,t).major},t.minor=function(e,t){return new p(e,t).minor},t.patch=function(e,t){return new p(e,t).patch},t.compare=m,t.compareLoose=function(e,t){return m(e,t,!0)},t.compareBuild=function(e,t,n){var r=new p(e,n),i=new p(t,n);return r.compare(i)||r.compareBuild(i)},t.rcompare=function(e,t,n){return m(t,e,n)},t.sort=function(e,n){return e.sort((function(e,r){return t.compareBuild(e,r,n)}))},t.rsort=function(e,n){return e.sort((function(e,r){return t.compareBuild(r,e,n)}))},t.gt=g,t.lt=_,t.eq=y,t.neq=b,t.gte=w,t.lte=E,t.cmp=D,t.Comparator=C;var k={};function S(e,t){if(t&&"object"===r(t)||(t={loose:!!t,includePrerelease:!1}),e instanceof S)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new S(e.raw,t);if(e instanceof C)return new S(e.value,t);if(!(this instanceof S))return new S(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function T(e,t){for(var n=!0,r=e.slice(),i=r.pop();n&&r.length;)n=r.every((function(e){return i.intersects(e,t)})),i=r.pop();return n}function x(e){return!e||"x"===e.toLowerCase()||"*"===e}function A(e,t,n,r,i,o,u,a,l,s,c,f,d){return((t=x(n)?"":x(r)?">="+n+".0.0":x(i)?">="+n+"."+r+".0":">="+t)+" "+(a=x(l)?"":x(s)?"<"+(+l+1)+".0.0":x(c)?"<"+l+"."+(+s+1)+".0":f?"<="+l+"."+s+"."+c+"-"+f:"<="+a)).trim()}function O(e,t,n){for(var r=0;r0){var o=e[r].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch)return!0}return!1}return!0}function M(e,t,n){try{t=new S(t,n)}catch(e){return!1}return t.test(e)}function I(e,t,n,r){var i,o,u,a,l;switch(e=new p(e,r),t=new S(t,r),n){case">":i=g,o=E,u=_,a=">",l=">=";break;case"<":i=_,o=w,u=g,a="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(M(e,t,r))return!1;for(var s=0;s=0.0.0")),f=f||e,d=d||e,i(e.semver,f.semver,r)?f=e:u(e.semver,d.semver,r)&&(d=e)})),f.operator===a||f.operator===l)return!1;if((!d.operator||d.operator===a)&&o(e,d.semver))return!1;if(d.operator===l&&u(e,d.semver))return!1}return!0}C.prototype.parse=function(e){var t=this.options.loose?u[l.COMPARATORLOOSE]:u[l.COMPARATOR],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new p(n[2],this.options.loose):this.semver=k},C.prototype.toString=function(){return this.value},C.prototype.test=function(e){if(i("Comparator.test",e,this.options.loose),this.semver===k||e===k)return!0;if("string"==typeof e)try{e=new p(e,this.options)}catch(e){return!1}return D(e,this.operator,this.semver,this.options)},C.prototype.intersects=function(e,t){if(!(e instanceof C))throw new TypeError("a Comparator is required");var n;if(t&&"object"===r(t)||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||(n=new S(e.value,t),M(this.value,n,t));if(""===e.operator)return""===e.value||(n=new S(this.value,t),M(e.semver,n,t));var i=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),u=this.semver.version===e.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),l=D(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),s=D(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return i||o||u&&a||l||s},t.Range=S,S.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},S.prototype.toString=function(){return this.range},S.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var n=t?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];e=e.replace(n,A),i("hyphen replace",e),e=e.replace(u[l.COMPARATORTRIM],"$1$2$3"),i("comparator trim",e,u[l.COMPARATORTRIM]),e=(e=(e=e.replace(u[l.TILDETRIM],"$1~")).replace(u[l.CARETTRIM],"$1^")).split(/\s+/).join(" ");var r=t?u[l.COMPARATORLOOSE]:u[l.COMPARATOR],o=e.split(" ").map((function(e){return function(e,t){return i("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){i("caret",e,t);var n=t.loose?u[l.CARETLOOSE]:u[l.CARET];return e.replace(n,(function(t,n,r,o,u){var a;return i("caret",e,t,n,r,o,u),x(n)?a="":x(r)?a=">="+n+".0.0 <"+(+n+1)+".0.0":x(o)?a="0"===n?">="+n+"."+r+".0 <"+n+"."+(+r+1)+".0":">="+n+"."+r+".0 <"+(+n+1)+".0.0":u?(i("replaceCaret pr",u),a="0"===n?"0"===r?">="+n+"."+r+"."+o+"-"+u+" <"+n+"."+r+"."+(+o+1):">="+n+"."+r+"."+o+"-"+u+" <"+n+"."+(+r+1)+".0":">="+n+"."+r+"."+o+"-"+u+" <"+(+n+1)+".0.0"):(i("no pr"),a="0"===n?"0"===r?">="+n+"."+r+"."+o+" <"+n+"."+r+"."+(+o+1):">="+n+"."+r+"."+o+" <"+n+"."+(+r+1)+".0":">="+n+"."+r+"."+o+" <"+(+n+1)+".0.0"),i("caret return",a),a}))}(e,t)})).join(" ")}(e,t),i("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var n=t.loose?u[l.TILDELOOSE]:u[l.TILDE];return e.replace(n,(function(t,n,r,o,u){var a;return i("tilde",e,t,n,r,o,u),x(n)?a="":x(r)?a=">="+n+".0.0 <"+(+n+1)+".0.0":x(o)?a=">="+n+"."+r+".0 <"+n+"."+(+r+1)+".0":u?(i("replaceTilde pr",u),a=">="+n+"."+r+"."+o+"-"+u+" <"+n+"."+(+r+1)+".0"):a=">="+n+"."+r+"."+o+" <"+n+"."+(+r+1)+".0",i("tilde return",a),a}))}(e,t)})).join(" ")}(e,t),i("tildes",e),e=function(e,t){return i("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var n=t.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return e.replace(n,(function(n,r,o,u,a,l){i("xRange",e,n,r,o,u,a,l);var s=x(o),c=s||x(u),f=c||x(a),d=f;return"="===r&&d&&(r=""),l=t.includePrerelease?"-0":"",s?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(c&&(u=0),a=0,">"===r?(r=">=",c?(o=+o+1,u=0,a=0):(u=+u+1,a=0)):"<="===r&&(r="<",c?o=+o+1:u=+u+1),n=r+o+"."+u+"."+a+l):c?n=">="+o+".0.0"+l+" <"+(+o+1)+".0.0"+l:f&&(n=">="+o+"."+u+".0"+l+" <"+o+"."+(+u+1)+".0"+l),i("xRange return",n),n}))}(e,t)})).join(" ")}(e,t),i("xrange",e),e=function(e,t){return i("replaceStars",e,t),e.trim().replace(u[l.STAR],"")}(e,t),i("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(o=o.filter((function(e){return!!e.match(r)}))),o.map((function(e){return new C(e,this.options)}),this)},S.prototype.intersects=function(e,t){if(!(e instanceof S))throw new TypeError("a Range is required");return this.set.some((function(n){return T(n,t)&&e.set.some((function(e){return T(e,t)&&n.every((function(n){return e.every((function(e){return n.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new S(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},S.prototype.test=function(e){if(!e)return!1;if("string"==typeof e)try{e=new p(e,this.options)}catch(e){return!1}for(var t=0;t":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!g(n,t)||(n=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}));return n&&e.test(n)?n:null},t.validRange=function(e,t){try{return new S(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,n){return I(e,t,"<",n)},t.gtr=function(e,t,n){return I(e,t,">",n)},t.outside=I,t.prerelease=function(e,t){var n=d(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new S(e,n),t=new S(t,n),e.intersects(t)},t.coerce=function(e,t){if(e instanceof p)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;var n=null;if((t=t||{}).rtl){for(var r;(r=u[l.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),u[l.COERCERTL].lastIndex=r.index+r[1].length+r[2].length;u[l.COERCERTL].lastIndex=-1}else n=e.match(u[l.COERCE]);return null===n?null:d(n[2]+"."+(n[3]||"0")+"."+(n[4]||"0"),t)}}).call(this,n(5))},function(e,t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"===("undefined"==typeof window?"undefined":n(window))&&(r=window)}e.exports=r},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(e){r=u}}();var l,s=[],c=!1,f=-1;function d(){c&&l&&(c=!1,l.length?s=l.concat(s):f=-1,s.length&&p())}function p(){if(!c){var e=a(d);c=!0;for(var t=s.length;t;){for(l=s,s=[];++f1)for(var n=1;nthis[u])return w(this,this[h].get(e)),!1;var o=this[h].get(e).value;return this[f]&&(this[d]||this[f](e,o.value)),o.now=r,o.maxAge=n,o.value=t,this[a]+=i-o.length,o.length=i,this.get(e),b(this),!0}var s=new E(e,t,i,r,n);return s.length>this[u]?(this[f]&&this[f](e,t),!1):(this[a]+=s.length,this[p].unshift(s),this[h].set(e,this[p].head),b(this),!0)}},{key:"has",value:function(e){if(!this[h].has(e))return!1;var t=this[h].get(e).value;return!y(this,t)}},{key:"get",value:function(e){return _(this,e,!0)}},{key:"peek",value:function(e){return _(this,e,!1)}},{key:"pop",value:function(){var e=this[p].tail;return e?(w(this,e),e.value):null}},{key:"del",value:function(e){w(this,this[h].get(e))}},{key:"load",value:function(e){this.reset();for(var t=Date.now(),n=e.length-1;n>=0;n--){var r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{var o=i-t;o>0&&this.set(r.k,r.v,o)}}}},{key:"prune",value:function(){var e=this;this[h].forEach((function(t,n){return _(e,n,!1)}))}},{key:"max",set:function(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[u]=e||1/0,b(this)},get:function(){return this[u]}},{key:"allowStale",set:function(e){this[s]=!!e},get:function(){return this[s]}},{key:"maxAge",set:function(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[c]=e,b(this)},get:function(){return this[c]}},{key:"lengthCalculator",set:function(e){var t=this;"function"!=typeof e&&(e=m),e!==this[l]&&(this[l]=e,this[a]=0,this[p].forEach((function(e){e.length=t[l](e.value,e.key),t[a]+=e.length}))),b(this)},get:function(){return this[l]}},{key:"length",get:function(){return this[a]}},{key:"itemCount",get:function(){return this[p].length}}])&&i(t.prototype,n),e}(),_=function(e,t,n){var r=e[h].get(t);if(r){var i=r.value;if(y(e,i)){if(w(e,r),!e[s])return}else n&&(e[v]&&(r.value.now=Date.now()),e[p].unshiftNode(r));return i.value}},y=function(e,t){if(!t||!t.maxAge&&!e[c])return!1;var n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[c]&&n>e[c]},b=function(e){if(e[a]>e[u])for(var t=e[p].tail;e[a]>e[u]&&null!==t;){var n=t.prev;w(e,t),t=n}},w=function(e,t){if(t){var n=t.value;e[f]&&e[f](n.key,n.value),e[a]-=n.length,e[h].delete(n.key),e[p].removeNode(t)}},E=function e(t,n,i,o,u){r(this,e),this.key=t,this.value=n,this.length=i,this.now=o,this.maxAge=u||0},D=function(e,t,n,r){var i=n.value;y(e,i)&&(w(e,n),e[s]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};e.exports=g},function(e,t,n){(function(t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=function(){if("undefined"==typeof document||!document.addEventListener)return null;var r,i,o,u={};return u.copy=function(){var e=!1,t=null,n=!1;function r(){e=!1,t=null,n&&window.getSelection().removeAllRanges(),n=!1}return document.addEventListener("copy",(function(n){if(e){for(var r in t)n.clipboardData.setData(r,t[r]);n.preventDefault()}})),function(i){return new Promise((function(o,u){e=!0,"string"==typeof i?t={"text/plain":i}:i instanceof Node?t={"text/html":(new XMLSerializer).serializeToString(i)}:i instanceof Object?t=i:u("Invalid data type. Must be string, DOM node, or an object mapping MIME types to strings."),function e(t){try{if(document.execCommand("copy"))r(),o();else{if(t)throw r(),new Error("Unable to copy. Perhaps it's not available in your browser?");!function(){var e=document.getSelection();if(!document.queryCommandEnabled("copy")&&e.isCollapsed){var t=document.createRange();t.selectNodeContents(document.body),e.removeAllRanges(),e.addRange(t),n=!0}}(),e(!0)}}catch(e){r(),u(e)}}(!1)}))}}(),u.paste=(o=!1,document.addEventListener("paste",(function(e){if(o){o=!1,e.preventDefault();var t=r;r=null,t(e.clipboardData.getData(i))}})),function(e){return new Promise((function(t,n){o=!0,r=t,i=e||"text/plain";try{document.execCommand("paste")||(o=!1,n(new Error("Unable to paste. Pasting only works in Internet Explorer at the moment.")))}catch(e){o=!1,n(new Error(e))}}))}),"undefined"==typeof ClipboardEvent&&void 0!==window.clipboardData&&void 0!==window.clipboardData.setData&&( +/*! promise-polyfill 2.0.1 */ +function(r){function i(e,t){return function(){e.apply(t,arguments)}}function o(e){if("object"!=n(this))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],f(e,i(a,this),i(l,this))}function u(e){var t=this;return null===this._state?void this._deferreds.push(e):void d((function(){var n=t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void e.reject(t)}e.resolve(r)}else(t._state?e.resolve:e.reject)(t._value)}))}function a(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==n(e)||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void f(i(t,e),i(a,this),i(l,this))}this._state=!0,this._value=e,s.call(this)}catch(e){l.call(this,e)}}function l(e){this._state=!1,this._value=e,s.call(this)}function s(){for(var e=0,t=this._deferreds.length;t>e;e++)u.call(this,this._deferreds[e]);this._deferreds=null}function c(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function f(e,t,n){var r=!1;try{e((function(e){r||(r=!0,t(e))}),(function(e){r||(r=!0,n(e))}))}catch(e){if(r)return;r=!0,n(e)}}var d=o.immediateFn||"function"==typeof t&&t||function(e){setTimeout(e,1)},p=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};o.prototype.catch=function(e){return this.then(null,e)},o.prototype.then=function(e,t){var n=this;return new o((function(r,i){u.call(n,new c(e,t,r,i))}))},o.all=function(){var e=Array.prototype.slice.call(1===arguments.length&&p(arguments[0])?arguments[0]:arguments);return new o((function(t,r){function i(u,a){try{if(a&&("object"==n(a)||"function"==typeof a)){var l=a.then;if("function"==typeof l)return void l.call(a,(function(e){i(u,e)}),r)}e[u]=a,0==--o&&t(e)}catch(e){r(e)}}if(0===e.length)return t([]);for(var o=e.length,u=0;ur;r++)e[r].then(t,n)}))},e.exports?e.exports=o:r.Promise||(r.Promise=o)}(this),u.copy=function(e){return new Promise((function(t,n){if("string"!=typeof e&&!("text/plain"in e))throw new Error("You must provide a text/plain type.");var r="string"==typeof e?e:e["text/plain"];window.clipboardData.setData("Text",r)?t():n(new Error("Copying was rejected."))}))},u.paste=function(){return new Promise((function(e,t){var n=window.clipboardData.getData("Text");n?e(n):t(new Error("Pasting was rejected."))}))}),u}()}).call(this,n(13).setImmediate)},function(e,t,n){"use strict";e.exports=n(15)},function(e,t,n){"use strict";n.r(t),t.default=":root {\n /**\n * IMPORTANT: When new theme variables are added below– also add them to SettingsContext updateThemeVariables()\n */\n\n /* Light theme */\n --light-color-attribute-name: #ef6632;\n --light-color-attribute-name-not-editable: #23272f;\n --light-color-attribute-name-inverted: rgba(255, 255, 255, 0.7);\n --light-color-attribute-value: #1a1aa6;\n --light-color-attribute-value-inverted: #ffffff;\n --light-color-attribute-editable-value: #1a1aa6;\n --light-color-background: #ffffff;\n --light-color-background-hover: rgba(0, 136, 250, 0.1);\n --light-color-background-inactive: #e5e5e5;\n --light-color-background-invalid: #fff0f0;\n --light-color-background-selected: #0088fa;\n --light-color-button-background: #ffffff;\n --light-color-button-background-focus: #ededed;\n --light-color-button: #5f6673;\n --light-color-button-disabled: #cfd1d5;\n --light-color-button-active: #0088fa;\n --light-color-button-focus: #23272f;\n --light-color-button-hover: #23272f;\n --light-color-border: #eeeeee;\n --light-color-commit-did-not-render-fill: #cfd1d5;\n --light-color-commit-did-not-render-fill-text: #000000;\n --light-color-commit-did-not-render-pattern: #cfd1d5;\n --light-color-commit-did-not-render-pattern-text: #333333;\n --light-color-commit-gradient-0: #37afa9;\n --light-color-commit-gradient-1: #63b19e;\n --light-color-commit-gradient-2: #80b393;\n --light-color-commit-gradient-3: #97b488;\n --light-color-commit-gradient-4: #abb67d;\n --light-color-commit-gradient-5: #beb771;\n --light-color-commit-gradient-6: #cfb965;\n --light-color-commit-gradient-7: #dfba57;\n --light-color-commit-gradient-8: #efbb49;\n --light-color-commit-gradient-9: #febc38;\n --light-color-commit-gradient-text: #000000;\n --light-color-component-name: #6a51b2;\n --light-color-component-name-inverted: #ffffff;\n --light-color-component-badge-background: rgba(0, 0, 0, 0.1);\n --light-color-component-badge-background-inverted: rgba(255, 255, 255, 0.25);\n --light-color-component-badge-count: #777d88;\n --light-color-component-badge-count-inverted: rgba(255, 255, 255, 0.7);\n --light-color-context-background: rgba(0,0,0,.9);\n --light-color-context-background-hover: rgba(255, 255, 255, 0.1);\n --light-color-context-background-selected: #178fb9;\n --light-color-context-border: #3d424a;\n --light-color-context-text: #ffffff;\n --light-color-context-text-selected: #ffffff;\n --light-color-dim: #777d88;\n --light-color-dimmer: #cfd1d5;\n --light-color-dimmest: #eff0f1;\n --light-color-error-background: hsl(0, 100%, 97%);\n --light-color-error-border: hsl(0, 100%, 92%);\n --light-color-error-text: #ff0000;\n --light-color-expand-collapse-toggle: #777d88;\n --light-color-link: #0000ff;\n --light-color-modal-background: rgba(255, 255, 255, 0.75);\n --light-color-record-active: #fc3a4b;\n --light-color-record-hover: #3578e5;\n --light-color-record-inactive: #0088fa;\n --light-color-scroll-thumb: #c2c2c2;\n --light-color-scroll-track: #fafafa;\n --light-color-search-match: yellow;\n --light-color-search-match-current: #f7923b;\n --light-color-selected-tree-highlight-active: rgba(0, 136, 250, 0.1);\n --light-color-selected-tree-highlight-inactive: rgba(0, 0, 0, 0.05);\n --light-color-shadow: rgba(0, 0, 0, 0.25);\n --light-color-tab-selected-border: #0088fa;\n --light-color-text: #000000;\n --light-color-text-invalid: #ff0000;\n --light-color-text-selected: #ffffff;\n --light-color-toggle-background-invalid: #fc3a4b;\n --light-color-toggle-background-on: #0088fa;\n --light-color-toggle-background-off: #cfd1d5;\n --light-color-toggle-text: #ffffff;\n --light-color-tooltip-background: rgba(0, 0, 0, 0.9);\n --light-color-tooltip-text: #ffffff;\n\n /* Dark theme */\n --dark-color-attribute-name: #9d87d2;\n --dark-color-attribute-name-not-editable: #ededed;\n --dark-color-attribute-name-inverted: #282828;\n --dark-color-attribute-value: #cedae0;\n --dark-color-attribute-value-inverted: #ffffff;\n --dark-color-attribute-editable-value: yellow;\n --dark-color-background: #282c34;\n --dark-color-background-hover: rgba(255, 255, 255, 0.1);\n --dark-color-background-inactive: #3d424a;\n --dark-color-background-invalid: #5c0000;\n --dark-color-background-selected: #178fb9;\n --dark-color-button-background: #282c34;\n --dark-color-button-background-focus: #3d424a;\n --dark-color-button: #afb3b9;\n --dark-color-button-active: #61dafb;\n --dark-color-button-disabled: #4f5766;\n --dark-color-button-focus: #a2e9fc;\n --dark-color-button-hover: #ededed;\n --dark-color-border: #3d424a;\n --dark-color-commit-did-not-render-fill: #777d88;\n --dark-color-commit-did-not-render-fill-text: #000000;\n --dark-color-commit-did-not-render-pattern: #666c77;\n --dark-color-commit-did-not-render-pattern-text: #ffffff;\n --dark-color-commit-gradient-0: #37afa9;\n --dark-color-commit-gradient-1: #63b19e;\n --dark-color-commit-gradient-2: #80b393;\n --dark-color-commit-gradient-3: #97b488;\n --dark-color-commit-gradient-4: #abb67d;\n --dark-color-commit-gradient-5: #beb771;\n --dark-color-commit-gradient-6: #cfb965;\n --dark-color-commit-gradient-7: #dfba57;\n --dark-color-commit-gradient-8: #efbb49;\n --dark-color-commit-gradient-9: #febc38;\n --dark-color-commit-gradient-text: #000000;\n --dark-color-component-name: #61dafb;\n --dark-color-component-name-inverted: #282828;\n --dark-color-component-badge-background: rgba(255, 255, 255, 0.25);\n --dark-color-component-badge-background-inverted: rgba(0, 0, 0, 0.25);\n --dark-color-component-badge-count: #8f949d;\n --dark-color-component-badge-count-inverted: rgba(255, 255, 255, 0.7);\n --dark-color-context-background: rgba(255,255,255,.9);\n --dark-color-context-background-hover: rgba(0, 136, 250, 0.1);\n --dark-color-context-background-selected: #0088fa;\n --dark-color-context-border: #eeeeee;\n --dark-color-context-text: #000000;\n --dark-color-context-text-selected: #ffffff;\n --dark-color-dim: #8f949d;\n --dark-color-dimmer: #777d88;\n --dark-color-dimmest: #4f5766;\n --dark-color-error-background: #200;\n --dark-color-error-border: #900;\n --dark-color-error-text: #f55;\n --dark-color-expand-collapse-toggle: #8f949d;\n --dark-color-link: #61dafb;\n --dark-color-modal-background: rgba(0, 0, 0, 0.75);\n --dark-color-record-active: #fc3a4b;\n --dark-color-record-hover: #a2e9fc;\n --dark-color-record-inactive: #61dafb;\n --dark-color-scroll-thumb: #afb3b9;\n --dark-color-scroll-track: #313640;\n --dark-color-search-match: yellow;\n --dark-color-search-match-current: #f7923b;\n --dark-color-selected-tree-highlight-active: rgba(23, 143, 185, 0.15);\n --dark-color-selected-tree-highlight-inactive: rgba(255, 255, 255, 0.05);\n --dark-color-shadow: rgba(0, 0, 0, 0.5);\n --dark-color-tab-selected-border: #178fb9;\n --dark-color-text: #ffffff;\n --dark-color-text-invalid: #ff8080;\n --dark-color-text-selected: #ffffff;\n --dark-color-toggle-background-invalid: #fc3a4b;\n --dark-color-toggle-background-on: #178fb9;\n --dark-color-toggle-background-off: #777d88;\n --dark-color-toggle-text: #ffffff;\n --dark-color-tooltip-background: rgba(255, 255, 255, 0.9);\n --dark-color-tooltip-text: #000000;\n\n /* Font smoothing */\n --light-font-smoothing: auto;\n --dark-font-smoothing: antialiased;\n --font-smoothing: auto;\n\n /* Compact density */\n --compact-font-size-monospace-small: 9px;\n --compact-font-size-monospace-normal: 11px;\n --compact-font-size-monospace-large: 15px;\n --compact-font-size-sans-small: 10px;\n --compact-font-size-sans-normal: 12px;\n --compact-font-size-sans-large: 14px;\n --compact-line-height-data: 18px;\n --compact-root-font-size: 16px;\n\n /* Comfortable density */\n --comfortable-font-size-monospace-small: 10px;\n --comfortable-font-size-monospace-normal: 13px;\n --comfortable-font-size-monospace-large: 17px;\n --comfortable-font-size-sans-small: 12px;\n --comfortable-font-size-sans-normal: 14px;\n --comfortable-font-size-sans-large: 16px;\n --comfortable-line-height-data: 22px;\n --comfortable-root-font-size: 20px;\n\n /* GitHub.com system fonts */\n --font-family-monospace: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo,\n Courier, monospace;\n --font-family-sans: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica,\n Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;\n\n /* Constant values shared between JS and CSS */\n --interaction-commit-size: 10px;\n --interaction-label-width: 200px;\n}\n"},function(e,t,n){"use strict";function r(e){var t=this;if(t instanceof r||(t=new r),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var n=0,i=arguments.length;n1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},r.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},r.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},r.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},r.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(tthis.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&ithis.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)n.push(o.value);return n},r.prototype.splice=function(e,t){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,r=this.head;null!==r&&n=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(14),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(4))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,i,o,u,a,l=1,s={},c=!1,f=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){h(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(u="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(u)&&h(+t.data.slice(u.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),r=function(t){e.postMessage(u+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){o.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(i=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(h,0,e)},d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;nv;v++)if(-1!==(h=g(p,c,v))){m=v,c=h;break e}c=-1}}e:{if(p=f,void 0!==(h=d().get(s.primitive)))for(v=0;vc-p?null:f.slice(p,c-1))){if(c=0,null!==r){for(;cc;r--)i=a.pop()}for(r=f.length-c-1;1<=r;r--)c=[],i.push({id:null,isStateEditable:!1,name:y(f[r-1].functionName),value:void 0,subHooks:c}),a.push(i),i=c;r=f}c="Context"===(f=s.primitive)||"DebugValue"===f?null:u++,i.push({id:c,isStateEditable:"Reducer"===f||"State"===f,name:f,value:s.value,subHooks:[]})}return function e(t,n){for(var r=[],i=0;i-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var n=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=n.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(n=r?n.replace(r[0],""):n).split(/\s+/).slice(1),o=this.extractLocation(r?r[1]:i.pop()),u=i.join(" ")||void 0,a=["eval",""].indexOf(o[0])>-1?void 0:o[0];return new e({functionName:u,fileName:a,lineNumber:o[1],columnNumber:o[2],source:t})}),this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter((function(e){return!e.match(r)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new e({functionName:t});var n=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(n),i=r&&r[1]?r[1]:void 0,o=this.extractLocation(t.replace(n,""));return new e({functionName:i,fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:t})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(t){for(var n=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],o=2,u=r.length;o/,"$2").replace(/\([^)]*\)/g,"")||void 0;o.match(/\(([^)]*)\)/)&&(n=o.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var a=void 0===n||"[arguments not available]"===n?void 0:n.split(",");return new e({functionName:u,args:a,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:t})}),this)}}})?r.apply(t,i):r)||(e.exports=o)}()},function(e,t,n){var r,i,o;!function(n,u){"use strict";i=[],void 0===(o="function"==typeof(r=function(){function e(e){return e.charAt(0).toUpperCase()+e.substring(1)}function t(e){return function(){return this[e]}}var n=["isConstructor","isEval","isNative","isToplevel"],r=["columnNumber","lineNumber"],i=["fileName","functionName","source"],o=n.concat(r,i,["args"]);function u(t){if(t)for(var n=0;n1?n-1:0),i=1;i=0&&n.splice(r,1)}}}])&&r(t.prototype,n),e}(),o=n(2),u=n.n(o);try{var a=n(9).default,l=function(e){var t=new RegExp("".concat(e,": ([0-9]+)")),n=a.match(t);return parseInt(n[1],10)};l("comfortable-line-height-data"),l("compact-line-height-data")}catch(e){}function s(e){try{return sessionStorage.getItem(e)}catch(e){return null}}function c(e){try{sessionStorage.removeItem(e)}catch(e){}}function f(e,t){try{return sessionStorage.setItem(e,t)}catch(e){}}var d=function(e,t){return e===t},p=n(1),h=n.n(p);function v(e){return e.ownerDocument?e.ownerDocument.defaultView:null}function m(e){var t=v(e);return t?t.frameElement:null}function g(e){var t=b(e);return _([e.getBoundingClientRect(),{top:t.borderTop,left:t.borderLeft,bottom:t.borderBottom,right:t.borderRight,width:0,height:0}])}function _(e){return e.reduce((function(e,t){return null==e?t:{top:e.top+t.top,left:e.left+t.left,width:e.width,height:e.height,bottom:e.bottom+t.bottom,right:e.right+t.right}}))}function y(e,t){var n=m(e);if(n&&n!==t){for(var r=[e.getBoundingClientRect()],i=n,o=!1;i;){var u=g(i);if(r.push(u),i=m(i),o)break;i&&v(i)===t&&(o=!0)}return _(r)}return e.getBoundingClientRect()}function b(e){var t=window.getComputedStyle(e);return{borderLeft:parseInt(t.borderLeftWidth,10),borderRight:parseInt(t.borderRightWidth,10),borderTop:parseInt(t.borderTopWidth,10),borderBottom:parseInt(t.borderBottomWidth,10),marginLeft:parseInt(t.marginLeft,10),marginRight:parseInt(t.marginRight,10),marginTop:parseInt(t.marginTop,10),marginBottom:parseInt(t.marginBottom,10),paddingLeft:parseInt(t.paddingLeft,10),paddingRight:parseInt(t.paddingRight,10),paddingTop:parseInt(t.paddingTop,10),paddingBottom:parseInt(t.paddingBottom,10)}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nt.left+t.width&&(u=t.left+t.width-o-5),{style:{top:r+="px",left:u+="px"}}}(e,t,{width:n.width,height:n.height});h()(this.tip.style,r.style)}}]),e}(),T=function(){function e(){E(this,e);var t=window.__REACT_DEVTOOLS_TARGET_WINDOW__||window;this.window=t;var n=window.__REACT_DEVTOOLS_TARGET_WINDOW__||window;this.tipBoundsWindow=n;var r=t.document;this.container=r.createElement("div"),this.container.style.zIndex="10000000",this.tip=new S(r,this.container),this.rects=[],r.body.appendChild(this.container)}return C(e,[{key:"remove",value:function(){this.tip.remove(),this.rects.forEach((function(e){e.remove()})),this.rects.length=0,this.container.parentNode&&this.container.parentNode.removeChild(this.container)}},{key:"inspect",value:function(e,t){for(var n=this,r=e.filter((function(e){return e.nodeType===Node.ELEMENT_NODE}));this.rects.length>r.length;)this.rects.pop().remove();if(0!==r.length){for(;this.rects.length=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return u=e.done,e},e:function(e){a=!0,o=e},f:function(){try{u||null==n.return||n.return()}finally{if(a)throw o}}}}(u.rendererInterfaces.values());try{for(s.s();!(a=s.n()).done;){var c=a.value,f=c.getFiberIDForNative(o,!0);if(null!==f){l=c.getDisplayNameForFiberID(f,!0);break}}}catch(e){s.e(e)}finally{s.f()}l&&(t+=" (in "+l+")")}}this.tip.updateText(t,i.right-i.left,i.bottom-i.top);var d=y(this.tipBoundsWindow.document.documentElement,this.window);this.tip.updatePosition({top:i.top,left:i.left,height:i.bottom-i.top,width:i.right-i.left},{top:d.top+this.tipBoundsWindow.scrollY,left:d.left+this.tipBoundsWindow.scrollX,height:this.tipBoundsWindow.innerHeight,width:this.tipBoundsWindow.innerWidth})}}}]),e}();function x(e,t,n){h()(n.style,{borderTopWidth:e[t+"Top"]+"px",borderLeftWidth:e[t+"Left"]+"px",borderRightWidth:e[t+"Right"]+"px",borderBottomWidth:e[t+"Bottom"]+"px",borderStyle:"solid"})}var A={background:"rgba(120, 170, 210, 0.7)",padding:"rgba(77, 200, 0, 0.3)",margin:"rgba(255, 155, 0, 0.3)",border:"rgba(255, 200, 50, 0.3)"},O=null,M=null;function I(){O=null,null!==M&&(M.remove(),M=null)}function R(e,t,n){null!=window.document&&(null!==O&&clearTimeout(O),null!=e&&(null===M&&(M=new T),M.inspect(e,t),n&&(O=setTimeout(I,2e3))))}var N=new Set,P=["#37afa9","#63b19e","#80b393","#97b488","#abb67d","#beb771","#cfb965","#dfba57","#efbb49","#febc38"],F=null;function L(e){return(L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var B="object"===("undefined"==typeof performance?"undefined":L(performance))&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()},U=new Map,j=null,z=!1,W=null;function H(e){z&&(e.forEach((function(e){var t=U.get(e),n=B(),r=null!=t?t.lastMeasuredAt:0,i=null!=t?t.rect:null;(null===i||r+2505&&void 0!==arguments[5]?arguments[5]:0,a=me(e);switch(a){case"html_element":return t.push(r),{inspectable:!1,preview_short:ye(e,!1),preview_long:ye(e,!0),name:e.tagName,type:a};case"function":return t.push(r),{inspectable:!1,preview_short:ye(e,!1),preview_long:ye(e,!0),name:"function"!=typeof e.name&&e.name?e.name:"function",type:a};case"string":return e.length<=500?e:e.slice(0,500)+"...";case"bigint":case"symbol":return t.push(r),{inspectable:!1,preview_short:ye(e,!1),preview_long:ye(e,!0),name:e.toString(),type:a};case"react_element":return t.push(r),{inspectable:!1,preview_short:ye(e,!1),preview_long:ye(e,!0),name:ge(e)||"Unknown",type:a};case"array_buffer":case"data_view":return t.push(r),{inspectable:!1,preview_short:ye(e,!1),preview_long:ye(e,!0),name:"data_view"===a?"DataView":"ArrayBuffer",size:e.byteLength,type:a};case"array":return o=i(r),u>=2&&!o?Z(a,!0,e,t,r):e.map((function(e,a){return ee(e,t,n,r.concat([a]),i,o?1:u+1)}));case"html_all_collection":case"typed_array":case"iterator":if(o=i(r),u>=2&&!o)return Z(a,!0,e,t,r);var l={unserializable:!0,type:a,readonly:!0,size:"typed_array"===a?e.length:void 0,preview_short:ye(e,!1),preview_long:ye(e,!0),name:e.constructor&&"Object"!==e.constructor.name?e.constructor.name:""};return J(e[Symbol.iterator])&&Array.from(e).forEach((function(e,a){return l[a]=ee(e,t,n,r.concat([a]),i,o?1:u+1)})),n.push(r),l;case"opaque_iterator":return t.push(r),{inspectable:!1,preview_short:ye(e,!1),preview_long:ye(e,!0),name:e[Symbol.toStringTag],type:a};case"date":case"regexp":return t.push(r),{inspectable:!1,preview_short:ye(e,!1),preview_long:ye(e,!0),name:e.toString(),type:a};case"object":if(o=i(r),u>=2&&!o)return Z(a,!0,e,t,r);var s={};return ae(e).forEach((function(a){var l=a.toString();s[l]=ee(e[a],t,n,r.concat([l]),i,o?1:u+1)})),s;case"infinity":case"nan":case"undefined":return t.push(r),{type:a};default:return e}}function te(e){return(te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ne(e){return function(e){if(Array.isArray(e))return re(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return re(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?re(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function re(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nt.toString()?1:t.toString()>e.toString()?-1:0}function ae(e){for(var t=[],n=e,r=function(){var e=[].concat(ne(Object.keys(n)),ne(Object.getOwnPropertySymbols(n))),r=Object.getOwnPropertyDescriptors(n);e.forEach((function(e){r[e].enumerable&&t.push(e)})),n=Object.getPrototypeOf(n)};null!=n;)r();return t}function le(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Anonymous",n=ie.get(e);if(null!=n)return n;var r=t;return"string"==typeof e.displayName?r=e.displayName:"string"==typeof e.name&&""!==e.name&&(r=e.name),ie.set(e,r),r}var se=0;function ce(){return++se}function fe(e){var t=oe.get(e);if(void 0!==t)return t;for(var n=new Array(e.length),r=0;r1&&void 0!==arguments[1]?arguments[1]:50;return e.length>t?e.substr(0,t)+"…":e}function ye(e,t){if(null!=e&&hasOwnProperty.call(e,Q.type))return t?e[Q.preview_long]:e[Q.preview_short];switch(me(e)){case"html_element":return"<".concat(_e(e.tagName.toLowerCase())," />");case"function":return _e("ƒ ".concat("function"==typeof e.name?"":e.name,"() {}"));case"string":return'"'.concat(e,'"');case"bigint":return _e(e.toString()+"n");case"regexp":case"symbol":return _e(e.toString());case"react_element":return"<".concat(_e(ge(e)||"Unknown")," />");case"array_buffer":return"ArrayBuffer(".concat(e.byteLength,")");case"data_view":return"DataView(".concat(e.buffer.byteLength,")");case"array":if(t){for(var n="",r=0;r0&&(n+=", "),!((n+=ye(e[r],!1)).length>50));r++);return"[".concat(_e(n),"]")}var i=hasOwnProperty.call(e,Q.size)?e[Q.size]:e.length;return"Array(".concat(i,")");case"typed_array":var o="".concat(e.constructor.name,"(").concat(e.length,")");if(t){for(var u="",a=0;a0&&(u+=", "),!((u+=e[a]).length>50));a++);return"".concat(o," [").concat(_e(u),"]")}return o;case"iterator":var l=e.constructor.name;if(t){for(var s=Array.from(e),c="",f=0;f0&&(c+=", "),Array.isArray(d)){var p=ye(d[0],!0),h=ye(d[1],!1);c+="".concat(p," => ").concat(h)}else c+=ye(d,!1);if(c.length>50)break}return"".concat(l,"(").concat(e.size,") {").concat(_e(c),"}")}return"".concat(l,"(").concat(e.size,")");case"opaque_iterator":return e[Symbol.toStringTag];case"date":return e.toString();case"object":if(t){for(var v=ae(e).sort(ue),m="",g=0;g0&&(m+=", "),(m+="".concat(_.toString(),": ").concat(ye(e[_],!1))).length>50)break}return"{".concat(_e(m),"}")}return"{…}";case"boolean":case"number":case"infinity":case"nan":case"null":case"undefined":return e;default:try{return _e(""+e)}catch(e){return"unserializable"}}}var be=n(7);function we(e){return(we="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function De(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:[];if(null!==e){var r=[],i=[],o=ee(e,r,i,n,t);return{data:o,cleaned:r,unserializable:i}}return null}function Se(e){var t,n,r=(t=e,n=new Set,JSON.stringify(t,(function(e,t){if("object"===we(t)&&null!==t){if(n.has(t))return;n.add(t)}return"bigint"==typeof t?t.toString()+"n":t}))),i=void 0===r?"undefined":r,o=window.__REACT_DEVTOOLS_GLOBAL_HOOK__.clipboardCopyText;"function"==typeof o?o(i).catch((function(e){})):Object(be.copy)(i)}function Te(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t[n],i=Array.isArray(e)?e.slice():De({},e);return n+1===t.length?Array.isArray(i)?i.splice(r,1):delete i[r]:i[r]=Te(e[r],t,n+1),i}function xe(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=t[r],o=Array.isArray(e)?e.slice():De({},e);if(r+1===t.length){var u=n[r];o[u]=o[i],Array.isArray(o)?o.splice(i,1):delete o[i]}else o[i]=xe(e[i],t,n,r+1);return o}function Ae(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(r>=t.length)return n;var i=t[r],o=Array.isArray(e)?e.slice():De({},e);return o[i]=Ae(e[i],t,n,r+1),o}var Oe=n(8);function Me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ie(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return u=e.done,e},e:function(e){a=!0,o=e},f:function(){try{u||null==n.return||n.return()}finally{if(a)throw o}}}}function Le(e,t){if(e){if("string"==typeof e)return Be(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Be(e,t):void 0}}function Be(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0){var a=o(e);if(null!=a){var l,s=Fe(Y);try{for(s.s();!(l=s.n()).done;)if(l.value.test(a))return!0}catch(e){s.e(e)}finally{s.f()}}}if(null!=t&&X.size>0){var c,f=t.fileName,d=Fe(X);try{for(d.s();!(c=d.n()).done;)if(c.value.test(f))return!0}catch(e){d.e(e)}finally{d.f()}}return!1}function te(e){var t=e.type;switch(e.tag){case v:case C:return 1;case h:case k:return 5;case y:return 6;case b:return 11;case E:return 7;case w:case D:case _:return 9;case S:case x:return 8;case A:return 12;case O:return 13;default:switch(u(t)){case 60111:case"Symbol(react.concurrent_mode)":case"Symbol(react.async_mode)":return 9;case 60109:case"Symbol(react.provider)":return 2;case 60110:case"Symbol(react.context)":return 2;case 60108:case"Symbol(react.strict_mode)":return 9;case 60114:case"Symbol(react.profiler)":return 10;default:return 9}}}function ne(e){if(oe.has(e))return e;var t=e.alternate;return null!=t&&oe.has(t)?t:(oe.add(e),e)}null!=window.__REACT_DEVTOOLS_COMPONENT_FILTERS__?Z(window.__REACT_DEVTOOLS_COMPONENT_FILTERS__):Z([{type:1,value:7,isEnabled:!0}]);var re=new Map,ie=new Map,oe=new Set,ue=new Map,ae=new Map,le=-1;function se(e){if(!re.has(e)){var t=ce();re.set(e,t),ie.set(t,e)}return re.get(e)}function me(e){switch(te(e)){case 1:if(null!==dt){var t=se(ne(e)),n=_e(e);null!==n&&dt.set(t,n)}}}var ge={};function _e(e){switch(te(e)){case 1:var t=e.stateNode,n=ge,r=ge;return null!=t&&(t.constructor&&null!=t.constructor.contextType?r=t.context:(n=t.context)&&0===Object.keys(n).length&&(n=ge)),[n,r];default:return null}}function ye(e){switch(te(e)){case 1:if(null!==dt){var t=se(ne(e)),n=dt.has(t)?dt.get(t):null,r=_e(e);if(null==n||null==r)return null;var i=Pe(n,2),o=i[0],u=i[1],a=Pe(r,2),l=a[0],s=a[1];if(l!==ge)return we(o,l);if(s!==ge)return u!==s}}return null}function be(e,t){if(null==e||null==t)return!1;if(t.hasOwnProperty("baseState")&&t.hasOwnProperty("memoizedState")&&t.hasOwnProperty("next")&&t.hasOwnProperty("queue"))for(;null!==t;){if(t.memoizedState!==e.memoizedState)return!0;t=t.next,e=e.next}return!1}function we(e,t){if(null==e||null==t)return null;if(t.hasOwnProperty("baseState")&&t.hasOwnProperty("memoizedState")&&t.hasOwnProperty("next")&&t.hasOwnProperty("queue"))return null;var n,r=[],i=Fe(new Set([].concat(Ne(Object.keys(e)),Ne(Object.keys(t)))));try{for(i.s();!(n=i.n()).done;){var o=n.value;e[o]!==t[o]&&r.push(o)}}catch(e){i.e(e)}finally{i.f()}return r}function Ee(e,t){switch(t.tag){case v:case h:case m:case S:case x:return(je(t)&d)===d;default:return e.memoizedProps!==t.memoizedProps||e.memoizedState!==t.memoizedState||e.ref!==t.ref}}var De=[],Ce=[],Me=[],Re=[],Le=new Map,Be=0,Ue=null;function ze(e){De.push(e)}function Ve(n){if(0!==De.length||0!==Ce.length||0!==Me.length||null!==Ue||vt){var r=Ce.length+Me.length+(null===Ue?0:1),i=new Array(3+Be+(r>0?2+r:0)+De.length),o=0;if(i[o++]=t,i[o++]=le,i[o++]=Be,Le.forEach((function(e,t){i[o++]=t.length;for(var n=fe(t),r=0;r0){i[o++]=2,i[o++]=r;for(var u=Ce.length-1;u>=0;u--)i[o++]=Ce[u];for(var a=0;a0?n.forEach((function(t){e.emit("operations",t)})):(null!==Dt&&(St=!0),e.getFiberRoots(t).forEach((function(e){Ot(le=se(ne(e.current)),e.current),vt&&null!=e.memoizedInteractions&&(st={changeDescriptions:gt?new Map:null,durations:[],commitTime:We()-mt,interactions:Array.from(e.memoizedInteractions).map((function(e){return Ie(Ie({},e),{},{timestamp:e.timestamp-mt})})),maxActualDuration:0,priorityLevel:null}),qe(e.current,null,!1,!1),Ve(),le=-1})))},getBestMatchForTrackedPath:function(){if(null===Dt)return null;if(null===Ct)return null;for(var e=Ct;null!==e&&ee(e);)e=e.return;return null===e?null:{id:se(ne(e)),isFullMatch:kt===Dt.length-1}},getDisplayNameForFiberID:function(e){var t=ie.get(e);return null!=t?o(t):null},getFiberIDForNative:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=n.findFiberByHostInstance(e);if(null!=r){if(t)for(;null!==r&&ee(r);)r=r.return;return se(ne(r))}return null},getInstanceAndStyle:function(e){var t=null,n=null,r=et(e);return null!==r&&(t=r.stateNode,null!==r.memoizedProps&&(n=r.memoizedProps.style)),{instance:t,style:n}},getOwnersList:function(e){var t=et(e);if(null==t)return null;var n=t._debugOwner,r=[{displayName:o(t)||"Anonymous",id:e,type:te(t)}];if(n)for(var i=n;null!==i;)r.unshift({displayName:o(i)||"Anonymous",id:se(ne(i)),type:te(i)}),i=i._debugOwner||null;return r},getPathForElement:function(e){var t=ie.get(e);if(null==t)return null;for(var n=[];null!==t;)n.push(It(t)),t=t.return;return n.reverse(),n},getProfilingData:function(){var e=[];if(null===_t)throw Error("getProfilingData() called before any profiling data was recorded");return _t.forEach((function(t,n){var r=[],i=[],o=new Map,u=new Map,a=null!==ft&&ft.get(n)||"Unknown";null!=pt&&pt.forEach((function(e,t){null!=ht&&ht.get(t)===n&&i.push([t,e])})),t.forEach((function(e,t){var n=e.changeDescriptions,i=e.durations,a=e.interactions,l=e.maxActualDuration,s=e.priorityLevel,c=e.commitTime,f=[];a.forEach((function(e){o.has(e.id)||o.set(e.id,e),f.push(e.id);var n=u.get(e.id);null!=n?n.push(t):u.set(e.id,[t])}));for(var d=[],p=[],h=0;h1?At.set(n,r-1):At.delete(n),xt.delete(e)}(le),Ge(r,!1))}else Ot(le,r),qe(r,null,!1,!1);if(vt&&o){var l=_t.get(le);null!=l?l.push(st):_t.set(le,[st])}Ve(),J&&e.emit("traceUpdates",Q),le=-1},handleCommitFiberUnmount:function(e){Ge(e,!1)},inspectElement:function(e,t){if(ot(e)){if(null!=t){ut(t);var n=null;return"hooks"===t[0]&&(n="hooks"),{id:e,type:"hydrated-path",path:t,value:ke(de(nt,t),at(null,n),t)}}return{id:e,type:"no-change"}}if(rt=!1,null!==nt&&nt.id===e||(it={}),null===(nt=tt(e)))return{id:e,type:"not-found"};null!=t&&ut(t),function(e){var t=e.hooks,n=e.id,i=e.props,o=ie.get(n);if(null!=o){var u=o.elementType,a=o.stateNode,l=o.tag,s=o.type;switch(l){case v:case C:case k:r.$r=a;break;case h:r.$r={hooks:t,props:i,type:s};break;case y:r.$r={props:i,type:s.render};break;case S:case x:r.$r={props:i,type:null!=u&&null!=u.type?u.type:s};break;default:r.$r=null}}else console.warn('Could not find Fiber with id "'.concat(n,'"'))}(nt);var i=Ie({},nt);return i.context=ke(i.context,at("context",null)),i.hooks=ke(i.hooks,at("hooks","hooks")),i.props=ke(i.props,at("props",null)),i.state=ke(i.state,at("state",null)),{id:e,type:"full-data",value:i}},logElementToConsole:function(e){var t=ot(e)?nt:tt(e);if(null!==t){var n="function"==typeof console.groupCollapsed;n&&console.groupCollapsed("[Click to expand] %c<".concat(t.displayName||"Component"," />"),"color: var(--dom-tag-name-color); font-weight: normal;"),null!==t.props&&console.log("Props:",t.props),null!==t.state&&console.log("State:",t.state),null!==t.hooks&&console.log("Hooks:",t.hooks);var r=Qe(e);null!==r&&console.log("Nodes:",r),null!==t.source&&console.log("Location:",t.source),(window.chrome||/firefox/i.test(navigator.userAgent))&&console.log("Right-click any value to save it as a global variable for further inspection."),n&&console.groupEnd()}else console.warn('Could not find Fiber with id "'.concat(e,'"'))},prepareViewAttributeSource:function(e,t){ot(e)&&(window.$attribute=de(nt,t))},prepareViewElementSource:function(e){var t=ie.get(e);if(null!=t){var n=t.elementType,i=t.tag,o=t.type;switch(i){case v:case C:case k:case h:r.$type=o;break;case y:r.$type=o.render;break;case S:case x:r.$type=null!=n&&null!=n.type?n.type:o;break;default:r.$type=null}}else console.warn('Could not find Fiber with id "'.concat(e,'"'))},overrideSuspense:function(e,t){if("function"!=typeof H||"function"!=typeof V)throw new Error("Expected overrideSuspense() to not get called for earlier React versions.");t?(wt.add(e),1===wt.size&&H(Et)):(wt.delete(e),0===wt.size&&H(bt));var n=ie.get(e);null!=n&&V(n)},overrideValueAtPath:function(e,t,n,r,i){var o=et(t);if(null!==o){var u=o.stateNode;switch(e){case"context":switch(r=r.slice(1),o.tag){case v:0===r.length?u.context=i:ve(u.context,r,i),u.forceUpdate()}break;case"hooks":"function"==typeof L&&L(o,n,r,i);break;case"props":switch(o.tag){case v:o.pendingProps=Ae(u.props,r,i),u.forceUpdate();break;default:"function"==typeof j&&j(o,r,i)}break;case"state":switch(o.tag){case v:ve(u.state,r,i),u.forceUpdate()}}}},renamePath:function(e,t,n,r,i){var o=et(t);if(null!==o){var u=o.stateNode;switch(e){case"context":switch(r=r.slice(1),i=i.slice(1),o.tag){case v:0===r.length||he(u.context,r,i),u.forceUpdate()}break;case"hooks":"function"==typeof U&&U(o,n,r,i);break;case"props":null===u?"function"==typeof W&&W(o,r,i):(o.pendingProps=xe(u.props,r,i),u.forceUpdate());break;case"state":he(u.state,r,i),u.forceUpdate()}}},renderer:n,setTraceUpdatesEnabled:function(e){J=e},setTrackedPath:Tt,startProfiling:yt,stopProfiling:function(){vt=!1,gt=!1},storeAsGlobal:function(e,t,n){if(ot(e)){var r=de(nt,t),i="$reactTemp".concat(n);window[i]=r,console.log(i),console.log(r)}},updateComponentFilters:function(n){if(vt)throw Error("Cannot modify filter preferences while profiling");e.getFiberRoots(t).forEach((function(e){le=se(ne(e.current)),Ye(e.current),Ge(e.current,!1),le=-1})),Z(n),At.clear(),e.getFiberRoots(t).forEach((function(e){Ot(le=se(ne(e.current)),e.current),qe(e.current,null,!1,!1),Ve(),le=-1}))}}}function $e(e){return($e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ge(e,t,n){if(void 0===ze)try{throw Error()}catch(e){var r=e.stack.trim().match(/\n( *(at )?)/);ze=r&&r[1]||""}return"\n"+ze+e}var qe=!1;function Ye(e,t,n){if(!e||qe)return"";var r,i=Error.prepareStackTrace;Error.prepareStackTrace=void 0,qe=!0;var o=n.current;n.current=null;try{if(t){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),"object"===("undefined"==typeof Reflect?"undefined":$e(Reflect))&&Reflect.construct){try{Reflect.construct(u,[])}catch(e){r=e}Reflect.construct(e,[],u)}else{try{u.call()}catch(e){r=e}e.call(u.prototype)}}else{try{throw Error()}catch(e){r=e}e()}}catch(e){if(e&&r&&"string"==typeof e.stack){for(var a=e.stack.split("\n"),l=r.stack.split("\n"),s=a.length-1,c=l.length-1;s>=1&&c>=0&&a[s]!==l[c];)c--;for(;s>=1&&c>=0;s--,c--)if(a[s]!==l[c]){if(1!==s||1!==c)do{if(s--,--c<0||a[s]!==l[c])return"\n"+a[s].replace(" at new "," at ")}while(s>=1&&c>=0);break}}}finally{qe=!1,Error.prepareStackTrace=i,n.current=o}var f=e?e.displayName||e.name:"";return f?Ge(f):""}function Xe(e,t,n,r){return Ye(e,!1,r)}function Ke(e,t,n){var r=e.HostComponent,i=e.LazyComponent,o=e.SuspenseComponent,u=e.SuspenseListComponent,a=e.FunctionComponent,l=e.IndeterminateComponent,s=e.SimpleMemoComponent,c=e.ForwardRef,f=e.Block,d=e.ClassComponent;switch(t.tag){case r:return Ge(t.type);case i:return Ge("Lazy");case o:return Ge("Suspense");case u:return Ge("SuspenseList");case a:case l:case s:return Xe(t.type,0,0,n);case c:return Xe(t.type.render,0,0,n);case f:return Xe(t.type._render,0,0,n);case d:return function(e,t,n,r){return Ye(e,!0,r)}(t.type,0,0,n);default:return""}}function Je(e,t,n){try{var r="",i=t;do{r+=Ke(e,i,n),i=i.return}while(i);return r}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}function Qe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ze(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ze(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,a=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return u=e.done,e},e:function(e){a=!0,o=e},f:function(){try{u||null==n.return||n.return()}finally{if(a)throw o}}}}function Ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?r[r.length-1]:null,u=null!==o&&(tt.test(o)||nt.test(o));if(!u){var a,l=Qe(rt.values());try{for(l.s();!(a=l.n()).done;){var s=a.value,c=s.currentDispatcherRef,f=s.getCurrentFiber,d=s.workTagMap,p=f();if(null!=p){var h=Je(d,p,c);""!==h&&r.push(h);break}}}catch(e){l.e(e)}finally{l.f()}}}catch(e){}t.apply(void 0,r)};n.__REACT_DEVTOOLS_ORIGINAL_METHOD__=t,it[e]=n}catch(e){}}))}}function ft(e){return(ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function dt(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:d,n=void 0,r=[],i=void 0,o=!1,u=function(e,n){return t(e,r[n])},a=function(){for(var t=arguments.length,a=Array(t),l=0;le.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?t-1:0),r=1;r0?"development":"production";var t=Function.prototype.toString;if(e.Mount&&e.Mount._renderNewRootComponent){var n=t.call(e.Mount._renderNewRootComponent);return 0!==n.indexOf("function")?"production":-1!==n.indexOf("storedMeasure")?"development":-1!==n.indexOf("should be a pure function")?-1!==n.indexOf("NODE_ENV")||-1!==n.indexOf("development")||-1!==n.indexOf("true")?"development":-1!==n.indexOf("nextElement")||-1!==n.indexOf("nextComponent")?"unminified":"development":-1!==n.indexOf("nextElement")||-1!==n.indexOf("nextComponent")?"unminified":"outdated"}}catch(e){}return"production"}(r);try{var l=!1!==window.__REACT_DEVTOOLS_APPEND_COMPONENT_STACK__,s=!0===window.__REACT_DEVTOOLS_BREAK_ON_CONSOLE_ERRORS__;(l||s)&&(lt(r),ct({appendComponentStack:l,breakOnConsoleErrors:s}))}catch(e){}var c=e.__REACT_DEVTOOLS_ATTACH__;if("function"==typeof c){var f=c(a,i,r,e);a.rendererInterfaces.set(i,f)}return a.emit("renderer",{id:i,renderer:r,reactBuildType:o}),i},on:function(e,t){o[e]||(o[e]=[]),o[e].push(t)},off:function(e,t){if(o[e]){var n=o[e].indexOf(t);-1!==n&&o[e].splice(n,1),o[e].length||delete o[e]}},sub:function(e,t){return a.on(e,t),function(){return a.off(e,t)}},supportsFiber:!0,checkDCE:function(e){try{Function.prototype.toString.call(e).indexOf("^_^")>-1&&(n=!0,setTimeout((function(){throw new Error("React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://reactjs.org/link/perf-use-production-build")})))}catch(e){}},onCommitFiberUnmount:function(e,t){var n=i.get(e);null!=n&&n.handleCommitFiberUnmount(t)},onCommitFiberRoot:function(e,t,n){var r=a.getFiberRoots(e),o=t.current,u=r.has(t),l=null==o.memoizedState||null==o.memoizedState.element;u||l?u&&l&&r.delete(t):r.add(t);var s=i.get(e);null!=s&&s.handleCommitFiberRoot(t,n)}};Object.defineProperty(e,"__REACT_DEVTOOLS_GLOBAL_HOOK__",{configurable:!1,enumerable:!1,get:function(){return a}})}(window);var qt=window.__REACT_DEVTOOLS_GLOBAL_HOOK__,Yt=[{type:1,value:7,isEnabled:!0}];function Xt(e){if(null!=qt){var t=e||{},n=t.host,r=void 0===n?"localhost":n,i=t.nativeStyleEditorValidAttributes,o=t.useHttps,u=void 0!==o&&o,a=t.port,l=void 0===a?8097:a,s=t.websocket,c=t.resolveRNStyle,f=void 0===c?null:c,d=t.isAppActive,p=u?"wss":"ws",h=null;if((void 0===d?function(){return!0}:d)()){var v=null,m=[],g=p+"://"+r+":"+l,_=s||new window.WebSocket(g);_.onclose=function(){null!==v&&v.emit("shutdown"),y()},_.onerror=function(){y()},_.onmessage=function(e){var t;try{if("string"!=typeof e.data)throw Error();t=JSON.parse(e.data)}catch(t){return void console.error("[React DevTools] Failed to parse JSON: "+e.data)}m.forEach((function(e){try{e(t)}catch(e){throw console.log("[React DevTools] Error calling listener",t),console.log("error:",e),e}}))},_.onopen=function(){(v=new xt({listen:function(e){return m.push(e),function(){var t=m.indexOf(e);t>=0&&m.splice(t,1)}},send:function(e,t,n){_.readyState===_.OPEN?_.send(JSON.stringify({event:e,payload:t})):(null!==v&&v.shutdown(),y())}})).addListener("inspectElement",(function(t){var n=t.id,r=t.rendererID,i=e.rendererInterfaces[r];if(null!=i){var o=i.findNativeNodesForFiberID(n);null!=o&&null!=o[0]&&e.emit("showNativeHighlight",o[0])}})),v.addListener("updateComponentFilters",(function(e){Yt=e})),null==window.__REACT_DEVTOOLS_COMPONENT_FILTERS__&&v.send("overrideComponentFilters",Yt);var e=new _t(v);if(e.addListener("shutdown",(function(){qt.emit("shutdown")})),function(e,t,n){if(null==e)return function(){};var r=[e.sub("renderer-attached",(function(e){var n=e.id,r=(e.renderer,e.rendererInterface);t.setRendererInterface(n,r),r.flushInitialOperations()})),e.sub("unsupported-renderer-version",(function(e){t.onUnsupportedRenderer(e)})),e.sub("operations",t.onHookOperations),e.sub("traceUpdates",t.onTraceUpdates)],i=function(t,r){var i=e.rendererInterfaces.get(t);null==i&&("function"==typeof r.findFiberByHostInstance?i=Ve(e,t,r,n):r.ComponentTree&&(i=function(e,t,n,r){var i,o=new Map,u=new WeakMap,a=new WeakMap,l=null;function s(e){if("object"!==Pt(e)||null===e)throw new Error("Invalid internal instance: "+e);if(!u.has(e)){var t=ce();u.set(e,t),o.set(t,e)}return u.get(e)}function c(e,t){if(e.length!==t.length)return!1;for(var n=0;n0?f[f.length-1]:0),f.push(i),a.set(n,s(r._topLevelWrapper));try{var o=e.apply(this,t);return f.pop(),o}catch(e){throw f=[],e}finally{if(0===f.length){var u=a.get(n);if(void 0===u)throw new Error("Expected to find root ID.");w(u)}}},performUpdateIfNecessary:function(e,t){var n=t[0];if(9===Lt(n))return e.apply(this,t);var r=s(n);f.push(r);var i=Bt(n);try{var o=e.apply(this,t),u=Bt(n);return c(i,u)||h(0,r,u),f.pop(),o}catch(e){throw f=[],e}finally{if(0===f.length){var l=a.get(n);if(void 0===l)throw new Error("Expected to find root ID.");w(l)}}},receiveComponent:function(e,t){var n=t[0];if(9===Lt(n))return e.apply(this,t);var r=s(n);f.push(r);var i=Bt(n);try{var o=e.apply(this,t),u=Bt(n);return c(i,u)||h(0,r,u),f.pop(),o}catch(e){throw f=[],e}finally{if(0===f.length){var l=a.get(n);if(void 0===l)throw new Error("Expected to find root ID.");w(l)}}},unmountComponent:function(e,t){var n=t[0];if(9===Lt(n))return e.apply(this,t);var r=s(n);f.push(r);try{var i=e.apply(this,t);return f.pop(),function(e,t){_.push(t),o.delete(t)}(0,r),i}catch(e){throw f=[],e}finally{if(0===f.length){var u=a.get(n);if(void 0===u)throw new Error("Expected to find root ID.");w(u)}}}}));var m=[],g=new Map,_=[],y=0,b=null;function w(n){if(0!==m.length||0!==_.length||null!==b){var r=_.length+(null===b?0:1),i=new Array(3+y+(r>0?2+r:0)+m.length),o=0;if(i[o++]=t,i[o++]=n,i[o++]=y,g.forEach((function(e,t){i[o++]=t.length;for(var n=fe(t),r=0;r0){i[o++]=2,i[o++]=r;for(var u=0;u<_.length;u++)i[o++]=_[u];null!==b&&(i[o]=b,o++)}for(var a=0;a"),"color: var(--dom-tag-name-color); font-weight: normal;"),null!==t.props&&console.log("Props:",t.props),null!==t.state&&console.log("State:",t.state),null!==t.context&&console.log("Context:",t.context);var r=i(e);null!==r&&console.log("Node:",r),(window.chrome||/firefox/i.test(navigator.userAgent))&&console.log("Right-click any value to save it as a global variable for further inspection."),n&&console.groupEnd()}else console.warn('Could not find element with id "'.concat(e,'"'))},overrideSuspense:function(){throw new Error("overrideSuspense not supported by this renderer")},overrideValueAtPath:function(e,t,n,r,i){var u=o.get(t);if(null!=u){var a=u._instance;if(null!=a)switch(e){case"context":ve(a.context,r,i),Mt(a);break;case"hooks":throw new Error("Hooks not supported by this renderer");case"props":var l=u._currentElement;u._currentElement=Rt(Rt({},l),{},{props:Ae(l.props,r,i)}),Mt(a);break;case"state":ve(a.state,r,i),Mt(a)}}},renamePath:function(e,t,n,r,i){var u=o.get(t);if(null!=u){var a=u._instance;if(null!=a)switch(e){case"context":he(a.context,r,i),Mt(a);break;case"hooks":throw new Error("Hooks not supported by this renderer");case"props":var l=u._currentElement;u._currentElement=Rt(Rt({},l),{},{props:xe(l.props,r,i)}),Mt(a);break;case"state":he(a.state,r,i),Mt(a)}}},prepareViewAttributeSource:function(e,t){var n=T(e);null!==n&&(window.$attribute=de(n,t))},prepareViewElementSource:function(e){var t=o.get(e);if(null!=t){var n=t._currentElement;null!=n?r.$type=n.type:console.warn('Could not find element with id "'.concat(e,'"'))}else console.warn('Could not find instance with id "'.concat(e,'"'))},renderer:n,setTraceUpdatesEnabled:function(e){},setTrackedPath:function(e){},startProfiling:function(){},stopProfiling:function(){},storeAsGlobal:function(e,t,n){var r=T(e);if(null!==r){var i=de(r,t),o="$reactTemp".concat(n);window[o]=i,console.log(o),console.log(i)}},updateComponentFilters:function(e){}}}(e,t,r,n)),null!=i&&e.rendererInterfaces.set(t,i)),null!=i?e.emit("renderer-attached",{id:t,renderer:r,rendererInterface:i}):e.emit("unsupported-renderer-version",t)};e.renderers.forEach((function(e,t){i(t,e)})),r.push(e.sub("renderer",(function(e){var t=e.id,n=e.renderer;i(t,n)}))),e.emit("react-devtools",t),e.reactDevtoolsAgent=t;var o=function(){r.forEach((function(e){return e()})),e.rendererInterfaces.forEach((function(e){e.cleanup()})),e.reactDevtoolsAgent=null};t.addListener("shutdown",o),r.push((function(){t.removeListener("shutdown",o)}))}(qt,e,window),null!=f||null!=qt.resolveRNStyle)Wt(v,e,f||qt.resolveRNStyle,i||qt.nativeStyleEditorValidAttributes||null);else{var t,n,r=function(){null!==v&&Wt(v,e,t,n)};qt.hasOwnProperty("resolveRNStyle")||Object.defineProperty(qt,"resolveRNStyle",{enumerable:!1,get:function(){return t},set:function(e){t=e,r()}}),qt.hasOwnProperty("nativeStyleEditorValidAttributes")||Object.defineProperty(qt,"nativeStyleEditorValidAttributes",{enumerable:!1,get:function(){return n},set:function(e){n=e,r()}})}}}else y()}function y(){null===h&&(h=setTimeout((function(){return Xt(e)}),2e3))}}}])},6099:(e,t,n)=>{"use strict"; +/** @license React v16.13.1 + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var r=n(9381),i="function"==typeof Symbol&&Symbol.for,o=i?Symbol.for("react.element"):60103,u=i?Symbol.for("react.portal"):60106,a=i?Symbol.for("react.fragment"):60107,l=i?Symbol.for("react.strict_mode"):60108,s=i?Symbol.for("react.profiler"):60114,c=i?Symbol.for("react.provider"):60109,f=i?Symbol.for("react.context"):60110,d=i?Symbol.for("react.forward_ref"):60112,p=i?Symbol.for("react.suspense"):60113,h=i?Symbol.for("react.memo"):60115,v=i?Symbol.for("react.lazy"):60116,m="function"==typeof Symbol&&Symbol.iterator;function g(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nO.length&&O.push(e)}function R(e,t,n){return null==e?0:function e(t,n,r,i){var a=typeof t;"undefined"!==a&&"boolean"!==a||(t=null);var l=!1;if(null===t)l=!0;else switch(a){case"string":case"number":l=!0;break;case"object":switch(t.$$typeof){case o:case u:l=!0}}if(l)return r(i,t,""===n?"."+N(t,0):n),1;if(l=0,n=""===n?".":n+":",Array.isArray(t))for(var s=0;s{"use strict";e.exports=n(6099)},3390:(e,t,n)=>{"use strict";const r=n(834),i=n(6458);e.exports=r(()=>{i(()=>{process.stderr.write("[?25h")},{alwaysLast:!0})})},706:(e,t)=>{"use strict"; +/** @license React v0.18.0 + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var n,r,i,o,u;if(Object.defineProperty(t,"__esModule",{value:!0}),"undefined"==typeof window||"function"!=typeof MessageChannel){var a=null,l=null,s=function(){if(null!==a)try{var e=t.unstable_now();a(!0,e),a=null}catch(e){throw setTimeout(s,0),e}},c=Date.now();t.unstable_now=function(){return Date.now()-c},n=function(e){null!==a?setTimeout(n,0,e):(a=e,setTimeout(s,0))},r=function(e,t){l=setTimeout(e,t)},i=function(){clearTimeout(l)},o=function(){return!1},u=t.unstable_forceFrameRate=function(){}}else{var f=window.performance,d=window.Date,p=window.setTimeout,h=window.clearTimeout;if("undefined"!=typeof console){var v=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof v&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof f&&"function"==typeof f.now)t.unstable_now=function(){return f.now()};else{var m=d.now();t.unstable_now=function(){return d.now()-m}}var g=!1,_=null,y=-1,b=5,w=0;o=function(){return t.unstable_now()>=w},u=function(){},t.unstable_forceFrameRate=function(e){0>e||125T(u,n))void 0!==l&&0>T(l,u)?(e[r]=l,e[a]=n,r=a):(e[r]=u,e[o]=n,r=o);else{if(!(void 0!==l&&0>T(l,n)))break e;e[r]=l,e[a]=n,r=a}}}return t}return null}function T(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var x=[],A=[],O=1,M=null,I=3,R=!1,N=!1,P=!1;function F(e){for(var t=k(A);null!==t;){if(null===t.callback)S(A);else{if(!(t.startTime<=e))break;S(A),t.sortIndex=t.expirationTime,C(x,t)}t=k(A)}}function L(e){if(P=!1,F(e),!N)if(null!==k(x))N=!0,n(B);else{var t=k(A);null!==t&&r(L,t.startTime-e)}}function B(e,n){N=!1,P&&(P=!1,i()),R=!0;var u=I;try{for(F(n),M=k(x);null!==M&&(!(M.expirationTime>n)||e&&!o());){var a=M.callback;if(null!==a){M.callback=null,I=M.priorityLevel;var l=a(M.expirationTime<=n);n=t.unstable_now(),"function"==typeof l?M.callback=l:M===k(x)&&S(x),F(n)}else S(x);M=k(x)}if(null!==M)var s=!0;else{var c=k(A);null!==c&&r(L,c.startTime-n),s=!1}return s}finally{M=null,I=u,R=!1}}function U(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var j=u;t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=I;I=e;try{return t()}finally{I=n}},t.unstable_next=function(e){switch(I){case 1:case 2:case 3:var t=3;break;default:t=I}var n=I;I=t;try{return e()}finally{I=n}},t.unstable_scheduleCallback=function(e,o,u){var a=t.unstable_now();if("object"==typeof u&&null!==u){var l=u.delay;l="number"==typeof l&&0a?(e.sortIndex=l,C(A,e),null===k(x)&&e===k(A)&&(P?i():P=!0,r(L,l-a))):(e.sortIndex=u,C(x,e),N||R||(N=!0,n(B))),e},t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_wrapCallback=function(e){var t=I;return function(){var n=I;I=t;try{return e.apply(this,arguments)}finally{I=n}}},t.unstable_getCurrentPriorityLevel=function(){return I},t.unstable_shouldYield=function(){var e=t.unstable_now();F(e);var n=k(x);return n!==M&&null!==M&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime{"use strict";e.exports=n(706)},6458:(e,t,n)=>{var r,i=n(2357),o=n(8082),u=n(8614);function a(){c&&(c=!1,o.forEach((function(e){try{process.removeListener(e,s[e])}catch(e){}})),process.emit=h,process.reallyExit=d,r.count-=1)}function l(e,t,n){r.emitted[e]||(r.emitted[e]=!0,r.emit(e,t,n))}"function"!=typeof u&&(u=u.EventEmitter),process.__signal_exit_emitter__?r=process.__signal_exit_emitter__:((r=process.__signal_exit_emitter__=new u).count=0,r.emitted={}),r.infinite||(r.setMaxListeners(1/0),r.infinite=!0),e.exports=function(e,t){i.equal(typeof e,"function","a callback must be provided for exit handler"),!1===c&&f();var n="exit";t&&t.alwaysLast&&(n="afterexit");return r.on(n,e),function(){r.removeListener(n,e),0===r.listeners("exit").length&&0===r.listeners("afterexit").length&&a()}},e.exports.unload=a;var s={};o.forEach((function(e){s[e]=function(){process.listeners(e).length===r.count&&(a(),l("exit",null,e),l("afterexit",null,e),process.kill(process.pid,e))}})),e.exports.signals=function(){return o},e.exports.load=f;var c=!1;function f(){c||(c=!0,r.count+=1,o=o.filter((function(e){try{return process.on(e,s[e]),!0}catch(e){return!1}})),process.emit=v,process.reallyExit=p)}var d=process.reallyExit;function p(e){process.exitCode=e||0,l("exit",process.exitCode,null),l("afterexit",process.exitCode,null),d.call(process,process.exitCode)}var h=process.emit;function v(e,t){if("exit"===e){void 0!==t&&(process.exitCode=t);var n=h.apply(this,arguments);return l("exit",process.exitCode,null),l("afterexit",process.exitCode,null),n}return h.apply(this,arguments)}},8082:e=>{e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],"win32"!==process.platform&&e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")},1566:(e,t,n)=>{"use strict";const r=n(7347),i=n(409),o=n(8483),u=["","›"],a=e=>`${u[0]}[${e}m`,l=(e,t,n)=>{let r=[];e=[...e];for(let n of e){const i=n;n.match(";")&&(n=n.split(";")[0][0]+"0");const u=o.codes.get(parseInt(n,10));if(u){const n=e.indexOf(u.toString());n>=0?e.splice(n,1):r.push(a(t?u:i))}else{if(t){r.push(a(0));break}r.push(a(i))}}if(t&&(r=r.filter((e,t)=>r.indexOf(e)===t),void 0!==n)){const e=a(o.codes.get(parseInt(n,10)));r=r.reduce((t,n)=>n===e?[n,...t]:[...t,n],[])}return r.join("")};e.exports=(e,t,n)=>{const o=[...e.normalize()],a=[];n="number"==typeof n?n:o.length;let s,c=!1,f=0,d="";for(const[p,h]of o.entries()){let o=!1;if(u.includes(h)){const t=/\d[^m]*/.exec(e.slice(p,p+18));s=t&&t.length>0?t[0]:void 0,ft&&f<=n)d+=h;else if(f!==t||c||void 0===s){if(f>=n){d+=l(a,!0,s);break}}else d=l(a)}return d}},9796:(e,t,n)=>{"use strict";const r=n(8759),i=[].concat(n(2282).builtinModules,"bootstrap_node","node").map(e=>new RegExp(`(?:\\(${e}\\.js:\\d+:\\d+\\)$|^\\s*at ${e}\\.js:\\d+:\\d+$)`));i.push(/\(internal\/[^:]+:\d+:\d+\)$/,/\s*at internal\/[^:]+:\d+:\d+$/,/\/\.node-spawn-wrap-\w+-\w+\/node:\d+:\d+\)?$/);class o{constructor(e){"internals"in(e={ignoredPackages:[],...e})==!1&&(e.internals=o.nodeInternals()),"cwd"in e==!1&&(e.cwd=process.cwd()),this._cwd=e.cwd.replace(/\\/g,"/"),this._internals=[].concat(e.internals,function(e){if(0===e.length)return[];const t=e.map(e=>r(e));return new RegExp(`[/\\\\]node_modules[/\\\\](?:${t.join("|")})[/\\\\][^:]+:\\d+:\\d+`)}(e.ignoredPackages)),this._wrapCallSite=e.wrapCallSite||!1}static nodeInternals(){return[...i]}clean(e,t=0){t=" ".repeat(t),Array.isArray(e)||(e=e.split("\n")),!/^\s*at /.test(e[0])&&/^\s*at /.test(e[1])&&(e=e.slice(1));let n=!1,r=null;const i=[];return e.forEach(e=>{if(e=e.replace(/\\/g,"/"),this._internals.some(t=>t.test(e)))return;const t=/^\s*at /.test(e);n?e=e.trimEnd().replace(/^(\s+)at /,"$1"):(e=e.trim(),t&&(e=e.slice(3))),(e=e.replace(this._cwd+"/",""))&&(t?(r&&(i.push(r),r=null),i.push(e)):(n=!0,r=e))}),i.map(e=>`${t}${e}\n`).join("")}captureString(e,t=this.captureString){"function"==typeof e&&(t=e,e=1/0);const{stackTraceLimit:n}=Error;e&&(Error.stackTraceLimit=e);const r={};Error.captureStackTrace(r,t);const{stack:i}=r;return Error.stackTraceLimit=n,this.clean(i)}capture(e,t=this.capture){"function"==typeof e&&(t=e,e=1/0);const{prepareStackTrace:n,stackTraceLimit:r}=Error;Error.prepareStackTrace=(e,t)=>this._wrapCallSite?t.map(this._wrapCallSite):t,e&&(Error.stackTraceLimit=e);const i={};Error.captureStackTrace(i,t);const{stack:o}=i;return Object.assign(Error,{prepareStackTrace:n,stackTraceLimit:r}),o}at(e=this.at){const[t]=this.capture(1,e);if(!t)return{};const n={line:t.getLineNumber(),column:t.getColumnNumber()};let r;u(n,t.getFileName(),this._cwd),t.isConstructor()&&(n.constructor=!0),t.isEval()&&(n.evalOrigin=t.getEvalOrigin()),t.isNative()&&(n.native=!0);try{r=t.getTypeName()}catch(e){}r&&"Object"!==r&&"[object Object]"!==r&&(n.type=r);const i=t.getFunctionName();i&&(n.function=i);const o=t.getMethodName();return o&&i!==o&&(n.method=o),n}parseLine(e){const t=e&&e.match(a);if(!t)return null;const n="new"===t[1];let r=t[2];const i=t[3],o=t[4],s=Number(t[5]),c=Number(t[6]);let f=t[7];const d=t[8],p=t[9],h="native"===t[10],v=")"===t[11];let m;const g={};if(d&&(g.line=Number(d)),p&&(g.column=Number(p)),v&&f){let e=0;for(let t=f.length-1;t>0;t--)if(")"===f.charAt(t))e++;else if("("===f.charAt(t)&&" "===f.charAt(t-1)&&(e--,-1===e&&" "===f.charAt(t-1))){const e=f.slice(0,t-1),n=f.slice(t+1);f=n,r+=" ("+e;break}}if(r){const e=r.match(l);e&&(r=e[1],m=e[2])}return u(g,f,this._cwd),n&&(g.constructor=!0),i&&(g.evalOrigin=i,g.evalLine=s,g.evalColumn=c,g.evalFile=o&&o.replace(/\\/g,"/")),h&&(g.native=!0),r&&(g.function=r),m&&r!==m&&(g.method=m),g}}function u(e,t,n){t&&((t=t.replace(/\\/g,"/")).startsWith(n+"/")&&(t=t.slice(n.length+1)),e.file=t)}const a=new RegExp("^(?:\\s*at )?(?:(new) )?(?:(.*?) \\()?(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?(?:(.+?):(\\d+):(\\d+)|(native))(\\)?)$"),l=/^(.*?) \[as (.*?)\]$/;e.exports=o},3262:(e,t,n)=>{"use strict";const r=n(7402),i=n(5640),o=e=>r(e).replace(i()," ").length;e.exports=o,e.exports.default=o},5043:(e,t,n)=>{"use strict";const r=n(7915),i=n(7347),o=n(1013),u=e=>{if("string"!=typeof(e=e.replace(o()," "))||0===e.length)return 0;e=r(e);let t=0;for(let n=0;n=127&&r<=159||(r>=768&&r<=879||(r>65535&&n++,t+=i(r)?2:1))}return t};e.exports=u,e.exports.default=u},7402:(e,t,n)=>{"use strict";const r=n(5378),i=e=>"string"==typeof e?e.replace(r(),""):e;e.exports=i,e.exports.default=i},7915:(e,t,n)=>{"use strict";const r=n(1337);e.exports=e=>"string"==typeof e?e.replace(r(),""):e},9428:(e,t,n)=>{"use strict";const r=n(2087),i=n(3867),o=n(2918),{env:u}=process;let a;function l(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function s(e,t){if(0===a)return 0;if(o("color=16m")||o("color=full")||o("color=truecolor"))return 3;if(o("color=256"))return 2;if(e&&!t&&void 0===a)return 0;const n=a||0;if("dumb"===u.TERM)return n;if("win32"===process.platform){const e=r.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in u)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in u)||"codeship"===u.CI_NAME?1:n;if("TEAMCITY_VERSION"in u)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(u.TEAMCITY_VERSION)?1:0;if("GITHUB_ACTIONS"in u)return 1;if("truecolor"===u.COLORTERM)return 3;if("TERM_PROGRAM"in u){const e=parseInt((u.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(u.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(u.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(u.TERM)||"COLORTERM"in u?1:n}o("no-color")||o("no-colors")||o("color=false")||o("color=never")?a=0:(o("color")||o("colors")||o("color=true")||o("color=always"))&&(a=1),"FORCE_COLOR"in u&&(a="true"===u.FORCE_COLOR?1:"false"===u.FORCE_COLOR?0:0===u.FORCE_COLOR.length?1:Math.min(parseInt(u.FORCE_COLOR,10),3)),e.exports={supportsColor:function(e){return l(s(e,e&&e.isTTY))},stdout:l(s(!0,i.isatty(1))),stderr:l(s(!0,i.isatty(2)))}},8949:(e,t,n)=>{"use strict";const r=n(5043),i=e=>{let t=0;for(const n of e.split("\n"))t=Math.max(t,r(n));return t};e.exports=i,e.exports.default=i},4332:(e,t,n)=>{"use strict";const r=n(5043),i=n(7915),o=n(8483),u=new Set(["","›"]),a=e=>`${u.values().next().value}[${e}m`,l=(e,t,n)=>{const o=[...t];let a=!1,l=r(i(e[e.length-1]));for(const[t,i]of o.entries()){const s=r(i);if(l+s<=n?e[e.length-1]+=i:(e.push(i),l=0),u.has(i))a=!0;else if(a&&"m"===i){a=!1;continue}a||(l+=s,l===n&&t0&&e.length>1&&(e[e.length-2]+=e.pop())},s=e=>{const t=e.split(" ");let n=t.length;for(;n>0&&!(r(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")},c=(e,t,n={})=>{if(!1!==n.trim&&""===e.trim())return"";let i,c="",f="";const d=(e=>e.split(" ").map(e=>r(e)))(e);let p=[""];for(const[i,o]of e.split(" ").entries()){!1!==n.trim&&(p[p.length-1]=p[p.length-1].trimLeft());let e=r(p[p.length-1]);if(0!==i&&(e>=t&&(!1===n.wordWrap||!1===n.trim)&&(p.push(""),e=0),(e>0||!1===n.trim)&&(p[p.length-1]+=" ",e++)),n.hard&&d[i]>t){const n=t-e,r=1+Math.floor((d[i]-n-1)/t);Math.floor((d[i]-1)/t)t&&e>0&&d[i]>0){if(!1===n.wordWrap&&et&&!1===n.wordWrap?l(p,o,t):p[p.length-1]+=o}}!1!==n.trim&&(p=p.map(s)),c=p.join("\n");for(const[e,t]of[...c].entries()){if(f+=t,u.has(t)){const t=parseFloat(/\d[^m]*/.exec(c.slice(e,e+4)));i=39===t?null:t}const n=o.codes.get(Number(i));i&&n&&("\n"===c[e+1]?f+=a(n):"\n"===t&&(f+=a(i)))}return f};e.exports=(e,t,n)=>String(e).normalize().replace(/\r\n/g,"\n").split("\n").map(e=>c(e,t,n)).join("\n")},3354:function(module,exports){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,wrapper;wrapper=function(Module,cb){var Module;"function"==typeof Module&&(cb=Module,Module={}),Module.onRuntimeInitialized=function(e,t){return function(){e&&e.apply(this,arguments);try{Module.ccall("nbind_init")}catch(e){return void t(e)}t(null,{bind:Module._nbind_value,reflect:Module.NBind.reflect,queryType:Module.NBind.queryType,toggleLightGC:Module.toggleLightGC,lib:Module})}}(Module.onRuntimeInitialized,cb),Module||(Module=(void 0!==Module?Module:null)||{});var moduleOverrides={};for(var key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var ENVIRONMENT_IS_WEB=!1,ENVIRONMENT_IS_WORKER=!1,ENVIRONMENT_IS_NODE=!1,ENVIRONMENT_IS_SHELL=!1,nodeFS,nodePath;if(Module.ENVIRONMENT)if("WEB"===Module.ENVIRONMENT)ENVIRONMENT_IS_WEB=!0;else if("WORKER"===Module.ENVIRONMENT)ENVIRONMENT_IS_WORKER=!0;else if("NODE"===Module.ENVIRONMENT)ENVIRONMENT_IS_NODE=!0;else{if("SHELL"!==Module.ENVIRONMENT)throw new Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.");ENVIRONMENT_IS_SHELL=!0}else ENVIRONMENT_IS_WEB="object"==typeof window,ENVIRONMENT_IS_WORKER="function"==typeof importScripts,ENVIRONMENT_IS_NODE="object"==typeof process&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER,ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE)Module.print||(Module.print=console.log),Module.printErr||(Module.printErr=console.warn),Module.read=function(e,t){nodeFS||(nodeFS={}("")),nodePath||(nodePath={}("")),e=nodePath.normalize(e);var n=nodeFS.readFileSync(e);return t?n:n.toString()},Module.readBinary=function(e){var t=Module.read(e,!0);return t.buffer||(t=new Uint8Array(t)),assert(t.buffer),t},Module.load=function(e){globalEval(read(e))},Module.thisProgram||(process.argv.length>1?Module.thisProgram=process.argv[1].replace(/\\/g,"/"):Module.thisProgram="unknown-program"),Module.arguments=process.argv.slice(2),module.exports=Module,Module.inspect=function(){return"[Emscripten Module object]"};else if(ENVIRONMENT_IS_SHELL)Module.print||(Module.print=print),"undefined"!=typeof printErr&&(Module.printErr=printErr),"undefined"!=typeof read?Module.read=read:Module.read=function(){throw"no read() available"},Module.readBinary=function(e){if("function"==typeof readbuffer)return new Uint8Array(readbuffer(e));var t=read(e,"binary");return assert("object"==typeof t),t},"undefined"!=typeof scriptArgs?Module.arguments=scriptArgs:void 0!==arguments&&(Module.arguments=arguments),"function"==typeof quit&&(Module.quit=function(e,t){quit(e)});else{if(!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER)throw"Unknown runtime environment. Where are we?";if(Module.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},ENVIRONMENT_IS_WORKER&&(Module.readBinary=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),Module.readAsync=function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)},void 0!==arguments&&(Module.arguments=arguments),"undefined"!=typeof console)Module.print||(Module.print=function(e){console.log(e)}),Module.printErr||(Module.printErr=function(e){console.warn(e)});else{var TRY_USE_DUMP=!1;Module.print||(Module.print=TRY_USE_DUMP&&"undefined"!=typeof dump?function(e){dump(e)}:function(e){})}ENVIRONMENT_IS_WORKER&&(Module.load=importScripts),void 0===Module.setWindowTitle&&(Module.setWindowTitle=function(e){document.title=e})}function globalEval(e){eval.call(null,e)}for(var key in!Module.load&&Module.read&&(Module.load=function(e){globalEval(Module.read(e))}),Module.print||(Module.print=function(){}),Module.printErr||(Module.printErr=Module.print),Module.arguments||(Module.arguments=[]),Module.thisProgram||(Module.thisProgram="./this.program"),Module.quit||(Module.quit=function(e,t){throw t}),Module.print=Module.print,Module.printErr=Module.printErr,Module.preRun=[],Module.postRun=[],moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);moduleOverrides=void 0;var Runtime={setTempRet0:function(e){return tempRet0=e,e},getTempRet0:function(){return tempRet0},stackSave:function(){return STACKTOP},stackRestore:function(e){STACKTOP=e},getNativeTypeSize:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:if("*"===e[e.length-1])return Runtime.QUANTUM_SIZE;if("i"===e[0]){var t=parseInt(e.substr(1));return assert(t%8==0),t/8}return 0}},getNativeFieldSize:function(e){return Math.max(Runtime.getNativeTypeSize(e),Runtime.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(e,t){return"double"===t||"i64"===t?7&e&&(assert(4==(7&e)),e+=4):assert(0==(3&e)),e},getAlignSize:function(e,t,n){return n||"i64"!=e&&"double"!=e?e?Math.min(t||(e?Runtime.getNativeFieldSize(e):0),Runtime.QUANTUM_SIZE):Math.min(t,8):8},dynCall:function(e,t,n){return n&&n.length?Module["dynCall_"+e].apply(null,[t].concat(n)):Module["dynCall_"+e].call(null,t)},functionPointers:[],addFunction:function(e){for(var t=0;t>2],n=-16&(t+e+15|0);return HEAP32[DYNAMICTOP_PTR>>2]=n,n>=TOTAL_MEMORY&&!enlargeMemory()?(HEAP32[DYNAMICTOP_PTR>>2]=t,0):t},alignMemory:function(e,t){return e=Math.ceil(e/(t||16))*(t||16)},makeBigInt:function(e,t,n){return n?+(e>>>0)+4294967296*+(t>>>0):+(e>>>0)+4294967296*+(0|t)},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module.Runtime=Runtime;var ABORT=0,EXITSTATUS=0,cwrap,ccall;function assert(e,t){e||abort("Assertion failed: "+t)}function getCFunc(ident){var func=Module["_"+ident];if(!func)try{func=eval("_"+ident)}catch(e){}return assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)"),func}function setValue(e,t,n,r){switch("*"===(n=n||"i8").charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":HEAP8[e>>0]=t;break;case"i16":HEAP16[e>>1]=t;break;case"i32":HEAP32[e>>2]=t;break;case"i64":tempI64=[t>>>0,(tempDouble=t,+Math_abs(tempDouble)>=1?tempDouble>0?(0|Math_min(+Math_floor(tempDouble/4294967296),4294967295))>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[e>>2]=tempI64[0],HEAP32[e+4>>2]=tempI64[1];break;case"float":HEAPF32[e>>2]=t;break;case"double":HEAPF64[e>>3]=t;break;default:abort("invalid type for setValue: "+n)}}function getValue(e,t,n){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return HEAP8[e>>0];case"i16":return HEAP16[e>>1];case"i32":case"i64":return HEAP32[e>>2];case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];default:abort("invalid type for setValue: "+t)}return null}!function(){var JSfuncs={stackSave:function(){Runtime.stackSave()},stackRestore:function(){Runtime.stackRestore()},arrayToC:function(e){var t=Runtime.stackAlloc(e.length);return writeArrayToMemory(e,t),t},stringToC:function(e){var t=0;if(null!=e&&0!==e){var n=1+(e.length<<2);stringToUTF8(e,t=Runtime.stackAlloc(n),n)}return t}},toC={string:JSfuncs.stringToC,array:JSfuncs.arrayToC};ccall=function(e,t,n,r,i){var o=getCFunc(e),u=[],a=0;if(r)for(var l=0;l>2]=0;for(l=u+o;r>0]=0;return u}if("i8"===a)return e.subarray||e.slice?HEAPU8.set(e,u):HEAPU8.set(new Uint8Array(e),u),u;for(var s,c,f,d=0;d>0],(0!=n||t)&&(i++,!t||i!=t););t||(t=i);var o="";if(r<128){for(var u;t>0;)u=String.fromCharCode.apply(String,HEAPU8.subarray(e,e+Math.min(t,1024))),o=o?o+u:u,e+=1024,t-=1024;return o}return Module.UTF8ToString(e)}function AsciiToString(e){for(var t="";;){var n=HEAP8[e++>>0];if(!n)return t;t+=String.fromCharCode(n)}}function stringToAscii(e,t){return writeAsciiToMemory(e,t,!1)}Module.ALLOC_NORMAL=ALLOC_NORMAL,Module.ALLOC_STACK=ALLOC_STACK,Module.ALLOC_STATIC=ALLOC_STATIC,Module.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module.ALLOC_NONE=ALLOC_NONE,Module.allocate=allocate,Module.getMemory=getMemory,Module.Pointer_stringify=Pointer_stringify,Module.AsciiToString=AsciiToString,Module.stringToAscii=stringToAscii;var UTF8Decoder="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function UTF8ArrayToString(e,t){for(var n=t;e[n];)++n;if(n-t>16&&e.subarray&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,n));for(var r,i,o,u,a,l="";;){if(!(r=e[t++]))return l;if(128&r)if(i=63&e[t++],192!=(224&r))if(o=63&e[t++],224==(240&r)?r=(15&r)<<12|i<<6|o:(u=63&e[t++],240==(248&r)?r=(7&r)<<18|i<<12|o<<6|u:(a=63&e[t++],r=248==(252&r)?(3&r)<<24|i<<18|o<<12|u<<6|a:(1&r)<<30|i<<24|o<<18|u<<12|a<<6|63&e[t++])),r<65536)l+=String.fromCharCode(r);else{var s=r-65536;l+=String.fromCharCode(55296|s>>10,56320|1023&s)}else l+=String.fromCharCode((31&r)<<6|i);else l+=String.fromCharCode(r)}}function UTF8ToString(e){return UTF8ArrayToString(HEAPU8,e)}function stringToUTF8Array(e,t,n,r){if(!(r>0))return 0;for(var i=n,o=n+r-1,u=0;u=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++u)),a<=127){if(n>=o)break;t[n++]=a}else if(a<=2047){if(n+1>=o)break;t[n++]=192|a>>6,t[n++]=128|63&a}else if(a<=65535){if(n+2>=o)break;t[n++]=224|a>>12,t[n++]=128|a>>6&63,t[n++]=128|63&a}else if(a<=2097151){if(n+3>=o)break;t[n++]=240|a>>18,t[n++]=128|a>>12&63,t[n++]=128|a>>6&63,t[n++]=128|63&a}else if(a<=67108863){if(n+4>=o)break;t[n++]=248|a>>24,t[n++]=128|a>>18&63,t[n++]=128|a>>12&63,t[n++]=128|a>>6&63,t[n++]=128|63&a}else{if(n+5>=o)break;t[n++]=252|a>>30,t[n++]=128|a>>24&63,t[n++]=128|a>>18&63,t[n++]=128|a>>12&63,t[n++]=128|a>>6&63,t[n++]=128|63&a}}return t[n]=0,n-i}function stringToUTF8(e,t,n){return stringToUTF8Array(e,HEAPU8,t,n)}function lengthBytesUTF8(e){for(var t=0,n=0;n=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++n)),r<=127?++t:t+=r<=2047?2:r<=65535?3:r<=2097151?4:r<=67108863?5:6}return t}Module.UTF8ArrayToString=UTF8ArrayToString,Module.UTF8ToString=UTF8ToString,Module.stringToUTF8Array=stringToUTF8Array,Module.stringToUTF8=stringToUTF8,Module.lengthBytesUTF8=lengthBytesUTF8;var UTF16Decoder="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,HEAP,buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,STATIC_BASE,STATICTOP,staticSealed,STACK_BASE,STACKTOP,STACK_MAX,DYNAMIC_BASE,DYNAMICTOP_PTR;function demangle(e){var t=Module.___cxa_demangle||Module.__cxa_demangle;if(t){try{var n=e.substr(1),r=lengthBytesUTF8(n)+1,i=_malloc(r);stringToUTF8(n,i,r);var o=_malloc(4),u=t(i,0,0,o);if(0===getValue(o,"i32")&&u)return Pointer_stringify(u)}catch(e){}finally{i&&_free(i),o&&_free(o),u&&_free(u)}return e}return Runtime.warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),e}function demangleAll(e){return e.replace(/__Z[\w\d_]+/g,(function(e){var t=demangle(e);return e===t?e:e+" ["+t+"]"}))}function jsStackTrace(){var e=new Error;if(!e.stack){try{throw new Error(0)}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}function stackTrace(){var e=jsStackTrace();return Module.extraStackTrace&&(e+="\n"+Module.extraStackTrace()),demangleAll(e)}function updateGlobalBufferViews(){Module.HEAP8=HEAP8=new Int8Array(buffer),Module.HEAP16=HEAP16=new Int16Array(buffer),Module.HEAP32=HEAP32=new Int32Array(buffer),Module.HEAPU8=HEAPU8=new Uint8Array(buffer),Module.HEAPU16=HEAPU16=new Uint16Array(buffer),Module.HEAPU32=HEAPU32=new Uint32Array(buffer),Module.HEAPF32=HEAPF32=new Float32Array(buffer),Module.HEAPF64=HEAPF64=new Float64Array(buffer)}function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+TOTAL_MEMORY+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}function enlargeMemory(){abortOnCannotGrowMemory()}Module.stackTrace=stackTrace,STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0,staticSealed=!1;var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||134217728;function getTotalMemory(){return TOTAL_MEMORY}if(TOTAL_MEMORY0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?Module.dynCall_v(n):Module.dynCall_vi(n,t.arg):n(void 0===t.arg?null:t.arg)}else t()}}Module.HEAP=HEAP,Module.buffer=buffer,Module.HEAP8=HEAP8,Module.HEAP16=HEAP16,Module.HEAP32=HEAP32,Module.HEAPU8=HEAPU8,Module.HEAPU16=HEAPU16,Module.HEAPU32=HEAPU32,Module.HEAPF32=HEAPF32,Module.HEAPF64=HEAPF64;var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1,runtimeExited=!1;function preRun(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__),runtimeExited=!0}function postRun(){if(Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPreMain(e){__ATMAIN__.unshift(e)}function addOnExit(e){__ATEXIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}function intArrayFromString(e,t,n){var r=n>0?n:lengthBytesUTF8(e)+1,i=new Array(r),o=stringToUTF8Array(e,i,0,i.length);return t&&(i.length=o),i}function intArrayToString(e){for(var t=[],n=0;n255&&(r&=255),t.push(String.fromCharCode(r))}return t.join("")}function writeStringToMemory(e,t,n){var r,i;Runtime.warnOnce("writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!"),n&&(i=t+lengthBytesUTF8(e),r=HEAP8[i]),stringToUTF8(e,t,1/0),n&&(HEAP8[i]=r)}function writeArrayToMemory(e,t){HEAP8.set(e,t)}function writeAsciiToMemory(e,t,n){for(var r=0;r>0]=e.charCodeAt(r);n||(HEAP8[t>>0]=0)}if(Module.addOnPreRun=addOnPreRun,Module.addOnInit=addOnInit,Module.addOnPreMain=addOnPreMain,Module.addOnExit=addOnExit,Module.addOnPostRun=addOnPostRun,Module.intArrayFromString=intArrayFromString,Module.intArrayToString=intArrayToString,Module.writeStringToMemory=writeStringToMemory,Module.writeArrayToMemory=writeArrayToMemory,Module.writeAsciiToMemory=writeAsciiToMemory,Math.imul&&-5===Math.imul(4294967295,5)||(Math.imul=function(e,t){var n=65535&e,r=65535&t;return n*r+((e>>>16)*r+n*(t>>>16)<<16)|0}),Math.imul=Math.imul,!Math.fround){var froundBuffer=new Float32Array(1);Math.fround=function(e){return froundBuffer[0]=e,froundBuffer[0]}}Math.fround=Math.fround,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.clz32=Math.clz32,Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Math.trunc=Math.trunc;var Math_abs=Math.abs,Math_cos=Math.cos,Math_sin=Math.sin,Math_tan=Math.tan,Math_acos=Math.acos,Math_asin=Math.asin,Math_atan=Math.atan,Math_atan2=Math.atan2,Math_exp=Math.exp,Math_log=Math.log,Math_sqrt=Math.sqrt,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_pow=Math.pow,Math_imul=Math.imul,Math_fround=Math.fround,Math_round=Math.round,Math_min=Math.min,Math_clz32=Math.clz32,Math_trunc=Math.trunc,runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(e){return e}function addRunDependency(e){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}}Module.addRunDependency=addRunDependency,Module.removeRunDependency=removeRunDependency,Module.preloadedImages={},Module.preloadedAudios={};var ASM_CONSTS=[function(e,t,n,r,i,o,u,a){return _nbind.callbackSignatureList[e].apply(this,arguments)}];function _emscripten_asm_const_iiiiiiii(e,t,n,r,i,o,u,a){return ASM_CONSTS[e](t,n,r,i,o,u,a)}function _emscripten_asm_const_iiiii(e,t,n,r,i){return ASM_CONSTS[e](t,n,r,i)}function _emscripten_asm_const_iiidddddd(e,t,n,r,i,o,u,a,l){return ASM_CONSTS[e](t,n,r,i,o,u,a,l)}function _emscripten_asm_const_iiididi(e,t,n,r,i,o,u){return ASM_CONSTS[e](t,n,r,i,o,u)}function _emscripten_asm_const_iiii(e,t,n,r){return ASM_CONSTS[e](t,n,r)}function _emscripten_asm_const_iiiid(e,t,n,r,i){return ASM_CONSTS[e](t,n,r,i)}function _emscripten_asm_const_iiiiii(e,t,n,r,i,o){return ASM_CONSTS[e](t,n,r,i,o)}STATIC_BASE=Runtime.GLOBAL_BASE,STATICTOP=STATIC_BASE+12800,__ATINIT__.push({func:function(){__GLOBAL__sub_I_Yoga_cpp()}},{func:function(){__GLOBAL__sub_I_nbind_cc()}},{func:function(){__GLOBAL__sub_I_common_cc()}},{func:function(){__GLOBAL__sub_I_Binding_cc()}}),allocate([0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,192,127,0,0,192,127,0,0,192,127,3,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,3,0,0,0,0,0,192,127,3,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,192,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,192,127,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,0,128,191,0,0,128,191,0,0,192,127,0,0,0,0,0,0,0,0,0,0,128,63,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,3,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,190,12,0,0,200,12,0,0,208,12,0,0,216,12,0,0,230,12,0,0,242,12,0,0,1,0,0,0,3,0,0,0,0,0,0,0,2,0,0,0,0,0,192,127,3,0,0,0,180,45,0,0,181,45,0,0,182,45,0,0,181,45,0,0,182,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,1,0,0,0,4,0,0,0,183,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,184,45,0,0,185,45,0,0,181,45,0,0,181,45,0,0,182,45,0,0,186,45,0,0,185,45,0,0,148,4,0,0,3,0,0,0,187,45,0,0,164,4,0,0,188,45,0,0,2,0,0,0,189,45,0,0,164,4,0,0,188,45,0,0,185,45,0,0,164,4,0,0,185,45,0,0,164,4,0,0,188,45,0,0,181,45,0,0,182,45,0,0,181,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,5,0,0,0,6,0,0,0,1,0,0,0,7,0,0,0,183,45,0,0,182,45,0,0,181,45,0,0,190,45,0,0,190,45,0,0,182,45,0,0,182,45,0,0,185,45,0,0,181,45,0,0,185,45,0,0,182,45,0,0,181,45,0,0,185,45,0,0,182,45,0,0,185,45,0,0,48,5,0,0,3,0,0,0,56,5,0,0,1,0,0,0,189,45,0,0,185,45,0,0,164,4,0,0,76,5,0,0,2,0,0,0,191,45,0,0,186,45,0,0,182,45,0,0,185,45,0,0,192,45,0,0,185,45,0,0,182,45,0,0,186,45,0,0,185,45,0,0,76,5,0,0,76,5,0,0,136,5,0,0,182,45,0,0,181,45,0,0,2,0,0,0,190,45,0,0,136,5,0,0,56,19,0,0,156,5,0,0,2,0,0,0,184,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,8,0,0,0,9,0,0,0,1,0,0,0,10,0,0,0,204,5,0,0,181,45,0,0,181,45,0,0,2,0,0,0,180,45,0,0,204,5,0,0,2,0,0,0,195,45,0,0,236,5,0,0,97,19,0,0,198,45,0,0,211,45,0,0,212,45,0,0,213,45,0,0,214,45,0,0,215,45,0,0,188,45,0,0,182,45,0,0,216,45,0,0,217,45,0,0,218,45,0,0,219,45,0,0,192,45,0,0,181,45,0,0,0,0,0,0,185,45,0,0,110,19,0,0,186,45,0,0,115,19,0,0,221,45,0,0,120,19,0,0,148,4,0,0,132,19,0,0,96,6,0,0,145,19,0,0,222,45,0,0,164,19,0,0,223,45,0,0,173,19,0,0,0,0,0,0,3,0,0,0,104,6,0,0,1,0,0,0,187,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,11,0,0,0,12,0,0,0,1,0,0,0,13,0,0,0,185,45,0,0,224,45,0,0,164,6,0,0,188,45,0,0,172,6,0,0,180,6,0,0,2,0,0,0,188,6,0,0,7,0,0,0,224,45,0,0,7,0,0,0,164,6,0,0,1,0,0,0,213,45,0,0,185,45,0,0,224,45,0,0,172,6,0,0,185,45,0,0,224,45,0,0,164,6,0,0,185,45,0,0,224,45,0,0,211,45,0,0,211,45,0,0,222,45,0,0,211,45,0,0,224,45,0,0,222,45,0,0,211,45,0,0,224,45,0,0,172,6,0,0,222,45,0,0,211,45,0,0,224,45,0,0,188,45,0,0,222,45,0,0,211,45,0,0,40,7,0,0,188,45,0,0,2,0,0,0,224,45,0,0,185,45,0,0,188,45,0,0,188,45,0,0,188,45,0,0,188,45,0,0,222,45,0,0,224,45,0,0,148,4,0,0,185,45,0,0,148,4,0,0,148,4,0,0,148,4,0,0,148,4,0,0,148,4,0,0,185,45,0,0,164,6,0,0,148,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,14,0,0,0,15,0,0,0,1,0,0,0,16,0,0,0,148,7,0,0,2,0,0,0,225,45,0,0,183,45,0,0,188,45,0,0,168,7,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,234,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,148,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,9,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,2,0,0,0,242,45,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,111,117,108,100,32,110,111,116,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,32,102,111,114,32,110,111,100,101,0,67,97,110,110,111,116,32,114,101,115,101,116,32,97,32,110,111,100,101,32,119,104,105,99,104,32,115,116,105,108,108,32,104,97,115,32,99,104,105,108,100,114,101,110,32,97,116,116,97,99,104,101,100,0,67,97,110,110,111,116,32,114,101,115,101,116,32,97,32,110,111,100,101,32,115,116,105,108,108,32,97,116,116,97,99,104,101,100,32,116,111,32,97,32,112,97,114,101,110,116,0,67,111,117,108,100,32,110,111,116,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,32,102,111,114,32,99,111,110,102,105,103,0,67,97,110,110,111,116,32,115,101,116,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,58,32,78,111,100,101,115,32,119,105,116,104,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,32,99,97,110,110,111,116,32,104,97,118,101,32,99,104,105,108,100,114,101,110,46,0,67,104,105,108,100,32,97,108,114,101,97,100,121,32,104,97,115,32,97,32,112,97,114,101,110,116,44,32,105,116,32,109,117,115,116,32,98,101,32,114,101,109,111,118,101,100,32,102,105,114,115,116,46,0,67,97,110,110,111,116,32,97,100,100,32,99,104,105,108,100,58,32,78,111,100,101,115,32,119,105,116,104,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,32,99,97,110,110,111,116,32,104,97,118,101,32,99,104,105,108,100,114,101,110,46,0,79,110,108,121,32,108,101,97,102,32,110,111,100,101,115,32,119,105,116,104,32,99,117,115,116,111,109,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,115,104,111,117,108,100,32,109,97,110,117,97,108,108,121,32,109,97,114,107,32,116,104,101,109,115,101,108,118,101,115,32,97,115,32,100,105,114,116,121,0,67,97,110,110,111,116,32,103,101,116,32,108,97,121,111,117,116,32,112,114,111,112,101,114,116,105,101,115,32,111,102,32,109,117,108,116,105,45,101,100,103,101,32,115,104,111,114,116,104,97,110,100,115,0,37,115,37,100,46,123,91,115,107,105,112,112,101,100,93,32,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,97,119,58,32,37,102,32,97,104,58,32,37,102,32,61,62,32,100,58,32,40,37,102,44,32,37,102,41,32,37,115,10,0,37,115,37,100,46,123,37,115,0,42,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,97,119,58,32,37,102,32,97,104,58,32,37,102,32,37,115,10,0,37,115,37,100,46,125,37,115,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,100,58,32,40,37,102,44,32,37,102,41,32,37,115,10,0,79,117,116,32,111,102,32,99,97,99,104,101,32,101,110,116,114,105,101,115,33,10,0,83,99,97,108,101,32,102,97,99,116,111,114,32,115,104,111,117,108,100,32,110,111,116,32,98,101,32,108,101,115,115,32,116,104,97,110,32,122,101,114,111,0,105,110,105,116,105,97,108,0,37,115,10,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,85,78,68,69,70,73,78,69,68,0,69,88,65,67,84,76,89,0,65,84,95,77,79,83,84,0,76,65,89,95,85,78,68,69,70,73,78,69,68,0,76,65,89,95,69,88,65,67,84,76,89,0,76,65,89,95,65,84,95,77,79,83,84,0,97,118,97,105,108,97,98,108,101,87,105,100,116,104,32,105,115,32,105,110,100,101,102,105,110,105,116,101,32,115,111,32,119,105,100,116,104,77,101,97,115,117,114,101,77,111,100,101,32,109,117,115,116,32,98,101,32,89,71,77,101,97,115,117,114,101,77,111,100,101,85,110,100,101,102,105,110,101,100,0,97,118,97,105,108,97,98,108,101,72,101,105,103,104,116,32,105,115,32,105,110,100,101,102,105,110,105,116,101,32,115,111,32,104,101,105,103,104,116,77,101,97,115,117,114,101,77,111,100,101,32,109,117,115,116,32,98,101,32,89,71,77,101,97,115,117,114,101,77,111,100,101,85,110,100,101,102,105,110,101,100,0,102,108,101,120,0,115,116,114,101,116,99,104,0,109,117,108,116,105,108,105,110,101,45,115,116,114,101,116,99,104,0,69,120,112,101,99,116,101,100,32,110,111,100,101,32,116,111,32,104,97,118,101,32,99,117,115,116,111,109,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,0,109,101,97,115,117,114,101,0,69,120,112,101,99,116,32,99,117,115,116,111,109,32,98,97,115,101,108,105,110,101,32,102,117,110,99,116,105,111,110,32,116,111,32,110,111,116,32,114,101,116,117,114,110,32,78,97,78,0,97,98,115,45,109,101,97,115,117,114,101,0,97,98,115,45,108,97,121,111,117,116,0,78,111,100,101,0,99,114,101,97,116,101,68,101,102,97,117,108,116,0,99,114,101,97,116,101,87,105,116,104,67,111,110,102,105,103,0,100,101,115,116,114,111,121,0,114,101,115,101,116,0,99,111,112,121,83,116,121,108,101,0,115,101,116,80,111,115,105,116,105,111,110,84,121,112,101,0,115,101,116,80,111,115,105,116,105,111,110,0,115,101,116,80,111,115,105,116,105,111,110,80,101,114,99,101,110,116,0,115,101,116,65,108,105,103,110,67,111,110,116,101,110,116,0,115,101,116,65,108,105,103,110,73,116,101,109,115,0,115,101,116,65,108,105,103,110,83,101,108,102,0,115,101,116,70,108,101,120,68,105,114,101,99,116,105,111,110,0,115,101,116,70,108,101,120,87,114,97,112,0,115,101,116,74,117,115,116,105,102,121,67,111,110,116,101,110,116,0,115,101,116,77,97,114,103,105,110,0,115,101,116,77,97,114,103,105,110,80,101,114,99,101,110,116,0,115,101,116,77,97,114,103,105,110,65,117,116,111,0,115,101,116,79,118,101,114,102,108,111,119,0,115,101,116,68,105,115,112,108,97,121,0,115,101,116,70,108,101,120,0,115,101,116,70,108,101,120,66,97,115,105,115,0,115,101,116,70,108,101,120,66,97,115,105,115,80,101,114,99,101,110,116,0,115,101,116,70,108,101,120,71,114,111,119,0,115,101,116,70,108,101,120,83,104,114,105,110,107,0,115,101,116,87,105,100,116,104,0,115,101,116,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,87,105,100,116,104,65,117,116,111,0,115,101,116,72,101,105,103,104,116,0,115,101,116,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,72,101,105,103,104,116,65,117,116,111,0,115,101,116,77,105,110,87,105,100,116,104,0,115,101,116,77,105,110,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,77,105,110,72,101,105,103,104,116,0,115,101,116,77,105,110,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,77,97,120,87,105,100,116,104,0,115,101,116,77,97,120,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,77,97,120,72,101,105,103,104,116,0,115,101,116,77,97,120,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,65,115,112,101,99,116,82,97,116,105,111,0,115,101,116,66,111,114,100,101,114,0,115,101,116,80,97,100,100,105,110,103,0,115,101,116,80,97,100,100,105,110,103,80,101,114,99,101,110,116,0,103,101,116,80,111,115,105,116,105,111,110,84,121,112,101,0,103,101,116,80,111,115,105,116,105,111,110,0,103,101,116,65,108,105,103,110,67,111,110,116,101,110,116,0,103,101,116,65,108,105,103,110,73,116,101,109,115,0,103,101,116,65,108,105,103,110,83,101,108,102,0,103,101,116,70,108,101,120,68,105,114,101,99,116,105,111,110,0,103,101,116,70,108,101,120,87,114,97,112,0,103,101,116,74,117,115,116,105,102,121,67,111,110,116,101,110,116,0,103,101,116,77,97,114,103,105,110,0,103,101,116,70,108,101,120,66,97,115,105,115,0,103,101,116,70,108,101,120,71,114,111,119,0,103,101,116,70,108,101,120,83,104,114,105,110,107,0,103,101,116,87,105,100,116,104,0,103,101,116,72,101,105,103,104,116,0,103,101,116,77,105,110,87,105,100,116,104,0,103,101,116,77,105,110,72,101,105,103,104,116,0,103,101,116,77,97,120,87,105,100,116,104,0,103,101,116,77,97,120,72,101,105,103,104,116,0,103,101,116,65,115,112,101,99,116,82,97,116,105,111,0,103,101,116,66,111,114,100,101,114,0,103,101,116,79,118,101,114,102,108,111,119,0,103,101,116,68,105,115,112,108,97,121,0,103,101,116,80,97,100,100,105,110,103,0,105,110,115,101,114,116,67,104,105,108,100,0,114,101,109,111,118,101,67,104,105,108,100,0,103,101,116,67,104,105,108,100,67,111,117,110,116,0,103,101,116,80,97,114,101,110,116,0,103,101,116,67,104,105,108,100,0,115,101,116,77,101,97,115,117,114,101,70,117,110,99,0,117,110,115,101,116,77,101,97,115,117,114,101,70,117,110,99,0,109,97,114,107,68,105,114,116,121,0,105,115,68,105,114,116,121,0,99,97,108,99,117,108,97,116,101,76,97,121,111,117,116,0,103,101,116,67,111,109,112,117,116,101,100,76,101,102,116,0,103,101,116,67,111,109,112,117,116,101,100,82,105,103,104,116,0,103,101,116,67,111,109,112,117,116,101,100,84,111,112,0,103,101,116,67,111,109,112,117,116,101,100,66,111,116,116,111,109,0,103,101,116,67,111,109,112,117,116,101,100,87,105,100,116,104,0,103,101,116,67,111,109,112,117,116,101,100,72,101,105,103,104,116,0,103,101,116,67,111,109,112,117,116,101,100,76,97,121,111,117,116,0,103,101,116,67,111,109,112,117,116,101,100,77,97,114,103,105,110,0,103,101,116,67,111,109,112,117,116,101,100,66,111,114,100,101,114,0,103,101,116,67,111,109,112,117,116,101,100,80,97,100,100,105,110,103,0,67,111,110,102,105,103,0,99,114,101,97,116,101,0,115,101,116,69,120,112,101,114,105,109,101,110,116,97,108,70,101,97,116,117,114,101,69,110,97,98,108,101,100,0,115,101,116,80,111,105,110,116,83,99,97,108,101,70,97,99,116,111,114,0,105,115,69,120,112,101,114,105,109,101,110,116,97,108,70,101,97,116,117,114,101,69,110,97,98,108,101,100,0,86,97,108,117,101,0,76,97,121,111,117,116,0,83,105,122,101,0,103,101,116,73,110,115,116,97,110,99,101,67,111,117,110,116,0,73,110,116,54,52,0,1,1,1,2,2,4,4,4,4,8,8,4,8,118,111,105,100,0,98,111,111,108,0,115,116,100,58,58,115,116,114,105,110,103,0,99,98,70,117,110,99,116,105,111,110,32,38,0,99,111,110,115,116,32,99,98,70,117,110,99,116,105,111,110,32,38,0,69,120,116,101,114,110,97,108,0,66,117,102,102,101,114,0,78,66,105,110,100,73,68,0,78,66,105,110,100,0,98,105,110,100,95,118,97,108,117,101,0,114,101,102,108,101,99,116,0,113,117,101,114,121,84,121,112,101,0,108,97,108,108,111,99,0,108,114,101,115,101,116,0,123,114,101,116,117,114,110,40,95,110,98,105,110,100,46,99,97,108,108,98,97,99,107,83,105,103,110,97,116,117,114,101,76,105,115,116,91,36,48,93,46,97,112,112,108,121,40,116,104,105,115,44,97,114,103,117,109,101,110,116,115,41,41,59,125,0,95,110,98,105,110,100,95,110,101,119,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,46,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE);var tempDoublePtr=STATICTOP;function _atexit(e,t){__ATEXIT__.unshift({func:e,arg:t})}function ___cxa_atexit(){return _atexit.apply(null,arguments)}function _abort(){Module.abort()}function __ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj(){Module.printErr("missing function: _ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj"),abort(-1)}function __decorate(e,t,n,r){var i,o=arguments.length,u=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(u=(o<3?i(u):o>3?i(t,n,u):i(t,n))||u);return o>3&&u&&Object.defineProperty(t,n,u),u}function _defineHidden(e){return function(t,n){Object.defineProperty(t,n,{configurable:!1,enumerable:!1,value:e,writable:!0})}}STATICTOP+=16;var _nbind={};function __nbind_free_external(e){_nbind.externalList[e].dereference(e)}function __nbind_reference_external(e){_nbind.externalList[e].reference()}function _llvm_stackrestore(e){var t=_llvm_stacksave,n=t.LLVM_SAVEDSTACKS[e];t.LLVM_SAVEDSTACKS.splice(e,1),Runtime.stackRestore(n)}function __nbind_register_pool(e,t,n,r){_nbind.Pool.pageSize=e,_nbind.Pool.usedPtr=t/4,_nbind.Pool.rootPtr=n,_nbind.Pool.pagePtr=r/4,HEAP32[t/4]=16909060,1==HEAP8[t]&&(_nbind.bigEndian=!0),HEAP32[t/4]=0,_nbind.makeTypeKindTbl=((i={})[1024]=_nbind.PrimitiveType,i[64]=_nbind.Int64Type,i[2048]=_nbind.BindClass,i[3072]=_nbind.BindClassPtr,i[4096]=_nbind.SharedClassPtr,i[5120]=_nbind.ArrayType,i[6144]=_nbind.ArrayType,i[7168]=_nbind.CStringType,i[9216]=_nbind.CallbackType,i[10240]=_nbind.BindType,i),_nbind.makeTypeNameTbl={Buffer:_nbind.BufferType,External:_nbind.ExternalType,Int64:_nbind.Int64Type,_nbind_new:_nbind.CreateValueType,bool:_nbind.BooleanType,"cbFunction &":_nbind.CallbackType,"const cbFunction &":_nbind.CallbackType,"const std::string &":_nbind.StringType,"std::string":_nbind.StringType},Module.toggleLightGC=_nbind.toggleLightGC,_nbind.callUpcast=Module.dynCall_ii;var i,o=_nbind.makeType(_nbind.constructType,{flags:2048,id:0,name:""});o.proto=Module,_nbind.BindClass.list.push(o)}function _emscripten_set_main_loop_timing(e,t){if(Browser.mainLoop.timingMode=e,Browser.mainLoop.timingValue=t,!Browser.mainLoop.func)return 1;if(0==e)Browser.mainLoop.scheduler=function(){var e=0|Math.max(0,Browser.mainLoop.tickStartTime+t-_emscripten_get_now());setTimeout(Browser.mainLoop.runner,e)},Browser.mainLoop.method="timeout";else if(1==e)Browser.mainLoop.scheduler=function(){Browser.requestAnimationFrame(Browser.mainLoop.runner)},Browser.mainLoop.method="rAF";else if(2==e){if(!window.setImmediate){var n=[];window.addEventListener("message",(function(e){e.source===window&&"setimmediate"===e.data&&(e.stopPropagation(),n.shift()())}),!0),window.setImmediate=function(e){n.push(e),ENVIRONMENT_IS_WORKER?(void 0===Module.setImmediates&&(Module.setImmediates=[]),Module.setImmediates.push(e),window.postMessage({target:"setimmediate"})):window.postMessage("setimmediate","*")}}Browser.mainLoop.scheduler=function(){window.setImmediate(Browser.mainLoop.runner)},Browser.mainLoop.method="immediate"}return 0}function _emscripten_get_now(){abort()}function _emscripten_set_main_loop(e,t,n,r,i){var o;Module.noExitRuntime=!0,assert(!Browser.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Browser.mainLoop.func=e,Browser.mainLoop.arg=r,o=void 0!==r?function(){Module.dynCall_vi(e,r)}:function(){Module.dynCall_v(e)};var u=Browser.mainLoop.currentlyRunningMainloop;if(Browser.mainLoop.runner=function(){if(!ABORT)if(Browser.mainLoop.queue.length>0){var e=Date.now(),t=Browser.mainLoop.queue.shift();if(t.func(t.arg),Browser.mainLoop.remainingBlockers){var n=Browser.mainLoop.remainingBlockers,r=n%1==0?n-1:Math.floor(n);t.counted?Browser.mainLoop.remainingBlockers=r:(r+=.5,Browser.mainLoop.remainingBlockers=(8*n+r)/9)}if(console.log('main loop blocker "'+t.name+'" took '+(Date.now()-e)+" ms"),Browser.mainLoop.updateStatus(),u1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0?Browser.mainLoop.scheduler():(0==Browser.mainLoop.timingMode&&(Browser.mainLoop.tickStartTime=_emscripten_get_now()),"timeout"===Browser.mainLoop.method&&Module.ctx&&(Module.printErr("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"),Browser.mainLoop.method=""),Browser.mainLoop.runIter(o),u0?_emscripten_set_main_loop_timing(0,1e3/t):_emscripten_set_main_loop_timing(1,1),Browser.mainLoop.scheduler()),n)throw"SimulateInfiniteLoop"}var Browser={mainLoop:{scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){Browser.mainLoop.scheduler=null,Browser.mainLoop.currentlyRunningMainloop++},resume:function(){Browser.mainLoop.currentlyRunningMainloop++;var e=Browser.mainLoop.timingMode,t=Browser.mainLoop.timingValue,n=Browser.mainLoop.func;Browser.mainLoop.func=null,_emscripten_set_main_loop(n,0,!1,Browser.mainLoop.arg,!0),_emscripten_set_main_loop_timing(e,t),Browser.mainLoop.scheduler()},updateStatus:function(){if(Module.setStatus){var e=Module.statusMessage||"Please wait...",t=Browser.mainLoop.remainingBlockers,n=Browser.mainLoop.expectedBlockers;t?t=6;){var u=r>>i-6&63;i-=6,n+=t[u]}return 2==i?(n+=t[(3&r)<<4],n+="=="):4==i&&(n+=t[(15&r)<<2],n+="="),n}(e),o(s))},s.src=l,Browser.safeSetTimeout((function(){o(s)}),1e4)}};Module.preloadPlugins.push(t);var n=Module.canvas;n&&(n.requestPointerLock=n.requestPointerLock||n.mozRequestPointerLock||n.webkitRequestPointerLock||n.msRequestPointerLock||function(){},n.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},n.exitPointerLock=n.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",r,!1),document.addEventListener("mozpointerlockchange",r,!1),document.addEventListener("webkitpointerlockchange",r,!1),document.addEventListener("mspointerlockchange",r,!1),Module.elementPointerLock&&n.addEventListener("click",(function(e){!Browser.pointerLock&&Module.canvas.requestPointerLock&&(Module.canvas.requestPointerLock(),e.preventDefault())}),!1))}function r(){Browser.pointerLock=document.pointerLockElement===Module.canvas||document.mozPointerLockElement===Module.canvas||document.webkitPointerLockElement===Module.canvas||document.msPointerLockElement===Module.canvas}},createContext:function(e,t,n,r){if(t&&Module.ctx&&e==Module.canvas)return Module.ctx;var i,o;if(t){var u={antialias:!1,alpha:!1};if(r)for(var a in r)u[a]=r[a];(o=GL.createContext(e,u))&&(i=GL.getContext(o).GLctx)}else i=e.getContext("2d");return i?(n&&(t||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),Module.ctx=i,t&&GL.makeContextCurrent(o),Module.useWebGL=t,Browser.moduleContextCreatedCallbacks.forEach((function(e){e()})),Browser.init()),i):null},destroyContext:function(e,t,n){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(e,t,n){Browser.lockPointer=e,Browser.resizeCanvas=t,Browser.vrDevice=n,void 0===Browser.lockPointer&&(Browser.lockPointer=!0),void 0===Browser.resizeCanvas&&(Browser.resizeCanvas=!1),void 0===Browser.vrDevice&&(Browser.vrDevice=null);var r=Module.canvas;function i(){Browser.isFullscreen=!1;var e=r.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(r.exitFullscreen=document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){},r.exitFullscreen=r.exitFullscreen.bind(document),Browser.lockPointer&&r.requestPointerLock(),Browser.isFullscreen=!0,Browser.resizeCanvas&&Browser.setFullscreenCanvasSize()):(e.parentNode.insertBefore(r,e),e.parentNode.removeChild(e),Browser.resizeCanvas&&Browser.setWindowedCanvasSize()),Module.onFullScreen&&Module.onFullScreen(Browser.isFullscreen),Module.onFullscreen&&Module.onFullscreen(Browser.isFullscreen),Browser.updateCanvasDimensions(r)}Browser.fullscreenHandlersInstalled||(Browser.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",i,!1),document.addEventListener("mozfullscreenchange",i,!1),document.addEventListener("webkitfullscreenchange",i,!1),document.addEventListener("MSFullscreenChange",i,!1));var o=document.createElement("div");r.parentNode.insertBefore(o,r),o.appendChild(r),o.requestFullscreen=o.requestFullscreen||o.mozRequestFullScreen||o.msRequestFullscreen||(o.webkitRequestFullscreen?function(){o.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}:null)||(o.webkitRequestFullScreen?function(){o.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),n?o.requestFullscreen({vrDisplay:n}):o.requestFullscreen()},requestFullScreen:function(e,t,n){return Module.printErr("Browser.requestFullScreen() is deprecated. Please call Browser.requestFullscreen instead."),Browser.requestFullScreen=function(e,t,n){return Browser.requestFullscreen(e,t,n)},Browser.requestFullscreen(e,t,n)},nextRAF:0,fakeRequestAnimationFrame:function(e){var t=Date.now();if(0===Browser.nextRAF)Browser.nextRAF=t+1e3/60;else for(;t+2>=Browser.nextRAF;)Browser.nextRAF+=1e3/60;var n=Math.max(Browser.nextRAF-t,0);setTimeout(e,n)},requestAnimationFrame:function(e){"undefined"==typeof window?Browser.fakeRequestAnimationFrame(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||Browser.fakeRequestAnimationFrame),window.requestAnimationFrame(e))},safeCallback:function(e){return function(){if(!ABORT)return e.apply(null,arguments)}},allowAsyncCallbacks:!0,queuedAsyncCallbacks:[],pauseAsyncCallbacks:function(){Browser.allowAsyncCallbacks=!1},resumeAsyncCallbacks:function(){if(Browser.allowAsyncCallbacks=!0,Browser.queuedAsyncCallbacks.length>0){var e=Browser.queuedAsyncCallbacks;Browser.queuedAsyncCallbacks=[],e.forEach((function(e){e()}))}},safeRequestAnimationFrame:function(e){return Browser.requestAnimationFrame((function(){ABORT||(Browser.allowAsyncCallbacks?e():Browser.queuedAsyncCallbacks.push(e))}))},safeSetTimeout:function(e,t){return Module.noExitRuntime=!0,setTimeout((function(){ABORT||(Browser.allowAsyncCallbacks?e():Browser.queuedAsyncCallbacks.push(e))}),t)},safeSetInterval:function(e,t){return Module.noExitRuntime=!0,setInterval((function(){ABORT||Browser.allowAsyncCallbacks&&e()}),t)},getMimetype:function(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]},getUserMedia:function(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:function(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY:function(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta:function(e){var t=0;switch(e.type){case"DOMMouseScroll":t=e.detail;break;case"mousewheel":t=e.wheelDelta;break;case"wheel":t=e.deltaY;break;default:throw"unrecognized mouse wheel event: "+e.type}return t},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(e){if(Browser.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?Browser.mouseMovementX=Browser.mouseMovementY=0:(Browser.mouseMovementX=Browser.getMovementX(e),Browser.mouseMovementY=Browser.getMovementY(e)),"undefined"!=typeof SDL?(Browser.mouseX=SDL.mouseX+Browser.mouseMovementX,Browser.mouseY=SDL.mouseY+Browser.mouseMovementY):(Browser.mouseX+=Browser.mouseMovementX,Browser.mouseY+=Browser.mouseMovementY);else{var t=Module.canvas.getBoundingClientRect(),n=Module.canvas.width,r=Module.canvas.height,i=void 0!==window.scrollX?window.scrollX:window.pageXOffset,o=void 0!==window.scrollY?window.scrollY:window.pageYOffset;if("touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var u=e.touch;if(void 0===u)return;var a=u.pageX-(i+t.left),l=u.pageY-(o+t.top),s={x:a*=n/t.width,y:l*=r/t.height};if("touchstart"===e.type)Browser.lastTouches[u.identifier]=s,Browser.touches[u.identifier]=s;else if("touchend"===e.type||"touchmove"===e.type){var c=Browser.touches[u.identifier];c||(c=s),Browser.lastTouches[u.identifier]=c,Browser.touches[u.identifier]=s}return}var f=e.pageX-(i+t.left),d=e.pageY-(o+t.top);f*=n/t.width,d*=r/t.height,Browser.mouseMovementX=f-Browser.mouseX,Browser.mouseMovementY=d-Browser.mouseY,Browser.mouseX=f,Browser.mouseY=d}},asyncLoad:function(e,t,n,r){var i=r?"":getUniqueRunDependency("al "+e);Module.readAsync(e,(function(n){assert(n,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(n)),i&&removeRunDependency(i)}),(function(t){if(!n)throw'Loading data file "'+e+'" failed.';n()})),i&&addRunDependency(i)},resizeListeners:[],updateResizeListeners:function(){var e=Module.canvas;Browser.resizeListeners.forEach((function(t){t(e.width,e.height)}))},setCanvasSize:function(e,t,n){var r=Module.canvas;Browser.updateCanvasDimensions(r,e,t),n||Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if("undefined"!=typeof SDL){var e=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];e|=8388608,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=e}Browser.updateResizeListeners()},setWindowedCanvasSize:function(){if("undefined"!=typeof SDL){var e=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];e&=-8388609,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=e}Browser.updateResizeListeners()},updateCanvasDimensions:function(e,t,n){t&&n?(e.widthNative=t,e.heightNative=n):(t=e.widthNative,n=e.heightNative);var r=t,i=n;if(Module.forcedAspectRatio&&Module.forcedAspectRatio>0&&(r/i>2]},getStr:function(){return Pointer_stringify(SYSCALLS.get())},get64:function(){var e=SYSCALLS.get(),t=SYSCALLS.get();return assert(e>=0?0===t:-1===t),e},getZero:function(){assert(0===SYSCALLS.get())}};function ___syscall6(e,t){SYSCALLS.varargs=t;try{var n=SYSCALLS.getStreamFromFD();return FS.close(n),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall54(e,t){SYSCALLS.varargs=t;try{return 0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function _typeModule(e){var t=[[0,1,"X"],[1,1,"const X"],[128,1,"X *"],[256,1,"X &"],[384,1,"X &&"],[512,1,"std::shared_ptr"],[640,1,"std::unique_ptr"],[5120,1,"std::vector"],[6144,2,"std::array"],[9216,-1,"std::function"]];function n(e,t,n,r,i,o){if(1==t){var u=896&r;128!=u&&256!=u&&384!=u||(e="X const")}return(o?n.replace("X",e).replace("Y",i):e.replace("X",n).replace("Y",i)).replace(/([*&]) (?=[*&])/g,"$1")}function r(e,t){var n=t.flags,r=896&n,i=15360&n;return t.name||1024!=i||(1==t.ptrSize?t.name=(16&n?"":(8&n?"un":"")+"signed ")+"char":t.name=(8&n?"u":"")+(32&n?"float":"int")+8*t.ptrSize+"_t"),8!=t.ptrSize||32&n||(i=64),2048==i&&(512==r||640==r?i=4096:r&&(i=3072)),e(i,t)}var i={Type:function(){function e(e){this.id=e.id,this.name=e.name,this.flags=e.flags,this.spec=e}return e.prototype.toString=function(){return this.name},e}(),getComplexType:function e(i,o,u,a,l,s,c,f){void 0===s&&(s="X"),void 0===f&&(f=1);var d=u(i);if(d)return d;var p,h=a(i),v=h.placeholderFlag,m=t[v];c&&m&&(s=n(c[2],c[0],s,m[0],"?",!0)),0==v&&(p="Unbound"),v>=10&&(p="Corrupt"),f>20&&(p="Deeply nested"),p&&function(e,t,n,r,i){throw new Error(e+" type "+n.replace("X",t+"?")+(r?" with flag "+r:"")+" in "+i)}(p,i,s,v,l||"?");var g,_=e(h.paramList[0],o,u,a,l,s,m,f+1),y={flags:m[0],id:i,name:"",paramList:[_]},b=[],w="?";switch(h.placeholderFlag){case 1:g=_.spec;break;case 2:if(1024==(15360&_.flags)&&1==_.spec.ptrSize){y.flags=7168;break}case 3:case 6:case 5:g=_.spec,_.flags;break;case 8:w=""+h.paramList[1],y.paramList.push(h.paramList[1]);break;case 9:for(var E=0,D=h.paramList[1];E>2]=e),e}function _llvm_stacksave(){var e=_llvm_stacksave;return e.LLVM_SAVEDSTACKS||(e.LLVM_SAVEDSTACKS=[]),e.LLVM_SAVEDSTACKS.push(Runtime.stackSave()),e.LLVM_SAVEDSTACKS.length-1}function ___syscall140(e,t){SYSCALLS.varargs=t;try{var n=SYSCALLS.getStreamFromFD(),r=(SYSCALLS.get(),SYSCALLS.get()),i=SYSCALLS.get(),o=SYSCALLS.get(),u=r;return FS.llseek(n,u,o),HEAP32[i>>2]=n.position,n.getdents&&0===u&&0===o&&(n.getdents=null),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall146(e,t){SYSCALLS.varargs=t;try{var n=SYSCALLS.get(),r=SYSCALLS.get(),i=SYSCALLS.get(),o=0;___syscall146.buffer||(___syscall146.buffers=[null,[],[]],___syscall146.printChar=function(e,t){var n=___syscall146.buffers[e];assert(n),0===t||10===t?((1===e?Module.print:Module.printErr)(UTF8ArrayToString(n,0)),n.length=0):n.push(t)});for(var u=0;u>2],l=HEAP32[r+(8*u+4)>>2],s=0;se.pageSize/2||t>e.pageSize-n?_nbind.typeNameTbl.NBind.proto.lalloc(t):(HEAPU32[e.usedPtr]=n+t,e.rootPtr+n)},e.lreset=function(t,n){HEAPU32[e.pagePtr]?_nbind.typeNameTbl.NBind.proto.lreset(t,n):HEAPU32[e.usedPtr]=t},e}();function constructType(e,t){var n=new(10240==e?_nbind.makeTypeNameTbl[t.name]||_nbind.BindType:_nbind.makeTypeKindTbl[e])(t);return typeIdTbl[t.id]=n,_nbind.typeNameTbl[t.name]=n,n}function getType(e){return typeIdTbl[e]}function queryType(e){var t=HEAPU8[e],n=_nbind.structureList[t][1];e/=4,n<0&&(++e,n=HEAPU32[e]+1);var r=Array.prototype.slice.call(HEAPU32.subarray(e+1,e+1+n));return 9==t&&(r=[r[0],r.slice(1)]),{paramList:r,placeholderFlag:t}}function getTypes(e,t){return e.map((function(e){return"number"==typeof e?_nbind.getComplexType(e,constructType,getType,queryType,t):_nbind.typeNameTbl[e]}))}function readTypeIdList(e,t){return Array.prototype.slice.call(HEAPU32,e/4,e/4+t)}function readAsciiString(e){for(var t=e;HEAPU8[t++];);return String.fromCharCode.apply("",HEAPU8.subarray(e,t-1))}function readPolicyList(e){var t={};if(e)for(;;){var n=HEAPU32[e/4];if(!n)break;t[readAsciiString(n)]=!0,e+=4}return t}function getDynCall(e,t){var n={float32_t:"d",float64_t:"d",int64_t:"d",uint64_t:"d",void:"v"},r=e.map((function(e){return n[e.name]||"i"})).join(""),i=Module["dynCall_"+r];if(!i)throw new Error("dynCall_"+r+" not found for "+t+"("+e.map((function(e){return e.name})).join(", ")+")");return i}function addMethod(e,t,n,r){var i=e[t];e.hasOwnProperty(t)&&i?((i.arity||0===i.arity)&&(i=_nbind.makeOverloader(i,i.arity),e[t]=i),i.addMethod(n,r)):(n.arity=r,e[t]=n)}function throwError(e){throw new Error(e)}_nbind.Pool=Pool,_nbind.constructType=constructType,_nbind.getType=getType,_nbind.queryType=queryType,_nbind.getTypes=getTypes,_nbind.readTypeIdList=readTypeIdList,_nbind.readAsciiString=readAsciiString,_nbind.readPolicyList=readPolicyList,_nbind.getDynCall=getDynCall,_nbind.addMethod=addMethod,_nbind.throwError=throwError,_nbind.bigEndian=!1,_a=_typeModule(_typeModule),_nbind.Type=_a.Type,_nbind.makeType=_a.makeType,_nbind.getComplexType=_a.getComplexType,_nbind.structureList=_a.structureList;var BindType=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.heap=HEAPU32,t.ptrSize=4,t}return __extends(t,e),t.prototype.needsWireRead=function(e){return!!this.wireRead||!!this.makeWireRead},t.prototype.needsWireWrite=function(e){return!!this.wireWrite||!!this.makeWireWrite},t}(_nbind.Type);_nbind.BindType=BindType;var PrimitiveType=function(e){function t(t){var n=e.call(this,t)||this,r=32&t.flags?{32:HEAPF32,64:HEAPF64}:8&t.flags?{8:HEAPU8,16:HEAPU16,32:HEAPU32}:{8:HEAP8,16:HEAP16,32:HEAP32};return n.heap=r[8*t.ptrSize],n.ptrSize=t.ptrSize,n}return __extends(t,e),t.prototype.needsWireWrite=function(e){return!!e&&!!e.Strict},t.prototype.makeWireWrite=function(e,t){return t&&t.Strict&&function(e){if("number"==typeof e)return e;throw new Error("Type mismatch")}},t}(BindType);function pushCString(e,t){if(null==e){if(t&&t.Nullable)return 0;throw new Error("Type mismatch")}if(t&&t.Strict){if("string"!=typeof e)throw new Error("Type mismatch")}else e=e.toString();var n=Module.lengthBytesUTF8(e)+1,r=_nbind.Pool.lalloc(n);return Module.stringToUTF8Array(e,HEAPU8,r,n),r}function popCString(e){return 0===e?null:Module.Pointer_stringify(e)}_nbind.PrimitiveType=PrimitiveType,_nbind.pushCString=pushCString,_nbind.popCString=popCString;var CStringType=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.wireRead=popCString,t.wireWrite=pushCString,t.readResources=[_nbind.resources.pool],t.writeResources=[_nbind.resources.pool],t}return __extends(t,e),t.prototype.makeWireWrite=function(e,t){return function(e){return pushCString(e,t)}},t}(BindType);_nbind.CStringType=CStringType;var BooleanType=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.wireRead=function(e){return!!e},t}return __extends(t,e),t.prototype.needsWireWrite=function(e){return!!e&&!!e.Strict},t.prototype.makeWireRead=function(e){return"!!("+e+")"},t.prototype.makeWireWrite=function(e,t){return t&&t.Strict&&function(e){if("boolean"==typeof e)return e;throw new Error("Type mismatch")}||e},t}(BindType);_nbind.BooleanType=BooleanType;var Wrapper=function(){function e(){}return e.prototype.persist=function(){this.__nbindState|=1},e}();function makeBound(e,t){var n=function(e){function n(t,r,i,o){var u=e.call(this)||this;if(!(u instanceof n))return new(Function.prototype.bind.apply(n,Array.prototype.concat.apply([null],arguments)));var a=r,l=i,s=o;if(t!==_nbind.ptrMarker){var c=u.__nbindConstructor.apply(u,arguments);a=4608,s=HEAPU32[c/4],l=HEAPU32[c/4+1]}var f={configurable:!0,enumerable:!1,value:null,writable:!1},d={__nbindFlags:a,__nbindPtr:l};s&&(d.__nbindShared=s,_nbind.mark(u));for(var p=0,h=Object.keys(d);p>=1;var n=_nbind.valueList[e];return _nbind.valueList[e]=firstFreeValue,firstFreeValue=e,n}if(t)return _nbind.popShared(e,t);throw new Error("Invalid value slot "+e)}_nbind.pushValue=pushValue,_nbind.popValue=popValue;var valueBase=0x10000000000000000;function push64(e){return"number"==typeof e?e:4096*pushValue(e)+valueBase}function pop64(e){return e=3?Buffer.from(o):new Buffer(o)).copy(r):getBuffer(r).set(o)}}_nbind.BufferType=BufferType,_nbind.commitBuffer=commitBuffer;var dirtyList=[],gcTimer=0;function sweep(){for(var e=0,t=dirtyList;e>2]=DYNAMIC_BASE,staticSealed=!0,Module.asmGlobalArg={Math,Int8Array,Int16Array,Int32Array,Uint8Array,Uint16Array,Uint32Array,Float32Array,Float64Array,NaN:NaN,Infinity:1/0},Module.asmLibraryArg={abort,assert,enlargeMemory,getTotalMemory,abortOnCannotGrowMemory,invoke_viiiii,invoke_vif,invoke_vid,invoke_fiff,invoke_vi,invoke_vii,invoke_ii,invoke_viddi,invoke_vidd,invoke_iiii,invoke_diii,invoke_di,invoke_iid,invoke_iii,invoke_viiddi,invoke_viiiiii,invoke_dii,invoke_i,invoke_iiiiii,invoke_viiid,invoke_viififi,invoke_viii,invoke_v,invoke_viid,invoke_idd,invoke_viiii,_emscripten_asm_const_iiiii,_emscripten_asm_const_iiidddddd,_emscripten_asm_const_iiiid,__nbind_reference_external,_emscripten_asm_const_iiiiiiii,_removeAccessorPrefix,_typeModule,__nbind_register_pool,__decorate,_llvm_stackrestore,___cxa_atexit,__extends,__nbind_get_value_object,__ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj,_emscripten_set_main_loop_timing,__nbind_register_primitive,__nbind_register_type,_emscripten_memcpy_big,__nbind_register_function,___setErrNo,__nbind_register_class,__nbind_finish,_abort,_nbind_value,_llvm_stacksave,___syscall54,_defineHidden,_emscripten_set_main_loop,_emscripten_get_now,__nbind_register_callback_signature,_emscripten_asm_const_iiiiii,__nbind_free_external,_emscripten_asm_const_iiii,_emscripten_asm_const_iiididi,___syscall6,_atexit,___syscall140,___syscall146,DYNAMICTOP_PTR,tempDoublePtr,ABORT,STACKTOP,STACK_MAX,cttz_i8,___dso_handle};var asm=function(e,t,n){"use asm";var r=new e.Int8Array(n);var i=new e.Int16Array(n);var o=new e.Int32Array(n);var u=new e.Uint8Array(n);var a=new e.Uint16Array(n);var l=new e.Uint32Array(n);var s=new e.Float32Array(n);var c=new e.Float64Array(n);var f=t.DYNAMICTOP_PTR|0;var d=t.tempDoublePtr|0;var p=t.ABORT|0;var h=t.STACKTOP|0;var v=t.STACK_MAX|0;var m=t.cttz_i8|0;var g=t.___dso_handle|0;var _=0;var y=0;var b=0;var w=0;var E=e.NaN,D=e.Infinity;var C=0,k=0,S=0,T=0,x=0.0;var A=0;var O=e.Math.floor;var M=e.Math.abs;var I=e.Math.sqrt;var R=e.Math.pow;var N=e.Math.cos;var P=e.Math.sin;var F=e.Math.tan;var L=e.Math.acos;var B=e.Math.asin;var U=e.Math.atan;var j=e.Math.atan2;var z=e.Math.exp;var W=e.Math.log;var H=e.Math.ceil;var V=e.Math.imul;var $=e.Math.min;var G=e.Math.max;var q=e.Math.clz32;var Y=e.Math.fround;var X=t.abort;var K=t.assert;var J=t.enlargeMemory;var Q=t.getTotalMemory;var Z=t.abortOnCannotGrowMemory;var ee=t.invoke_viiiii;var te=t.invoke_vif;var ne=t.invoke_vid;var re=t.invoke_fiff;var ie=t.invoke_vi;var oe=t.invoke_vii;var ue=t.invoke_ii;var ae=t.invoke_viddi;var le=t.invoke_vidd;var se=t.invoke_iiii;var ce=t.invoke_diii;var fe=t.invoke_di;var de=t.invoke_iid;var pe=t.invoke_iii;var he=t.invoke_viiddi;var ve=t.invoke_viiiiii;var me=t.invoke_dii;var ge=t.invoke_i;var _e=t.invoke_iiiiii;var ye=t.invoke_viiid;var be=t.invoke_viififi;var we=t.invoke_viii;var Ee=t.invoke_v;var De=t.invoke_viid;var Ce=t.invoke_idd;var ke=t.invoke_viiii;var Se=t._emscripten_asm_const_iiiii;var Te=t._emscripten_asm_const_iiidddddd;var xe=t._emscripten_asm_const_iiiid;var Ae=t.__nbind_reference_external;var Oe=t._emscripten_asm_const_iiiiiiii;var Me=t._removeAccessorPrefix;var Ie=t._typeModule;var Re=t.__nbind_register_pool;var Ne=t.__decorate;var Pe=t._llvm_stackrestore;var Fe=t.___cxa_atexit;var Le=t.__extends;var Be=t.__nbind_get_value_object;var Ue=t.__ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj;var je=t._emscripten_set_main_loop_timing;var ze=t.__nbind_register_primitive;var We=t.__nbind_register_type;var He=t._emscripten_memcpy_big;var Ve=t.__nbind_register_function;var $e=t.___setErrNo;var Ge=t.__nbind_register_class;var qe=t.__nbind_finish;var Ye=t._abort;var Xe=t._nbind_value;var Ke=t._llvm_stacksave;var Je=t.___syscall54;var Qe=t._defineHidden;var Ze=t._emscripten_set_main_loop;var et=t._emscripten_get_now;var tt=t.__nbind_register_callback_signature;var nt=t._emscripten_asm_const_iiiiii;var rt=t.__nbind_free_external;var it=t._emscripten_asm_const_iiii;var ot=t._emscripten_asm_const_iiididi;var ut=t.___syscall6;var at=t._atexit;var lt=t.___syscall140;var st=t.___syscall146;var ct=Y(0);const ft=Y(0);function dt(e){e=e|0;var t=0;t=h;h=h+e|0;h=h+15&-16;return t|0}function pt(){return h|0}function ht(e){e=e|0;h=e}function vt(e,t){e=e|0;t=t|0;h=e;v=t}function mt(e,t){e=e|0;t=t|0;if(!_){_=e;y=t}}function gt(e){e=e|0;A=e}function _t(){return A|0}function yt(){var e=0,t=0;ix(8104,8,400)|0;ix(8504,408,540)|0;e=9044;t=e+44|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));r[9088]=0;r[9089]=1;o[2273]=0;o[2274]=948;o[2275]=948;Fe(17,8104,g|0)|0;return}function bt(e){e=e|0;$t(e+948|0);return}function wt(e){e=Y(e);return((Ii(e)|0)&2147483647)>>>0>2139095040|0}function Et(e,t,n){e=e|0;t=t|0;n=n|0;e:do{if(!(o[e+(t<<3)+4>>2]|0)){if((t|2|0)==3?o[e+60>>2]|0:0){e=e+56|0;break}switch(t|0){case 0:case 2:case 4:case 5:{if(o[e+52>>2]|0){e=e+48|0;break e}break}default:{}}if(!(o[e+68>>2]|0)){e=(t|1|0)==5?948:n;break}else{e=e+64|0;break}}else e=e+(t<<3)|0}while(0);return e|0}function Dt(e){e=e|0;var t=0;t=$S(1e3)|0;Ct(e,(t|0)!=0,2456);o[2276]=(o[2276]|0)+1;ix(t|0,8104,1e3)|0;if(r[e+2>>0]|0){o[t+4>>2]=2;o[t+12>>2]=4}o[t+976>>2]=e;return t|0}function Ct(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0;i=h;h=h+16|0;r=i;if(!t){o[r>>2]=n;Lr(e,5,3197,r)}h=i;return}function kt(){return Dt(956)|0}function St(e){e=e|0;var t=0;t=qT(1e3)|0;Tt(t,e);Ct(o[e+976>>2]|0,1,2456);o[2276]=(o[2276]|0)+1;o[t+944>>2]=0;return t|0}function Tt(e,t){e=e|0;t=t|0;var n=0;ix(e|0,t|0,948)|0;jr(e+948|0,t+948|0);n=e+960|0;e=t+960|0;t=n+40|0;do{o[n>>2]=o[e>>2];n=n+4|0;e=e+4|0}while((n|0)<(t|0));return}function xt(e){e=e|0;var t=0,n=0,r=0,i=0;t=e+944|0;n=o[t>>2]|0;if(n|0){At(n+948|0,e)|0;o[t>>2]=0}n=Ot(e)|0;if(n|0){t=0;do{o[(Mt(e,t)|0)+944>>2]=0;t=t+1|0}while((t|0)!=(n|0))}n=e+948|0;r=o[n>>2]|0;i=e+952|0;t=o[i>>2]|0;if((t|0)!=(r|0))o[i>>2]=t+(~((t+-4-r|0)>>>2)<<2);It(n);GS(e);o[2276]=(o[2276]|0)+-1;return}function At(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0;r=o[e>>2]|0;l=e+4|0;n=o[l>>2]|0;u=n;e:do{if((r|0)==(n|0)){i=r;a=4}else{e=r;while(1){if((o[e>>2]|0)==(t|0)){i=e;a=4;break e}e=e+4|0;if((e|0)==(n|0)){e=0;break}}}}while(0);if((a|0)==4)if((i|0)!=(n|0)){r=i+4|0;e=u-r|0;t=e>>2;if(t){sx(i|0,r|0,e|0)|0;n=o[l>>2]|0}e=i+(t<<2)|0;if((n|0)==(e|0))e=1;else{o[l>>2]=n+(~((n+-4-e|0)>>>2)<<2);e=1}}else e=0;return e|0}function Ot(e){e=e|0;return(o[e+952>>2]|0)-(o[e+948>>2]|0)>>2|0}function Mt(e,t){e=e|0;t=t|0;var n=0;n=o[e+948>>2]|0;if((o[e+952>>2]|0)-n>>2>>>0>t>>>0)e=o[n+(t<<2)>>2]|0;else e=0;return e|0}function It(e){e=e|0;var t=0,n=0,r=0,i=0;r=h;h=h+32|0;t=r;i=o[e>>2]|0;n=(o[e+4>>2]|0)-i|0;if(((o[e+8>>2]|0)-i|0)>>>0>n>>>0){i=n>>2;Ri(t,i,i,e+8|0);Ni(e,t);Pi(t)}h=r;return}function Rt(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0;c=Ot(e)|0;do{if(c|0){if((o[(Mt(e,0)|0)+944>>2]|0)==(e|0)){if(!(At(e+948|0,t)|0))break;ix(t+400|0,8504,540)|0;o[t+944>>2]=0;Vt(e);break}a=o[(o[e+976>>2]|0)+12>>2]|0;l=e+948|0;s=(a|0)==0;n=0;u=0;do{r=o[(o[l>>2]|0)+(u<<2)>>2]|0;if((r|0)==(t|0))Vt(e);else{i=St(r)|0;o[(o[l>>2]|0)+(n<<2)>>2]=i;o[i+944>>2]=e;if(!s)PA[a&15](r,i,e,n);n=n+1|0}u=u+1|0}while((u|0)!=(c|0));if(n>>>0>>0){s=e+948|0;l=e+952|0;a=n;n=o[l>>2]|0;do{u=(o[s>>2]|0)+(a<<2)|0;r=u+4|0;i=n-r|0;t=i>>2;if(!t)i=n;else{sx(u|0,r|0,i|0)|0;n=o[l>>2]|0;i=n}r=u+(t<<2)|0;if((i|0)!=(r|0)){n=i+(~((i+-4-r|0)>>>2)<<2)|0;o[l>>2]=n}a=a+1|0}while((a|0)!=(c|0))}}}while(0);return}function Nt(e){e=e|0;var t=0,n=0,i=0,u=0;Pt(e,(Ot(e)|0)==0,2491);Pt(e,(o[e+944>>2]|0)==0,2545);t=e+948|0;n=o[t>>2]|0;i=e+952|0;u=o[i>>2]|0;if((u|0)!=(n|0))o[i>>2]=u+(~((u+-4-n|0)>>>2)<<2);It(t);t=e+976|0;n=o[t>>2]|0;ix(e|0,8104,1e3)|0;if(r[n+2>>0]|0){o[e+4>>2]=2;o[e+12>>2]=4}o[t>>2]=n;return}function Pt(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0;i=h;h=h+16|0;r=i;if(!t){o[r>>2]=n;kr(e,5,3197,r)}h=i;return}function Ft(){return o[2276]|0}function Lt(){var e=0;e=$S(20)|0;Bt((e|0)!=0,2592);o[2277]=(o[2277]|0)+1;o[e>>2]=o[239];o[e+4>>2]=o[240];o[e+8>>2]=o[241];o[e+12>>2]=o[242];o[e+16>>2]=o[243];return e|0}function Bt(e,t){e=e|0;t=t|0;var n=0,r=0;r=h;h=h+16|0;n=r;if(!e){o[n>>2]=t;kr(0,5,3197,n)}h=r;return}function Ut(e){e=e|0;GS(e);o[2277]=(o[2277]|0)+-1;return}function jt(e,t){e=e|0;t=t|0;var n=0;if(!t){n=0;t=0}else{Pt(e,(Ot(e)|0)==0,2629);n=1}o[e+964>>2]=t;o[e+988>>2]=n;return}function zt(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;u=r+8|0;i=r+4|0;a=r;o[i>>2]=t;Pt(e,(o[t+944>>2]|0)==0,2709);Pt(e,(o[e+964>>2]|0)==0,2763);Wt(e);t=e+948|0;o[a>>2]=(o[t>>2]|0)+(n<<2);o[u>>2]=o[a>>2];Ht(t,u,i)|0;o[(o[i>>2]|0)+944>>2]=e;Vt(e);h=r;return}function Wt(e){e=e|0;var t=0,n=0,r=0,i=0,u=0,a=0,l=0;n=Ot(e)|0;if(n|0?(o[(Mt(e,0)|0)+944>>2]|0)!=(e|0):0){r=o[(o[e+976>>2]|0)+12>>2]|0;i=e+948|0;u=(r|0)==0;t=0;do{a=o[(o[i>>2]|0)+(t<<2)>>2]|0;l=St(a)|0;o[(o[i>>2]|0)+(t<<2)>>2]=l;o[l+944>>2]=e;if(!u)PA[r&15](a,l,e,t);t=t+1|0}while((t|0)!=(n|0))}return}function Ht(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,v=0,m=0,g=0,_=0,y=0;_=h;h=h+64|0;d=_+52|0;l=_+48|0;p=_+28|0;v=_+24|0;m=_+20|0;g=_;r=o[e>>2]|0;u=r;t=r+((o[t>>2]|0)-u>>2<<2)|0;r=e+4|0;i=o[r>>2]|0;a=e+8|0;do{if(i>>>0<(o[a>>2]|0)>>>0){if((t|0)==(i|0)){o[t>>2]=o[n>>2];o[r>>2]=(o[r>>2]|0)+4;break}Fi(e,t,i,t+4|0);if(t>>>0<=n>>>0)n=(o[r>>2]|0)>>>0>n>>>0?n+4|0:n;o[t>>2]=o[n>>2]}else{r=(i-u>>2)+1|0;i=Hr(e)|0;if(i>>>0>>0)jT(e);f=o[e>>2]|0;c=(o[a>>2]|0)-f|0;u=c>>1;Ri(g,c>>2>>>0>>1>>>0?u>>>0>>0?r:u:i,t-f>>2,e+8|0);f=g+8|0;r=o[f>>2]|0;u=g+12|0;c=o[u>>2]|0;a=c;s=r;do{if((r|0)==(c|0)){c=g+4|0;r=o[c>>2]|0;y=o[g>>2]|0;i=y;if(r>>>0<=y>>>0){r=a-i>>1;r=(r|0)==0?1:r;Ri(p,r,r>>>2,o[g+16>>2]|0);o[v>>2]=o[c>>2];o[m>>2]=o[f>>2];o[l>>2]=o[v>>2];o[d>>2]=o[m>>2];Bi(p,l,d);r=o[g>>2]|0;o[g>>2]=o[p>>2];o[p>>2]=r;r=p+4|0;y=o[c>>2]|0;o[c>>2]=o[r>>2];o[r>>2]=y;r=p+8|0;y=o[f>>2]|0;o[f>>2]=o[r>>2];o[r>>2]=y;r=p+12|0;y=o[u>>2]|0;o[u>>2]=o[r>>2];o[r>>2]=y;Pi(p);r=o[f>>2]|0;break}u=r;a=((u-i>>2)+1|0)/-2|0;l=r+(a<<2)|0;i=s-u|0;u=i>>2;if(u){sx(l|0,r|0,i|0)|0;r=o[c>>2]|0}y=l+(u<<2)|0;o[f>>2]=y;o[c>>2]=r+(a<<2);r=y}}while(0);o[r>>2]=o[n>>2];o[f>>2]=(o[f>>2]|0)+4;t=Li(e,g,t)|0;Pi(g)}}while(0);h=_;return t|0}function Vt(e){e=e|0;var t=0;do{t=e+984|0;if(r[t>>0]|0)break;r[t>>0]=1;s[e+504>>2]=Y(E);e=o[e+944>>2]|0}while((e|0)!=0);return}function $t(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-4-r|0)>>>2)<<2);XT(n)}return}function Gt(e){e=e|0;return o[e+944>>2]|0}function qt(e){e=e|0;Pt(e,(o[e+964>>2]|0)!=0,2832);Vt(e);return}function Yt(e){e=e|0;return(r[e+984>>0]|0)!=0|0}function Xt(e,t){e=e|0;t=t|0;if(iT(e,t,400)|0){ix(e|0,t|0,400)|0;Vt(e)}return}function Kt(e){e=e|0;var t=ft;t=Y(s[e+44>>2]);e=wt(t)|0;return Y(e?Y(0.0):t)}function Jt(e){e=e|0;var t=ft;t=Y(s[e+48>>2]);if(wt(t)|0)t=r[(o[e+976>>2]|0)+2>>0]|0?Y(1.0):Y(0.0);return Y(t)}function Qt(e,t){e=e|0;t=t|0;o[e+980>>2]=t;return}function Zt(e){e=e|0;return o[e+980>>2]|0}function en(e,t){e=e|0;t=t|0;var n=0;n=e+4|0;if((o[n>>2]|0)!=(t|0)){o[n>>2]=t;Vt(e)}return}function tn(e){e=e|0;return o[e+4>>2]|0}function nn(e,t){e=e|0;t=t|0;var n=0;n=e+8|0;if((o[n>>2]|0)!=(t|0)){o[n>>2]=t;Vt(e)}return}function rn(e){e=e|0;return o[e+8>>2]|0}function on(e,t){e=e|0;t=t|0;var n=0;n=e+12|0;if((o[n>>2]|0)!=(t|0)){o[n>>2]=t;Vt(e)}return}function un(e){e=e|0;return o[e+12>>2]|0}function an(e,t){e=e|0;t=t|0;var n=0;n=e+16|0;if((o[n>>2]|0)!=(t|0)){o[n>>2]=t;Vt(e)}return}function ln(e){e=e|0;return o[e+16>>2]|0}function sn(e,t){e=e|0;t=t|0;var n=0;n=e+20|0;if((o[n>>2]|0)!=(t|0)){o[n>>2]=t;Vt(e)}return}function cn(e){e=e|0;return o[e+20>>2]|0}function fn(e,t){e=e|0;t=t|0;var n=0;n=e+24|0;if((o[n>>2]|0)!=(t|0)){o[n>>2]=t;Vt(e)}return}function dn(e){e=e|0;return o[e+24>>2]|0}function pn(e,t){e=e|0;t=t|0;var n=0;n=e+28|0;if((o[n>>2]|0)!=(t|0)){o[n>>2]=t;Vt(e)}return}function hn(e){e=e|0;return o[e+28>>2]|0}function vn(e,t){e=e|0;t=t|0;var n=0;n=e+32|0;if((o[n>>2]|0)!=(t|0)){o[n>>2]=t;Vt(e)}return}function mn(e){e=e|0;return o[e+32>>2]|0}function gn(e,t){e=e|0;t=t|0;var n=0;n=e+36|0;if((o[n>>2]|0)!=(t|0)){o[n>>2]=t;Vt(e)}return}function _n(e){e=e|0;return o[e+36>>2]|0}function yn(e,t){e=e|0;t=Y(t);var n=0;n=e+40|0;if(Y(s[n>>2])!=t){s[n>>2]=t;Vt(e)}return}function bn(e,t){e=e|0;t=Y(t);var n=0;n=e+44|0;if(Y(s[n>>2])!=t){s[n>>2]=t;Vt(e)}return}function wn(e,t){e=e|0;t=Y(t);var n=0;n=e+48|0;if(Y(s[n>>2])!=t){s[n>>2]=t;Vt(e)}return}function En(e,t){e=e|0;t=Y(t);var n=0,r=0,i=0,u=0;u=wt(t)|0;n=(u^1)&1;r=e+52|0;i=e+56|0;if(!(u|Y(s[r>>2])==t?(o[i>>2]|0)==(n|0):0)){s[r>>2]=t;o[i>>2]=n;Vt(e)}return}function Dn(e,t){e=e|0;t=Y(t);var n=0,r=0;r=e+52|0;n=e+56|0;if(!(!(Y(s[r>>2])!=t)?(o[n>>2]|0)==2:0)){s[r>>2]=t;r=wt(t)|0;o[n>>2]=r?3:2;Vt(e)}return}function Cn(e,t){e=e|0;t=t|0;var n=0,r=0;r=t+52|0;n=o[r+4>>2]|0;t=e;o[t>>2]=o[r>>2];o[t+4>>2]=n;return}function kn(e,t,n){e=e|0;t=t|0;n=Y(n);var r=0,i=0,u=0;u=wt(n)|0;r=(u^1)&1;i=e+132+(t<<3)|0;t=e+132+(t<<3)+4|0;if(!(u|Y(s[i>>2])==n?(o[t>>2]|0)==(r|0):0)){s[i>>2]=n;o[t>>2]=r;Vt(e)}return}function Sn(e,t,n){e=e|0;t=t|0;n=Y(n);var r=0,i=0,u=0;u=wt(n)|0;r=u?0:2;i=e+132+(t<<3)|0;t=e+132+(t<<3)+4|0;if(!(u|Y(s[i>>2])==n?(o[t>>2]|0)==(r|0):0)){s[i>>2]=n;o[t>>2]=r;Vt(e)}return}function Tn(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=t+132+(n<<3)|0;t=o[r+4>>2]|0;n=e;o[n>>2]=o[r>>2];o[n+4>>2]=t;return}function xn(e,t,n){e=e|0;t=t|0;n=Y(n);var r=0,i=0,u=0;u=wt(n)|0;r=(u^1)&1;i=e+60+(t<<3)|0;t=e+60+(t<<3)+4|0;if(!(u|Y(s[i>>2])==n?(o[t>>2]|0)==(r|0):0)){s[i>>2]=n;o[t>>2]=r;Vt(e)}return}function An(e,t,n){e=e|0;t=t|0;n=Y(n);var r=0,i=0,u=0;u=wt(n)|0;r=u?0:2;i=e+60+(t<<3)|0;t=e+60+(t<<3)+4|0;if(!(u|Y(s[i>>2])==n?(o[t>>2]|0)==(r|0):0)){s[i>>2]=n;o[t>>2]=r;Vt(e)}return}function On(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=t+60+(n<<3)|0;t=o[r+4>>2]|0;n=e;o[n>>2]=o[r>>2];o[n+4>>2]=t;return}function Mn(e,t){e=e|0;t=t|0;var n=0;n=e+60+(t<<3)+4|0;if((o[n>>2]|0)!=3){s[e+60+(t<<3)>>2]=Y(E);o[n>>2]=3;Vt(e)}return}function In(e,t,n){e=e|0;t=t|0;n=Y(n);var r=0,i=0,u=0;u=wt(n)|0;r=(u^1)&1;i=e+204+(t<<3)|0;t=e+204+(t<<3)+4|0;if(!(u|Y(s[i>>2])==n?(o[t>>2]|0)==(r|0):0)){s[i>>2]=n;o[t>>2]=r;Vt(e)}return}function Rn(e,t,n){e=e|0;t=t|0;n=Y(n);var r=0,i=0,u=0;u=wt(n)|0;r=u?0:2;i=e+204+(t<<3)|0;t=e+204+(t<<3)+4|0;if(!(u|Y(s[i>>2])==n?(o[t>>2]|0)==(r|0):0)){s[i>>2]=n;o[t>>2]=r;Vt(e)}return}function Nn(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=t+204+(n<<3)|0;t=o[r+4>>2]|0;n=e;o[n>>2]=o[r>>2];o[n+4>>2]=t;return}function Pn(e,t,n){e=e|0;t=t|0;n=Y(n);var r=0,i=0,u=0;u=wt(n)|0;r=(u^1)&1;i=e+276+(t<<3)|0;t=e+276+(t<<3)+4|0;if(!(u|Y(s[i>>2])==n?(o[t>>2]|0)==(r|0):0)){s[i>>2]=n;o[t>>2]=r;Vt(e)}return}function Fn(e,t){e=e|0;t=t|0;return Y(s[e+276+(t<<3)>>2])}function Ln(e,t){e=e|0;t=Y(t);var n=0,r=0,i=0,u=0;u=wt(t)|0;n=(u^1)&1;r=e+348|0;i=e+352|0;if(!(u|Y(s[r>>2])==t?(o[i>>2]|0)==(n|0):0)){s[r>>2]=t;o[i>>2]=n;Vt(e)}return}function Bn(e,t){e=e|0;t=Y(t);var n=0,r=0;r=e+348|0;n=e+352|0;if(!(!(Y(s[r>>2])!=t)?(o[n>>2]|0)==2:0)){s[r>>2]=t;r=wt(t)|0;o[n>>2]=r?3:2;Vt(e)}return}function Un(e){e=e|0;var t=0;t=e+352|0;if((o[t>>2]|0)!=3){s[e+348>>2]=Y(E);o[t>>2]=3;Vt(e)}return}function jn(e,t){e=e|0;t=t|0;var n=0,r=0;r=t+348|0;n=o[r+4>>2]|0;t=e;o[t>>2]=o[r>>2];o[t+4>>2]=n;return}function zn(e,t){e=e|0;t=Y(t);var n=0,r=0,i=0,u=0;u=wt(t)|0;n=(u^1)&1;r=e+356|0;i=e+360|0;if(!(u|Y(s[r>>2])==t?(o[i>>2]|0)==(n|0):0)){s[r>>2]=t;o[i>>2]=n;Vt(e)}return}function Wn(e,t){e=e|0;t=Y(t);var n=0,r=0;r=e+356|0;n=e+360|0;if(!(!(Y(s[r>>2])!=t)?(o[n>>2]|0)==2:0)){s[r>>2]=t;r=wt(t)|0;o[n>>2]=r?3:2;Vt(e)}return}function Hn(e){e=e|0;var t=0;t=e+360|0;if((o[t>>2]|0)!=3){s[e+356>>2]=Y(E);o[t>>2]=3;Vt(e)}return}function Vn(e,t){e=e|0;t=t|0;var n=0,r=0;r=t+356|0;n=o[r+4>>2]|0;t=e;o[t>>2]=o[r>>2];o[t+4>>2]=n;return}function $n(e,t){e=e|0;t=Y(t);var n=0,r=0,i=0,u=0;u=wt(t)|0;n=(u^1)&1;r=e+364|0;i=e+368|0;if(!(u|Y(s[r>>2])==t?(o[i>>2]|0)==(n|0):0)){s[r>>2]=t;o[i>>2]=n;Vt(e)}return}function Gn(e,t){e=e|0;t=Y(t);var n=0,r=0,i=0,u=0;u=wt(t)|0;n=u?0:2;r=e+364|0;i=e+368|0;if(!(u|Y(s[r>>2])==t?(o[i>>2]|0)==(n|0):0)){s[r>>2]=t;o[i>>2]=n;Vt(e)}return}function qn(e,t){e=e|0;t=t|0;var n=0,r=0;r=t+364|0;n=o[r+4>>2]|0;t=e;o[t>>2]=o[r>>2];o[t+4>>2]=n;return}function Yn(e,t){e=e|0;t=Y(t);var n=0,r=0,i=0,u=0;u=wt(t)|0;n=(u^1)&1;r=e+372|0;i=e+376|0;if(!(u|Y(s[r>>2])==t?(o[i>>2]|0)==(n|0):0)){s[r>>2]=t;o[i>>2]=n;Vt(e)}return}function Xn(e,t){e=e|0;t=Y(t);var n=0,r=0,i=0,u=0;u=wt(t)|0;n=u?0:2;r=e+372|0;i=e+376|0;if(!(u|Y(s[r>>2])==t?(o[i>>2]|0)==(n|0):0)){s[r>>2]=t;o[i>>2]=n;Vt(e)}return}function Kn(e,t){e=e|0;t=t|0;var n=0,r=0;r=t+372|0;n=o[r+4>>2]|0;t=e;o[t>>2]=o[r>>2];o[t+4>>2]=n;return}function Jn(e,t){e=e|0;t=Y(t);var n=0,r=0,i=0,u=0;u=wt(t)|0;n=(u^1)&1;r=e+380|0;i=e+384|0;if(!(u|Y(s[r>>2])==t?(o[i>>2]|0)==(n|0):0)){s[r>>2]=t;o[i>>2]=n;Vt(e)}return}function Qn(e,t){e=e|0;t=Y(t);var n=0,r=0,i=0,u=0;u=wt(t)|0;n=u?0:2;r=e+380|0;i=e+384|0;if(!(u|Y(s[r>>2])==t?(o[i>>2]|0)==(n|0):0)){s[r>>2]=t;o[i>>2]=n;Vt(e)}return}function Zn(e,t){e=e|0;t=t|0;var n=0,r=0;r=t+380|0;n=o[r+4>>2]|0;t=e;o[t>>2]=o[r>>2];o[t+4>>2]=n;return}function er(e,t){e=e|0;t=Y(t);var n=0,r=0,i=0,u=0;u=wt(t)|0;n=(u^1)&1;r=e+388|0;i=e+392|0;if(!(u|Y(s[r>>2])==t?(o[i>>2]|0)==(n|0):0)){s[r>>2]=t;o[i>>2]=n;Vt(e)}return}function tr(e,t){e=e|0;t=Y(t);var n=0,r=0,i=0,u=0;u=wt(t)|0;n=u?0:2;r=e+388|0;i=e+392|0;if(!(u|Y(s[r>>2])==t?(o[i>>2]|0)==(n|0):0)){s[r>>2]=t;o[i>>2]=n;Vt(e)}return}function nr(e,t){e=e|0;t=t|0;var n=0,r=0;r=t+388|0;n=o[r+4>>2]|0;t=e;o[t>>2]=o[r>>2];o[t+4>>2]=n;return}function rr(e,t){e=e|0;t=Y(t);var n=0;n=e+396|0;if(Y(s[n>>2])!=t){s[n>>2]=t;Vt(e)}return}function ir(e){e=e|0;return Y(s[e+396>>2])}function or(e){e=e|0;return Y(s[e+400>>2])}function ur(e){e=e|0;return Y(s[e+404>>2])}function ar(e){e=e|0;return Y(s[e+408>>2])}function lr(e){e=e|0;return Y(s[e+412>>2])}function sr(e){e=e|0;return Y(s[e+416>>2])}function cr(e){e=e|0;return Y(s[e+420>>2])}function fr(e,t){e=e|0;t=t|0;Pt(e,(t|0)<6,2918);switch(t|0){case 0:{t=(o[e+496>>2]|0)==2?5:4;break}case 2:{t=(o[e+496>>2]|0)==2?4:5;break}default:{}}return Y(s[e+424+(t<<2)>>2])}function dr(e,t){e=e|0;t=t|0;Pt(e,(t|0)<6,2918);switch(t|0){case 0:{t=(o[e+496>>2]|0)==2?5:4;break}case 2:{t=(o[e+496>>2]|0)==2?4:5;break}default:{}}return Y(s[e+448+(t<<2)>>2])}function pr(e,t){e=e|0;t=t|0;Pt(e,(t|0)<6,2918);switch(t|0){case 0:{t=(o[e+496>>2]|0)==2?5:4;break}case 2:{t=(o[e+496>>2]|0)==2?4:5;break}default:{}}return Y(s[e+472+(t<<2)>>2])}function hr(e,t){e=e|0;t=t|0;var n=0,r=ft;n=o[e+4>>2]|0;if((n|0)==(o[t+4>>2]|0)){if(!n)e=1;else{r=Y(s[e>>2]);e=Y(M(Y(r-Y(s[t>>2]))))>2]=0;o[i+4>>2]=0;o[i+8>>2]=0;Ue(i|0,e|0,t|0,0);kr(e,3,(r[i+11>>0]|0)<0?o[i>>2]|0:i,n);KT(i);h=n;return}function _r(e,t,n,r){e=Y(e);t=Y(t);n=n|0;r=r|0;var i=ft;e=Y(e*t);i=Y(LT(e,Y(1.0)));do{if(!(vr(i,Y(0.0))|0)){e=Y(e-i);if(vr(i,Y(1.0))|0){e=Y(e+Y(1.0));break}if(n){e=Y(e+Y(1.0));break}if(!r){if(i>Y(.5))i=Y(1.0);else{r=vr(i,Y(.5))|0;i=r?Y(1.0):Y(0.0)}e=Y(e+i)}}else e=Y(e-i)}while(0);return Y(e/t)}function yr(e,t,n,r,i,o,u,a,l,c,f,d,p){e=e|0;t=Y(t);n=n|0;r=Y(r);i=i|0;o=Y(o);u=u|0;a=Y(a);l=Y(l);c=Y(c);f=Y(f);d=Y(d);p=p|0;var h=0,v=ft,m=ft,g=ft,_=ft,y=ft,b=ft;if(l>2]),v!=Y(0.0)):0){g=Y(_r(t,v,0,0));_=Y(_r(r,v,0,0));m=Y(_r(o,v,0,0));v=Y(_r(a,v,0,0))}else{m=o;g=t;v=a;_=r}if((i|0)==(e|0))h=vr(m,g)|0;else h=0;if((u|0)==(n|0))p=vr(v,_)|0;else p=0;if((!h?(y=Y(t-f),!(br(e,y,l)|0)):0)?!(wr(e,y,i,l)|0):0)h=Er(e,y,i,o,l)|0;else h=1;if((!p?(b=Y(r-d),!(br(n,b,c)|0)):0)?!(wr(n,b,u,c)|0):0)p=Er(n,b,u,a,c)|0;else p=1;p=h&p}return p|0}function br(e,t,n){e=e|0;t=Y(t);n=Y(n);if((e|0)==1)e=vr(t,n)|0;else e=0;return e|0}function wr(e,t,n,r){e=e|0;t=Y(t);n=n|0;r=Y(r);if((e|0)==2&(n|0)==0){if(!(t>=r))e=vr(t,r)|0;else e=1}else e=0;return e|0}function Er(e,t,n,r,i){e=e|0;t=Y(t);n=n|0;r=Y(r);i=Y(i);if((e|0)==2&(n|0)==2&r>t){if(!(i<=t))e=vr(t,i)|0;else e=1}else e=0;return e|0}function Dr(e,t,n,i,u,a,l,f,d,p,v){e=e|0;t=Y(t);n=Y(n);i=i|0;u=u|0;a=a|0;l=Y(l);f=Y(f);d=d|0;p=p|0;v=v|0;var m=0,g=0,_=0,y=0,b=ft,w=ft,E=0,D=0,C=0,k=0,S=0,T=0,x=0,A=0,O=0,M=0,I=0,R=ft,N=ft,P=ft,F=0.0,L=0.0;I=h;h=h+160|0;A=I+152|0;x=I+120|0;T=I+104|0;C=I+72|0;y=I+56|0;S=I+8|0;D=I;k=(o[2279]|0)+1|0;o[2279]=k;O=e+984|0;if((r[O>>0]|0)!=0?(o[e+512>>2]|0)!=(o[2278]|0):0)E=4;else if((o[e+516>>2]|0)==(i|0))M=0;else E=4;if((E|0)==4){o[e+520>>2]=0;o[e+924>>2]=-1;o[e+928>>2]=-1;s[e+932>>2]=Y(-1.0);s[e+936>>2]=Y(-1.0);M=1}e:do{if(!(o[e+964>>2]|0)){if(d){m=e+916|0;if(!(vr(Y(s[m>>2]),t)|0)){E=21;break}if(!(vr(Y(s[e+920>>2]),n)|0)){E=21;break}if((o[e+924>>2]|0)!=(u|0)){E=21;break}m=(o[e+928>>2]|0)==(a|0)?m:0;E=22;break}_=o[e+520>>2]|0;if(!_)E=21;else{g=0;while(1){m=e+524+(g*24|0)|0;if(((vr(Y(s[m>>2]),t)|0?vr(Y(s[e+524+(g*24|0)+4>>2]),n)|0:0)?(o[e+524+(g*24|0)+8>>2]|0)==(u|0):0)?(o[e+524+(g*24|0)+12>>2]|0)==(a|0):0){E=22;break e}g=g+1|0;if(g>>>0>=_>>>0){E=21;break}}}}else{b=Y(Cr(e,2,l));w=Y(Cr(e,0,l));m=e+916|0;P=Y(s[m>>2]);N=Y(s[e+920>>2]);R=Y(s[e+932>>2]);if(!(yr(u,t,a,n,o[e+924>>2]|0,P,o[e+928>>2]|0,N,R,Y(s[e+936>>2]),b,w,v)|0)){_=o[e+520>>2]|0;if(!_)E=21;else{g=0;while(1){m=e+524+(g*24|0)|0;R=Y(s[m>>2]);N=Y(s[e+524+(g*24|0)+4>>2]);P=Y(s[e+524+(g*24|0)+16>>2]);if(yr(u,t,a,n,o[e+524+(g*24|0)+8>>2]|0,R,o[e+524+(g*24|0)+12>>2]|0,N,P,Y(s[e+524+(g*24|0)+20>>2]),b,w,v)|0){E=22;break e}g=g+1|0;if(g>>>0>=_>>>0){E=21;break}}}}else E=22}}while(0);do{if((E|0)==21){if(!(r[11697]|0)){m=0;E=31}else{m=0;E=28}}else if((E|0)==22){g=(r[11697]|0)!=0;if(!((m|0)!=0&(M^1)))if(g){E=28;break}else{E=31;break}y=m+16|0;o[e+908>>2]=o[y>>2];_=m+20|0;o[e+912>>2]=o[_>>2];if(!((r[11698]|0)==0|g^1)){o[D>>2]=Sr(k)|0;o[D+4>>2]=k;kr(e,4,2972,D);g=o[e+972>>2]|0;if(g|0)hA[g&127](e);u=Tr(u,d)|0;a=Tr(a,d)|0;L=+Y(s[y>>2]);F=+Y(s[_>>2]);o[S>>2]=u;o[S+4>>2]=a;c[S+8>>3]=+t;c[S+16>>3]=+n;c[S+24>>3]=L;c[S+32>>3]=F;o[S+40>>2]=p;kr(e,4,2989,S)}}}while(0);if((E|0)==28){g=Sr(k)|0;o[y>>2]=g;o[y+4>>2]=k;o[y+8>>2]=M?3047:11699;kr(e,4,3038,y);g=o[e+972>>2]|0;if(g|0)hA[g&127](e);S=Tr(u,d)|0;E=Tr(a,d)|0;o[C>>2]=S;o[C+4>>2]=E;c[C+8>>3]=+t;c[C+16>>3]=+n;o[C+24>>2]=p;kr(e,4,3049,C);E=31}if((E|0)==31){xr(e,t,n,i,u,a,l,f,d,v);if(r[11697]|0){g=o[2279]|0;S=Sr(g)|0;o[T>>2]=S;o[T+4>>2]=g;o[T+8>>2]=M?3047:11699;kr(e,4,3083,T);g=o[e+972>>2]|0;if(g|0)hA[g&127](e);S=Tr(u,d)|0;T=Tr(a,d)|0;F=+Y(s[e+908>>2]);L=+Y(s[e+912>>2]);o[x>>2]=S;o[x+4>>2]=T;c[x+8>>3]=F;c[x+16>>3]=L;o[x+24>>2]=p;kr(e,4,3092,x)}o[e+516>>2]=i;if(!m){g=e+520|0;m=o[g>>2]|0;if((m|0)==16){if(r[11697]|0)kr(e,4,3124,A);o[g>>2]=0;m=0}if(d)m=e+916|0;else{o[g>>2]=m+1;m=e+524+(m*24|0)|0}s[m>>2]=t;s[m+4>>2]=n;o[m+8>>2]=u;o[m+12>>2]=a;o[m+16>>2]=o[e+908>>2];o[m+20>>2]=o[e+912>>2];m=0}}if(d){o[e+416>>2]=o[e+908>>2];o[e+420>>2]=o[e+912>>2];r[e+985>>0]=1;r[O>>0]=0}o[2279]=(o[2279]|0)+-1;o[e+512>>2]=o[2278];h=I;return M|(m|0)==0|0}function Cr(e,t,n){e=e|0;t=t|0;n=Y(n);var r=ft;r=Y(Vr(e,t,n));return Y(r+Y($r(e,t,n)))}function kr(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0;u=h;h=h+16|0;i=u;o[i>>2]=r;if(!e)r=0;else r=o[e+976>>2]|0;Br(r,e,t,n,i);h=u;return}function Sr(e){e=e|0;return(e>>>0>60?3201:3201+(60-e)|0)|0}function Tr(e,t){e=e|0;t=t|0;var n=0,r=0,i=0;i=h;h=h+32|0;n=i+12|0;r=i;o[n>>2]=o[254];o[n+4>>2]=o[255];o[n+8>>2]=o[256];o[r>>2]=o[257];o[r+4>>2]=o[258];o[r+8>>2]=o[259];if((e|0)>2)e=11699;else e=o[(t?r:n)+(e<<2)>>2]|0;h=i;return e|0}function xr(e,t,n,i,a,l,c,f,p,v){e=e|0;t=Y(t);n=Y(n);i=i|0;a=a|0;l=l|0;c=Y(c);f=Y(f);p=p|0;v=v|0;var m=0,g=0,_=0,y=0,b=ft,w=ft,E=ft,D=ft,C=ft,k=ft,S=ft,T=0,x=0,A=0,O=ft,M=ft,I=0,R=ft,N=0,P=0,F=0,L=0,B=0,U=0,j=0,z=0,W=0,H=0,V=0,$=0,G=0,q=0,X=0,K=0,J=0,Q=0,Z=ft,ee=ft,te=ft,ne=ft,re=ft,ie=0,oe=0,ue=0,ae=0,le=0,se=ft,ce=ft,fe=ft,de=ft,pe=ft,he=ft,ve=0,me=ft,ge=ft,_e=ft,ye=ft,be=ft,we=ft,Ee=0,De=0,Ce=ft,ke=ft,Se=0,Te=0,xe=0,Ae=0,Oe=ft,Me=0,Ie=0,Re=0,Ne=0,Pe=0,Fe=0,Le=0,Be=ft,Ue=0,je=0;Le=h;h=h+16|0;ie=Le+12|0;oe=Le+8|0;ue=Le+4|0;ae=Le;Pt(e,(a|0)==0|(wt(t)|0)^1,3326);Pt(e,(l|0)==0|(wt(n)|0)^1,3406);Ie=Yr(e,i)|0;o[e+496>>2]=Ie;Pe=Xr(2,Ie)|0;Fe=Xr(0,Ie)|0;s[e+440>>2]=Y(Vr(e,Pe,c));s[e+444>>2]=Y($r(e,Pe,c));s[e+428>>2]=Y(Vr(e,Fe,c));s[e+436>>2]=Y($r(e,Fe,c));s[e+464>>2]=Y(Kr(e,Pe));s[e+468>>2]=Y(Jr(e,Pe));s[e+452>>2]=Y(Kr(e,Fe));s[e+460>>2]=Y(Jr(e,Fe));s[e+488>>2]=Y(Qr(e,Pe,c));s[e+492>>2]=Y(Zr(e,Pe,c));s[e+476>>2]=Y(Qr(e,Fe,c));s[e+484>>2]=Y(Zr(e,Fe,c));do{if(!(o[e+964>>2]|0)){Re=e+948|0;Ne=(o[e+952>>2]|0)-(o[Re>>2]|0)>>2;if(!Ne){ti(e,t,n,a,l,c,f);break}if(!p?ni(e,t,n,a,l,c,f)|0:0)break;Wt(e);K=e+508|0;r[K>>0]=0;Pe=Xr(o[e+4>>2]|0,Ie)|0;Fe=ri(Pe,Ie)|0;Me=Gr(Pe)|0;J=o[e+8>>2]|0;Te=e+28|0;Q=(o[Te>>2]|0)!=0;be=Me?c:f;Ce=Me?f:c;Z=Y(ii(e,Pe,c));ee=Y(oi(e,Pe,c));b=Y(ii(e,Fe,c));we=Y(ui(e,Pe,c));ke=Y(ui(e,Fe,c));A=Me?a:l;Se=Me?l:a;Oe=Me?we:ke;C=Me?ke:we;ye=Y(Cr(e,2,c));D=Y(Cr(e,0,c));w=Y(Y(Rr(e+364|0,c))-Oe);E=Y(Y(Rr(e+380|0,c))-Oe);k=Y(Y(Rr(e+372|0,f))-C);S=Y(Y(Rr(e+388|0,f))-C);te=Me?w:k;ne=Me?E:S;ye=Y(t-ye);t=Y(ye-Oe);if(wt(t)|0)Oe=t;else Oe=Y(RT(Y(PT(t,E)),w));ge=Y(n-D);t=Y(ge-C);if(wt(t)|0)_e=t;else _e=Y(RT(Y(PT(t,S)),k));w=Me?Oe:_e;me=Me?_e:Oe;e:do{if((A|0)==1){i=0;g=0;while(1){m=Mt(e,g)|0;if(!i){if(Y(li(m))>Y(0.0)?Y(si(m))>Y(0.0):0)i=m;else i=0}else if(ai(m)|0){y=0;break e}g=g+1|0;if(g>>>0>=Ne>>>0){y=i;break}}}else y=0}while(0);T=y+500|0;x=y+504|0;i=0;m=0;t=Y(0.0);_=0;do{g=o[(o[Re>>2]|0)+(_<<2)>>2]|0;if((o[g+36>>2]|0)==1){ci(g);r[g+985>>0]=1;r[g+984>>0]=0}else{Mr(g);if(p)Nr(g,Yr(g,Ie)|0,w,me,Oe);do{if((o[g+24>>2]|0)!=1){if((g|0)==(y|0)){o[T>>2]=o[2278];s[x>>2]=Y(0.0);break}else{fi(e,g,Oe,a,_e,Oe,_e,l,Ie,v);break}}else{if(m|0)o[m+960>>2]=g;o[g+960>>2]=0;m=g;i=(i|0)==0?g:i}}while(0);he=Y(s[g+504>>2]);t=Y(t+Y(he+Y(Cr(g,Pe,Oe))))}_=_+1|0}while((_|0)!=(Ne|0));F=t>w;ve=Q&((A|0)==2&F)?1:A;N=(Se|0)==1;B=N&(p^1);U=(ve|0)==1;j=(ve|0)==2;z=976+(Pe<<2)|0;W=(Se|2|0)==2;q=N&(Q^1);H=1040+(Fe<<2)|0;V=1040+(Pe<<2)|0;$=976+(Fe<<2)|0;G=(Se|0)!=1;F=Q&((A|0)!=0&F);P=e+976|0;N=N^1;t=w;I=0;L=0;he=Y(0.0);re=Y(0.0);while(1){e:do{if(I>>>0>>0){x=o[Re>>2]|0;_=0;S=Y(0.0);k=Y(0.0);E=Y(0.0);w=Y(0.0);g=0;m=0;y=I;while(1){T=o[x+(y<<2)>>2]|0;if((o[T+36>>2]|0)!=1?(o[T+940>>2]=L,(o[T+24>>2]|0)!=1):0){D=Y(Cr(T,Pe,Oe));X=o[z>>2]|0;n=Y(Rr(T+380+(X<<3)|0,be));C=Y(s[T+504>>2]);n=Y(PT(n,C));n=Y(RT(Y(Rr(T+364+(X<<3)|0,be)),n));if(Q&(_|0)!=0&Y(D+Y(k+n))>t){l=_;D=S;A=y;break e}D=Y(D+n);n=Y(k+D);D=Y(S+D);if(ai(T)|0){E=Y(E+Y(li(T)));w=Y(w-Y(C*Y(si(T))))}if(m|0)o[m+960>>2]=T;o[T+960>>2]=0;_=_+1|0;m=T;g=(g|0)==0?T:g}else{D=S;n=k}y=y+1|0;if(y>>>0>>0){S=D;k=n}else{l=_;A=y;break}}}else{l=0;D=Y(0.0);E=Y(0.0);w=Y(0.0);g=0;A=I}}while(0);X=E>Y(0.0)&EY(0.0)&wne&((wt(ne)|0)^1))){if(!(r[(o[P>>2]|0)+3>>0]|0)){if(!(O==Y(0.0))?!(Y(li(e))==Y(0.0)):0){X=53;break}t=D;X=53}else X=51}else{t=ne;X=51}}else{t=te;X=51}}else X=51}while(0);if((X|0)==51){X=0;if(wt(t)|0)X=53;else{M=Y(t-D);R=t}}if((X|0)==53){X=0;if(D>2]|0;y=MY(0.0);k=Y(M/O);E=Y(0.0);D=Y(0.0);t=Y(0.0);m=g;do{n=Y(Rr(m+380+(_<<3)|0,be));w=Y(Rr(m+364+(_<<3)|0,be));w=Y(PT(n,Y(RT(w,Y(s[m+504>>2])))));if(y){n=Y(w*Y(si(m)));if(n!=Y(-0.0)?(Be=Y(w-Y(C*n)),se=Y(di(m,Pe,Be,R,Oe)),Be!=se):0){E=Y(E-Y(se-w));t=Y(t+n)}}else if((T?(ce=Y(li(m)),ce!=Y(0.0)):0)?(Be=Y(w+Y(k*ce)),fe=Y(di(m,Pe,Be,R,Oe)),Be!=fe):0){E=Y(E-Y(fe-w));D=Y(D-ce)}m=o[m+960>>2]|0}while((m|0)!=0);t=Y(S+t);w=Y(M+E);if(!le){C=Y(O+D);y=o[z>>2]|0;T=wY(0.0);C=Y(w/C);t=Y(0.0);do{Be=Y(Rr(g+380+(y<<3)|0,be));E=Y(Rr(g+364+(y<<3)|0,be));E=Y(PT(Be,Y(RT(E,Y(s[g+504>>2])))));if(T){Be=Y(E*Y(si(g)));w=Y(-Be);if(Be!=Y(-0.0)){Be=Y(k*w);w=Y(di(g,Pe,Y(E+(x?w:Be)),R,Oe))}else w=E}else if(_?(de=Y(li(g)),de!=Y(0.0)):0)w=Y(di(g,Pe,Y(E+Y(C*de)),R,Oe));else w=E;t=Y(t-Y(w-E));D=Y(Cr(g,Pe,Oe));n=Y(Cr(g,Fe,Oe));w=Y(w+D);s[oe>>2]=w;o[ae>>2]=1;E=Y(s[g+396>>2]);e:do{if(wt(E)|0){m=wt(me)|0;do{if(!m){if(F|(Ir(g,Fe,me)|0|N))break;if((pi(e,g)|0)!=4)break;if((o[(hi(g,Fe)|0)+4>>2]|0)==3)break;if((o[(vi(g,Fe)|0)+4>>2]|0)==3)break;s[ie>>2]=me;o[ue>>2]=1;break e}}while(0);if(Ir(g,Fe,me)|0){m=o[g+992+(o[$>>2]<<2)>>2]|0;Be=Y(n+Y(Rr(m,me)));s[ie>>2]=Be;m=G&(o[m+4>>2]|0)==2;o[ue>>2]=((wt(Be)|0|m)^1)&1;break}else{s[ie>>2]=me;o[ue>>2]=m?0:2;break}}else{Be=Y(w-D);O=Y(Be/E);Be=Y(E*Be);o[ue>>2]=1;s[ie>>2]=Y(n+(Me?O:Be))}}while(0);mi(g,Pe,R,Oe,ae,oe);mi(g,Fe,me,Oe,ue,ie);do{if(!(Ir(g,Fe,me)|0)?(pi(e,g)|0)==4:0){if((o[(hi(g,Fe)|0)+4>>2]|0)==3){m=0;break}m=(o[(vi(g,Fe)|0)+4>>2]|0)!=3}else m=0}while(0);Be=Y(s[oe>>2]);O=Y(s[ie>>2]);Ue=o[ae>>2]|0;je=o[ue>>2]|0;Dr(g,Me?Be:O,Me?O:Be,Ie,Me?Ue:je,Me?je:Ue,Oe,_e,p&(m^1),3488,v)|0;r[K>>0]=r[K>>0]|r[g+508>>0];g=o[g+960>>2]|0}while((g|0)!=0)}else t=Y(0.0)}else t=Y(0.0);t=Y(M+t);je=t>0]=je|u[K>>0];if(j&t>Y(0.0)){m=o[z>>2]|0;if((o[e+364+(m<<3)+4>>2]|0)!=0?(pe=Y(Rr(e+364+(m<<3)|0,be)),pe>=Y(0.0)):0)w=Y(RT(Y(0.0),Y(pe-Y(R-t))));else w=Y(0.0)}else w=t;T=I>>>0>>0;if(T){y=o[Re>>2]|0;_=I;m=0;do{g=o[y+(_<<2)>>2]|0;if(!(o[g+24>>2]|0)){m=((o[(hi(g,Pe)|0)+4>>2]|0)==3&1)+m|0;m=m+((o[(vi(g,Pe)|0)+4>>2]|0)==3&1)|0}_=_+1|0}while((_|0)!=(A|0));if(m){D=Y(0.0);n=Y(0.0)}else X=101}else X=101;e:do{if((X|0)==101){X=0;switch(J|0){case 1:{m=0;D=Y(w*Y(.5));n=Y(0.0);break e}case 2:{m=0;D=w;n=Y(0.0);break e}case 3:{if(l>>>0<=1){m=0;D=Y(0.0);n=Y(0.0);break e}n=Y((l+-1|0)>>>0);m=0;D=Y(0.0);n=Y(Y(RT(w,Y(0.0)))/n);break e}case 5:{n=Y(w/Y((l+1|0)>>>0));m=0;D=n;break e}case 4:{n=Y(w/Y(l>>>0));m=0;D=Y(n*Y(.5));break e}default:{m=0;D=Y(0.0);n=Y(0.0);break e}}}}while(0);t=Y(Z+D);if(T){E=Y(w/Y(m|0));_=o[Re>>2]|0;g=I;w=Y(0.0);do{m=o[_+(g<<2)>>2]|0;e:do{if((o[m+36>>2]|0)!=1){switch(o[m+24>>2]|0){case 1:{if(gi(m,Pe)|0){if(!p)break e;Be=Y(_i(m,Pe,R));Be=Y(Be+Y(Kr(e,Pe)));Be=Y(Be+Y(Vr(m,Pe,Oe)));s[m+400+(o[V>>2]<<2)>>2]=Be;break e}break}case 0:{je=(o[(hi(m,Pe)|0)+4>>2]|0)==3;Be=Y(E+t);t=je?Be:t;if(p){je=m+400+(o[V>>2]<<2)|0;s[je>>2]=Y(t+Y(s[je>>2]))}je=(o[(vi(m,Pe)|0)+4>>2]|0)==3;Be=Y(E+t);t=je?Be:t;if(B){Be=Y(n+Y(Cr(m,Pe,Oe)));w=me;t=Y(t+Y(Be+Y(s[m+504>>2])));break e}else{t=Y(t+Y(n+Y(yi(m,Pe,Oe))));w=Y(RT(w,Y(yi(m,Fe,Oe))));break e}}default:{}}if(p){Be=Y(D+Y(Kr(e,Pe)));je=m+400+(o[V>>2]<<2)|0;s[je>>2]=Y(Be+Y(s[je>>2]))}}}while(0);g=g+1|0}while((g|0)!=(A|0))}else w=Y(0.0);n=Y(ee+t);if(W)D=Y(Y(di(e,Fe,Y(ke+w),Ce,c))-ke);else D=me;E=Y(Y(di(e,Fe,Y(ke+(q?me:w)),Ce,c))-ke);if(T&p){g=I;do{_=o[(o[Re>>2]|0)+(g<<2)>>2]|0;do{if((o[_+36>>2]|0)!=1){if((o[_+24>>2]|0)==1){if(gi(_,Fe)|0){Be=Y(_i(_,Fe,me));Be=Y(Be+Y(Kr(e,Fe)));Be=Y(Be+Y(Vr(_,Fe,Oe)));m=o[H>>2]|0;s[_+400+(m<<2)>>2]=Be;if(!(wt(Be)|0))break}else m=o[H>>2]|0;Be=Y(Kr(e,Fe));s[_+400+(m<<2)>>2]=Y(Be+Y(Vr(_,Fe,Oe)));break}m=pi(e,_)|0;do{if((m|0)==4){if((o[(hi(_,Fe)|0)+4>>2]|0)==3){X=139;break}if((o[(vi(_,Fe)|0)+4>>2]|0)==3){X=139;break}if(Ir(_,Fe,me)|0){t=b;break}Ue=o[_+908+(o[z>>2]<<2)>>2]|0;o[ie>>2]=Ue;t=Y(s[_+396>>2]);je=wt(t)|0;w=(o[d>>2]=Ue,Y(s[d>>2]));if(je)t=E;else{M=Y(Cr(_,Fe,Oe));Be=Y(w/t);t=Y(t*w);t=Y(M+(Me?Be:t))}s[oe>>2]=t;s[ie>>2]=Y(Y(Cr(_,Pe,Oe))+w);o[ue>>2]=1;o[ae>>2]=1;mi(_,Pe,R,Oe,ue,ie);mi(_,Fe,me,Oe,ae,oe);t=Y(s[ie>>2]);M=Y(s[oe>>2]);Be=Me?t:M;t=Me?M:t;je=((wt(Be)|0)^1)&1;Dr(_,Be,t,Ie,je,((wt(t)|0)^1)&1,Oe,_e,1,3493,v)|0;t=b}else X=139}while(0);e:do{if((X|0)==139){X=0;t=Y(D-Y(yi(_,Fe,Oe)));do{if((o[(hi(_,Fe)|0)+4>>2]|0)==3){if((o[(vi(_,Fe)|0)+4>>2]|0)!=3)break;t=Y(b+Y(RT(Y(0.0),Y(t*Y(.5)))));break e}}while(0);if((o[(vi(_,Fe)|0)+4>>2]|0)==3){t=b;break}if((o[(hi(_,Fe)|0)+4>>2]|0)==3){t=Y(b+Y(RT(Y(0.0),t)));break}switch(m|0){case 1:{t=b;break e}case 2:{t=Y(b+Y(t*Y(.5)));break e}default:{t=Y(b+t);break e}}}}while(0);Be=Y(he+t);je=_+400+(o[H>>2]<<2)|0;s[je>>2]=Y(Be+Y(s[je>>2]))}}while(0);g=g+1|0}while((g|0)!=(A|0))}he=Y(he+E);re=Y(RT(re,n));l=L+1|0;if(A>>>0>=Ne>>>0)break;else{t=R;I=A;L=l}}do{if(p){m=l>>>0>1;if(!m?!(bi(e)|0):0)break;if(!(wt(me)|0)){t=Y(me-he);e:do{switch(o[e+12>>2]|0){case 3:{b=Y(b+t);k=Y(0.0);break}case 2:{b=Y(b+Y(t*Y(.5)));k=Y(0.0);break}case 4:{if(me>he)k=Y(t/Y(l>>>0));else k=Y(0.0);break}case 7:if(me>he){b=Y(b+Y(t/Y(l<<1>>>0)));k=Y(t/Y(l>>>0));k=m?k:Y(0.0);break e}else{b=Y(b+Y(t*Y(.5)));k=Y(0.0);break e}case 6:{k=Y(t/Y(L>>>0));k=me>he&m?k:Y(0.0);break}default:k=Y(0.0)}}while(0);if(l|0){T=1040+(Fe<<2)|0;x=976+(Fe<<2)|0;y=0;g=0;while(1){e:do{if(g>>>0>>0){w=Y(0.0);E=Y(0.0);t=Y(0.0);_=g;while(1){m=o[(o[Re>>2]|0)+(_<<2)>>2]|0;do{if((o[m+36>>2]|0)!=1?(o[m+24>>2]|0)==0:0){if((o[m+940>>2]|0)!=(y|0))break e;if(wi(m,Fe)|0){Be=Y(s[m+908+(o[x>>2]<<2)>>2]);t=Y(RT(t,Y(Be+Y(Cr(m,Fe,Oe)))))}if((pi(e,m)|0)!=5)break;pe=Y(Ei(m));pe=Y(pe+Y(Vr(m,0,Oe)));Be=Y(s[m+912>>2]);Be=Y(Y(Be+Y(Cr(m,0,Oe)))-pe);pe=Y(RT(E,pe));Be=Y(RT(w,Be));w=Be;E=pe;t=Y(RT(t,Y(pe+Be)))}}while(0);m=_+1|0;if(m>>>0>>0)_=m;else{_=m;break}}}else{E=Y(0.0);t=Y(0.0);_=g}}while(0);C=Y(k+t);n=b;b=Y(b+C);if(g>>>0<_>>>0){D=Y(n+E);m=g;do{g=o[(o[Re>>2]|0)+(m<<2)>>2]|0;e:do{if((o[g+36>>2]|0)!=1?(o[g+24>>2]|0)==0:0)switch(pi(e,g)|0){case 1:{Be=Y(n+Y(Vr(g,Fe,Oe)));s[g+400+(o[T>>2]<<2)>>2]=Be;break e}case 3:{Be=Y(Y(b-Y($r(g,Fe,Oe)))-Y(s[g+908+(o[x>>2]<<2)>>2]));s[g+400+(o[T>>2]<<2)>>2]=Be;break e}case 2:{Be=Y(n+Y(Y(C-Y(s[g+908+(o[x>>2]<<2)>>2]))*Y(.5)));s[g+400+(o[T>>2]<<2)>>2]=Be;break e}case 4:{Be=Y(n+Y(Vr(g,Fe,Oe)));s[g+400+(o[T>>2]<<2)>>2]=Be;if(Ir(g,Fe,me)|0)break e;if(Me){w=Y(s[g+908>>2]);t=Y(w+Y(Cr(g,Pe,Oe)));E=C}else{E=Y(s[g+912>>2]);E=Y(E+Y(Cr(g,Fe,Oe)));t=C;w=Y(s[g+908>>2])}if(vr(t,w)|0?vr(E,Y(s[g+912>>2]))|0:0)break e;Dr(g,t,E,Ie,1,1,Oe,_e,1,3501,v)|0;break e}case 5:{s[g+404>>2]=Y(Y(D-Y(Ei(g)))+Y(_i(g,0,me)));break e}default:break e}}while(0);m=m+1|0}while((m|0)!=(_|0))}y=y+1|0;if((y|0)==(l|0))break;else g=_}}}}}while(0);s[e+908>>2]=Y(di(e,2,ye,c,c));s[e+912>>2]=Y(di(e,0,ge,f,c));if((ve|0)!=0?(Ee=o[e+32>>2]|0,De=(ve|0)==2,!(De&(Ee|0)!=2)):0){if(De&(Ee|0)==2){t=Y(we+R);t=Y(RT(Y(PT(t,Y(Di(e,Pe,re,be)))),we));X=198}}else{t=Y(di(e,Pe,re,be,c));X=198}if((X|0)==198)s[e+908+(o[976+(Pe<<2)>>2]<<2)>>2]=t;if((Se|0)!=0?(xe=o[e+32>>2]|0,Ae=(Se|0)==2,!(Ae&(xe|0)!=2)):0){if(Ae&(xe|0)==2){t=Y(ke+me);t=Y(RT(Y(PT(t,Y(Di(e,Fe,Y(ke+he),Ce)))),ke));X=204}}else{t=Y(di(e,Fe,Y(ke+he),Ce,c));X=204}if((X|0)==204)s[e+908+(o[976+(Fe<<2)>>2]<<2)>>2]=t;if(p){if((o[Te>>2]|0)==2){g=976+(Fe<<2)|0;_=1040+(Fe<<2)|0;m=0;do{y=Mt(e,m)|0;if(!(o[y+24>>2]|0)){Ue=o[g>>2]|0;Be=Y(s[e+908+(Ue<<2)>>2]);je=y+400+(o[_>>2]<<2)|0;Be=Y(Be-Y(s[je>>2]));s[je>>2]=Y(Be-Y(s[y+908+(Ue<<2)>>2]))}m=m+1|0}while((m|0)!=(Ne|0))}if(i|0){m=Me?ve:a;do{Ci(e,i,Oe,m,_e,Ie,v);i=o[i+960>>2]|0}while((i|0)!=0)}m=(Pe|2|0)==3;g=(Fe|2|0)==3;if(m|g){i=0;do{_=o[(o[Re>>2]|0)+(i<<2)>>2]|0;if((o[_+36>>2]|0)!=1){if(m)ki(e,_,Pe);if(g)ki(e,_,Fe)}i=i+1|0}while((i|0)!=(Ne|0))}}}else ei(e,t,n,a,l,c,f)}while(0);h=Le;return}function Ar(e,t){e=e|0;t=Y(t);var n=0;Ct(e,t>=Y(0.0),3147);n=t==Y(0.0);s[e+4>>2]=n?Y(0.0):t;return}function Or(e,t,n,i){e=e|0;t=Y(t);n=Y(n);i=i|0;var u=ft,a=ft,l=0,c=0,f=0;o[2278]=(o[2278]|0)+1;Mr(e);if(!(Ir(e,2,t)|0)){u=Y(Rr(e+380|0,t));if(!(u>=Y(0.0))){f=((wt(t)|0)^1)&1;u=t}else f=2}else{u=Y(Rr(o[e+992>>2]|0,t));f=1;u=Y(u+Y(Cr(e,2,t)))}if(!(Ir(e,0,n)|0)){a=Y(Rr(e+388|0,n));if(!(a>=Y(0.0))){c=((wt(n)|0)^1)&1;a=n}else c=2}else{a=Y(Rr(o[e+996>>2]|0,n));c=1;a=Y(a+Y(Cr(e,0,t)))}l=e+976|0;if(Dr(e,u,a,i,f,c,t,n,1,3189,o[l>>2]|0)|0?(Nr(e,o[e+496>>2]|0,t,n,t),Pr(e,Y(s[(o[l>>2]|0)+4>>2]),Y(0.0),Y(0.0)),r[11696]|0):0)mr(e,7);return}function Mr(e){e=e|0;var t=0,n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;a=l+24|0;u=l+16|0;r=l+8|0;i=l;n=0;do{t=e+380+(n<<3)|0;if(!((o[e+380+(n<<3)+4>>2]|0)!=0?(s=t,c=o[s+4>>2]|0,f=r,o[f>>2]=o[s>>2],o[f+4>>2]=c,f=e+364+(n<<3)|0,c=o[f+4>>2]|0,s=i,o[s>>2]=o[f>>2],o[s+4>>2]=c,o[u>>2]=o[r>>2],o[u+4>>2]=o[r+4>>2],o[a>>2]=o[i>>2],o[a+4>>2]=o[i+4>>2],hr(u,a)|0):0))t=e+348+(n<<3)|0;o[e+992+(n<<2)>>2]=t;n=n+1|0}while((n|0)!=2);h=l;return}function Ir(e,t,n){e=e|0;t=t|0;n=Y(n);var r=0;e=o[e+992+(o[976+(t<<2)>>2]<<2)>>2]|0;switch(o[e+4>>2]|0){case 0:case 3:{e=0;break}case 1:{if(Y(s[e>>2])>2])>2]|0){case 2:{t=Y(Y(Y(s[e>>2])*t)/Y(100.0));break}case 1:{t=Y(s[e>>2]);break}default:t=Y(E)}return Y(t)}function Nr(e,t,n,r,i){e=e|0;t=t|0;n=Y(n);r=Y(r);i=Y(i);var u=0,a=ft;t=o[e+944>>2]|0?t:1;u=Xr(o[e+4>>2]|0,t)|0;t=ri(u,t)|0;n=Y(Mi(e,u,n));r=Y(Mi(e,t,r));a=Y(n+Y(Vr(e,u,i)));s[e+400+(o[1040+(u<<2)>>2]<<2)>>2]=a;n=Y(n+Y($r(e,u,i)));s[e+400+(o[1e3+(u<<2)>>2]<<2)>>2]=n;n=Y(r+Y(Vr(e,t,i)));s[e+400+(o[1040+(t<<2)>>2]<<2)>>2]=n;i=Y(r+Y($r(e,t,i)));s[e+400+(o[1e3+(t<<2)>>2]<<2)>>2]=i;return}function Pr(e,t,n,r){e=e|0;t=Y(t);n=Y(n);r=Y(r);var i=0,u=0,a=ft,l=ft,c=0,f=0,d=ft,p=0,h=ft,v=ft,m=ft,g=ft;if(!(t==Y(0.0))){i=e+400|0;g=Y(s[i>>2]);u=e+404|0;m=Y(s[u>>2]);p=e+416|0;v=Y(s[p>>2]);f=e+420|0;a=Y(s[f>>2]);h=Y(g+n);d=Y(m+r);r=Y(h+v);l=Y(d+a);c=(o[e+988>>2]|0)==1;s[i>>2]=Y(_r(g,t,0,c));s[u>>2]=Y(_r(m,t,0,c));n=Y(LT(Y(v*t),Y(1.0)));if(vr(n,Y(0.0))|0)u=0;else u=(vr(n,Y(1.0))|0)^1;n=Y(LT(Y(a*t),Y(1.0)));if(vr(n,Y(0.0))|0)i=0;else i=(vr(n,Y(1.0))|0)^1;g=Y(_r(r,t,c&u,c&(u^1)));s[p>>2]=Y(g-Y(_r(h,t,0,c)));g=Y(_r(l,t,c&i,c&(i^1)));s[f>>2]=Y(g-Y(_r(d,t,0,c)));u=(o[e+952>>2]|0)-(o[e+948>>2]|0)>>2;if(u|0){i=0;do{Pr(Mt(e,i)|0,t,h,d);i=i+1|0}while((i|0)!=(u|0))}}return}function Fr(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;switch(n|0){case 5:case 0:{e=oT(o[489]|0,r,i)|0;break}default:e=UT(r,i)|0}return e|0}function Lr(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0;i=h;h=h+16|0;u=i;o[u>>2]=r;Br(e,0,t,n,u);h=i;return}function Br(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;e=e|0?e:956;xA[o[e+8>>2]&1](e,t,n,r,i)|0;if((n|0)==5)Ye();else return}function Ur(e,t,n){e=e|0;t=t|0;n=n|0;r[e+t>>0]=n&1;return}function jr(e,t){e=e|0;t=t|0;var n=0,r=0;o[e>>2]=0;o[e+4>>2]=0;o[e+8>>2]=0;n=t+4|0;r=(o[n>>2]|0)-(o[t>>2]|0)>>2;if(r|0){zr(e,r);Wr(e,o[t>>2]|0,o[n>>2]|0,r)}return}function zr(e,t){e=e|0;t=t|0;var n=0;if((Hr(e)|0)>>>0>>0)jT(e);if(t>>>0>1073741823)Ye();else{n=qT(t<<2)|0;o[e+4>>2]=n;o[e>>2]=n;o[e+8>>2]=n+(t<<2);return}}function Wr(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;r=e+4|0;e=n-t|0;if((e|0)>0){ix(o[r>>2]|0,t|0,e|0)|0;o[r>>2]=(o[r>>2]|0)+(e>>>2<<2)}return}function Hr(e){e=e|0;return 1073741823}function Vr(e,t,n){e=e|0;t=t|0;n=Y(n);if(Gr(t)|0?(o[e+96>>2]|0)!=0:0)e=e+92|0;else e=Et(e+60|0,o[1040+(t<<2)>>2]|0,992)|0;return Y(qr(e,n))}function $r(e,t,n){e=e|0;t=t|0;n=Y(n);if(Gr(t)|0?(o[e+104>>2]|0)!=0:0)e=e+100|0;else e=Et(e+60|0,o[1e3+(t<<2)>>2]|0,992)|0;return Y(qr(e,n))}function Gr(e){e=e|0;return(e|1|0)==3|0}function qr(e,t){e=e|0;t=Y(t);if((o[e+4>>2]|0)==3)t=Y(0.0);else t=Y(Rr(e,t));return Y(t)}function Yr(e,t){e=e|0;t=t|0;e=o[e>>2]|0;return((e|0)==0?(t|0)>1?t:1:e)|0}function Xr(e,t){e=e|0;t=t|0;var n=0;e:do{if((t|0)==2){switch(e|0){case 2:{e=3;break e}case 3:break;default:{n=4;break e}}e=2}else n=4}while(0);return e|0}function Kr(e,t){e=e|0;t=t|0;var n=ft;if(!((Gr(t)|0?(o[e+312>>2]|0)!=0:0)?(n=Y(s[e+308>>2]),n>=Y(0.0)):0))n=Y(RT(Y(s[(Et(e+276|0,o[1040+(t<<2)>>2]|0,992)|0)>>2]),Y(0.0)));return Y(n)}function Jr(e,t){e=e|0;t=t|0;var n=ft;if(!((Gr(t)|0?(o[e+320>>2]|0)!=0:0)?(n=Y(s[e+316>>2]),n>=Y(0.0)):0))n=Y(RT(Y(s[(Et(e+276|0,o[1e3+(t<<2)>>2]|0,992)|0)>>2]),Y(0.0)));return Y(n)}function Qr(e,t,n){e=e|0;t=t|0;n=Y(n);var r=ft;if(!((Gr(t)|0?(o[e+240>>2]|0)!=0:0)?(r=Y(Rr(e+236|0,n)),r>=Y(0.0)):0))r=Y(RT(Y(Rr(Et(e+204|0,o[1040+(t<<2)>>2]|0,992)|0,n)),Y(0.0)));return Y(r)}function Zr(e,t,n){e=e|0;t=t|0;n=Y(n);var r=ft;if(!((Gr(t)|0?(o[e+248>>2]|0)!=0:0)?(r=Y(Rr(e+244|0,n)),r>=Y(0.0)):0))r=Y(RT(Y(Rr(Et(e+204|0,o[1e3+(t<<2)>>2]|0,992)|0,n)),Y(0.0)));return Y(r)}function ei(e,t,n,r,i,u,a){e=e|0;t=Y(t);n=Y(n);r=r|0;i=i|0;u=Y(u);a=Y(a);var l=ft,c=ft,f=ft,d=ft,p=ft,v=ft,m=0,g=0,_=0;_=h;h=h+16|0;m=_;g=e+964|0;Pt(e,(o[g>>2]|0)!=0,3519);l=Y(ui(e,2,t));c=Y(ui(e,0,t));f=Y(Cr(e,2,t));d=Y(Cr(e,0,t));if(wt(t)|0)p=t;else p=Y(RT(Y(0.0),Y(Y(t-f)-l)));if(wt(n)|0)v=n;else v=Y(RT(Y(0.0),Y(Y(n-d)-c)));if((r|0)==1&(i|0)==1){s[e+908>>2]=Y(di(e,2,Y(t-f),u,u));t=Y(di(e,0,Y(n-d),a,u))}else{OA[o[g>>2]&1](m,e,p,r,v,i);p=Y(l+Y(s[m>>2]));v=Y(t-f);s[e+908>>2]=Y(di(e,2,(r|2|0)==2?p:v,u,u));v=Y(c+Y(s[m+4>>2]));t=Y(n-d);t=Y(di(e,0,(i|2|0)==2?v:t,a,u))}s[e+912>>2]=t;h=_;return}function ti(e,t,n,r,i,o,u){e=e|0;t=Y(t);n=Y(n);r=r|0;i=i|0;o=Y(o);u=Y(u);var a=ft,l=ft,c=ft,f=ft;c=Y(ui(e,2,o));a=Y(ui(e,0,o));f=Y(Cr(e,2,o));l=Y(Cr(e,0,o));t=Y(t-f);s[e+908>>2]=Y(di(e,2,(r|2|0)==2?c:t,o,o));n=Y(n-l);s[e+912>>2]=Y(di(e,0,(i|2|0)==2?a:n,u,o));return}function ni(e,t,n,r,i,o,u){e=e|0;t=Y(t);n=Y(n);r=r|0;i=i|0;o=Y(o);u=Y(u);var a=0,l=ft,c=ft;a=(r|0)==2;if((!(t<=Y(0.0)&a)?!(n<=Y(0.0)&(i|0)==2):0)?!((r|0)==1&(i|0)==1):0)e=0;else{l=Y(Cr(e,0,o));c=Y(Cr(e,2,o));a=t>2]=Y(di(e,2,a?Y(0.0):t,o,o));t=Y(n-l);a=n>2]=Y(di(e,0,a?Y(0.0):t,u,o));e=1}return e|0}function ri(e,t){e=e|0;t=t|0;if(Si(e)|0)e=Xr(2,t)|0;else e=0;return e|0}function ii(e,t,n){e=e|0;t=t|0;n=Y(n);n=Y(Qr(e,t,n));return Y(n+Y(Kr(e,t)))}function oi(e,t,n){e=e|0;t=t|0;n=Y(n);n=Y(Zr(e,t,n));return Y(n+Y(Jr(e,t)))}function ui(e,t,n){e=e|0;t=t|0;n=Y(n);var r=ft;r=Y(ii(e,t,n));return Y(r+Y(oi(e,t,n)))}function ai(e){e=e|0;if(!(o[e+24>>2]|0)){if(Y(li(e))!=Y(0.0))e=1;else e=Y(si(e))!=Y(0.0)}else e=0;return e|0}function li(e){e=e|0;var t=ft;if(o[e+944>>2]|0){t=Y(s[e+44>>2]);if(wt(t)|0){t=Y(s[e+40>>2]);e=t>Y(0.0)&((wt(t)|0)^1);return Y(e?t:Y(0.0))}}else t=Y(0.0);return Y(t)}function si(e){e=e|0;var t=ft,n=0,i=ft;do{if(o[e+944>>2]|0){t=Y(s[e+48>>2]);if(wt(t)|0){n=r[(o[e+976>>2]|0)+2>>0]|0;if(n<<24>>24==0?(i=Y(s[e+40>>2]),i>24?Y(1.0):Y(0.0)}}else t=Y(0.0)}while(0);return Y(t)}function ci(e){e=e|0;var t=0,n=0;tx(e+400|0,0,540)|0;r[e+985>>0]=1;Wt(e);n=Ot(e)|0;if(n|0){t=e+948|0;e=0;do{ci(o[(o[t>>2]|0)+(e<<2)>>2]|0);e=e+1|0}while((e|0)!=(n|0))}return}function fi(e,t,n,r,i,u,a,l,c,f){e=e|0;t=t|0;n=Y(n);r=r|0;i=Y(i);u=Y(u);a=Y(a);l=l|0;c=c|0;f=f|0;var d=0,p=ft,v=0,m=0,g=ft,_=ft,y=0,b=ft,w=0,D=ft,C=0,k=0,S=0,T=0,x=0,A=0,O=0,M=0,I=0,R=0;I=h;h=h+16|0;S=I+12|0;T=I+8|0;x=I+4|0;A=I;M=Xr(o[e+4>>2]|0,c)|0;C=Gr(M)|0;p=Y(Rr(Ti(t)|0,C?u:a));k=Ir(t,2,u)|0;O=Ir(t,0,a)|0;do{if(!(wt(p)|0)?!(wt(C?n:i)|0):0){d=t+504|0;if(!(wt(Y(s[d>>2]))|0)){if(!(xi(o[t+976>>2]|0,0)|0))break;if((o[t+500>>2]|0)==(o[2278]|0))break}s[d>>2]=Y(RT(p,Y(ui(t,M,u))))}else v=7}while(0);do{if((v|0)==7){w=C^1;if(!(w|k^1)){a=Y(Rr(o[t+992>>2]|0,u));s[t+504>>2]=Y(RT(a,Y(ui(t,2,u))));break}if(!(C|O^1)){a=Y(Rr(o[t+996>>2]|0,a));s[t+504>>2]=Y(RT(a,Y(ui(t,0,u))));break}s[S>>2]=Y(E);s[T>>2]=Y(E);o[x>>2]=0;o[A>>2]=0;b=Y(Cr(t,2,u));D=Y(Cr(t,0,u));if(k){g=Y(b+Y(Rr(o[t+992>>2]|0,u)));s[S>>2]=g;o[x>>2]=1;m=1}else{m=0;g=Y(E)}if(O){p=Y(D+Y(Rr(o[t+996>>2]|0,a)));s[T>>2]=p;o[A>>2]=1;d=1}else{d=0;p=Y(E)}v=o[e+32>>2]|0;if(!(C&(v|0)==2)){if(wt(g)|0?!(wt(n)|0):0){s[S>>2]=n;o[x>>2]=2;m=2;g=n}}else v=2;if((!((v|0)==2&w)?wt(p)|0:0)?!(wt(i)|0):0){s[T>>2]=i;o[A>>2]=2;d=2;p=i}_=Y(s[t+396>>2]);y=wt(_)|0;do{if(!y){if((m|0)==1&w){s[T>>2]=Y(Y(g-b)/_);o[A>>2]=1;d=1;v=1;break}if(C&(d|0)==1){s[S>>2]=Y(_*Y(p-D));o[x>>2]=1;d=1;v=1}else v=m}else v=m}while(0);R=wt(n)|0;m=(pi(e,t)|0)!=4;if(!(C|k|((r|0)!=1|R)|(m|(v|0)==1))?(s[S>>2]=n,o[x>>2]=1,!y):0){s[T>>2]=Y(Y(n-b)/_);o[A>>2]=1;d=1}if(!(O|w|((l|0)!=1|(wt(i)|0))|(m|(d|0)==1))?(s[T>>2]=i,o[A>>2]=1,!y):0){s[S>>2]=Y(_*Y(i-D));o[x>>2]=1}mi(t,2,u,u,x,S);mi(t,0,a,u,A,T);n=Y(s[S>>2]);i=Y(s[T>>2]);Dr(t,n,i,c,o[x>>2]|0,o[A>>2]|0,u,a,0,3565,f)|0;a=Y(s[t+908+(o[976+(M<<2)>>2]<<2)>>2]);s[t+504>>2]=Y(RT(a,Y(ui(t,M,u))))}}while(0);o[t+500>>2]=o[2278];h=I;return}function di(e,t,n,r,i){e=e|0;t=t|0;n=Y(n);r=Y(r);i=Y(i);r=Y(Di(e,t,n,r));return Y(RT(r,Y(ui(e,t,i))))}function pi(e,t){e=e|0;t=t|0;t=t+20|0;t=o[((o[t>>2]|0)==0?e+16|0:t)>>2]|0;if((t|0)==5?Si(o[e+4>>2]|0)|0:0)t=1;return t|0}function hi(e,t){e=e|0;t=t|0;if(Gr(t)|0?(o[e+96>>2]|0)!=0:0)t=4;else t=o[1040+(t<<2)>>2]|0;return e+60+(t<<3)|0}function vi(e,t){e=e|0;t=t|0;if(Gr(t)|0?(o[e+104>>2]|0)!=0:0)t=5;else t=o[1e3+(t<<2)>>2]|0;return e+60+(t<<3)|0}function mi(e,t,n,r,i,u){e=e|0;t=t|0;n=Y(n);r=Y(r);i=i|0;u=u|0;n=Y(Rr(e+380+(o[976+(t<<2)>>2]<<3)|0,n));n=Y(n+Y(Cr(e,t,r)));switch(o[i>>2]|0){case 2:case 1:{i=wt(n)|0;r=Y(s[u>>2]);s[u>>2]=i|r>2]=2;s[u>>2]=n}break}default:{}}return}function gi(e,t){e=e|0;t=t|0;e=e+132|0;if(Gr(t)|0?(o[(Et(e,4,948)|0)+4>>2]|0)!=0:0)e=1;else e=(o[(Et(e,o[1040+(t<<2)>>2]|0,948)|0)+4>>2]|0)!=0;return e|0}function _i(e,t,n){e=e|0;t=t|0;n=Y(n);var r=0,i=0;e=e+132|0;if(Gr(t)|0?(r=Et(e,4,948)|0,(o[r+4>>2]|0)!=0):0)i=4;else{r=Et(e,o[1040+(t<<2)>>2]|0,948)|0;if(!(o[r+4>>2]|0))n=Y(0.0);else i=4}if((i|0)==4)n=Y(Rr(r,n));return Y(n)}function yi(e,t,n){e=e|0;t=t|0;n=Y(n);var r=ft;r=Y(s[e+908+(o[976+(t<<2)>>2]<<2)>>2]);r=Y(r+Y(Vr(e,t,n)));return Y(r+Y($r(e,t,n)))}function bi(e){e=e|0;var t=0,n=0,r=0;e:do{if(!(Si(o[e+4>>2]|0)|0)){if((o[e+16>>2]|0)!=5){n=Ot(e)|0;if(!n)t=0;else{t=0;while(1){r=Mt(e,t)|0;if((o[r+24>>2]|0)==0?(o[r+20>>2]|0)==5:0){t=1;break e}t=t+1|0;if(t>>>0>=n>>>0){t=0;break}}}}else t=1}else t=0}while(0);return t|0}function wi(e,t){e=e|0;t=t|0;var n=ft;n=Y(s[e+908+(o[976+(t<<2)>>2]<<2)>>2]);return n>=Y(0.0)&((wt(n)|0)^1)|0}function Ei(e){e=e|0;var t=ft,n=0,r=0,i=0,u=0,a=0,l=0,c=ft;n=o[e+968>>2]|0;if(!n){u=Ot(e)|0;do{if(u|0){n=0;i=0;while(1){r=Mt(e,i)|0;if(o[r+940>>2]|0){a=8;break}if((o[r+24>>2]|0)!=1){l=(pi(e,r)|0)==5;if(l){n=r;break}else n=(n|0)==0?r:n}i=i+1|0;if(i>>>0>=u>>>0){a=8;break}}if((a|0)==8)if(!n)break;t=Y(Ei(n));return Y(t+Y(s[n+404>>2]))}}while(0);t=Y(s[e+912>>2])}else{c=Y(s[e+908>>2]);t=Y(s[e+912>>2]);t=Y(pA[n&0](e,c,t));Pt(e,(wt(t)|0)^1,3573)}return Y(t)}function Di(e,t,n,r){e=e|0;t=t|0;n=Y(n);r=Y(r);var i=ft,o=0;if(!(Si(t)|0)){if(Gr(t)|0){t=0;o=3}else{r=Y(E);i=Y(E)}}else{t=1;o=3}if((o|0)==3){i=Y(Rr(e+364+(t<<3)|0,r));r=Y(Rr(e+380+(t<<3)|0,r))}o=r=Y(0.0)&((wt(r)|0)^1));n=o?r:n;o=i>=Y(0.0)&((wt(i)|0)^1)&n>2]|0,u)|0;m=ri(_,u)|0;g=Gr(_)|0;p=Y(Cr(t,2,n));h=Y(Cr(t,0,n));if(!(Ir(t,2,n)|0)){if(gi(t,2)|0?Ai(t,2)|0:0){l=Y(s[e+908>>2]);c=Y(Kr(e,2));c=Y(l-Y(c+Y(Jr(e,2))));l=Y(_i(t,2,n));l=Y(di(t,2,Y(c-Y(l+Y(Oi(t,2,n)))),n,n))}else l=Y(E)}else l=Y(p+Y(Rr(o[t+992>>2]|0,n)));if(!(Ir(t,0,i)|0)){if(gi(t,0)|0?Ai(t,0)|0:0){c=Y(s[e+912>>2]);b=Y(Kr(e,0));b=Y(c-Y(b+Y(Jr(e,0))));c=Y(_i(t,0,i));c=Y(di(t,0,Y(b-Y(c+Y(Oi(t,0,i)))),i,n))}else c=Y(E)}else c=Y(h+Y(Rr(o[t+996>>2]|0,i)));f=wt(l)|0;d=wt(c)|0;do{if(f^d?(v=Y(s[t+396>>2]),!(wt(v)|0)):0)if(f){l=Y(p+Y(Y(c-h)*v));break}else{b=Y(h+Y(Y(l-p)/v));c=d?b:c;break}}while(0);d=wt(l)|0;f=wt(c)|0;if(d|f){w=(d^1)&1;r=n>Y(0.0)&((r|0)!=0&d);l=g?l:r?n:l;Dr(t,l,c,u,g?w:r?2:w,d&(f^1)&1,l,c,0,3623,a)|0;l=Y(s[t+908>>2]);l=Y(l+Y(Cr(t,2,n)));c=Y(s[t+912>>2]);c=Y(c+Y(Cr(t,0,n)))}Dr(t,l,c,u,1,1,l,c,1,3635,a)|0;if(Ai(t,_)|0?!(gi(t,_)|0):0){w=o[976+(_<<2)>>2]|0;b=Y(s[e+908+(w<<2)>>2]);b=Y(b-Y(s[t+908+(w<<2)>>2]));b=Y(b-Y(Jr(e,_)));b=Y(b-Y($r(t,_,n)));b=Y(b-Y(Oi(t,_,g?n:i)));s[t+400+(o[1040+(_<<2)>>2]<<2)>>2]=b}else y=21;do{if((y|0)==21){if(!(gi(t,_)|0)?(o[e+8>>2]|0)==1:0){w=o[976+(_<<2)>>2]|0;b=Y(s[e+908+(w<<2)>>2]);b=Y(Y(b-Y(s[t+908+(w<<2)>>2]))*Y(.5));s[t+400+(o[1040+(_<<2)>>2]<<2)>>2]=b;break}if(!(gi(t,_)|0)?(o[e+8>>2]|0)==2:0){w=o[976+(_<<2)>>2]|0;b=Y(s[e+908+(w<<2)>>2]);b=Y(b-Y(s[t+908+(w<<2)>>2]));s[t+400+(o[1040+(_<<2)>>2]<<2)>>2]=b}}}while(0);if(Ai(t,m)|0?!(gi(t,m)|0):0){w=o[976+(m<<2)>>2]|0;b=Y(s[e+908+(w<<2)>>2]);b=Y(b-Y(s[t+908+(w<<2)>>2]));b=Y(b-Y(Jr(e,m)));b=Y(b-Y($r(t,m,n)));b=Y(b-Y(Oi(t,m,g?i:n)));s[t+400+(o[1040+(m<<2)>>2]<<2)>>2]=b}else y=30;do{if((y|0)==30?!(gi(t,m)|0):0){if((pi(e,t)|0)==2){w=o[976+(m<<2)>>2]|0;b=Y(s[e+908+(w<<2)>>2]);b=Y(Y(b-Y(s[t+908+(w<<2)>>2]))*Y(.5));s[t+400+(o[1040+(m<<2)>>2]<<2)>>2]=b;break}w=(pi(e,t)|0)==3;if(w^(o[e+28>>2]|0)==2){w=o[976+(m<<2)>>2]|0;b=Y(s[e+908+(w<<2)>>2]);b=Y(b-Y(s[t+908+(w<<2)>>2]));s[t+400+(o[1040+(m<<2)>>2]<<2)>>2]=b}}}while(0);return}function ki(e,t,n){e=e|0;t=t|0;n=n|0;var r=ft,i=0;i=o[976+(n<<2)>>2]|0;r=Y(s[t+908+(i<<2)>>2]);r=Y(Y(s[e+908+(i<<2)>>2])-r);r=Y(r-Y(s[t+400+(o[1040+(n<<2)>>2]<<2)>>2]));s[t+400+(o[1e3+(n<<2)>>2]<<2)>>2]=r;return}function Si(e){e=e|0;return(e|1|0)==1|0}function Ti(e){e=e|0;var t=ft;switch(o[e+56>>2]|0){case 0:case 3:{t=Y(s[e+40>>2]);if(t>Y(0.0)&((wt(t)|0)^1))e=r[(o[e+976>>2]|0)+2>>0]|0?1056:992;else e=1056;break}default:e=e+52|0}return e|0}function xi(e,t){e=e|0;t=t|0;return(r[e+t>>0]|0)!=0|0}function Ai(e,t){e=e|0;t=t|0;e=e+132|0;if(Gr(t)|0?(o[(Et(e,5,948)|0)+4>>2]|0)!=0:0)e=1;else e=(o[(Et(e,o[1e3+(t<<2)>>2]|0,948)|0)+4>>2]|0)!=0;return e|0}function Oi(e,t,n){e=e|0;t=t|0;n=Y(n);var r=0,i=0;e=e+132|0;if(Gr(t)|0?(r=Et(e,5,948)|0,(o[r+4>>2]|0)!=0):0)i=4;else{r=Et(e,o[1e3+(t<<2)>>2]|0,948)|0;if(!(o[r+4>>2]|0))n=Y(0.0);else i=4}if((i|0)==4)n=Y(Rr(r,n));return Y(n)}function Mi(e,t,n){e=e|0;t=t|0;n=Y(n);if(gi(e,t)|0)n=Y(_i(e,t,n));else n=Y(-Y(Oi(e,t,n)));return Y(n)}function Ii(e){e=Y(e);return(s[d>>2]=e,o[d>>2]|0)|0}function Ri(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>1073741823)Ye();else{i=qT(t<<2)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<2)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<2);return}function Ni(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>2)<<2)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Pi(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-4-t|0)>>>2)<<2);e=o[e>>2]|0;if(e|0)XT(e);return}function Fi(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0;a=e+4|0;l=o[a>>2]|0;i=l-r|0;u=i>>2;e=t+(u<<2)|0;if(e>>>0>>0){r=l;do{o[r>>2]=o[e>>2];e=e+4|0;r=(o[a>>2]|0)+4|0;o[a>>2]=r}while(e>>>0>>0)}if(u|0)sx(l+(0-u<<2)|0,t|0,i|0)|0;return}function Li(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0;l=t+4|0;s=o[l>>2]|0;i=o[e>>2]|0;a=n;u=a-i|0;r=s+(0-(u>>2)<<2)|0;o[l>>2]=r;if((u|0)>0)ix(r|0,i|0,u|0)|0;i=e+4|0;u=t+8|0;r=(o[i>>2]|0)-a|0;if((r|0)>0){ix(o[u>>2]|0,n|0,r|0)|0;o[u>>2]=(o[u>>2]|0)+(r>>>2<<2)}a=o[e>>2]|0;o[e>>2]=o[l>>2];o[l>>2]=a;a=o[i>>2]|0;o[i>>2]=o[u>>2];o[u>>2]=a;a=e+8|0;n=t+12|0;e=o[a>>2]|0;o[a>>2]=o[n>>2];o[n>>2]=e;o[t>>2]=o[l>>2];return s|0}function Bi(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;a=o[t>>2]|0;u=o[n>>2]|0;if((a|0)!=(u|0)){i=e+8|0;n=((u+-4-a|0)>>>2)+1|0;e=a;r=o[i>>2]|0;do{o[r>>2]=o[e>>2];r=(o[i>>2]|0)+4|0;o[i>>2]=r;e=e+4|0}while((e|0)!=(u|0));o[t>>2]=a+(n<<2)}return}function Ui(){yt();return}function ji(){var e=0;e=qT(4)|0;zi(e);return e|0}function zi(e){e=e|0;o[e>>2]=Lt()|0;return}function Wi(e){e=e|0;if(e|0){Hi(e);XT(e)}return}function Hi(e){e=e|0;Ut(o[e>>2]|0);return}function Vi(e,t,n){e=e|0;t=t|0;n=n|0;Ur(o[e>>2]|0,t,n);return}function $i(e,t){e=e|0;t=Y(t);Ar(o[e>>2]|0,t);return}function Gi(e,t){e=e|0;t=t|0;return xi(o[e>>2]|0,t)|0}function qi(){var e=0;e=qT(8)|0;Yi(e,0);return e|0}function Yi(e,t){e=e|0;t=t|0;if(!t)t=kt()|0;else t=Dt(o[t>>2]|0)|0;o[e>>2]=t;o[e+4>>2]=0;Qt(t,e);return}function Xi(e){e=e|0;var t=0;t=qT(8)|0;Yi(t,e);return t|0}function Ki(e){e=e|0;if(e|0){Ji(e);XT(e)}return}function Ji(e){e=e|0;var t=0;xt(o[e>>2]|0);t=e+4|0;e=o[t>>2]|0;o[t>>2]=0;if(e|0){Qi(e);XT(e)}return}function Qi(e){e=e|0;Zi(e);return}function Zi(e){e=e|0;e=o[e>>2]|0;if(e|0)rt(e|0);return}function eo(e){e=e|0;return Zt(e)|0}function to(e){e=e|0;var t=0,n=0;n=e+4|0;t=o[n>>2]|0;o[n>>2]=0;if(t|0){Qi(t);XT(t)}Nt(o[e>>2]|0);return}function no(e,t){e=e|0;t=t|0;Xt(o[e>>2]|0,o[t>>2]|0);return}function ro(e,t){e=e|0;t=t|0;fn(o[e>>2]|0,t);return}function io(e,t,n){e=e|0;t=t|0;n=+n;kn(o[e>>2]|0,t,Y(n));return}function oo(e,t,n){e=e|0;t=t|0;n=+n;Sn(o[e>>2]|0,t,Y(n));return}function uo(e,t){e=e|0;t=t|0;on(o[e>>2]|0,t);return}function ao(e,t){e=e|0;t=t|0;an(o[e>>2]|0,t);return}function lo(e,t){e=e|0;t=t|0;sn(o[e>>2]|0,t);return}function so(e,t){e=e|0;t=t|0;en(o[e>>2]|0,t);return}function co(e,t){e=e|0;t=t|0;pn(o[e>>2]|0,t);return}function fo(e,t){e=e|0;t=t|0;nn(o[e>>2]|0,t);return}function po(e,t,n){e=e|0;t=t|0;n=+n;xn(o[e>>2]|0,t,Y(n));return}function ho(e,t,n){e=e|0;t=t|0;n=+n;An(o[e>>2]|0,t,Y(n));return}function vo(e,t){e=e|0;t=t|0;Mn(o[e>>2]|0,t);return}function mo(e,t){e=e|0;t=t|0;vn(o[e>>2]|0,t);return}function go(e,t){e=e|0;t=t|0;gn(o[e>>2]|0,t);return}function _o(e,t){e=e|0;t=+t;yn(o[e>>2]|0,Y(t));return}function yo(e,t){e=e|0;t=+t;En(o[e>>2]|0,Y(t));return}function bo(e,t){e=e|0;t=+t;Dn(o[e>>2]|0,Y(t));return}function wo(e,t){e=e|0;t=+t;bn(o[e>>2]|0,Y(t));return}function Eo(e,t){e=e|0;t=+t;wn(o[e>>2]|0,Y(t));return}function Do(e,t){e=e|0;t=+t;Ln(o[e>>2]|0,Y(t));return}function Co(e,t){e=e|0;t=+t;Bn(o[e>>2]|0,Y(t));return}function ko(e){e=e|0;Un(o[e>>2]|0);return}function So(e,t){e=e|0;t=+t;zn(o[e>>2]|0,Y(t));return}function To(e,t){e=e|0;t=+t;Wn(o[e>>2]|0,Y(t));return}function xo(e){e=e|0;Hn(o[e>>2]|0);return}function Ao(e,t){e=e|0;t=+t;$n(o[e>>2]|0,Y(t));return}function Oo(e,t){e=e|0;t=+t;Gn(o[e>>2]|0,Y(t));return}function Mo(e,t){e=e|0;t=+t;Yn(o[e>>2]|0,Y(t));return}function Io(e,t){e=e|0;t=+t;Xn(o[e>>2]|0,Y(t));return}function Ro(e,t){e=e|0;t=+t;Jn(o[e>>2]|0,Y(t));return}function No(e,t){e=e|0;t=+t;Qn(o[e>>2]|0,Y(t));return}function Po(e,t){e=e|0;t=+t;er(o[e>>2]|0,Y(t));return}function Fo(e,t){e=e|0;t=+t;tr(o[e>>2]|0,Y(t));return}function Lo(e,t){e=e|0;t=+t;rr(o[e>>2]|0,Y(t));return}function Bo(e,t,n){e=e|0;t=t|0;n=+n;Pn(o[e>>2]|0,t,Y(n));return}function Uo(e,t,n){e=e|0;t=t|0;n=+n;In(o[e>>2]|0,t,Y(n));return}function jo(e,t,n){e=e|0;t=t|0;n=+n;Rn(o[e>>2]|0,t,Y(n));return}function zo(e){e=e|0;return dn(o[e>>2]|0)|0}function Wo(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0;r=h;h=h+16|0;i=r;Tn(i,o[t>>2]|0,n);Ho(e,i);h=r;return}function Ho(e,t){e=e|0;t=t|0;Vo(e,o[t+4>>2]|0,+Y(s[t>>2]));return}function Vo(e,t,n){e=e|0;t=t|0;n=+n;o[e>>2]=t;c[e+8>>3]=n;return}function $o(e){e=e|0;return un(o[e>>2]|0)|0}function Go(e){e=e|0;return ln(o[e>>2]|0)|0}function qo(e){e=e|0;return cn(o[e>>2]|0)|0}function Yo(e){e=e|0;return tn(o[e>>2]|0)|0}function Xo(e){e=e|0;return hn(o[e>>2]|0)|0}function Ko(e){e=e|0;return rn(o[e>>2]|0)|0}function Jo(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0;r=h;h=h+16|0;i=r;On(i,o[t>>2]|0,n);Ho(e,i);h=r;return}function Qo(e){e=e|0;return mn(o[e>>2]|0)|0}function Zo(e){e=e|0;return _n(o[e>>2]|0)|0}function eu(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;Cn(r,o[t>>2]|0);Ho(e,r);h=n;return}function tu(e){e=e|0;return+ +Y(Kt(o[e>>2]|0))}function nu(e){e=e|0;return+ +Y(Jt(o[e>>2]|0))}function ru(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;jn(r,o[t>>2]|0);Ho(e,r);h=n;return}function iu(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;Vn(r,o[t>>2]|0);Ho(e,r);h=n;return}function ou(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;qn(r,o[t>>2]|0);Ho(e,r);h=n;return}function uu(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;Kn(r,o[t>>2]|0);Ho(e,r);h=n;return}function au(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;Zn(r,o[t>>2]|0);Ho(e,r);h=n;return}function lu(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;nr(r,o[t>>2]|0);Ho(e,r);h=n;return}function su(e){e=e|0;return+ +Y(ir(o[e>>2]|0))}function cu(e,t){e=e|0;t=t|0;return+ +Y(Fn(o[e>>2]|0,t))}function fu(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0;r=h;h=h+16|0;i=r;Nn(i,o[t>>2]|0,n);Ho(e,i);h=r;return}function du(e,t,n){e=e|0;t=t|0;n=n|0;zt(o[e>>2]|0,o[t>>2]|0,n);return}function pu(e,t){e=e|0;t=t|0;Rt(o[e>>2]|0,o[t>>2]|0);return}function hu(e){e=e|0;return Ot(o[e>>2]|0)|0}function vu(e){e=e|0;e=Gt(o[e>>2]|0)|0;if(!e)e=0;else e=eo(e)|0;return e|0}function mu(e,t){e=e|0;t=t|0;e=Mt(o[e>>2]|0,t)|0;if(!e)e=0;else e=eo(e)|0;return e|0}function gu(e,t){e=e|0;t=t|0;var n=0,r=0;r=qT(4)|0;_u(r,t);n=e+4|0;t=o[n>>2]|0;o[n>>2]=r;if(t|0){Qi(t);XT(t)}jt(o[e>>2]|0,1);return}function _u(e,t){e=e|0;t=t|0;Bu(e,t);return}function yu(e,t,n,r,i,o){e=e|0;t=t|0;n=Y(n);r=r|0;i=Y(i);o=o|0;var u=0,a=0;u=h;h=h+16|0;a=u;bu(a,Zt(t)|0,+n,r,+i,o);s[e>>2]=Y(+c[a>>3]);s[e+4>>2]=Y(+c[a+8>>3]);h=u;return}function bu(e,t,n,r,i,u){e=e|0;t=t|0;n=+n;r=r|0;i=+i;u=u|0;var a=0,l=0,s=0,f=0,d=0;a=h;h=h+32|0;d=a+8|0;f=a+20|0;s=a;l=a+16|0;c[d>>3]=n;o[f>>2]=r;c[s>>3]=i;o[l>>2]=u;wu(e,o[t+4>>2]|0,d,f,s,l);h=a;return}function wu(e,t,n,r,i,u){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;u=u|0;var a=0,l=0;a=h;h=h+16|0;l=a;DS(l);t=Eu(t)|0;Du(e,t,+c[n>>3],o[r>>2]|0,+c[i>>3],o[u>>2]|0);kS(l);h=a;return}function Eu(e){e=e|0;return o[e>>2]|0}function Du(e,t,n,r,i,o){e=e|0;t=t|0;n=+n;r=r|0;i=+i;o=o|0;var u=0;u=ku(Cu()|0)|0;n=+Su(n);r=Tu(r)|0;i=+Su(i);xu(e,ot(0,u|0,t|0,+n,r|0,+i,Tu(o)|0)|0);return}function Cu(){var e=0;if(!(r[7608]|0)){Pu(9120);e=7608;o[e>>2]=1;o[e+4>>2]=0}return 9120}function ku(e){e=e|0;return o[e+8>>2]|0}function Su(e){e=+e;return+ +Nu(e)}function Tu(e){e=e|0;return Ru(e)|0}function xu(e,t){e=e|0;t=t|0;var n=0,r=0,i=0;i=h;h=h+32|0;n=i;r=t;if(!(r&1)){o[e>>2]=o[t>>2];o[e+4>>2]=o[t+4>>2];o[e+8>>2]=o[t+8>>2];o[e+12>>2]=o[t+12>>2]}else{Au(n,0);Be(r|0,n|0)|0;Ou(e,n);Mu(n)}h=i;return}function Au(e,t){e=e|0;t=t|0;Iu(e,t);o[e+8>>2]=0;r[e+24>>0]=0;return}function Ou(e,t){e=e|0;t=t|0;t=t+8|0;o[e>>2]=o[t>>2];o[e+4>>2]=o[t+4>>2];o[e+8>>2]=o[t+8>>2];o[e+12>>2]=o[t+12>>2];return}function Mu(e){e=e|0;r[e+24>>0]=0;return}function Iu(e,t){e=e|0;t=t|0;o[e>>2]=t;return}function Ru(e){e=e|0;return e|0}function Nu(e){e=+e;return+e}function Pu(e){e=e|0;Lu(e,Fu()|0,4);return}function Fu(){return 1064}function Lu(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;o[e+4>>2]=n;o[e+8>>2]=tt(t|0,n+1|0)|0;return}function Bu(e,t){e=e|0;t=t|0;t=o[t>>2]|0;o[e>>2]=t;Ae(t|0);return}function Uu(e){e=e|0;var t=0,n=0;n=e+4|0;t=o[n>>2]|0;o[n>>2]=0;if(t|0){Qi(t);XT(t)}jt(o[e>>2]|0,0);return}function ju(e){e=e|0;qt(o[e>>2]|0);return}function zu(e){e=e|0;return Yt(o[e>>2]|0)|0}function Wu(e,t,n,r){e=e|0;t=+t;n=+n;r=r|0;Or(o[e>>2]|0,Y(t),Y(n),r);return}function Hu(e){e=e|0;return+ +Y(or(o[e>>2]|0))}function Vu(e){e=e|0;return+ +Y(ar(o[e>>2]|0))}function $u(e){e=e|0;return+ +Y(ur(o[e>>2]|0))}function Gu(e){e=e|0;return+ +Y(lr(o[e>>2]|0))}function qu(e){e=e|0;return+ +Y(sr(o[e>>2]|0))}function Yu(e){e=e|0;return+ +Y(cr(o[e>>2]|0))}function Xu(e,t){e=e|0;t=t|0;c[e>>3]=+Y(or(o[t>>2]|0));c[e+8>>3]=+Y(ar(o[t>>2]|0));c[e+16>>3]=+Y(ur(o[t>>2]|0));c[e+24>>3]=+Y(lr(o[t>>2]|0));c[e+32>>3]=+Y(sr(o[t>>2]|0));c[e+40>>3]=+Y(cr(o[t>>2]|0));return}function Ku(e,t){e=e|0;t=t|0;return+ +Y(fr(o[e>>2]|0,t))}function Ju(e,t){e=e|0;t=t|0;return+ +Y(dr(o[e>>2]|0,t))}function Qu(e,t){e=e|0;t=t|0;return+ +Y(pr(o[e>>2]|0,t))}function Zu(){return Ft()|0}function ea(){ta();na();ra();ia();oa();ua();return}function ta(){zb(11713,4938,1);return}function na(){tb(10448);return}function ra(){Py(10408);return}function ia(){Q_(10324);return}function oa(){$m(10096);return}function ua(){aa(9132);return}function aa(e){e=e|0;var t=0,n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,v=0,m=0,g=0,_=0,y=0,b=0,w=0,E=0,D=0,C=0,k=0,S=0,T=0,x=0,A=0,O=0,M=0,I=0,R=0,N=0,P=0,F=0,L=0,B=0,U=0,j=0,z=0,W=0,H=0,V=0,$=0,G=0,q=0,Y=0,X=0,K=0,J=0,Q=0,Z=0,ee=0,te=0,ne=0,re=0,ie=0,oe=0,ue=0,ae=0,le=0,se=0,ce=0,fe=0,de=0,pe=0,he=0,ve=0,me=0,ge=0,_e=0,ye=0,be=0,we=0,Ee=0,De=0,Ce=0,ke=0,Se=0,Te=0,xe=0,Ae=0,Oe=0,Me=0,Ie=0;t=h;h=h+672|0;n=t+656|0;Ie=t+648|0;Me=t+640|0;Oe=t+632|0;Ae=t+624|0;xe=t+616|0;Te=t+608|0;Se=t+600|0;ke=t+592|0;Ce=t+584|0;De=t+576|0;Ee=t+568|0;we=t+560|0;be=t+552|0;ye=t+544|0;_e=t+536|0;ge=t+528|0;me=t+520|0;ve=t+512|0;he=t+504|0;pe=t+496|0;de=t+488|0;fe=t+480|0;ce=t+472|0;se=t+464|0;le=t+456|0;ae=t+448|0;ue=t+440|0;oe=t+432|0;ie=t+424|0;re=t+416|0;ne=t+408|0;te=t+400|0;ee=t+392|0;Z=t+384|0;Q=t+376|0;J=t+368|0;K=t+360|0;X=t+352|0;Y=t+344|0;q=t+336|0;G=t+328|0;$=t+320|0;V=t+312|0;H=t+304|0;W=t+296|0;z=t+288|0;j=t+280|0;U=t+272|0;B=t+264|0;L=t+256|0;F=t+248|0;P=t+240|0;N=t+232|0;R=t+224|0;I=t+216|0;M=t+208|0;O=t+200|0;A=t+192|0;x=t+184|0;T=t+176|0;S=t+168|0;k=t+160|0;C=t+152|0;D=t+144|0;E=t+136|0;w=t+128|0;b=t+120|0;y=t+112|0;_=t+104|0;g=t+96|0;m=t+88|0;v=t+80|0;p=t+72|0;d=t+64|0;f=t+56|0;c=t+48|0;s=t+40|0;l=t+32|0;a=t+24|0;u=t+16|0;i=t+8|0;r=t;la(e,3646);sa(e,3651,2)|0;ca(e,3665,2)|0;fa(e,3682,18)|0;o[Ie>>2]=19;o[Ie+4>>2]=0;o[n>>2]=o[Ie>>2];o[n+4>>2]=o[Ie+4>>2];da(e,3690,n)|0;o[Me>>2]=1;o[Me+4>>2]=0;o[n>>2]=o[Me>>2];o[n+4>>2]=o[Me+4>>2];pa(e,3696,n)|0;o[Oe>>2]=2;o[Oe+4>>2]=0;o[n>>2]=o[Oe>>2];o[n+4>>2]=o[Oe+4>>2];ha(e,3706,n)|0;o[Ae>>2]=1;o[Ae+4>>2]=0;o[n>>2]=o[Ae>>2];o[n+4>>2]=o[Ae+4>>2];va(e,3722,n)|0;o[xe>>2]=2;o[xe+4>>2]=0;o[n>>2]=o[xe>>2];o[n+4>>2]=o[xe+4>>2];va(e,3734,n)|0;o[Te>>2]=3;o[Te+4>>2]=0;o[n>>2]=o[Te>>2];o[n+4>>2]=o[Te+4>>2];ha(e,3753,n)|0;o[Se>>2]=4;o[Se+4>>2]=0;o[n>>2]=o[Se>>2];o[n+4>>2]=o[Se+4>>2];ha(e,3769,n)|0;o[ke>>2]=5;o[ke+4>>2]=0;o[n>>2]=o[ke>>2];o[n+4>>2]=o[ke+4>>2];ha(e,3783,n)|0;o[Ce>>2]=6;o[Ce+4>>2]=0;o[n>>2]=o[Ce>>2];o[n+4>>2]=o[Ce+4>>2];ha(e,3796,n)|0;o[De>>2]=7;o[De+4>>2]=0;o[n>>2]=o[De>>2];o[n+4>>2]=o[De+4>>2];ha(e,3813,n)|0;o[Ee>>2]=8;o[Ee+4>>2]=0;o[n>>2]=o[Ee>>2];o[n+4>>2]=o[Ee+4>>2];ha(e,3825,n)|0;o[we>>2]=3;o[we+4>>2]=0;o[n>>2]=o[we>>2];o[n+4>>2]=o[we+4>>2];va(e,3843,n)|0;o[be>>2]=4;o[be+4>>2]=0;o[n>>2]=o[be>>2];o[n+4>>2]=o[be+4>>2];va(e,3853,n)|0;o[ye>>2]=9;o[ye+4>>2]=0;o[n>>2]=o[ye>>2];o[n+4>>2]=o[ye+4>>2];ha(e,3870,n)|0;o[_e>>2]=10;o[_e+4>>2]=0;o[n>>2]=o[_e>>2];o[n+4>>2]=o[_e+4>>2];ha(e,3884,n)|0;o[ge>>2]=11;o[ge+4>>2]=0;o[n>>2]=o[ge>>2];o[n+4>>2]=o[ge+4>>2];ha(e,3896,n)|0;o[me>>2]=1;o[me+4>>2]=0;o[n>>2]=o[me>>2];o[n+4>>2]=o[me+4>>2];ma(e,3907,n)|0;o[ve>>2]=2;o[ve+4>>2]=0;o[n>>2]=o[ve>>2];o[n+4>>2]=o[ve+4>>2];ma(e,3915,n)|0;o[he>>2]=3;o[he+4>>2]=0;o[n>>2]=o[he>>2];o[n+4>>2]=o[he+4>>2];ma(e,3928,n)|0;o[pe>>2]=4;o[pe+4>>2]=0;o[n>>2]=o[pe>>2];o[n+4>>2]=o[pe+4>>2];ma(e,3948,n)|0;o[de>>2]=5;o[de+4>>2]=0;o[n>>2]=o[de>>2];o[n+4>>2]=o[de+4>>2];ma(e,3960,n)|0;o[fe>>2]=6;o[fe+4>>2]=0;o[n>>2]=o[fe>>2];o[n+4>>2]=o[fe+4>>2];ma(e,3974,n)|0;o[ce>>2]=7;o[ce+4>>2]=0;o[n>>2]=o[ce>>2];o[n+4>>2]=o[ce+4>>2];ma(e,3983,n)|0;o[se>>2]=20;o[se+4>>2]=0;o[n>>2]=o[se>>2];o[n+4>>2]=o[se+4>>2];da(e,3999,n)|0;o[le>>2]=8;o[le+4>>2]=0;o[n>>2]=o[le>>2];o[n+4>>2]=o[le+4>>2];ma(e,4012,n)|0;o[ae>>2]=9;o[ae+4>>2]=0;o[n>>2]=o[ae>>2];o[n+4>>2]=o[ae+4>>2];ma(e,4022,n)|0;o[ue>>2]=21;o[ue+4>>2]=0;o[n>>2]=o[ue>>2];o[n+4>>2]=o[ue+4>>2];da(e,4039,n)|0;o[oe>>2]=10;o[oe+4>>2]=0;o[n>>2]=o[oe>>2];o[n+4>>2]=o[oe+4>>2];ma(e,4053,n)|0;o[ie>>2]=11;o[ie+4>>2]=0;o[n>>2]=o[ie>>2];o[n+4>>2]=o[ie+4>>2];ma(e,4065,n)|0;o[re>>2]=12;o[re+4>>2]=0;o[n>>2]=o[re>>2];o[n+4>>2]=o[re+4>>2];ma(e,4084,n)|0;o[ne>>2]=13;o[ne+4>>2]=0;o[n>>2]=o[ne>>2];o[n+4>>2]=o[ne+4>>2];ma(e,4097,n)|0;o[te>>2]=14;o[te+4>>2]=0;o[n>>2]=o[te>>2];o[n+4>>2]=o[te+4>>2];ma(e,4117,n)|0;o[ee>>2]=15;o[ee+4>>2]=0;o[n>>2]=o[ee>>2];o[n+4>>2]=o[ee+4>>2];ma(e,4129,n)|0;o[Z>>2]=16;o[Z+4>>2]=0;o[n>>2]=o[Z>>2];o[n+4>>2]=o[Z+4>>2];ma(e,4148,n)|0;o[Q>>2]=17;o[Q+4>>2]=0;o[n>>2]=o[Q>>2];o[n+4>>2]=o[Q+4>>2];ma(e,4161,n)|0;o[J>>2]=18;o[J+4>>2]=0;o[n>>2]=o[J>>2];o[n+4>>2]=o[J+4>>2];ma(e,4181,n)|0;o[K>>2]=5;o[K+4>>2]=0;o[n>>2]=o[K>>2];o[n+4>>2]=o[K+4>>2];va(e,4196,n)|0;o[X>>2]=6;o[X+4>>2]=0;o[n>>2]=o[X>>2];o[n+4>>2]=o[X+4>>2];va(e,4206,n)|0;o[Y>>2]=7;o[Y+4>>2]=0;o[n>>2]=o[Y>>2];o[n+4>>2]=o[Y+4>>2];va(e,4217,n)|0;o[q>>2]=3;o[q+4>>2]=0;o[n>>2]=o[q>>2];o[n+4>>2]=o[q+4>>2];ga(e,4235,n)|0;o[G>>2]=1;o[G+4>>2]=0;o[n>>2]=o[G>>2];o[n+4>>2]=o[G+4>>2];_a(e,4251,n)|0;o[$>>2]=4;o[$+4>>2]=0;o[n>>2]=o[$>>2];o[n+4>>2]=o[$+4>>2];ga(e,4263,n)|0;o[V>>2]=5;o[V+4>>2]=0;o[n>>2]=o[V>>2];o[n+4>>2]=o[V+4>>2];ga(e,4279,n)|0;o[H>>2]=6;o[H+4>>2]=0;o[n>>2]=o[H>>2];o[n+4>>2]=o[H+4>>2];ga(e,4293,n)|0;o[W>>2]=7;o[W+4>>2]=0;o[n>>2]=o[W>>2];o[n+4>>2]=o[W+4>>2];ga(e,4306,n)|0;o[z>>2]=8;o[z+4>>2]=0;o[n>>2]=o[z>>2];o[n+4>>2]=o[z+4>>2];ga(e,4323,n)|0;o[j>>2]=9;o[j+4>>2]=0;o[n>>2]=o[j>>2];o[n+4>>2]=o[j+4>>2];ga(e,4335,n)|0;o[U>>2]=2;o[U+4>>2]=0;o[n>>2]=o[U>>2];o[n+4>>2]=o[U+4>>2];_a(e,4353,n)|0;o[B>>2]=12;o[B+4>>2]=0;o[n>>2]=o[B>>2];o[n+4>>2]=o[B+4>>2];ya(e,4363,n)|0;o[L>>2]=1;o[L+4>>2]=0;o[n>>2]=o[L>>2];o[n+4>>2]=o[L+4>>2];ba(e,4376,n)|0;o[F>>2]=2;o[F+4>>2]=0;o[n>>2]=o[F>>2];o[n+4>>2]=o[F+4>>2];ba(e,4388,n)|0;o[P>>2]=13;o[P+4>>2]=0;o[n>>2]=o[P>>2];o[n+4>>2]=o[P+4>>2];ya(e,4402,n)|0;o[N>>2]=14;o[N+4>>2]=0;o[n>>2]=o[N>>2];o[n+4>>2]=o[N+4>>2];ya(e,4411,n)|0;o[R>>2]=15;o[R+4>>2]=0;o[n>>2]=o[R>>2];o[n+4>>2]=o[R+4>>2];ya(e,4421,n)|0;o[I>>2]=16;o[I+4>>2]=0;o[n>>2]=o[I>>2];o[n+4>>2]=o[I+4>>2];ya(e,4433,n)|0;o[M>>2]=17;o[M+4>>2]=0;o[n>>2]=o[M>>2];o[n+4>>2]=o[M+4>>2];ya(e,4446,n)|0;o[O>>2]=18;o[O+4>>2]=0;o[n>>2]=o[O>>2];o[n+4>>2]=o[O+4>>2];ya(e,4458,n)|0;o[A>>2]=3;o[A+4>>2]=0;o[n>>2]=o[A>>2];o[n+4>>2]=o[A+4>>2];ba(e,4471,n)|0;o[x>>2]=1;o[x+4>>2]=0;o[n>>2]=o[x>>2];o[n+4>>2]=o[x+4>>2];wa(e,4486,n)|0;o[T>>2]=10;o[T+4>>2]=0;o[n>>2]=o[T>>2];o[n+4>>2]=o[T+4>>2];ga(e,4496,n)|0;o[S>>2]=11;o[S+4>>2]=0;o[n>>2]=o[S>>2];o[n+4>>2]=o[S+4>>2];ga(e,4508,n)|0;o[k>>2]=3;o[k+4>>2]=0;o[n>>2]=o[k>>2];o[n+4>>2]=o[k+4>>2];_a(e,4519,n)|0;o[C>>2]=4;o[C+4>>2]=0;o[n>>2]=o[C>>2];o[n+4>>2]=o[C+4>>2];Ea(e,4530,n)|0;o[D>>2]=19;o[D+4>>2]=0;o[n>>2]=o[D>>2];o[n+4>>2]=o[D+4>>2];Da(e,4542,n)|0;o[E>>2]=12;o[E+4>>2]=0;o[n>>2]=o[E>>2];o[n+4>>2]=o[E+4>>2];Ca(e,4554,n)|0;o[w>>2]=13;o[w+4>>2]=0;o[n>>2]=o[w>>2];o[n+4>>2]=o[w+4>>2];ka(e,4568,n)|0;o[b>>2]=2;o[b+4>>2]=0;o[n>>2]=o[b>>2];o[n+4>>2]=o[b+4>>2];Sa(e,4578,n)|0;o[y>>2]=20;o[y+4>>2]=0;o[n>>2]=o[y>>2];o[n+4>>2]=o[y+4>>2];Ta(e,4587,n)|0;o[_>>2]=22;o[_+4>>2]=0;o[n>>2]=o[_>>2];o[n+4>>2]=o[_+4>>2];da(e,4602,n)|0;o[g>>2]=23;o[g+4>>2]=0;o[n>>2]=o[g>>2];o[n+4>>2]=o[g+4>>2];da(e,4619,n)|0;o[m>>2]=14;o[m+4>>2]=0;o[n>>2]=o[m>>2];o[n+4>>2]=o[m+4>>2];xa(e,4629,n)|0;o[v>>2]=1;o[v+4>>2]=0;o[n>>2]=o[v>>2];o[n+4>>2]=o[v+4>>2];Aa(e,4637,n)|0;o[p>>2]=4;o[p+4>>2]=0;o[n>>2]=o[p>>2];o[n+4>>2]=o[p+4>>2];ba(e,4653,n)|0;o[d>>2]=5;o[d+4>>2]=0;o[n>>2]=o[d>>2];o[n+4>>2]=o[d+4>>2];ba(e,4669,n)|0;o[f>>2]=6;o[f+4>>2]=0;o[n>>2]=o[f>>2];o[n+4>>2]=o[f+4>>2];ba(e,4686,n)|0;o[c>>2]=7;o[c+4>>2]=0;o[n>>2]=o[c>>2];o[n+4>>2]=o[c+4>>2];ba(e,4701,n)|0;o[s>>2]=8;o[s+4>>2]=0;o[n>>2]=o[s>>2];o[n+4>>2]=o[s+4>>2];ba(e,4719,n)|0;o[l>>2]=9;o[l+4>>2]=0;o[n>>2]=o[l>>2];o[n+4>>2]=o[l+4>>2];ba(e,4736,n)|0;o[a>>2]=21;o[a+4>>2]=0;o[n>>2]=o[a>>2];o[n+4>>2]=o[a+4>>2];Oa(e,4754,n)|0;o[u>>2]=2;o[u+4>>2]=0;o[n>>2]=o[u>>2];o[n+4>>2]=o[u+4>>2];wa(e,4772,n)|0;o[i>>2]=3;o[i+4>>2]=0;o[n>>2]=o[i>>2];o[n+4>>2]=o[i+4>>2];wa(e,4790,n)|0;o[r>>2]=4;o[r+4>>2]=0;o[n>>2]=o[r>>2];o[n+4>>2]=o[r+4>>2];wa(e,4808,n)|0;h=t;return}function la(e,t){e=e|0;t=t|0;var n=0;n=Nm()|0;o[e>>2]=n;Pm(n,t);cw(o[e>>2]|0);return}function sa(e,t,n){e=e|0;t=t|0;n=n|0;gm(e,Ia(t)|0,n,0);return e|0}function ca(e,t,n){e=e|0;t=t|0;n=n|0;Kv(e,Ia(t)|0,n,0);return e|0}function fa(e,t,n){e=e|0;t=t|0;n=n|0;Rv(e,Ia(t)|0,n,0);return e|0}function da(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];hv(e,t,i);h=r;return e|0}function pa(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Gh(e,t,i);h=r;return e|0}function ha(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Th(e,t,i);h=r;return e|0}function va(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];lh(e,t,i);h=r;return e|0}function ma(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Hp(e,t,i);h=r;return e|0}function ga(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Cp(e,t,i);h=r;return e|0}function _a(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];op(e,t,i);h=r;return e|0}function ya(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];kd(e,t,i);h=r;return e|0}function ba(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];ud(e,t,i);h=r;return e|0}function wa(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];zf(e,t,i);h=r;return e|0}function Ea(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Ef(e,t,i);h=r;return e|0}function Da(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Zc(e,t,i);h=r;return e|0}function Ca(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Rc(e,t,i);h=r;return e|0}function ka(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];hc(e,t,i);h=r;return e|0}function Sa(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];$s(e,t,i);h=r;return e|0}function Ta(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];ws(e,t,i);h=r;return e|0}function xa(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];ts(e,t,i);h=r;return e|0}function Aa(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Ol(e,t,i);h=r;return e|0}function Oa(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Ma(e,t,i);h=r;return e|0}function Ma(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Ra(e,n,i,1);h=r;return}function Ia(e){e=e|0;return e|0}function Ra(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=Na()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=Pa(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,Fa(u,r)|0,r);h=i;return}function Na(){var e=0,t=0;if(!(r[7616]|0)){Ya(9136);Fe(24,9136,g|0)|0;t=7616;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(9136)|0)){e=9136;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Ya(9136)}return 9136}function Pa(e){e=e|0;return 0}function Fa(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=Na()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];Wa(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{Ha(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function La(e,t,n,r,i,u){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;u=u|0;var a=0,l=0,s=0,c=0,f=0,d=0,p=0,v=0;a=h;h=h+32|0;p=a+24|0;d=a+20|0;s=a+16|0;f=a+12|0;c=a+8|0;l=a+4|0;v=a;o[d>>2]=t;o[s>>2]=n;o[f>>2]=r;o[c>>2]=i;o[l>>2]=u;u=e+28|0;o[v>>2]=o[u>>2];o[p>>2]=o[v>>2];Ba(e+24|0,p,d,f,c,s,l)|0;o[u>>2]=o[o[u>>2]>>2];h=a;return}function Ba(e,t,n,r,i,u,a){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;u=u|0;a=a|0;e=Ua(t)|0;t=qT(24)|0;ja(t+4|0,o[n>>2]|0,o[r>>2]|0,o[i>>2]|0,o[u>>2]|0,o[a>>2]|0);o[t>>2]=o[e>>2];o[e>>2]=t;return t|0}function Ua(e){e=e|0;return o[e>>2]|0}function ja(e,t,n,r,i,u){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;u=u|0;o[e>>2]=t;o[e+4>>2]=n;o[e+8>>2]=r;o[e+12>>2]=i;o[e+16>>2]=u;return}function za(e,t){e=e|0;t=t|0;return t|e|0}function Wa(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function Ha(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=Va(e)|0;if(u>>>0>>0)jT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;$a(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];Wa(u,r,n);o[s>>2]=(o[s>>2]|0)+12;Ga(e,l);qa(l);h=c;return}}function Va(e){e=e|0;return 357913941}function $a(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=qT(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function Ga(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function qa(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)XT(e);return}function Ya(e){e=e|0;Qa(e);return}function Xa(e){e=e|0;Ja(e+24|0);return}function Ka(e){e=e|0;return o[e>>2]|0}function Ja(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);XT(n)}return}function Qa(e){e=e|0;var t=0;t=Za()|0;nl(e,2,3,t,el()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Za(){return 9228}function el(){return 1140}function tl(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0;n=h;h=h+16|0;r=n+8|0;i=n;u=rl(e)|0;e=o[u+4>>2]|0;o[i>>2]=o[u>>2];o[i+4>>2]=e;o[r>>2]=o[i>>2];o[r+4>>2]=o[i+4>>2];t=il(t,r)|0;h=n;return t|0}function nl(e,t,n,r,i,u){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;u=u|0;o[e>>2]=t;o[e+4>>2]=n;o[e+8>>2]=r;o[e+12>>2]=i;o[e+16>>2]=u;return}function rl(e){e=e|0;return(o[(Na()|0)+24>>2]|0)+(e*12|0)|0}function il(e,t){e=e|0;t=t|0;var n=0,r=0,i=0;i=h;h=h+48|0;r=i;n=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)n=o[(o[e>>2]|0)+n>>2]|0;vA[n&31](r,e);r=ol(r)|0;h=i;return r|0}function ol(e){e=e|0;var t=0,n=0,r=0,i=0;i=h;h=h+32|0;t=i+12|0;n=i;r=al(ul()|0)|0;if(!r)e=dl(e)|0;else{ll(t,r);sl(n,t);cl(e,n);e=fl(t)|0}h=i;return e|0}function ul(){var e=0;if(!(r[7632]|0)){Dl(9184);Fe(25,9184,g|0)|0;e=7632;o[e>>2]=1;o[e+4>>2]=0}return 9184}function al(e){e=e|0;return o[e+36>>2]|0}function ll(e,t){e=e|0;t=t|0;o[e>>2]=t;o[e+4>>2]=e;o[e+8>>2]=0;return}function sl(e,t){e=e|0;t=t|0;o[e>>2]=o[t>>2];o[e+4>>2]=o[t+4>>2];o[e+8>>2]=0;return}function cl(e,t){e=e|0;t=t|0;gl(t,e,e+8|0,e+16|0,e+24|0,e+32|0,e+40|0)|0;return}function fl(e){e=e|0;return o[(o[e+4>>2]|0)+8>>2]|0}function dl(e){e=e|0;var t=0,n=0,r=0,i=0,u=0,a=0,l=0,s=0;s=h;h=h+16|0;n=s+4|0;r=s;i=jD(8)|0;u=i;a=qT(48)|0;l=a;t=l+48|0;do{o[l>>2]=o[e>>2];l=l+4|0;e=e+4|0}while((l|0)<(t|0));t=u+4|0;o[t>>2]=a;l=qT(8)|0;a=o[t>>2]|0;o[r>>2]=0;o[n>>2]=o[r>>2];pl(l,a,n);o[i>>2]=l;h=s;return u|0}function pl(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;n=qT(16)|0;o[n+4>>2]=0;o[n+8>>2]=0;o[n>>2]=1092;o[n+12>>2]=t;o[e+4>>2]=n;return}function hl(e){e=e|0;zT(e);XT(e);return}function vl(e){e=e|0;e=o[e+12>>2]|0;if(e|0)XT(e);return}function ml(e){e=e|0;XT(e);return}function gl(e,t,n,r,i,u,a){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;u=u|0;a=a|0;u=_l(o[e>>2]|0,t,n,r,i,u,a)|0;a=e+4|0;o[(o[a>>2]|0)+8>>2]=u;return o[(o[a>>2]|0)+8>>2]|0}function _l(e,t,n,r,i,o,u){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;o=o|0;u=u|0;var a=0,l=0;a=h;h=h+16|0;l=a;DS(l);e=Eu(e)|0;u=yl(e,+c[t>>3],+c[n>>3],+c[r>>3],+c[i>>3],+c[o>>3],+c[u>>3])|0;kS(l);h=a;return u|0}function yl(e,t,n,r,i,o,u){e=e|0;t=+t;n=+n;r=+r;i=+i;o=+o;u=+u;var a=0;a=ku(bl()|0)|0;t=+Su(t);n=+Su(n);r=+Su(r);i=+Su(i);o=+Su(o);return Te(0,a|0,e|0,+t,+n,+r,+i,+o,+ +Su(u))|0}function bl(){var e=0;if(!(r[7624]|0)){wl(9172);e=7624;o[e>>2]=1;o[e+4>>2]=0}return 9172}function wl(e){e=e|0;Lu(e,El()|0,6);return}function El(){return 1112}function Dl(e){e=e|0;Al(e);return}function Cl(e){e=e|0;kl(e+24|0);Sl(e+16|0);return}function kl(e){e=e|0;xl(e);return}function Sl(e){e=e|0;Tl(e);return}function Tl(e){e=e|0;var t=0,n=0;t=o[e>>2]|0;if(t|0)do{n=t;t=o[t>>2]|0;XT(n)}while((t|0)!=0);o[e>>2]=0;return}function xl(e){e=e|0;var t=0,n=0;t=o[e>>2]|0;if(t|0)do{n=t;t=o[t>>2]|0;XT(n)}while((t|0)!=0);o[e>>2]=0;return}function Al(e){e=e|0;var t=0;o[e+16>>2]=0;o[e+20>>2]=0;t=e+24|0;o[t>>2]=0;o[e+28>>2]=t;o[e+36>>2]=0;r[e+40>>0]=0;r[e+41>>0]=0;return}function Ol(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Ml(e,n,i,0);h=r;return}function Ml(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=Il()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=Rl(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,Nl(u,r)|0,r);h=i;return}function Il(){var e=0,t=0;if(!(r[7640]|0)){zl(9232);Fe(26,9232,g|0)|0;t=7640;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(9232)|0)){e=9232;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));zl(9232)}return 9232}function Rl(e){e=e|0;return 0}function Nl(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=Il()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];Pl(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{Fl(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function Pl(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function Fl(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=Ll(e)|0;if(u>>>0>>0)jT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;Bl(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];Pl(u,r,n);o[s>>2]=(o[s>>2]|0)+12;Ul(e,l);jl(l);h=c;return}}function Ll(e){e=e|0;return 357913941}function Bl(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=qT(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function Ul(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function jl(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)XT(e);return}function zl(e){e=e|0;Vl(e);return}function Wl(e){e=e|0;Hl(e+24|0);return}function Hl(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);XT(n)}return}function Vl(e){e=e|0;var t=0;t=Za()|0;nl(e,2,1,t,$l()|0,3);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function $l(){return 1144}function Gl(e,t,n,r,i){e=e|0;t=t|0;n=+n;r=+r;i=i|0;var u=0,a=0,l=0,s=0;u=h;h=h+16|0;a=u+8|0;l=u;s=ql(e)|0;e=o[s+4>>2]|0;o[l>>2]=o[s>>2];o[l+4>>2]=e;o[a>>2]=o[l>>2];o[a+4>>2]=o[l+4>>2];Yl(t,a,n,r,i);h=u;return}function ql(e){e=e|0;return(o[(Il()|0)+24>>2]|0)+(e*12|0)|0}function Yl(e,t,n,r,i){e=e|0;t=t|0;n=+n;r=+r;i=i|0;var u=0,a=0,l=0,s=0,c=0;c=h;h=h+16|0;a=c+2|0;l=c+1|0;s=c;u=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)u=o[(o[e>>2]|0)+u>>2]|0;Xl(a,n);n=+Kl(a,n);Xl(l,r);r=+Kl(l,r);Jl(s,i);s=Ql(s,i)|0;gA[u&1](e,n,r,s);h=c;return}function Xl(e,t){e=e|0;t=+t;return}function Kl(e,t){e=e|0;t=+t;return+ +es(t)}function Jl(e,t){e=e|0;t=t|0;return}function Ql(e,t){e=e|0;t=t|0;return Zl(t)|0}function Zl(e){e=e|0;return e|0}function es(e){e=+e;return+e}function ts(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];ns(e,n,i,1);h=r;return}function ns(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=rs()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=is(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,os(u,r)|0,r);h=i;return}function rs(){var e=0,t=0;if(!(r[7648]|0)){ds(9268);Fe(27,9268,g|0)|0;t=7648;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(9268)|0)){e=9268;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));ds(9268)}return 9268}function is(e){e=e|0;return 0}function os(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=rs()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];us(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{as(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function us(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function as(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=ls(e)|0;if(u>>>0>>0)jT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;ss(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];us(u,r,n);o[s>>2]=(o[s>>2]|0)+12;cs(e,l);fs(l);h=c;return}}function ls(e){e=e|0;return 357913941}function ss(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=qT(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function cs(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function fs(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)XT(e);return}function ds(e){e=e|0;vs(e);return}function ps(e){e=e|0;hs(e+24|0);return}function hs(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);XT(n)}return}function vs(e){e=e|0;var t=0;t=Za()|0;nl(e,2,4,t,ms()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function ms(){return 1160}function gs(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0;n=h;h=h+16|0;r=n+8|0;i=n;u=_s(e)|0;e=o[u+4>>2]|0;o[i>>2]=o[u>>2];o[i+4>>2]=e;o[r>>2]=o[i>>2];o[r+4>>2]=o[i+4>>2];t=ys(t,r)|0;h=n;return t|0}function _s(e){e=e|0;return(o[(rs()|0)+24>>2]|0)+(e*12|0)|0}function ys(e,t){e=e|0;t=t|0;var n=0;n=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)n=o[(o[e>>2]|0)+n>>2]|0;return bs(mA[n&31](e)|0)|0}function bs(e){e=e|0;return e&1|0}function ws(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Es(e,n,i,0);h=r;return}function Es(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=Ds()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=Cs(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,ks(u,r)|0,r);h=i;return}function Ds(){var e=0,t=0;if(!(r[7656]|0)){Is(9304);Fe(28,9304,g|0)|0;t=7656;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(9304)|0)){e=9304;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Is(9304)}return 9304}function Cs(e){e=e|0;return 0}function ks(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=Ds()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];Ss(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{Ts(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function Ss(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function Ts(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=xs(e)|0;if(u>>>0>>0)jT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;As(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];Ss(u,r,n);o[s>>2]=(o[s>>2]|0)+12;Os(e,l);Ms(l);h=c;return}}function xs(e){e=e|0;return 357913941}function As(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=qT(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function Os(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Ms(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)XT(e);return}function Is(e){e=e|0;Ps(e);return}function Rs(e){e=e|0;Ns(e+24|0);return}function Ns(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);XT(n)}return}function Ps(e){e=e|0;var t=0;t=Za()|0;nl(e,2,5,t,Fs()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Fs(){return 1164}function Ls(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=Bs(e)|0;e=o[a+4>>2]|0;o[u>>2]=o[a>>2];o[u+4>>2]=e;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Us(t,i,n);h=r;return}function Bs(e){e=e|0;return(o[(Ds()|0)+24>>2]|0)+(e*12|0)|0}function Us(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0;u=h;h=h+16|0;i=u;r=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=o[(o[e>>2]|0)+r>>2]|0;js(i,n);n=zs(i,n)|0;vA[r&31](e,n);Ws(i);h=u;return}function js(e,t){e=e|0;t=t|0;Hs(e,t);return}function zs(e,t){e=e|0;t=t|0;return e|0}function Ws(e){e=e|0;Qi(e);return}function Hs(e,t){e=e|0;t=t|0;Vs(e,t);return}function Vs(e,t){e=e|0;t=t|0;o[e>>2]=t;return}function $s(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Gs(e,n,i,0);h=r;return}function Gs(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=qs()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=Ys(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,Xs(u,r)|0,r);h=i;return}function qs(){var e=0,t=0;if(!(r[7664]|0)){nc(9340);Fe(29,9340,g|0)|0;t=7664;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(9340)|0)){e=9340;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));nc(9340)}return 9340}function Ys(e){e=e|0;return 0}function Xs(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=qs()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];Ks(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{Js(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function Ks(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function Js(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=Qs(e)|0;if(u>>>0>>0)jT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;Zs(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];Ks(u,r,n);o[s>>2]=(o[s>>2]|0)+12;ec(e,l);tc(l);h=c;return}}function Qs(e){e=e|0;return 357913941}function Zs(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=qT(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function ec(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function tc(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)XT(e);return}function nc(e){e=e|0;oc(e);return}function rc(e){e=e|0;ic(e+24|0);return}function ic(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);XT(n)}return}function oc(e){e=e|0;var t=0;t=Za()|0;nl(e,2,4,t,uc()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function uc(){return 1180}function ac(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=lc(e)|0;e=o[a+4>>2]|0;o[u>>2]=o[a>>2];o[u+4>>2]=e;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];n=sc(t,i,n)|0;h=r;return n|0}function lc(e){e=e|0;return(o[(qs()|0)+24>>2]|0)+(e*12|0)|0}function sc(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0;u=h;h=h+16|0;i=u;r=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=o[(o[e>>2]|0)+r>>2]|0;cc(i,n);i=fc(i,n)|0;i=dc(DA[r&15](e,i)|0)|0;h=u;return i|0}function cc(e,t){e=e|0;t=t|0;return}function fc(e,t){e=e|0;t=t|0;return pc(t)|0}function dc(e){e=e|0;return e|0}function pc(e){e=e|0;return e|0}function hc(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];vc(e,n,i,0);h=r;return}function vc(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=mc()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=gc(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,_c(u,r)|0,r);h=i;return}function mc(){var e=0,t=0;if(!(r[7672]|0)){kc(9376);Fe(30,9376,g|0)|0;t=7672;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(9376)|0)){e=9376;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));kc(9376)}return 9376}function gc(e){e=e|0;return 0}function _c(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=mc()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];yc(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{bc(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function yc(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function bc(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=wc(e)|0;if(u>>>0>>0)jT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;Ec(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];yc(u,r,n);o[s>>2]=(o[s>>2]|0)+12;Dc(e,l);Cc(l);h=c;return}}function wc(e){e=e|0;return 357913941}function Ec(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=qT(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function Dc(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Cc(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)XT(e);return}function kc(e){e=e|0;xc(e);return}function Sc(e){e=e|0;Tc(e+24|0);return}function Tc(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);XT(n)}return}function xc(e){e=e|0;var t=0;t=Za()|0;nl(e,2,5,t,Ac()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Ac(){return 1196}function Oc(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0;n=h;h=h+16|0;r=n+8|0;i=n;u=Mc(e)|0;e=o[u+4>>2]|0;o[i>>2]=o[u>>2];o[i+4>>2]=e;o[r>>2]=o[i>>2];o[r+4>>2]=o[i+4>>2];t=Ic(t,r)|0;h=n;return t|0}function Mc(e){e=e|0;return(o[(mc()|0)+24>>2]|0)+(e*12|0)|0}function Ic(e,t){e=e|0;t=t|0;var n=0;n=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)n=o[(o[e>>2]|0)+n>>2]|0;return dc(mA[n&31](e)|0)|0}function Rc(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Nc(e,n,i,1);h=r;return}function Nc(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=Pc()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=Fc(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,Lc(u,r)|0,r);h=i;return}function Pc(){var e=0,t=0;if(!(r[7680]|0)){Vc(9412);Fe(31,9412,g|0)|0;t=7680;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(9412)|0)){e=9412;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Vc(9412)}return 9412}function Fc(e){e=e|0;return 0}function Lc(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=Pc()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];Bc(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{Uc(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function Bc(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function Uc(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=jc(e)|0;if(u>>>0>>0)jT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;zc(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];Bc(u,r,n);o[s>>2]=(o[s>>2]|0)+12;Wc(e,l);Hc(l);h=c;return}}function jc(e){e=e|0;return 357913941}function zc(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=qT(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function Wc(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Hc(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)XT(e);return}function Vc(e){e=e|0;qc(e);return}function $c(e){e=e|0;Gc(e+24|0);return}function Gc(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);XT(n)}return}function qc(e){e=e|0;var t=0;t=Za()|0;nl(e,2,6,t,Yc()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Yc(){return 1200}function Xc(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0;n=h;h=h+16|0;r=n+8|0;i=n;u=Kc(e)|0;e=o[u+4>>2]|0;o[i>>2]=o[u>>2];o[i+4>>2]=e;o[r>>2]=o[i>>2];o[r+4>>2]=o[i+4>>2];t=Jc(t,r)|0;h=n;return t|0}function Kc(e){e=e|0;return(o[(Pc()|0)+24>>2]|0)+(e*12|0)|0}function Jc(e,t){e=e|0;t=t|0;var n=0;n=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)n=o[(o[e>>2]|0)+n>>2]|0;return Qc(mA[n&31](e)|0)|0}function Qc(e){e=e|0;return e|0}function Zc(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];ef(e,n,i,0);h=r;return}function ef(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=tf()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=nf(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,rf(u,r)|0,r);h=i;return}function tf(){var e=0,t=0;if(!(r[7688]|0)){ff(9448);Fe(32,9448,g|0)|0;t=7688;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(9448)|0)){e=9448;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));ff(9448)}return 9448}function nf(e){e=e|0;return 0}function rf(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=tf()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];of(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{uf(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function of(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function uf(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=af(e)|0;if(u>>>0>>0)jT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;lf(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];of(u,r,n);o[s>>2]=(o[s>>2]|0)+12;sf(e,l);cf(l);h=c;return}}function af(e){e=e|0;return 357913941}function lf(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=qT(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function sf(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function cf(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)XT(e);return}function ff(e){e=e|0;hf(e);return}function df(e){e=e|0;pf(e+24|0);return}function pf(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);XT(n)}return}function hf(e){e=e|0;var t=0;t=Za()|0;nl(e,2,6,t,vf()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function vf(){return 1204}function mf(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=gf(e)|0;e=o[a+4>>2]|0;o[u>>2]=o[a>>2];o[u+4>>2]=e;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];_f(t,i,n);h=r;return}function gf(e){e=e|0;return(o[(tf()|0)+24>>2]|0)+(e*12|0)|0}function _f(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0;u=h;h=h+16|0;i=u;r=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=o[(o[e>>2]|0)+r>>2]|0;yf(i,n);i=bf(i,n)|0;vA[r&31](e,i);h=u;return}function yf(e,t){e=e|0;t=t|0;return}function bf(e,t){e=e|0;t=t|0;return wf(t)|0}function wf(e){e=e|0;return e|0}function Ef(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Df(e,n,i,0);h=r;return}function Df(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=Cf()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=kf(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,Sf(u,r)|0,r);h=i;return}function Cf(){var e=0,t=0;if(!(r[7696]|0)){Rf(9484);Fe(33,9484,g|0)|0;t=7696;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(9484)|0)){e=9484;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Rf(9484)}return 9484}function kf(e){e=e|0;return 0}function Sf(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=Cf()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];Tf(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{xf(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function Tf(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function xf(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=Af(e)|0;if(u>>>0>>0)jT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;Of(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];Tf(u,r,n);o[s>>2]=(o[s>>2]|0)+12;Mf(e,l);If(l);h=c;return}}function Af(e){e=e|0;return 357913941}function Of(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=qT(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function Mf(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function If(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)XT(e);return}function Rf(e){e=e|0;Ff(e);return}function Nf(e){e=e|0;Pf(e+24|0);return}function Pf(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);XT(n)}return}function Ff(e){e=e|0;var t=0;t=Za()|0;nl(e,2,1,t,Lf()|0,2);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Lf(){return 1212}function Bf(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0;i=h;h=h+16|0;u=i+8|0;a=i;l=Uf(e)|0;e=o[l+4>>2]|0;o[a>>2]=o[l>>2];o[a+4>>2]=e;o[u>>2]=o[a>>2];o[u+4>>2]=o[a+4>>2];jf(t,u,n,r);h=i;return}function Uf(e){e=e|0;return(o[(Cf()|0)+24>>2]|0)+(e*12|0)|0}function jf(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0;l=h;h=h+16|0;u=l+1|0;a=l;i=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)i=o[(o[e>>2]|0)+i>>2]|0;yf(u,n);u=bf(u,n)|0;cc(a,r);a=fc(a,r)|0;MA[i&15](e,u,a);h=l;return}function zf(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Wf(e,n,i,1);h=r;return}function Wf(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=Hf()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=Vf(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,$f(u,r)|0,r);h=i;return}function Hf(){var e=0,t=0;if(!(r[7704]|0)){Qf(9520);Fe(34,9520,g|0)|0;t=7704;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(9520)|0)){e=9520;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Qf(9520)}return 9520}function Vf(e){e=e|0;return 0}function $f(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=Hf()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];Gf(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{qf(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function Gf(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function qf(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=Yf(e)|0;if(u>>>0>>0)jT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;Xf(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];Gf(u,r,n);o[s>>2]=(o[s>>2]|0)+12;Kf(e,l);Jf(l);h=c;return}}function Yf(e){e=e|0;return 357913941}function Xf(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=qT(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function Kf(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Jf(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)XT(e);return}function Qf(e){e=e|0;td(e);return}function Zf(e){e=e|0;ed(e+24|0);return}function ed(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);XT(n)}return}function td(e){e=e|0;var t=0;t=Za()|0;nl(e,2,1,t,nd()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function nd(){return 1224}function rd(e,t,n){e=e|0;t=t|0;n=n|0;var r=0.0,i=0,u=0,a=0,l=0;i=h;h=h+16|0;u=i+8|0;a=i;l=id(e)|0;e=o[l+4>>2]|0;o[a>>2]=o[l>>2];o[a+4>>2]=e;o[u>>2]=o[a>>2];o[u+4>>2]=o[a+4>>2];r=+od(t,u,n);h=i;return+r}function id(e){e=e|0;return(o[(Hf()|0)+24>>2]|0)+(e*12|0)|0}function od(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0.0;u=h;h=h+16|0;i=u;r=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=o[(o[e>>2]|0)+r>>2]|0;Jl(i,n);i=Ql(i,n)|0;a=+Nu(+SA[r&7](e,i));h=u;return+a}function ud(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];ad(e,n,i,1);h=r;return}function ad(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=ld()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=sd(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,cd(u,r)|0,r);h=i;return}function ld(){var e=0,t=0;if(!(r[7712]|0)){gd(9556);Fe(35,9556,g|0)|0;t=7712;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(9556)|0)){e=9556;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));gd(9556)}return 9556}function sd(e){e=e|0;return 0}function cd(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=ld()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];fd(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{dd(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function fd(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function dd(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=pd(e)|0;if(u>>>0>>0)jT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;hd(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];fd(u,r,n);o[s>>2]=(o[s>>2]|0)+12;vd(e,l);md(l);h=c;return}}function pd(e){e=e|0;return 357913941}function hd(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=qT(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function vd(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function md(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)XT(e);return}function gd(e){e=e|0;bd(e);return}function _d(e){e=e|0;yd(e+24|0);return}function yd(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);XT(n)}return}function bd(e){e=e|0;var t=0;t=Za()|0;nl(e,2,5,t,wd()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function wd(){return 1232}function Ed(e,t){e=e|0;t=t|0;var n=0.0,r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=Dd(e)|0;e=o[a+4>>2]|0;o[u>>2]=o[a>>2];o[u+4>>2]=e;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];n=+Cd(t,i);h=r;return+n}function Dd(e){e=e|0;return(o[(ld()|0)+24>>2]|0)+(e*12|0)|0}function Cd(e,t){e=e|0;t=t|0;var n=0;n=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)n=o[(o[e>>2]|0)+n>>2]|0;return+ +Nu(+wA[n&15](e))}function kd(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Sd(e,n,i,1);h=r;return}function Sd(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=Td()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=xd(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,Ad(u,r)|0,r);h=i;return}function Td(){var e=0,t=0;if(!(r[7720]|0)){Fd(9592);Fe(36,9592,g|0)|0;t=7720;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(9592)|0)){e=9592;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Fd(9592)}return 9592}function xd(e){e=e|0;return 0}function Ad(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=Td()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];Od(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{Md(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function Od(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function Md(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=Id(e)|0;if(u>>>0>>0)jT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;Rd(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];Od(u,r,n);o[s>>2]=(o[s>>2]|0)+12;Nd(e,l);Pd(l);h=c;return}}function Id(e){e=e|0;return 357913941}function Rd(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=qT(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function Nd(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Pd(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)XT(e);return}function Fd(e){e=e|0;Ud(e);return}function Ld(e){e=e|0;Bd(e+24|0);return}function Bd(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);XT(n)}return}function Ud(e){e=e|0;var t=0;t=Za()|0;nl(e,2,7,t,jd()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function jd(){return 1276}function zd(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0;n=h;h=h+16|0;r=n+8|0;i=n;u=Wd(e)|0;e=o[u+4>>2]|0;o[i>>2]=o[u>>2];o[i+4>>2]=e;o[r>>2]=o[i>>2];o[r+4>>2]=o[i+4>>2];t=Hd(t,r)|0;h=n;return t|0}function Wd(e){e=e|0;return(o[(Td()|0)+24>>2]|0)+(e*12|0)|0}function Hd(e,t){e=e|0;t=t|0;var n=0,r=0,i=0;i=h;h=h+16|0;r=i;n=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)n=o[(o[e>>2]|0)+n>>2]|0;vA[n&31](r,e);r=Vd(r)|0;h=i;return r|0}function Vd(e){e=e|0;var t=0,n=0,r=0,i=0;i=h;h=h+32|0;t=i+12|0;n=i;r=al($d()|0)|0;if(!r)e=qd(e)|0;else{ll(t,r);sl(n,t);Gd(e,n);e=fl(t)|0}h=i;return e|0}function $d(){var e=0;if(!(r[7736]|0)){ip(9640);Fe(25,9640,g|0)|0;e=7736;o[e>>2]=1;o[e+4>>2]=0}return 9640}function Gd(e,t){e=e|0;t=t|0;Qd(t,e,e+8|0)|0;return}function qd(e){e=e|0;var t=0,n=0,r=0,i=0,u=0,a=0,l=0;n=h;h=h+16|0;i=n+4|0;a=n;r=jD(8)|0;t=r;l=qT(16)|0;o[l>>2]=o[e>>2];o[l+4>>2]=o[e+4>>2];o[l+8>>2]=o[e+8>>2];o[l+12>>2]=o[e+12>>2];u=t+4|0;o[u>>2]=l;e=qT(8)|0;u=o[u>>2]|0;o[a>>2]=0;o[i>>2]=o[a>>2];Yd(e,u,i);o[r>>2]=e;h=n;return t|0}function Yd(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;n=qT(16)|0;o[n+4>>2]=0;o[n+8>>2]=0;o[n>>2]=1244;o[n+12>>2]=t;o[e+4>>2]=n;return}function Xd(e){e=e|0;zT(e);XT(e);return}function Kd(e){e=e|0;e=o[e+12>>2]|0;if(e|0)XT(e);return}function Jd(e){e=e|0;XT(e);return}function Qd(e,t,n){e=e|0;t=t|0;n=n|0;t=Zd(o[e>>2]|0,t,n)|0;n=e+4|0;o[(o[n>>2]|0)+8>>2]=t;return o[(o[n>>2]|0)+8>>2]|0}function Zd(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0;r=h;h=h+16|0;i=r;DS(i);e=Eu(e)|0;n=ep(e,o[t>>2]|0,+c[n>>3])|0;kS(i);h=r;return n|0}function ep(e,t,n){e=e|0;t=t|0;n=+n;var r=0;r=ku(tp()|0)|0;t=Tu(t)|0;return xe(0,r|0,e|0,t|0,+ +Su(n))|0}function tp(){var e=0;if(!(r[7728]|0)){np(9628);e=7728;o[e>>2]=1;o[e+4>>2]=0}return 9628}function np(e){e=e|0;Lu(e,rp()|0,2);return}function rp(){return 1264}function ip(e){e=e|0;Al(e);return}function op(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];up(e,n,i,1);h=r;return}function up(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=ap()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=lp(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,sp(u,r)|0,r);h=i;return}function ap(){var e=0,t=0;if(!(r[7744]|0)){mp(9684);Fe(37,9684,g|0)|0;t=7744;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(9684)|0)){e=9684;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));mp(9684)}return 9684}function lp(e){e=e|0;return 0}function sp(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=ap()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];cp(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{fp(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function cp(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function fp(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=dp(e)|0;if(u>>>0>>0)jT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;pp(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];cp(u,r,n);o[s>>2]=(o[s>>2]|0)+12;hp(e,l);vp(l);h=c;return}}function dp(e){e=e|0;return 357913941}function pp(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=qT(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function hp(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function vp(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)XT(e);return}function mp(e){e=e|0;yp(e);return}function gp(e){e=e|0;_p(e+24|0);return}function _p(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);XT(n)}return}function yp(e){e=e|0;var t=0;t=Za()|0;nl(e,2,5,t,bp()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function bp(){return 1280}function wp(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=Ep(e)|0;e=o[a+4>>2]|0;o[u>>2]=o[a>>2];o[u+4>>2]=e;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];n=Dp(t,i,n)|0;h=r;return n|0}function Ep(e){e=e|0;return(o[(ap()|0)+24>>2]|0)+(e*12|0)|0}function Dp(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;a=h;h=h+32|0;i=a;u=a+16|0;r=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=o[(o[e>>2]|0)+r>>2]|0;Jl(u,n);u=Ql(u,n)|0;MA[r&15](i,e,u);u=Vd(i)|0;h=a;return u|0}function Cp(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];kp(e,n,i,1);h=r;return}function kp(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=Sp()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=Tp(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,xp(u,r)|0,r);h=i;return}function Sp(){var e=0,t=0;if(!(r[7752]|0)){Pp(9720);Fe(38,9720,g|0)|0;t=7752;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(9720)|0)){e=9720;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Pp(9720)}return 9720}function Tp(e){e=e|0;return 0}function xp(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=Sp()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];Ap(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{Op(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function Ap(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function Op(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=Mp(e)|0;if(u>>>0>>0)jT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;Ip(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];Ap(u,r,n);o[s>>2]=(o[s>>2]|0)+12;Rp(e,l);Np(l);h=c;return}}function Mp(e){e=e|0;return 357913941}function Ip(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=qT(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function Rp(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Np(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)XT(e);return}function Pp(e){e=e|0;Bp(e);return}function Fp(e){e=e|0;Lp(e+24|0);return}function Lp(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);XT(n)}return}function Bp(e){e=e|0;var t=0;t=Za()|0;nl(e,2,8,t,Up()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Up(){return 1288}function jp(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0;n=h;h=h+16|0;r=n+8|0;i=n;u=zp(e)|0;e=o[u+4>>2]|0;o[i>>2]=o[u>>2];o[i+4>>2]=e;o[r>>2]=o[i>>2];o[r+4>>2]=o[i+4>>2];t=Wp(t,r)|0;h=n;return t|0}function zp(e){e=e|0;return(o[(Sp()|0)+24>>2]|0)+(e*12|0)|0}function Wp(e,t){e=e|0;t=t|0;var n=0;n=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)n=o[(o[e>>2]|0)+n>>2]|0;return Ru(mA[n&31](e)|0)|0}function Hp(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Vp(e,n,i,0);h=r;return}function Vp(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=$p()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=Gp(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,qp(u,r)|0,r);h=i;return}function $p(){var e=0,t=0;if(!(r[7760]|0)){eh(9756);Fe(39,9756,g|0)|0;t=7760;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(9756)|0)){e=9756;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));eh(9756)}return 9756}function Gp(e){e=e|0;return 0}function qp(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=$p()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];Yp(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{Xp(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function Yp(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function Xp(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=Kp(e)|0;if(u>>>0>>0)jT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;Jp(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];Yp(u,r,n);o[s>>2]=(o[s>>2]|0)+12;Qp(e,l);Zp(l);h=c;return}}function Kp(e){e=e|0;return 357913941}function Jp(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=qT(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function Qp(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Zp(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)XT(e);return}function eh(e){e=e|0;rh(e);return}function th(e){e=e|0;nh(e+24|0);return}function nh(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);XT(n)}return}function rh(e){e=e|0;var t=0;t=Za()|0;nl(e,2,8,t,ih()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function ih(){return 1292}function oh(e,t,n){e=e|0;t=t|0;n=+n;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=uh(e)|0;e=o[a+4>>2]|0;o[u>>2]=o[a>>2];o[u+4>>2]=e;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];ah(t,i,n);h=r;return}function uh(e){e=e|0;return(o[($p()|0)+24>>2]|0)+(e*12|0)|0}function ah(e,t,n){e=e|0;t=t|0;n=+n;var r=0,i=0,u=0;u=h;h=h+16|0;i=u;r=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=o[(o[e>>2]|0)+r>>2]|0;Xl(i,n);n=+Kl(i,n);dA[r&31](e,n);h=u;return}function lh(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];sh(e,n,i,0);h=r;return}function sh(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=ch()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=fh(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,dh(u,r)|0,r);h=i;return}function ch(){var e=0,t=0;if(!(r[7768]|0)){yh(9792);Fe(40,9792,g|0)|0;t=7768;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(9792)|0)){e=9792;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));yh(9792)}return 9792}function fh(e){e=e|0;return 0}function dh(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=ch()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];ph(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{hh(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function ph(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function hh(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=vh(e)|0;if(u>>>0>>0)jT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;mh(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];ph(u,r,n);o[s>>2]=(o[s>>2]|0)+12;gh(e,l);_h(l);h=c;return}}function vh(e){e=e|0;return 357913941}function mh(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=qT(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function gh(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function _h(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)XT(e);return}function yh(e){e=e|0;Eh(e);return}function bh(e){e=e|0;wh(e+24|0);return}function wh(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);XT(n)}return}function Eh(e){e=e|0;var t=0;t=Za()|0;nl(e,2,1,t,Dh()|0,2);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Dh(){return 1300}function Ch(e,t,n,r){e=e|0;t=t|0;n=n|0;r=+r;var i=0,u=0,a=0,l=0;i=h;h=h+16|0;u=i+8|0;a=i;l=kh(e)|0;e=o[l+4>>2]|0;o[a>>2]=o[l>>2];o[a+4>>2]=e;o[u>>2]=o[a>>2];o[u+4>>2]=o[a+4>>2];Sh(t,u,n,r);h=i;return}function kh(e){e=e|0;return(o[(ch()|0)+24>>2]|0)+(e*12|0)|0}function Sh(e,t,n,r){e=e|0;t=t|0;n=n|0;r=+r;var i=0,u=0,a=0,l=0;l=h;h=h+16|0;u=l+1|0;a=l;i=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)i=o[(o[e>>2]|0)+i>>2]|0;Jl(u,n);u=Ql(u,n)|0;Xl(a,r);r=+Kl(a,r);RA[i&15](e,u,r);h=l;return}function Th(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];xh(e,n,i,0);h=r;return}function xh(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=Ah()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=Oh(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,Mh(u,r)|0,r);h=i;return}function Ah(){var e=0,t=0;if(!(r[7776]|0)){Bh(9828);Fe(41,9828,g|0)|0;t=7776;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(9828)|0)){e=9828;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Bh(9828)}return 9828}function Oh(e){e=e|0;return 0}function Mh(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=Ah()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];Ih(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{Rh(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function Ih(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function Rh(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=Nh(e)|0;if(u>>>0>>0)jT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;Ph(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];Ih(u,r,n);o[s>>2]=(o[s>>2]|0)+12;Fh(e,l);Lh(l);h=c;return}}function Nh(e){e=e|0;return 357913941}function Ph(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=qT(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function Fh(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Lh(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)XT(e);return}function Bh(e){e=e|0;zh(e);return}function Uh(e){e=e|0;jh(e+24|0);return}function jh(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);XT(n)}return}function zh(e){e=e|0;var t=0;t=Za()|0;nl(e,2,7,t,Wh()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Wh(){return 1312}function Hh(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=Vh(e)|0;e=o[a+4>>2]|0;o[u>>2]=o[a>>2];o[u+4>>2]=e;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];$h(t,i,n);h=r;return}function Vh(e){e=e|0;return(o[(Ah()|0)+24>>2]|0)+(e*12|0)|0}function $h(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0;u=h;h=h+16|0;i=u;r=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=o[(o[e>>2]|0)+r>>2]|0;Jl(i,n);i=Ql(i,n)|0;vA[r&31](e,i);h=u;return}function Gh(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];qh(e,n,i,0);h=r;return}function qh(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=Yh()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=Xh(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,Kh(u,r)|0,r);h=i;return}function Yh(){var e=0,t=0;if(!(r[7784]|0)){rv(9864);Fe(42,9864,g|0)|0;t=7784;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(9864)|0)){e=9864;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));rv(9864)}return 9864}function Xh(e){e=e|0;return 0}function Kh(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=Yh()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];Jh(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{Qh(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function Jh(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function Qh(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=Zh(e)|0;if(u>>>0>>0)jT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;ev(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];Jh(u,r,n);o[s>>2]=(o[s>>2]|0)+12;tv(e,l);nv(l);h=c;return}}function Zh(e){e=e|0;return 357913941}function ev(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=qT(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function tv(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function nv(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)XT(e);return}function rv(e){e=e|0;uv(e);return}function iv(e){e=e|0;ov(e+24|0);return}function ov(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);XT(n)}return}function uv(e){e=e|0;var t=0;t=Za()|0;nl(e,2,8,t,av()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function av(){return 1320}function lv(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=sv(e)|0;e=o[a+4>>2]|0;o[u>>2]=o[a>>2];o[u+4>>2]=e;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];cv(t,i,n);h=r;return}function sv(e){e=e|0;return(o[(Yh()|0)+24>>2]|0)+(e*12|0)|0}function cv(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0;u=h;h=h+16|0;i=u;r=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=o[(o[e>>2]|0)+r>>2]|0;fv(i,n);i=dv(i,n)|0;vA[r&31](e,i);h=u;return}function fv(e,t){e=e|0;t=t|0;return}function dv(e,t){e=e|0;t=t|0;return pv(t)|0}function pv(e){e=e|0;return e|0}function hv(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];vv(e,n,i,0);h=r;return}function vv(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=mv()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=gv(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,_v(u,r)|0,r);h=i;return}function mv(){var e=0,t=0;if(!(r[7792]|0)){kv(9900);Fe(43,9900,g|0)|0;t=7792;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(9900)|0)){e=9900;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));kv(9900)}return 9900}function gv(e){e=e|0;return 0}function _v(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=mv()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];yv(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{bv(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function yv(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function bv(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=wv(e)|0;if(u>>>0>>0)jT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;Ev(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];yv(u,r,n);o[s>>2]=(o[s>>2]|0)+12;Dv(e,l);Cv(l);h=c;return}}function wv(e){e=e|0;return 357913941}function Ev(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=qT(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function Dv(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Cv(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)XT(e);return}function kv(e){e=e|0;xv(e);return}function Sv(e){e=e|0;Tv(e+24|0);return}function Tv(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);XT(n)}return}function xv(e){e=e|0;var t=0;t=Za()|0;nl(e,2,22,t,Av()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Av(){return 1344}function Ov(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0;n=h;h=h+16|0;r=n+8|0;i=n;u=Mv(e)|0;e=o[u+4>>2]|0;o[i>>2]=o[u>>2];o[i+4>>2]=e;o[r>>2]=o[i>>2];o[r+4>>2]=o[i+4>>2];Iv(t,r);h=n;return}function Mv(e){e=e|0;return(o[(mv()|0)+24>>2]|0)+(e*12|0)|0}function Iv(e,t){e=e|0;t=t|0;var n=0;n=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)n=o[(o[e>>2]|0)+n>>2]|0;hA[n&127](e);return}function Rv(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0;u=o[e>>2]|0;i=Nv()|0;e=Pv(n)|0;La(u,t,i,e,Fv(n,r)|0,r);return}function Nv(){var e=0,t=0;if(!(r[7800]|0)){Hv(9936);Fe(44,9936,g|0)|0;t=7800;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(9936)|0)){e=9936;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Hv(9936)}return 9936}function Pv(e){e=e|0;return e|0}function Fv(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;u=l+4|0;o[i>>2]=e;s=Nv()|0;a=s+24|0;t=za(t,4)|0;o[u>>2]=t;n=s+28|0;r=o[n>>2]|0;if(r>>>0<(o[s+32>>2]|0)>>>0){Lv(r,e,t);t=(o[n>>2]|0)+8|0;o[n>>2]=t}else{Bv(a,i,u);t=o[n>>2]|0}h=l;return(t-(o[a>>2]|0)>>3)+-1|0}function Lv(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;o[e+4>>2]=n;return}function Bv(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;u=e+4|0;a=((o[u>>2]|0)-(o[e>>2]|0)>>3)+1|0;r=Uv(e)|0;if(r>>>0>>0)jT(e);else{s=o[e>>2]|0;f=(o[e+8>>2]|0)-s|0;c=f>>2;jv(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(o[u>>2]|0)-s>>3,e+8|0);a=i+8|0;Lv(o[a>>2]|0,o[t>>2]|0,o[n>>2]|0);o[a>>2]=(o[a>>2]|0)+8;zv(e,i);Wv(i);h=l;return}}function Uv(e){e=e|0;return 536870911}function jv(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>536870911)Ye();else{i=qT(t<<3)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<3)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<3);return}function zv(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>3)<<3)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Wv(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=o[e>>2]|0;if(e|0)XT(e);return}function Hv(e){e=e|0;Gv(e);return}function Vv(e){e=e|0;$v(e+24|0);return}function $v(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);XT(n)}return}function Gv(e){e=e|0;var t=0;t=Za()|0;nl(e,1,23,t,vf()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function qv(e,t){e=e|0;t=t|0;Xv(o[(Yv(e)|0)>>2]|0,t);return}function Yv(e){e=e|0;return(o[(Nv()|0)+24>>2]|0)+(e<<3)|0}function Xv(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;yf(r,t);t=bf(r,t)|0;hA[e&127](t);h=n;return}function Kv(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0;u=o[e>>2]|0;i=Jv()|0;e=Qv(n)|0;La(u,t,i,e,Zv(n,r)|0,r);return}function Jv(){var e=0,t=0;if(!(r[7808]|0)){um(9972);Fe(45,9972,g|0)|0;t=7808;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(9972)|0)){e=9972;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));um(9972)}return 9972}function Qv(e){e=e|0;return e|0}function Zv(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;u=l+4|0;o[i>>2]=e;s=Jv()|0;a=s+24|0;t=za(t,4)|0;o[u>>2]=t;n=s+28|0;r=o[n>>2]|0;if(r>>>0<(o[s+32>>2]|0)>>>0){em(r,e,t);t=(o[n>>2]|0)+8|0;o[n>>2]=t}else{tm(a,i,u);t=o[n>>2]|0}h=l;return(t-(o[a>>2]|0)>>3)+-1|0}function em(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;o[e+4>>2]=n;return}function tm(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;u=e+4|0;a=((o[u>>2]|0)-(o[e>>2]|0)>>3)+1|0;r=nm(e)|0;if(r>>>0>>0)jT(e);else{s=o[e>>2]|0;f=(o[e+8>>2]|0)-s|0;c=f>>2;rm(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(o[u>>2]|0)-s>>3,e+8|0);a=i+8|0;em(o[a>>2]|0,o[t>>2]|0,o[n>>2]|0);o[a>>2]=(o[a>>2]|0)+8;im(e,i);om(i);h=l;return}}function nm(e){e=e|0;return 536870911}function rm(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>536870911)Ye();else{i=qT(t<<3)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<3)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<3);return}function im(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>3)<<3)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function om(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=o[e>>2]|0;if(e|0)XT(e);return}function um(e){e=e|0;sm(e);return}function am(e){e=e|0;lm(e+24|0);return}function lm(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);XT(n)}return}function sm(e){e=e|0;var t=0;t=Za()|0;nl(e,1,9,t,cm()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function cm(){return 1348}function fm(e,t){e=e|0;t=t|0;return pm(o[(dm(e)|0)>>2]|0,t)|0}function dm(e){e=e|0;return(o[(Jv()|0)+24>>2]|0)+(e<<3)|0}function pm(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;hm(r,t);t=vm(r,t)|0;t=dc(mA[e&31](t)|0)|0;h=n;return t|0}function hm(e,t){e=e|0;t=t|0;return}function vm(e,t){e=e|0;t=t|0;return mm(t)|0}function mm(e){e=e|0;return e|0}function gm(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0;u=o[e>>2]|0;i=_m()|0;e=ym(n)|0;La(u,t,i,e,bm(n,r)|0,r);return}function _m(){var e=0,t=0;if(!(r[7816]|0)){Tm(10008);Fe(46,10008,g|0)|0;t=7816;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(10008)|0)){e=10008;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Tm(10008)}return 10008}function ym(e){e=e|0;return e|0}function bm(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;u=l+4|0;o[i>>2]=e;s=_m()|0;a=s+24|0;t=za(t,4)|0;o[u>>2]=t;n=s+28|0;r=o[n>>2]|0;if(r>>>0<(o[s+32>>2]|0)>>>0){wm(r,e,t);t=(o[n>>2]|0)+8|0;o[n>>2]=t}else{Em(a,i,u);t=o[n>>2]|0}h=l;return(t-(o[a>>2]|0)>>3)+-1|0}function wm(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;o[e+4>>2]=n;return}function Em(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;u=e+4|0;a=((o[u>>2]|0)-(o[e>>2]|0)>>3)+1|0;r=Dm(e)|0;if(r>>>0>>0)jT(e);else{s=o[e>>2]|0;f=(o[e+8>>2]|0)-s|0;c=f>>2;Cm(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(o[u>>2]|0)-s>>3,e+8|0);a=i+8|0;wm(o[a>>2]|0,o[t>>2]|0,o[n>>2]|0);o[a>>2]=(o[a>>2]|0)+8;km(e,i);Sm(i);h=l;return}}function Dm(e){e=e|0;return 536870911}function Cm(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>536870911)Ye();else{i=qT(t<<3)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<3)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<3);return}function km(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>3)<<3)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Sm(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=o[e>>2]|0;if(e|0)XT(e);return}function Tm(e){e=e|0;Om(e);return}function xm(e){e=e|0;Am(e+24|0);return}function Am(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);XT(n)}return}function Om(e){e=e|0;var t=0;t=Za()|0;nl(e,1,15,t,Ac()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Mm(e){e=e|0;return Rm(o[(Im(e)|0)>>2]|0)|0}function Im(e){e=e|0;return(o[(_m()|0)+24>>2]|0)+(e<<3)|0}function Rm(e){e=e|0;return dc(TA[e&7]()|0)|0}function Nm(){var e=0;if(!(r[7832]|0)){Vm(10052);Fe(25,10052,g|0)|0;e=7832;o[e>>2]=1;o[e+4>>2]=0}return 10052}function Pm(e,t){e=e|0;t=t|0;o[e>>2]=Fm()|0;o[e+4>>2]=Lm()|0;o[e+12>>2]=t;o[e+8>>2]=Bm()|0;o[e+32>>2]=2;return}function Fm(){return 11709}function Lm(){return 1188}function Bm(){return Wm()|0}function Um(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;if((jm(r,896)|0)==512){if(n|0){zm(n);XT(n)}}else if(t|0){Ji(t);XT(t)}return}function jm(e,t){e=e|0;t=t|0;return t&e|0}function zm(e){e=e|0;e=o[e+4>>2]|0;if(e|0)$T(e);return}function Wm(){var e=0;if(!(r[7824]|0)){o[2511]=Hm()|0;o[2512]=0;e=7824;o[e>>2]=1;o[e+4>>2]=0}return 10044}function Hm(){return 0}function Vm(e){e=e|0;Al(e);return}function $m(e){e=e|0;var t=0,n=0,r=0,i=0,u=0;t=h;h=h+32|0;n=t+24|0;u=t+16|0;i=t+8|0;r=t;Gm(e,4827);qm(e,4834,3)|0;Ym(e,3682,47)|0;o[u>>2]=9;o[u+4>>2]=0;o[n>>2]=o[u>>2];o[n+4>>2]=o[u+4>>2];Xm(e,4841,n)|0;o[i>>2]=1;o[i+4>>2]=0;o[n>>2]=o[i>>2];o[n+4>>2]=o[i+4>>2];Km(e,4871,n)|0;o[r>>2]=10;o[r+4>>2]=0;o[n>>2]=o[r>>2];o[n+4>>2]=o[r+4>>2];Jm(e,4891,n)|0;h=t;return}function Gm(e,t){e=e|0;t=t|0;var n=0;n=V_()|0;o[e>>2]=n;$_(n,t);cw(o[e>>2]|0);return}function qm(e,t,n){e=e|0;t=t|0;n=n|0;k_(e,Ia(t)|0,n,0);return e|0}function Ym(e,t,n){e=e|0;t=t|0;n=n|0;a_(e,Ia(t)|0,n,0);return e|0}function Xm(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Ug(e,t,i);h=r;return e|0}function Km(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];gg(e,t,i);h=r;return e|0}function Jm(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=o[n+4>>2]|0;o[u>>2]=o[n>>2];o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Qm(e,t,i);h=r;return e|0}function Qm(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Zm(e,n,i,1);h=r;return}function Zm(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=eg()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=tg(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,ng(u,r)|0,r);h=i;return}function eg(){var e=0,t=0;if(!(r[7840]|0)){sg(10100);Fe(48,10100,g|0)|0;t=7840;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(10100)|0)){e=10100;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));sg(10100)}return 10100}function tg(e){e=e|0;return 0}function ng(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=eg()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];rg(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{ig(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function rg(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function ig(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=og(e)|0;if(u>>>0>>0)jT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;ug(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];rg(u,r,n);o[s>>2]=(o[s>>2]|0)+12;ag(e,l);lg(l);h=c;return}}function og(e){e=e|0;return 357913941}function ug(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=qT(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function ag(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function lg(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)XT(e);return}function sg(e){e=e|0;dg(e);return}function cg(e){e=e|0;fg(e+24|0);return}function fg(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);XT(n)}return}function dg(e){e=e|0;var t=0;t=Za()|0;nl(e,2,6,t,pg()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function pg(){return 1364}function hg(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=vg(e)|0;e=o[a+4>>2]|0;o[u>>2]=o[a>>2];o[u+4>>2]=e;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];n=mg(t,i,n)|0;h=r;return n|0}function vg(e){e=e|0;return(o[(eg()|0)+24>>2]|0)+(e*12|0)|0}function mg(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0;u=h;h=h+16|0;i=u;r=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=o[(o[e>>2]|0)+r>>2]|0;Jl(i,n);i=Ql(i,n)|0;i=bs(DA[r&15](e,i)|0)|0;h=u;return i|0}function gg(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];_g(e,n,i,0);h=r;return}function _g(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=yg()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=bg(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,wg(u,r)|0,r);h=i;return}function yg(){var e=0,t=0;if(!(r[7848]|0)){xg(10136);Fe(49,10136,g|0)|0;t=7848;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(10136)|0)){e=10136;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));xg(10136)}return 10136}function bg(e){e=e|0;return 0}function wg(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=yg()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];Eg(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{Dg(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function Eg(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function Dg(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=Cg(e)|0;if(u>>>0>>0)jT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;kg(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];Eg(u,r,n);o[s>>2]=(o[s>>2]|0)+12;Sg(e,l);Tg(l);h=c;return}}function Cg(e){e=e|0;return 357913941}function kg(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=qT(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function Sg(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Tg(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)XT(e);return}function xg(e){e=e|0;Mg(e);return}function Ag(e){e=e|0;Og(e+24|0);return}function Og(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);XT(n)}return}function Mg(e){e=e|0;var t=0;t=Za()|0;nl(e,2,9,t,Ig()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Ig(){return 1372}function Rg(e,t,n){e=e|0;t=t|0;n=+n;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;i=r+8|0;u=r;a=Ng(e)|0;e=o[a+4>>2]|0;o[u>>2]=o[a>>2];o[u+4>>2]=e;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];Pg(t,i,n);h=r;return}function Ng(e){e=e|0;return(o[(yg()|0)+24>>2]|0)+(e*12|0)|0}function Pg(e,t,n){e=e|0;t=t|0;n=+n;var r=0,i=0,u=0,a=ft;u=h;h=h+16|0;i=u;r=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)r=o[(o[e>>2]|0)+r>>2]|0;Fg(i,n);a=Y(Lg(i,n));fA[r&1](e,a);h=u;return}function Fg(e,t){e=e|0;t=+t;return}function Lg(e,t){e=e|0;t=+t;return Y(Bg(t))}function Bg(e){e=+e;return Y(e)}function Ug(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;i=r+8|0;u=r;l=o[n>>2]|0;a=o[n+4>>2]|0;n=Ia(t)|0;o[u>>2]=l;o[u+4>>2]=a;o[i>>2]=o[u>>2];o[i+4>>2]=o[u+4>>2];jg(e,n,i,0);h=r;return}function jg(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0;i=h;h=h+32|0;u=i+16|0;f=i+8|0;l=i;c=o[n>>2]|0;s=o[n+4>>2]|0;a=o[e>>2]|0;e=zg()|0;o[f>>2]=c;o[f+4>>2]=s;o[u>>2]=o[f>>2];o[u+4>>2]=o[f+4>>2];n=Wg(u)|0;o[l>>2]=c;o[l+4>>2]=s;o[u>>2]=o[l>>2];o[u+4>>2]=o[l+4>>2];La(a,t,e,n,Hg(u,r)|0,r);h=i;return}function zg(){var e=0,t=0;if(!(r[7856]|0)){Kg(10172);Fe(50,10172,g|0)|0;t=7856;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(10172)|0)){e=10172;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Kg(10172)}return 10172}function Wg(e){e=e|0;return 0}function Hg(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0;f=h;h=h+32|0;i=f+24|0;a=f+16|0;l=f;s=f+8|0;u=o[e>>2]|0;r=o[e+4>>2]|0;o[l>>2]=u;o[l+4>>2]=r;d=zg()|0;c=d+24|0;e=za(t,4)|0;o[s>>2]=e;t=d+28|0;n=o[t>>2]|0;if(n>>>0<(o[d+32>>2]|0)>>>0){o[a>>2]=u;o[a+4>>2]=r;o[i>>2]=o[a>>2];o[i+4>>2]=o[a+4>>2];Vg(n,i,e);e=(o[t>>2]|0)+12|0;o[t>>2]=e}else{$g(c,l,s);e=o[t>>2]|0}h=f;return((e-(o[c>>2]|0)|0)/12|0)+-1|0}function Vg(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=o[t+4>>2]|0;o[e>>2]=o[t>>2];o[e+4>>2]=r;o[e+8>>2]=n;return}function $g(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0;c=h;h=h+48|0;r=c+32|0;a=c+24|0;l=c;s=e+4|0;i=(((o[s>>2]|0)-(o[e>>2]|0)|0)/12|0)+1|0;u=Gg(e)|0;if(u>>>0>>0)jT(e);else{f=o[e>>2]|0;p=((o[e+8>>2]|0)-f|0)/12|0;d=p<<1;qg(l,p>>>0>>1>>>0?d>>>0>>0?i:d:u,((o[s>>2]|0)-f|0)/12|0,e+8|0);s=l+8|0;u=o[s>>2]|0;i=o[t+4>>2]|0;n=o[n>>2]|0;o[a>>2]=o[t>>2];o[a+4>>2]=i;o[r>>2]=o[a>>2];o[r+4>>2]=o[a+4>>2];Vg(u,r,n);o[s>>2]=(o[s>>2]|0)+12;Yg(e,l);Xg(l);h=c;return}}function Gg(e){e=e|0;return 357913941}function qg(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>357913941)Ye();else{i=qT(t*12|0)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n*12|0)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t*12|0);return}function Yg(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(((i|0)/-12|0)*12|0)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Xg(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~(((r+-12-t|0)>>>0)/12|0)*12|0);e=o[e>>2]|0;if(e|0)XT(e);return}function Kg(e){e=e|0;Zg(e);return}function Jg(e){e=e|0;Qg(e+24|0);return}function Qg(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~(((t+-12-r|0)>>>0)/12|0)*12|0);XT(n)}return}function Zg(e){e=e|0;var t=0;t=Za()|0;nl(e,2,3,t,e_()|0,2);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function e_(){return 1380}function t_(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0;i=h;h=h+16|0;u=i+8|0;a=i;l=n_(e)|0;e=o[l+4>>2]|0;o[a>>2]=o[l>>2];o[a+4>>2]=e;o[u>>2]=o[a>>2];o[u+4>>2]=o[a+4>>2];r_(t,u,n,r);h=i;return}function n_(e){e=e|0;return(o[(zg()|0)+24>>2]|0)+(e*12|0)|0}function r_(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0;l=h;h=h+16|0;u=l+1|0;a=l;i=o[t>>2]|0;t=o[t+4>>2]|0;e=e+(t>>1)|0;if(t&1)i=o[(o[e>>2]|0)+i>>2]|0;Jl(u,n);u=Ql(u,n)|0;i_(a,r);a=o_(a,r)|0;MA[i&15](e,u,a);h=l;return}function i_(e,t){e=e|0;t=t|0;return}function o_(e,t){e=e|0;t=t|0;return u_(t)|0}function u_(e){e=e|0;return(e|0)!=0|0}function a_(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0;u=o[e>>2]|0;i=l_()|0;e=s_(n)|0;La(u,t,i,e,c_(n,r)|0,r);return}function l_(){var e=0,t=0;if(!(r[7864]|0)){g_(10208);Fe(51,10208,g|0)|0;t=7864;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(10208)|0)){e=10208;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));g_(10208)}return 10208}function s_(e){e=e|0;return e|0}function c_(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;u=l+4|0;o[i>>2]=e;s=l_()|0;a=s+24|0;t=za(t,4)|0;o[u>>2]=t;n=s+28|0;r=o[n>>2]|0;if(r>>>0<(o[s+32>>2]|0)>>>0){f_(r,e,t);t=(o[n>>2]|0)+8|0;o[n>>2]=t}else{d_(a,i,u);t=o[n>>2]|0}h=l;return(t-(o[a>>2]|0)>>3)+-1|0}function f_(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;o[e+4>>2]=n;return}function d_(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;u=e+4|0;a=((o[u>>2]|0)-(o[e>>2]|0)>>3)+1|0;r=p_(e)|0;if(r>>>0>>0)jT(e);else{s=o[e>>2]|0;f=(o[e+8>>2]|0)-s|0;c=f>>2;h_(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(o[u>>2]|0)-s>>3,e+8|0);a=i+8|0;f_(o[a>>2]|0,o[t>>2]|0,o[n>>2]|0);o[a>>2]=(o[a>>2]|0)+8;v_(e,i);m_(i);h=l;return}}function p_(e){e=e|0;return 536870911}function h_(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>536870911)Ye();else{i=qT(t<<3)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<3)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<3);return}function v_(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>3)<<3)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function m_(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=o[e>>2]|0;if(e|0)XT(e);return}function g_(e){e=e|0;b_(e);return}function __(e){e=e|0;y_(e+24|0);return}function y_(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);XT(n)}return}function b_(e){e=e|0;var t=0;t=Za()|0;nl(e,1,24,t,w_()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function w_(){return 1392}function E_(e,t){e=e|0;t=t|0;C_(o[(D_(e)|0)>>2]|0,t);return}function D_(e){e=e|0;return(o[(l_()|0)+24>>2]|0)+(e<<3)|0}function C_(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;hm(r,t);t=vm(r,t)|0;hA[e&127](t);h=n;return}function k_(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0;u=o[e>>2]|0;i=S_()|0;e=T_(n)|0;La(u,t,i,e,x_(n,r)|0,r);return}function S_(){var e=0,t=0;if(!(r[7872]|0)){P_(10244);Fe(52,10244,g|0)|0;t=7872;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(10244)|0)){e=10244;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));P_(10244)}return 10244}function T_(e){e=e|0;return e|0}function x_(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;u=l+4|0;o[i>>2]=e;s=S_()|0;a=s+24|0;t=za(t,4)|0;o[u>>2]=t;n=s+28|0;r=o[n>>2]|0;if(r>>>0<(o[s+32>>2]|0)>>>0){A_(r,e,t);t=(o[n>>2]|0)+8|0;o[n>>2]=t}else{O_(a,i,u);t=o[n>>2]|0}h=l;return(t-(o[a>>2]|0)>>3)+-1|0}function A_(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;o[e+4>>2]=n;return}function O_(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;u=e+4|0;a=((o[u>>2]|0)-(o[e>>2]|0)>>3)+1|0;r=M_(e)|0;if(r>>>0>>0)jT(e);else{s=o[e>>2]|0;f=(o[e+8>>2]|0)-s|0;c=f>>2;I_(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(o[u>>2]|0)-s>>3,e+8|0);a=i+8|0;A_(o[a>>2]|0,o[t>>2]|0,o[n>>2]|0);o[a>>2]=(o[a>>2]|0)+8;R_(e,i);N_(i);h=l;return}}function M_(e){e=e|0;return 536870911}function I_(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>536870911)Ye();else{i=qT(t<<3)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<3)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<3);return}function R_(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>3)<<3)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function N_(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=o[e>>2]|0;if(e|0)XT(e);return}function P_(e){e=e|0;B_(e);return}function F_(e){e=e|0;L_(e+24|0);return}function L_(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);XT(n)}return}function B_(e){e=e|0;var t=0;t=Za()|0;nl(e,1,16,t,U_()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function U_(){return 1400}function j_(e){e=e|0;return W_(o[(z_(e)|0)>>2]|0)|0}function z_(e){e=e|0;return(o[(S_()|0)+24>>2]|0)+(e<<3)|0}function W_(e){e=e|0;return H_(TA[e&7]()|0)|0}function H_(e){e=e|0;return e|0}function V_(){var e=0;if(!(r[7880]|0)){J_(10280);Fe(25,10280,g|0)|0;e=7880;o[e>>2]=1;o[e+4>>2]=0}return 10280}function $_(e,t){e=e|0;t=t|0;o[e>>2]=G_()|0;o[e+4>>2]=q_()|0;o[e+12>>2]=t;o[e+8>>2]=Y_()|0;o[e+32>>2]=4;return}function G_(){return 11711}function q_(){return 1356}function Y_(){return Wm()|0}function X_(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;if((jm(r,896)|0)==512){if(n|0){K_(n);XT(n)}}else if(t|0){Hi(t);XT(t)}return}function K_(e){e=e|0;e=o[e+4>>2]|0;if(e|0)$T(e);return}function J_(e){e=e|0;Al(e);return}function Q_(e){e=e|0;Z_(e,4920);ey(e)|0;ty(e)|0;return}function Z_(e,t){e=e|0;t=t|0;var n=0;n=$d()|0;o[e>>2]=n;Ty(n,t);cw(o[e>>2]|0);return}function ey(e){e=e|0;var t=0;t=o[e>>2]|0;ry(t,vy()|0);return e|0}function ty(e){e=e|0;var t=0;t=o[e>>2]|0;ry(t,ny()|0);return e|0}function ny(){var e=0;if(!(r[7888]|0)){iy(10328);Fe(53,10328,g|0)|0;e=7888;o[e>>2]=1;o[e+4>>2]=0}if(!(Ka(10328)|0))iy(10328);return 10328}function ry(e,t){e=e|0;t=t|0;La(e,0,t,0,0,0);return}function iy(e){e=e|0;ay(e);sy(e,10);return}function oy(e){e=e|0;uy(e+24|0);return}function uy(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);XT(n)}return}function ay(e){e=e|0;var t=0;t=Za()|0;nl(e,5,1,t,dy()|0,2);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function ly(e,t,n){e=e|0;t=t|0;n=+n;cy(e,t,n);return}function sy(e,t){e=e|0;t=t|0;o[e+20>>2]=t;return}function cy(e,t,n){e=e|0;t=t|0;n=+n;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+16|0;u=r+8|0;l=r+13|0;i=r;a=r+12|0;Jl(l,t);o[u>>2]=Ql(l,t)|0;Xl(a,n);c[i>>3]=+Kl(a,n);fy(e,u,i);h=r;return}function fy(e,t,n){e=e|0;t=t|0;n=n|0;Vo(e+8|0,o[t>>2]|0,+c[n>>3]);r[e+24>>0]=1;return}function dy(){return 1404}function py(e,t){e=e|0;t=+t;return hy(e,t)|0}function hy(e,t){e=e|0;t=+t;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;r=h;h=h+16|0;u=r+4|0;a=r+8|0;l=r;i=jD(8)|0;n=i;s=qT(16)|0;Jl(u,e);e=Ql(u,e)|0;Xl(a,t);Vo(s,e,+Kl(a,t));a=n+4|0;o[a>>2]=s;e=qT(8)|0;a=o[a>>2]|0;o[l>>2]=0;o[u>>2]=o[l>>2];Yd(e,a,u);o[i>>2]=e;h=r;return n|0}function vy(){var e=0;if(!(r[7896]|0)){my(10364);Fe(54,10364,g|0)|0;e=7896;o[e>>2]=1;o[e+4>>2]=0}if(!(Ka(10364)|0))my(10364);return 10364}function my(e){e=e|0;yy(e);sy(e,55);return}function gy(e){e=e|0;_y(e+24|0);return}function _y(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);XT(n)}return}function yy(e){e=e|0;var t=0;t=Za()|0;nl(e,5,4,t,Cy()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function by(e){e=e|0;wy(e);return}function wy(e){e=e|0;Ey(e);return}function Ey(e){e=e|0;Dy(e+8|0);r[e+24>>0]=1;return}function Dy(e){e=e|0;o[e>>2]=0;c[e+8>>3]=0.0;return}function Cy(){return 1424}function ky(){return Sy()|0}function Sy(){var e=0,t=0,n=0,r=0,i=0,u=0,a=0;t=h;h=h+16|0;i=t+4|0;a=t;n=jD(8)|0;e=n;r=qT(16)|0;Dy(r);u=e+4|0;o[u>>2]=r;r=qT(8)|0;u=o[u>>2]|0;o[a>>2]=0;o[i>>2]=o[a>>2];Yd(r,u,i);o[n>>2]=r;h=t;return e|0}function Ty(e,t){e=e|0;t=t|0;o[e>>2]=xy()|0;o[e+4>>2]=Ay()|0;o[e+12>>2]=t;o[e+8>>2]=Oy()|0;o[e+32>>2]=5;return}function xy(){return 11710}function Ay(){return 1416}function Oy(){return Ry()|0}function My(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;if((jm(r,896)|0)==512){if(n|0){Iy(n);XT(n)}}else if(t|0)XT(t);return}function Iy(e){e=e|0;e=o[e+4>>2]|0;if(e|0)$T(e);return}function Ry(){var e=0;if(!(r[7904]|0)){o[2600]=Ny()|0;o[2601]=0;e=7904;o[e>>2]=1;o[e+4>>2]=0}return 10400}function Ny(){return o[357]|0}function Py(e){e=e|0;Fy(e,4926);Ly(e)|0;return}function Fy(e,t){e=e|0;t=t|0;var n=0;n=ul()|0;o[e>>2]=n;Xy(n,t);cw(o[e>>2]|0);return}function Ly(e){e=e|0;var t=0;t=o[e>>2]|0;ry(t,By()|0);return e|0}function By(){var e=0;if(!(r[7912]|0)){Uy(10412);Fe(56,10412,g|0)|0;e=7912;o[e>>2]=1;o[e+4>>2]=0}if(!(Ka(10412)|0))Uy(10412);return 10412}function Uy(e){e=e|0;Wy(e);sy(e,57);return}function jy(e){e=e|0;zy(e+24|0);return}function zy(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);XT(n)}return}function Wy(e){e=e|0;var t=0;t=Za()|0;nl(e,5,5,t,Gy()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Hy(e){e=e|0;Vy(e);return}function Vy(e){e=e|0;$y(e);return}function $y(e){e=e|0;var t=0,n=0;t=e+8|0;n=t+48|0;do{o[t>>2]=0;t=t+4|0}while((t|0)<(n|0));r[e+56>>0]=1;return}function Gy(){return 1432}function qy(){return Yy()|0}function Yy(){var e=0,t=0,n=0,r=0,i=0,u=0,a=0,l=0;a=h;h=h+16|0;e=a+4|0;t=a;n=jD(8)|0;r=n;i=qT(48)|0;u=i;l=u+48|0;do{o[u>>2]=0;u=u+4|0}while((u|0)<(l|0));u=r+4|0;o[u>>2]=i;l=qT(8)|0;u=o[u>>2]|0;o[t>>2]=0;o[e>>2]=o[t>>2];pl(l,u,e);o[n>>2]=l;h=a;return r|0}function Xy(e,t){e=e|0;t=t|0;o[e>>2]=Ky()|0;o[e+4>>2]=Jy()|0;o[e+12>>2]=t;o[e+8>>2]=Qy()|0;o[e+32>>2]=6;return}function Ky(){return 11704}function Jy(){return 1436}function Qy(){return Ry()|0}function Zy(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;if((jm(r,896)|0)==512){if(n|0){eb(n);XT(n)}}else if(t|0)XT(t);return}function eb(e){e=e|0;e=o[e+4>>2]|0;if(e|0)$T(e);return}function tb(e){e=e|0;nb(e,4933);rb(e)|0;ib(e)|0;return}function nb(e,t){e=e|0;t=t|0;var n=0;n=Rb()|0;o[e>>2]=n;Nb(n,t);cw(o[e>>2]|0);return}function rb(e){e=e|0;var t=0;t=o[e>>2]|0;ry(t,wb()|0);return e|0}function ib(e){e=e|0;var t=0;t=o[e>>2]|0;ry(t,ob()|0);return e|0}function ob(){var e=0;if(!(r[7920]|0)){ub(10452);Fe(58,10452,g|0)|0;e=7920;o[e>>2]=1;o[e+4>>2]=0}if(!(Ka(10452)|0))ub(10452);return 10452}function ub(e){e=e|0;sb(e);sy(e,1);return}function ab(e){e=e|0;lb(e+24|0);return}function lb(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);XT(n)}return}function sb(e){e=e|0;var t=0;t=Za()|0;nl(e,5,1,t,hb()|0,2);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function cb(e,t,n){e=e|0;t=+t;n=+n;fb(e,t,n);return}function fb(e,t,n){e=e|0;t=+t;n=+n;var r=0,i=0,o=0,u=0,a=0;r=h;h=h+32|0;o=r+8|0;a=r+17|0;i=r;u=r+16|0;Xl(a,t);c[o>>3]=+Kl(a,t);Xl(u,n);c[i>>3]=+Kl(u,n);db(e,o,i);h=r;return}function db(e,t,n){e=e|0;t=t|0;n=n|0;pb(e+8|0,+c[t>>3],+c[n>>3]);r[e+24>>0]=1;return}function pb(e,t,n){e=e|0;t=+t;n=+n;c[e>>3]=t;c[e+8>>3]=n;return}function hb(){return 1472}function vb(e,t){e=+e;t=+t;return mb(e,t)|0}function mb(e,t){e=+e;t=+t;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;r=h;h=h+16|0;a=r+4|0;l=r+8|0;s=r;i=jD(8)|0;n=i;u=qT(16)|0;Xl(a,e);e=+Kl(a,e);Xl(l,t);pb(u,e,+Kl(l,t));l=n+4|0;o[l>>2]=u;u=qT(8)|0;l=o[l>>2]|0;o[s>>2]=0;o[a>>2]=o[s>>2];gb(u,l,a);o[i>>2]=u;h=r;return n|0}function gb(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;n=qT(16)|0;o[n+4>>2]=0;o[n+8>>2]=0;o[n>>2]=1452;o[n+12>>2]=t;o[e+4>>2]=n;return}function _b(e){e=e|0;zT(e);XT(e);return}function yb(e){e=e|0;e=o[e+12>>2]|0;if(e|0)XT(e);return}function bb(e){e=e|0;XT(e);return}function wb(){var e=0;if(!(r[7928]|0)){Eb(10488);Fe(59,10488,g|0)|0;e=7928;o[e>>2]=1;o[e+4>>2]=0}if(!(Ka(10488)|0))Eb(10488);return 10488}function Eb(e){e=e|0;kb(e);sy(e,60);return}function Db(e){e=e|0;Cb(e+24|0);return}function Cb(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);XT(n)}return}function kb(e){e=e|0;var t=0;t=Za()|0;nl(e,5,6,t,Ob()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Sb(e){e=e|0;Tb(e);return}function Tb(e){e=e|0;xb(e);return}function xb(e){e=e|0;Ab(e+8|0);r[e+24>>0]=1;return}function Ab(e){e=e|0;o[e>>2]=0;o[e+4>>2]=0;o[e+8>>2]=0;o[e+12>>2]=0;return}function Ob(){return 1492}function Mb(){return Ib()|0}function Ib(){var e=0,t=0,n=0,r=0,i=0,u=0,a=0;t=h;h=h+16|0;i=t+4|0;a=t;n=jD(8)|0;e=n;r=qT(16)|0;Ab(r);u=e+4|0;o[u>>2]=r;r=qT(8)|0;u=o[u>>2]|0;o[a>>2]=0;o[i>>2]=o[a>>2];gb(r,u,i);o[n>>2]=r;h=t;return e|0}function Rb(){var e=0;if(!(r[7936]|0)){jb(10524);Fe(25,10524,g|0)|0;e=7936;o[e>>2]=1;o[e+4>>2]=0}return 10524}function Nb(e,t){e=e|0;t=t|0;o[e>>2]=Pb()|0;o[e+4>>2]=Fb()|0;o[e+12>>2]=t;o[e+8>>2]=Lb()|0;o[e+32>>2]=7;return}function Pb(){return 11700}function Fb(){return 1484}function Lb(){return Ry()|0}function Bb(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;if((jm(r,896)|0)==512){if(n|0){Ub(n);XT(n)}}else if(t|0)XT(t);return}function Ub(e){e=e|0;e=o[e+4>>2]|0;if(e|0)$T(e);return}function jb(e){e=e|0;Al(e);return}function zb(e,t,n){e=e|0;t=t|0;n=n|0;e=Ia(t)|0;t=Wb(n)|0;n=Hb(n,0)|0;xw(e,t,n,Vb()|0,0);return}function Wb(e){e=e|0;return e|0}function Hb(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;u=l+4|0;o[i>>2]=e;s=Vb()|0;a=s+24|0;t=za(t,4)|0;o[u>>2]=t;n=s+28|0;r=o[n>>2]|0;if(r>>>0<(o[s+32>>2]|0)>>>0){Qb(r,e,t);t=(o[n>>2]|0)+8|0;o[n>>2]=t}else{Zb(a,i,u);t=o[n>>2]|0}h=l;return(t-(o[a>>2]|0)>>3)+-1|0}function Vb(){var e=0,t=0;if(!(r[7944]|0)){$b(10568);Fe(61,10568,g|0)|0;t=7944;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(10568)|0)){e=10568;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));$b(10568)}return 10568}function $b(e){e=e|0;Yb(e);return}function Gb(e){e=e|0;qb(e+24|0);return}function qb(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);XT(n)}return}function Yb(e){e=e|0;var t=0;t=Za()|0;nl(e,1,17,t,Yc()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Xb(e){e=e|0;return Jb(o[(Kb(e)|0)>>2]|0)|0}function Kb(e){e=e|0;return(o[(Vb()|0)+24>>2]|0)+(e<<3)|0}function Jb(e){e=e|0;return Qc(TA[e&7]()|0)|0}function Qb(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;o[e+4>>2]=n;return}function Zb(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;u=e+4|0;a=((o[u>>2]|0)-(o[e>>2]|0)>>3)+1|0;r=ew(e)|0;if(r>>>0>>0)jT(e);else{s=o[e>>2]|0;f=(o[e+8>>2]|0)-s|0;c=f>>2;tw(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(o[u>>2]|0)-s>>3,e+8|0);a=i+8|0;Qb(o[a>>2]|0,o[t>>2]|0,o[n>>2]|0);o[a>>2]=(o[a>>2]|0)+8;nw(e,i);rw(i);h=l;return}}function ew(e){e=e|0;return 536870911}function tw(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>536870911)Ye();else{i=qT(t<<3)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<3)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<3);return}function nw(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>3)<<3)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function rw(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=o[e>>2]|0;if(e|0)XT(e);return}function iw(){ow();return}function ow(){uw(10604);return}function uw(e){e=e|0;aw(e,4955);return}function aw(e,t){e=e|0;t=t|0;var n=0;n=lw()|0;o[e>>2]=n;sw(n,t);cw(o[e>>2]|0);return}function lw(){var e=0;if(!(r[7952]|0)){bw(10612);Fe(25,10612,g|0)|0;e=7952;o[e>>2]=1;o[e+4>>2]=0}return 10612}function sw(e,t){e=e|0;t=t|0;o[e>>2]=vw()|0;o[e+4>>2]=mw()|0;o[e+12>>2]=t;o[e+8>>2]=gw()|0;o[e+32>>2]=8;return}function cw(e){e=e|0;var t=0,n=0;t=h;h=h+16|0;n=t;fw()|0;o[n>>2]=e;dw(10608,n);h=t;return}function fw(){if(!(r[11714]|0)){o[2652]=0;Fe(62,10608,g|0)|0;r[11714]=1}return 10608}function dw(e,t){e=e|0;t=t|0;var n=0;n=qT(8)|0;o[n+4>>2]=o[t>>2];o[n>>2]=o[e>>2];o[e>>2]=n;return}function pw(e){e=e|0;hw(e);return}function hw(e){e=e|0;var t=0,n=0;t=o[e>>2]|0;if(t|0)do{n=t;t=o[t>>2]|0;XT(n)}while((t|0)!=0);o[e>>2]=0;return}function vw(){return 11715}function mw(){return 1496}function gw(){return Wm()|0}function _w(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;if((jm(r,896)|0)==512){if(n|0){yw(n);XT(n)}}else if(t|0)XT(t);return}function yw(e){e=e|0;e=o[e+4>>2]|0;if(e|0)$T(e);return}function bw(e){e=e|0;Al(e);return}function ww(e,t){e=e|0;t=t|0;var n=0,r=0;fw()|0;n=o[2652]|0;e:do{if(n|0){while(1){r=o[n+4>>2]|0;if(r|0?(rT(Ew(r)|0,e)|0)==0:0)break;n=o[n>>2]|0;if(!n)break e}Dw(r,t)}}while(0);return}function Ew(e){e=e|0;return o[e+12>>2]|0}function Dw(e,t){e=e|0;t=t|0;var n=0;e=e+36|0;n=o[e>>2]|0;if(n|0){Qi(n);XT(n)}n=qT(4)|0;_u(n,t);o[e>>2]=n;return}function Cw(){if(!(r[11716]|0)){o[2664]=0;Fe(63,10656,g|0)|0;r[11716]=1}return 10656}function kw(){var e=0;if(!(r[11717]|0)){Sw();o[2665]=1504;r[11717]=1;e=1504}else e=o[2665]|0;return e|0}function Sw(){if(!(r[11740]|0)){r[11718]=za(za(8,0)|0,0)|0;r[11719]=za(za(0,0)|0,0)|0;r[11720]=za(za(0,16)|0,0)|0;r[11721]=za(za(8,0)|0,0)|0;r[11722]=za(za(0,0)|0,0)|0;r[11723]=za(za(8,0)|0,0)|0;r[11724]=za(za(0,0)|0,0)|0;r[11725]=za(za(8,0)|0,0)|0;r[11726]=za(za(0,0)|0,0)|0;r[11727]=za(za(8,0)|0,0)|0;r[11728]=za(za(0,0)|0,0)|0;r[11729]=za(za(0,0)|0,32)|0;r[11730]=za(za(0,0)|0,32)|0;r[11740]=1}return}function Tw(){return 1572}function xw(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;var u=0,a=0,l=0,s=0,c=0,f=0;u=h;h=h+32|0;f=u+16|0;c=u+12|0;s=u+8|0;l=u+4|0;a=u;o[f>>2]=e;o[c>>2]=t;o[s>>2]=n;o[l>>2]=r;o[a>>2]=i;Cw()|0;Aw(10656,f,c,s,l,a);h=u;return}function Aw(e,t,n,r,i,u){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;u=u|0;var a=0;a=qT(24)|0;ja(a+4|0,o[t>>2]|0,o[n>>2]|0,o[r>>2]|0,o[i>>2]|0,o[u>>2]|0);o[a>>2]=o[e>>2];o[e>>2]=a;return}function Ow(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,v=0,m=0,g=0,_=0,y=0,b=0;b=h;h=h+32|0;m=b+20|0;g=b+8|0;_=b+4|0;y=b;t=o[t>>2]|0;if(t|0){v=m+4|0;s=m+8|0;c=g+4|0;f=g+8|0;d=g+8|0;p=m+8|0;do{a=t+4|0;l=Mw(a)|0;if(l|0){i=Iw(l)|0;o[m>>2]=0;o[v>>2]=0;o[s>>2]=0;r=(Rw(l)|0)+1|0;Nw(m,r);if(r|0)while(1){r=r+-1|0;gS(g,o[i>>2]|0);u=o[v>>2]|0;if(u>>>0<(o[p>>2]|0)>>>0){o[u>>2]=o[g>>2];o[v>>2]=(o[v>>2]|0)+4}else Pw(m,g);if(!r)break;else i=i+4|0}r=Fw(l)|0;o[g>>2]=0;o[c>>2]=0;o[f>>2]=0;e:do{if(o[r>>2]|0){i=0;u=0;while(1){if((i|0)==(u|0))Lw(g,r);else{o[i>>2]=o[r>>2];o[c>>2]=(o[c>>2]|0)+4}r=r+4|0;if(!(o[r>>2]|0))break e;i=o[c>>2]|0;u=o[d>>2]|0}}}while(0);o[_>>2]=Bw(a)|0;o[y>>2]=Ka(l)|0;Uw(n,e,_,y,m,g);jw(g);zw(m)}t=o[t>>2]|0}while((t|0)!=0)}h=b;return}function Mw(e){e=e|0;return o[e+12>>2]|0}function Iw(e){e=e|0;return o[e+12>>2]|0}function Rw(e){e=e|0;return o[e+16>>2]|0}function Nw(e,t){e=e|0;t=t|0;var n=0,r=0,i=0;i=h;h=h+32|0;n=i;r=o[e>>2]|0;if((o[e+8>>2]|0)-r>>2>>>0>>0){bE(n,t,(o[e+4>>2]|0)-r>>2,e+8|0);wE(e,n);EE(n)}h=i;return}function Pw(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0;a=h;h=h+32|0;n=a;r=e+4|0;i=((o[r>>2]|0)-(o[e>>2]|0)>>2)+1|0;u=mE(e)|0;if(u>>>0>>0)jT(e);else{l=o[e>>2]|0;c=(o[e+8>>2]|0)-l|0;s=c>>1;bE(n,c>>2>>>0>>1>>>0?s>>>0>>0?i:s:u,(o[r>>2]|0)-l>>2,e+8|0);u=n+8|0;o[o[u>>2]>>2]=o[t>>2];o[u>>2]=(o[u>>2]|0)+4;wE(e,n);EE(n);h=a;return}}function Fw(e){e=e|0;return o[e+8>>2]|0}function Lw(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0;a=h;h=h+32|0;n=a;r=e+4|0;i=((o[r>>2]|0)-(o[e>>2]|0)>>2)+1|0;u=pE(e)|0;if(u>>>0>>0)jT(e);else{l=o[e>>2]|0;c=(o[e+8>>2]|0)-l|0;s=c>>1;gE(n,c>>2>>>0>>1>>>0?s>>>0>>0?i:s:u,(o[r>>2]|0)-l>>2,e+8|0);u=n+8|0;o[o[u>>2]>>2]=o[t>>2];o[u>>2]=(o[u>>2]|0)+4;_E(e,n);yE(n);h=a;return}}function Bw(e){e=e|0;return o[e>>2]|0}function Uw(e,t,n,r,i,o){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;o=o|0;Ww(e,t,n,r,i,o);return}function jw(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-4-r|0)>>>2)<<2);XT(n)}return}function zw(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-4-r|0)>>>2)<<2);XT(n)}return}function Ww(e,t,n,r,i,u){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;u=u|0;var a=0,l=0,s=0,c=0,f=0,d=0;a=h;h=h+48|0;f=a+40|0;l=a+32|0;d=a+24|0;s=a+12|0;c=a;DS(l);e=Eu(e)|0;o[d>>2]=o[t>>2];n=o[n>>2]|0;r=o[r>>2]|0;Hw(s,i);Vw(c,u);o[f>>2]=o[d>>2];$w(e,f,n,r,s,c);jw(c);zw(s);kS(l);h=a;return}function Hw(e,t){e=e|0;t=t|0;var n=0,r=0;o[e>>2]=0;o[e+4>>2]=0;o[e+8>>2]=0;n=t+4|0;r=(o[n>>2]|0)-(o[t>>2]|0)>>2;if(r|0){hE(e,r);vE(e,o[t>>2]|0,o[n>>2]|0,r)}return}function Vw(e,t){e=e|0;t=t|0;var n=0,r=0;o[e>>2]=0;o[e+4>>2]=0;o[e+8>>2]=0;n=t+4|0;r=(o[n>>2]|0)-(o[t>>2]|0)>>2;if(r|0){fE(e,r);dE(e,o[t>>2]|0,o[n>>2]|0,r)}return}function $w(e,t,n,r,i,u){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;u=u|0;var a=0,l=0,s=0,c=0,f=0,d=0;a=h;h=h+32|0;f=a+28|0;d=a+24|0;l=a+12|0;s=a;c=ku(Gw()|0)|0;o[d>>2]=o[t>>2];o[f>>2]=o[d>>2];t=qw(f)|0;n=Yw(n)|0;r=Xw(r)|0;o[l>>2]=o[i>>2];f=i+4|0;o[l+4>>2]=o[f>>2];d=i+8|0;o[l+8>>2]=o[d>>2];o[d>>2]=0;o[f>>2]=0;o[i>>2]=0;i=Kw(l)|0;o[s>>2]=o[u>>2];f=u+4|0;o[s+4>>2]=o[f>>2];d=u+8|0;o[s+8>>2]=o[d>>2];o[d>>2]=0;o[f>>2]=0;o[u>>2]=0;Oe(0,c|0,e|0,t|0,n|0,r|0,i|0,Jw(s)|0)|0;jw(s);zw(l);h=a;return}function Gw(){var e=0;if(!(r[7968]|0)){sE(10708);e=7968;o[e>>2]=1;o[e+4>>2]=0}return 10708}function qw(e){e=e|0;return tE(e)|0}function Yw(e){e=e|0;return Zw(e)|0}function Xw(e){e=e|0;return Qc(e)|0}function Kw(e){e=e|0;return eE(e)|0}function Jw(e){e=e|0;return Qw(e)|0}function Qw(e){e=e|0;var t=0,n=0,r=0;r=(o[e+4>>2]|0)-(o[e>>2]|0)|0;n=r>>2;r=jD(r+4|0)|0;o[r>>2]=n;if(n|0){t=0;do{o[r+4+(t<<2)>>2]=Zw(o[(o[e>>2]|0)+(t<<2)>>2]|0)|0;t=t+1|0}while((t|0)!=(n|0))}return r|0}function Zw(e){e=e|0;return e|0}function eE(e){e=e|0;var t=0,n=0,r=0;r=(o[e+4>>2]|0)-(o[e>>2]|0)|0;n=r>>2;r=jD(r+4|0)|0;o[r>>2]=n;if(n|0){t=0;do{o[r+4+(t<<2)>>2]=tE((o[e>>2]|0)+(t<<2)|0)|0;t=t+1|0}while((t|0)!=(n|0))}return r|0}function tE(e){e=e|0;var t=0,n=0,r=0,i=0;i=h;h=h+32|0;t=i+12|0;n=i;r=al(nE()|0)|0;if(!r)e=rE(e)|0;else{ll(t,r);sl(n,t);bS(e,n);e=fl(t)|0}h=i;return e|0}function nE(){var e=0;if(!(r[7960]|0)){lE(10664);Fe(25,10664,g|0)|0;e=7960;o[e>>2]=1;o[e+4>>2]=0}return 10664}function rE(e){e=e|0;var t=0,n=0,r=0,i=0,u=0,a=0,l=0;n=h;h=h+16|0;i=n+4|0;a=n;r=jD(8)|0;t=r;l=qT(4)|0;o[l>>2]=o[e>>2];u=t+4|0;o[u>>2]=l;e=qT(8)|0;u=o[u>>2]|0;o[a>>2]=0;o[i>>2]=o[a>>2];iE(e,u,i);o[r>>2]=e;h=n;return t|0}function iE(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;n=qT(16)|0;o[n+4>>2]=0;o[n+8>>2]=0;o[n>>2]=1656;o[n+12>>2]=t;o[e+4>>2]=n;return}function oE(e){e=e|0;zT(e);XT(e);return}function uE(e){e=e|0;e=o[e+12>>2]|0;if(e|0)XT(e);return}function aE(e){e=e|0;XT(e);return}function lE(e){e=e|0;Al(e);return}function sE(e){e=e|0;Lu(e,cE()|0,5);return}function cE(){return 1676}function fE(e,t){e=e|0;t=t|0;var n=0;if((pE(e)|0)>>>0>>0)jT(e);if(t>>>0>1073741823)Ye();else{n=qT(t<<2)|0;o[e+4>>2]=n;o[e>>2]=n;o[e+8>>2]=n+(t<<2);return}}function dE(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;r=e+4|0;e=n-t|0;if((e|0)>0){ix(o[r>>2]|0,t|0,e|0)|0;o[r>>2]=(o[r>>2]|0)+(e>>>2<<2)}return}function pE(e){e=e|0;return 1073741823}function hE(e,t){e=e|0;t=t|0;var n=0;if((mE(e)|0)>>>0>>0)jT(e);if(t>>>0>1073741823)Ye();else{n=qT(t<<2)|0;o[e+4>>2]=n;o[e>>2]=n;o[e+8>>2]=n+(t<<2);return}}function vE(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;r=e+4|0;e=n-t|0;if((e|0)>0){ix(o[r>>2]|0,t|0,e|0)|0;o[r>>2]=(o[r>>2]|0)+(e>>>2<<2)}return}function mE(e){e=e|0;return 1073741823}function gE(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>1073741823)Ye();else{i=qT(t<<2)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<2)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<2);return}function _E(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>2)<<2)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function yE(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-4-t|0)>>>2)<<2);e=o[e>>2]|0;if(e|0)XT(e);return}function bE(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>1073741823)Ye();else{i=qT(t<<2)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<2)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<2);return}function wE(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>2)<<2)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function EE(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-4-t|0)>>>2)<<2);e=o[e>>2]|0;if(e|0)XT(e);return}function DE(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;var u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,v=0,m=0,g=0;g=h;h=h+32|0;f=g+20|0;d=g+12|0;c=g+16|0;p=g+4|0;v=g;m=g+8|0;l=kw()|0;u=o[l>>2]|0;a=o[u>>2]|0;if(a|0){s=o[l+8>>2]|0;l=o[l+4>>2]|0;while(1){gS(f,a);CE(e,f,l,s);u=u+4|0;a=o[u>>2]|0;if(!a)break;else{s=s+1|0;l=l+1|0}}}u=Tw()|0;a=o[u>>2]|0;if(a|0)do{gS(f,a);o[d>>2]=o[u+4>>2];kE(t,f,d);u=u+8|0;a=o[u>>2]|0}while((a|0)!=0);u=o[(fw()|0)>>2]|0;if(u|0)do{t=o[u+4>>2]|0;gS(f,o[(SE(t)|0)>>2]|0);o[d>>2]=Ew(t)|0;TE(n,f,d);u=o[u>>2]|0}while((u|0)!=0);gS(c,0);u=Cw()|0;o[f>>2]=o[c>>2];Ow(f,u,i);u=o[(fw()|0)>>2]|0;if(u|0){e=f+4|0;t=f+8|0;n=f+8|0;do{s=o[u+4>>2]|0;gS(d,o[(SE(s)|0)>>2]|0);AE(p,xE(s)|0);a=o[p>>2]|0;if(a|0){o[f>>2]=0;o[e>>2]=0;o[t>>2]=0;do{gS(v,o[(SE(o[a+4>>2]|0)|0)>>2]|0);l=o[e>>2]|0;if(l>>>0<(o[n>>2]|0)>>>0){o[l>>2]=o[v>>2];o[e>>2]=(o[e>>2]|0)+4}else Pw(f,v);a=o[a>>2]|0}while((a|0)!=0);OE(r,d,f);zw(f)}o[m>>2]=o[d>>2];c=ME(s)|0;o[f>>2]=o[m>>2];Ow(f,c,i);Sl(p);u=o[u>>2]|0}while((u|0)!=0)}h=g;return}function CE(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;$E(e,t,n,r);return}function kE(e,t,n){e=e|0;t=t|0;n=n|0;VE(e,t,n);return}function SE(e){e=e|0;return e|0}function TE(e,t,n){e=e|0;t=t|0;n=n|0;UE(e,t,n);return}function xE(e){e=e|0;return e+16|0}function AE(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;u=h;h=h+16|0;i=u+8|0;n=u;o[e>>2]=0;r=o[t>>2]|0;o[i>>2]=r;o[n>>2]=e;n=LE(n)|0;if(r|0){r=qT(12)|0;a=(BE(i)|0)+4|0;e=o[a+4>>2]|0;t=r+4|0;o[t>>2]=o[a>>2];o[t+4>>2]=e;t=o[o[i>>2]>>2]|0;o[i>>2]=t;if(!t)e=r;else{t=r;while(1){e=qT(12)|0;s=(BE(i)|0)+4|0;l=o[s+4>>2]|0;a=e+4|0;o[a>>2]=o[s>>2];o[a+4>>2]=l;o[t>>2]=e;a=o[o[i>>2]>>2]|0;o[i>>2]=a;if(!a)break;else t=e}}o[e>>2]=o[n>>2];o[n>>2]=r}h=u;return}function OE(e,t,n){e=e|0;t=t|0;n=n|0;IE(e,t,n);return}function ME(e){e=e|0;return e+24|0}function IE(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+32|0;a=r+24|0;i=r+16|0;l=r+12|0;u=r;DS(i);e=Eu(e)|0;o[l>>2]=o[t>>2];Hw(u,n);o[a>>2]=o[l>>2];RE(e,a,u);zw(u);kS(i);h=r;return}function RE(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0;r=h;h=h+32|0;a=r+16|0;l=r+12|0;i=r;u=ku(NE()|0)|0;o[l>>2]=o[t>>2];o[a>>2]=o[l>>2];t=qw(a)|0;o[i>>2]=o[n>>2];a=n+4|0;o[i+4>>2]=o[a>>2];l=n+8|0;o[i+8>>2]=o[l>>2];o[l>>2]=0;o[a>>2]=0;o[n>>2]=0;Se(0,u|0,e|0,t|0,Kw(i)|0)|0;zw(i);h=r;return}function NE(){var e=0;if(!(r[7976]|0)){PE(10720);e=7976;o[e>>2]=1;o[e+4>>2]=0}return 10720}function PE(e){e=e|0;Lu(e,FE()|0,2);return}function FE(){return 1732}function LE(e){e=e|0;return o[e>>2]|0}function BE(e){e=e|0;return o[e>>2]|0}function UE(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+32|0;u=r+16|0;i=r+8|0;a=r;DS(i);e=Eu(e)|0;o[a>>2]=o[t>>2];n=o[n>>2]|0;o[u>>2]=o[a>>2];jE(e,u,n);kS(i);h=r;return}function jE(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+16|0;u=r+4|0;a=r;i=ku(zE()|0)|0;o[a>>2]=o[t>>2];o[u>>2]=o[a>>2];t=qw(u)|0;Se(0,i|0,e|0,t|0,Yw(n)|0)|0;h=r;return}function zE(){var e=0;if(!(r[7984]|0)){WE(10732);e=7984;o[e>>2]=1;o[e+4>>2]=0}return 10732}function WE(e){e=e|0;Lu(e,HE()|0,2);return}function HE(){return 1744}function VE(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0;r=h;h=h+32|0;u=r+16|0;i=r+8|0;a=r;DS(i);e=Eu(e)|0;o[a>>2]=o[t>>2];n=o[n>>2]|0;o[u>>2]=o[a>>2];jE(e,u,n);kS(i);h=r;return}function $E(e,t,n,i){e=e|0;t=t|0;n=n|0;i=i|0;var u=0,a=0,l=0,s=0;u=h;h=h+32|0;l=u+16|0;a=u+8|0;s=u;DS(a);e=Eu(e)|0;o[s>>2]=o[t>>2];n=r[n>>0]|0;i=r[i>>0]|0;o[l>>2]=o[s>>2];GE(e,l,n,i);kS(a);h=u;return}function GE(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0;i=h;h=h+16|0;a=i+4|0;l=i;u=ku(qE()|0)|0;o[l>>2]=o[t>>2];o[a>>2]=o[l>>2];t=qw(a)|0;n=YE(n)|0;nt(0,u|0,e|0,t|0,n|0,YE(r)|0)|0;h=i;return}function qE(){var e=0;if(!(r[7992]|0)){KE(10744);e=7992;o[e>>2]=1;o[e+4>>2]=0}return 10744}function YE(e){e=e|0;return XE(e)|0}function XE(e){e=e|0;return e&255|0}function KE(e){e=e|0;Lu(e,JE()|0,3);return}function JE(){return 1756}function QE(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,v=0;v=h;h=h+32|0;s=v+8|0;c=v+4|0;f=v+20|0;d=v;Vs(e,0);i=yS(t)|0;o[s>>2]=0;p=s+4|0;o[p>>2]=0;o[s+8>>2]=0;switch(i<<24>>24){case 0:{r[f>>0]=0;ZE(c,n,f);eD(e,c)|0;Zi(c);break}case 8:{p=_S(t)|0;r[f>>0]=8;gS(d,o[p+4>>2]|0);tD(c,n,f,d,p+8|0);eD(e,c)|0;Zi(c);break}case 9:{a=_S(t)|0;t=o[a+4>>2]|0;if(t|0){l=s+8|0;u=a+12|0;while(1){t=t+-1|0;gS(c,o[u>>2]|0);i=o[p>>2]|0;if(i>>>0<(o[l>>2]|0)>>>0){o[i>>2]=o[c>>2];o[p>>2]=(o[p>>2]|0)+4}else Pw(s,c);if(!t)break;else u=u+4|0}}r[f>>0]=9;gS(d,o[a+8>>2]|0);nD(c,n,f,d,s);eD(e,c)|0;Zi(c);break}default:{p=_S(t)|0;r[f>>0]=i;gS(d,o[p+4>>2]|0);rD(c,n,f,d);eD(e,c)|0;Zi(c)}}zw(s);h=v;return}function ZE(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,o=0;i=h;h=h+16|0;o=i;DS(o);t=Eu(t)|0;gD(e,t,r[n>>0]|0);kS(o);h=i;return}function eD(e,t){e=e|0;t=t|0;var n=0;n=o[e>>2]|0;if(n|0)rt(n|0);o[e>>2]=o[t>>2];o[t>>2]=0;return e|0}function tD(e,t,n,i,u){e=e|0;t=t|0;n=n|0;i=i|0;u=u|0;var a=0,l=0,s=0,c=0;a=h;h=h+32|0;s=a+16|0;l=a+8|0;c=a;DS(l);t=Eu(t)|0;n=r[n>>0]|0;o[c>>2]=o[i>>2];u=o[u>>2]|0;o[s>>2]=o[c>>2];pD(e,t,n,s,u);kS(l);h=a;return}function nD(e,t,n,i,u){e=e|0;t=t|0;n=n|0;i=i|0;u=u|0;var a=0,l=0,s=0,c=0,f=0;a=h;h=h+32|0;c=a+24|0;l=a+16|0;f=a+12|0;s=a;DS(l);t=Eu(t)|0;n=r[n>>0]|0;o[f>>2]=o[i>>2];Hw(s,u);o[c>>2]=o[f>>2];sD(e,t,n,c,s);zw(s);kS(l);h=a;return}function rD(e,t,n,i){e=e|0;t=t|0;n=n|0;i=i|0;var u=0,a=0,l=0,s=0;u=h;h=h+32|0;l=u+16|0;a=u+8|0;s=u;DS(a);t=Eu(t)|0;n=r[n>>0]|0;o[s>>2]=o[i>>2];o[l>>2]=o[s>>2];iD(e,t,n,l);kS(a);h=u;return}function iD(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0,a=0,l=0;i=h;h=h+16|0;u=i+4|0;l=i;a=ku(oD()|0)|0;n=YE(n)|0;o[l>>2]=o[r>>2];o[u>>2]=o[l>>2];uD(e,Se(0,a|0,t|0,n|0,qw(u)|0)|0);h=i;return}function oD(){var e=0;if(!(r[8e3]|0)){aD(10756);e=8e3;o[e>>2]=1;o[e+4>>2]=0}return 10756}function uD(e,t){e=e|0;t=t|0;Vs(e,t);return}function aD(e){e=e|0;Lu(e,lD()|0,2);return}function lD(){return 1772}function sD(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;var u=0,a=0,l=0,s=0,c=0;u=h;h=h+32|0;s=u+16|0;c=u+12|0;a=u;l=ku(cD()|0)|0;n=YE(n)|0;o[c>>2]=o[r>>2];o[s>>2]=o[c>>2];r=qw(s)|0;o[a>>2]=o[i>>2];s=i+4|0;o[a+4>>2]=o[s>>2];c=i+8|0;o[a+8>>2]=o[c>>2];o[c>>2]=0;o[s>>2]=0;o[i>>2]=0;uD(e,nt(0,l|0,t|0,n|0,r|0,Kw(a)|0)|0);zw(a);h=u;return}function cD(){var e=0;if(!(r[8008]|0)){fD(10768);e=8008;o[e>>2]=1;o[e+4>>2]=0}return 10768}function fD(e){e=e|0;Lu(e,dD()|0,3);return}function dD(){return 1784}function pD(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;var u=0,a=0,l=0,s=0;u=h;h=h+16|0;l=u+4|0;s=u;a=ku(hD()|0)|0;n=YE(n)|0;o[s>>2]=o[r>>2];o[l>>2]=o[s>>2];r=qw(l)|0;uD(e,nt(0,a|0,t|0,n|0,r|0,Xw(i)|0)|0);h=u;return}function hD(){var e=0;if(!(r[8016]|0)){vD(10780);e=8016;o[e>>2]=1;o[e+4>>2]=0}return 10780}function vD(e){e=e|0;Lu(e,mD()|0,3);return}function mD(){return 1800}function gD(e,t,n){e=e|0;t=t|0;n=n|0;var r=0;r=ku(_D()|0)|0;uD(e,it(0,r|0,t|0,YE(n)|0)|0);return}function _D(){var e=0;if(!(r[8024]|0)){yD(10792);e=8024;o[e>>2]=1;o[e+4>>2]=0}return 10792}function yD(e){e=e|0;Lu(e,bD()|0,1);return}function bD(){return 1816}function wD(){ED();DD();CD();return}function ED(){o[2702]=YT(65536)|0;return}function DD(){qD(10856);return}function CD(){kD(10816);return}function kD(e){e=e|0;SD(e,5044);TD(e)|0;return}function SD(e,t){e=e|0;t=t|0;var n=0;n=nE()|0;o[e>>2]=n;zD(n,t);cw(o[e>>2]|0);return}function TD(e){e=e|0;var t=0;t=o[e>>2]|0;ry(t,xD()|0);return e|0}function xD(){var e=0;if(!(r[8032]|0)){AD(10820);Fe(64,10820,g|0)|0;e=8032;o[e>>2]=1;o[e+4>>2]=0}if(!(Ka(10820)|0))AD(10820);return 10820}function AD(e){e=e|0;ID(e);sy(e,25);return}function OD(e){e=e|0;MD(e+24|0);return}function MD(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);XT(n)}return}function ID(e){e=e|0;var t=0;t=Za()|0;nl(e,5,18,t,LD()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function RD(e,t){e=e|0;t=t|0;ND(e,t);return}function ND(e,t){e=e|0;t=t|0;var n=0,r=0,i=0;n=h;h=h+16|0;r=n;i=n+4|0;cc(i,t);o[r>>2]=fc(i,t)|0;PD(e,r);h=n;return}function PD(e,t){e=e|0;t=t|0;FD(e+4|0,o[t>>2]|0);r[e+8>>0]=1;return}function FD(e,t){e=e|0;t=t|0;o[e>>2]=t;return}function LD(){return 1824}function BD(e){e=e|0;return UD(e)|0}function UD(e){e=e|0;var t=0,n=0,r=0,i=0,u=0,a=0,l=0;n=h;h=h+16|0;i=n+4|0;a=n;r=jD(8)|0;t=r;l=qT(4)|0;cc(i,e);FD(l,fc(i,e)|0);u=t+4|0;o[u>>2]=l;e=qT(8)|0;u=o[u>>2]|0;o[a>>2]=0;o[i>>2]=o[a>>2];iE(e,u,i);o[r>>2]=e;h=n;return t|0}function jD(e){e=e|0;var t=0,n=0;e=e+7&-8;if(e>>>0<=32768?(t=o[2701]|0,e>>>0<=(65536-t|0)>>>0):0){n=(o[2702]|0)+t|0;o[2701]=t+e;e=n}else{e=YT(e+8|0)|0;o[e>>2]=o[2703];o[2703]=e;e=e+8|0}return e|0}function zD(e,t){e=e|0;t=t|0;o[e>>2]=WD()|0;o[e+4>>2]=HD()|0;o[e+12>>2]=t;o[e+8>>2]=VD()|0;o[e+32>>2]=9;return}function WD(){return 11744}function HD(){return 1832}function VD(){return Ry()|0}function $D(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;if((jm(r,896)|0)==512){if(n|0){GD(n);XT(n)}}else if(t|0)XT(t);return}function GD(e){e=e|0;e=o[e+4>>2]|0;if(e|0)$T(e);return}function qD(e){e=e|0;YD(e,5052);XD(e)|0;KD(e,5058,26)|0;JD(e,5069,1)|0;QD(e,5077,10)|0;ZD(e,5087,19)|0;tC(e,5094,27)|0;return}function YD(e,t){e=e|0;t=t|0;var n=0;n=sS()|0;o[e>>2]=n;cS(n,t);cw(o[e>>2]|0);return}function XD(e){e=e|0;var t=0;t=o[e>>2]|0;ry(t,Yk()|0);return e|0}function KD(e,t,n){e=e|0;t=t|0;n=n|0;Tk(e,Ia(t)|0,n,0);return e|0}function JD(e,t,n){e=e|0;t=t|0;n=n|0;sk(e,Ia(t)|0,n,0);return e|0}function QD(e,t,n){e=e|0;t=t|0;n=n|0;BC(e,Ia(t)|0,n,0);return e|0}function ZD(e,t,n){e=e|0;t=t|0;n=n|0;bC(e,Ia(t)|0,n,0);return e|0}function eC(e,t){e=e|0;t=t|0;var n=0,r=0;e:while(1){n=o[2703]|0;while(1){if((n|0)==(t|0))break e;r=o[n>>2]|0;o[2703]=r;if(!n)n=r;else break}XT(n)}o[2701]=e;return}function tC(e,t,n){e=e|0;t=t|0;n=n|0;nC(e,Ia(t)|0,n,0);return e|0}function nC(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0;u=o[e>>2]|0;i=rC()|0;e=iC(n)|0;La(u,t,i,e,oC(n,r)|0,r);return}function rC(){var e=0,t=0;if(!(r[8040]|0)){dC(10860);Fe(65,10860,g|0)|0;t=8040;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(10860)|0)){e=10860;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));dC(10860)}return 10860}function iC(e){e=e|0;return e|0}function oC(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;u=l+4|0;o[i>>2]=e;s=rC()|0;a=s+24|0;t=za(t,4)|0;o[u>>2]=t;n=s+28|0;r=o[n>>2]|0;if(r>>>0<(o[s+32>>2]|0)>>>0){uC(r,e,t);t=(o[n>>2]|0)+8|0;o[n>>2]=t}else{aC(a,i,u);t=o[n>>2]|0}h=l;return(t-(o[a>>2]|0)>>3)+-1|0}function uC(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;o[e+4>>2]=n;return}function aC(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;u=e+4|0;a=((o[u>>2]|0)-(o[e>>2]|0)>>3)+1|0;r=lC(e)|0;if(r>>>0>>0)jT(e);else{s=o[e>>2]|0;f=(o[e+8>>2]|0)-s|0;c=f>>2;sC(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(o[u>>2]|0)-s>>3,e+8|0);a=i+8|0;uC(o[a>>2]|0,o[t>>2]|0,o[n>>2]|0);o[a>>2]=(o[a>>2]|0)+8;cC(e,i);fC(i);h=l;return}}function lC(e){e=e|0;return 536870911}function sC(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>536870911)Ye();else{i=qT(t<<3)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<3)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<3);return}function cC(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>3)<<3)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function fC(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=o[e>>2]|0;if(e|0)XT(e);return}function dC(e){e=e|0;vC(e);return}function pC(e){e=e|0;hC(e+24|0);return}function hC(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);XT(n)}return}function vC(e){e=e|0;var t=0;t=Za()|0;nl(e,1,11,t,mC()|0,2);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function mC(){return 1840}function gC(e,t,n){e=e|0;t=t|0;n=n|0;yC(o[(_C(e)|0)>>2]|0,t,n);return}function _C(e){e=e|0;return(o[(rC()|0)+24>>2]|0)+(e<<3)|0}function yC(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0;r=h;h=h+16|0;o=r+1|0;i=r;cc(o,t);t=fc(o,t)|0;cc(i,n);n=fc(i,n)|0;vA[e&31](t,n);h=r;return}function bC(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0;u=o[e>>2]|0;i=wC()|0;e=EC(n)|0;La(u,t,i,e,DC(n,r)|0,r);return}function wC(){var e=0,t=0;if(!(r[8048]|0)){OC(10896);Fe(66,10896,g|0)|0;t=8048;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(10896)|0)){e=10896;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));OC(10896)}return 10896}function EC(e){e=e|0;return e|0}function DC(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;u=l+4|0;o[i>>2]=e;s=wC()|0;a=s+24|0;t=za(t,4)|0;o[u>>2]=t;n=s+28|0;r=o[n>>2]|0;if(r>>>0<(o[s+32>>2]|0)>>>0){CC(r,e,t);t=(o[n>>2]|0)+8|0;o[n>>2]=t}else{kC(a,i,u);t=o[n>>2]|0}h=l;return(t-(o[a>>2]|0)>>3)+-1|0}function CC(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;o[e+4>>2]=n;return}function kC(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;u=e+4|0;a=((o[u>>2]|0)-(o[e>>2]|0)>>3)+1|0;r=SC(e)|0;if(r>>>0>>0)jT(e);else{s=o[e>>2]|0;f=(o[e+8>>2]|0)-s|0;c=f>>2;TC(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(o[u>>2]|0)-s>>3,e+8|0);a=i+8|0;CC(o[a>>2]|0,o[t>>2]|0,o[n>>2]|0);o[a>>2]=(o[a>>2]|0)+8;xC(e,i);AC(i);h=l;return}}function SC(e){e=e|0;return 536870911}function TC(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>536870911)Ye();else{i=qT(t<<3)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<3)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<3);return}function xC(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>3)<<3)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function AC(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=o[e>>2]|0;if(e|0)XT(e);return}function OC(e){e=e|0;RC(e);return}function MC(e){e=e|0;IC(e+24|0);return}function IC(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);XT(n)}return}function RC(e){e=e|0;var t=0;t=Za()|0;nl(e,1,11,t,NC()|0,1);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function NC(){return 1852}function PC(e,t){e=e|0;t=t|0;return LC(o[(FC(e)|0)>>2]|0,t)|0}function FC(e){e=e|0;return(o[(wC()|0)+24>>2]|0)+(e<<3)|0}function LC(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;cc(r,t);t=fc(r,t)|0;t=Qc(mA[e&31](t)|0)|0;h=n;return t|0}function BC(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0;u=o[e>>2]|0;i=UC()|0;e=jC(n)|0;La(u,t,i,e,zC(n,r)|0,r);return}function UC(){var e=0,t=0;if(!(r[8056]|0)){YC(10932);Fe(67,10932,g|0)|0;t=8056;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(10932)|0)){e=10932;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));YC(10932)}return 10932}function jC(e){e=e|0;return e|0}function zC(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;u=l+4|0;o[i>>2]=e;s=UC()|0;a=s+24|0;t=za(t,4)|0;o[u>>2]=t;n=s+28|0;r=o[n>>2]|0;if(r>>>0<(o[s+32>>2]|0)>>>0){WC(r,e,t);t=(o[n>>2]|0)+8|0;o[n>>2]=t}else{HC(a,i,u);t=o[n>>2]|0}h=l;return(t-(o[a>>2]|0)>>3)+-1|0}function WC(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;o[e+4>>2]=n;return}function HC(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;u=e+4|0;a=((o[u>>2]|0)-(o[e>>2]|0)>>3)+1|0;r=VC(e)|0;if(r>>>0>>0)jT(e);else{s=o[e>>2]|0;f=(o[e+8>>2]|0)-s|0;c=f>>2;$C(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(o[u>>2]|0)-s>>3,e+8|0);a=i+8|0;WC(o[a>>2]|0,o[t>>2]|0,o[n>>2]|0);o[a>>2]=(o[a>>2]|0)+8;GC(e,i);qC(i);h=l;return}}function VC(e){e=e|0;return 536870911}function $C(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>536870911)Ye();else{i=qT(t<<3)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<3)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<3);return}function GC(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>3)<<3)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function qC(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=o[e>>2]|0;if(e|0)XT(e);return}function YC(e){e=e|0;JC(e);return}function XC(e){e=e|0;KC(e+24|0);return}function KC(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);XT(n)}return}function JC(e){e=e|0;var t=0;t=Za()|0;nl(e,1,7,t,QC()|0,2);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function QC(){return 1860}function ZC(e,t,n){e=e|0;t=t|0;n=n|0;return tk(o[(ek(e)|0)>>2]|0,t,n)|0}function ek(e){e=e|0;return(o[(UC()|0)+24>>2]|0)+(e<<3)|0}function tk(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0;r=h;h=h+32|0;a=r+12|0;u=r+8|0;l=r;s=r+16|0;i=r+4|0;nk(s,t);rk(l,s,t);js(i,n);n=zs(i,n)|0;o[a>>2]=o[l>>2];MA[e&15](u,a,n);n=ik(u)|0;Zi(u);Ws(i);h=r;return n|0}function nk(e,t){e=e|0;t=t|0;return}function rk(e,t,n){e=e|0;t=t|0;n=n|0;ok(e,n);return}function ik(e){e=e|0;return Eu(e)|0}function ok(e,t){e=e|0;t=t|0;var n=0,r=0,i=0;i=h;h=h+16|0;n=i;r=t;if(!(r&1))o[e>>2]=o[t>>2];else{uk(n,0);Be(r|0,n|0)|0;ak(e,n);lk(n)}h=i;return}function uk(e,t){e=e|0;t=t|0;Iu(e,t);o[e+4>>2]=0;r[e+8>>0]=0;return}function ak(e,t){e=e|0;t=t|0;o[e>>2]=o[t+4>>2];return}function lk(e){e=e|0;r[e+8>>0]=0;return}function sk(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0;u=o[e>>2]|0;i=ck()|0;e=fk(n)|0;La(u,t,i,e,dk(n,r)|0,r);return}function ck(){var e=0,t=0;if(!(r[8064]|0)){yk(10968);Fe(68,10968,g|0)|0;t=8064;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(10968)|0)){e=10968;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));yk(10968)}return 10968}function fk(e){e=e|0;return e|0}function dk(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;u=l+4|0;o[i>>2]=e;s=ck()|0;a=s+24|0;t=za(t,4)|0;o[u>>2]=t;n=s+28|0;r=o[n>>2]|0;if(r>>>0<(o[s+32>>2]|0)>>>0){pk(r,e,t);t=(o[n>>2]|0)+8|0;o[n>>2]=t}else{hk(a,i,u);t=o[n>>2]|0}h=l;return(t-(o[a>>2]|0)>>3)+-1|0}function pk(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;o[e+4>>2]=n;return}function hk(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;u=e+4|0;a=((o[u>>2]|0)-(o[e>>2]|0)>>3)+1|0;r=vk(e)|0;if(r>>>0>>0)jT(e);else{s=o[e>>2]|0;f=(o[e+8>>2]|0)-s|0;c=f>>2;mk(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(o[u>>2]|0)-s>>3,e+8|0);a=i+8|0;pk(o[a>>2]|0,o[t>>2]|0,o[n>>2]|0);o[a>>2]=(o[a>>2]|0)+8;gk(e,i);_k(i);h=l;return}}function vk(e){e=e|0;return 536870911}function mk(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>536870911)Ye();else{i=qT(t<<3)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<3)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<3);return}function gk(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>3)<<3)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function _k(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=o[e>>2]|0;if(e|0)XT(e);return}function yk(e){e=e|0;Ek(e);return}function bk(e){e=e|0;wk(e+24|0);return}function wk(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);XT(n)}return}function Ek(e){e=e|0;var t=0;t=Za()|0;nl(e,1,1,t,Dk()|0,5);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Dk(){return 1872}function Ck(e,t,n,r,i,u){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;u=u|0;Sk(o[(kk(e)|0)>>2]|0,t,n,r,i,u);return}function kk(e){e=e|0;return(o[(ck()|0)+24>>2]|0)+(e<<3)|0}function Sk(e,t,n,r,i,o){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;o=o|0;var u=0,a=0,l=0,s=0,c=0,f=0;u=h;h=h+32|0;a=u+16|0;l=u+12|0;s=u+8|0;c=u+4|0;f=u;js(a,t);t=zs(a,t)|0;js(l,n);n=zs(l,n)|0;js(s,r);r=zs(s,r)|0;js(c,i);i=zs(c,i)|0;js(f,o);o=zs(f,o)|0;cA[e&1](t,n,r,i,o);Ws(f);Ws(c);Ws(s);Ws(l);Ws(a);h=u;return}function Tk(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0,u=0;u=o[e>>2]|0;i=xk()|0;e=Ak(n)|0;La(u,t,i,e,Ok(n,r)|0,r);return}function xk(){var e=0,t=0;if(!(r[8072]|0)){Lk(11004);Fe(69,11004,g|0)|0;t=8072;o[t>>2]=1;o[t+4>>2]=0}if(!(Ka(11004)|0)){e=11004;t=e+36|0;do{o[e>>2]=0;e=e+4|0}while((e|0)<(t|0));Lk(11004)}return 11004}function Ak(e){e=e|0;return e|0}function Ok(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0,l=0,s=0;l=h;h=h+16|0;i=l;u=l+4|0;o[i>>2]=e;s=xk()|0;a=s+24|0;t=za(t,4)|0;o[u>>2]=t;n=s+28|0;r=o[n>>2]|0;if(r>>>0<(o[s+32>>2]|0)>>>0){Mk(r,e,t);t=(o[n>>2]|0)+8|0;o[n>>2]=t}else{Ik(a,i,u);t=o[n>>2]|0}h=l;return(t-(o[a>>2]|0)>>3)+-1|0}function Mk(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;o[e+4>>2]=n;return}function Ik(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0;l=h;h=h+32|0;i=l;u=e+4|0;a=((o[u>>2]|0)-(o[e>>2]|0)>>3)+1|0;r=Rk(e)|0;if(r>>>0>>0)jT(e);else{s=o[e>>2]|0;f=(o[e+8>>2]|0)-s|0;c=f>>2;Nk(i,f>>3>>>0>>1>>>0?c>>>0>>0?a:c:r,(o[u>>2]|0)-s>>3,e+8|0);a=i+8|0;Mk(o[a>>2]|0,o[t>>2]|0,o[n>>2]|0);o[a>>2]=(o[a>>2]|0)+8;Pk(e,i);Fk(i);h=l;return}}function Rk(e){e=e|0;return 536870911}function Nk(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;var i=0;o[e+12>>2]=0;o[e+16>>2]=r;do{if(t){if(t>>>0>536870911)Ye();else{i=qT(t<<3)|0;break}}else i=0}while(0);o[e>>2]=i;r=i+(n<<3)|0;o[e+8>>2]=r;o[e+4>>2]=r;o[e+12>>2]=i+(t<<3);return}function Pk(e,t){e=e|0;t=t|0;var n=0,r=0,i=0,u=0,a=0;r=o[e>>2]|0;a=e+4|0;u=t+4|0;i=(o[a>>2]|0)-r|0;n=(o[u>>2]|0)+(0-(i>>3)<<3)|0;o[u>>2]=n;if((i|0)>0){ix(n|0,r|0,i|0)|0;r=u;n=o[u>>2]|0}else r=u;u=o[e>>2]|0;o[e>>2]=n;o[r>>2]=u;u=t+8|0;i=o[a>>2]|0;o[a>>2]=o[u>>2];o[u>>2]=i;u=e+8|0;a=t+12|0;e=o[u>>2]|0;o[u>>2]=o[a>>2];o[a>>2]=e;o[t>>2]=o[r>>2];return}function Fk(e){e=e|0;var t=0,n=0,r=0;t=o[e+4>>2]|0;n=e+8|0;r=o[n>>2]|0;if((r|0)!=(t|0))o[n>>2]=r+(~((r+-8-t|0)>>>3)<<3);e=o[e>>2]|0;if(e|0)XT(e);return}function Lk(e){e=e|0;jk(e);return}function Bk(e){e=e|0;Uk(e+24|0);return}function Uk(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);XT(n)}return}function jk(e){e=e|0;var t=0;t=Za()|0;nl(e,1,12,t,zk()|0,2);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function zk(){return 1896}function Wk(e,t,n){e=e|0;t=t|0;n=n|0;Vk(o[(Hk(e)|0)>>2]|0,t,n);return}function Hk(e){e=e|0;return(o[(xk()|0)+24>>2]|0)+(e<<3)|0}function Vk(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,o=0;r=h;h=h+16|0;o=r+4|0;i=r;$k(o,t);t=Gk(o,t)|0;js(i,n);n=zs(i,n)|0;vA[e&31](t,n);Ws(i);h=r;return}function $k(e,t){e=e|0;t=t|0;return}function Gk(e,t){e=e|0;t=t|0;return qk(t)|0}function qk(e){e=e|0;return e|0}function Yk(){var e=0;if(!(r[8080]|0)){Xk(11040);Fe(70,11040,g|0)|0;e=8080;o[e>>2]=1;o[e+4>>2]=0}if(!(Ka(11040)|0))Xk(11040);return 11040}function Xk(e){e=e|0;Qk(e);sy(e,71);return}function Kk(e){e=e|0;Jk(e+24|0);return}function Jk(e){e=e|0;var t=0,n=0,r=0;n=o[e>>2]|0;r=n;if(n|0){e=e+4|0;t=o[e>>2]|0;if((t|0)!=(n|0))o[e>>2]=t+(~((t+-8-r|0)>>>3)<<3);XT(n)}return}function Qk(e){e=e|0;var t=0;t=Za()|0;nl(e,5,7,t,nS()|0,0);o[e+24>>2]=0;o[e+28>>2]=0;o[e+32>>2]=0;return}function Zk(e){e=e|0;eS(e);return}function eS(e){e=e|0;tS(e);return}function tS(e){e=e|0;r[e+8>>0]=1;return}function nS(){return 1936}function rS(){return iS()|0}function iS(){var e=0,t=0,n=0,r=0,i=0,u=0,a=0;t=h;h=h+16|0;i=t+4|0;a=t;n=jD(8)|0;e=n;u=e+4|0;o[u>>2]=qT(1)|0;r=qT(8)|0;u=o[u>>2]|0;o[a>>2]=0;o[i>>2]=o[a>>2];oS(r,u,i);o[n>>2]=r;h=t;return e|0}function oS(e,t,n){e=e|0;t=t|0;n=n|0;o[e>>2]=t;n=qT(16)|0;o[n+4>>2]=0;o[n+8>>2]=0;o[n>>2]=1916;o[n+12>>2]=t;o[e+4>>2]=n;return}function uS(e){e=e|0;zT(e);XT(e);return}function aS(e){e=e|0;e=o[e+12>>2]|0;if(e|0)XT(e);return}function lS(e){e=e|0;XT(e);return}function sS(){var e=0;if(!(r[8088]|0)){mS(11076);Fe(25,11076,g|0)|0;e=8088;o[e>>2]=1;o[e+4>>2]=0}return 11076}function cS(e,t){e=e|0;t=t|0;o[e>>2]=fS()|0;o[e+4>>2]=dS()|0;o[e+12>>2]=t;o[e+8>>2]=pS()|0;o[e+32>>2]=10;return}function fS(){return 11745}function dS(){return 1940}function pS(){return Wm()|0}function hS(e,t,n,r){e=e|0;t=t|0;n=n|0;r=r|0;if((jm(r,896)|0)==512){if(n|0){vS(n);XT(n)}}else if(t|0)XT(t);return}function vS(e){e=e|0;e=o[e+4>>2]|0;if(e|0)$T(e);return}function mS(e){e=e|0;Al(e);return}function gS(e,t){e=e|0;t=t|0;o[e>>2]=t;return}function _S(e){e=e|0;return o[e>>2]|0}function yS(e){e=e|0;return r[o[e>>2]>>0]|0}function bS(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;o[r>>2]=o[e>>2];wS(t,r)|0;h=n;return}function wS(e,t){e=e|0;t=t|0;var n=0;n=ES(o[e>>2]|0,t)|0;t=e+4|0;o[(o[t>>2]|0)+8>>2]=n;return o[(o[t>>2]|0)+8>>2]|0}function ES(e,t){e=e|0;t=t|0;var n=0,r=0;n=h;h=h+16|0;r=n;DS(r);e=Eu(e)|0;t=CS(e,o[t>>2]|0)|0;kS(r);h=n;return t|0}function DS(e){e=e|0;o[e>>2]=o[2701];o[e+4>>2]=o[2703];return}function CS(e,t){e=e|0;t=t|0;var n=0;n=ku(SS()|0)|0;return it(0,n|0,e|0,Xw(t)|0)|0}function kS(e){e=e|0;eC(o[e>>2]|0,o[e+4>>2]|0);return}function SS(){var e=0;if(!(r[8096]|0)){TS(11120);e=8096;o[e>>2]=1;o[e+4>>2]=0}return 11120}function TS(e){e=e|0;Lu(e,xS()|0,1);return}function xS(){return 1948}function AS(){OS();return}function OS(){var e=0,t=0,n=0,i=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,v=0,m=0,g=0,_=0,y=0;_=h;h=h+16|0;p=_+4|0;v=_;Re(65536,10804,o[2702]|0,10812);n=kw()|0;t=o[n>>2]|0;e=o[t>>2]|0;if(e|0){i=o[n+8>>2]|0;n=o[n+4>>2]|0;while(1){ze(e|0,u[n>>0]|0|0,r[i>>0]|0);t=t+4|0;e=o[t>>2]|0;if(!e)break;else{i=i+1|0;n=n+1|0}}}e=Tw()|0;t=o[e>>2]|0;if(t|0)do{We(t|0,o[e+4>>2]|0);e=e+8|0;t=o[e>>2]|0}while((t|0)!=0);We(MS()|0,5167);d=fw()|0;e=o[d>>2]|0;e:do{if(e|0){do{IS(o[e+4>>2]|0);e=o[e>>2]|0}while((e|0)!=0);e=o[d>>2]|0;if(e|0){f=d;do{while(1){a=e;e=o[e>>2]|0;a=o[a+4>>2]|0;if(!(RS(a)|0))break;o[v>>2]=f;o[p>>2]=o[v>>2];NS(d,p)|0;if(!e)break e}PS(a);f=o[f>>2]|0;t=FS(a)|0;l=Ke()|0;s=h;h=h+((1*(t<<2)|0)+15&-16)|0;c=h;h=h+((1*(t<<2)|0)+15&-16)|0;t=o[(xE(a)|0)>>2]|0;if(t|0){n=s;i=c;while(1){o[n>>2]=o[(SE(o[t+4>>2]|0)|0)>>2];o[i>>2]=o[t+8>>2];t=o[t>>2]|0;if(!t)break;else{n=n+4|0;i=i+4|0}}}y=SE(a)|0;t=LS(a)|0;n=FS(a)|0;i=BS(a)|0;Ge(y|0,t|0,s|0,c|0,n|0,i|0,Ew(a)|0);Pe(l|0)}while((e|0)!=0)}}}while(0);e=o[(Cw()|0)>>2]|0;if(e|0)do{y=e+4|0;d=Mw(y)|0;a=Fw(d)|0;l=Iw(d)|0;s=(Rw(d)|0)+1|0;c=US(d)|0;f=jS(y)|0;d=Ka(d)|0;p=Bw(y)|0;v=zS(y)|0;Ve(0,a|0,l|0,s|0,c|0,f|0,d|0,p|0,v|0,WS(y)|0);e=o[e>>2]|0}while((e|0)!=0);e=o[(fw()|0)>>2]|0;e:do{if(e|0){t:while(1){t=o[e+4>>2]|0;if(t|0?(m=o[(SE(t)|0)>>2]|0,g=o[(ME(t)|0)>>2]|0,g|0):0){n=g;do{t=n+4|0;i=Mw(t)|0;n:do{if(i|0)switch(Ka(i)|0){case 0:break t;case 4:case 3:case 2:{c=Fw(i)|0;f=Iw(i)|0;d=(Rw(i)|0)+1|0;p=US(i)|0;v=Ka(i)|0;y=Bw(t)|0;Ve(m|0,c|0,f|0,d|0,p|0,0,v|0,y|0,zS(t)|0,WS(t)|0);break n}case 1:{s=Fw(i)|0;c=Iw(i)|0;f=(Rw(i)|0)+1|0;d=US(i)|0;p=jS(t)|0;v=Ka(i)|0;y=Bw(t)|0;Ve(m|0,s|0,c|0,f|0,d|0,p|0,v|0,y|0,zS(t)|0,WS(t)|0);break n}case 5:{d=Fw(i)|0;p=Iw(i)|0;v=(Rw(i)|0)+1|0;y=US(i)|0;Ve(m|0,d|0,p|0,v|0,y|0,HS(i)|0,Ka(i)|0,0,0,0);break n}default:break n}}while(0);n=o[n>>2]|0}while((n|0)!=0)}e=o[e>>2]|0;if(!e)break e}Ye()}}while(0);qe();h=_;return}function MS(){return 11703}function IS(e){e=e|0;r[e+40>>0]=0;return}function RS(e){e=e|0;return(r[e+40>>0]|0)!=0|0}function NS(e,t){e=e|0;t=t|0;t=VS(t)|0;e=o[t>>2]|0;o[t>>2]=o[e>>2];XT(e);return o[t>>2]|0}function PS(e){e=e|0;r[e+40>>0]=1;return}function FS(e){e=e|0;return o[e+20>>2]|0}function LS(e){e=e|0;return o[e+8>>2]|0}function BS(e){e=e|0;return o[e+32>>2]|0}function US(e){e=e|0;return o[e+4>>2]|0}function jS(e){e=e|0;return o[e+4>>2]|0}function zS(e){e=e|0;return o[e+8>>2]|0}function WS(e){e=e|0;return o[e+16>>2]|0}function HS(e){e=e|0;return o[e+20>>2]|0}function VS(e){e=e|0;return o[e>>2]|0}function $S(e){e=e|0;var t=0,n=0,r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,v=0,m=0,g=0,_=0,y=0,b=0,w=0,E=0,D=0;D=h;h=h+16|0;p=D;do{if(e>>>0<245){c=e>>>0<11?16:e+11&-8;e=c>>>3;d=o[2783]|0;n=d>>>e;if(n&3|0){t=(n&1^1)+e|0;e=11172+(t<<1<<2)|0;n=e+8|0;r=o[n>>2]|0;i=r+8|0;u=o[i>>2]|0;if((e|0)==(u|0))o[2783]=d&~(1<>2]=e;o[n>>2]=u}E=t<<3;o[r+4>>2]=E|3;E=r+E+4|0;o[E>>2]=o[E>>2]|1;E=i;h=D;return E|0}f=o[2785]|0;if(c>>>0>f>>>0){if(n|0){t=2<>>12&16;t=t>>>a;n=t>>>5&8;t=t>>>n;i=t>>>2&4;t=t>>>i;e=t>>>1&2;t=t>>>e;r=t>>>1&1;r=(n|a|i|e|r)+(t>>>r)|0;t=11172+(r<<1<<2)|0;e=t+8|0;i=o[e>>2]|0;a=i+8|0;n=o[a>>2]|0;if((t|0)==(n|0)){e=d&~(1<>2]=t;o[e>>2]=n;e=d}u=(r<<3)-c|0;o[i+4>>2]=c|3;r=i+c|0;o[r+4>>2]=u|1;o[r+u>>2]=u;if(f|0){i=o[2788]|0;t=f>>>3;n=11172+(t<<1<<2)|0;t=1<>2]|0}o[e>>2]=i;o[t+12>>2]=i;o[i+8>>2]=t;o[i+12>>2]=n}o[2785]=u;o[2788]=r;E=a;h=D;return E|0}l=o[2784]|0;if(l){n=(l&0-l)+-1|0;a=n>>>12&16;n=n>>>a;u=n>>>5&8;n=n>>>u;s=n>>>2&4;n=n>>>s;r=n>>>1&2;n=n>>>r;e=n>>>1&1;e=o[11436+((u|a|s|r|e)+(n>>>e)<<2)>>2]|0;n=(o[e+4>>2]&-8)-c|0;r=o[e+16+(((o[e+16>>2]|0)==0&1)<<2)>>2]|0;if(!r){s=e;u=n}else{do{a=(o[r+4>>2]&-8)-c|0;s=a>>>0>>0;n=s?a:n;e=s?r:e;r=o[r+16+(((o[r+16>>2]|0)==0&1)<<2)>>2]|0}while((r|0)!=0);s=e;u=n}a=s+c|0;if(s>>>0>>0){i=o[s+24>>2]|0;t=o[s+12>>2]|0;do{if((t|0)==(s|0)){e=s+20|0;t=o[e>>2]|0;if(!t){e=s+16|0;t=o[e>>2]|0;if(!t){n=0;break}}while(1){n=t+20|0;r=o[n>>2]|0;if(r|0){t=r;e=n;continue}n=t+16|0;r=o[n>>2]|0;if(!r)break;else{t=r;e=n}}o[e>>2]=0;n=t}else{n=o[s+8>>2]|0;o[n+12>>2]=t;o[t+8>>2]=n;n=t}}while(0);do{if(i|0){t=o[s+28>>2]|0;e=11436+(t<<2)|0;if((s|0)==(o[e>>2]|0)){o[e>>2]=n;if(!n){o[2784]=l&~(1<>2]|0)!=(s|0)&1)<<2)>>2]=n;if(!n)break}o[n+24>>2]=i;t=o[s+16>>2]|0;if(t|0){o[n+16>>2]=t;o[t+24>>2]=n}t=o[s+20>>2]|0;if(t|0){o[n+20>>2]=t;o[t+24>>2]=n}}}while(0);if(u>>>0<16){E=u+c|0;o[s+4>>2]=E|3;E=s+E+4|0;o[E>>2]=o[E>>2]|1}else{o[s+4>>2]=c|3;o[a+4>>2]=u|1;o[a+u>>2]=u;if(f|0){r=o[2788]|0;t=f>>>3;n=11172+(t<<1<<2)|0;t=1<>2]|0}o[e>>2]=r;o[t+12>>2]=r;o[r+8>>2]=t;o[r+12>>2]=n}o[2785]=u;o[2788]=a}E=s+8|0;h=D;return E|0}else d=c}else d=c}else d=c}else if(e>>>0<=4294967231){e=e+11|0;c=e&-8;s=o[2784]|0;if(s){r=0-c|0;e=e>>>8;if(e){if(c>>>0>16777215)l=31;else{d=(e+1048320|0)>>>16&8;w=e<>>16&4;w=w<>>16&2;l=14-(f|d|l)+(w<>>15)|0;l=c>>>(l+7|0)&1|l<<1}}else l=0;n=o[11436+(l<<2)>>2]|0;e:do{if(!n){n=0;e=0;w=57}else{e=0;a=c<<((l|0)==31?0:25-(l>>>1)|0);u=0;while(1){i=(o[n+4>>2]&-8)-c|0;if(i>>>0>>0)if(!i){e=n;r=0;i=n;w=61;break e}else{e=n;r=i}i=o[n+20>>2]|0;n=o[n+16+(a>>>31<<2)>>2]|0;u=(i|0)==0|(i|0)==(n|0)?u:i;i=(n|0)==0;if(i){n=u;w=57;break}else a=a<<((i^1)&1)}}}while(0);if((w|0)==57){if((n|0)==0&(e|0)==0){e=2<>>12&16;d=d>>>a;u=d>>>5&8;d=d>>>u;l=d>>>2&4;d=d>>>l;f=d>>>1&2;d=d>>>f;n=d>>>1&1;e=0;n=o[11436+((u|a|l|f|n)+(d>>>n)<<2)>>2]|0}if(!n){l=e;a=r}else{i=n;w=61}}if((w|0)==61)while(1){w=0;n=(o[i+4>>2]&-8)-c|0;d=n>>>0>>0;n=d?n:r;e=d?i:e;i=o[i+16+(((o[i+16>>2]|0)==0&1)<<2)>>2]|0;if(!i){l=e;a=n;break}else{r=n;w=61}}if((l|0)!=0?a>>>0<((o[2785]|0)-c|0)>>>0:0){u=l+c|0;if(l>>>0>=u>>>0){E=0;h=D;return E|0}i=o[l+24>>2]|0;t=o[l+12>>2]|0;do{if((t|0)==(l|0)){e=l+20|0;t=o[e>>2]|0;if(!t){e=l+16|0;t=o[e>>2]|0;if(!t){t=0;break}}while(1){n=t+20|0;r=o[n>>2]|0;if(r|0){t=r;e=n;continue}n=t+16|0;r=o[n>>2]|0;if(!r)break;else{t=r;e=n}}o[e>>2]=0}else{E=o[l+8>>2]|0;o[E+12>>2]=t;o[t+8>>2]=E}}while(0);do{if(i){e=o[l+28>>2]|0;n=11436+(e<<2)|0;if((l|0)==(o[n>>2]|0)){o[n>>2]=t;if(!t){r=s&~(1<>2]|0)!=(l|0)&1)<<2)>>2]=t;if(!t){r=s;break}}o[t+24>>2]=i;e=o[l+16>>2]|0;if(e|0){o[t+16>>2]=e;o[e+24>>2]=t}e=o[l+20>>2]|0;if(e){o[t+20>>2]=e;o[e+24>>2]=t;r=s}else r=s}else r=s}while(0);do{if(a>>>0>=16){o[l+4>>2]=c|3;o[u+4>>2]=a|1;o[u+a>>2]=a;t=a>>>3;if(a>>>0<256){n=11172+(t<<1<<2)|0;e=o[2783]|0;t=1<>2]|0}o[e>>2]=u;o[t+12>>2]=u;o[u+8>>2]=t;o[u+12>>2]=n;break}t=a>>>8;if(t){if(a>>>0>16777215)t=31;else{w=(t+1048320|0)>>>16&8;E=t<>>16&4;E=E<>>16&2;t=14-(b|w|t)+(E<>>15)|0;t=a>>>(t+7|0)&1|t<<1}}else t=0;n=11436+(t<<2)|0;o[u+28>>2]=t;e=u+16|0;o[e+4>>2]=0;o[e>>2]=0;e=1<>2]=u;o[u+24>>2]=n;o[u+12>>2]=u;o[u+8>>2]=u;break}e=a<<((t|0)==31?0:25-(t>>>1)|0);n=o[n>>2]|0;while(1){if((o[n+4>>2]&-8|0)==(a|0)){w=97;break}r=n+16+(e>>>31<<2)|0;t=o[r>>2]|0;if(!t){w=96;break}else{e=e<<1;n=t}}if((w|0)==96){o[r>>2]=u;o[u+24>>2]=n;o[u+12>>2]=u;o[u+8>>2]=u;break}else if((w|0)==97){w=n+8|0;E=o[w>>2]|0;o[E+12>>2]=u;o[w>>2]=u;o[u+8>>2]=E;o[u+12>>2]=n;o[u+24>>2]=0;break}}else{E=a+c|0;o[l+4>>2]=E|3;E=l+E+4|0;o[E>>2]=o[E>>2]|1}}while(0);E=l+8|0;h=D;return E|0}else d=c}else d=c}else d=-1}while(0);n=o[2785]|0;if(n>>>0>=d>>>0){t=n-d|0;e=o[2788]|0;if(t>>>0>15){E=e+d|0;o[2788]=E;o[2785]=t;o[E+4>>2]=t|1;o[E+t>>2]=t;o[e+4>>2]=d|3}else{o[2785]=0;o[2788]=0;o[e+4>>2]=n|3;E=e+n+4|0;o[E>>2]=o[E>>2]|1}E=e+8|0;h=D;return E|0}a=o[2786]|0;if(a>>>0>d>>>0){b=a-d|0;o[2786]=b;E=o[2789]|0;w=E+d|0;o[2789]=w;o[w+4>>2]=b|1;o[E+4>>2]=d|3;E=E+8|0;h=D;return E|0}if(!(o[2901]|0)){o[2903]=4096;o[2902]=4096;o[2904]=-1;o[2905]=-1;o[2906]=0;o[2894]=0;e=p&-16^1431655768;o[p>>2]=e;o[2901]=e;e=4096}else e=o[2903]|0;l=d+48|0;s=d+47|0;u=e+s|0;i=0-e|0;c=u&i;if(c>>>0<=d>>>0){E=0;h=D;return E|0}e=o[2893]|0;if(e|0?(f=o[2891]|0,p=f+c|0,p>>>0<=f>>>0|p>>>0>e>>>0):0){E=0;h=D;return E|0}e:do{if(!(o[2894]&4)){n=o[2789]|0;t:do{if(n){r=11580;while(1){e=o[r>>2]|0;if(e>>>0<=n>>>0?(g=r+4|0,(e+(o[g>>2]|0)|0)>>>0>n>>>0):0)break;e=o[r+8>>2]|0;if(!e){w=118;break t}else r=e}t=u-a&i;if(t>>>0<2147483647){e=lx(t|0)|0;if((e|0)==((o[r>>2]|0)+(o[g>>2]|0)|0)){if((e|0)!=(-1|0)){a=t;u=e;w=135;break e}}else{r=e;w=126}}else t=0}else w=118}while(0);do{if((w|0)==118){n=lx(0)|0;if((n|0)!=(-1|0)?(t=n,v=o[2902]|0,m=v+-1|0,t=((m&t|0)==0?0:(m+t&0-v)-t|0)+c|0,v=o[2891]|0,m=t+v|0,t>>>0>d>>>0&t>>>0<2147483647):0){g=o[2893]|0;if(g|0?m>>>0<=v>>>0|m>>>0>g>>>0:0){t=0;break}e=lx(t|0)|0;if((e|0)==(n|0)){a=t;u=n;w=135;break e}else{r=e;w=126}}else t=0}}while(0);do{if((w|0)==126){n=0-t|0;if(!(l>>>0>t>>>0&(t>>>0<2147483647&(r|0)!=(-1|0))))if((r|0)==(-1|0)){t=0;break}else{a=t;u=r;w=135;break e}e=o[2903]|0;e=s-t+e&0-e;if(e>>>0>=2147483647){a=t;u=r;w=135;break e}if((lx(e|0)|0)==(-1|0)){lx(n|0)|0;t=0;break}else{a=e+t|0;u=r;w=135;break e}}}while(0);o[2894]=o[2894]|4;w=133}else{t=0;w=133}}while(0);if(((w|0)==133?c>>>0<2147483647:0)?(b=lx(c|0)|0,g=lx(0)|0,_=g-b|0,y=_>>>0>(d+40|0)>>>0,!((b|0)==(-1|0)|y^1|b>>>0>>0&((b|0)!=(-1|0)&(g|0)!=(-1|0))^1)):0){a=y?_:t;u=b;w=135}if((w|0)==135){t=(o[2891]|0)+a|0;o[2891]=t;if(t>>>0>(o[2892]|0)>>>0)o[2892]=t;s=o[2789]|0;do{if(s){t=11580;while(1){e=o[t>>2]|0;n=t+4|0;r=o[n>>2]|0;if((u|0)==(e+r|0)){w=145;break}i=o[t+8>>2]|0;if(!i)break;else t=i}if(((w|0)==145?(o[t+12>>2]&8|0)==0:0)?s>>>0>>0&s>>>0>=e>>>0:0){o[n>>2]=r+a;E=s+8|0;E=(E&7|0)==0?0:0-E&7;w=s+E|0;E=(o[2786]|0)+(a-E)|0;o[2789]=w;o[2786]=E;o[w+4>>2]=E|1;o[w+E+4>>2]=40;o[2790]=o[2905];break}if(u>>>0<(o[2787]|0)>>>0)o[2787]=u;n=u+a|0;t=11580;while(1){if((o[t>>2]|0)==(n|0)){w=153;break}e=o[t+8>>2]|0;if(!e)break;else t=e}if((w|0)==153?(o[t+12>>2]&8|0)==0:0){o[t>>2]=u;f=t+4|0;o[f>>2]=(o[f>>2]|0)+a;f=u+8|0;f=u+((f&7|0)==0?0:0-f&7)|0;t=n+8|0;t=n+((t&7|0)==0?0:0-t&7)|0;c=f+d|0;l=t-f-d|0;o[f+4>>2]=d|3;do{if((t|0)!=(s|0)){if((t|0)==(o[2788]|0)){E=(o[2785]|0)+l|0;o[2785]=E;o[2788]=c;o[c+4>>2]=E|1;o[c+E>>2]=E;break}e=o[t+4>>2]|0;if((e&3|0)==1){a=e&-8;r=e>>>3;e:do{if(e>>>0<256){e=o[t+8>>2]|0;n=o[t+12>>2]|0;if((n|0)==(e|0)){o[2783]=o[2783]&~(1<>2]=n;o[n+8>>2]=e;break}}else{u=o[t+24>>2]|0;e=o[t+12>>2]|0;do{if((e|0)==(t|0)){r=t+16|0;n=r+4|0;e=o[n>>2]|0;if(!e){e=o[r>>2]|0;if(!e){e=0;break}else n=r}while(1){r=e+20|0;i=o[r>>2]|0;if(i|0){e=i;n=r;continue}r=e+16|0;i=o[r>>2]|0;if(!i)break;else{e=i;n=r}}o[n>>2]=0}else{E=o[t+8>>2]|0;o[E+12>>2]=e;o[e+8>>2]=E}}while(0);if(!u)break;n=o[t+28>>2]|0;r=11436+(n<<2)|0;do{if((t|0)!=(o[r>>2]|0)){o[u+16+(((o[u+16>>2]|0)!=(t|0)&1)<<2)>>2]=e;if(!e)break e}else{o[r>>2]=e;if(e|0)break;o[2784]=o[2784]&~(1<>2]=u;n=t+16|0;r=o[n>>2]|0;if(r|0){o[e+16>>2]=r;o[r+24>>2]=e}n=o[n+4>>2]|0;if(!n)break;o[e+20>>2]=n;o[n+24>>2]=e}}while(0);t=t+a|0;i=a+l|0}else i=l;t=t+4|0;o[t>>2]=o[t>>2]&-2;o[c+4>>2]=i|1;o[c+i>>2]=i;t=i>>>3;if(i>>>0<256){n=11172+(t<<1<<2)|0;e=o[2783]|0;t=1<>2]|0}o[e>>2]=c;o[t+12>>2]=c;o[c+8>>2]=t;o[c+12>>2]=n;break}t=i>>>8;do{if(!t)t=0;else{if(i>>>0>16777215){t=31;break}w=(t+1048320|0)>>>16&8;E=t<>>16&4;E=E<>>16&2;t=14-(b|w|t)+(E<>>15)|0;t=i>>>(t+7|0)&1|t<<1}}while(0);r=11436+(t<<2)|0;o[c+28>>2]=t;e=c+16|0;o[e+4>>2]=0;o[e>>2]=0;e=o[2784]|0;n=1<>2]=c;o[c+24>>2]=r;o[c+12>>2]=c;o[c+8>>2]=c;break}e=i<<((t|0)==31?0:25-(t>>>1)|0);n=o[r>>2]|0;while(1){if((o[n+4>>2]&-8|0)==(i|0)){w=194;break}r=n+16+(e>>>31<<2)|0;t=o[r>>2]|0;if(!t){w=193;break}else{e=e<<1;n=t}}if((w|0)==193){o[r>>2]=c;o[c+24>>2]=n;o[c+12>>2]=c;o[c+8>>2]=c;break}else if((w|0)==194){w=n+8|0;E=o[w>>2]|0;o[E+12>>2]=c;o[w>>2]=c;o[c+8>>2]=E;o[c+12>>2]=n;o[c+24>>2]=0;break}}else{E=(o[2786]|0)+l|0;o[2786]=E;o[2789]=c;o[c+4>>2]=E|1}}while(0);E=f+8|0;h=D;return E|0}t=11580;while(1){e=o[t>>2]|0;if(e>>>0<=s>>>0?(E=e+(o[t+4>>2]|0)|0,E>>>0>s>>>0):0)break;t=o[t+8>>2]|0}i=E+-47|0;e=i+8|0;e=i+((e&7|0)==0?0:0-e&7)|0;i=s+16|0;e=e>>>0>>0?s:e;t=e+8|0;n=u+8|0;n=(n&7|0)==0?0:0-n&7;w=u+n|0;n=a+-40-n|0;o[2789]=w;o[2786]=n;o[w+4>>2]=n|1;o[w+n+4>>2]=40;o[2790]=o[2905];n=e+4|0;o[n>>2]=27;o[t>>2]=o[2895];o[t+4>>2]=o[2896];o[t+8>>2]=o[2897];o[t+12>>2]=o[2898];o[2895]=u;o[2896]=a;o[2898]=0;o[2897]=t;t=e+24|0;do{w=t;t=t+4|0;o[t>>2]=7}while((w+8|0)>>>0>>0);if((e|0)!=(s|0)){u=e-s|0;o[n>>2]=o[n>>2]&-2;o[s+4>>2]=u|1;o[e>>2]=u;t=u>>>3;if(u>>>0<256){n=11172+(t<<1<<2)|0;e=o[2783]|0;t=1<>2]|0}o[e>>2]=s;o[t+12>>2]=s;o[s+8>>2]=t;o[s+12>>2]=n;break}t=u>>>8;if(t){if(u>>>0>16777215)n=31;else{w=(t+1048320|0)>>>16&8;E=t<>>16&4;E=E<>>16&2;n=14-(b|w|n)+(E<>>15)|0;n=u>>>(n+7|0)&1|n<<1}}else n=0;r=11436+(n<<2)|0;o[s+28>>2]=n;o[s+20>>2]=0;o[i>>2]=0;t=o[2784]|0;e=1<>2]=s;o[s+24>>2]=r;o[s+12>>2]=s;o[s+8>>2]=s;break}e=u<<((n|0)==31?0:25-(n>>>1)|0);n=o[r>>2]|0;while(1){if((o[n+4>>2]&-8|0)==(u|0)){w=216;break}r=n+16+(e>>>31<<2)|0;t=o[r>>2]|0;if(!t){w=215;break}else{e=e<<1;n=t}}if((w|0)==215){o[r>>2]=s;o[s+24>>2]=n;o[s+12>>2]=s;o[s+8>>2]=s;break}else if((w|0)==216){w=n+8|0;E=o[w>>2]|0;o[E+12>>2]=s;o[w>>2]=s;o[s+8>>2]=E;o[s+12>>2]=n;o[s+24>>2]=0;break}}}else{E=o[2787]|0;if((E|0)==0|u>>>0>>0)o[2787]=u;o[2895]=u;o[2896]=a;o[2898]=0;o[2792]=o[2901];o[2791]=-1;t=0;do{E=11172+(t<<1<<2)|0;o[E+12>>2]=E;o[E+8>>2]=E;t=t+1|0}while((t|0)!=32);E=u+8|0;E=(E&7|0)==0?0:0-E&7;w=u+E|0;E=a+-40-E|0;o[2789]=w;o[2786]=E;o[w+4>>2]=E|1;o[w+E+4>>2]=40;o[2790]=o[2905]}}while(0);t=o[2786]|0;if(t>>>0>d>>>0){b=t-d|0;o[2786]=b;E=o[2789]|0;w=E+d|0;o[2789]=w;o[w+4>>2]=b|1;o[E+4>>2]=d|3;E=E+8|0;h=D;return E|0}}o[(QS()|0)>>2]=12;E=0;h=D;return E|0}function GS(e){e=e|0;var t=0,n=0,r=0,i=0,u=0,a=0,l=0,s=0;if(!e)return;n=e+-8|0;i=o[2787]|0;e=o[e+-4>>2]|0;t=e&-8;s=n+t|0;do{if(!(e&1)){r=o[n>>2]|0;if(!(e&3))return;a=n+(0-r)|0;u=r+t|0;if(a>>>0>>0)return;if((a|0)==(o[2788]|0)){e=s+4|0;t=o[e>>2]|0;if((t&3|0)!=3){l=a;t=u;break}o[2785]=u;o[e>>2]=t&-2;o[a+4>>2]=u|1;o[a+u>>2]=u;return}n=r>>>3;if(r>>>0<256){e=o[a+8>>2]|0;t=o[a+12>>2]|0;if((t|0)==(e|0)){o[2783]=o[2783]&~(1<>2]=t;o[t+8>>2]=e;l=a;t=u;break}}i=o[a+24>>2]|0;e=o[a+12>>2]|0;do{if((e|0)==(a|0)){n=a+16|0;t=n+4|0;e=o[t>>2]|0;if(!e){e=o[n>>2]|0;if(!e){e=0;break}else t=n}while(1){n=e+20|0;r=o[n>>2]|0;if(r|0){e=r;t=n;continue}n=e+16|0;r=o[n>>2]|0;if(!r)break;else{e=r;t=n}}o[t>>2]=0}else{l=o[a+8>>2]|0;o[l+12>>2]=e;o[e+8>>2]=l}}while(0);if(i){t=o[a+28>>2]|0;n=11436+(t<<2)|0;if((a|0)==(o[n>>2]|0)){o[n>>2]=e;if(!e){o[2784]=o[2784]&~(1<>2]|0)!=(a|0)&1)<<2)>>2]=e;if(!e){l=a;t=u;break}}o[e+24>>2]=i;t=a+16|0;n=o[t>>2]|0;if(n|0){o[e+16>>2]=n;o[n+24>>2]=e}t=o[t+4>>2]|0;if(t){o[e+20>>2]=t;o[t+24>>2]=e;l=a;t=u}else{l=a;t=u}}else{l=a;t=u}}else{l=n;a=n}}while(0);if(a>>>0>=s>>>0)return;e=s+4|0;r=o[e>>2]|0;if(!(r&1))return;if(!(r&2)){e=o[2788]|0;if((s|0)==(o[2789]|0)){s=(o[2786]|0)+t|0;o[2786]=s;o[2789]=l;o[l+4>>2]=s|1;if((l|0)!=(e|0))return;o[2788]=0;o[2785]=0;return}if((s|0)==(e|0)){s=(o[2785]|0)+t|0;o[2785]=s;o[2788]=a;o[l+4>>2]=s|1;o[a+s>>2]=s;return}i=(r&-8)+t|0;n=r>>>3;do{if(r>>>0<256){t=o[s+8>>2]|0;e=o[s+12>>2]|0;if((e|0)==(t|0)){o[2783]=o[2783]&~(1<>2]=e;o[e+8>>2]=t;break}}else{u=o[s+24>>2]|0;e=o[s+12>>2]|0;do{if((e|0)==(s|0)){n=s+16|0;t=n+4|0;e=o[t>>2]|0;if(!e){e=o[n>>2]|0;if(!e){n=0;break}else t=n}while(1){n=e+20|0;r=o[n>>2]|0;if(r|0){e=r;t=n;continue}n=e+16|0;r=o[n>>2]|0;if(!r)break;else{e=r;t=n}}o[t>>2]=0;n=e}else{n=o[s+8>>2]|0;o[n+12>>2]=e;o[e+8>>2]=n;n=e}}while(0);if(u|0){e=o[s+28>>2]|0;t=11436+(e<<2)|0;if((s|0)==(o[t>>2]|0)){o[t>>2]=n;if(!n){o[2784]=o[2784]&~(1<>2]|0)!=(s|0)&1)<<2)>>2]=n;if(!n)break}o[n+24>>2]=u;e=s+16|0;t=o[e>>2]|0;if(t|0){o[n+16>>2]=t;o[t+24>>2]=n}e=o[e+4>>2]|0;if(e|0){o[n+20>>2]=e;o[e+24>>2]=n}}}}while(0);o[l+4>>2]=i|1;o[a+i>>2]=i;if((l|0)==(o[2788]|0)){o[2785]=i;return}}else{o[e>>2]=r&-2;o[l+4>>2]=t|1;o[a+t>>2]=t;i=t}e=i>>>3;if(i>>>0<256){n=11172+(e<<1<<2)|0;t=o[2783]|0;e=1<>2]|0}o[t>>2]=l;o[e+12>>2]=l;o[l+8>>2]=e;o[l+12>>2]=n;return}e=i>>>8;if(e){if(i>>>0>16777215)e=31;else{a=(e+1048320|0)>>>16&8;s=e<>>16&4;s=s<>>16&2;e=14-(u|a|e)+(s<>>15)|0;e=i>>>(e+7|0)&1|e<<1}}else e=0;r=11436+(e<<2)|0;o[l+28>>2]=e;o[l+20>>2]=0;o[l+16>>2]=0;t=o[2784]|0;n=1<>>1)|0);n=o[r>>2]|0;while(1){if((o[n+4>>2]&-8|0)==(i|0)){e=73;break}r=n+16+(t>>>31<<2)|0;e=o[r>>2]|0;if(!e){e=72;break}else{t=t<<1;n=e}}if((e|0)==72){o[r>>2]=l;o[l+24>>2]=n;o[l+12>>2]=l;o[l+8>>2]=l;break}else if((e|0)==73){a=n+8|0;s=o[a>>2]|0;o[s+12>>2]=l;o[a>>2]=l;o[l+8>>2]=s;o[l+12>>2]=n;o[l+24>>2]=0;break}}else{o[2784]=t|n;o[r>>2]=l;o[l+24>>2]=r;o[l+12>>2]=l;o[l+8>>2]=l}}while(0);s=(o[2791]|0)+-1|0;o[2791]=s;if(!s)e=11588;else return;while(1){e=o[e>>2]|0;if(!e)break;else e=e+8|0}o[2791]=-1;return}function qS(){return 11628}function YS(e){e=e|0;var t=0,n=0;t=h;h=h+16|0;n=t;o[n>>2]=tT(o[e+60>>2]|0)|0;e=JS(ut(6,n|0)|0)|0;h=t;return e|0}function XS(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,v=0;d=h;h=h+48|0;c=d+16|0;u=d;i=d+32|0;l=e+28|0;r=o[l>>2]|0;o[i>>2]=r;s=e+20|0;r=(o[s>>2]|0)-r|0;o[i+4>>2]=r;o[i+8>>2]=t;o[i+12>>2]=n;r=r+n|0;a=e+60|0;o[u>>2]=o[a>>2];o[u+4>>2]=i;o[u+8>>2]=2;u=JS(st(146,u|0)|0)|0;e:do{if((r|0)!=(u|0)){t=2;while(1){if((u|0)<0)break;r=r-u|0;v=o[i+4>>2]|0;p=u>>>0>v>>>0;i=p?i+8|0:i;t=(p<<31>>31)+t|0;v=u-(p?v:0)|0;o[i>>2]=(o[i>>2]|0)+v;p=i+4|0;o[p>>2]=(o[p>>2]|0)-v;o[c>>2]=o[a>>2];o[c+4>>2]=i;o[c+8>>2]=t;u=JS(st(146,c|0)|0)|0;if((r|0)==(u|0)){f=3;break e}}o[e+16>>2]=0;o[l>>2]=0;o[s>>2]=0;o[e>>2]=o[e>>2]|32;if((t|0)==2)n=0;else n=n-(o[i+4>>2]|0)|0}else f=3}while(0);if((f|0)==3){v=o[e+44>>2]|0;o[e+16>>2]=v+(o[e+48>>2]|0);o[l>>2]=v;o[s>>2]=v}h=d;return n|0}function KS(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0;i=h;h=h+32|0;u=i;r=i+20|0;o[u>>2]=o[e+60>>2];o[u+4>>2]=0;o[u+8>>2]=t;o[u+12>>2]=r;o[u+16>>2]=n;if((JS(lt(140,u|0)|0)|0)<0){o[r>>2]=-1;e=-1}else e=o[r>>2]|0;h=i;return e|0}function JS(e){e=e|0;if(e>>>0>4294963200){o[(QS()|0)>>2]=0-e;e=-1}return e|0}function QS(){return(ZS()|0)+64|0}function ZS(){return eT()|0}function eT(){return 2084}function tT(e){e=e|0;return e|0}function nT(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,u=0;u=h;h=h+32|0;i=u;o[e+36>>2]=1;if((o[e>>2]&64|0)==0?(o[i>>2]=o[e+60>>2],o[i+4>>2]=21523,o[i+8>>2]=u+16,Je(54,i|0)|0):0)r[e+75>>0]=-1;i=XS(e,t,n)|0;h=u;return i|0}function rT(e,t){e=e|0;t=t|0;var n=0,i=0;n=r[e>>0]|0;i=r[t>>0]|0;if(n<<24>>24==0?1:n<<24>>24!=i<<24>>24)e=i;else{do{e=e+1|0;t=t+1|0;n=r[e>>0]|0;i=r[t>>0]|0}while(!(n<<24>>24==0?1:n<<24>>24!=i<<24>>24));e=i}return(n&255)-(e&255)|0}function iT(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,o=0;e:do{if(!n)e=0;else{while(1){i=r[e>>0]|0;o=r[t>>0]|0;if(i<<24>>24!=o<<24>>24)break;n=n+-1|0;if(!n){e=0;break e}else{e=e+1|0;t=t+1|0}}e=(i&255)-(o&255)|0}}while(0);return e|0}function oT(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,v=0,m=0,g=0,_=0;_=h;h=h+224|0;d=_+120|0;p=_+80|0;m=_;g=_+136|0;i=p;u=i+40|0;do{o[i>>2]=0;i=i+4|0}while((i|0)<(u|0));o[d>>2]=o[n>>2];if((uT(0,t,d,m,p)|0)<0)n=-1;else{if((o[e+76>>2]|0)>-1)v=aT(e)|0;else v=0;n=o[e>>2]|0;f=n&32;if((r[e+74>>0]|0)<1)o[e>>2]=n&-33;i=e+48|0;if(!(o[i>>2]|0)){u=e+44|0;a=o[u>>2]|0;o[u>>2]=g;l=e+28|0;o[l>>2]=g;s=e+20|0;o[s>>2]=g;o[i>>2]=80;c=e+16|0;o[c>>2]=g+80;n=uT(e,t,d,m,p)|0;if(a){yA[o[e+36>>2]&7](e,0,0)|0;n=(o[s>>2]|0)==0?-1:n;o[u>>2]=a;o[i>>2]=0;o[c>>2]=0;o[l>>2]=0;o[s>>2]=0}}else n=uT(e,t,d,m,p)|0;i=o[e>>2]|0;o[e>>2]=i|f;if(v|0)lT(e);n=(i&32|0)==0?n:-1}h=_;return n|0}function uT(e,t,n,u,a){e=e|0;t=t|0;n=n|0;u=u|0;a=a|0;var l=0,s=0,f=0,d=0,p=0,v=0,m=0,g=0,_=0,y=0,b=0,w=0,E=0,D=0,C=0,k=0,S=0,T=0,x=0,O=0,M=0,I=0,R=0;R=h;h=h+64|0;x=R+16|0;O=R;S=R+24|0;M=R+8|0;I=R+20|0;o[x>>2]=t;D=(e|0)!=0;C=S+40|0;k=C;S=S+39|0;T=M+4|0;s=0;l=0;v=0;e:while(1){do{if((l|0)>-1)if((s|0)>(2147483647-l|0)){o[(QS()|0)>>2]=75;l=-1;break}else{l=s+l|0;break}}while(0);s=r[t>>0]|0;if(!(s<<24>>24)){E=87;break}else f=t;t:while(1){switch(s<<24>>24){case 37:{s=f;E=9;break t}case 0:{s=f;break t}default:{}}w=f+1|0;o[x>>2]=w;s=r[w>>0]|0;f=w}t:do{if((E|0)==9)while(1){E=0;if((r[f+1>>0]|0)!=37)break t;s=s+1|0;f=f+2|0;o[x>>2]=f;if((r[f>>0]|0)==37)E=9;else break}}while(0);s=s-t|0;if(D)sT(e,t,s);if(s|0){t=f;continue}d=f+1|0;s=(r[d>>0]|0)+-48|0;if(s>>>0<10){w=(r[f+2>>0]|0)==36;b=w?s:-1;v=w?1:v;d=w?f+3|0:d}else b=-1;o[x>>2]=d;s=r[d>>0]|0;f=(s<<24>>24)+-32|0;t:do{if(f>>>0<32){p=0;m=s;while(1){s=1<>2]=d;s=r[d>>0]|0;f=(s<<24>>24)+-32|0;if(f>>>0>=32)break;else m=s}}else p=0}while(0);if(s<<24>>24==42){f=d+1|0;s=(r[f>>0]|0)+-48|0;if(s>>>0<10?(r[d+2>>0]|0)==36:0){o[a+(s<<2)>>2]=10;s=o[u+((r[f>>0]|0)+-48<<3)>>2]|0;v=1;d=d+3|0}else{if(v|0){l=-1;break}if(D){v=(o[n>>2]|0)+(4-1)&~(4-1);s=o[v>>2]|0;o[n>>2]=v+4;v=0;d=f}else{s=0;v=0;d=f}}o[x>>2]=d;w=(s|0)<0;s=w?0-s|0:s;p=w?p|8192:p}else{s=cT(x)|0;if((s|0)<0){l=-1;break}d=o[x>>2]|0}do{if((r[d>>0]|0)==46){if((r[d+1>>0]|0)!=42){o[x>>2]=d+1;f=cT(x)|0;d=o[x>>2]|0;break}m=d+2|0;f=(r[m>>0]|0)+-48|0;if(f>>>0<10?(r[d+3>>0]|0)==36:0){o[a+(f<<2)>>2]=10;f=o[u+((r[m>>0]|0)+-48<<3)>>2]|0;d=d+4|0;o[x>>2]=d;break}if(v|0){l=-1;break e}if(D){w=(o[n>>2]|0)+(4-1)&~(4-1);f=o[w>>2]|0;o[n>>2]=w+4}else f=0;o[x>>2]=m;d=m}else f=-1}while(0);y=0;while(1){if(((r[d>>0]|0)+-65|0)>>>0>57){l=-1;break e}w=d+1|0;o[x>>2]=w;m=r[(r[d>>0]|0)+-65+(5178+(y*58|0))>>0]|0;g=m&255;if((g+-1|0)>>>0<8){y=g;d=w}else break}if(!(m<<24>>24)){l=-1;break}_=(b|0)>-1;do{if(m<<24>>24==19){if(_){l=-1;break e}else E=49}else{if(_){o[a+(b<<2)>>2]=g;_=u+(b<<3)|0;b=o[_+4>>2]|0;E=O;o[E>>2]=o[_>>2];o[E+4>>2]=b;E=49;break}if(!D){l=0;break e}fT(O,g,n)}}while(0);if((E|0)==49?(E=0,!D):0){s=0;t=w;continue}d=r[d>>0]|0;d=(y|0)!=0&(d&15|0)==3?d&-33:d;_=p&-65537;b=(p&8192|0)==0?p:_;t:do{switch(d|0){case 110:switch((y&255)<<24>>24){case 0:{o[o[O>>2]>>2]=l;s=0;t=w;continue e}case 1:{o[o[O>>2]>>2]=l;s=0;t=w;continue e}case 2:{s=o[O>>2]|0;o[s>>2]=l;o[s+4>>2]=((l|0)<0)<<31>>31;s=0;t=w;continue e}case 3:{i[o[O>>2]>>1]=l;s=0;t=w;continue e}case 4:{r[o[O>>2]>>0]=l;s=0;t=w;continue e}case 6:{o[o[O>>2]>>2]=l;s=0;t=w;continue e}case 7:{s=o[O>>2]|0;o[s>>2]=l;o[s+4>>2]=((l|0)<0)<<31>>31;s=0;t=w;continue e}default:{s=0;t=w;continue e}}case 112:{d=120;f=f>>>0>8?f:8;t=b|8;E=61;break}case 88:case 120:{t=b;E=61;break}case 111:{d=O;t=o[d>>2]|0;d=o[d+4>>2]|0;g=pT(t,d,C)|0;_=k-g|0;p=0;m=5642;f=(b&8|0)==0|(f|0)>(_|0)?f:_+1|0;_=b;E=67;break}case 105:case 100:{d=O;t=o[d>>2]|0;d=o[d+4>>2]|0;if((d|0)<0){t=ZT(0,0,t|0,d|0)|0;d=A;p=O;o[p>>2]=t;o[p+4>>2]=d;p=1;m=5642;E=66;break t}else{p=(b&2049|0)!=0&1;m=(b&2048|0)==0?(b&1|0)==0?5642:5644:5643;E=66;break t}}case 117:{d=O;p=0;m=5642;t=o[d>>2]|0;d=o[d+4>>2]|0;E=66;break}case 99:{r[S>>0]=o[O>>2];t=S;p=0;m=5642;g=C;d=1;f=_;break}case 109:{d=vT(o[(QS()|0)>>2]|0)|0;E=71;break}case 115:{d=o[O>>2]|0;d=d|0?d:5652;E=71;break}case 67:{o[M>>2]=o[O>>2];o[T>>2]=0;o[O>>2]=M;g=-1;d=M;E=75;break}case 83:{t=o[O>>2]|0;if(!f){gT(e,32,s,0,b);t=0;E=84}else{g=f;d=t;E=75}break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{s=yT(e,+c[O>>3],s,f,b,d)|0;t=w;continue e}default:{p=0;m=5642;g=C;d=f;f=b}}}while(0);t:do{if((E|0)==61){b=O;y=o[b>>2]|0;b=o[b+4>>2]|0;g=dT(y,b,C,d&32)|0;m=(t&8|0)==0|(y|0)==0&(b|0)==0;p=m?0:2;m=m?5642:5642+(d>>4)|0;_=t;t=y;d=b;E=67}else if((E|0)==66){g=hT(t,d,C)|0;_=b;E=67}else if((E|0)==71){E=0;b=mT(d,0,f)|0;y=(b|0)==0;t=d;p=0;m=5642;g=y?d+f|0:b;d=y?f:b-d|0;f=_}else if((E|0)==75){E=0;m=d;t=0;f=0;while(1){p=o[m>>2]|0;if(!p)break;f=_T(I,p)|0;if((f|0)<0|f>>>0>(g-t|0)>>>0)break;t=f+t|0;if(g>>>0>t>>>0)m=m+4|0;else break}if((f|0)<0){l=-1;break e}gT(e,32,s,t,b);if(!t){t=0;E=84}else{p=0;while(1){f=o[d>>2]|0;if(!f){E=84;break t}f=_T(I,f)|0;p=f+p|0;if((p|0)>(t|0)){E=84;break t}sT(e,I,f);if(p>>>0>=t>>>0){E=84;break}else d=d+4|0}}}}while(0);if((E|0)==67){E=0;d=(t|0)!=0|(d|0)!=0;b=(f|0)!=0|d;d=((d^1)&1)+(k-g)|0;t=b?g:C;g=C;d=b?(f|0)>(d|0)?f:d:f;f=(f|0)>-1?_&-65537:_}else if((E|0)==84){E=0;gT(e,32,s,t,b^8192);s=(s|0)>(t|0)?s:t;t=w;continue}y=g-t|0;_=(d|0)<(y|0)?y:d;b=_+p|0;s=(s|0)<(b|0)?b:s;gT(e,32,s,b,f);sT(e,m,p);gT(e,48,s,b,f^65536);gT(e,48,_,y,0);sT(e,t,y);gT(e,32,s,b,f^8192);t=w}e:do{if((E|0)==87)if(!e)if(!v)l=0;else{l=1;while(1){t=o[a+(l<<2)>>2]|0;if(!t)break;fT(u+(l<<3)|0,t,n);l=l+1|0;if((l|0)>=10){l=1;break e}}while(1){if(o[a+(l<<2)>>2]|0){l=-1;break e}l=l+1|0;if((l|0)>=10){l=1;break}}}}while(0);h=R;return l|0}function aT(e){e=e|0;return 0}function lT(e){e=e|0;return}function sT(e,t,n){e=e|0;t=t|0;n=n|0;if(!(o[e>>2]&32))MT(t,n,e)|0;return}function cT(e){e=e|0;var t=0,n=0,i=0;n=o[e>>2]|0;i=(r[n>>0]|0)+-48|0;if(i>>>0<10){t=0;do{t=i+(t*10|0)|0;n=n+1|0;o[e>>2]=n;i=(r[n>>0]|0)+-48|0}while(i>>>0<10)}else t=0;return t|0}function fT(e,t,n){e=e|0;t=t|0;n=n|0;var r=0,i=0,u=0.0;e:do{if(t>>>0<=20)do{switch(t|0){case 9:{r=(o[n>>2]|0)+(4-1)&~(4-1);t=o[r>>2]|0;o[n>>2]=r+4;o[e>>2]=t;break e}case 10:{r=(o[n>>2]|0)+(4-1)&~(4-1);t=o[r>>2]|0;o[n>>2]=r+4;r=e;o[r>>2]=t;o[r+4>>2]=((t|0)<0)<<31>>31;break e}case 11:{r=(o[n>>2]|0)+(4-1)&~(4-1);t=o[r>>2]|0;o[n>>2]=r+4;r=e;o[r>>2]=t;o[r+4>>2]=0;break e}case 12:{r=(o[n>>2]|0)+(8-1)&~(8-1);t=r;i=o[t>>2]|0;t=o[t+4>>2]|0;o[n>>2]=r+8;r=e;o[r>>2]=i;o[r+4>>2]=t;break e}case 13:{i=(o[n>>2]|0)+(4-1)&~(4-1);r=o[i>>2]|0;o[n>>2]=i+4;r=(r&65535)<<16>>16;i=e;o[i>>2]=r;o[i+4>>2]=((r|0)<0)<<31>>31;break e}case 14:{i=(o[n>>2]|0)+(4-1)&~(4-1);r=o[i>>2]|0;o[n>>2]=i+4;i=e;o[i>>2]=r&65535;o[i+4>>2]=0;break e}case 15:{i=(o[n>>2]|0)+(4-1)&~(4-1);r=o[i>>2]|0;o[n>>2]=i+4;r=(r&255)<<24>>24;i=e;o[i>>2]=r;o[i+4>>2]=((r|0)<0)<<31>>31;break e}case 16:{i=(o[n>>2]|0)+(4-1)&~(4-1);r=o[i>>2]|0;o[n>>2]=i+4;i=e;o[i>>2]=r&255;o[i+4>>2]=0;break e}case 17:{i=(o[n>>2]|0)+(8-1)&~(8-1);u=+c[i>>3];o[n>>2]=i+8;c[e>>3]=u;break e}case 18:{i=(o[n>>2]|0)+(8-1)&~(8-1);u=+c[i>>3];o[n>>2]=i+8;c[e>>3]=u;break e}default:break e}}while(0)}while(0);return}function dT(e,t,n,i){e=e|0;t=t|0;n=n|0;i=i|0;if(!((e|0)==0&(t|0)==0))do{n=n+-1|0;r[n>>0]=u[5694+(e&15)>>0]|0|i;e=rx(e|0,t|0,4)|0;t=A}while(!((e|0)==0&(t|0)==0));return n|0}function pT(e,t,n){e=e|0;t=t|0;n=n|0;if(!((e|0)==0&(t|0)==0))do{n=n+-1|0;r[n>>0]=e&7|48;e=rx(e|0,t|0,3)|0;t=A}while(!((e|0)==0&(t|0)==0));return n|0}function hT(e,t,n){e=e|0;t=t|0;n=n|0;var i=0;if(t>>>0>0|(t|0)==0&e>>>0>4294967295){while(1){i=cx(e|0,t|0,10,0)|0;n=n+-1|0;r[n>>0]=i&255|48;i=e;e=ax(e|0,t|0,10,0)|0;if(!(t>>>0>9|(t|0)==9&i>>>0>4294967295))break;else t=A}t=e}else t=e;if(t)while(1){n=n+-1|0;r[n>>0]=(t>>>0)%10|0|48;if(t>>>0<10)break;else t=(t>>>0)/10|0}return n|0}function vT(e){e=e|0;return ST(e,o[(kT()|0)+188>>2]|0)|0}function mT(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,u=0,a=0,l=0;a=t&255;i=(n|0)!=0;e:do{if(i&(e&3|0)!=0){u=t&255;while(1){if((r[e>>0]|0)==u<<24>>24){l=6;break e}e=e+1|0;n=n+-1|0;i=(n|0)!=0;if(!(i&(e&3|0)!=0)){l=5;break}}}else l=5}while(0);if((l|0)==5)if(i)l=6;else n=0;e:do{if((l|0)==6){u=t&255;if((r[e>>0]|0)!=u<<24>>24){i=V(a,16843009)|0;t:do{if(n>>>0>3)while(1){a=o[e>>2]^i;if((a&-2139062144^-2139062144)&a+-16843009|0)break;e=e+4|0;n=n+-4|0;if(n>>>0<=3){l=11;break t}}else l=11}while(0);if((l|0)==11)if(!n){n=0;break}while(1){if((r[e>>0]|0)==u<<24>>24)break e;e=e+1|0;n=n+-1|0;if(!n){n=0;break}}}}}while(0);return(n|0?e:0)|0}function gT(e,t,n,r,i){e=e|0;t=t|0;n=n|0;r=r|0;i=i|0;var o=0,u=0;u=h;h=h+256|0;o=u;if((n|0)>(r|0)&(i&73728|0)==0){i=n-r|0;tx(o|0,t|0,(i>>>0<256?i:256)|0)|0;if(i>>>0>255){t=n-r|0;do{sT(e,o,256);i=i+-256|0}while(i>>>0>255);i=t&255}sT(e,o,i)}h=u;return}function _T(e,t){e=e|0;t=t|0;if(!e)e=0;else e=DT(e,t,0)|0;return e|0}function yT(e,t,n,i,a,l){e=e|0;t=+t;n=n|0;i=i|0;a=a|0;l=l|0;var s=0,c=0,f=0,d=0,p=0,v=0,m=0,g=0.0,_=0,y=0,b=0,w=0,E=0,D=0,C=0,k=0,S=0,T=0,x=0,O=0,M=0,I=0,R=0;R=h;h=h+560|0;f=R+8|0;b=R;I=R+524|0;M=I;d=R+512|0;o[b>>2]=0;O=d+12|0;bT(t)|0;if((A|0)<0){t=-t;T=1;S=5659}else{T=(a&2049|0)!=0&1;S=(a&2048|0)==0?(a&1|0)==0?5660:5665:5662}bT(t)|0;x=A&2146435072;do{if(x>>>0<2146435072|(x|0)==2146435072&0<0){g=+wT(t,b)*2.0;s=g!=0.0;if(s)o[b>>2]=(o[b>>2]|0)+-1;E=l|32;if((E|0)==97){_=l&32;m=(_|0)==0?S:S+9|0;v=T|2;s=12-i|0;do{if(!(i>>>0>11|(s|0)==0)){t=8.0;do{s=s+-1|0;t=t*16.0}while((s|0)!=0);if((r[m>>0]|0)==45){t=-(t+(-g-t));break}else{t=g+t-t;break}}else t=g}while(0);c=o[b>>2]|0;s=(c|0)<0?0-c|0:c;s=hT(s,((s|0)<0)<<31>>31,O)|0;if((s|0)==(O|0)){s=d+11|0;r[s>>0]=48}r[s+-1>>0]=(c>>31&2)+43;p=s+-2|0;r[p>>0]=l+15;d=(i|0)<1;f=(a&8|0)==0;s=I;do{x=~~t;c=s+1|0;r[s>>0]=u[5694+x>>0]|_;t=(t-+(x|0))*16.0;if((c-M|0)==1?!(f&(d&t==0.0)):0){r[c>>0]=46;s=s+2|0}else s=c}while(t!=0.0);x=s-M|0;M=O-p|0;O=(i|0)!=0&(x+-2|0)<(i|0)?i+2|0:x;s=M+v+O|0;gT(e,32,n,s,a);sT(e,m,v);gT(e,48,n,s,a^65536);sT(e,I,x);gT(e,48,O-x|0,0,0);sT(e,p,M);gT(e,32,n,s,a^8192);break}c=(i|0)<0?6:i;if(s){s=(o[b>>2]|0)+-28|0;o[b>>2]=s;t=g*268435456.0}else{t=g;s=o[b>>2]|0}x=(s|0)<0?f:f+288|0;f=x;do{C=~~t>>>0;o[f>>2]=C;f=f+4|0;t=(t-+(C>>>0))*1.0e9}while(t!=0.0);if((s|0)>0){d=x;v=f;while(1){p=(s|0)<29?s:29;s=v+-4|0;if(s>>>0>=d>>>0){f=0;do{D=nx(o[s>>2]|0,0,p|0)|0;D=ex(D|0,A|0,f|0,0)|0;C=A;w=cx(D|0,C|0,1e9,0)|0;o[s>>2]=w;f=ax(D|0,C|0,1e9,0)|0;s=s+-4|0}while(s>>>0>=d>>>0);if(f){d=d+-4|0;o[d>>2]=f}}f=v;while(1){if(f>>>0<=d>>>0)break;s=f+-4|0;if(!(o[s>>2]|0))f=s;else break}s=(o[b>>2]|0)-p|0;o[b>>2]=s;if((s|0)>0)v=f;else break}}else d=x;if((s|0)<0){i=((c+25|0)/9|0)+1|0;y=(E|0)==102;do{_=0-s|0;_=(_|0)<9?_:9;if(d>>>0>>0){p=(1<<_)+-1|0;v=1e9>>>_;m=0;s=d;do{C=o[s>>2]|0;o[s>>2]=(C>>>_)+m;m=V(C&p,v)|0;s=s+4|0}while(s>>>0>>0);s=(o[d>>2]|0)==0?d+4|0:d;if(!m){d=s;s=f}else{o[f>>2]=m;d=s;s=f+4|0}}else{d=(o[d>>2]|0)==0?d+4|0:d;s=f}f=y?x:d;f=(s-f>>2|0)>(i|0)?f+(i<<2)|0:s;s=(o[b>>2]|0)+_|0;o[b>>2]=s}while((s|0)<0);s=d;i=f}else{s=d;i=f}C=x;if(s>>>0>>0){f=(C-s>>2)*9|0;p=o[s>>2]|0;if(p>>>0>=10){d=10;do{d=d*10|0;f=f+1|0}while(p>>>0>=d>>>0)}}else f=0;y=(E|0)==103;w=(c|0)!=0;d=c-((E|0)!=102?f:0)+((w&y)<<31>>31)|0;if((d|0)<(((i-C>>2)*9|0)+-9|0)){d=d+9216|0;_=x+4+(((d|0)/9|0)+-1024<<2)|0;d=((d|0)%9|0)+1|0;if((d|0)<9){p=10;do{p=p*10|0;d=d+1|0}while((d|0)!=9)}else p=10;v=o[_>>2]|0;m=(v>>>0)%(p>>>0)|0;d=(_+4|0)==(i|0);if(!(d&(m|0)==0)){g=(((v>>>0)/(p>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;D=(p|0)/2|0;t=m>>>0>>0?.5:d&(m|0)==(D|0)?1.0:1.5;if(T){D=(r[S>>0]|0)==45;t=D?-t:t;g=D?-g:g}d=v-m|0;o[_>>2]=d;if(g+t!=g){D=d+p|0;o[_>>2]=D;if(D>>>0>999999999){f=_;while(1){d=f+-4|0;o[f>>2]=0;if(d>>>0>>0){s=s+-4|0;o[s>>2]=0}D=(o[d>>2]|0)+1|0;o[d>>2]=D;if(D>>>0>999999999)f=d;else break}}else d=_;f=(C-s>>2)*9|0;v=o[s>>2]|0;if(v>>>0>=10){p=10;do{p=p*10|0;f=f+1|0}while(v>>>0>=p>>>0)}}else d=_}else d=_;d=d+4|0;d=i>>>0>d>>>0?d:i;D=s}else{d=i;D=s}E=d;while(1){if(E>>>0<=D>>>0){b=0;break}s=E+-4|0;if(!(o[s>>2]|0))E=s;else{b=1;break}}i=0-f|0;do{if(y){s=((w^1)&1)+c|0;if((s|0)>(f|0)&(f|0)>-5){p=l+-1|0;c=s+-1-f|0}else{p=l+-2|0;c=s+-1|0}s=a&8;if(!s){if(b?(k=o[E+-4>>2]|0,(k|0)!=0):0){if(!((k>>>0)%10|0)){d=0;s=10;do{s=s*10|0;d=d+1|0}while(!((k>>>0)%(s>>>0)|0|0))}else d=0}else d=9;s=((E-C>>2)*9|0)+-9|0;if((p|32|0)==102){_=s-d|0;_=(_|0)>0?_:0;c=(c|0)<(_|0)?c:_;_=0;break}else{_=s+f-d|0;_=(_|0)>0?_:0;c=(c|0)<(_|0)?c:_;_=0;break}}else _=s}else{p=l;_=a&8}}while(0);y=c|_;v=(y|0)!=0&1;m=(p|32|0)==102;if(m){w=0;s=(f|0)>0?f:0}else{s=(f|0)<0?i:f;s=hT(s,((s|0)<0)<<31>>31,O)|0;d=O;if((d-s|0)<2)do{s=s+-1|0;r[s>>0]=48}while((d-s|0)<2);r[s+-1>>0]=(f>>31&2)+43;s=s+-2|0;r[s>>0]=p;w=s;s=d-s|0}s=T+1+c+v+s|0;gT(e,32,n,s,a);sT(e,S,T);gT(e,48,n,s,a^65536);if(m){p=D>>>0>x>>>0?x:D;_=I+9|0;v=_;m=I+8|0;d=p;do{f=hT(o[d>>2]|0,0,_)|0;if((d|0)==(p|0)){if((f|0)==(_|0)){r[m>>0]=48;f=m}}else if(f>>>0>I>>>0){tx(I|0,48,f-M|0)|0;do{f=f+-1|0}while(f>>>0>I>>>0)}sT(e,f,v-f|0);d=d+4|0}while(d>>>0<=x>>>0);if(y|0)sT(e,5710,1);if(d>>>0>>0&(c|0)>0)while(1){f=hT(o[d>>2]|0,0,_)|0;if(f>>>0>I>>>0){tx(I|0,48,f-M|0)|0;do{f=f+-1|0}while(f>>>0>I>>>0)}sT(e,f,(c|0)<9?c:9);d=d+4|0;f=c+-9|0;if(!(d>>>0>>0&(c|0)>9)){c=f;break}else c=f}gT(e,48,c+9|0,9,0)}else{y=b?E:D+4|0;if((c|0)>-1){b=I+9|0;_=(_|0)==0;i=b;v=0-M|0;m=I+8|0;p=D;do{f=hT(o[p>>2]|0,0,b)|0;if((f|0)==(b|0)){r[m>>0]=48;f=m}do{if((p|0)==(D|0)){d=f+1|0;sT(e,f,1);if(_&(c|0)<1){f=d;break}sT(e,5710,1);f=d}else{if(f>>>0<=I>>>0)break;tx(I|0,48,f+v|0)|0;do{f=f+-1|0}while(f>>>0>I>>>0)}}while(0);M=i-f|0;sT(e,f,(c|0)>(M|0)?M:c);c=c-M|0;p=p+4|0}while(p>>>0>>0&(c|0)>-1)}gT(e,48,c+18|0,18,0);sT(e,w,O-w|0)}gT(e,32,n,s,a^8192)}else{I=(l&32|0)!=0;s=T+3|0;gT(e,32,n,s,a&-65537);sT(e,S,T);sT(e,t!=t|0.0!=0.0?I?5686:5690:I?5678:5682,3);gT(e,32,n,s,a^8192)}}while(0);h=R;return((s|0)<(n|0)?n:s)|0}function bT(e){e=+e;var t=0;c[d>>3]=e;t=o[d>>2]|0;A=o[d+4>>2]|0;return t|0}function wT(e,t){e=+e;t=t|0;return+ +ET(e,t)}function ET(e,t){e=+e;t=t|0;var n=0,r=0,i=0;c[d>>3]=e;n=o[d>>2]|0;r=o[d+4>>2]|0;i=rx(n|0,r|0,52)|0;switch(i&2047){case 0:{if(e!=0.0){e=+ET(e*18446744073709551616.0,t);n=(o[t>>2]|0)+-64|0}else n=0;o[t>>2]=n;break}case 2047:break;default:{o[t>>2]=(i&2047)+-1022;o[d>>2]=n;o[d+4>>2]=r&-2146435073|1071644672;e=+c[d>>3]}}return+e}function DT(e,t,n){e=e|0;t=t|0;n=n|0;do{if(e){if(t>>>0<128){r[e>>0]=t;e=1;break}if(!(o[o[(CT()|0)+188>>2]>>2]|0))if((t&-128|0)==57216){r[e>>0]=t;e=1;break}else{o[(QS()|0)>>2]=84;e=-1;break}if(t>>>0<2048){r[e>>0]=t>>>6|192;r[e+1>>0]=t&63|128;e=2;break}if(t>>>0<55296|(t&-8192|0)==57344){r[e>>0]=t>>>12|224;r[e+1>>0]=t>>>6&63|128;r[e+2>>0]=t&63|128;e=3;break}if((t+-65536|0)>>>0<1048576){r[e>>0]=t>>>18|240;r[e+1>>0]=t>>>12&63|128;r[e+2>>0]=t>>>6&63|128;r[e+3>>0]=t&63|128;e=4;break}else{o[(QS()|0)>>2]=84;e=-1;break}}else e=1}while(0);return e|0}function CT(){return eT()|0}function kT(){return eT()|0}function ST(e,t){e=e|0;t=t|0;var n=0,i=0;i=0;while(1){if((u[5712+i>>0]|0)==(e|0)){e=2;break}n=i+1|0;if((n|0)==87){n=5800;i=87;e=5;break}else i=n}if((e|0)==2)if(!i)n=5800;else{n=5800;e=5}if((e|0)==5)while(1){do{e=n;n=n+1|0}while((r[e>>0]|0)!=0);i=i+-1|0;if(!i)break;else e=5}return TT(n,o[t+20>>2]|0)|0}function TT(e,t){e=e|0;t=t|0;return xT(e,t)|0}function xT(e,t){e=e|0;t=t|0;if(!t)t=0;else t=AT(o[t>>2]|0,o[t+4>>2]|0,e)|0;return(t|0?t:e)|0}function AT(e,t,n){e=e|0;t=t|0;n=n|0;var i=0,u=0,a=0,l=0,s=0,c=0,f=0,d=0,p=0,h=0;h=(o[e>>2]|0)+1794895138|0;a=OT(o[e+8>>2]|0,h)|0;i=OT(o[e+12>>2]|0,h)|0;u=OT(o[e+16>>2]|0,h)|0;e:do{if((a>>>0>>2>>>0?(p=t-(a<<2)|0,i>>>0