From e00097bb8a9ac7769ab801d6c7cb11f00f8121f3 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Thu, 7 Sep 2023 14:04:25 +0100 Subject: [PATCH] fix: update action/core to avoid warnings and add missing output in action.yml (#85) --- action.yml | 2 + dist/index.js | 2114 ++++++++++++++++++++++++++++-------- dist/index.js.map | 2 +- dist/licenses.txt | 23 +- dist/sourcemap-register.js | 2 +- package-lock.json | 63 +- package.json | 4 +- 7 files changed, 1689 insertions(+), 521 deletions(-) diff --git a/action.yml b/action.yml index 556fb8c..95bfa19 100644 --- a/action.yml +++ b/action.yml @@ -26,6 +26,8 @@ inputs: outputs: cid: description: 'The IPFS Content ID for the directory' + url: + description: 'The IPFS Gateway URL' runs: using: 'node16' main: 'dist/index.js' diff --git a/dist/index.js b/dist/index.js index 91aa8a8..d197af5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -27,7 +27,7 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.issue = exports.issueCommand = void 0; -const os = __importStar(__nccwpck_require__(2087)); +const os = __importStar(__nccwpck_require__(2037)); const utils_1 = __nccwpck_require__(5278); /** * Commands @@ -138,8 +138,8 @@ exports.getIDToken = exports.getState = exports.saveState = exports.group = expo const command_1 = __nccwpck_require__(7351); const file_command_1 = __nccwpck_require__(717); const utils_1 = __nccwpck_require__(5278); -const os = __importStar(__nccwpck_require__(2087)); -const path = __importStar(__nccwpck_require__(5622)); +const os = __importStar(__nccwpck_require__(2037)); +const path = __importStar(__nccwpck_require__(1017)); const oidc_utils_1 = __nccwpck_require__(8041); /** * The code to exit an action @@ -169,13 +169,9 @@ function exportVariable(name, val) { process.env[name] = convertedVal; const filePath = process.env['GITHUB_ENV'] || ''; if (filePath) { - const delimiter = '_GitHubActionsFileCommandDelimeter_'; - const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`; - file_command_1.issueCommand('ENV', commandValue); - } - else { - command_1.issueCommand('set-env', { name }, convertedVal); + return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val)); } + command_1.issueCommand('set-env', { name }, convertedVal); } exports.exportVariable = exportVariable; /** @@ -193,7 +189,7 @@ exports.setSecret = setSecret; function addPath(inputPath) { const filePath = process.env['GITHUB_PATH'] || ''; if (filePath) { - file_command_1.issueCommand('PATH', inputPath); + file_command_1.issueFileCommand('PATH', inputPath); } else { command_1.issueCommand('add-path', {}, inputPath); @@ -233,7 +229,10 @@ function getMultilineInput(name, options) { const inputs = getInput(name, options) .split('\n') .filter(x => x !== ''); - return inputs; + if (options && options.trimWhitespace === false) { + return inputs; + } + return inputs.map(input => input.trim()); } exports.getMultilineInput = getMultilineInput; /** @@ -266,8 +265,12 @@ exports.getBooleanInput = getBooleanInput; */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function setOutput(name, value) { + const filePath = process.env['GITHUB_OUTPUT'] || ''; + if (filePath) { + return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value)); + } process.stdout.write(os.EOL); - command_1.issueCommand('set-output', { name }, value); + command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value)); } exports.setOutput = setOutput; /** @@ -396,7 +399,11 @@ exports.group = group; */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function saveState(name, value) { - command_1.issueCommand('save-state', { name }, value); + const filePath = process.env['GITHUB_STATE'] || ''; + if (filePath) { + return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value)); + } + command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value)); } exports.saveState = saveState; /** @@ -415,6 +422,23 @@ function getIDToken(aud) { }); } exports.getIDToken = getIDToken; +/** + * Summary exports + */ +var summary_1 = __nccwpck_require__(1327); +Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } })); +/** + * @deprecated use core.summary + */ +var summary_2 = __nccwpck_require__(1327); +Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } })); +/** + * Path exports + */ +var path_utils_1 = __nccwpck_require__(2981); +Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } })); +Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } })); +Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } })); //# sourceMappingURL=core.js.map /***/ }), @@ -445,13 +469,14 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.issueCommand = void 0; +exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ -const fs = __importStar(__nccwpck_require__(5747)); -const os = __importStar(__nccwpck_require__(2087)); +const fs = __importStar(__nccwpck_require__(7147)); +const os = __importStar(__nccwpck_require__(2037)); +const uuid_1 = __nccwpck_require__(5840); const utils_1 = __nccwpck_require__(5278); -function issueCommand(command, message) { +function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; if (!filePath) { throw new Error(`Unable to find environment variable for file command ${command}`); @@ -463,7 +488,22 @@ function issueCommand(command, message) { encoding: 'utf8' }); } -exports.issueCommand = issueCommand; +exports.issueFileCommand = issueFileCommand; +function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${uuid_1.v4()}`; + const convertedValue = utils_1.toCommandValue(value); + // These should realistically never happen, but just in case someone finds a + // way to exploit uuid generation let's not allow keys or values that contain + // the delimiter. + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); + } + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); + } + return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`; +} +exports.prepareKeyValueMessage = prepareKeyValueMessage; //# sourceMappingURL=file-command.js.map /***/ }), @@ -484,8 +524,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.OidcClient = void 0; -const http_client_1 = __nccwpck_require__(9925); -const auth_1 = __nccwpck_require__(3702); +const http_client_1 = __nccwpck_require__(6255); +const auth_1 = __nccwpck_require__(5526); const core_1 = __nccwpck_require__(2186); class OidcClient { static createHttpClient(allowRetry = true, maxRetry = 10) { @@ -552,6 +592,361 @@ exports.OidcClient = OidcClient; /***/ }), +/***/ 2981: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0; +const path = __importStar(__nccwpck_require__(1017)); +/** + * toPosixPath converts the given path to the posix form. On Windows, \\ will be + * replaced with /. + * + * @param pth. Path to transform. + * @return string Posix path. + */ +function toPosixPath(pth) { + return pth.replace(/[\\]/g, '/'); +} +exports.toPosixPath = toPosixPath; +/** + * toWin32Path converts the given path to the win32 form. On Linux, / will be + * replaced with \\. + * + * @param pth. Path to transform. + * @return string Win32 path. + */ +function toWin32Path(pth) { + return pth.replace(/[/]/g, '\\'); +} +exports.toWin32Path = toWin32Path; +/** + * toPlatformPath converts the given path to a platform-specific path. It does + * this by replacing instances of / and \ with the platform-specific path + * separator. + * + * @param pth The path to platformize. + * @return string The platform-specific path. + */ +function toPlatformPath(pth) { + return pth.replace(/[/\\]/g, path.sep); +} +exports.toPlatformPath = toPlatformPath; +//# sourceMappingURL=path-utils.js.map + +/***/ }), + +/***/ 1327: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0; +const os_1 = __nccwpck_require__(2037); +const fs_1 = __nccwpck_require__(7147); +const { access, appendFile, writeFile } = fs_1.promises; +exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY'; +exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary'; +class Summary { + constructor() { + this._buffer = ''; + } + /** + * Finds the summary file path from the environment, rejects if env var is not found or file does not exist + * Also checks r/w permissions. + * + * @returns step summary file path + */ + filePath() { + return __awaiter(this, void 0, void 0, function* () { + if (this._filePath) { + return this._filePath; + } + const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR]; + if (!pathFromEnv) { + throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`); + } + try { + yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); + } + catch (_a) { + throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); + } + this._filePath = pathFromEnv; + return this._filePath; + }); + } + /** + * Wraps content in an HTML tag, adding any HTML attributes + * + * @param {string} tag HTML tag to wrap + * @param {string | null} content content within the tag + * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add + * + * @returns {string} content wrapped in HTML element + */ + wrap(tag, content, attrs = {}) { + const htmlAttrs = Object.entries(attrs) + .map(([key, value]) => ` ${key}="${value}"`) + .join(''); + if (!content) { + return `<${tag}${htmlAttrs}>`; + } + return `<${tag}${htmlAttrs}>${content}`; + } + /** + * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default. + * + * @param {SummaryWriteOptions} [options] (optional) options for write operation + * + * @returns {Promise} summary instance + */ + write(options) { + return __awaiter(this, void 0, void 0, function* () { + const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite); + const filePath = yield this.filePath(); + const writeFunc = overwrite ? writeFile : appendFile; + yield writeFunc(filePath, this._buffer, { encoding: 'utf8' }); + return this.emptyBuffer(); + }); + } + /** + * Clears the summary buffer and wipes the summary file + * + * @returns {Summary} summary instance + */ + clear() { + return __awaiter(this, void 0, void 0, function* () { + return this.emptyBuffer().write({ overwrite: true }); + }); + } + /** + * Returns the current summary buffer as a string + * + * @returns {string} string of summary buffer + */ + stringify() { + return this._buffer; + } + /** + * If the summary buffer is empty + * + * @returns {boolen} true if the buffer is empty + */ + isEmptyBuffer() { + return this._buffer.length === 0; + } + /** + * Resets the summary buffer without writing to summary file + * + * @returns {Summary} summary instance + */ + emptyBuffer() { + this._buffer = ''; + return this; + } + /** + * Adds raw text to the summary buffer + * + * @param {string} text content to add + * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false) + * + * @returns {Summary} summary instance + */ + addRaw(text, addEOL = false) { + this._buffer += text; + return addEOL ? this.addEOL() : this; + } + /** + * Adds the operating system-specific end-of-line marker to the buffer + * + * @returns {Summary} summary instance + */ + addEOL() { + return this.addRaw(os_1.EOL); + } + /** + * Adds an HTML codeblock to the summary buffer + * + * @param {string} code content to render within fenced code block + * @param {string} lang (optional) language to syntax highlight code + * + * @returns {Summary} summary instance + */ + addCodeBlock(code, lang) { + const attrs = Object.assign({}, (lang && { lang })); + const element = this.wrap('pre', this.wrap('code', code), attrs); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML list to the summary buffer + * + * @param {string[]} items list of items to render + * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false) + * + * @returns {Summary} summary instance + */ + addList(items, ordered = false) { + const tag = ordered ? 'ol' : 'ul'; + const listItems = items.map(item => this.wrap('li', item)).join(''); + const element = this.wrap(tag, listItems); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML table to the summary buffer + * + * @param {SummaryTableCell[]} rows table rows + * + * @returns {Summary} summary instance + */ + addTable(rows) { + const tableBody = rows + .map(row => { + const cells = row + .map(cell => { + if (typeof cell === 'string') { + return this.wrap('td', cell); + } + const { header, data, colspan, rowspan } = cell; + const tag = header ? 'th' : 'td'; + const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan })); + return this.wrap(tag, data, attrs); + }) + .join(''); + return this.wrap('tr', cells); + }) + .join(''); + const element = this.wrap('table', tableBody); + return this.addRaw(element).addEOL(); + } + /** + * Adds a collapsable HTML details element to the summary buffer + * + * @param {string} label text for the closed state + * @param {string} content collapsable content + * + * @returns {Summary} summary instance + */ + addDetails(label, content) { + const element = this.wrap('details', this.wrap('summary', label) + content); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML image tag to the summary buffer + * + * @param {string} src path to the image you to embed + * @param {string} alt text description of the image + * @param {SummaryImageOptions} options (optional) addition image attributes + * + * @returns {Summary} summary instance + */ + addImage(src, alt, options) { + const { width, height } = options || {}; + const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height })); + const element = this.wrap('img', null, Object.assign({ src, alt }, attrs)); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML section heading element + * + * @param {string} text heading text + * @param {number | string} [level=1] (optional) the heading level, default: 1 + * + * @returns {Summary} summary instance + */ + addHeading(text, level) { + const tag = `h${level}`; + const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag) + ? tag + : 'h1'; + const element = this.wrap(allowedTag, text); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML thematic break (
) to the summary buffer + * + * @returns {Summary} summary instance + */ + addSeparator() { + const element = this.wrap('hr', null); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML line break (
) to the summary buffer + * + * @returns {Summary} summary instance + */ + addBreak() { + const element = this.wrap('br', null); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML blockquote to the summary buffer + * + * @param {string} text quote text + * @param {string} cite (optional) citation url + * + * @returns {Summary} summary instance + */ + addQuote(text, cite) { + const attrs = Object.assign({}, (cite && { cite })); + const element = this.wrap('blockquote', text, attrs); + return this.addRaw(element).addEOL(); + } + /** + * Adds an HTML anchor tag to the summary buffer + * + * @param {string} text link text/content + * @param {string} href hyperlink + * + * @returns {Summary} summary instance + */ + addLink(text, href) { + const element = this.wrap('a', text, { href }); + return this.addRaw(element).addEOL(); + } +} +const _summary = new Summary(); +/** + * @deprecated use `core.summary` + */ +exports.markdownSummary = _summary; +exports.summary = _summary; +//# sourceMappingURL=summary.js.map + +/***/ }), + /***/ 5278: /***/ ((__unused_webpack_module, exports) => { @@ -599,28 +994,41 @@ exports.toCommandProperties = toCommandProperties; /***/ }), -/***/ 3702: -/***/ ((__unused_webpack_module, exports) => { +/***/ 5526: +/***/ (function(__unused_webpack_module, exports) { "use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0; class BasicCredentialHandler { constructor(username, password) { this.username = username; this.password = password; } prepareRequest(options) { - options.headers['Authorization'] = - 'Basic ' + - Buffer.from(this.username + ':' + this.password).toString('base64'); + if (!options.headers) { + throw Error('The request has no headers'); + } + options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`; } // This handler cannot handle 401 - canHandleAuthentication(response) { + canHandleAuthentication() { return false; } - handleAuthentication(httpClient, requestInfo, objs) { - return null; + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error('not implemented'); + }); } } exports.BasicCredentialHandler = BasicCredentialHandler; @@ -631,14 +1039,19 @@ class BearerCredentialHandler { // currently implements pre-authorization // TODO: support preAuth = false where it hooks on 401 prepareRequest(options) { - options.headers['Authorization'] = 'Bearer ' + this.token; + if (!options.headers) { + throw Error('The request has no headers'); + } + options.headers['Authorization'] = `Bearer ${this.token}`; } // This handler cannot handle 401 - canHandleAuthentication(response) { + canHandleAuthentication() { return false; } - handleAuthentication(httpClient, requestInfo, objs) { - return null; + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error('not implemented'); + }); } } exports.BearerCredentialHandler = BearerCredentialHandler; @@ -649,32 +1062,66 @@ class PersonalAccessTokenCredentialHandler { // currently implements pre-authorization // TODO: support preAuth = false where it hooks on 401 prepareRequest(options) { - options.headers['Authorization'] = - 'Basic ' + Buffer.from('PAT:' + this.token).toString('base64'); + if (!options.headers) { + throw Error('The request has no headers'); + } + options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`; } // This handler cannot handle 401 - canHandleAuthentication(response) { + canHandleAuthentication() { return false; } - handleAuthentication(httpClient, requestInfo, objs) { - return null; + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error('not implemented'); + }); } } exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; - +//# sourceMappingURL=auth.js.map /***/ }), -/***/ 9925: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 6255: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; +/* eslint-disable @typescript-eslint/no-explicit-any */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -const http = __nccwpck_require__(8605); -const https = __nccwpck_require__(7211); -const pm = __nccwpck_require__(6443); -let tunnel; +exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; +const http = __importStar(__nccwpck_require__(3685)); +const https = __importStar(__nccwpck_require__(5687)); +const pm = __importStar(__nccwpck_require__(9835)); +const tunnel = __importStar(__nccwpck_require__(4294)); var HttpCodes; (function (HttpCodes) { HttpCodes[HttpCodes["OK"] = 200] = "OK"; @@ -719,7 +1166,7 @@ var MediaTypes; * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com */ function getProxyUrl(serverUrl) { - let proxyUrl = pm.getProxyUrl(new URL(serverUrl)); + const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); return proxyUrl ? proxyUrl.href : ''; } exports.getProxyUrl = getProxyUrl; @@ -752,20 +1199,22 @@ class HttpClientResponse { this.message = message; } readBody() { - return new Promise(async (resolve, reject) => { - let output = Buffer.alloc(0); - this.message.on('data', (chunk) => { - output = Buffer.concat([output, chunk]); - }); - this.message.on('end', () => { - resolve(output.toString()); - }); + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { + let output = Buffer.alloc(0); + this.message.on('data', (chunk) => { + output = Buffer.concat([output, chunk]); + }); + this.message.on('end', () => { + resolve(output.toString()); + }); + })); }); } } exports.HttpClientResponse = HttpClientResponse; function isHttps(requestUrl) { - let parsedUrl = new URL(requestUrl); + const parsedUrl = new URL(requestUrl); return parsedUrl.protocol === 'https:'; } exports.isHttps = isHttps; @@ -808,141 +1257,169 @@ class HttpClient { } } options(requestUrl, additionalHeaders) { - return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); + return __awaiter(this, void 0, void 0, function* () { + return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); + }); } get(requestUrl, additionalHeaders) { - return this.request('GET', requestUrl, null, additionalHeaders || {}); + return __awaiter(this, void 0, void 0, function* () { + return this.request('GET', requestUrl, null, additionalHeaders || {}); + }); } del(requestUrl, additionalHeaders) { - return this.request('DELETE', requestUrl, null, additionalHeaders || {}); + return __awaiter(this, void 0, void 0, function* () { + return this.request('DELETE', requestUrl, null, additionalHeaders || {}); + }); } post(requestUrl, data, additionalHeaders) { - return this.request('POST', requestUrl, data, additionalHeaders || {}); + return __awaiter(this, void 0, void 0, function* () { + return this.request('POST', requestUrl, data, additionalHeaders || {}); + }); } patch(requestUrl, data, additionalHeaders) { - return this.request('PATCH', requestUrl, data, additionalHeaders || {}); + return __awaiter(this, void 0, void 0, function* () { + return this.request('PATCH', requestUrl, data, additionalHeaders || {}); + }); } put(requestUrl, data, additionalHeaders) { - return this.request('PUT', requestUrl, data, additionalHeaders || {}); + return __awaiter(this, void 0, void 0, function* () { + return this.request('PUT', requestUrl, data, additionalHeaders || {}); + }); } head(requestUrl, additionalHeaders) { - return this.request('HEAD', requestUrl, null, additionalHeaders || {}); + return __awaiter(this, void 0, void 0, function* () { + return this.request('HEAD', requestUrl, null, additionalHeaders || {}); + }); } sendStream(verb, requestUrl, stream, additionalHeaders) { - return this.request(verb, requestUrl, stream, additionalHeaders); + return __awaiter(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream, additionalHeaders); + }); } /** * Gets a typed object from an endpoint * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise */ - async getJson(requestUrl, additionalHeaders = {}) { - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - let res = await this.get(requestUrl, additionalHeaders); - return this._processResponse(res, this.requestOptions); - } - async postJson(requestUrl, obj, additionalHeaders = {}) { - let data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - let res = await this.post(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - } - async putJson(requestUrl, obj, additionalHeaders = {}) { - let data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - let res = await this.put(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - } - async patchJson(requestUrl, obj, additionalHeaders = {}) { - let data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - let res = await this.patch(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); + getJson(requestUrl, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + const res = yield this.get(requestUrl, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + postJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + const res = yield this.post(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + putJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + const res = yield this.put(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + patchJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + const res = yield this.patch(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); } /** * Makes a raw http request. * All other methods such as get, post, patch, and request ultimately call this. * Prefer get, del, post and patch */ - async request(verb, requestUrl, data, headers) { - if (this._disposed) { - throw new Error('Client has already been disposed.'); - } - let parsedUrl = new URL(requestUrl); - let info = this._prepareRequest(verb, parsedUrl, headers); - // Only perform retries on reads since writes may not be idempotent. - let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1 - ? this._maxRetries + 1 - : 1; - let numTries = 0; - let response; - while (numTries < maxTries) { - response = await this.requestRaw(info, data); - // Check if it's an authentication challenge - if (response && - response.message && - response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (let i = 0; i < this.handlers.length; i++) { - if (this.handlers[i].canHandleAuthentication(response)) { - authenticationHandler = this.handlers[i]; - break; + request(verb, requestUrl, data, headers) { + return __awaiter(this, void 0, void 0, function* () { + if (this._disposed) { + throw new Error('Client has already been disposed.'); + } + const parsedUrl = new URL(requestUrl); + let info = this._prepareRequest(verb, parsedUrl, headers); + // Only perform retries on reads since writes may not be idempotent. + const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) + ? this._maxRetries + 1 + : 1; + let numTries = 0; + let response; + do { + response = yield this.requestRaw(info, data); + // Check if it's an authentication challenge + if (response && + response.message && + response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info, data); + } + else { + // We have received an unauthorized response but have no handlers to handle it. + // Let the response return to the caller. + return response; } } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info, data); + let redirectsRemaining = this._maxRedirects; + while (response.message.statusCode && + HttpRedirectCodes.includes(response.message.statusCode) && + this._allowRedirects && + redirectsRemaining > 0) { + const redirectUrl = response.message.headers['location']; + if (!redirectUrl) { + // if there's no location to redirect to, we won't + break; + } + const parsedRedirectUrl = new URL(redirectUrl); + if (parsedUrl.protocol === 'https:' && + parsedUrl.protocol !== parsedRedirectUrl.protocol && + !this._allowRedirectDowngrade) { + throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.'); + } + // we need to finish reading the response before reassigning response + // which will leak the open socket. + yield response.readBody(); + // strip authorization header if redirected to a different hostname + if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { + for (const header in headers) { + // header names are case insensitive + if (header.toLowerCase() === 'authorization') { + delete headers[header]; + } + } + } + // let's make the request with the new redirectUrl + info = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info, data); + redirectsRemaining--; } - else { - // We have received an unauthorized response but have no handlers to handle it. - // Let the response return to the caller. + if (!response.message.statusCode || + !HttpResponseRetryCodes.includes(response.message.statusCode)) { + // If not a retry code, return immediately instead of retrying return response; } - } - let redirectsRemaining = this._maxRedirects; - while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 && - this._allowRedirects && - redirectsRemaining > 0) { - const redirectUrl = response.message.headers['location']; - if (!redirectUrl) { - // if there's no location to redirect to, we won't - break; - } - let parsedRedirectUrl = new URL(redirectUrl); - if (parsedUrl.protocol == 'https:' && - parsedUrl.protocol != parsedRedirectUrl.protocol && - !this._allowRedirectDowngrade) { - throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.'); + numTries += 1; + if (numTries < maxTries) { + yield response.readBody(); + yield this._performExponentialBackoff(numTries); } - // we need to finish reading the response before reassigning response - // which will leak the open socket. - await response.readBody(); - // strip authorization header if redirected to a different hostname - if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { - for (let header in headers) { - // header names are case insensitive - if (header.toLowerCase() === 'authorization') { - delete headers[header]; - } - } - } - // let's make the request with the new redirectUrl - info = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = await this.requestRaw(info, data); - redirectsRemaining--; - } - if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) { - // If not a retry code, return immediately instead of retrying - return response; - } - numTries += 1; - if (numTries < maxTries) { - await response.readBody(); - await this._performExponentialBackoff(numTries); - } - } - return response; + } while (numTries < maxTries); + return response; + }); } /** * Needs to be called if keepAlive is set to true in request options. @@ -959,14 +1436,22 @@ class HttpClient { * @param data */ requestRaw(info, data) { - return new Promise((resolve, reject) => { - let callbackForResult = function (err, res) { - if (err) { - reject(err); + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } + else if (!res) { + // If `err` is not passed, then `res` must be passed. + reject(new Error('Unknown error')); + } + else { + resolve(res); + } } - resolve(res); - }; - this.requestRawWithCallback(info, data, callbackForResult); + this.requestRawWithCallback(info, data, callbackForResult); + }); }); } /** @@ -976,21 +1461,24 @@ class HttpClient { * @param onResult */ requestRawWithCallback(info, data, onResult) { - let socket; if (typeof data === 'string') { + if (!info.options.headers) { + info.options.headers = {}; + } info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8'); } let callbackCalled = false; - let handleResult = (err, res) => { + function handleResult(err, res) { if (!callbackCalled) { callbackCalled = true; onResult(err, res); } - }; - let req = info.httpModule.request(info.options, (msg) => { - let res = new HttpClientResponse(msg); - handleResult(null, res); + } + const req = info.httpModule.request(info.options, (msg) => { + const res = new HttpClientResponse(msg); + handleResult(undefined, res); }); + let socket; req.on('socket', sock => { socket = sock; }); @@ -999,12 +1487,12 @@ class HttpClient { if (socket) { socket.end(); } - handleResult(new Error('Request timeout: ' + info.options.path), null); + handleResult(new Error(`Request timeout: ${info.options.path}`)); }); req.on('error', function (err) { // err has statusCode property // res should have headers - handleResult(err, null); + handleResult(err); }); if (data && typeof data === 'string') { req.write(data, 'utf8'); @@ -1025,7 +1513,7 @@ class HttpClient { * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com */ getAgent(serverUrl) { - let parsedUrl = new URL(serverUrl); + const parsedUrl = new URL(serverUrl); return this._getAgent(parsedUrl); } _prepareRequest(method, requestUrl, headers) { @@ -1049,21 +1537,19 @@ class HttpClient { info.options.agent = this._getAgent(info.parsedUrl); // gives handlers an opportunity to participate if (this.handlers) { - this.handlers.forEach(handler => { + for (const handler of this.handlers) { handler.prepareRequest(info.options); - }); + } } return info; } _mergeHeaders(headers) { - const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers)); + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); } return lowercaseKeys(headers || {}); } _getExistingOrDefaultHeader(additionalHeaders, header, _default) { - const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); let clientHeader; if (this.requestOptions && this.requestOptions.headers) { clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; @@ -1072,8 +1558,8 @@ class HttpClient { } _getAgent(parsedUrl) { let agent; - let proxyUrl = pm.getProxyUrl(parsedUrl); - let useProxy = proxyUrl && proxyUrl.hostname; + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; if (this._keepAlive && useProxy) { agent = this._proxyAgent; } @@ -1081,29 +1567,22 @@ class HttpClient { agent = this._agent; } // if agent is already assigned use that agent. - if (!!agent) { + if (agent) { return agent; } const usingSsl = parsedUrl.protocol === 'https:'; let maxSockets = 100; - if (!!this.requestOptions) { + if (this.requestOptions) { maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; } - if (useProxy) { - // If using proxy, need tunnel - if (!tunnel) { - tunnel = __nccwpck_require__(4294); - } + // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis. + if (proxyUrl && proxyUrl.hostname) { const agentOptions = { - maxSockets: maxSockets, + maxSockets, keepAlive: this._keepAlive, - proxy: { - ...((proxyUrl.username || proxyUrl.password) && { - proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` - }), - host: proxyUrl.hostname, - port: proxyUrl.port - } + proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && { + proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` + })), { host: proxyUrl.hostname, port: proxyUrl.port }) }; let tunnelAgent; const overHttps = proxyUrl.protocol === 'https:'; @@ -1118,7 +1597,7 @@ class HttpClient { } // if reusing agent across request and tunneling agent isn't assigned create a new agent if (this._keepAlive && !agent) { - const options = { keepAlive: this._keepAlive, maxSockets: maxSockets }; + const options = { keepAlive: this._keepAlive, maxSockets }; agent = usingSsl ? new https.Agent(options) : new http.Agent(options); this._agent = agent; } @@ -1137,109 +1616,121 @@ class HttpClient { return agent; } _performExponentialBackoff(retryNumber) { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise(resolve => setTimeout(() => resolve(), ms)); - } - static dateTimeDeserializer(key, value) { - if (typeof value === 'string') { - let a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; - } - } - return value; + return __awaiter(this, void 0, void 0, function* () { + retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); + const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); + return new Promise(resolve => setTimeout(() => resolve(), ms)); + }); } - async _processResponse(res, options) { - return new Promise(async (resolve, reject) => { - const statusCode = res.message.statusCode; - const response = { - statusCode: statusCode, - result: null, - headers: {} - }; - // not found leads to null obj returned - if (statusCode == HttpCodes.NotFound) { - resolve(response); - } - let obj; - let contents; - // get the result from the body - try { - contents = await res.readBody(); - if (contents && contents.length > 0) { - if (options && options.deserializeDates) { - obj = JSON.parse(contents, HttpClient.dateTimeDeserializer); + _processResponse(res, options) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + // not found leads to null obj returned + if (statusCode === HttpCodes.NotFound) { + resolve(response); + } + // get the result from the body + function dateTimeDeserializer(key, value) { + if (typeof value === 'string') { + const a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; + } } - else { - obj = JSON.parse(contents); + return value; + } + let obj; + let contents; + try { + contents = yield res.readBody(); + if (contents && contents.length > 0) { + if (options && options.deserializeDates) { + obj = JSON.parse(contents, dateTimeDeserializer); + } + else { + obj = JSON.parse(contents); + } + response.result = obj; } - response.result = obj; + response.headers = res.message.headers; } - response.headers = res.message.headers; - } - catch (err) { - // Invalid resource (contents not json); leaving result obj null - } - // note that 3xx redirects are handled by the http layer. - if (statusCode > 299) { - let msg; - // if exception/error in body, attempt to get better error - if (obj && obj.message) { - msg = obj.message; + catch (err) { + // Invalid resource (contents not json); leaving result obj null } - else if (contents && contents.length > 0) { - // it may be the case that the exception is in the body message as string - msg = contents; + // note that 3xx redirects are handled by the http layer. + if (statusCode > 299) { + let msg; + // if exception/error in body, attempt to get better error + if (obj && obj.message) { + msg = obj.message; + } + else if (contents && contents.length > 0) { + // it may be the case that the exception is in the body message as string + msg = contents; + } + else { + msg = `Failed request: (${statusCode})`; + } + const err = new HttpClientError(msg, statusCode); + err.result = response.result; + reject(err); } else { - msg = 'Failed request: (' + statusCode + ')'; + resolve(response); } - let err = new HttpClientError(msg, statusCode); - err.result = response.result; - reject(err); - } - else { - resolve(response); - } + })); }); } } exports.HttpClient = HttpClient; - +const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); +//# sourceMappingURL=index.js.map /***/ }), -/***/ 6443: +/***/ 9835: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.checkBypass = exports.getProxyUrl = void 0; function getProxyUrl(reqUrl) { - let usingSsl = reqUrl.protocol === 'https:'; - let proxyUrl; + const usingSsl = reqUrl.protocol === 'https:'; if (checkBypass(reqUrl)) { - return proxyUrl; + return undefined; } - let proxyVar; - if (usingSsl) { - proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY']; + const proxyVar = (() => { + if (usingSsl) { + return process.env['https_proxy'] || process.env['HTTPS_PROXY']; + } + else { + return process.env['http_proxy'] || process.env['HTTP_PROXY']; + } + })(); + if (proxyVar) { + return new URL(proxyVar); } else { - proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY']; - } - if (proxyVar) { - proxyUrl = new URL(proxyVar); + return undefined; } - return proxyUrl; } exports.getProxyUrl = getProxyUrl; function checkBypass(reqUrl) { if (!reqUrl.hostname) { return false; } - let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; + } + const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; if (!noProxy) { return false; } @@ -1255,23 +1746,34 @@ function checkBypass(reqUrl) { reqPort = 443; } // Format the request hostname and hostname with port - let upperReqHosts = [reqUrl.hostname.toUpperCase()]; + const upperReqHosts = [reqUrl.hostname.toUpperCase()]; if (typeof reqPort === 'number') { upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); } // Compare request host against noproxy - for (let upperNoProxyItem of noProxy + for (const upperNoProxyItem of noProxy .split(',') .map(x => x.trim().toUpperCase()) .filter(x => x)) { - if (upperReqHosts.some(x => x === upperNoProxyItem)) { + if (upperNoProxyItem === '*' || + upperReqHosts.some(x => x === upperNoProxyItem || + x.endsWith(`.${upperNoProxyItem}`) || + (upperNoProxyItem.startsWith('.') && + x.endsWith(`${upperNoProxyItem}`)))) { return true; } } return false; } exports.checkBypass = checkBypass; - +function isLoopbackAddress(host) { + const hostLower = host.toLowerCase(); + return (hostLower === 'localhost' || + hostLower.startsWith('127.') || + hostLower.startsWith('[::1]') || + hostLower.startsWith('[0:0:0:0:0:0:0:1]')); +} +//# sourceMappingURL=proxy.js.map /***/ }), @@ -1737,7 +2239,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); var varint = __nccwpck_require__(8018); var cid = __nccwpck_require__(6447); var Digest = __nccwpck_require__(76); -var dagCbor = __nccwpck_require__(3829); +var dagCbor = __nccwpck_require__(8614); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } @@ -1987,7 +2489,7 @@ exports.readHeader = readHeader; Object.defineProperty(exports, "__esModule", ({ value: true })); var varint = __nccwpck_require__(8018); -var dagCbor = __nccwpck_require__(3829); +var dagCbor = __nccwpck_require__(8614); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } @@ -2038,8 +2540,8 @@ exports.createHeader = createHeader; Object.defineProperty(exports, "__esModule", ({ value: true })); -var fs = __nccwpck_require__(5747); -var stream = __nccwpck_require__(2413); +var fs = __nccwpck_require__(7147); +var stream = __nccwpck_require__(2781); var cid = __nccwpck_require__(6447); var indexer = __nccwpck_require__(3038); var reader = __nccwpck_require__(7677); @@ -2445,8 +2947,8 @@ exports.__browser = __browser; Object.defineProperty(exports, "__esModule", ({ value: true })); -var fs = __nccwpck_require__(5747); -var util = __nccwpck_require__(1669); +var fs = __nccwpck_require__(7147); +var util = __nccwpck_require__(3837); var readerBrowser = __nccwpck_require__(1599); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } @@ -2617,8 +3119,8 @@ exports.__browser = __browser; Object.defineProperty(exports, "__esModule", ({ value: true })); -var fs = __nccwpck_require__(5747); -var util = __nccwpck_require__(1669); +var fs = __nccwpck_require__(7147); +var util = __nccwpck_require__(3837); var writerBrowser = __nccwpck_require__(5479); var decoder = __nccwpck_require__(7490); var encoder = __nccwpck_require__(9464); @@ -2668,7 +3170,7 @@ exports.__browser = __browser; /***/ }), -/***/ 3829: +/***/ 8614: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -7902,9 +8404,9 @@ module.exports = createError; Object.defineProperty(exports, "__esModule", ({ value: true })); -var Path = __nccwpck_require__(5622); +var Path = __nccwpck_require__(1017); var fs = __nccwpck_require__(7758); -var util = __nccwpck_require__(1669); +var util = __nccwpck_require__(3837); var glob = __nccwpck_require__(402); var errCode = __nccwpck_require__(2997); @@ -8046,12 +8548,12 @@ function clone (obj) { /***/ 7758: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var fs = __nccwpck_require__(5747) +var fs = __nccwpck_require__(7147) var polyfills = __nccwpck_require__(263) var legacy = __nccwpck_require__(3086) var clone = __nccwpck_require__(7356) -var util = __nccwpck_require__(1669) +var util = __nccwpck_require__(3837) /* istanbul ignore next - node 0.x polyfill */ var gracefulQueue @@ -8132,7 +8634,7 @@ if (!fs[gracefulQueue]) { if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { process.on('exit', function() { debug(fs[gracefulQueue]) - __nccwpck_require__(2357).equal(fs[gracefulQueue].length, 0) + __nccwpck_require__(9491).equal(fs[gracefulQueue].length, 0) }) } } @@ -8501,7 +9003,7 @@ function retry () { /***/ 3086: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var Stream = __nccwpck_require__(2413).Stream +var Stream = (__nccwpck_require__(2781).Stream) module.exports = legacy @@ -8626,7 +9128,7 @@ function legacy (fs) { /***/ 263: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var constants = __nccwpck_require__(7619) +var constants = __nccwpck_require__(2057) var origCwd = process.cwd var cwd = null @@ -9636,8 +10138,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.FsBlockStore = void 0; -const fs_1 = __importDefault(__nccwpck_require__(5747)); -const os_1 = __importDefault(__nccwpck_require__(2087)); +const fs_1 = __importDefault(__nccwpck_require__(7147)); +const os_1 = __importDefault(__nccwpck_require__(2037)); const multiformats_1 = __nccwpck_require__(5978); const blockstore_core_1 = __nccwpck_require__(6226); class FsBlockStore extends blockstore_core_1.BaseBlockstore { @@ -12355,7 +12857,7 @@ module.exports = toPathComponents; "use strict"; -const { Buffer } = __nccwpck_require__(4293) +const { Buffer } = __nccwpck_require__(4300) const symbol = Symbol.for('BufferList') function BufferList (buf) { @@ -13410,7 +13912,7 @@ const Metadata = $root.Metadata = (() => { exports.Data = Data; exports.Metadata = Metadata; exports.UnixTime = UnixTime; -exports.default = $root; +exports["default"] = $root; /***/ }), @@ -13560,8 +14062,8 @@ module.exports = filter "use strict"; -const fs = __nccwpck_require__(5747).promises -const path = __nccwpck_require__(5622) +const fs = (__nccwpck_require__(7147).promises) +const path = __nccwpck_require__(1017) const minimatch = __nccwpck_require__(3973) /** @@ -14117,7 +14619,7 @@ minimatch.Minimatch = Minimatch var path = { sep: '/' } try { - path = __nccwpck_require__(5622) + path = __nccwpck_require__(1017) } catch (er) {} var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} @@ -16305,7 +16807,7 @@ exports.identity = identity; Object.defineProperty(exports, "__esModule", ({ value: true })); -var crypto = __nccwpck_require__(6417); +var crypto = __nccwpck_require__(6113); var hasher = __nccwpck_require__(92); var bytes = __nccwpck_require__(6507); @@ -17257,7 +17759,7 @@ const pRetry = (input, options) => new Promise((resolve, reject) => { module.exports = pRetry; // TODO: remove this in the next major version -module.exports.default = pRetry; +module.exports["default"] = pRetry; module.exports.AbortError = AbortError; @@ -19226,7 +19728,7 @@ BufferWriter._configure(); const { instantiateSync } = __nccwpck_require__(1748); -const fs = __nccwpck_require__(5747) +const fs = __nccwpck_require__(7147) loadWebAssembly.supported = typeof WebAssembly !== 'undefined' @@ -20894,7 +21396,7 @@ function throttledQueue(maxRequestsPerInterval, interval, evenlySpaced) { }); }; } module.exports = throttledQueue; -exports.default = throttledQueue; +exports["default"] = throttledQueue; //# sourceMappingURL=throttledQueue.js.map /***/ }), @@ -20913,13 +21415,13 @@ module.exports = __nccwpck_require__(4219); "use strict"; -var net = __nccwpck_require__(1631); -var tls = __nccwpck_require__(4016); -var http = __nccwpck_require__(8605); -var https = __nccwpck_require__(7211); -var events = __nccwpck_require__(8614); -var assert = __nccwpck_require__(2357); -var util = __nccwpck_require__(1669); +var net = __nccwpck_require__(1808); +var tls = __nccwpck_require__(4404); +var http = __nccwpck_require__(3685); +var https = __nccwpck_require__(5687); +var events = __nccwpck_require__(2361); +var assert = __nccwpck_require__(9491); +var util = __nccwpck_require__(3837); exports.httpOverHttp = httpOverHttp; @@ -21295,20 +21797,666 @@ const ascii = createCodec('ascii', 'a', buf => { for (let i = 0; i < str.length; i++) { buf[i] = str.charCodeAt(i); } - return buf; -}); -const BASES = { - utf8: string, - 'utf-8': string, - hex: basics.bases.base16, - latin1: ascii, - ascii: ascii, - binary: ascii, - ...basics.bases -}; + return buf; +}); +const BASES = { + utf8: string, + 'utf-8': string, + hex: basics.bases.base16, + latin1: ascii, + ascii: ascii, + binary: ascii, + ...basics.bases +}; + +module.exports = BASES; + + +/***/ }), + +/***/ 5840: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +Object.defineProperty(exports, "v1", ({ + enumerable: true, + get: function () { + return _v.default; + } +})); +Object.defineProperty(exports, "v3", ({ + enumerable: true, + get: function () { + return _v2.default; + } +})); +Object.defineProperty(exports, "v4", ({ + enumerable: true, + get: function () { + return _v3.default; + } +})); +Object.defineProperty(exports, "v5", ({ + enumerable: true, + get: function () { + return _v4.default; + } +})); +Object.defineProperty(exports, "NIL", ({ + enumerable: true, + get: function () { + return _nil.default; + } +})); +Object.defineProperty(exports, "version", ({ + enumerable: true, + get: function () { + return _version.default; + } +})); +Object.defineProperty(exports, "validate", ({ + enumerable: true, + get: function () { + return _validate.default; + } +})); +Object.defineProperty(exports, "stringify", ({ + enumerable: true, + get: function () { + return _stringify.default; + } +})); +Object.defineProperty(exports, "parse", ({ + enumerable: true, + get: function () { + return _parse.default; + } +})); + +var _v = _interopRequireDefault(__nccwpck_require__(8628)); + +var _v2 = _interopRequireDefault(__nccwpck_require__(6409)); + +var _v3 = _interopRequireDefault(__nccwpck_require__(5122)); + +var _v4 = _interopRequireDefault(__nccwpck_require__(9120)); + +var _nil = _interopRequireDefault(__nccwpck_require__(5332)); + +var _version = _interopRequireDefault(__nccwpck_require__(1595)); + +var _validate = _interopRequireDefault(__nccwpck_require__(6900)); + +var _stringify = _interopRequireDefault(__nccwpck_require__(8950)); + +var _parse = _interopRequireDefault(__nccwpck_require__(2746)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/***/ }), + +/***/ 4569: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function md5(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + + return _crypto.default.createHash('md5').update(bytes).digest(); +} + +var _default = md5; +exports["default"] = _default; + +/***/ }), + +/***/ 5332: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = '00000000-0000-0000-0000-000000000000'; +exports["default"] = _default; + +/***/ }), + +/***/ 2746: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _validate = _interopRequireDefault(__nccwpck_require__(6900)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function parse(uuid) { + if (!(0, _validate.default)(uuid)) { + throw TypeError('Invalid UUID'); + } + + let v; + const arr = new Uint8Array(16); // Parse ########-....-....-....-............ + + arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; + arr[1] = v >>> 16 & 0xff; + arr[2] = v >>> 8 & 0xff; + arr[3] = v & 0xff; // Parse ........-####-....-....-............ + + arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; + arr[5] = v & 0xff; // Parse ........-....-####-....-............ + + arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; + arr[7] = v & 0xff; // Parse ........-....-....-####-............ + + arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; + arr[9] = v & 0xff; // Parse ........-....-....-....-############ + // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) + + arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff; + arr[11] = v / 0x100000000 & 0xff; + arr[12] = v >>> 24 & 0xff; + arr[13] = v >>> 16 & 0xff; + arr[14] = v >>> 8 & 0xff; + arr[15] = v & 0xff; + return arr; +} + +var _default = parse; +exports["default"] = _default; + +/***/ }), + +/***/ 814: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; +var _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; +exports["default"] = _default; + +/***/ }), + +/***/ 807: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = rng; + +var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate + +let poolPtr = rnds8Pool.length; + +function rng() { + if (poolPtr > rnds8Pool.length - 16) { + _crypto.default.randomFillSync(rnds8Pool); + + poolPtr = 0; + } + + return rnds8Pool.slice(poolPtr, poolPtr += 16); +} + +/***/ }), + +/***/ 5274: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _crypto = _interopRequireDefault(__nccwpck_require__(6113)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function sha1(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + + return _crypto.default.createHash('sha1').update(bytes).digest(); +} + +var _default = sha1; +exports["default"] = _default; + +/***/ }), + +/***/ 8950: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _validate = _interopRequireDefault(__nccwpck_require__(6900)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ +const byteToHex = []; + +for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).substr(1)); +} + +function stringify(arr, offset = 0) { + // Note: Be careful editing this code! It's been tuned for performance + // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 + const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one + // of the following: + // - One or more input array values don't map to a hex octet (leading to + // "undefined" in the uuid) + // - Invalid input values for the RFC `version` or `variant` fields + + if (!(0, _validate.default)(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + + return uuid; +} + +var _default = stringify; +exports["default"] = _default; + +/***/ }), + +/***/ 8628: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _rng = _interopRequireDefault(__nccwpck_require__(807)); + +var _stringify = _interopRequireDefault(__nccwpck_require__(8950)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// **`v1()` - Generate time-based UUID** +// +// Inspired by https://github.com/LiosK/UUID.js +// and http://docs.python.org/library/uuid.html +let _nodeId; + +let _clockseq; // Previous uuid creation time + + +let _lastMSecs = 0; +let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details + +function v1(options, buf, offset) { + let i = buf && offset || 0; + const b = buf || new Array(16); + options = options || {}; + let node = options.node || _nodeId; + let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not + // specified. We do this lazily to minimize issues related to insufficient + // system entropy. See #189 + + if (node == null || clockseq == null) { + const seedBytes = options.random || (options.rng || _rng.default)(); + + if (node == null) { + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; + } + + if (clockseq == null) { + // Per 4.2.2, randomize (14 bit) clockseq + clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; + } + } // UUID timestamps are 100 nano-second units since the Gregorian epoch, + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. + + + let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock + // cycle to simulate higher resolution clock + + let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) + + const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression + + if (dt < 0 && options.clockseq === undefined) { + clockseq = clockseq + 1 & 0x3fff; + } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval + + + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { + nsecs = 0; + } // Per 4.2.1.2 Throw error if too many uuids are requested + + + if (nsecs >= 10000) { + throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); + } + + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + + msecs += 12219292800000; // `time_low` + + const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + b[i++] = tl >>> 24 & 0xff; + b[i++] = tl >>> 16 & 0xff; + b[i++] = tl >>> 8 & 0xff; + b[i++] = tl & 0xff; // `time_mid` + + const tmh = msecs / 0x100000000 * 10000 & 0xfffffff; + b[i++] = tmh >>> 8 & 0xff; + b[i++] = tmh & 0xff; // `time_high_and_version` + + b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + + b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + + b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` + + b[i++] = clockseq & 0xff; // `node` + + for (let n = 0; n < 6; ++n) { + b[i + n] = node[n]; + } + + return buf || (0, _stringify.default)(b); +} + +var _default = v1; +exports["default"] = _default; + +/***/ }), + +/***/ 6409: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _v = _interopRequireDefault(__nccwpck_require__(5998)); + +var _md = _interopRequireDefault(__nccwpck_require__(4569)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const v3 = (0, _v.default)('v3', 0x30, _md.default); +var _default = v3; +exports["default"] = _default; + +/***/ }), + +/***/ 5998: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = _default; +exports.URL = exports.DNS = void 0; + +var _stringify = _interopRequireDefault(__nccwpck_require__(8950)); + +var _parse = _interopRequireDefault(__nccwpck_require__(2746)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); // UTF8 escape + + const bytes = []; + + for (let i = 0; i < str.length; ++i) { + bytes.push(str.charCodeAt(i)); + } + + return bytes; +} + +const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; +exports.DNS = DNS; +const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; +exports.URL = URL; + +function _default(name, version, hashfunc) { + function generateUUID(value, namespace, buf, offset) { + if (typeof value === 'string') { + value = stringToBytes(value); + } + + if (typeof namespace === 'string') { + namespace = (0, _parse.default)(namespace); + } + + if (namespace.length !== 16) { + throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); + } // Compute hash of namespace and value, Per 4.3 + // Future: Use spread syntax when supported on all platforms, e.g. `bytes = + // hashfunc([...namespace, ... value])` + + + let bytes = new Uint8Array(16 + value.length); + bytes.set(namespace); + bytes.set(value, namespace.length); + bytes = hashfunc(bytes); + bytes[6] = bytes[6] & 0x0f | version; + bytes[8] = bytes[8] & 0x3f | 0x80; + + if (buf) { + offset = offset || 0; + + for (let i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } + + return buf; + } + + return (0, _stringify.default)(bytes); + } // Function#name is not settable on some platforms (#270) + + + try { + generateUUID.name = name; // eslint-disable-next-line no-empty + } catch (err) {} // For CommonJS default export support + + + generateUUID.DNS = DNS; + generateUUID.URL = URL; + return generateUUID; +} + +/***/ }), + +/***/ 5122: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _rng = _interopRequireDefault(__nccwpck_require__(807)); + +var _stringify = _interopRequireDefault(__nccwpck_require__(8950)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function v4(options, buf, offset) { + options = options || {}; + + const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + + + rnds[6] = rnds[6] & 0x0f | 0x40; + rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided + + if (buf) { + offset = offset || 0; + + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + + return buf; + } + + return (0, _stringify.default)(rnds); +} + +var _default = v4; +exports["default"] = _default; + +/***/ }), + +/***/ 9120: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _v = _interopRequireDefault(__nccwpck_require__(5998)); + +var _sha = _interopRequireDefault(__nccwpck_require__(5274)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const v5 = (0, _v.default)('v5', 0x50, _sha.default); +var _default = v5; +exports["default"] = _default; + +/***/ }), + +/***/ 6900: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _regex = _interopRequireDefault(__nccwpck_require__(814)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function validate(uuid) { + return typeof uuid === 'string' && _regex.default.test(uuid); +} + +var _default = validate; +exports["default"] = _default; + +/***/ }), + +/***/ 1595: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = void 0; + +var _validate = _interopRequireDefault(__nccwpck_require__(6900)); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function version(uuid) { + if (!(0, _validate.default)(uuid)) { + throw TypeError('Invalid UUID'); + } -module.exports = BASES; + return parseInt(uuid.substr(14, 1), 16); +} +var _default = version; +exports["default"] = _default; /***/ }), @@ -21436,10 +22584,10 @@ module.exports = function (value) { exports.TextEncoder = - typeof TextEncoder !== "undefined" ? TextEncoder : __nccwpck_require__(1669).TextEncoder + typeof TextEncoder !== "undefined" ? TextEncoder : (__nccwpck_require__(3837).TextEncoder) exports.TextDecoder = - typeof TextDecoder !== "undefined" ? TextDecoder : __nccwpck_require__(1669).TextDecoder + typeof TextDecoder !== "undefined" ? TextDecoder : (__nccwpck_require__(3837).TextDecoder) /***/ }), @@ -25808,7 +26956,7 @@ exports.TextDecoder = /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { getFilesFromPath } = __nccwpck_require__(5090) -const { Web3Storage } = __nccwpck_require__(8100) +const { Web3Storage } = __nccwpck_require__(8272) async function addToWeb3 ({ endpoint, token, pathToAdd, name, wrapWithDirectory = false, includeHidden }) { const web3 = new Web3Storage({ endpoint, token }) @@ -25828,15 +26976,143 @@ module.exports.pickName = pickName /***/ }), -/***/ 9081: +/***/ 9491: +/***/ ((module) => { + +"use strict"; +module.exports = require("assert"); + +/***/ }), + +/***/ 4300: +/***/ ((module) => { + +"use strict"; +module.exports = require("buffer"); + +/***/ }), + +/***/ 2057: +/***/ ((module) => { + +"use strict"; +module.exports = require("constants"); + +/***/ }), + +/***/ 6113: +/***/ ((module) => { + +"use strict"; +module.exports = require("crypto"); + +/***/ }), + +/***/ 2361: +/***/ ((module) => { + +"use strict"; +module.exports = require("events"); + +/***/ }), + +/***/ 7147: +/***/ ((module) => { + +"use strict"; +module.exports = require("fs"); + +/***/ }), + +/***/ 3685: +/***/ ((module) => { + +"use strict"; +module.exports = require("http"); + +/***/ }), + +/***/ 5687: +/***/ ((module) => { + +"use strict"; +module.exports = require("https"); + +/***/ }), + +/***/ 1808: +/***/ ((module) => { + +"use strict"; +module.exports = require("net"); + +/***/ }), + +/***/ 2037: +/***/ ((module) => { + +"use strict"; +module.exports = require("os"); + +/***/ }), + +/***/ 1017: +/***/ ((module) => { + +"use strict"; +module.exports = require("path"); + +/***/ }), + +/***/ 2781: +/***/ ((module) => { + +"use strict"; +module.exports = require("stream"); + +/***/ }), + +/***/ 5356: +/***/ ((module) => { + +"use strict"; +module.exports = require("stream/web"); + +/***/ }), + +/***/ 4404: +/***/ ((module) => { + +"use strict"; +module.exports = require("tls"); + +/***/ }), + +/***/ 7310: +/***/ ((module) => { + +"use strict"; +module.exports = require("url"); + +/***/ }), + +/***/ 3837: /***/ ((module) => { -module.exports = eval("require")("stream/web"); +"use strict"; +module.exports = require("util"); + +/***/ }), + +/***/ 9796: +/***/ ((module) => { +"use strict"; +module.exports = require("zlib"); /***/ }), -/***/ 5576: +/***/ 107: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -25845,7 +27121,7 @@ module.exports = eval("require")("stream/web"); Object.defineProperty(exports, "__esModule", ({ value: true })); var webEncoding = __nccwpck_require__(1430); -var stream = __nccwpck_require__(6995); +var stream = __nccwpck_require__(8059); /** * @implements {globalThis.Blob} @@ -26152,7 +27428,7 @@ exports.Blob = Blob; /***/ }), -/***/ 5343: +/***/ 9620: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -26161,8 +27437,8 @@ exports.Blob = Blob; Object.defineProperty(exports, "__esModule", ({ value: true })); var webEncoding = __nccwpck_require__(1430); -var stream = __nccwpck_require__(6995); -var blob = __nccwpck_require__(5576); +var stream = __nccwpck_require__(8059); +var blob = __nccwpck_require__(107); /** @type {typeof globalThis.Blob} */ // Our first choise is to use global `Blob` because it may be available e.g. in @@ -26199,7 +27475,7 @@ exports.Blob = Blob; /***/ }), -/***/ 9681: +/***/ 4975: /***/ ((module, exports, __nccwpck_require__) => { "use strict"; @@ -26207,17 +27483,17 @@ exports.Blob = Blob; exports = module.exports = fetch; -const http = __nccwpck_require__(8605); -const https = __nccwpck_require__(7211); -const zlib = __nccwpck_require__(8761); +const http = __nccwpck_require__(3685); +const https = __nccwpck_require__(5687); +const zlib = __nccwpck_require__(9796); const dataUriToBuffer = __nccwpck_require__(2371); -const Stream = __nccwpck_require__(2413); -const util = __nccwpck_require__(1669); -const blob = __nccwpck_require__(5343); -const formData = __nccwpck_require__(9349); -const crypto = __nccwpck_require__(6417); +const Stream = __nccwpck_require__(2781); +const util = __nccwpck_require__(3837); +const blob = __nccwpck_require__(9620); +const formData = __nccwpck_require__(3670); +const crypto = __nccwpck_require__(6113); const multipartParser = __nccwpck_require__(3661); -const url = __nccwpck_require__(8835); +const url = __nccwpck_require__(7310); class FetchBaseError extends Error { /** @@ -28199,14 +29475,14 @@ exports.FetchError = FetchError; exports.Headers = Headers; exports.Request = Request; exports.Response = Response; -exports.default = fetch; +exports["default"] = fetch; exports.isRedirect = isRedirect; //# sourceMappingURL=index.cjs.map /***/ }), -/***/ 3984: +/***/ 9270: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -28214,7 +29490,7 @@ exports.isRedirect = isRedirect; Object.defineProperty(exports, "__esModule", ({ value: true })); -var blob = __nccwpck_require__(5343); +var blob = __nccwpck_require__(9620); /** * @implements {globalThis.File} @@ -28287,7 +29563,7 @@ exports.File = File; /***/ }), -/***/ 7905: +/***/ 973: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -28295,8 +29571,8 @@ exports.File = File; Object.defineProperty(exports, "__esModule", ({ value: true })); -var blob = __nccwpck_require__(5343); -var file = __nccwpck_require__(3984); +var blob = __nccwpck_require__(9620); +var file = __nccwpck_require__(9270); // Electron-renderer should get the browser implementation instead of node // Browser configuration is not enough @@ -28317,7 +29593,7 @@ exports.File = File; /***/ }), -/***/ 8068: +/***/ 1455: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -28646,7 +29922,7 @@ exports.FormData = FormData; /***/ }), -/***/ 9349: +/***/ 3670: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -28654,7 +29930,7 @@ exports.FormData = FormData; Object.defineProperty(exports, "__esModule", ({ value: true })); -var formData = __nccwpck_require__(8068); +var formData = __nccwpck_require__(1455); // @ts-check @@ -28671,11 +29947,11 @@ exports.FormData = FormData; /***/ }), -/***/ 6995: +/***/ 8059: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { try { - module.exports = __nccwpck_require__(9081) + module.exports = __nccwpck_require__(5356) } catch (error) { module.exports = __nccwpck_require__(5650) } @@ -28683,7 +29959,7 @@ try { /***/ }), -/***/ 4799: +/***/ 3852: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -28771,7 +30047,7 @@ exports.parseLinkHeader = parseLinkHeader; /***/ }), -/***/ 8100: +/***/ 8272: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -28782,15 +30058,15 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); var streamingIterables = __nccwpck_require__(8205); var pRetry = __nccwpck_require__(2548); var pack = __nccwpck_require__(8163); -var parseLinkHeader = __nccwpck_require__(4799); +var parseLinkHeader = __nccwpck_require__(3852); var unpack = __nccwpck_require__(3428); var treewalk = __nccwpck_require__(6025); var car = __nccwpck_require__(2805); var filesFromPath = __nccwpck_require__(5090); var throttledQueue = __nccwpck_require__(7855); -var fetch = __nccwpck_require__(9681); -var blob = __nccwpck_require__(5343); -var file = __nccwpck_require__(7905); +var fetch = __nccwpck_require__(4975); +var blob = __nccwpck_require__(9620); +var file = __nccwpck_require__(973); var fs = __nccwpck_require__(2689); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } @@ -29364,134 +30640,6 @@ exports.createRateLimiter = createRateLimiter; //# sourceMappingURL=lib.cjs.map -/***/ }), - -/***/ 2357: -/***/ ((module) => { - -"use strict"; -module.exports = require("assert"); - -/***/ }), - -/***/ 4293: -/***/ ((module) => { - -"use strict"; -module.exports = require("buffer"); - -/***/ }), - -/***/ 7619: -/***/ ((module) => { - -"use strict"; -module.exports = require("constants"); - -/***/ }), - -/***/ 6417: -/***/ ((module) => { - -"use strict"; -module.exports = require("crypto"); - -/***/ }), - -/***/ 8614: -/***/ ((module) => { - -"use strict"; -module.exports = require("events"); - -/***/ }), - -/***/ 5747: -/***/ ((module) => { - -"use strict"; -module.exports = require("fs"); - -/***/ }), - -/***/ 8605: -/***/ ((module) => { - -"use strict"; -module.exports = require("http"); - -/***/ }), - -/***/ 7211: -/***/ ((module) => { - -"use strict"; -module.exports = require("https"); - -/***/ }), - -/***/ 1631: -/***/ ((module) => { - -"use strict"; -module.exports = require("net"); - -/***/ }), - -/***/ 2087: -/***/ ((module) => { - -"use strict"; -module.exports = require("os"); - -/***/ }), - -/***/ 5622: -/***/ ((module) => { - -"use strict"; -module.exports = require("path"); - -/***/ }), - -/***/ 2413: -/***/ ((module) => { - -"use strict"; -module.exports = require("stream"); - -/***/ }), - -/***/ 4016: -/***/ ((module) => { - -"use strict"; -module.exports = require("tls"); - -/***/ }), - -/***/ 8835: -/***/ ((module) => { - -"use strict"; -module.exports = require("url"); - -/***/ }), - -/***/ 1669: -/***/ ((module) => { - -"use strict"; -module.exports = require("util"); - -/***/ }), - -/***/ 8761: -/***/ ((module) => { - -"use strict"; -module.exports = require("zlib"); - /***/ }) /******/ }); diff --git a/dist/index.js.map b/dist/index.js.map index d0ecd6c..7e1aca6 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../webpack://add-to-web3/./node_modules/@actions/core/lib/command.js","../webpack://add-to-web3/./node_modules/@actions/core/lib/core.js","../webpack://add-to-web3/./node_modules/@actions/core/lib/file-command.js","../webpack://add-to-web3/./node_modules/@actions/core/lib/oidc-utils.js","../webpack://add-to-web3/./node_modules/@actions/core/lib/utils.js","../webpack://add-to-web3/./node_modules/@actions/http-client/auth.js","../webpack://add-to-web3/./node_modules/@actions/http-client/index.js","../webpack://add-to-web3/./node_modules/@actions/http-client/proxy.js","../webpack://add-to-web3/./node_modules/@assemblyscript/loader/index.js","../webpack://add-to-web3/./node_modules/@ipld/car/cjs/car.js","../webpack://add-to-web3/./node_modules/@ipld/car/cjs/lib/decoder.js","../webpack://add-to-web3/./node_modules/@ipld/car/cjs/lib/encoder.js","../webpack://add-to-web3/./node_modules/@ipld/car/cjs/lib/indexed-reader.js","../webpack://add-to-web3/./node_modules/@ipld/car/cjs/lib/indexer.js","../webpack://add-to-web3/./node_modules/@ipld/car/cjs/lib/iterator-channel.js","../webpack://add-to-web3/./node_modules/@ipld/car/cjs/lib/iterator.js","../webpack://add-to-web3/./node_modules/@ipld/car/cjs/lib/reader-browser.js","../webpack://add-to-web3/./node_modules/@ipld/car/cjs/lib/reader.js","../webpack://add-to-web3/./node_modules/@ipld/car/cjs/lib/writer-browser.js","../webpack://add-to-web3/./node_modules/@ipld/car/cjs/lib/writer.js","../webpack://add-to-web3/./node_modules/@ipld/car/node_modules/@ipld/dag-cbor/cjs/index.js","../webpack://add-to-web3/./node_modules/@ipld/dag-cbor/cjs/index.js","../webpack://add-to-web3/./node_modules/@ipld/dag-pb/cjs/src/index.js","../webpack://add-to-web3/./node_modules/@ipld/dag-pb/cjs/src/pb-decode.js","../webpack://add-to-web3/./node_modules/@ipld/dag-pb/cjs/src/pb-encode.js","../webpack://add-to-web3/./node_modules/@ipld/dag-pb/cjs/src/util.js","../webpack://add-to-web3/./node_modules/@multiformats/murmur3/cjs/index.js","../webpack://add-to-web3/./node_modules/@protobufjs/aspromise/index.js","../webpack://add-to-web3/./node_modules/@protobufjs/base64/index.js","../webpack://add-to-web3/./node_modules/@protobufjs/eventemitter/index.js","../webpack://add-to-web3/./node_modules/@protobufjs/float/index.js","../webpack://add-to-web3/./node_modules/@protobufjs/inquire/index.js","../webpack://add-to-web3/./node_modules/@protobufjs/pool/index.js","../webpack://add-to-web3/./node_modules/@protobufjs/utf8/index.js","../webpack://add-to-web3/./node_modules/@web3-storage/multipart-parser/cjs/src/index.js","../webpack://add-to-web3/./node_modules/@web3-storage/multipart-parser/cjs/src/search.js","../webpack://add-to-web3/./node_modules/@web3-storage/multipart-parser/cjs/src/utils.js","../webpack://add-to-web3/./node_modules/balanced-match/index.js","../webpack://add-to-web3/./node_modules/blob-to-it/index.js","../webpack://add-to-web3/./node_modules/blockstore-core/cjs/src/base.js","../webpack://add-to-web3/./node_modules/blockstore-core/cjs/src/errors.js","../webpack://add-to-web3/./node_modules/blockstore-core/cjs/src/index.js","../webpack://add-to-web3/./node_modules/blockstore-core/cjs/src/memory.js","../webpack://add-to-web3/./node_modules/brace-expansion/index.js","../webpack://add-to-web3/./node_modules/browser-readablestream-to-it/index.js","../webpack://add-to-web3/./node_modules/carbites/cjs/lib/treewalk/index.js","../webpack://add-to-web3/./node_modules/carbites/cjs/lib/treewalk/joiner.js","../webpack://add-to-web3/./node_modules/carbites/cjs/lib/treewalk/splitter.js","../webpack://add-to-web3/./node_modules/cborg/cjs/cborg.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/0uint.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/1negint.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/2bytes.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/3string.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/4array.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/5map.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/6tag.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/7float.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/bl.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/byte-utils.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/common.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/decode.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/encode.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/is.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/jump.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/token.js","../webpack://add-to-web3/./node_modules/concat-map/index.js","../webpack://add-to-web3/./node_modules/data-uri-to-buffer/dist/src/index.js","../webpack://add-to-web3/./node_modules/err-code/index.js","../webpack://add-to-web3/./node_modules/files-from-path/cjs/src/index.js","../webpack://add-to-web3/./node_modules/graceful-fs/clone.js","../webpack://add-to-web3/./node_modules/graceful-fs/graceful-fs.js","../webpack://add-to-web3/./node_modules/graceful-fs/legacy-streams.js","../webpack://add-to-web3/./node_modules/graceful-fs/polyfills.js","../webpack://add-to-web3/./node_modules/hamt-sharding/src/bucket.js","../webpack://add-to-web3/./node_modules/hamt-sharding/src/consumable-buffer.js","../webpack://add-to-web3/./node_modules/hamt-sharding/src/consumable-hash.js","../webpack://add-to-web3/./node_modules/hamt-sharding/src/index.js","../webpack://add-to-web3/./node_modules/ipfs-car/dist/cjs/blockstore/fs.js","../webpack://add-to-web3/./node_modules/ipfs-car/dist/cjs/blockstore/memory.js","../webpack://add-to-web3/./node_modules/ipfs-car/dist/cjs/pack/constants.js","../webpack://add-to-web3/./node_modules/ipfs-car/dist/cjs/pack/index.js","../webpack://add-to-web3/./node_modules/ipfs-car/dist/cjs/pack/utils/normalise-input.js","../webpack://add-to-web3/./node_modules/ipfs-car/dist/cjs/unpack/index.js","../webpack://add-to-web3/./node_modules/ipfs-car/dist/cjs/unpack/utils/verifying-get-only-blockstore.js","../webpack://add-to-web3/./node_modules/ipfs-core-utils/cjs/src/files/normalise-candidate-multiple.js","../webpack://add-to-web3/./node_modules/ipfs-core-utils/cjs/src/files/normalise-candidate-single.js","../webpack://add-to-web3/./node_modules/ipfs-core-utils/cjs/src/files/normalise-content.js","../webpack://add-to-web3/./node_modules/ipfs-core-utils/cjs/src/files/normalise-input-multiple.js","../webpack://add-to-web3/./node_modules/ipfs-core-utils/cjs/src/files/normalise-input-single.js","../webpack://add-to-web3/./node_modules/ipfs-core-utils/cjs/src/files/utils.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-exporter/cjs/src/index.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-exporter/cjs/src/resolvers/dag-cbor.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-exporter/cjs/src/resolvers/identity.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-exporter/cjs/src/resolvers/index.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-exporter/cjs/src/resolvers/raw.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-exporter/cjs/src/resolvers/unixfs-v1/content/directory.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-exporter/cjs/src/resolvers/unixfs-v1/content/file.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-exporter/cjs/src/resolvers/unixfs-v1/content/hamt-sharded-directory.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-exporter/cjs/src/resolvers/unixfs-v1/index.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-exporter/cjs/src/utils/extract-data-from-block.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-exporter/cjs/src/utils/find-cid-in-shard.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-exporter/cjs/src/utils/validate-offset-and-length.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/chunker/fixed-size.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/chunker/rabin.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/dag-builder/dir.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/dag-builder/file/balanced.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/dag-builder/file/buffer-importer.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/dag-builder/file/flat.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/dag-builder/file/index.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/dag-builder/file/trickle.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/dag-builder/index.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/dag-builder/validate-chunks.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/dir-flat.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/dir-sharded.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/dir.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/flat-to-shard.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/index.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/options.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/tree-builder.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/utils/persist.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/utils/to-path-components.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/node_modules/bl/BufferList.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs/cjs/src/index.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs/cjs/src/unixfs.js","../webpack://add-to-web3/./node_modules/is-plain-obj/index.js","../webpack://add-to-web3/./node_modules/it-all/index.js","../webpack://add-to-web3/./node_modules/it-batch/index.js","../webpack://add-to-web3/./node_modules/it-drain/index.js","../webpack://add-to-web3/./node_modules/it-filter/index.js","../webpack://add-to-web3/./node_modules/it-glob/index.js","../webpack://add-to-web3/./node_modules/it-last/index.js","../webpack://add-to-web3/./node_modules/it-map/index.js","../webpack://add-to-web3/./node_modules/it-parallel-batch/index.js","../webpack://add-to-web3/./node_modules/it-peekable/index.js","../webpack://add-to-web3/./node_modules/it-pipe/index.js","../webpack://add-to-web3/./node_modules/it-take/index.js","../webpack://add-to-web3/./node_modules/merge-options/index.js","../webpack://add-to-web3/./node_modules/minimatch/minimatch.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/bases/base.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/bases/base10.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/bases/base16.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/bases/base2.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/bases/base32.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/bases/base36.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/bases/base58.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/bases/base64.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/bases/base8.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/bases/identity.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/basics.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/block.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/bytes.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/cid.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/codecs/json.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/codecs/raw.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/hashes/digest.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/hashes/hasher.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/hashes/identity.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/hashes/sha2.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/index.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/varint.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/vendor/base-x.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/vendor/varint.js","../webpack://add-to-web3/./node_modules/murmurhash3js-revisited/index.js","../webpack://add-to-web3/./node_modules/murmurhash3js-revisited/lib/murmurHash3js.js","../webpack://add-to-web3/./node_modules/p-retry/index.js","../webpack://add-to-web3/./node_modules/protobufjs/minimal.js","../webpack://add-to-web3/./node_modules/protobufjs/src/index-minimal.js","../webpack://add-to-web3/./node_modules/protobufjs/src/reader.js","../webpack://add-to-web3/./node_modules/protobufjs/src/reader_buffer.js","../webpack://add-to-web3/./node_modules/protobufjs/src/roots.js","../webpack://add-to-web3/./node_modules/protobufjs/src/rpc.js","../webpack://add-to-web3/./node_modules/protobufjs/src/rpc/service.js","../webpack://add-to-web3/./node_modules/protobufjs/src/util/longbits.js","../webpack://add-to-web3/./node_modules/protobufjs/src/util/minimal.js","../webpack://add-to-web3/./node_modules/protobufjs/src/writer.js","../webpack://add-to-web3/./node_modules/protobufjs/src/writer_buffer.js","../webpack://add-to-web3/./node_modules/rabin-wasm/dist/rabin-wasm.node.js","../webpack://add-to-web3/./node_modules/rabin-wasm/src/index.js","../webpack://add-to-web3/./node_modules/rabin-wasm/src/rabin.js","../webpack://add-to-web3/./node_modules/retry/index.js","../webpack://add-to-web3/./node_modules/retry/lib/retry.js","../webpack://add-to-web3/./node_modules/retry/lib/retry_operation.js","../webpack://add-to-web3/./node_modules/sparse-array/index.js","../webpack://add-to-web3/./node_modules/streaming-iterables/dist/index.js","../webpack://add-to-web3/./node_modules/throttled-queue/dist/throttledQueue.js","../webpack://add-to-web3/./node_modules/tunnel/index.js","../webpack://add-to-web3/./node_modules/tunnel/lib/tunnel.js","../webpack://add-to-web3/./node_modules/uint8arrays/cjs/src/concat.js","../webpack://add-to-web3/./node_modules/uint8arrays/cjs/src/equals.js","../webpack://add-to-web3/./node_modules/uint8arrays/cjs/src/from-string.js","../webpack://add-to-web3/./node_modules/uint8arrays/cjs/src/util/bases.js","../webpack://add-to-web3/./node_modules/varint/decode.js","../webpack://add-to-web3/./node_modules/varint/encode.js","../webpack://add-to-web3/./node_modules/varint/index.js","../webpack://add-to-web3/./node_modules/varint/length.js","../webpack://add-to-web3/./node_modules/web-encoding/src/lib.js","../webpack://add-to-web3/./node_modules/web-streams-polyfill/dist/ponyfill.js","../webpack://add-to-web3/./web3.js","../webpack://add-to-web3/./node_modules/@vercel/ncc/dist/ncc/@@notfound.js","../webpack://add-to-web3/./node_modules/@web-std/blob/dist/src/blob.cjs","../webpack://add-to-web3/./node_modules/@web-std/blob/dist/src/lib.node.cjs","../webpack://add-to-web3/./node_modules/@web-std/fetch/dist/index.cjs","../webpack://add-to-web3/./node_modules/@web-std/file/dist/src/file.cjs","../webpack://add-to-web3/./node_modules/@web-std/file/dist/src/lib.node.cjs","../webpack://add-to-web3/./node_modules/@web-std/form-data/dist/src/form-data.cjs","../webpack://add-to-web3/./node_modules/@web-std/form-data/dist/src/lib.node.cjs","../webpack://add-to-web3/./node_modules/@web-std/stream/src/stream.cjs","../webpack://add-to-web3/./node_modules/@web3-storage/parse-link-header/dist/index.cjs","../webpack://add-to-web3/./node_modules/web3.storage/dist/src/lib.cjs","../webpack://add-to-web3/external \"assert\"","../webpack://add-to-web3/external \"buffer\"","../webpack://add-to-web3/external \"constants\"","../webpack://add-to-web3/external \"crypto\"","../webpack://add-to-web3/external \"events\"","../webpack://add-to-web3/external \"fs\"","../webpack://add-to-web3/external \"http\"","../webpack://add-to-web3/external \"https\"","../webpack://add-to-web3/external \"net\"","../webpack://add-to-web3/external \"os\"","../webpack://add-to-web3/external \"path\"","../webpack://add-to-web3/external \"stream\"","../webpack://add-to-web3/external \"tls\"","../webpack://add-to-web3/external \"url\"","../webpack://add-to-web3/external \"util\"","../webpack://add-to-web3/external \"zlib\"","../webpack://add-to-web3/webpack/bootstrap","../webpack://add-to-web3/webpack/runtime/compat","../webpack://add-to-web3/./index.js"],"sourcesContent":["\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issue = exports.issueCommand = void 0;\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\n/**\n * Commands\n *\n * Command Format:\n * ::name key=value,key=value::message\n *\n * Examples:\n * ::warning::This is the message\n * ::set-env name=MY_VAR::some value\n */\nfunction issueCommand(command, properties, message) {\n const cmd = new Command(command, properties, message);\n process.stdout.write(cmd.toString() + os.EOL);\n}\nexports.issueCommand = issueCommand;\nfunction issue(name, message = '') {\n issueCommand(name, {}, message);\n}\nexports.issue = issue;\nconst CMD_STRING = '::';\nclass Command {\n constructor(command, properties, message) {\n if (!command) {\n command = 'missing.command';\n }\n this.command = command;\n this.properties = properties;\n this.message = message;\n }\n toString() {\n let cmdStr = CMD_STRING + this.command;\n if (this.properties && Object.keys(this.properties).length > 0) {\n cmdStr += ' ';\n let first = true;\n for (const key in this.properties) {\n if (this.properties.hasOwnProperty(key)) {\n const val = this.properties[key];\n if (val) {\n if (first) {\n first = false;\n }\n else {\n cmdStr += ',';\n }\n cmdStr += `${key}=${escapeProperty(val)}`;\n }\n }\n }\n }\n cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n return cmdStr;\n }\n}\nfunction escapeData(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A')\n .replace(/:/g, '%3A')\n .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;\nconst command_1 = require(\"./command\");\nconst file_command_1 = require(\"./file-command\");\nconst utils_1 = require(\"./utils\");\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\nconst oidc_utils_1 = require(\"./oidc-utils\");\n/**\n * The code to exit an action\n */\nvar ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction exportVariable(name, val) {\n const convertedVal = utils_1.toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n const delimiter = '_GitHubActionsFileCommandDelimeter_';\n const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;\n file_command_1.issueCommand('ENV', commandValue);\n }\n else {\n command_1.issueCommand('set-env', { name }, convertedVal);\n }\n}\nexports.exportVariable = exportVariable;\n/**\n * Registers a secret which will get masked from logs\n * @param secret value of the secret\n */\nfunction setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}\nexports.setSecret = setSecret;\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nfunction addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n file_command_1.issueCommand('PATH', inputPath);\n }\n else {\n command_1.issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\nexports.addPath = addPath;\n/**\n * Gets the value of an input.\n * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.\n * Returns an empty string if the value is not defined.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nfunction getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n if (options && options.trimWhitespace === false) {\n return val;\n }\n return val.trim();\n}\nexports.getInput = getInput;\n/**\n * Gets the values of an multiline input. Each value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string[]\n *\n */\nfunction getMultilineInput(name, options) {\n const inputs = getInput(name, options)\n .split('\\n')\n .filter(x => x !== '');\n return inputs;\n}\nexports.getMultilineInput = getMultilineInput;\n/**\n * Gets the input value of the boolean type in the YAML 1.2 \"core schema\" specification.\n * Support boolean input list: `true | True | TRUE | false | False | FALSE` .\n * The return value is also in boolean type.\n * ref: https://yaml.org/spec/1.2/spec.html#id2804923\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns boolean\n */\nfunction getBooleanInput(name, options) {\n const trueValue = ['true', 'True', 'TRUE'];\n const falseValue = ['false', 'False', 'FALSE'];\n const val = getInput(name, options);\n if (trueValue.includes(val))\n return true;\n if (falseValue.includes(val))\n return false;\n throw new TypeError(`Input does not meet YAML 1.2 \"Core Schema\" specification: ${name}\\n` +\n `Support boolean input list: \\`true | True | TRUE | false | False | FALSE\\``);\n}\nexports.getBooleanInput = getBooleanInput;\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setOutput(name, value) {\n process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, value);\n}\nexports.setOutput = setOutput;\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nfunction setCommandEcho(enabled) {\n command_1.issue('echo', enabled ? 'on' : 'off');\n}\nexports.setCommandEcho = setCommandEcho;\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nfunction setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\nexports.setFailed = setFailed;\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nfunction isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\nexports.isDebug = isDebug;\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nfunction debug(message) {\n command_1.issueCommand('debug', {}, message);\n}\nexports.debug = debug;\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction error(message, properties = {}) {\n command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.error = error;\n/**\n * Adds a warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction warning(message, properties = {}) {\n command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.warning = warning;\n/**\n * Adds a notice issue\n * @param message notice issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction notice(message, properties = {}) {\n command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.notice = notice;\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nfunction info(message) {\n process.stdout.write(message + os.EOL);\n}\nexports.info = info;\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nfunction startGroup(name) {\n command_1.issue('group', name);\n}\nexports.startGroup = startGroup;\n/**\n * End an output group.\n */\nfunction endGroup() {\n command_1.issue('endgroup');\n}\nexports.endGroup = endGroup;\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nfunction group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\nexports.group = group;\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction saveState(name, value) {\n command_1.issueCommand('save-state', { name }, value);\n}\nexports.saveState = saveState;\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nfunction getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexports.getState = getState;\nfunction getIDToken(aud) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield oidc_utils_1.OidcClient.getIDToken(aud);\n });\n}\nexports.getIDToken = getIDToken;\n//# sourceMappingURL=core.js.map","\"use strict\";\n// For internal use, subject to change.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issueCommand = void 0;\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst fs = __importStar(require(\"fs\"));\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\nfunction issueCommand(command, message) {\n const filePath = process.env[`GITHUB_${command}`];\n if (!filePath) {\n throw new Error(`Unable to find environment variable for file command ${command}`);\n }\n if (!fs.existsSync(filePath)) {\n throw new Error(`Missing file at path: ${filePath}`);\n }\n fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {\n encoding: 'utf8'\n });\n}\nexports.issueCommand = issueCommand;\n//# sourceMappingURL=file-command.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OidcClient = void 0;\nconst http_client_1 = require(\"@actions/http-client\");\nconst auth_1 = require(\"@actions/http-client/auth\");\nconst core_1 = require(\"./core\");\nclass OidcClient {\n static createHttpClient(allowRetry = true, maxRetry = 10) {\n const requestOptions = {\n allowRetries: allowRetry,\n maxRetries: maxRetry\n };\n return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);\n }\n static getRequestToken() {\n const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];\n if (!token) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');\n }\n return token;\n }\n static getIDTokenUrl() {\n const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];\n if (!runtimeUrl) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');\n }\n return runtimeUrl;\n }\n static getCall(id_token_url) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const httpclient = OidcClient.createHttpClient();\n const res = yield httpclient\n .getJson(id_token_url)\n .catch(error => {\n throw new Error(`Failed to get ID Token. \\n \n Error Code : ${error.statusCode}\\n \n Error Message: ${error.result.message}`);\n });\n const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;\n if (!id_token) {\n throw new Error('Response json body do not have ID Token field');\n }\n return id_token;\n });\n }\n static getIDToken(audience) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n // New ID Token is requested from action service\n let id_token_url = OidcClient.getIDTokenUrl();\n if (audience) {\n const encodedAudience = encodeURIComponent(audience);\n id_token_url = `${id_token_url}&audience=${encodedAudience}`;\n }\n core_1.debug(`ID token url is ${id_token_url}`);\n const id_token = yield OidcClient.getCall(id_token_url);\n core_1.setSecret(id_token);\n return id_token;\n }\n catch (error) {\n throw new Error(`Error message: ${error.message}`);\n }\n });\n }\n}\nexports.OidcClient = OidcClient;\n//# sourceMappingURL=oidc-utils.js.map","\"use strict\";\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toCommandProperties = exports.toCommandValue = void 0;\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nfunction toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}\nexports.toCommandValue = toCommandValue;\n/**\n *\n * @param annotationProperties\n * @returns The command properties to send with the actual annotation command\n * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646\n */\nfunction toCommandProperties(annotationProperties) {\n if (!Object.keys(annotationProperties).length) {\n return {};\n }\n return {\n title: annotationProperties.title,\n file: annotationProperties.file,\n line: annotationProperties.startLine,\n endLine: annotationProperties.endLine,\n col: annotationProperties.startColumn,\n endColumn: annotationProperties.endColumn\n };\n}\nexports.toCommandProperties = toCommandProperties;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass BasicCredentialHandler {\n constructor(username, password) {\n this.username = username;\n this.password = password;\n }\n prepareRequest(options) {\n options.headers['Authorization'] =\n 'Basic ' +\n Buffer.from(this.username + ':' + this.password).toString('base64');\n }\n // This handler cannot handle 401\n canHandleAuthentication(response) {\n return false;\n }\n handleAuthentication(httpClient, requestInfo, objs) {\n return null;\n }\n}\nexports.BasicCredentialHandler = BasicCredentialHandler;\nclass BearerCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n options.headers['Authorization'] = 'Bearer ' + this.token;\n }\n // This handler cannot handle 401\n canHandleAuthentication(response) {\n return false;\n }\n handleAuthentication(httpClient, requestInfo, objs) {\n return null;\n }\n}\nexports.BearerCredentialHandler = BearerCredentialHandler;\nclass PersonalAccessTokenCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n options.headers['Authorization'] =\n 'Basic ' + Buffer.from('PAT:' + this.token).toString('base64');\n }\n // This handler cannot handle 401\n canHandleAuthentication(response) {\n return false;\n }\n handleAuthentication(httpClient, requestInfo, objs) {\n return null;\n }\n}\nexports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst http = require(\"http\");\nconst https = require(\"https\");\nconst pm = require(\"./proxy\");\nlet tunnel;\nvar HttpCodes;\n(function (HttpCodes) {\n HttpCodes[HttpCodes[\"OK\"] = 200] = \"OK\";\n HttpCodes[HttpCodes[\"MultipleChoices\"] = 300] = \"MultipleChoices\";\n HttpCodes[HttpCodes[\"MovedPermanently\"] = 301] = \"MovedPermanently\";\n HttpCodes[HttpCodes[\"ResourceMoved\"] = 302] = \"ResourceMoved\";\n HttpCodes[HttpCodes[\"SeeOther\"] = 303] = \"SeeOther\";\n HttpCodes[HttpCodes[\"NotModified\"] = 304] = \"NotModified\";\n HttpCodes[HttpCodes[\"UseProxy\"] = 305] = \"UseProxy\";\n HttpCodes[HttpCodes[\"SwitchProxy\"] = 306] = \"SwitchProxy\";\n HttpCodes[HttpCodes[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n HttpCodes[HttpCodes[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n HttpCodes[HttpCodes[\"BadRequest\"] = 400] = \"BadRequest\";\n HttpCodes[HttpCodes[\"Unauthorized\"] = 401] = \"Unauthorized\";\n HttpCodes[HttpCodes[\"PaymentRequired\"] = 402] = \"PaymentRequired\";\n HttpCodes[HttpCodes[\"Forbidden\"] = 403] = \"Forbidden\";\n HttpCodes[HttpCodes[\"NotFound\"] = 404] = \"NotFound\";\n HttpCodes[HttpCodes[\"MethodNotAllowed\"] = 405] = \"MethodNotAllowed\";\n HttpCodes[HttpCodes[\"NotAcceptable\"] = 406] = \"NotAcceptable\";\n HttpCodes[HttpCodes[\"ProxyAuthenticationRequired\"] = 407] = \"ProxyAuthenticationRequired\";\n HttpCodes[HttpCodes[\"RequestTimeout\"] = 408] = \"RequestTimeout\";\n HttpCodes[HttpCodes[\"Conflict\"] = 409] = \"Conflict\";\n HttpCodes[HttpCodes[\"Gone\"] = 410] = \"Gone\";\n HttpCodes[HttpCodes[\"TooManyRequests\"] = 429] = \"TooManyRequests\";\n HttpCodes[HttpCodes[\"InternalServerError\"] = 500] = \"InternalServerError\";\n HttpCodes[HttpCodes[\"NotImplemented\"] = 501] = \"NotImplemented\";\n HttpCodes[HttpCodes[\"BadGateway\"] = 502] = \"BadGateway\";\n HttpCodes[HttpCodes[\"ServiceUnavailable\"] = 503] = \"ServiceUnavailable\";\n HttpCodes[HttpCodes[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));\nvar Headers;\n(function (Headers) {\n Headers[\"Accept\"] = \"accept\";\n Headers[\"ContentType\"] = \"content-type\";\n})(Headers = exports.Headers || (exports.Headers = {}));\nvar MediaTypes;\n(function (MediaTypes) {\n MediaTypes[\"ApplicationJson\"] = \"application/json\";\n})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));\n/**\n * Returns the proxy URL, depending upon the supplied url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\nfunction getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}\nexports.getProxyUrl = getProxyUrl;\nconst HttpRedirectCodes = [\n HttpCodes.MovedPermanently,\n HttpCodes.ResourceMoved,\n HttpCodes.SeeOther,\n HttpCodes.TemporaryRedirect,\n HttpCodes.PermanentRedirect\n];\nconst HttpResponseRetryCodes = [\n HttpCodes.BadGateway,\n HttpCodes.ServiceUnavailable,\n HttpCodes.GatewayTimeout\n];\nconst RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];\nconst ExponentialBackoffCeiling = 10;\nconst ExponentialBackoffTimeSlice = 5;\nclass HttpClientError extends Error {\n constructor(message, statusCode) {\n super(message);\n this.name = 'HttpClientError';\n this.statusCode = statusCode;\n Object.setPrototypeOf(this, HttpClientError.prototype);\n }\n}\nexports.HttpClientError = HttpClientError;\nclass HttpClientResponse {\n constructor(message) {\n this.message = message;\n }\n readBody() {\n return new Promise(async (resolve, reject) => {\n let output = Buffer.alloc(0);\n this.message.on('data', (chunk) => {\n output = Buffer.concat([output, chunk]);\n });\n this.message.on('end', () => {\n resolve(output.toString());\n });\n });\n }\n}\nexports.HttpClientResponse = HttpClientResponse;\nfunction isHttps(requestUrl) {\n let parsedUrl = new URL(requestUrl);\n return parsedUrl.protocol === 'https:';\n}\nexports.isHttps = isHttps;\nclass HttpClient {\n constructor(userAgent, handlers, requestOptions) {\n this._ignoreSslError = false;\n this._allowRedirects = true;\n this._allowRedirectDowngrade = false;\n this._maxRedirects = 50;\n this._allowRetries = false;\n this._maxRetries = 1;\n this._keepAlive = false;\n this._disposed = false;\n this.userAgent = userAgent;\n this.handlers = handlers || [];\n this.requestOptions = requestOptions;\n if (requestOptions) {\n if (requestOptions.ignoreSslError != null) {\n this._ignoreSslError = requestOptions.ignoreSslError;\n }\n this._socketTimeout = requestOptions.socketTimeout;\n if (requestOptions.allowRedirects != null) {\n this._allowRedirects = requestOptions.allowRedirects;\n }\n if (requestOptions.allowRedirectDowngrade != null) {\n this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;\n }\n if (requestOptions.maxRedirects != null) {\n this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);\n }\n if (requestOptions.keepAlive != null) {\n this._keepAlive = requestOptions.keepAlive;\n }\n if (requestOptions.allowRetries != null) {\n this._allowRetries = requestOptions.allowRetries;\n }\n if (requestOptions.maxRetries != null) {\n this._maxRetries = requestOptions.maxRetries;\n }\n }\n }\n options(requestUrl, additionalHeaders) {\n return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});\n }\n get(requestUrl, additionalHeaders) {\n return this.request('GET', requestUrl, null, additionalHeaders || {});\n }\n del(requestUrl, additionalHeaders) {\n return this.request('DELETE', requestUrl, null, additionalHeaders || {});\n }\n post(requestUrl, data, additionalHeaders) {\n return this.request('POST', requestUrl, data, additionalHeaders || {});\n }\n patch(requestUrl, data, additionalHeaders) {\n return this.request('PATCH', requestUrl, data, additionalHeaders || {});\n }\n put(requestUrl, data, additionalHeaders) {\n return this.request('PUT', requestUrl, data, additionalHeaders || {});\n }\n head(requestUrl, additionalHeaders) {\n return this.request('HEAD', requestUrl, null, additionalHeaders || {});\n }\n sendStream(verb, requestUrl, stream, additionalHeaders) {\n return this.request(verb, requestUrl, stream, additionalHeaders);\n }\n /**\n * Gets a typed object from an endpoint\n * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise\n */\n async getJson(requestUrl, additionalHeaders = {}) {\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n let res = await this.get(requestUrl, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n async postJson(requestUrl, obj, additionalHeaders = {}) {\n let data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n let res = await this.post(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n async putJson(requestUrl, obj, additionalHeaders = {}) {\n let data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n let res = await this.put(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n async patchJson(requestUrl, obj, additionalHeaders = {}) {\n let data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n let res = await this.patch(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n /**\n * Makes a raw http request.\n * All other methods such as get, post, patch, and request ultimately call this.\n * Prefer get, del, post and patch\n */\n async request(verb, requestUrl, data, headers) {\n if (this._disposed) {\n throw new Error('Client has already been disposed.');\n }\n let parsedUrl = new URL(requestUrl);\n let info = this._prepareRequest(verb, parsedUrl, headers);\n // Only perform retries on reads since writes may not be idempotent.\n let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1\n ? this._maxRetries + 1\n : 1;\n let numTries = 0;\n let response;\n while (numTries < maxTries) {\n response = await this.requestRaw(info, data);\n // Check if it's an authentication challenge\n if (response &&\n response.message &&\n response.message.statusCode === HttpCodes.Unauthorized) {\n let authenticationHandler;\n for (let i = 0; i < this.handlers.length; i++) {\n if (this.handlers[i].canHandleAuthentication(response)) {\n authenticationHandler = this.handlers[i];\n break;\n }\n }\n if (authenticationHandler) {\n return authenticationHandler.handleAuthentication(this, info, data);\n }\n else {\n // We have received an unauthorized response but have no handlers to handle it.\n // Let the response return to the caller.\n return response;\n }\n }\n let redirectsRemaining = this._maxRedirects;\n while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&\n this._allowRedirects &&\n redirectsRemaining > 0) {\n const redirectUrl = response.message.headers['location'];\n if (!redirectUrl) {\n // if there's no location to redirect to, we won't\n break;\n }\n let parsedRedirectUrl = new URL(redirectUrl);\n if (parsedUrl.protocol == 'https:' &&\n parsedUrl.protocol != parsedRedirectUrl.protocol &&\n !this._allowRedirectDowngrade) {\n throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');\n }\n // we need to finish reading the response before reassigning response\n // which will leak the open socket.\n await response.readBody();\n // strip authorization header if redirected to a different hostname\n if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {\n for (let header in headers) {\n // header names are case insensitive\n if (header.toLowerCase() === 'authorization') {\n delete headers[header];\n }\n }\n }\n // let's make the request with the new redirectUrl\n info = this._prepareRequest(verb, parsedRedirectUrl, headers);\n response = await this.requestRaw(info, data);\n redirectsRemaining--;\n }\n if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {\n // If not a retry code, return immediately instead of retrying\n return response;\n }\n numTries += 1;\n if (numTries < maxTries) {\n await response.readBody();\n await this._performExponentialBackoff(numTries);\n }\n }\n return response;\n }\n /**\n * Needs to be called if keepAlive is set to true in request options.\n */\n dispose() {\n if (this._agent) {\n this._agent.destroy();\n }\n this._disposed = true;\n }\n /**\n * Raw request.\n * @param info\n * @param data\n */\n requestRaw(info, data) {\n return new Promise((resolve, reject) => {\n let callbackForResult = function (err, res) {\n if (err) {\n reject(err);\n }\n resolve(res);\n };\n this.requestRawWithCallback(info, data, callbackForResult);\n });\n }\n /**\n * Raw request with callback.\n * @param info\n * @param data\n * @param onResult\n */\n requestRawWithCallback(info, data, onResult) {\n let socket;\n if (typeof data === 'string') {\n info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n let handleResult = (err, res) => {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n };\n let req = info.httpModule.request(info.options, (msg) => {\n let res = new HttpClientResponse(msg);\n handleResult(null, res);\n });\n req.on('socket', sock => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error('Request timeout: ' + info.options.path), null);\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err, null);\n });\n if (data && typeof data === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof data !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }\n /**\n * Gets an http agent. This function is useful when you need an http agent that handles\n * routing through a proxy server - depending upon the url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\n getAgent(serverUrl) {\n let parsedUrl = new URL(serverUrl);\n return this._getAgent(parsedUrl);\n }\n _prepareRequest(method, requestUrl, headers) {\n const info = {};\n info.parsedUrl = requestUrl;\n const usingSsl = info.parsedUrl.protocol === 'https:';\n info.httpModule = usingSsl ? https : http;\n const defaultPort = usingSsl ? 443 : 80;\n info.options = {};\n info.options.host = info.parsedUrl.hostname;\n info.options.port = info.parsedUrl.port\n ? parseInt(info.parsedUrl.port)\n : defaultPort;\n info.options.path =\n (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');\n info.options.method = method;\n info.options.headers = this._mergeHeaders(headers);\n if (this.userAgent != null) {\n info.options.headers['user-agent'] = this.userAgent;\n }\n info.options.agent = this._getAgent(info.parsedUrl);\n // gives handlers an opportunity to participate\n if (this.handlers) {\n this.handlers.forEach(handler => {\n handler.prepareRequest(info.options);\n });\n }\n return info;\n }\n _mergeHeaders(headers) {\n const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n if (this.requestOptions && this.requestOptions.headers) {\n return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));\n }\n return lowercaseKeys(headers || {});\n }\n _getExistingOrDefaultHeader(additionalHeaders, header, _default) {\n const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n let clientHeader;\n if (this.requestOptions && this.requestOptions.headers) {\n clientHeader = lowercaseKeys(this.requestOptions.headers)[header];\n }\n return additionalHeaders[header] || clientHeader || _default;\n }\n _getAgent(parsedUrl) {\n let agent;\n let proxyUrl = pm.getProxyUrl(parsedUrl);\n let useProxy = proxyUrl && proxyUrl.hostname;\n if (this._keepAlive && useProxy) {\n agent = this._proxyAgent;\n }\n if (this._keepAlive && !useProxy) {\n agent = this._agent;\n }\n // if agent is already assigned use that agent.\n if (!!agent) {\n return agent;\n }\n const usingSsl = parsedUrl.protocol === 'https:';\n let maxSockets = 100;\n if (!!this.requestOptions) {\n maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;\n }\n if (useProxy) {\n // If using proxy, need tunnel\n if (!tunnel) {\n tunnel = require('tunnel');\n }\n const agentOptions = {\n maxSockets: maxSockets,\n keepAlive: this._keepAlive,\n proxy: {\n ...((proxyUrl.username || proxyUrl.password) && {\n proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`\n }),\n host: proxyUrl.hostname,\n port: proxyUrl.port\n }\n };\n let tunnelAgent;\n const overHttps = proxyUrl.protocol === 'https:';\n if (usingSsl) {\n tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;\n }\n else {\n tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;\n }\n agent = tunnelAgent(agentOptions);\n this._proxyAgent = agent;\n }\n // if reusing agent across request and tunneling agent isn't assigned create a new agent\n if (this._keepAlive && !agent) {\n const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };\n agent = usingSsl ? new https.Agent(options) : new http.Agent(options);\n this._agent = agent;\n }\n // if not using private agent and tunnel agent isn't setup then use global agent\n if (!agent) {\n agent = usingSsl ? https.globalAgent : http.globalAgent;\n }\n if (usingSsl && this._ignoreSslError) {\n // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n // we have to cast it to any and change it directly\n agent.options = Object.assign(agent.options || {}, {\n rejectUnauthorized: false\n });\n }\n return agent;\n }\n _performExponentialBackoff(retryNumber) {\n retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);\n const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);\n return new Promise(resolve => setTimeout(() => resolve(), ms));\n }\n static dateTimeDeserializer(key, value) {\n if (typeof value === 'string') {\n let a = new Date(value);\n if (!isNaN(a.valueOf())) {\n return a;\n }\n }\n return value;\n }\n async _processResponse(res, options) {\n return new Promise(async (resolve, reject) => {\n const statusCode = res.message.statusCode;\n const response = {\n statusCode: statusCode,\n result: null,\n headers: {}\n };\n // not found leads to null obj returned\n if (statusCode == HttpCodes.NotFound) {\n resolve(response);\n }\n let obj;\n let contents;\n // get the result from the body\n try {\n contents = await res.readBody();\n if (contents && contents.length > 0) {\n if (options && options.deserializeDates) {\n obj = JSON.parse(contents, HttpClient.dateTimeDeserializer);\n }\n else {\n obj = JSON.parse(contents);\n }\n response.result = obj;\n }\n response.headers = res.message.headers;\n }\n catch (err) {\n // Invalid resource (contents not json); leaving result obj null\n }\n // note that 3xx redirects are handled by the http layer.\n if (statusCode > 299) {\n let msg;\n // if exception/error in body, attempt to get better error\n if (obj && obj.message) {\n msg = obj.message;\n }\n else if (contents && contents.length > 0) {\n // it may be the case that the exception is in the body message as string\n msg = contents;\n }\n else {\n msg = 'Failed request: (' + statusCode + ')';\n }\n let err = new HttpClientError(msg, statusCode);\n err.result = response.result;\n reject(err);\n }\n else {\n resolve(response);\n }\n });\n }\n}\nexports.HttpClient = HttpClient;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction getProxyUrl(reqUrl) {\n let usingSsl = reqUrl.protocol === 'https:';\n let proxyUrl;\n if (checkBypass(reqUrl)) {\n return proxyUrl;\n }\n let proxyVar;\n if (usingSsl) {\n proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n }\n else {\n proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];\n }\n if (proxyVar) {\n proxyUrl = new URL(proxyVar);\n }\n return proxyUrl;\n}\nexports.getProxyUrl = getProxyUrl;\nfunction checkBypass(reqUrl) {\n if (!reqUrl.hostname) {\n return false;\n }\n let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';\n if (!noProxy) {\n return false;\n }\n // Determine the request port\n let reqPort;\n if (reqUrl.port) {\n reqPort = Number(reqUrl.port);\n }\n else if (reqUrl.protocol === 'http:') {\n reqPort = 80;\n }\n else if (reqUrl.protocol === 'https:') {\n reqPort = 443;\n }\n // Format the request hostname and hostname with port\n let upperReqHosts = [reqUrl.hostname.toUpperCase()];\n if (typeof reqPort === 'number') {\n upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);\n }\n // Compare request host against noproxy\n for (let upperNoProxyItem of noProxy\n .split(',')\n .map(x => x.trim().toUpperCase())\n .filter(x => x)) {\n if (upperReqHosts.some(x => x === upperNoProxyItem)) {\n return true;\n }\n }\n return false;\n}\nexports.checkBypass = checkBypass;\n","\"use strict\";\n\n// Runtime header offsets\nconst ID_OFFSET = -8;\nconst SIZE_OFFSET = -4;\n\n// Runtime ids\nconst ARRAYBUFFER_ID = 0;\nconst STRING_ID = 1;\nconst ARRAYBUFFERVIEW_ID = 2;\n\n// Runtime type information\nconst ARRAYBUFFERVIEW = 1 << 0;\nconst ARRAY = 1 << 1;\nconst SET = 1 << 2;\nconst MAP = 1 << 3;\nconst VAL_ALIGN_OFFSET = 5;\nconst VAL_ALIGN = 1 << VAL_ALIGN_OFFSET;\nconst VAL_SIGNED = 1 << 10;\nconst VAL_FLOAT = 1 << 11;\nconst VAL_NULLABLE = 1 << 12;\nconst VAL_MANAGED = 1 << 13;\nconst KEY_ALIGN_OFFSET = 14;\nconst KEY_ALIGN = 1 << KEY_ALIGN_OFFSET;\nconst KEY_SIGNED = 1 << 19;\nconst KEY_FLOAT = 1 << 20;\nconst KEY_NULLABLE = 1 << 21;\nconst KEY_MANAGED = 1 << 22;\n\n// Array(BufferView) layout\nconst ARRAYBUFFERVIEW_BUFFER_OFFSET = 0;\nconst ARRAYBUFFERVIEW_DATASTART_OFFSET = 4;\nconst ARRAYBUFFERVIEW_DATALENGTH_OFFSET = 8;\nconst ARRAYBUFFERVIEW_SIZE = 12;\nconst ARRAY_LENGTH_OFFSET = 12;\nconst ARRAY_SIZE = 16;\n\nconst BIGINT = typeof BigUint64Array !== \"undefined\";\nconst THIS = Symbol();\nconst CHUNKSIZE = 1024;\n\n/** Gets a string from an U32 and an U16 view on a memory. */\nfunction getStringImpl(buffer, ptr) {\n const U32 = new Uint32Array(buffer);\n const U16 = new Uint16Array(buffer);\n var length = U32[(ptr + SIZE_OFFSET) >>> 2] >>> 1;\n var offset = ptr >>> 1;\n if (length <= CHUNKSIZE) return String.fromCharCode.apply(String, U16.subarray(offset, offset + length));\n const parts = [];\n do {\n const last = U16[offset + CHUNKSIZE - 1];\n const size = last >= 0xD800 && last < 0xDC00 ? CHUNKSIZE - 1 : CHUNKSIZE;\n parts.push(String.fromCharCode.apply(String, U16.subarray(offset, offset += size)));\n length -= size;\n } while (length > CHUNKSIZE);\n return parts.join(\"\") + String.fromCharCode.apply(String, U16.subarray(offset, offset + length));\n}\n\n/** Prepares the base module prior to instantiation. */\nfunction preInstantiate(imports) {\n const baseModule = {};\n\n function getString(memory, ptr) {\n if (!memory) return \"\";\n return getStringImpl(memory.buffer, ptr);\n }\n\n // add common imports used by stdlib for convenience\n const env = (imports.env = imports.env || {});\n env.abort = env.abort || function abort(mesg, file, line, colm) {\n const memory = baseModule.memory || env.memory; // prefer exported, otherwise try imported\n throw Error(\"abort: \" + getString(memory, mesg) + \" at \" + getString(memory, file) + \":\" + line + \":\" + colm);\n }\n env.trace = env.trace || function trace(mesg, n) {\n const memory = baseModule.memory || env.memory;\n console.log(\"trace: \" + getString(memory, mesg) + (n ? \" \" : \"\") + Array.prototype.slice.call(arguments, 2, 2 + n).join(\", \"));\n }\n imports.Math = imports.Math || Math;\n imports.Date = imports.Date || Date;\n\n return baseModule;\n}\n\n/** Prepares the final module once instantiation is complete. */\nfunction postInstantiate(baseModule, instance) {\n const rawExports = instance.exports;\n const memory = rawExports.memory;\n const table = rawExports.table;\n const alloc = rawExports[\"__alloc\"];\n const retain = rawExports[\"__retain\"];\n const rttiBase = rawExports[\"__rtti_base\"] || ~0; // oob if not present\n\n /** Gets the runtime type info for the given id. */\n function getInfo(id) {\n const U32 = new Uint32Array(memory.buffer);\n const count = U32[rttiBase >>> 2];\n if ((id >>>= 0) >= count) throw Error(\"invalid id: \" + id);\n return U32[(rttiBase + 4 >>> 2) + id * 2];\n }\n\n /** Gets the runtime base id for the given id. */\n function getBase(id) {\n const U32 = new Uint32Array(memory.buffer);\n const count = U32[rttiBase >>> 2];\n if ((id >>>= 0) >= count) throw Error(\"invalid id: \" + id);\n return U32[(rttiBase + 4 >>> 2) + id * 2 + 1];\n }\n\n /** Gets the runtime alignment of a collection's values. */\n function getValueAlign(info) {\n return 31 - Math.clz32((info >>> VAL_ALIGN_OFFSET) & 31); // -1 if none\n }\n\n /** Gets the runtime alignment of a collection's keys. */\n function getKeyAlign(info) {\n return 31 - Math.clz32((info >>> KEY_ALIGN_OFFSET) & 31); // -1 if none\n }\n\n /** Allocates a new string in the module's memory and returns its retained pointer. */\n function __allocString(str) {\n const length = str.length;\n const ptr = alloc(length << 1, STRING_ID);\n const U16 = new Uint16Array(memory.buffer);\n for (var i = 0, p = ptr >>> 1; i < length; ++i) U16[p + i] = str.charCodeAt(i);\n return ptr;\n }\n\n baseModule.__allocString = __allocString;\n\n /** Reads a string from the module's memory by its pointer. */\n function __getString(ptr) {\n const buffer = memory.buffer;\n const id = new Uint32Array(buffer)[ptr + ID_OFFSET >>> 2];\n if (id !== STRING_ID) throw Error(\"not a string: \" + ptr);\n return getStringImpl(buffer, ptr);\n }\n\n baseModule.__getString = __getString;\n\n /** Gets the view matching the specified alignment, signedness and floatness. */\n function getView(alignLog2, signed, float) {\n const buffer = memory.buffer;\n if (float) {\n switch (alignLog2) {\n case 2: return new Float32Array(buffer);\n case 3: return new Float64Array(buffer);\n }\n } else {\n switch (alignLog2) {\n case 0: return new (signed ? Int8Array : Uint8Array)(buffer);\n case 1: return new (signed ? Int16Array : Uint16Array)(buffer);\n case 2: return new (signed ? Int32Array : Uint32Array)(buffer);\n case 3: return new (signed ? BigInt64Array : BigUint64Array)(buffer);\n }\n }\n throw Error(\"unsupported align: \" + alignLog2);\n }\n\n /** Allocates a new array in the module's memory and returns its retained pointer. */\n function __allocArray(id, values) {\n const info = getInfo(id);\n if (!(info & (ARRAYBUFFERVIEW | ARRAY))) throw Error(\"not an array: \" + id + \" @ \" + info);\n const align = getValueAlign(info);\n const length = values.length;\n const buf = alloc(length << align, ARRAYBUFFER_ID);\n const arr = alloc(info & ARRAY ? ARRAY_SIZE : ARRAYBUFFERVIEW_SIZE, id);\n const U32 = new Uint32Array(memory.buffer);\n U32[arr + ARRAYBUFFERVIEW_BUFFER_OFFSET >>> 2] = retain(buf);\n U32[arr + ARRAYBUFFERVIEW_DATASTART_OFFSET >>> 2] = buf;\n U32[arr + ARRAYBUFFERVIEW_DATALENGTH_OFFSET >>> 2] = length << align;\n if (info & ARRAY) U32[arr + ARRAY_LENGTH_OFFSET >>> 2] = length;\n const view = getView(align, info & VAL_SIGNED, info & VAL_FLOAT);\n if (info & VAL_MANAGED) {\n for (let i = 0; i < length; ++i) view[(buf >>> align) + i] = retain(values[i]);\n } else {\n view.set(values, buf >>> align);\n }\n return arr;\n }\n\n baseModule.__allocArray = __allocArray;\n\n /** Gets a live view on an array's values in the module's memory. Infers the array type from RTTI. */\n function __getArrayView(arr) {\n const U32 = new Uint32Array(memory.buffer);\n const id = U32[arr + ID_OFFSET >>> 2];\n const info = getInfo(id);\n if (!(info & ARRAYBUFFERVIEW)) throw Error(\"not an array: \" + id);\n const align = getValueAlign(info);\n var buf = U32[arr + ARRAYBUFFERVIEW_DATASTART_OFFSET >>> 2];\n const length = info & ARRAY\n ? U32[arr + ARRAY_LENGTH_OFFSET >>> 2]\n : U32[buf + SIZE_OFFSET >>> 2] >>> align;\n return getView(align, info & VAL_SIGNED, info & VAL_FLOAT)\n .subarray(buf >>>= align, buf + length);\n }\n\n baseModule.__getArrayView = __getArrayView;\n\n /** Copies an array's values from the module's memory. Infers the array type from RTTI. */\n function __getArray(arr) {\n const input = __getArrayView(arr);\n const len = input.length;\n const out = new Array(len);\n for (let i = 0; i < len; i++) out[i] = input[i];\n return out;\n }\n\n baseModule.__getArray = __getArray;\n\n /** Copies an ArrayBuffer's value from the module's memory. */\n function __getArrayBuffer(ptr) {\n const buffer = memory.buffer;\n const length = new Uint32Array(buffer)[ptr + SIZE_OFFSET >>> 2];\n return buffer.slice(ptr, ptr + length);\n }\n\n baseModule.__getArrayBuffer = __getArrayBuffer;\n\n /** Copies a typed array's values from the module's memory. */\n function getTypedArray(Type, alignLog2, ptr) {\n return new Type(getTypedArrayView(Type, alignLog2, ptr));\n }\n\n /** Gets a live view on a typed array's values in the module's memory. */\n function getTypedArrayView(Type, alignLog2, ptr) {\n const buffer = memory.buffer;\n const U32 = new Uint32Array(buffer);\n const bufPtr = U32[ptr + ARRAYBUFFERVIEW_DATASTART_OFFSET >>> 2];\n return new Type(buffer, bufPtr, U32[bufPtr + SIZE_OFFSET >>> 2] >>> alignLog2);\n }\n\n baseModule.__getInt8Array = getTypedArray.bind(null, Int8Array, 0);\n baseModule.__getInt8ArrayView = getTypedArrayView.bind(null, Int8Array, 0);\n baseModule.__getUint8Array = getTypedArray.bind(null, Uint8Array, 0);\n baseModule.__getUint8ArrayView = getTypedArrayView.bind(null, Uint8Array, 0);\n baseModule.__getUint8ClampedArray = getTypedArray.bind(null, Uint8ClampedArray, 0);\n baseModule.__getUint8ClampedArrayView = getTypedArrayView.bind(null, Uint8ClampedArray, 0);\n baseModule.__getInt16Array = getTypedArray.bind(null, Int16Array, 1);\n baseModule.__getInt16ArrayView = getTypedArrayView.bind(null, Int16Array, 1);\n baseModule.__getUint16Array = getTypedArray.bind(null, Uint16Array, 1);\n baseModule.__getUint16ArrayView = getTypedArrayView.bind(null, Uint16Array, 1);\n baseModule.__getInt32Array = getTypedArray.bind(null, Int32Array, 2);\n baseModule.__getInt32ArrayView = getTypedArrayView.bind(null, Int32Array, 2);\n baseModule.__getUint32Array = getTypedArray.bind(null, Uint32Array, 2);\n baseModule.__getUint32ArrayView = getTypedArrayView.bind(null, Uint32Array, 2);\n if (BIGINT) {\n baseModule.__getInt64Array = getTypedArray.bind(null, BigInt64Array, 3);\n baseModule.__getInt64ArrayView = getTypedArrayView.bind(null, BigInt64Array, 3);\n baseModule.__getUint64Array = getTypedArray.bind(null, BigUint64Array, 3);\n baseModule.__getUint64ArrayView = getTypedArrayView.bind(null, BigUint64Array, 3);\n }\n baseModule.__getFloat32Array = getTypedArray.bind(null, Float32Array, 2);\n baseModule.__getFloat32ArrayView = getTypedArrayView.bind(null, Float32Array, 2);\n baseModule.__getFloat64Array = getTypedArray.bind(null, Float64Array, 3);\n baseModule.__getFloat64ArrayView = getTypedArrayView.bind(null, Float64Array, 3);\n\n /** Tests whether an object is an instance of the class represented by the specified base id. */\n function __instanceof(ptr, baseId) {\n const U32 = new Uint32Array(memory.buffer);\n var id = U32[(ptr + ID_OFFSET) >>> 2];\n if (id <= U32[rttiBase >>> 2]) {\n do if (id == baseId) return true;\n while (id = getBase(id));\n }\n return false;\n }\n\n baseModule.__instanceof = __instanceof;\n\n // Pull basic exports to baseModule so code in preInstantiate can use them\n baseModule.memory = baseModule.memory || memory;\n baseModule.table = baseModule.table || table;\n\n // Demangle exports and provide the usual utility on the prototype\n return demangle(rawExports, baseModule);\n}\n\nfunction isResponse(o) {\n return typeof Response !== \"undefined\" && o instanceof Response;\n}\n\n/** Asynchronously instantiates an AssemblyScript module from anything that can be instantiated. */\nasync function instantiate(source, imports) {\n if (isResponse(source = await source)) return instantiateStreaming(source, imports);\n return postInstantiate(\n preInstantiate(imports || (imports = {})),\n await WebAssembly.instantiate(\n source instanceof WebAssembly.Module\n ? source\n : await WebAssembly.compile(source),\n imports\n )\n );\n}\n\nexports.instantiate = instantiate;\n\n/** Synchronously instantiates an AssemblyScript module from a WebAssembly.Module or binary buffer. */\nfunction instantiateSync(source, imports) {\n return postInstantiate(\n preInstantiate(imports || (imports = {})),\n new WebAssembly.Instance(\n source instanceof WebAssembly.Module\n ? source\n : new WebAssembly.Module(source),\n imports\n )\n )\n}\n\nexports.instantiateSync = instantiateSync;\n\n/** Asynchronously instantiates an AssemblyScript module from a response, i.e. as obtained by `fetch`. */\nasync function instantiateStreaming(source, imports) {\n if (!WebAssembly.instantiateStreaming) {\n return instantiate(\n isResponse(source = await source)\n ? source.arrayBuffer()\n : source,\n imports\n );\n }\n return postInstantiate(\n preInstantiate(imports || (imports = {})),\n (await WebAssembly.instantiateStreaming(source, imports)).instance\n );\n}\n\nexports.instantiateStreaming = instantiateStreaming;\n\n/** Demangles an AssemblyScript module's exports to a friendly object structure. */\nfunction demangle(exports, baseModule) {\n var module = baseModule ? Object.create(baseModule) : {};\n var setArgumentsLength = exports[\"__argumentsLength\"]\n ? function(length) { exports[\"__argumentsLength\"].value = length; }\n : exports[\"__setArgumentsLength\"] || exports[\"__setargc\"] || function() {};\n for (let internalName in exports) {\n if (!Object.prototype.hasOwnProperty.call(exports, internalName)) continue;\n const elem = exports[internalName];\n let parts = internalName.split(\".\");\n let curr = module;\n while (parts.length > 1) {\n let part = parts.shift();\n if (!Object.prototype.hasOwnProperty.call(curr, part)) curr[part] = {};\n curr = curr[part];\n }\n let name = parts[0];\n let hash = name.indexOf(\"#\");\n if (hash >= 0) {\n let className = name.substring(0, hash);\n let classElem = curr[className];\n if (typeof classElem === \"undefined\" || !classElem.prototype) {\n let ctor = function(...args) {\n return ctor.wrap(ctor.prototype.constructor(0, ...args));\n };\n ctor.prototype = {\n valueOf: function valueOf() {\n return this[THIS];\n }\n };\n ctor.wrap = function(thisValue) {\n return Object.create(ctor.prototype, { [THIS]: { value: thisValue, writable: false } });\n };\n if (classElem) Object.getOwnPropertyNames(classElem).forEach(name =>\n Object.defineProperty(ctor, name, Object.getOwnPropertyDescriptor(classElem, name))\n );\n curr[className] = ctor;\n }\n name = name.substring(hash + 1);\n curr = curr[className].prototype;\n if (/^(get|set):/.test(name)) {\n if (!Object.prototype.hasOwnProperty.call(curr, name = name.substring(4))) {\n let getter = exports[internalName.replace(\"set:\", \"get:\")];\n let setter = exports[internalName.replace(\"get:\", \"set:\")];\n Object.defineProperty(curr, name, {\n get: function() { return getter(this[THIS]); },\n set: function(value) { setter(this[THIS], value); },\n enumerable: true\n });\n }\n } else {\n if (name === 'constructor') {\n (curr[name] = (...args) => {\n setArgumentsLength(args.length);\n return elem(...args);\n }).original = elem;\n } else { // instance method\n (curr[name] = function(...args) { // !\n setArgumentsLength(args.length);\n return elem(this[THIS], ...args);\n }).original = elem;\n }\n }\n } else {\n if (/^(get|set):/.test(name)) {\n if (!Object.prototype.hasOwnProperty.call(curr, name = name.substring(4))) {\n Object.defineProperty(curr, name, {\n get: exports[internalName.replace(\"set:\", \"get:\")],\n set: exports[internalName.replace(\"get:\", \"set:\")],\n enumerable: true\n });\n }\n } else if (typeof elem === \"function\" && elem !== setArgumentsLength) {\n (curr[name] = (...args) => {\n setArgumentsLength(args.length);\n return elem(...args);\n }).original = elem;\n } else {\n curr[name] = elem;\n }\n }\n }\n return module;\n}\n\nexports.demangle = demangle;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar reader = require('./lib/reader.js');\nvar indexer = require('./lib/indexer.js');\nvar iterator = require('./lib/iterator.js');\nvar writer = require('./lib/writer.js');\nvar indexedReader = require('./lib/indexed-reader.js');\n\n\n\nexports.CarReader = reader.CarReader;\nexports.CarIndexer = indexer.CarIndexer;\nexports.CarBlockIterator = iterator.CarBlockIterator;\nexports.CarCIDIterator = iterator.CarCIDIterator;\nexports.CarWriter = writer.CarWriter;\nexports.CarIndexedReader = indexedReader.CarIndexedReader;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar varint = require('varint');\nvar cid = require('multiformats/cid');\nvar Digest = require('multiformats/hashes/digest');\nvar dagCbor = require('@ipld/dag-cbor');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () { return e[k]; }\n });\n }\n });\n }\n n[\"default\"] = e;\n return Object.freeze(n);\n}\n\nvar varint__default = /*#__PURE__*/_interopDefaultLegacy(varint);\nvar Digest__namespace = /*#__PURE__*/_interopNamespace(Digest);\n\nconst CIDV0_BYTES = {\n SHA2_256: 18,\n LENGTH: 32,\n DAG_PB: 112\n};\nasync function readVarint(reader) {\n const bytes = await reader.upTo(8);\n const i = varint__default[\"default\"].decode(bytes);\n reader.seek(varint__default[\"default\"].decode.bytes);\n return i;\n}\nasync function readHeader(reader) {\n const length = await readVarint(reader);\n if (length === 0) {\n throw new Error('Invalid CAR header (zero length)');\n }\n const header = await reader.exactly(length);\n reader.seek(length);\n const block = dagCbor.decode(header);\n if (block == null || Array.isArray(block) || typeof block !== 'object') {\n throw new Error('Invalid CAR header format');\n }\n if (block.version !== 1) {\n if (typeof block.version === 'string') {\n throw new Error(`Invalid CAR version: \"${ block.version }\"`);\n }\n throw new Error(`Invalid CAR version: ${ block.version }`);\n }\n if (!Array.isArray(block.roots)) {\n throw new Error('Invalid CAR header format');\n }\n if (Object.keys(block).filter(p => p !== 'roots' && p !== 'version').length) {\n throw new Error('Invalid CAR header format');\n }\n return block;\n}\nasync function readMultihash(reader) {\n const bytes = await reader.upTo(8);\n varint__default[\"default\"].decode(bytes);\n const codeLength = varint__default[\"default\"].decode.bytes;\n const length = varint__default[\"default\"].decode(bytes.subarray(varint__default[\"default\"].decode.bytes));\n const lengthLength = varint__default[\"default\"].decode.bytes;\n const mhLength = codeLength + lengthLength + length;\n const multihash = await reader.exactly(mhLength);\n reader.seek(mhLength);\n return multihash;\n}\nasync function readCid(reader) {\n const first = await reader.exactly(2);\n if (first[0] === CIDV0_BYTES.SHA2_256 && first[1] === CIDV0_BYTES.LENGTH) {\n const bytes = await reader.exactly(34);\n reader.seek(34);\n const multihash = Digest__namespace.decode(bytes);\n return cid.CID.create(0, CIDV0_BYTES.DAG_PB, multihash);\n }\n const version = await readVarint(reader);\n if (version !== 1) {\n throw new Error(`Unexpected CID version (${ version })`);\n }\n const codec = await readVarint(reader);\n const bytes = await readMultihash(reader);\n const multihash = Digest__namespace.decode(bytes);\n return cid.CID.create(version, codec, multihash);\n}\nasync function readBlockHead(reader) {\n const start = reader.pos;\n let length = await readVarint(reader);\n if (length === 0) {\n throw new Error('Invalid CAR section (zero length)');\n }\n length += reader.pos - start;\n const cid = await readCid(reader);\n const blockLength = length - (reader.pos - start);\n return {\n cid,\n length,\n blockLength\n };\n}\nasync function readBlock(reader) {\n const {cid, blockLength} = await readBlockHead(reader);\n const bytes = await reader.exactly(blockLength);\n reader.seek(blockLength);\n return {\n bytes,\n cid\n };\n}\nasync function readBlockIndex(reader) {\n const offset = reader.pos;\n const {cid, length, blockLength} = await readBlockHead(reader);\n const index = {\n cid,\n length,\n blockLength,\n offset,\n blockOffset: reader.pos\n };\n reader.seek(index.blockLength);\n return index;\n}\nfunction createDecoder(reader) {\n const headerPromise = readHeader(reader);\n return {\n header: () => headerPromise,\n async *blocks() {\n await headerPromise;\n while ((await reader.upTo(8)).length > 0) {\n yield await readBlock(reader);\n }\n },\n async *blocksIndex() {\n await headerPromise;\n while ((await reader.upTo(8)).length > 0) {\n yield await readBlockIndex(reader);\n }\n }\n };\n}\nfunction bytesReader(bytes) {\n let pos = 0;\n return {\n async upTo(length) {\n return bytes.subarray(pos, pos + Math.min(length, bytes.length - pos));\n },\n async exactly(length) {\n if (length > bytes.length - pos) {\n throw new Error('Unexpected end of data');\n }\n return bytes.subarray(pos, pos + length);\n },\n seek(length) {\n pos += length;\n },\n get pos() {\n return pos;\n }\n };\n}\nfunction chunkReader(readChunk) {\n let pos = 0;\n let have = 0;\n let offset = 0;\n let currentChunk = new Uint8Array(0);\n const read = async length => {\n have = currentChunk.length - offset;\n const bufa = [currentChunk.subarray(offset)];\n while (have < length) {\n const chunk = await readChunk();\n if (chunk == null) {\n break;\n }\n if (have < 0) {\n if (chunk.length > have) {\n bufa.push(chunk.subarray(-have));\n }\n } else {\n bufa.push(chunk);\n }\n have += chunk.length;\n }\n currentChunk = new Uint8Array(bufa.reduce((p, c) => p + c.length, 0));\n let off = 0;\n for (const b of bufa) {\n currentChunk.set(b, off);\n off += b.length;\n }\n offset = 0;\n };\n return {\n async upTo(length) {\n if (currentChunk.length - offset < length) {\n await read(length);\n }\n return currentChunk.subarray(offset, offset + Math.min(currentChunk.length - offset, length));\n },\n async exactly(length) {\n if (currentChunk.length - offset < length) {\n await read(length);\n }\n if (currentChunk.length - offset < length) {\n throw new Error('Unexpected end of data');\n }\n return currentChunk.subarray(offset, offset + length);\n },\n seek(length) {\n pos += length;\n offset += length;\n },\n get pos() {\n return pos;\n }\n };\n}\nfunction asyncIterableReader(asyncIterable) {\n const iterator = asyncIterable[Symbol.asyncIterator]();\n async function readChunk() {\n const next = await iterator.next();\n if (next.done) {\n return null;\n }\n return next.value;\n }\n return chunkReader(readChunk);\n}\n\nexports.asyncIterableReader = asyncIterableReader;\nexports.bytesReader = bytesReader;\nexports.chunkReader = chunkReader;\nexports.createDecoder = createDecoder;\nexports.readBlockHead = readBlockHead;\nexports.readHeader = readHeader;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar varint = require('varint');\nvar dagCbor = require('@ipld/dag-cbor');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar varint__default = /*#__PURE__*/_interopDefaultLegacy(varint);\n\nfunction createHeader(roots) {\n const headerBytes = dagCbor.encode({\n version: 1,\n roots\n });\n const varintBytes = varint__default[\"default\"].encode(headerBytes.length);\n const header = new Uint8Array(varintBytes.length + headerBytes.length);\n header.set(varintBytes, 0);\n header.set(headerBytes, varintBytes.length);\n return header;\n}\nfunction createEncoder(writer) {\n return {\n async setRoots(roots) {\n const bytes = createHeader(roots);\n await writer.write(bytes);\n },\n async writeBlock(block) {\n const {cid, bytes} = block;\n await writer.write(new Uint8Array(varint__default[\"default\"].encode(cid.bytes.length + bytes.length)));\n await writer.write(cid.bytes);\n if (bytes.length) {\n await writer.write(bytes);\n }\n },\n async close() {\n return writer.end();\n }\n };\n}\n\nexports.createEncoder = createEncoder;\nexports.createHeader = createHeader;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar fs = require('fs');\nvar stream = require('stream');\nvar cid = require('multiformats/cid');\nvar indexer = require('./indexer.js');\nvar reader = require('./reader.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);\n\nclass CarIndexedReader {\n constructor(version, path, roots, index, order) {\n this._version = version;\n this._path = path;\n this._roots = roots;\n this._index = index;\n this._order = order;\n this._fd = null;\n }\n get version() {\n return this._version;\n }\n async getRoots() {\n return this._roots;\n }\n async has(key) {\n return this._index.has(key.toString());\n }\n async get(key) {\n const blockIndex = this._index.get(key.toString());\n if (!blockIndex) {\n return undefined;\n }\n if (!this._fd) {\n this._fd = await fs__default[\"default\"].promises.open(this._path, 'r');\n }\n const readIndex = {\n cid: key,\n length: 0,\n offset: 0,\n blockLength: blockIndex.blockLength,\n blockOffset: blockIndex.blockOffset\n };\n return reader.CarReader.readRaw(this._fd, readIndex);\n }\n async *blocks() {\n for (const cidStr of this._order) {\n const block = await this.get(cid.CID.parse(cidStr));\n if (!block) {\n throw new Error('Unexpected internal error');\n }\n yield block;\n }\n }\n async *cids() {\n for (const cidStr of this._order) {\n yield cid.CID.parse(cidStr);\n }\n }\n async close() {\n if (this._fd) {\n return this._fd.close();\n }\n }\n static async fromFile(path) {\n if (typeof path !== 'string') {\n throw new TypeError('fromFile() requires a file path string');\n }\n const iterable = await indexer.CarIndexer.fromIterable(stream.Readable.from(fs__default[\"default\"].createReadStream(path)));\n const index = new Map();\n const order = [];\n for await (const {cid, blockLength, blockOffset} of iterable) {\n const cidStr = cid.toString();\n index.set(cidStr, {\n blockLength,\n blockOffset\n });\n order.push(cidStr);\n }\n return new CarIndexedReader(iterable.version, path, await iterable.getRoots(), index, order);\n }\n}\nconst __browser = false;\n\nexports.CarIndexedReader = CarIndexedReader;\nexports.__browser = __browser;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar decoder = require('./decoder.js');\n\nclass CarIndexer {\n constructor(version, roots, iterator) {\n this._version = version;\n this._roots = roots;\n this._iterator = iterator;\n }\n get version() {\n return this._version;\n }\n async getRoots() {\n return this._roots;\n }\n [Symbol.asyncIterator]() {\n return this._iterator;\n }\n static async fromBytes(bytes) {\n if (!(bytes instanceof Uint8Array)) {\n throw new TypeError('fromBytes() requires a Uint8Array');\n }\n return decodeIndexerComplete(decoder.bytesReader(bytes));\n }\n static async fromIterable(asyncIterable) {\n if (!asyncIterable || !(typeof asyncIterable[Symbol.asyncIterator] === 'function')) {\n throw new TypeError('fromIterable() requires an async iterable');\n }\n return decodeIndexerComplete(decoder.asyncIterableReader(asyncIterable));\n }\n}\nasync function decodeIndexerComplete(reader) {\n const decoder$1 = decoder.createDecoder(reader);\n const {version, roots} = await decoder$1.header();\n return new CarIndexer(version, roots, decoder$1.blocksIndex());\n}\n\nexports.CarIndexer = CarIndexer;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction noop() {\n}\nfunction create() {\n const chunkQueue = [];\n let drainer = null;\n let drainerResolver = noop;\n let ended = false;\n let outWait = null;\n let outWaitResolver = noop;\n const makeDrainer = () => {\n if (!drainer) {\n drainer = new Promise(resolve => {\n drainerResolver = () => {\n drainer = null;\n drainerResolver = noop;\n resolve();\n };\n });\n }\n return drainer;\n };\n const writer = {\n write(chunk) {\n chunkQueue.push(chunk);\n const drainer = makeDrainer();\n outWaitResolver();\n return drainer;\n },\n async end() {\n ended = true;\n const drainer = makeDrainer();\n outWaitResolver();\n return drainer;\n }\n };\n const iterator = {\n async next() {\n const chunk = chunkQueue.shift();\n if (chunk) {\n if (chunkQueue.length === 0) {\n drainerResolver();\n }\n return {\n done: false,\n value: chunk\n };\n }\n if (ended) {\n drainerResolver();\n return {\n done: true,\n value: undefined\n };\n }\n if (!outWait) {\n outWait = new Promise(resolve => {\n outWaitResolver = () => {\n outWait = null;\n outWaitResolver = noop;\n return resolve(iterator.next());\n };\n });\n }\n return outWait;\n }\n };\n return {\n writer,\n iterator\n };\n}\n\nexports.create = create;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar decoder = require('./decoder.js');\n\nclass CarIteratorBase {\n constructor(version, roots, iterable) {\n this._version = version;\n this._roots = roots;\n this._iterable = iterable;\n this._decoded = false;\n }\n get version() {\n return this._version;\n }\n async getRoots() {\n return this._roots;\n }\n}\nclass CarBlockIterator extends CarIteratorBase {\n [Symbol.asyncIterator]() {\n if (this._decoded) {\n throw new Error('Cannot decode more than once');\n }\n if (!this._iterable) {\n throw new Error('Block iterable not found');\n }\n this._decoded = true;\n return this._iterable[Symbol.asyncIterator]();\n }\n static async fromBytes(bytes) {\n const {version, roots, iterator} = await fromBytes(bytes);\n return new CarBlockIterator(version, roots, iterator);\n }\n static async fromIterable(asyncIterable) {\n const {version, roots, iterator} = await fromIterable(asyncIterable);\n return new CarBlockIterator(version, roots, iterator);\n }\n}\nclass CarCIDIterator extends CarIteratorBase {\n [Symbol.asyncIterator]() {\n if (this._decoded) {\n throw new Error('Cannot decode more than once');\n }\n if (!this._iterable) {\n throw new Error('Block iterable not found');\n }\n this._decoded = true;\n const iterable = this._iterable[Symbol.asyncIterator]();\n return {\n async next() {\n const next = await iterable.next();\n if (next.done) {\n return next;\n }\n return {\n done: false,\n value: next.value.cid\n };\n }\n };\n }\n static async fromBytes(bytes) {\n const {version, roots, iterator} = await fromBytes(bytes);\n return new CarCIDIterator(version, roots, iterator);\n }\n static async fromIterable(asyncIterable) {\n const {version, roots, iterator} = await fromIterable(asyncIterable);\n return new CarCIDIterator(version, roots, iterator);\n }\n}\nasync function fromBytes(bytes) {\n if (!(bytes instanceof Uint8Array)) {\n throw new TypeError('fromBytes() requires a Uint8Array');\n }\n return decodeIterator(decoder.bytesReader(bytes));\n}\nasync function fromIterable(asyncIterable) {\n if (!asyncIterable || !(typeof asyncIterable[Symbol.asyncIterator] === 'function')) {\n throw new TypeError('fromIterable() requires an async iterable');\n }\n return decodeIterator(decoder.asyncIterableReader(asyncIterable));\n}\nasync function decodeIterator(reader) {\n const decoder$1 = decoder.createDecoder(reader);\n const {version, roots} = await decoder$1.header();\n return {\n version,\n roots,\n iterator: decoder$1.blocks()\n };\n}\n\nexports.CarBlockIterator = CarBlockIterator;\nexports.CarCIDIterator = CarCIDIterator;\nexports.CarIteratorBase = CarIteratorBase;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar decoder = require('./decoder.js');\n\nclass CarReader {\n constructor(version, roots, blocks) {\n this._version = version;\n this._roots = roots;\n this._blocks = blocks;\n this._keys = blocks.map(b => b.cid.toString());\n }\n get version() {\n return this._version;\n }\n async getRoots() {\n return this._roots;\n }\n async has(key) {\n return this._keys.indexOf(key.toString()) > -1;\n }\n async get(key) {\n const index = this._keys.indexOf(key.toString());\n return index > -1 ? this._blocks[index] : undefined;\n }\n async *blocks() {\n for (const block of this._blocks) {\n yield block;\n }\n }\n async *cids() {\n for (const block of this._blocks) {\n yield block.cid;\n }\n }\n static async fromBytes(bytes) {\n if (!(bytes instanceof Uint8Array)) {\n throw new TypeError('fromBytes() requires a Uint8Array');\n }\n return decodeReaderComplete(decoder.bytesReader(bytes));\n }\n static async fromIterable(asyncIterable) {\n if (!asyncIterable || !(typeof asyncIterable[Symbol.asyncIterator] === 'function')) {\n throw new TypeError('fromIterable() requires an async iterable');\n }\n return decodeReaderComplete(decoder.asyncIterableReader(asyncIterable));\n }\n}\nasync function decodeReaderComplete(reader) {\n const decoder$1 = decoder.createDecoder(reader);\n const {version, roots} = await decoder$1.header();\n const blocks = [];\n for await (const block of decoder$1.blocks()) {\n blocks.push(block);\n }\n return new CarReader(version, roots, blocks);\n}\nconst __browser = true;\n\nexports.CarReader = CarReader;\nexports.__browser = __browser;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar fs = require('fs');\nvar util = require('util');\nvar readerBrowser = require('./reader-browser.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);\n\nconst fsread = util.promisify(fs__default[\"default\"].read);\nclass CarReader extends readerBrowser.CarReader {\n static async readRaw(fd, blockIndex) {\n const {cid, blockLength, blockOffset} = blockIndex;\n const bytes = new Uint8Array(blockLength);\n let read;\n if (typeof fd === 'number') {\n read = (await fsread(fd, bytes, 0, blockLength, blockOffset)).bytesRead;\n } else if (typeof fd === 'object' && typeof fd.read === 'function') {\n read = (await fd.read(bytes, 0, blockLength, blockOffset)).bytesRead;\n } else {\n throw new TypeError('Bad fd');\n }\n if (read !== blockLength) {\n throw new Error(`Failed to read entire block (${ read } instead of ${ blockLength })`);\n }\n return {\n cid,\n bytes\n };\n }\n}\nconst __browser = false;\n\nexports.CarReader = CarReader;\nexports.__browser = __browser;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar cid = require('multiformats/cid');\nvar encoder = require('./encoder.js');\nvar iteratorChannel = require('./iterator-channel.js');\nvar decoder = require('./decoder.js');\n\nclass CarWriter {\n constructor(roots, encoder) {\n this._encoder = encoder;\n this._mutex = encoder.setRoots(roots);\n this._ended = false;\n }\n async put(block) {\n if (!(block.bytes instanceof Uint8Array) || !block.cid) {\n throw new TypeError('Can only write {cid, bytes} objects');\n }\n if (this._ended) {\n throw new Error('Already closed');\n }\n const cid$1 = cid.CID.asCID(block.cid);\n if (!cid$1) {\n throw new TypeError('Can only write {cid, bytes} objects');\n }\n this._mutex = this._mutex.then(() => this._encoder.writeBlock({\n cid: cid$1,\n bytes: block.bytes\n }));\n return this._mutex;\n }\n async close() {\n if (this._ended) {\n throw new Error('Already closed');\n }\n await this._mutex;\n this._ended = true;\n return this._encoder.close();\n }\n static create(roots) {\n roots = toRoots(roots);\n const {encoder, iterator} = encodeWriter();\n const writer = new CarWriter(roots, encoder);\n const out = new CarWriterOut(iterator);\n return {\n writer,\n out\n };\n }\n static createAppender() {\n const {encoder, iterator} = encodeWriter();\n encoder.setRoots = () => Promise.resolve();\n const writer = new CarWriter([], encoder);\n const out = new CarWriterOut(iterator);\n return {\n writer,\n out\n };\n }\n static async updateRootsInBytes(bytes, roots) {\n const reader = decoder.bytesReader(bytes);\n await decoder.readHeader(reader);\n const newHeader = encoder.createHeader(roots);\n if (reader.pos !== newHeader.length) {\n throw new Error(`updateRoots() can only overwrite a header of the same length (old header is ${ reader.pos } bytes, new header is ${ newHeader.length } bytes)`);\n }\n bytes.set(newHeader, 0);\n return bytes;\n }\n}\nclass CarWriterOut {\n constructor(iterator) {\n this._iterator = iterator;\n }\n [Symbol.asyncIterator]() {\n if (this._iterating) {\n throw new Error('Multiple iterator not supported');\n }\n this._iterating = true;\n return this._iterator;\n }\n}\nfunction encodeWriter() {\n const iw = iteratorChannel.create();\n const {writer, iterator} = iw;\n const encoder$1 = encoder.createEncoder(writer);\n return {\n encoder: encoder$1,\n iterator\n };\n}\nfunction toRoots(roots) {\n if (roots === undefined) {\n return [];\n }\n if (!Array.isArray(roots)) {\n const cid$1 = cid.CID.asCID(roots);\n if (!cid$1) {\n throw new TypeError('roots must be a single CID or an array of CIDs');\n }\n return [cid$1];\n }\n const _roots = [];\n for (const root of roots) {\n const _root = cid.CID.asCID(root);\n if (!_root) {\n throw new TypeError('roots must be a single CID or an array of CIDs');\n }\n _roots.push(_root);\n }\n return _roots;\n}\nconst __browser = true;\n\nexports.CarWriter = CarWriter;\nexports.CarWriterOut = CarWriterOut;\nexports.__browser = __browser;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar fs = require('fs');\nvar util = require('util');\nvar writerBrowser = require('./writer-browser.js');\nvar decoder = require('./decoder.js');\nvar encoder = require('./encoder.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);\n\nconst fsread = util.promisify(fs__default[\"default\"].read);\nconst fswrite = util.promisify(fs__default[\"default\"].write);\nclass CarWriter extends writerBrowser.CarWriter {\n static async updateRootsInFile(fd, roots) {\n const chunkSize = 256;\n let bytes;\n let offset = 0;\n let readChunk;\n if (typeof fd === 'number') {\n readChunk = async () => (await fsread(fd, bytes, 0, chunkSize, offset)).bytesRead;\n } else if (typeof fd === 'object' && typeof fd.read === 'function') {\n readChunk = async () => (await fd.read(bytes, 0, chunkSize, offset)).bytesRead;\n } else {\n throw new TypeError('Bad fd');\n }\n const fdReader = decoder.chunkReader(async () => {\n bytes = new Uint8Array(chunkSize);\n const read = await readChunk();\n offset += read;\n return read < chunkSize ? bytes.subarray(0, read) : bytes;\n });\n await decoder.readHeader(fdReader);\n const newHeader = encoder.createHeader(roots);\n if (fdReader.pos !== newHeader.length) {\n throw new Error(`updateRoots() can only overwrite a header of the same length (old header is ${ fdReader.pos } bytes, new header is ${ newHeader.length } bytes)`);\n }\n if (typeof fd === 'number') {\n await fswrite(fd, newHeader, 0, newHeader.length, 0);\n } else if (typeof fd === 'object' && typeof fd.read === 'function') {\n await fd.write(newHeader, 0, newHeader.length, 0);\n }\n }\n}\nconst __browser = false;\n\nexports.CarWriter = CarWriter;\nexports.__browser = __browser;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar cborg = require('cborg');\nvar cid = require('multiformats/cid');\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () { return e[k]; }\n });\n }\n });\n }\n n[\"default\"] = e;\n return Object.freeze(n);\n}\n\nvar cborg__namespace = /*#__PURE__*/_interopNamespace(cborg);\n\nconst CID_CBOR_TAG = 42;\nfunction cidEncoder(obj) {\n if (obj.asCID !== obj) {\n return null;\n }\n const cid$1 = cid.CID.asCID(obj);\n if (!cid$1) {\n return null;\n }\n const bytes = new Uint8Array(cid$1.bytes.byteLength + 1);\n bytes.set(cid$1.bytes, 1);\n return [\n new cborg__namespace.Token(cborg__namespace.Type.tag, CID_CBOR_TAG),\n new cborg__namespace.Token(cborg__namespace.Type.bytes, bytes)\n ];\n}\nfunction undefinedEncoder() {\n throw new Error('`undefined` is not supported by the IPLD Data Model and cannot be encoded');\n}\nfunction numberEncoder(num) {\n if (Number.isNaN(num)) {\n throw new Error('`NaN` is not supported by the IPLD Data Model and cannot be encoded');\n }\n if (num === Infinity || num === -Infinity) {\n throw new Error('`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded');\n }\n return null;\n}\nconst encodeOptions = {\n float64: true,\n typeEncoders: {\n Object: cidEncoder,\n undefined: undefinedEncoder,\n number: numberEncoder\n }\n};\nfunction cidDecoder(bytes) {\n if (bytes[0] !== 0) {\n throw new Error('Invalid CID for CBOR tag 42; expected leading 0x00');\n }\n return cid.CID.decode(bytes.subarray(1));\n}\nconst decodeOptions = {\n allowIndefinite: false,\n coerceUndefinedToNull: true,\n allowNaN: false,\n allowInfinity: false,\n allowBigInt: true,\n strict: true,\n useMaps: false,\n tags: []\n};\ndecodeOptions.tags[CID_CBOR_TAG] = cidDecoder;\nconst name = 'dag-cbor';\nconst code = 113;\nconst encode = node => cborg__namespace.encode(node, encodeOptions);\nconst decode = data => cborg__namespace.decode(data, decodeOptions);\n\nexports.code = code;\nexports.decode = decode;\nexports.encode = encode;\nexports.name = name;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar cborg = require('cborg');\nvar cid = require('multiformats/cid');\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () {\n return e[k];\n }\n });\n }\n });\n }\n n['default'] = e;\n return Object.freeze(n);\n}\n\nvar cborg__namespace = /*#__PURE__*/_interopNamespace(cborg);\n\nconst CID_CBOR_TAG = 42;\nfunction cidEncoder(obj) {\n if (obj.asCID !== obj) {\n return null;\n }\n const cid$1 = cid.CID.asCID(obj);\n if (!cid$1) {\n return null;\n }\n const bytes = new Uint8Array(cid$1.bytes.byteLength + 1);\n bytes.set(cid$1.bytes, 1);\n return [\n new cborg__namespace.Token(cborg__namespace.Type.tag, CID_CBOR_TAG),\n new cborg__namespace.Token(cborg__namespace.Type.bytes, bytes)\n ];\n}\nfunction undefinedEncoder() {\n throw new Error('`undefined` is not supported by the IPLD Data Model and cannot be encoded');\n}\nfunction numberEncoder(num) {\n if (Number.isNaN(num)) {\n throw new Error('`NaN` is not supported by the IPLD Data Model and cannot be encoded');\n }\n if (num === Infinity || num === -Infinity) {\n throw new Error('`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded');\n }\n return null;\n}\nconst encodeOptions = {\n float64: true,\n typeEncoders: {\n Object: cidEncoder,\n undefined: undefinedEncoder,\n number: numberEncoder\n }\n};\nfunction cidDecoder(bytes) {\n if (bytes[0] !== 0) {\n throw new Error('Invalid CID for CBOR tag 42; expected leading 0x00');\n }\n return cid.CID.decode(bytes.subarray(1));\n}\nconst decodeOptions = {\n allowIndefinite: false,\n allowUndefined: false,\n allowNaN: false,\n allowInfinity: false,\n allowBigInt: true,\n strict: true,\n useMaps: false,\n tags: []\n};\ndecodeOptions.tags[CID_CBOR_TAG] = cidDecoder;\nconst name = 'dag-cbor';\nconst code = 113;\nconst encode = node => cborg__namespace.encode(node, encodeOptions);\nconst decode = data => cborg__namespace.decode(data, decodeOptions);\n\nexports.code = code;\nexports.decode = decode;\nexports.encode = encode;\nexports.name = name;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar cid = require('multiformats/cid');\nvar pbDecode = require('./pb-decode.js');\nvar pbEncode = require('./pb-encode.js');\nvar util = require('./util.js');\n\nconst name = 'dag-pb';\nconst code = 112;\nfunction encode(node) {\n util.validate(node);\n const pbn = {};\n if (node.Links) {\n pbn.Links = node.Links.map(l => {\n const link = {};\n if (l.Hash) {\n link.Hash = l.Hash.bytes;\n }\n if (l.Name !== undefined) {\n link.Name = l.Name;\n }\n if (l.Tsize !== undefined) {\n link.Tsize = l.Tsize;\n }\n return link;\n });\n }\n if (node.Data) {\n pbn.Data = node.Data;\n }\n return pbEncode.encodeNode(pbn);\n}\nfunction decode(bytes) {\n const pbn = pbDecode.decodeNode(bytes);\n const node = {};\n if (pbn.Data) {\n node.Data = pbn.Data;\n }\n if (pbn.Links) {\n node.Links = pbn.Links.map(l => {\n const link = {};\n try {\n link.Hash = cid.CID.decode(l.Hash);\n } catch (e) {\n }\n if (!link.Hash) {\n throw new Error('Invalid Hash field found in link, expected CID');\n }\n if (l.Name !== undefined) {\n link.Name = l.Name;\n }\n if (l.Tsize !== undefined) {\n link.Tsize = l.Tsize;\n }\n return link;\n });\n }\n return node;\n}\n\nexports.createLink = util.createLink;\nexports.createNode = util.createNode;\nexports.prepare = util.prepare;\nexports.validate = util.validate;\nexports.code = code;\nexports.decode = decode;\nexports.encode = encode;\nexports.name = name;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst textDecoder = new TextDecoder();\nfunction decodeVarint(bytes, offset) {\n let v = 0;\n for (let shift = 0;; shift += 7) {\n if (shift >= 64) {\n throw new Error('protobuf: varint overflow');\n }\n if (offset >= bytes.length) {\n throw new Error('protobuf: unexpected end of data');\n }\n const b = bytes[offset++];\n v += shift < 28 ? (b & 127) << shift : (b & 127) * 2 ** shift;\n if (b < 128) {\n break;\n }\n }\n return [\n v,\n offset\n ];\n}\nfunction decodeBytes(bytes, offset) {\n let byteLen;\n [byteLen, offset] = decodeVarint(bytes, offset);\n const postOffset = offset + byteLen;\n if (byteLen < 0 || postOffset < 0) {\n throw new Error('protobuf: invalid length');\n }\n if (postOffset > bytes.length) {\n throw new Error('protobuf: unexpected end of data');\n }\n return [\n bytes.subarray(offset, postOffset),\n postOffset\n ];\n}\nfunction decodeKey(bytes, index) {\n let wire;\n [wire, index] = decodeVarint(bytes, index);\n return [\n wire & 7,\n wire >> 3,\n index\n ];\n}\nfunction decodeLink(bytes) {\n const link = {};\n const l = bytes.length;\n let index = 0;\n while (index < l) {\n let wireType, fieldNum;\n [wireType, fieldNum, index] = decodeKey(bytes, index);\n if (fieldNum === 1) {\n if (link.Hash) {\n throw new Error('protobuf: (PBLink) duplicate Hash section');\n }\n if (wireType !== 2) {\n throw new Error(`protobuf: (PBLink) wrong wireType (${ wireType }) for Hash`);\n }\n if (link.Name !== undefined) {\n throw new Error('protobuf: (PBLink) invalid order, found Name before Hash');\n }\n if (link.Tsize !== undefined) {\n throw new Error('protobuf: (PBLink) invalid order, found Tsize before Hash');\n }\n ;\n [link.Hash, index] = decodeBytes(bytes, index);\n } else if (fieldNum === 2) {\n if (link.Name !== undefined) {\n throw new Error('protobuf: (PBLink) duplicate Name section');\n }\n if (wireType !== 2) {\n throw new Error(`protobuf: (PBLink) wrong wireType (${ wireType }) for Name`);\n }\n if (link.Tsize !== undefined) {\n throw new Error('protobuf: (PBLink) invalid order, found Tsize before Name');\n }\n let byts;\n [byts, index] = decodeBytes(bytes, index);\n link.Name = textDecoder.decode(byts);\n } else if (fieldNum === 3) {\n if (link.Tsize !== undefined) {\n throw new Error('protobuf: (PBLink) duplicate Tsize section');\n }\n if (wireType !== 0) {\n throw new Error(`protobuf: (PBLink) wrong wireType (${ wireType }) for Tsize`);\n }\n ;\n [link.Tsize, index] = decodeVarint(bytes, index);\n } else {\n throw new Error(`protobuf: (PBLink) invalid fieldNumber, expected 1, 2 or 3, got ${ fieldNum }`);\n }\n }\n if (index > l) {\n throw new Error('protobuf: (PBLink) unexpected end of data');\n }\n return link;\n}\nfunction decodeNode(bytes) {\n const l = bytes.length;\n let index = 0;\n let links;\n let linksBeforeData = false;\n let data;\n while (index < l) {\n let wireType, fieldNum;\n [wireType, fieldNum, index] = decodeKey(bytes, index);\n if (wireType !== 2) {\n throw new Error(`protobuf: (PBNode) invalid wireType, expected 2, got ${ wireType }`);\n }\n if (fieldNum === 1) {\n if (data) {\n throw new Error('protobuf: (PBNode) duplicate Data section');\n }\n ;\n [data, index] = decodeBytes(bytes, index);\n if (links) {\n linksBeforeData = true;\n }\n } else if (fieldNum === 2) {\n if (linksBeforeData) {\n throw new Error('protobuf: (PBNode) duplicate Links section');\n } else if (!links) {\n links = [];\n }\n let byts;\n [byts, index] = decodeBytes(bytes, index);\n links.push(decodeLink(byts));\n } else {\n throw new Error(`protobuf: (PBNode) invalid fieldNumber, expected 1 or 2, got ${ fieldNum }`);\n }\n }\n if (index > l) {\n throw new Error('protobuf: (PBNode) unexpected end of data');\n }\n const node = {};\n if (data) {\n node.Data = data;\n }\n node.Links = links || [];\n return node;\n}\n\nexports.decodeNode = decodeNode;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst textEncoder = new TextEncoder();\nconst maxInt32 = 2 ** 32;\nconst maxUInt32 = 2 ** 31;\nfunction encodeLink(link, bytes) {\n let i = bytes.length;\n if (typeof link.Tsize === 'number') {\n if (link.Tsize < 0) {\n throw new Error('Tsize cannot be negative');\n }\n if (!Number.isSafeInteger(link.Tsize)) {\n throw new Error('Tsize too large for encoding');\n }\n i = encodeVarint(bytes, i, link.Tsize) - 1;\n bytes[i] = 24;\n }\n if (typeof link.Name === 'string') {\n const nameBytes = textEncoder.encode(link.Name);\n i -= nameBytes.length;\n bytes.set(nameBytes, i);\n i = encodeVarint(bytes, i, nameBytes.length) - 1;\n bytes[i] = 18;\n }\n if (link.Hash) {\n i -= link.Hash.length;\n bytes.set(link.Hash, i);\n i = encodeVarint(bytes, i, link.Hash.length) - 1;\n bytes[i] = 10;\n }\n return bytes.length - i;\n}\nfunction encodeNode(node) {\n const size = sizeNode(node);\n const bytes = new Uint8Array(size);\n let i = size;\n if (node.Data) {\n i -= node.Data.length;\n bytes.set(node.Data, i);\n i = encodeVarint(bytes, i, node.Data.length) - 1;\n bytes[i] = 10;\n }\n if (node.Links) {\n for (let index = node.Links.length - 1; index >= 0; index--) {\n const size = encodeLink(node.Links[index], bytes.subarray(0, i));\n i -= size;\n i = encodeVarint(bytes, i, size) - 1;\n bytes[i] = 18;\n }\n }\n return bytes;\n}\nfunction sizeLink(link) {\n let n = 0;\n if (link.Hash) {\n const l = link.Hash.length;\n n += 1 + l + sov(l);\n }\n if (typeof link.Name === 'string') {\n const l = textEncoder.encode(link.Name).length;\n n += 1 + l + sov(l);\n }\n if (typeof link.Tsize === 'number') {\n n += 1 + sov(link.Tsize);\n }\n return n;\n}\nfunction sizeNode(node) {\n let n = 0;\n if (node.Data) {\n const l = node.Data.length;\n n += 1 + l + sov(l);\n }\n if (node.Links) {\n for (const link of node.Links) {\n const l = sizeLink(link);\n n += 1 + l + sov(l);\n }\n }\n return n;\n}\nfunction encodeVarint(bytes, offset, v) {\n offset -= sov(v);\n const base = offset;\n while (v >= maxUInt32) {\n bytes[offset++] = v & 127 | 128;\n v /= 128;\n }\n while (v >= 128) {\n bytes[offset++] = v & 127 | 128;\n v >>>= 7;\n }\n bytes[offset] = v;\n return base;\n}\nfunction sov(x) {\n if (x % 2 === 0) {\n x++;\n }\n return Math.floor((len64(x) + 6) / 7);\n}\nfunction len64(x) {\n let n = 0;\n if (x >= maxInt32) {\n x = Math.floor(x / maxInt32);\n n = 32;\n }\n if (x >= 1 << 16) {\n x >>>= 16;\n n += 16;\n }\n if (x >= 1 << 8) {\n x >>>= 8;\n n += 8;\n }\n return n + len8tab[x];\n}\nconst len8tab = [\n 0,\n 1,\n 2,\n 2,\n 3,\n 3,\n 3,\n 3,\n 4,\n 4,\n 4,\n 4,\n 4,\n 4,\n 4,\n 4,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8\n];\n\nexports.encodeNode = encodeNode;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar cid = require('multiformats/cid');\n\nconst pbNodeProperties = [\n 'Data',\n 'Links'\n];\nconst pbLinkProperties = [\n 'Hash',\n 'Name',\n 'Tsize'\n];\nconst textEncoder = new TextEncoder();\nfunction linkComparator(a, b) {\n if (a === b) {\n return 0;\n }\n const abuf = a.Name ? textEncoder.encode(a.Name) : [];\n const bbuf = b.Name ? textEncoder.encode(b.Name) : [];\n let x = abuf.length;\n let y = bbuf.length;\n for (let i = 0, len = Math.min(x, y); i < len; ++i) {\n if (abuf[i] !== bbuf[i]) {\n x = abuf[i];\n y = bbuf[i];\n break;\n }\n }\n return x < y ? -1 : y < x ? 1 : 0;\n}\nfunction hasOnlyProperties(node, properties) {\n return !Object.keys(node).some(p => !properties.includes(p));\n}\nfunction asLink(link) {\n if (typeof link.asCID === 'object') {\n const Hash = cid.CID.asCID(link);\n if (!Hash) {\n throw new TypeError('Invalid DAG-PB form');\n }\n return { Hash };\n }\n if (typeof link !== 'object' || Array.isArray(link)) {\n throw new TypeError('Invalid DAG-PB form');\n }\n const pbl = {};\n if (link.Hash) {\n let cid$1 = cid.CID.asCID(link.Hash);\n try {\n if (!cid$1) {\n if (typeof link.Hash === 'string') {\n cid$1 = cid.CID.parse(link.Hash);\n } else if (link.Hash instanceof Uint8Array) {\n cid$1 = cid.CID.decode(link.Hash);\n }\n }\n } catch (e) {\n throw new TypeError(`Invalid DAG-PB form: ${ e.message }`);\n }\n if (cid$1) {\n pbl.Hash = cid$1;\n }\n }\n if (!pbl.Hash) {\n throw new TypeError('Invalid DAG-PB form');\n }\n if (typeof link.Name === 'string') {\n pbl.Name = link.Name;\n }\n if (typeof link.Tsize === 'number') {\n pbl.Tsize = link.Tsize;\n }\n return pbl;\n}\nfunction prepare(node) {\n if (node instanceof Uint8Array || typeof node === 'string') {\n node = { Data: node };\n }\n if (typeof node !== 'object' || Array.isArray(node)) {\n throw new TypeError('Invalid DAG-PB form');\n }\n const pbn = {};\n if (node.Data !== undefined) {\n if (typeof node.Data === 'string') {\n pbn.Data = textEncoder.encode(node.Data);\n } else if (node.Data instanceof Uint8Array) {\n pbn.Data = node.Data;\n } else {\n throw new TypeError('Invalid DAG-PB form');\n }\n }\n if (node.Links !== undefined) {\n if (Array.isArray(node.Links)) {\n pbn.Links = node.Links.map(asLink);\n pbn.Links.sort(linkComparator);\n } else {\n throw new TypeError('Invalid DAG-PB form');\n }\n } else {\n pbn.Links = [];\n }\n return pbn;\n}\nfunction validate(node) {\n if (!node || typeof node !== 'object' || Array.isArray(node)) {\n throw new TypeError('Invalid DAG-PB form');\n }\n if (!hasOnlyProperties(node, pbNodeProperties)) {\n throw new TypeError('Invalid DAG-PB form (extraneous properties)');\n }\n if (node.Data !== undefined && !(node.Data instanceof Uint8Array)) {\n throw new TypeError('Invalid DAG-PB form (Data must be a Uint8Array)');\n }\n if (!Array.isArray(node.Links)) {\n throw new TypeError('Invalid DAG-PB form (Links must be an array)');\n }\n for (let i = 0; i < node.Links.length; i++) {\n const link = node.Links[i];\n if (!link || typeof link !== 'object' || Array.isArray(link)) {\n throw new TypeError('Invalid DAG-PB form (bad link object)');\n }\n if (!hasOnlyProperties(link, pbLinkProperties)) {\n throw new TypeError('Invalid DAG-PB form (extraneous properties on link object)');\n }\n if (!link.Hash) {\n throw new TypeError('Invalid DAG-PB form (link must have a Hash)');\n }\n if (link.Hash.asCID !== link.Hash) {\n throw new TypeError('Invalid DAG-PB form (link Hash must be a CID)');\n }\n if (link.Name !== undefined && typeof link.Name !== 'string') {\n throw new TypeError('Invalid DAG-PB form (link Name must be a string)');\n }\n if (link.Tsize !== undefined && (typeof link.Tsize !== 'number' || link.Tsize % 1 !== 0)) {\n throw new TypeError('Invalid DAG-PB form (link Tsize must be an integer)');\n }\n if (i > 0 && linkComparator(link, node.Links[i - 1]) === -1) {\n throw new TypeError('Invalid DAG-PB form (links must be sorted by Name bytes)');\n }\n }\n}\nfunction createNode(data, links = []) {\n return prepare({\n Data: data,\n Links: links\n });\n}\nfunction createLink(name, size, cid) {\n return asLink({\n Hash: cid,\n Name: name,\n Tsize: size\n });\n}\n\nexports.createLink = createLink;\nexports.createNode = createNode;\nexports.prepare = prepare;\nexports.validate = validate;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar hasher = require('multiformats/hashes/hasher');\nvar multiformats = require('multiformats');\nvar mur = require('murmurhash3js-revisited');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar mur__default = /*#__PURE__*/_interopDefaultLegacy(mur);\n\nfunction fromNumberTo32BitBuf(number) {\n const bytes = new Array(4);\n for (let i = 0; i < 4; i++) {\n bytes[i] = number & 255;\n number = number >> 8;\n }\n return new Uint8Array(bytes);\n}\nconst murmur332 = hasher.from({\n name: 'murmur3-32',\n code: 35,\n encode: input => fromNumberTo32BitBuf(mur__default[\"default\"].x86.hash32(input))\n});\nconst murmur3128 = hasher.from({\n name: 'murmur3-128',\n code: 34,\n encode: input => multiformats.bytes.fromHex(mur__default[\"default\"].x64.hash128(input))\n});\n\nexports.murmur3128 = murmur3128;\nexports.murmur332 = murmur332;\n","\"use strict\";\r\nmodule.exports = asPromise;\r\n\r\n/**\r\n * Callback as used by {@link util.asPromise}.\r\n * @typedef asPromiseCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {...*} params Additional arguments\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Returns a promise from a node-style callback function.\r\n * @memberof util\r\n * @param {asPromiseCallback} fn Function to call\r\n * @param {*} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0,\r\n index = 2,\r\n pending = true;\r\n while (index < arguments.length)\r\n params[offset++] = arguments[index++];\r\n return new Promise(function executor(resolve, reject) {\r\n params[offset] = function callback(err/*, varargs */) {\r\n if (pending) {\r\n pending = false;\r\n if (err)\r\n reject(err);\r\n else {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0;\r\n while (offset < params.length)\r\n params[offset++] = arguments[offset];\r\n resolve.apply(null, params);\r\n }\r\n }\r\n };\r\n try {\r\n fn.apply(ctx || null, params);\r\n } catch (err) {\r\n if (pending) {\r\n pending = false;\r\n reject(err);\r\n }\r\n }\r\n });\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} string Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(string) {\r\n var p = string.length;\r\n if (!p)\r\n return 0;\r\n var n = 0;\r\n while (--p % 4 > 1 && string.charAt(p) === \"=\")\r\n ++n;\r\n return Math.ceil(string.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = new Array(64);\r\n\r\n// Base64 decoding table\r\nvar s64 = new Array(123);\r\n\r\n// 65..90, 97..122, 48..57, 43, 47\r\nfor (var i = 0; i < 64;)\r\n s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n var parts = null,\r\n chunk = [];\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n chunk[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n chunk[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n chunk[i++] = b64[t | b >> 6];\r\n chunk[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (j) {\r\n chunk[i++] = b64[t];\r\n chunk[i++] = 61;\r\n if (j === 1)\r\n chunk[i++] = 61;\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(string, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < string.length;) {\r\n var c = string.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n\r\n/**\r\n * Tests if the specified string appears to be base64 encoded.\r\n * @param {string} string String to test\r\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\r\n */\r\nbase64.test = function test(string) {\r\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r\n};\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {*} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener or any matching listeners if arguments are omitted.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = [],\r\n i = 1;\r\n for (; i < arguments.length;)\r\n args.push(arguments[i++]);\r\n for (i = 0; i < listeners.length;)\r\n listeners[i].fn.apply(listeners[i++].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = factory(factory);\r\n\r\n/**\r\n * Reads / writes floats / doubles from / to buffers.\r\n * @name util.float\r\n * @namespace\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using little endian byte order.\r\n * @name util.float.writeFloatLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using big endian byte order.\r\n * @name util.float.writeFloatBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using little endian byte order.\r\n * @name util.float.readFloatLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using big endian byte order.\r\n * @name util.float.readFloatBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using little endian byte order.\r\n * @name util.float.writeDoubleLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using big endian byte order.\r\n * @name util.float.writeDoubleBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using little endian byte order.\r\n * @name util.float.readDoubleLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using big endian byte order.\r\n * @name util.float.readDoubleBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n// Factory function for the purpose of node-based testing in modified global environments\r\nfunction factory(exports) {\r\n\r\n // float: typed array\r\n if (typeof Float32Array !== \"undefined\") (function() {\r\n\r\n var f32 = new Float32Array([ -0 ]),\r\n f8b = new Uint8Array(f32.buffer),\r\n le = f8b[3] === 128;\r\n\r\n function writeFloat_f32_cpy(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n }\r\n\r\n function writeFloat_f32_rev(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[3];\r\n buf[pos + 1] = f8b[2];\r\n buf[pos + 2] = f8b[1];\r\n buf[pos + 3] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r\n\r\n function readFloat_f32_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n function readFloat_f32_rev(buf, pos) {\r\n f8b[3] = buf[pos ];\r\n f8b[2] = buf[pos + 1];\r\n f8b[1] = buf[pos + 2];\r\n f8b[0] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r\n\r\n // float: ieee754\r\n })(); else (function() {\r\n\r\n function writeFloat_ieee754(writeUint, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0)\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r\n else if (isNaN(val))\r\n writeUint(2143289344, buf, pos);\r\n else if (val > 3.4028234663852886e+38) // +-Infinity\r\n writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r\n else if (val < 1.1754943508222875e-38) // denormal\r\n writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r\n else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2),\r\n mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r\n writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r\n }\r\n }\r\n\r\n exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r\n exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r\n\r\n function readFloat_ieee754(readUint, buf, pos) {\r\n var uint = readUint(buf, pos),\r\n sign = (uint >> 31) * 2 + 1,\r\n exponent = uint >>> 23 & 255,\r\n mantissa = uint & 8388607;\r\n return exponent === 255\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 1.401298464324817e-45 * mantissa\r\n : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r\n }\r\n\r\n exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r\n exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r\n\r\n })();\r\n\r\n // double: typed array\r\n if (typeof Float64Array !== \"undefined\") (function() {\r\n\r\n var f64 = new Float64Array([-0]),\r\n f8b = new Uint8Array(f64.buffer),\r\n le = f8b[7] === 128;\r\n\r\n function writeDouble_f64_cpy(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n buf[pos + 4] = f8b[4];\r\n buf[pos + 5] = f8b[5];\r\n buf[pos + 6] = f8b[6];\r\n buf[pos + 7] = f8b[7];\r\n }\r\n\r\n function writeDouble_f64_rev(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[7];\r\n buf[pos + 1] = f8b[6];\r\n buf[pos + 2] = f8b[5];\r\n buf[pos + 3] = f8b[4];\r\n buf[pos + 4] = f8b[3];\r\n buf[pos + 5] = f8b[2];\r\n buf[pos + 6] = f8b[1];\r\n buf[pos + 7] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r\n\r\n function readDouble_f64_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n f8b[4] = buf[pos + 4];\r\n f8b[5] = buf[pos + 5];\r\n f8b[6] = buf[pos + 6];\r\n f8b[7] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n function readDouble_f64_rev(buf, pos) {\r\n f8b[7] = buf[pos ];\r\n f8b[6] = buf[pos + 1];\r\n f8b[5] = buf[pos + 2];\r\n f8b[4] = buf[pos + 3];\r\n f8b[3] = buf[pos + 4];\r\n f8b[2] = buf[pos + 5];\r\n f8b[1] = buf[pos + 6];\r\n f8b[0] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r\n\r\n // double: ieee754\r\n })(); else (function() {\r\n\r\n function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r\n } else if (isNaN(val)) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(2146959360, buf, pos + off1);\r\n } else if (val > 1.7976931348623157e+308) { // +-Infinity\r\n writeUint(0, buf, pos + off0);\r\n writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r\n } else {\r\n var mantissa;\r\n if (val < 2.2250738585072014e-308) { // denormal\r\n mantissa = val / 5e-324;\r\n writeUint(mantissa >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r\n } else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2);\r\n if (exponent === 1024)\r\n exponent = 1023;\r\n mantissa = val * Math.pow(2, -exponent);\r\n writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r\n }\r\n }\r\n }\r\n\r\n exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r\n exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r\n\r\n function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r\n var lo = readUint(buf, pos + off0),\r\n hi = readUint(buf, pos + off1);\r\n var sign = (hi >> 31) * 2 + 1,\r\n exponent = hi >>> 20 & 2047,\r\n mantissa = 4294967296 * (hi & 1048575) + lo;\r\n return exponent === 2047\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 5e-324 * mantissa\r\n : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r\n }\r\n\r\n exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r\n exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r\n\r\n })();\r\n\r\n return exports;\r\n}\r\n\r\n// uint helpers\r\n\r\nfunction writeUintLE(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\nfunction writeUintBE(val, buf, pos) {\r\n buf[pos ] = val >>> 24;\r\n buf[pos + 1] = val >>> 16 & 255;\r\n buf[pos + 2] = val >>> 8 & 255;\r\n buf[pos + 3] = val & 255;\r\n}\r\n\r\nfunction readUintLE(buf, pos) {\r\n return (buf[pos ]\r\n | buf[pos + 1] << 8\r\n | buf[pos + 2] << 16\r\n | buf[pos + 3] << 24) >>> 0;\r\n}\r\n\r\nfunction readUintBE(buf, pos) {\r\n return (buf[pos ] << 24\r\n | buf[pos + 1] << 16\r\n | buf[pos + 2] << 8\r\n | buf[pos + 3]) >>> 0;\r\n}\r\n","\"use strict\";\r\nmodule.exports = inquire;\r\n\r\n/**\r\n * Requires a module only if available.\r\n * @memberof util\r\n * @param {string} moduleName Module to require\r\n * @returns {?Object} Required module if available and not empty, otherwise `null`\r\n */\r\nfunction inquire(moduleName) {\r\n try {\r\n var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval\r\n if (mod && (mod.length || Object.keys(mod).length))\r\n return mod;\r\n } catch (e) {} // eslint-disable-line no-empty\r\n return null;\r\n}\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size < 1 || size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < string.length; ++i) {\r\n c = string.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null,\r\n chunk = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128)\r\n chunk[i++] = t;\r\n else if (t > 191 && t < 224)\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n var start = offset,\r\n c1, // character 1\r\n c2; // character 2\r\n for (var i = 0; i < string.length; ++i) {\r\n c1 = string.charCodeAt(i);\r\n if (c1 < 128) {\r\n buffer[offset++] = c1;\r\n } else if (c1 < 2048) {\r\n buffer[offset++] = c1 >> 6 | 192;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buffer[offset++] = c1 >> 18 | 240;\r\n buffer[offset++] = c1 >> 12 & 63 | 128;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else {\r\n buffer[offset++] = c1 >> 12 | 224;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n }\r\n }\r\n return offset - start;\r\n};\r\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar search = require('./search.js');\nvar utils = require('./utils.js');\n\nconst mergeArrays2 = Function.prototype.apply.bind(utils.mergeArrays, undefined);\nconst dash = utils.stringToArray('--');\nconst CRLF = utils.stringToArray('\\r\\n');\nfunction parseContentDisposition(header) {\n const parts = header.split(';').map(part => part.trim());\n if (parts.shift() !== 'form-data') {\n throw new Error('malformed content-disposition header: missing \"form-data\" in `' + JSON.stringify(parts) + '`');\n }\n const out = {};\n for (const part of parts) {\n const kv = part.split('=', 2);\n if (kv.length !== 2) {\n throw new Error('malformed content-disposition header: key-value pair not found - ' + part + ' in `' + header + '`');\n }\n const [name, value] = kv;\n if (value[0] === '\"' && value[value.length - 1] === '\"') {\n out[name] = value.slice(1, -1).replace(/\\\\\"/g, '\"');\n } else if (value[0] !== '\"' && value[value.length - 1] !== '\"') {\n out[name] = value;\n } else if (value[0] === '\"' && value[value.length - 1] !== '\"' || value[0] !== '\"' && value[value.length - 1] === '\"') {\n throw new Error('malformed content-disposition header: mismatched quotations in `' + header + '`');\n }\n }\n if (!out.name) {\n throw new Error('malformed content-disposition header: missing field name in `' + header + '`');\n }\n return out;\n}\nfunction parsePartHeaders(lines) {\n const entries = [];\n let disposition = false;\n let line;\n while (typeof (line = lines.shift()) !== 'undefined') {\n const colon = line.indexOf(':');\n if (colon === -1) {\n throw new Error('malformed multipart-form header: missing colon');\n }\n const header = line.slice(0, colon).trim().toLowerCase();\n const value = line.slice(colon + 1).trim();\n switch (header) {\n case 'content-disposition':\n disposition = true;\n entries.push(...Object.entries(parseContentDisposition(value)));\n break;\n case 'content-type':\n entries.push([\n 'contentType',\n value\n ]);\n }\n }\n if (!disposition) {\n throw new Error('malformed multipart-form header: missing content-disposition');\n }\n return Object.fromEntries(entries);\n}\nasync function readHeaderLines(it, needle) {\n let firstChunk = true;\n let lastTokenWasMatch = false;\n const headerLines = [[]];\n const crlfSearch = new search.StreamSearch(CRLF);\n for (;;) {\n const result = await it.next();\n if (result.done) {\n throw new Error('malformed multipart-form data: unexpected end of stream');\n }\n if (firstChunk && result.value !== search.MATCH && utils.arraysEqual(result.value.slice(0, 2), dash)) {\n return [\n undefined,\n new Uint8Array()\n ];\n }\n let chunk;\n if (result.value !== search.MATCH) {\n chunk = result.value;\n } else if (!lastTokenWasMatch) {\n chunk = needle;\n } else {\n throw new Error('malformed multipart-form data: unexpected boundary');\n }\n if (!chunk.length) {\n continue;\n }\n if (firstChunk) {\n firstChunk = false;\n }\n const tokens = crlfSearch.feed(chunk);\n for (const [i, token] of tokens.entries()) {\n const isMatch = token === search.MATCH;\n if (!isMatch && !token.length) {\n continue;\n }\n if (lastTokenWasMatch && isMatch) {\n tokens.push(crlfSearch.end());\n return [\n headerLines.filter(chunks => chunks.length).map(mergeArrays2).map(utils.arrayToString),\n utils.mergeArrays(...tokens.slice(i + 1).map(token => token === search.MATCH ? CRLF : token))\n ];\n }\n if (lastTokenWasMatch = isMatch) {\n headerLines.push([]);\n } else {\n headerLines[headerLines.length - 1].push(token);\n }\n }\n }\n}\nasync function* streamMultipart(body, boundary) {\n const needle = utils.mergeArrays(dash, utils.stringToArray(boundary));\n const it = new search.ReadableStreamSearch(needle, body)[Symbol.asyncIterator]();\n for (;;) {\n const result = await it.next();\n if (result.done) {\n return;\n }\n if (result.value === search.MATCH) {\n break;\n }\n }\n const crlfSearch = new search.StreamSearch(CRLF);\n for (;;) {\n const [headerLines, tail] = await readHeaderLines(it, needle);\n if (!headerLines) {\n return;\n }\n async function nextToken() {\n const result = await it.next();\n if (result.done) {\n throw new Error('malformed multipart-form data: unexpected end of stream');\n }\n return result;\n }\n let trailingCRLF = false;\n function feedChunk(chunk) {\n const chunks = [];\n for (const token of crlfSearch.feed(chunk)) {\n if (trailingCRLF) {\n chunks.push(CRLF);\n }\n if (!(trailingCRLF = token === search.MATCH)) {\n chunks.push(token);\n }\n }\n return utils.mergeArrays(...chunks);\n }\n let done = false;\n async function nextChunk() {\n const result = await nextToken();\n let chunk;\n if (result.value !== search.MATCH) {\n chunk = result.value;\n } else if (!trailingCRLF) {\n chunk = CRLF;\n } else {\n done = true;\n return { value: crlfSearch.end() };\n }\n return { value: feedChunk(chunk) };\n }\n const bufferedChunks = [{ value: feedChunk(tail) }];\n yield {\n ...parsePartHeaders(headerLines),\n data: {\n [Symbol.asyncIterator]() {\n return this;\n },\n async next() {\n for (;;) {\n const result = bufferedChunks.shift();\n if (!result) {\n break;\n }\n if (result.value.length > 0) {\n return result;\n }\n }\n for (;;) {\n if (done) {\n return {\n done,\n value: undefined\n };\n }\n const result = await nextChunk();\n if (result.value.length > 0) {\n return result;\n }\n }\n }\n }\n };\n while (!done) {\n bufferedChunks.push(await nextChunk());\n }\n }\n}\nasync function* iterateMultipart(body, boundary) {\n for await (const part of streamMultipart(body, boundary)) {\n const chunks = [];\n for await (const chunk of part.data) {\n chunks.push(chunk);\n }\n yield {\n ...part,\n data: utils.mergeArrays(...chunks)\n };\n }\n}\n\nexports.iterateMultipart = iterateMultipart;\nexports.streamMultipart = streamMultipart;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar utils = require('./utils.js');\n\nfunction coerce(a) {\n if (a instanceof Uint8Array) {\n return index => a[index];\n }\n return a;\n}\nfunction jsmemcmp(buf1, pos1, buf2, pos2, len) {\n const fn1 = coerce(buf1);\n const fn2 = coerce(buf2);\n for (let i = 0; i < len; ++i) {\n if (fn1(pos1 + i) !== fn2(pos2 + i)) {\n return false;\n }\n }\n return true;\n}\nfunction createOccurenceTable(s) {\n const table = new Array(256).fill(s.length);\n if (s.length > 1) {\n for (let i = 0; i < s.length - 1; i++) {\n table[s[i]] = s.length - 1 - i;\n }\n }\n return table;\n}\nconst MATCH = Symbol('Match');\nclass StreamSearch {\n constructor(needle) {\n this._lookbehind = new Uint8Array();\n if (typeof needle === 'string') {\n this._needle = needle = utils.stringToArray(needle);\n } else {\n this._needle = needle;\n }\n this._lastChar = needle[needle.length - 1];\n this._occ = createOccurenceTable(needle);\n }\n feed(chunk) {\n let pos = 0;\n let tokens;\n const allTokens = [];\n while (pos !== chunk.length) {\n ;\n [pos, ...tokens] = this._feed(chunk, pos);\n allTokens.push(...tokens);\n }\n return allTokens;\n }\n end() {\n const tail = this._lookbehind;\n this._lookbehind = new Uint8Array();\n return tail;\n }\n _feed(data, bufPos) {\n const tokens = [];\n let pos = -this._lookbehind.length;\n if (pos < 0) {\n while (pos < 0 && pos <= data.length - this._needle.length) {\n const ch = this._charAt(data, pos + this._needle.length - 1);\n if (ch === this._lastChar && this._memcmp(data, pos, this._needle.length - 1)) {\n if (pos > -this._lookbehind.length) {\n tokens.push(this._lookbehind.slice(0, this._lookbehind.length + pos));\n }\n tokens.push(MATCH);\n this._lookbehind = new Uint8Array();\n return [\n pos + this._needle.length,\n ...tokens\n ];\n } else {\n pos += this._occ[ch];\n }\n }\n if (pos < 0) {\n while (pos < 0 && !this._memcmp(data, pos, data.length - pos)) {\n pos++;\n }\n }\n if (pos >= 0) {\n tokens.push(this._lookbehind);\n this._lookbehind = new Uint8Array();\n } else {\n const bytesToCutOff = this._lookbehind.length + pos;\n if (bytesToCutOff > 0) {\n tokens.push(this._lookbehind.slice(0, bytesToCutOff));\n this._lookbehind = this._lookbehind.slice(bytesToCutOff);\n }\n this._lookbehind = Uint8Array.from(new Array(this._lookbehind.length + data.length), (_, i) => this._charAt(data, i - this._lookbehind.length));\n return [\n data.length,\n ...tokens\n ];\n }\n }\n pos += bufPos;\n while (pos <= data.length - this._needle.length) {\n const ch = data[pos + this._needle.length - 1];\n if (ch === this._lastChar && data[pos] === this._needle[0] && jsmemcmp(this._needle, 0, data, pos, this._needle.length - 1)) {\n if (pos > bufPos) {\n tokens.push(data.slice(bufPos, pos));\n }\n tokens.push(MATCH);\n return [\n pos + this._needle.length,\n ...tokens\n ];\n } else {\n pos += this._occ[ch];\n }\n }\n if (pos < data.length) {\n while (pos < data.length && (data[pos] !== this._needle[0] || !jsmemcmp(data, pos, this._needle, 0, data.length - pos))) {\n ++pos;\n }\n if (pos < data.length) {\n this._lookbehind = data.slice(pos);\n }\n }\n if (pos > 0) {\n tokens.push(data.slice(bufPos, pos < data.length ? pos : data.length));\n }\n return [\n data.length,\n ...tokens\n ];\n }\n _charAt(data, pos) {\n if (pos < 0) {\n return this._lookbehind[this._lookbehind.length + pos];\n }\n return data[pos];\n }\n _memcmp(data, pos, len) {\n return jsmemcmp(this._charAt.bind(this, data), pos, this._needle, 0, len);\n }\n}\nclass ReadableStreamSearch {\n constructor(needle, _readableStream) {\n this._readableStream = _readableStream;\n this._search = new StreamSearch(needle);\n }\n async *[Symbol.asyncIterator]() {\n const reader = this._readableStream.getReader();\n try {\n while (true) {\n const result = await reader.read();\n if (result.done) {\n break;\n }\n yield* this._search.feed(result.value);\n }\n const tail = this._search.end();\n if (tail.length) {\n yield tail;\n }\n } finally {\n reader.releaseLock();\n }\n }\n}\nconst EOQ = Symbol('End of Queue');\nclass QueueableStreamSearch {\n constructor(needle) {\n this._chunksQueue = [];\n this._closed = false;\n this._search = new StreamSearch(needle);\n }\n push(...chunks) {\n if (this._closed) {\n throw new Error('cannot call push after close');\n }\n this._chunksQueue.push(...chunks);\n if (this._notify) {\n this._notify();\n }\n }\n close() {\n if (this._closed) {\n throw new Error('close was already called');\n }\n this._closed = true;\n this._chunksQueue.push(EOQ);\n if (this._notify) {\n this._notify();\n }\n }\n async *[Symbol.asyncIterator]() {\n while (true) {\n let chunk;\n while (!(chunk = this._chunksQueue.shift())) {\n await new Promise(resolve => this._notify = resolve);\n this._notify = undefined;\n }\n if (chunk === EOQ) {\n break;\n }\n yield* this._search.feed(chunk);\n }\n const tail = this._search.end();\n if (tail.length) {\n yield tail;\n }\n }\n}\nfunction splitChunks(chunks, needle) {\n const search = new StreamSearch(needle);\n const outchunks = [[]];\n for (const chunk of chunks) {\n for (const token of search.feed(chunk)) {\n if (token === MATCH) {\n outchunks.push([]);\n } else {\n outchunks[outchunks.length - 1].push(token);\n }\n }\n }\n const end = search.end();\n outchunks[outchunks.length - 1].push(end);\n return outchunks.map(chunks => utils.mergeArrays(...chunks));\n}\nfunction split(buf, needle) {\n return splitChunks([buf], needle);\n}\nasync function* chunksIterator(iter) {\n let chunks = [];\n for await (const value of iter) {\n if (value === MATCH) {\n yield chunks;\n chunks = [];\n } else {\n chunks.push(value);\n }\n }\n yield chunks;\n}\nasync function* stringIterator(iter) {\n for await (const chunk of chunksIterator(iter)) {\n yield chunk.map(utils.arrayToString).join('');\n }\n}\nasync function allStrings(iter) {\n const segments = [];\n for await (const value of stringIterator(iter)) {\n segments.push(value);\n }\n return segments;\n}\nasync function* arrayIterator(iter) {\n for await (const chunk of chunksIterator(iter)) {\n yield utils.mergeArrays(...chunk);\n }\n}\n\nexports.MATCH = MATCH;\nexports.QueueableStreamSearch = QueueableStreamSearch;\nexports.ReadableStreamSearch = ReadableStreamSearch;\nexports.StreamSearch = StreamSearch;\nexports.allStrings = allStrings;\nexports.arrayIterator = arrayIterator;\nexports.chunksIterator = chunksIterator;\nexports.split = split;\nexports.splitChunks = splitChunks;\nexports.stringIterator = stringIterator;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction stringToArray(s) {\n const utf8 = unescape(encodeURIComponent(s));\n return Uint8Array.from(utf8, (_, i) => utf8.charCodeAt(i));\n}\nfunction arrayToString(a) {\n const utf8 = String.fromCharCode.apply(null, a);\n return decodeURIComponent(escape(utf8));\n}\nfunction mergeArrays(...arrays) {\n const out = new Uint8Array(arrays.reduce((total, arr) => total + arr.length, 0));\n let offset = 0;\n for (const arr of arrays) {\n out.set(arr, offset);\n offset += arr.length;\n }\n return out;\n}\nfunction arraysEqual(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\n\nexports.arrayToString = arrayToString;\nexports.arraysEqual = arraysEqual;\nexports.mergeArrays = mergeArrays;\nexports.stringToArray = stringToArray;\n","'use strict';\nmodule.exports = balanced;\nfunction balanced(a, b, str) {\n if (a instanceof RegExp) a = maybeMatch(a, str);\n if (b instanceof RegExp) b = maybeMatch(b, str);\n\n var r = range(a, b, str);\n\n return r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + a.length, r[1]),\n post: str.slice(r[1] + b.length)\n };\n}\n\nfunction maybeMatch(reg, str) {\n var m = str.match(reg);\n return m ? m[0] : null;\n}\n\nbalanced.range = range;\nfunction range(a, b, str) {\n var begs, beg, left, right, result;\n var ai = str.indexOf(a);\n var bi = str.indexOf(b, ai + 1);\n var i = ai;\n\n if (ai >= 0 && bi > 0) {\n if(a===b) {\n return [ai, bi];\n }\n begs = [];\n left = str.length;\n\n while (i >= 0 && !result) {\n if (i == ai) {\n begs.push(i);\n ai = str.indexOf(a, i + 1);\n } else if (begs.length == 1) {\n result = [ begs.pop(), bi ];\n } else {\n beg = begs.pop();\n if (beg < left) {\n left = beg;\n right = bi;\n }\n\n bi = str.indexOf(b, i + 1);\n }\n\n i = ai < bi && ai >= 0 ? ai : bi;\n }\n\n if (begs.length) {\n result = [ left, right ];\n }\n }\n\n return result;\n}\n","/* eslint-env browser */\n\n'use strict'\n\nconst browserReadableStreamToIt = require('browser-readablestream-to-it')\n\n/**\n * @param {Blob} blob\n * @returns {AsyncIterable}\n */\nfunction blobToIt (blob) {\n if (typeof blob.stream === 'function') {\n // @ts-ignore missing some properties\n return browserReadableStreamToIt(blob.stream())\n }\n\n // firefox < 69 does not support blob.stream()\n // @ts-ignore - response.body is optional, but in practice it's a stream.\n return browserReadableStreamToIt(new Response(blob).body)\n}\n\nmodule.exports = blobToIt\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar drain = require('it-drain');\nvar filter = require('it-filter');\nvar take = require('it-take');\nvar all = require('it-all');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar drain__default = /*#__PURE__*/_interopDefaultLegacy(drain);\nvar filter__default = /*#__PURE__*/_interopDefaultLegacy(filter);\nvar take__default = /*#__PURE__*/_interopDefaultLegacy(take);\nvar all__default = /*#__PURE__*/_interopDefaultLegacy(all);\n\nconst sortAll = (iterable, sorter) => {\n return async function* () {\n const values = await all__default[\"default\"](iterable);\n yield* values.sort(sorter);\n }();\n};\nclass BaseBlockstore {\n open() {\n return Promise.reject(new Error('.open is not implemented'));\n }\n close() {\n return Promise.reject(new Error('.close is not implemented'));\n }\n put(key, val, options) {\n return Promise.reject(new Error('.put is not implemented'));\n }\n get(key, options) {\n return Promise.reject(new Error('.get is not implemented'));\n }\n has(key, options) {\n return Promise.reject(new Error('.has is not implemented'));\n }\n delete(key, options) {\n return Promise.reject(new Error('.delete is not implemented'));\n }\n async *putMany(source, options = {}) {\n for await (const {key, value} of source) {\n await this.put(key, value, options);\n yield {\n key,\n value\n };\n }\n }\n async *getMany(source, options = {}) {\n for await (const key of source) {\n yield this.get(key, options);\n }\n }\n async *deleteMany(source, options = {}) {\n for await (const key of source) {\n await this.delete(key, options);\n yield key;\n }\n }\n batch() {\n let puts = [];\n let dels = [];\n return {\n put(key, value) {\n puts.push({\n key,\n value\n });\n },\n delete(key) {\n dels.push(key);\n },\n commit: async options => {\n await drain__default[\"default\"](this.putMany(puts, options));\n puts = [];\n await drain__default[\"default\"](this.deleteMany(dels, options));\n dels = [];\n }\n };\n }\n async *_all(q, options) {\n throw new Error('._all is not implemented');\n }\n async *_allKeys(q, options) {\n throw new Error('._allKeys is not implemented');\n }\n query(q, options) {\n let it = this._all(q, options);\n if (q.prefix != null) {\n it = filter__default[\"default\"](it, e => e.key.toString().startsWith(q.prefix || ''));\n }\n if (Array.isArray(q.filters)) {\n it = q.filters.reduce((it, f) => filter__default[\"default\"](it, f), it);\n }\n if (Array.isArray(q.orders)) {\n it = q.orders.reduce((it, f) => sortAll(it, f), it);\n }\n if (q.offset != null) {\n let i = 0;\n it = filter__default[\"default\"](it, () => i++ >= (q.offset || 0));\n }\n if (q.limit != null) {\n it = take__default[\"default\"](it, q.limit);\n }\n return it;\n }\n queryKeys(q, options) {\n let it = this._allKeys(q, options);\n if (q.prefix != null) {\n it = filter__default[\"default\"](it, cid => cid.toString().startsWith(q.prefix || ''));\n }\n if (Array.isArray(q.filters)) {\n it = q.filters.reduce((it, f) => filter__default[\"default\"](it, f), it);\n }\n if (Array.isArray(q.orders)) {\n it = q.orders.reduce((it, f) => sortAll(it, f), it);\n }\n if (q.offset != null) {\n let i = 0;\n it = filter__default[\"default\"](it, () => i++ >= q.offset);\n }\n if (q.limit != null) {\n it = take__default[\"default\"](it, q.limit);\n }\n return it;\n }\n}\n\nexports.BaseBlockstore = BaseBlockstore;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar errCode = require('err-code');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\n\nfunction notFoundError(err) {\n err = err || new Error('Not Found');\n return errCode__default[\"default\"](err, 'ERR_NOT_FOUND');\n}\nfunction abortedError(err) {\n err = err || new Error('Aborted');\n return errCode__default[\"default\"](err, 'ERR_ABORTED');\n}\n\nexports.abortedError = abortedError;\nexports.notFoundError = notFoundError;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar errors = require('./errors.js');\nvar base = require('./base.js');\nvar memory = require('./memory.js');\n\nconst Errors = { ...errors };\n\nexports.BaseBlockstore = base.BaseBlockstore;\nexports.MemoryBlockstore = memory.MemoryBlockstore;\nexports.Errors = Errors;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar base = require('./base.js');\nvar base32 = require('multiformats/bases/base32');\nvar raw = require('multiformats/codecs/raw');\nvar cid = require('multiformats/cid');\nvar Digest = require('multiformats/hashes/digest');\nvar errors = require('./errors.js');\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () { return e[k]; }\n });\n }\n });\n }\n n[\"default\"] = e;\n return Object.freeze(n);\n}\n\nvar raw__namespace = /*#__PURE__*/_interopNamespace(raw);\nvar Digest__namespace = /*#__PURE__*/_interopNamespace(Digest);\n\nclass MemoryBlockstore extends base.BaseBlockstore {\n constructor() {\n super();\n this.data = {};\n }\n open() {\n return Promise.resolve();\n }\n close() {\n return Promise.resolve();\n }\n async put(key, val) {\n this.data[base32.base32.encode(key.multihash.bytes)] = val;\n }\n async get(key) {\n const exists = await this.has(key);\n if (!exists)\n throw errors.notFoundError();\n return this.data[base32.base32.encode(key.multihash.bytes)];\n }\n async has(key) {\n return this.data[base32.base32.encode(key.multihash.bytes)] !== undefined;\n }\n async delete(key) {\n delete this.data[base32.base32.encode(key.multihash.bytes)];\n }\n async *_all() {\n yield* Object.entries(this.data).map(([key, value]) => ({\n key: cid.CID.createV1(raw__namespace.code, Digest__namespace.decode(base32.base32.decode(key))),\n value\n }));\n }\n async *_allKeys() {\n yield* Object.entries(this.data).map(([key]) => cid.CID.createV1(raw__namespace.code, Digest__namespace.decode(base32.base32.decode(key))));\n }\n}\n\nexports.MemoryBlockstore = MemoryBlockstore;\n","var concatMap = require('concat-map');\nvar balanced = require('balanced-match');\n\nmodule.exports = expandTop;\n\nvar escSlash = '\\0SLASH'+Math.random()+'\\0';\nvar escOpen = '\\0OPEN'+Math.random()+'\\0';\nvar escClose = '\\0CLOSE'+Math.random()+'\\0';\nvar escComma = '\\0COMMA'+Math.random()+'\\0';\nvar escPeriod = '\\0PERIOD'+Math.random()+'\\0';\n\nfunction numeric(str) {\n return parseInt(str, 10) == str\n ? parseInt(str, 10)\n : str.charCodeAt(0);\n}\n\nfunction escapeBraces(str) {\n return str.split('\\\\\\\\').join(escSlash)\n .split('\\\\{').join(escOpen)\n .split('\\\\}').join(escClose)\n .split('\\\\,').join(escComma)\n .split('\\\\.').join(escPeriod);\n}\n\nfunction unescapeBraces(str) {\n return str.split(escSlash).join('\\\\')\n .split(escOpen).join('{')\n .split(escClose).join('}')\n .split(escComma).join(',')\n .split(escPeriod).join('.');\n}\n\n\n// Basically just str.split(\",\"), but handling cases\n// where we have nested braced sections, which should be\n// treated as individual members, like {a,{b,c},d}\nfunction parseCommaParts(str) {\n if (!str)\n return [''];\n\n var parts = [];\n var m = balanced('{', '}', str);\n\n if (!m)\n return str.split(',');\n\n var pre = m.pre;\n var body = m.body;\n var post = m.post;\n var p = pre.split(',');\n\n p[p.length-1] += '{' + body + '}';\n var postParts = parseCommaParts(post);\n if (post.length) {\n p[p.length-1] += postParts.shift();\n p.push.apply(p, postParts);\n }\n\n parts.push.apply(parts, p);\n\n return parts;\n}\n\nfunction expandTop(str) {\n if (!str)\n return [];\n\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.substr(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.substr(2);\n }\n\n return expand(escapeBraces(str), true).map(unescapeBraces);\n}\n\nfunction identity(e) {\n return e;\n}\n\nfunction embrace(str) {\n return '{' + str + '}';\n}\nfunction isPadded(el) {\n return /^-?0\\d/.test(el);\n}\n\nfunction lte(i, y) {\n return i <= y;\n}\nfunction gte(i, y) {\n return i >= y;\n}\n\nfunction expand(str, isTop) {\n var expansions = [];\n\n var m = balanced('{', '}', str);\n if (!m || /\\$$/.test(m.pre)) return [str];\n\n var isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body);\n var isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(m.body);\n var isSequence = isNumericSequence || isAlphaSequence;\n var isOptions = m.body.indexOf(',') >= 0;\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,.*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post;\n return expand(str);\n }\n return [str];\n }\n\n var n;\n if (isSequence) {\n n = m.body.split(/\\.\\./);\n } else {\n n = parseCommaParts(m.body);\n if (n.length === 1) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand(n[0], false).map(embrace);\n if (n.length === 1) {\n var post = m.post.length\n ? expand(m.post, false)\n : [''];\n return post.map(function(p) {\n return m.pre + n[0] + p;\n });\n }\n }\n }\n\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n var pre = m.pre;\n var post = m.post.length\n ? expand(m.post, false)\n : [''];\n\n var N;\n\n if (isSequence) {\n var x = numeric(n[0]);\n var y = numeric(n[1]);\n var width = Math.max(n[0].length, n[1].length)\n var incr = n.length == 3\n ? Math.abs(numeric(n[2]))\n : 1;\n var test = lte;\n var reverse = y < x;\n if (reverse) {\n incr *= -1;\n test = gte;\n }\n var pad = n.some(isPadded);\n\n N = [];\n\n for (var i = x; test(i, y); i += incr) {\n var c;\n if (isAlphaSequence) {\n c = String.fromCharCode(i);\n if (c === '\\\\')\n c = '';\n } else {\n c = String(i);\n if (pad) {\n var need = width - c.length;\n if (need > 0) {\n var z = new Array(need + 1).join('0');\n if (i < 0)\n c = '-' + z + c.slice(1);\n else\n c = z + c;\n }\n }\n }\n N.push(c);\n }\n } else {\n N = concatMap(n, function(el) { return expand(el, false) });\n }\n\n for (var j = 0; j < N.length; j++) {\n for (var k = 0; k < post.length; k++) {\n var expansion = pre + N[j] + post[k];\n if (!isTop || isSequence || expansion)\n expansions.push(expansion);\n }\n }\n\n return expansions;\n}\n\n","'use strict'\n\n/**\n * Turns a browser readable stream into an async iterable. Async iteration over\n * returned iterable will lock give stream, preventing any other consumer from\n * acquiring a reader. The lock will be released if iteration loop is broken. To\n * prevent stream cancelling optional `{ preventCancel: true }` could be passed\n * as a second argument.\n * @template T\n * @param {ReadableStream} stream\n * @param {Object} [options]\n * @param {boolean} [options.preventCancel=boolean]\n * @returns {AsyncIterable}\n */\nasync function * browserReadableStreamToIt (stream, options = {}) {\n const reader = stream.getReader()\n\n try {\n while (true) {\n const result = await reader.read()\n\n if (result.done) {\n return\n }\n\n yield result.value\n }\n } finally {\n if (options.preventCancel !== true) {\n reader.cancel()\n }\n\n reader.releaseLock()\n }\n}\n\nmodule.exports = browserReadableStreamToIt\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar splitter = require('./splitter.js');\nvar joiner = require('./joiner.js');\n\n\n\nexports.TreewalkCarSplitter = splitter.TreewalkCarSplitter;\nexports.TreewalkCarJoiner = joiner.TreewalkCarJoiner;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar car = require('@ipld/car');\n\nclass TreewalkCarJoiner {\n constructor(cars) {\n this._cars = Array.from(cars);\n if (!this._cars.length)\n throw new Error('missing CARs');\n }\n async *car() {\n const reader = this._cars[0];\n const roots = await reader.getRoots();\n const {writer, out} = car.CarWriter.create(roots);\n const writeCar = async () => {\n const written = new Set();\n const writeBlocks = async reader => {\n for await (const b of reader.blocks()) {\n if (written.has(b.cid.toString()))\n continue;\n await writer.put(b);\n written.add(b.cid.toString());\n }\n };\n try {\n await writeBlocks(reader);\n for (const reader of this._cars.slice(1)) {\n await writeBlocks(reader);\n }\n } catch (err) {\n console.error(err);\n } finally {\n await writer.close();\n }\n };\n writeCar();\n yield* out;\n }\n}\n\nexports.TreewalkCarJoiner = TreewalkCarJoiner;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar car = require('@ipld/car');\nvar block = require('multiformats/block');\nvar raw = require('multiformats/codecs/raw');\nvar dagCbor = require('@ipld/dag-cbor');\nvar pb = require('@ipld/dag-pb');\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () {\n return e[k];\n }\n });\n }\n });\n }\n n['default'] = e;\n return Object.freeze(n);\n}\n\nvar raw__namespace = /*#__PURE__*/_interopNamespace(raw);\nvar dagCbor__namespace = /*#__PURE__*/_interopNamespace(dagCbor);\nvar pb__namespace = /*#__PURE__*/_interopNamespace(pb);\n\nclass TreewalkCarSplitter {\n constructor(reader, targetSize, options = {}) {\n if (typeof targetSize !== 'number' || targetSize <= 0) {\n throw new Error('invalid target chunk size');\n }\n this._reader = reader;\n this._targetSize = targetSize;\n this._decoders = [\n pb__namespace,\n raw__namespace,\n dagCbor__namespace,\n ...options.decoders || []\n ];\n }\n async *cars() {\n const roots = await this._reader.getRoots();\n if (roots.length !== 1)\n throw new Error(`unexpected number of roots: ${ roots.length }`);\n let channel;\n for await (const val of this._cars(roots[0])) {\n channel = val.channel;\n if (val.out)\n yield val.out;\n }\n if (!channel) {\n throw new Error('missing CAR writer channel');\n }\n channel.writer.close();\n yield channel.out;\n }\n async _get(cid) {\n const rawBlock = await this._reader.get(cid);\n if (!rawBlock)\n throw new Error(`missing block for ${ cid }`);\n const {bytes} = rawBlock;\n const decoder = this._decoders.find(d => d.code === cid.code);\n if (!decoder)\n throw new Error(`missing decoder for ${ cid.code }`);\n return new block.Block({\n cid,\n bytes,\n value: decoder.decode(bytes)\n });\n }\n async *_cars(cid, parents = [], channel = undefined) {\n const block = await this._get(cid);\n channel = channel || Object.assign(car.CarWriter.create(cid), { size: 0 });\n if (channel.size > 0 && channel.size + block.bytes.byteLength >= this._targetSize) {\n channel.writer.close();\n const {out} = channel;\n channel = newCar(parents);\n yield {\n channel,\n out\n };\n }\n parents = parents.concat(block);\n channel.size += block.bytes.byteLength;\n channel.writer.put(block);\n for (const [, cid] of block.links()) {\n for await (const val of this._cars(cid, parents, channel)) {\n channel = val.channel;\n yield val;\n }\n }\n if (!channel) {\n throw new Error('missing CAR writer channel');\n }\n yield { channel };\n }\n static async fromIterable(iterable, targetSize, options) {\n const reader = await car.CarReader.fromIterable(iterable);\n return new TreewalkCarSplitter(reader, targetSize, options);\n }\n static async fromBlob(blob, targetSize, options) {\n const buffer = await blob.arrayBuffer();\n const reader = await car.CarReader.fromBytes(new Uint8Array(buffer));\n return new TreewalkCarSplitter(reader, targetSize, options);\n }\n}\nfunction newCar(parents) {\n const ch = Object.assign(car.CarWriter.create(parents[0].cid), { size: parents.reduce((size, b) => size + b.bytes.byteLength, 0) });\n for (const b of parents) {\n ch.writer.put(b);\n }\n return ch;\n}\n\nexports.TreewalkCarSplitter = TreewalkCarSplitter;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar encode = require('./lib/encode.js');\nvar decode = require('./lib/decode.js');\nvar token = require('./lib/token.js');\n\n\n\nexports.encode = encode.encode;\nexports.decode = decode.decode;\nexports.Token = token.Token;\nexports.Type = token.Type;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar token = require('./token.js');\nvar common = require('./common.js');\n\nconst uintBoundaries = [\n 24,\n 256,\n 65536,\n 4294967296,\n BigInt('18446744073709551616')\n];\nfunction readUint8(data, offset, options) {\n common.assertEnoughData(data, offset, 1);\n const value = data[offset];\n if (options.strict === true && value < uintBoundaries[0]) {\n throw new Error(`${ common.decodeErrPrefix } integer encoded in more bytes than necessary (strict decode)`);\n }\n return value;\n}\nfunction readUint16(data, offset, options) {\n common.assertEnoughData(data, offset, 2);\n const value = data[offset] << 8 | data[offset + 1];\n if (options.strict === true && value < uintBoundaries[1]) {\n throw new Error(`${ common.decodeErrPrefix } integer encoded in more bytes than necessary (strict decode)`);\n }\n return value;\n}\nfunction readUint32(data, offset, options) {\n common.assertEnoughData(data, offset, 4);\n const value = data[offset] * 16777216 + (data[offset + 1] << 16) + (data[offset + 2] << 8) + data[offset + 3];\n if (options.strict === true && value < uintBoundaries[2]) {\n throw new Error(`${ common.decodeErrPrefix } integer encoded in more bytes than necessary (strict decode)`);\n }\n return value;\n}\nfunction readUint64(data, offset, options) {\n common.assertEnoughData(data, offset, 8);\n const hi = data[offset] * 16777216 + (data[offset + 1] << 16) + (data[offset + 2] << 8) + data[offset + 3];\n const lo = data[offset + 4] * 16777216 + (data[offset + 5] << 16) + (data[offset + 6] << 8) + data[offset + 7];\n const value = (BigInt(hi) << BigInt(32)) + BigInt(lo);\n if (options.strict === true && value < uintBoundaries[3]) {\n throw new Error(`${ common.decodeErrPrefix } integer encoded in more bytes than necessary (strict decode)`);\n }\n if (value <= Number.MAX_SAFE_INTEGER) {\n return Number(value);\n }\n if (options.allowBigInt === true) {\n return value;\n }\n throw new Error(`${ common.decodeErrPrefix } integers outside of the safe integer range are not supported`);\n}\nfunction decodeUint8(data, pos, _minor, options) {\n return new token.Token(token.Type.uint, readUint8(data, pos + 1, options), 2);\n}\nfunction decodeUint16(data, pos, _minor, options) {\n return new token.Token(token.Type.uint, readUint16(data, pos + 1, options), 3);\n}\nfunction decodeUint32(data, pos, _minor, options) {\n return new token.Token(token.Type.uint, readUint32(data, pos + 1, options), 5);\n}\nfunction decodeUint64(data, pos, _minor, options) {\n return new token.Token(token.Type.uint, readUint64(data, pos + 1, options), 9);\n}\nfunction encodeUint(buf, token) {\n return encodeUintValue(buf, 0, token.value);\n}\nfunction encodeUintValue(buf, major, uint) {\n if (uint < uintBoundaries[0]) {\n const nuint = Number(uint);\n buf.push([major | nuint]);\n } else if (uint < uintBoundaries[1]) {\n const nuint = Number(uint);\n buf.push([\n major | 24,\n nuint\n ]);\n } else if (uint < uintBoundaries[2]) {\n const nuint = Number(uint);\n buf.push([\n major | 25,\n nuint >>> 8,\n nuint & 255\n ]);\n } else if (uint < uintBoundaries[3]) {\n const nuint = Number(uint);\n buf.push([\n major | 26,\n nuint >>> 24 & 255,\n nuint >>> 16 & 255,\n nuint >>> 8 & 255,\n nuint & 255\n ]);\n } else {\n const buint = BigInt(uint);\n if (buint < uintBoundaries[4]) {\n const set = [\n major | 27,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0\n ];\n let lo = Number(buint & BigInt(4294967295));\n let hi = Number(buint >> BigInt(32) & BigInt(4294967295));\n set[8] = lo & 255;\n lo = lo >> 8;\n set[7] = lo & 255;\n lo = lo >> 8;\n set[6] = lo & 255;\n lo = lo >> 8;\n set[5] = lo & 255;\n set[4] = hi & 255;\n hi = hi >> 8;\n set[3] = hi & 255;\n hi = hi >> 8;\n set[2] = hi & 255;\n hi = hi >> 8;\n set[1] = hi & 255;\n buf.push(set);\n } else {\n throw new Error(`${ common.decodeErrPrefix } encountered BigInt larger than allowable range`);\n }\n }\n}\nencodeUint.encodedSize = function encodedSize(token) {\n return encodeUintValue.encodedSize(token.value);\n};\nencodeUintValue.encodedSize = function encodedSize(uint) {\n if (uint < uintBoundaries[0]) {\n return 1;\n }\n if (uint < uintBoundaries[1]) {\n return 2;\n }\n if (uint < uintBoundaries[2]) {\n return 3;\n }\n if (uint < uintBoundaries[3]) {\n return 5;\n }\n return 9;\n};\nencodeUint.compareTokens = function compareTokens(tok1, tok2) {\n return tok1.value < tok2.value ? -1 : tok1.value > tok2.value ? 1 : 0;\n};\n\nexports.decodeUint16 = decodeUint16;\nexports.decodeUint32 = decodeUint32;\nexports.decodeUint64 = decodeUint64;\nexports.decodeUint8 = decodeUint8;\nexports.encodeUint = encodeUint;\nexports.encodeUintValue = encodeUintValue;\nexports.readUint16 = readUint16;\nexports.readUint32 = readUint32;\nexports.readUint64 = readUint64;\nexports.readUint8 = readUint8;\nexports.uintBoundaries = uintBoundaries;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar token = require('./token.js');\nvar _0uint = require('./0uint.js');\nvar common = require('./common.js');\n\nfunction decodeNegint8(data, pos, _minor, options) {\n return new token.Token(token.Type.negint, -1 - _0uint.readUint8(data, pos + 1, options), 2);\n}\nfunction decodeNegint16(data, pos, _minor, options) {\n return new token.Token(token.Type.negint, -1 - _0uint.readUint16(data, pos + 1, options), 3);\n}\nfunction decodeNegint32(data, pos, _minor, options) {\n return new token.Token(token.Type.negint, -1 - _0uint.readUint32(data, pos + 1, options), 5);\n}\nconst neg1b = BigInt(-1);\nconst pos1b = BigInt(1);\nfunction decodeNegint64(data, pos, _minor, options) {\n const int = _0uint.readUint64(data, pos + 1, options);\n if (typeof int !== 'bigint') {\n const value = -1 - int;\n if (value >= Number.MIN_SAFE_INTEGER) {\n return new token.Token(token.Type.negint, value, 9);\n }\n }\n if (options.allowBigInt !== true) {\n throw new Error(`${ common.decodeErrPrefix } integers outside of the safe integer range are not supported`);\n }\n return new token.Token(token.Type.negint, neg1b - BigInt(int), 9);\n}\nfunction encodeNegint(buf, token) {\n const negint = token.value;\n const unsigned = typeof negint === 'bigint' ? negint * neg1b - pos1b : negint * -1 - 1;\n _0uint.encodeUintValue(buf, token.type.majorEncoded, unsigned);\n}\nencodeNegint.encodedSize = function encodedSize(token) {\n const negint = token.value;\n const unsigned = typeof negint === 'bigint' ? negint * neg1b - pos1b : negint * -1 - 1;\n if (unsigned < _0uint.uintBoundaries[0]) {\n return 1;\n }\n if (unsigned < _0uint.uintBoundaries[1]) {\n return 2;\n }\n if (unsigned < _0uint.uintBoundaries[2]) {\n return 3;\n }\n if (unsigned < _0uint.uintBoundaries[3]) {\n return 5;\n }\n return 9;\n};\nencodeNegint.compareTokens = function compareTokens(tok1, tok2) {\n return tok1.value < tok2.value ? 1 : tok1.value > tok2.value ? -1 : 0;\n};\n\nexports.decodeNegint16 = decodeNegint16;\nexports.decodeNegint32 = decodeNegint32;\nexports.decodeNegint64 = decodeNegint64;\nexports.decodeNegint8 = decodeNegint8;\nexports.encodeNegint = encodeNegint;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar token = require('./token.js');\nvar common = require('./common.js');\nvar _0uint = require('./0uint.js');\nvar byteUtils = require('./byte-utils.js');\n\nfunction toToken(data, pos, prefix, length) {\n common.assertEnoughData(data, pos, prefix + length);\n const buf = byteUtils.slice(data, pos + prefix, pos + prefix + length);\n return new token.Token(token.Type.bytes, buf, prefix + length);\n}\nfunction decodeBytesCompact(data, pos, minor, _options) {\n return toToken(data, pos, 1, minor);\n}\nfunction decodeBytes8(data, pos, _minor, options) {\n return toToken(data, pos, 2, _0uint.readUint8(data, pos + 1, options));\n}\nfunction decodeBytes16(data, pos, _minor, options) {\n return toToken(data, pos, 3, _0uint.readUint16(data, pos + 1, options));\n}\nfunction decodeBytes32(data, pos, _minor, options) {\n return toToken(data, pos, 5, _0uint.readUint32(data, pos + 1, options));\n}\nfunction decodeBytes64(data, pos, _minor, options) {\n const l = _0uint.readUint64(data, pos + 1, options);\n if (typeof l === 'bigint') {\n throw new Error(`${ common.decodeErrPrefix } 64-bit integer bytes lengths not supported`);\n }\n return toToken(data, pos, 9, l);\n}\nfunction tokenBytes(token$1) {\n if (token$1.encodedBytes === undefined) {\n token$1.encodedBytes = token$1.type === token.Type.string ? byteUtils.fromString(token$1.value) : token$1.value;\n }\n return token$1.encodedBytes;\n}\nfunction encodeBytes(buf, token) {\n const bytes = tokenBytes(token);\n _0uint.encodeUintValue(buf, token.type.majorEncoded, bytes.length);\n buf.push(bytes);\n}\nencodeBytes.encodedSize = function encodedSize(token) {\n const bytes = tokenBytes(token);\n return _0uint.encodeUintValue.encodedSize(bytes.length) + bytes.length;\n};\nencodeBytes.compareTokens = function compareTokens(tok1, tok2) {\n return compareBytes(tokenBytes(tok1), tokenBytes(tok2));\n};\nfunction compareBytes(b1, b2) {\n return b1.length < b2.length ? -1 : b1.length > b2.length ? 1 : byteUtils.compare(b1, b2);\n}\n\nexports.compareBytes = compareBytes;\nexports.decodeBytes16 = decodeBytes16;\nexports.decodeBytes32 = decodeBytes32;\nexports.decodeBytes64 = decodeBytes64;\nexports.decodeBytes8 = decodeBytes8;\nexports.decodeBytesCompact = decodeBytesCompact;\nexports.encodeBytes = encodeBytes;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar token = require('./token.js');\nvar common = require('./common.js');\nvar _0uint = require('./0uint.js');\nvar _2bytes = require('./2bytes.js');\nvar byteUtils = require('./byte-utils.js');\n\nfunction toToken(data, pos, prefix, length, options) {\n const totLength = prefix + length;\n common.assertEnoughData(data, pos, totLength);\n const tok = new token.Token(token.Type.string, byteUtils.toString(data, pos + prefix, pos + totLength), totLength);\n if (options.retainStringBytes === true) {\n tok.byteValue = byteUtils.slice(data, pos + prefix, pos + totLength);\n }\n return tok;\n}\nfunction decodeStringCompact(data, pos, minor, options) {\n return toToken(data, pos, 1, minor, options);\n}\nfunction decodeString8(data, pos, _minor, options) {\n return toToken(data, pos, 2, _0uint.readUint8(data, pos + 1, options), options);\n}\nfunction decodeString16(data, pos, _minor, options) {\n return toToken(data, pos, 3, _0uint.readUint16(data, pos + 1, options), options);\n}\nfunction decodeString32(data, pos, _minor, options) {\n return toToken(data, pos, 5, _0uint.readUint32(data, pos + 1, options), options);\n}\nfunction decodeString64(data, pos, _minor, options) {\n const l = _0uint.readUint64(data, pos + 1, options);\n if (typeof l === 'bigint') {\n throw new Error(`${ common.decodeErrPrefix } 64-bit integer string lengths not supported`);\n }\n return toToken(data, pos, 9, l, options);\n}\nconst encodeString = _2bytes.encodeBytes;\n\nexports.decodeString16 = decodeString16;\nexports.decodeString32 = decodeString32;\nexports.decodeString64 = decodeString64;\nexports.decodeString8 = decodeString8;\nexports.decodeStringCompact = decodeStringCompact;\nexports.encodeString = encodeString;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar token = require('./token.js');\nvar _0uint = require('./0uint.js');\nvar common = require('./common.js');\n\nfunction toToken(_data, _pos, prefix, length) {\n return new token.Token(token.Type.array, length, prefix);\n}\nfunction decodeArrayCompact(data, pos, minor, _options) {\n return toToken(data, pos, 1, minor);\n}\nfunction decodeArray8(data, pos, _minor, options) {\n return toToken(data, pos, 2, _0uint.readUint8(data, pos + 1, options));\n}\nfunction decodeArray16(data, pos, _minor, options) {\n return toToken(data, pos, 3, _0uint.readUint16(data, pos + 1, options));\n}\nfunction decodeArray32(data, pos, _minor, options) {\n return toToken(data, pos, 5, _0uint.readUint32(data, pos + 1, options));\n}\nfunction decodeArray64(data, pos, _minor, options) {\n const l = _0uint.readUint64(data, pos + 1, options);\n if (typeof l === 'bigint') {\n throw new Error(`${ common.decodeErrPrefix } 64-bit integer array lengths not supported`);\n }\n return toToken(data, pos, 9, l);\n}\nfunction decodeArrayIndefinite(data, pos, _minor, options) {\n if (options.allowIndefinite === false) {\n throw new Error(`${ common.decodeErrPrefix } indefinite length items not allowed`);\n }\n return toToken(data, pos, 1, Infinity);\n}\nfunction encodeArray(buf, token$1) {\n _0uint.encodeUintValue(buf, token.Type.array.majorEncoded, token$1.value);\n}\nencodeArray.compareTokens = _0uint.encodeUint.compareTokens;\nencodeArray.encodedSize = function encodedSize(token) {\n return _0uint.encodeUintValue.encodedSize(token.value);\n};\n\nexports.decodeArray16 = decodeArray16;\nexports.decodeArray32 = decodeArray32;\nexports.decodeArray64 = decodeArray64;\nexports.decodeArray8 = decodeArray8;\nexports.decodeArrayCompact = decodeArrayCompact;\nexports.decodeArrayIndefinite = decodeArrayIndefinite;\nexports.encodeArray = encodeArray;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar token = require('./token.js');\nvar _0uint = require('./0uint.js');\nvar common = require('./common.js');\n\nfunction toToken(_data, _pos, prefix, length) {\n return new token.Token(token.Type.map, length, prefix);\n}\nfunction decodeMapCompact(data, pos, minor, _options) {\n return toToken(data, pos, 1, minor);\n}\nfunction decodeMap8(data, pos, _minor, options) {\n return toToken(data, pos, 2, _0uint.readUint8(data, pos + 1, options));\n}\nfunction decodeMap16(data, pos, _minor, options) {\n return toToken(data, pos, 3, _0uint.readUint16(data, pos + 1, options));\n}\nfunction decodeMap32(data, pos, _minor, options) {\n return toToken(data, pos, 5, _0uint.readUint32(data, pos + 1, options));\n}\nfunction decodeMap64(data, pos, _minor, options) {\n const l = _0uint.readUint64(data, pos + 1, options);\n if (typeof l === 'bigint') {\n throw new Error(`${ common.decodeErrPrefix } 64-bit integer map lengths not supported`);\n }\n return toToken(data, pos, 9, l);\n}\nfunction decodeMapIndefinite(data, pos, _minor, options) {\n if (options.allowIndefinite === false) {\n throw new Error(`${ common.decodeErrPrefix } indefinite length items not allowed`);\n }\n return toToken(data, pos, 1, Infinity);\n}\nfunction encodeMap(buf, token$1) {\n _0uint.encodeUintValue(buf, token.Type.map.majorEncoded, token$1.value);\n}\nencodeMap.compareTokens = _0uint.encodeUint.compareTokens;\nencodeMap.encodedSize = function encodedSize(token) {\n return _0uint.encodeUintValue.encodedSize(token.value);\n};\n\nexports.decodeMap16 = decodeMap16;\nexports.decodeMap32 = decodeMap32;\nexports.decodeMap64 = decodeMap64;\nexports.decodeMap8 = decodeMap8;\nexports.decodeMapCompact = decodeMapCompact;\nexports.decodeMapIndefinite = decodeMapIndefinite;\nexports.encodeMap = encodeMap;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar token = require('./token.js');\nvar _0uint = require('./0uint.js');\n\nfunction decodeTagCompact(_data, _pos, minor, _options) {\n return new token.Token(token.Type.tag, minor, 1);\n}\nfunction decodeTag8(data, pos, _minor, options) {\n return new token.Token(token.Type.tag, _0uint.readUint8(data, pos + 1, options), 2);\n}\nfunction decodeTag16(data, pos, _minor, options) {\n return new token.Token(token.Type.tag, _0uint.readUint16(data, pos + 1, options), 3);\n}\nfunction decodeTag32(data, pos, _minor, options) {\n return new token.Token(token.Type.tag, _0uint.readUint32(data, pos + 1, options), 5);\n}\nfunction decodeTag64(data, pos, _minor, options) {\n return new token.Token(token.Type.tag, _0uint.readUint64(data, pos + 1, options), 9);\n}\nfunction encodeTag(buf, token$1) {\n _0uint.encodeUintValue(buf, token.Type.tag.majorEncoded, token$1.value);\n}\nencodeTag.compareTokens = _0uint.encodeUint.compareTokens;\nencodeTag.encodedSize = function encodedSize(token) {\n return _0uint.encodeUintValue.encodedSize(token.value);\n};\n\nexports.decodeTag16 = decodeTag16;\nexports.decodeTag32 = decodeTag32;\nexports.decodeTag64 = decodeTag64;\nexports.decodeTag8 = decodeTag8;\nexports.decodeTagCompact = decodeTagCompact;\nexports.encodeTag = encodeTag;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar token = require('./token.js');\nvar common = require('./common.js');\nvar _0uint = require('./0uint.js');\n\nconst MINOR_FALSE = 20;\nconst MINOR_TRUE = 21;\nconst MINOR_NULL = 22;\nconst MINOR_UNDEFINED = 23;\nfunction decodeUndefined(_data, _pos, _minor, options) {\n if (options.allowUndefined === false) {\n throw new Error(`${ common.decodeErrPrefix } undefined values are not supported`);\n } else if (options.coerceUndefinedToNull === true) {\n return new token.Token(token.Type.null, null, 1);\n }\n return new token.Token(token.Type.undefined, undefined, 1);\n}\nfunction decodeBreak(_data, _pos, _minor, options) {\n if (options.allowIndefinite === false) {\n throw new Error(`${ common.decodeErrPrefix } indefinite length items not allowed`);\n }\n return new token.Token(token.Type.break, undefined, 1);\n}\nfunction createToken(value, bytes, options) {\n if (options) {\n if (options.allowNaN === false && Number.isNaN(value)) {\n throw new Error(`${ common.decodeErrPrefix } NaN values are not supported`);\n }\n if (options.allowInfinity === false && (value === Infinity || value === -Infinity)) {\n throw new Error(`${ common.decodeErrPrefix } Infinity values are not supported`);\n }\n }\n return new token.Token(token.Type.float, value, bytes);\n}\nfunction decodeFloat16(data, pos, _minor, options) {\n return createToken(readFloat16(data, pos + 1), 3, options);\n}\nfunction decodeFloat32(data, pos, _minor, options) {\n return createToken(readFloat32(data, pos + 1), 5, options);\n}\nfunction decodeFloat64(data, pos, _minor, options) {\n return createToken(readFloat64(data, pos + 1), 9, options);\n}\nfunction encodeFloat(buf, token$1, options) {\n const float = token$1.value;\n if (float === false) {\n buf.push([token.Type.float.majorEncoded | MINOR_FALSE]);\n } else if (float === true) {\n buf.push([token.Type.float.majorEncoded | MINOR_TRUE]);\n } else if (float === null) {\n buf.push([token.Type.float.majorEncoded | MINOR_NULL]);\n } else if (float === undefined) {\n buf.push([token.Type.float.majorEncoded | MINOR_UNDEFINED]);\n } else {\n let decoded;\n let success = false;\n if (!options || options.float64 !== true) {\n encodeFloat16(float);\n decoded = readFloat16(ui8a, 1);\n if (float === decoded || Number.isNaN(float)) {\n ui8a[0] = 249;\n buf.push(ui8a.slice(0, 3));\n success = true;\n } else {\n encodeFloat32(float);\n decoded = readFloat32(ui8a, 1);\n if (float === decoded) {\n ui8a[0] = 250;\n buf.push(ui8a.slice(0, 5));\n success = true;\n }\n }\n }\n if (!success) {\n encodeFloat64(float);\n decoded = readFloat64(ui8a, 1);\n ui8a[0] = 251;\n buf.push(ui8a.slice(0, 9));\n }\n }\n}\nencodeFloat.encodedSize = function encodedSize(token, options) {\n const float = token.value;\n if (float === false || float === true || float === null || float === undefined) {\n return 1;\n }\n if (!options || options.float64 !== true) {\n encodeFloat16(float);\n let decoded = readFloat16(ui8a, 1);\n if (float === decoded || Number.isNaN(float)) {\n return 3;\n }\n encodeFloat32(float);\n decoded = readFloat32(ui8a, 1);\n if (float === decoded) {\n return 5;\n }\n }\n return 9;\n};\nconst buffer = new ArrayBuffer(9);\nconst dataView = new DataView(buffer, 1);\nconst ui8a = new Uint8Array(buffer, 0);\nfunction encodeFloat16(inp) {\n if (inp === Infinity) {\n dataView.setUint16(0, 31744, false);\n } else if (inp === -Infinity) {\n dataView.setUint16(0, 64512, false);\n } else if (Number.isNaN(inp)) {\n dataView.setUint16(0, 32256, false);\n } else {\n dataView.setFloat32(0, inp);\n const valu32 = dataView.getUint32(0);\n const exponent = (valu32 & 2139095040) >> 23;\n const mantissa = valu32 & 8388607;\n if (exponent === 255) {\n dataView.setUint16(0, 31744, false);\n } else if (exponent === 0) {\n dataView.setUint16(0, (inp & 2147483648) >> 16 | mantissa >> 13, false);\n } else {\n const logicalExponent = exponent - 127;\n if (logicalExponent < -24) {\n dataView.setUint16(0, 0);\n } else if (logicalExponent < -14) {\n dataView.setUint16(0, (valu32 & 2147483648) >> 16 | 1 << 24 + logicalExponent, false);\n } else {\n dataView.setUint16(0, (valu32 & 2147483648) >> 16 | logicalExponent + 15 << 10 | mantissa >> 13, false);\n }\n }\n }\n}\nfunction readFloat16(ui8a, pos) {\n if (ui8a.length - pos < 2) {\n throw new Error(`${ common.decodeErrPrefix } not enough data for float16`);\n }\n const half = (ui8a[pos] << 8) + ui8a[pos + 1];\n if (half === 31744) {\n return Infinity;\n }\n if (half === 64512) {\n return -Infinity;\n }\n if (half === 32256) {\n return NaN;\n }\n const exp = half >> 10 & 31;\n const mant = half & 1023;\n let val;\n if (exp === 0) {\n val = mant * 2 ** -24;\n } else if (exp !== 31) {\n val = (mant + 1024) * 2 ** (exp - 25);\n } else {\n val = mant === 0 ? Infinity : NaN;\n }\n return half & 32768 ? -val : val;\n}\nfunction encodeFloat32(inp) {\n dataView.setFloat32(0, inp, false);\n}\nfunction readFloat32(ui8a, pos) {\n if (ui8a.length - pos < 4) {\n throw new Error(`${ common.decodeErrPrefix } not enough data for float32`);\n }\n const offset = (ui8a.byteOffset || 0) + pos;\n return new DataView(ui8a.buffer, offset, 4).getFloat32(0, false);\n}\nfunction encodeFloat64(inp) {\n dataView.setFloat64(0, inp, false);\n}\nfunction readFloat64(ui8a, pos) {\n if (ui8a.length - pos < 8) {\n throw new Error(`${ common.decodeErrPrefix } not enough data for float64`);\n }\n const offset = (ui8a.byteOffset || 0) + pos;\n return new DataView(ui8a.buffer, offset, 8).getFloat64(0, false);\n}\nencodeFloat.compareTokens = _0uint.encodeUint.compareTokens;\n\nexports.decodeBreak = decodeBreak;\nexports.decodeFloat16 = decodeFloat16;\nexports.decodeFloat32 = decodeFloat32;\nexports.decodeFloat64 = decodeFloat64;\nexports.decodeUndefined = decodeUndefined;\nexports.encodeFloat = encodeFloat;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar byteUtils = require('./byte-utils.js');\n\nconst defaultChunkSize = 256;\nclass Bl {\n constructor(chunkSize = defaultChunkSize) {\n this.chunkSize = chunkSize;\n this.cursor = 0;\n this.maxCursor = -1;\n this.chunks = [];\n this._initReuseChunk = null;\n }\n reset() {\n this.cursor = 0;\n this.maxCursor = -1;\n if (this.chunks.length) {\n this.chunks = [];\n }\n if (this._initReuseChunk !== null) {\n this.chunks.push(this._initReuseChunk);\n this.maxCursor = this._initReuseChunk.length - 1;\n }\n }\n push(bytes) {\n let topChunk = this.chunks[this.chunks.length - 1];\n const newMax = this.cursor + bytes.length;\n if (newMax <= this.maxCursor + 1) {\n const chunkPos = topChunk.length - (this.maxCursor - this.cursor) - 1;\n topChunk.set(bytes, chunkPos);\n } else {\n if (topChunk) {\n const chunkPos = topChunk.length - (this.maxCursor - this.cursor) - 1;\n if (chunkPos < topChunk.length) {\n this.chunks[this.chunks.length - 1] = topChunk.subarray(0, chunkPos);\n this.maxCursor = this.cursor - 1;\n }\n }\n if (bytes.length < 64 && bytes.length < this.chunkSize) {\n topChunk = byteUtils.alloc(this.chunkSize);\n this.chunks.push(topChunk);\n this.maxCursor += topChunk.length;\n if (this._initReuseChunk === null) {\n this._initReuseChunk = topChunk;\n }\n topChunk.set(bytes, 0);\n } else {\n this.chunks.push(bytes);\n this.maxCursor += bytes.length;\n }\n }\n this.cursor += bytes.length;\n }\n toBytes(reset = false) {\n let byts;\n if (this.chunks.length === 1) {\n const chunk = this.chunks[0];\n if (reset && this.cursor > chunk.length / 2) {\n byts = this.cursor === chunk.length ? chunk : chunk.subarray(0, this.cursor);\n this._initReuseChunk = null;\n this.chunks = [];\n } else {\n byts = byteUtils.slice(chunk, 0, this.cursor);\n }\n } else {\n byts = byteUtils.concat(this.chunks, this.cursor);\n }\n if (reset) {\n this.reset();\n }\n return byts;\n }\n}\n\nexports.Bl = Bl;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst useBuffer = globalThis.process && !globalThis.process.browser && globalThis.Buffer && typeof globalThis.Buffer.isBuffer === 'function';\nconst textDecoder = new TextDecoder();\nconst textEncoder = new TextEncoder();\nfunction isBuffer(buf) {\n return useBuffer && globalThis.Buffer.isBuffer(buf);\n}\nfunction asU8A(buf) {\n if (!(buf instanceof Uint8Array)) {\n return Uint8Array.from(buf);\n }\n return isBuffer(buf) ? new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength) : buf;\n}\nconst toString = useBuffer ? (bytes, start, end) => {\n return end - start > 64 ? globalThis.Buffer.from(bytes.subarray(start, end)).toString('utf8') : utf8Slice(bytes, start, end);\n} : (bytes, start, end) => {\n return end - start > 64 ? textDecoder.decode(bytes.subarray(start, end)) : utf8Slice(bytes, start, end);\n};\nconst fromString = useBuffer ? string => {\n return string.length > 64 ? globalThis.Buffer.from(string) : utf8ToBytes(string);\n} : string => {\n return string.length > 64 ? textEncoder.encode(string) : utf8ToBytes(string);\n};\nconst fromArray = arr => {\n return Uint8Array.from(arr);\n};\nconst slice = useBuffer ? (bytes, start, end) => {\n if (isBuffer(bytes)) {\n return new Uint8Array(bytes.subarray(start, end));\n }\n return bytes.slice(start, end);\n} : (bytes, start, end) => {\n return bytes.slice(start, end);\n};\nconst concat = useBuffer ? (chunks, length) => {\n chunks = chunks.map(c => c instanceof Uint8Array ? c : globalThis.Buffer.from(c));\n return asU8A(globalThis.Buffer.concat(chunks, length));\n} : (chunks, length) => {\n const out = new Uint8Array(length);\n let off = 0;\n for (let b of chunks) {\n if (off + b.length > out.length) {\n b = b.subarray(0, out.length - off);\n }\n out.set(b, off);\n off += b.length;\n }\n return out;\n};\nconst alloc = useBuffer ? size => {\n return globalThis.Buffer.allocUnsafe(size);\n} : size => {\n return new Uint8Array(size);\n};\nconst toHex = useBuffer ? d => {\n if (typeof d === 'string') {\n return d;\n }\n return globalThis.Buffer.from(toBytes(d)).toString('hex');\n} : d => {\n if (typeof d === 'string') {\n return d;\n }\n return Array.prototype.reduce.call(toBytes(d), (p, c) => `${ p }${ c.toString(16).padStart(2, '0') }`, '');\n};\nconst fromHex = useBuffer ? hex => {\n if (hex instanceof Uint8Array) {\n return hex;\n }\n return globalThis.Buffer.from(hex, 'hex');\n} : hex => {\n if (hex instanceof Uint8Array) {\n return hex;\n }\n if (!hex.length) {\n return new Uint8Array(0);\n }\n return new Uint8Array(hex.split('').map((c, i, d) => i % 2 === 0 ? `0x${ c }${ d[i + 1] }` : '').filter(Boolean).map(e => parseInt(e, 16)));\n};\nfunction toBytes(obj) {\n if (obj instanceof Uint8Array && obj.constructor.name === 'Uint8Array') {\n return obj;\n }\n if (obj instanceof ArrayBuffer) {\n return new Uint8Array(obj);\n }\n if (ArrayBuffer.isView(obj)) {\n return new Uint8Array(obj.buffer, obj.byteOffset, obj.byteLength);\n }\n throw new Error('Unknown type, must be binary type');\n}\nfunction compare(b1, b2) {\n if (isBuffer(b1) && isBuffer(b2)) {\n return b1.compare(b2);\n }\n for (let i = 0; i < b1.length; i++) {\n if (b1[i] === b2[i]) {\n continue;\n }\n return b1[i] < b2[i] ? -1 : 1;\n }\n return 0;\n}\nfunction utf8ToBytes(string, units = Infinity) {\n let codePoint;\n const length = string.length;\n let leadSurrogate = null;\n const bytes = [];\n for (let i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i);\n if (codePoint > 55295 && codePoint < 57344) {\n if (!leadSurrogate) {\n if (codePoint > 56319) {\n if ((units -= 3) > -1)\n bytes.push(239, 191, 189);\n continue;\n } else if (i + 1 === length) {\n if ((units -= 3) > -1)\n bytes.push(239, 191, 189);\n continue;\n }\n leadSurrogate = codePoint;\n continue;\n }\n if (codePoint < 56320) {\n if ((units -= 3) > -1)\n bytes.push(239, 191, 189);\n leadSurrogate = codePoint;\n continue;\n }\n codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536;\n } else if (leadSurrogate) {\n if ((units -= 3) > -1)\n bytes.push(239, 191, 189);\n }\n leadSurrogate = null;\n if (codePoint < 128) {\n if ((units -= 1) < 0)\n break;\n bytes.push(codePoint);\n } else if (codePoint < 2048) {\n if ((units -= 2) < 0)\n break;\n bytes.push(codePoint >> 6 | 192, codePoint & 63 | 128);\n } else if (codePoint < 65536) {\n if ((units -= 3) < 0)\n break;\n bytes.push(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128);\n } else if (codePoint < 1114112) {\n if ((units -= 4) < 0)\n break;\n bytes.push(codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128);\n } else {\n throw new Error('Invalid code point');\n }\n }\n return bytes;\n}\nfunction utf8Slice(buf, offset, end) {\n const res = [];\n while (offset < end) {\n const firstByte = buf[offset];\n let codePoint = null;\n let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1;\n if (offset + bytesPerSequence <= end) {\n let secondByte, thirdByte, fourthByte, tempCodePoint;\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 128) {\n codePoint = firstByte;\n }\n break;\n case 2:\n secondByte = buf[offset + 1];\n if ((secondByte & 192) === 128) {\n tempCodePoint = (firstByte & 31) << 6 | secondByte & 63;\n if (tempCodePoint > 127) {\n codePoint = tempCodePoint;\n }\n }\n break;\n case 3:\n secondByte = buf[offset + 1];\n thirdByte = buf[offset + 2];\n if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) {\n tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63;\n if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) {\n codePoint = tempCodePoint;\n }\n }\n break;\n case 4:\n secondByte = buf[offset + 1];\n thirdByte = buf[offset + 2];\n fourthByte = buf[offset + 3];\n if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) {\n tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63;\n if (tempCodePoint > 65535 && tempCodePoint < 1114112) {\n codePoint = tempCodePoint;\n }\n }\n }\n }\n if (codePoint === null) {\n codePoint = 65533;\n bytesPerSequence = 1;\n } else if (codePoint > 65535) {\n codePoint -= 65536;\n res.push(codePoint >>> 10 & 1023 | 55296);\n codePoint = 56320 | codePoint & 1023;\n }\n res.push(codePoint);\n offset += bytesPerSequence;\n }\n return decodeCodePointsArray(res);\n}\nconst MAX_ARGUMENTS_LENGTH = 4096;\nfunction decodeCodePointsArray(codePoints) {\n const len = codePoints.length;\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints);\n }\n let res = '';\n let i = 0;\n while (i < len) {\n res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH));\n }\n return res;\n}\n\nexports.alloc = alloc;\nexports.asU8A = asU8A;\nexports.compare = compare;\nexports.concat = concat;\nexports.decodeCodePointsArray = decodeCodePointsArray;\nexports.fromArray = fromArray;\nexports.fromHex = fromHex;\nexports.fromString = fromString;\nexports.slice = slice;\nexports.toHex = toHex;\nexports.toString = toString;\nexports.useBuffer = useBuffer;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst decodeErrPrefix = 'CBOR decode error:';\nconst encodeErrPrefix = 'CBOR encode error:';\nconst uintMinorPrefixBytes = [];\nuintMinorPrefixBytes[23] = 1;\nuintMinorPrefixBytes[24] = 2;\nuintMinorPrefixBytes[25] = 3;\nuintMinorPrefixBytes[26] = 5;\nuintMinorPrefixBytes[27] = 9;\nfunction assertEnoughData(data, pos, need) {\n if (data.length - pos < need) {\n throw new Error(`${ decodeErrPrefix } not enough data for type`);\n }\n}\n\nexports.assertEnoughData = assertEnoughData;\nexports.decodeErrPrefix = decodeErrPrefix;\nexports.encodeErrPrefix = encodeErrPrefix;\nexports.uintMinorPrefixBytes = uintMinorPrefixBytes;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar common = require('./common.js');\nvar token = require('./token.js');\nvar jump = require('./jump.js');\n\nconst defaultDecodeOptions = {\n strict: false,\n allowIndefinite: true,\n allowUndefined: true,\n allowBigInt: true\n};\nclass Tokeniser {\n constructor(data, options = {}) {\n this.pos = 0;\n this.data = data;\n this.options = options;\n }\n done() {\n return this.pos >= this.data.length;\n }\n next() {\n const byt = this.data[this.pos];\n let token = jump.quick[byt];\n if (token === undefined) {\n const decoder = jump.jump[byt];\n if (!decoder) {\n throw new Error(`${ common.decodeErrPrefix } no decoder for major type ${ byt >>> 5 } (byte 0x${ byt.toString(16).padStart(2, '0') })`);\n }\n const minor = byt & 31;\n token = decoder(this.data, this.pos, minor, this.options);\n }\n this.pos += token.encodedLength;\n return token;\n }\n}\nconst DONE = Symbol.for('DONE');\nconst BREAK = Symbol.for('BREAK');\nfunction tokenToArray(token, tokeniser, options) {\n const arr = [];\n for (let i = 0; i < token.value; i++) {\n const value = tokensToObject(tokeniser, options);\n if (value === BREAK) {\n if (token.value === Infinity) {\n break;\n }\n throw new Error(`${ common.decodeErrPrefix } got unexpected break to lengthed array`);\n }\n if (value === DONE) {\n throw new Error(`${ common.decodeErrPrefix } found array but not enough entries (got ${ i }, expected ${ token.value })`);\n }\n arr[i] = value;\n }\n return arr;\n}\nfunction tokenToMap(token, tokeniser, options) {\n const useMaps = options.useMaps === true;\n const obj = useMaps ? undefined : {};\n const m = useMaps ? new Map() : undefined;\n for (let i = 0; i < token.value; i++) {\n const key = tokensToObject(tokeniser, options);\n if (key === BREAK) {\n if (token.value === Infinity) {\n break;\n }\n throw new Error(`${ common.decodeErrPrefix } got unexpected break to lengthed map`);\n }\n if (key === DONE) {\n throw new Error(`${ common.decodeErrPrefix } found map but not enough entries (got ${ i } [no key], expected ${ token.value })`);\n }\n if (useMaps !== true && typeof key !== 'string') {\n throw new Error(`${ common.decodeErrPrefix } non-string keys not supported (got ${ typeof key })`);\n }\n const value = tokensToObject(tokeniser, options);\n if (value === DONE) {\n throw new Error(`${ common.decodeErrPrefix } found map but not enough entries (got ${ i } [no value], expected ${ token.value })`);\n }\n if (useMaps) {\n m.set(key, value);\n } else {\n obj[key] = value;\n }\n }\n return useMaps ? m : obj;\n}\nfunction tokensToObject(tokeniser, options) {\n if (tokeniser.done()) {\n return DONE;\n }\n const token$1 = tokeniser.next();\n if (token$1.type === token.Type.break) {\n return BREAK;\n }\n if (token$1.type.terminal) {\n return token$1.value;\n }\n if (token$1.type === token.Type.array) {\n return tokenToArray(token$1, tokeniser, options);\n }\n if (token$1.type === token.Type.map) {\n return tokenToMap(token$1, tokeniser, options);\n }\n if (token$1.type === token.Type.tag) {\n if (options.tags && typeof options.tags[token$1.value] === 'function') {\n const tagged = tokensToObject(tokeniser, options);\n return options.tags[token$1.value](tagged);\n }\n throw new Error(`${ common.decodeErrPrefix } tag not supported (${ token$1.value })`);\n }\n throw new Error('unsupported');\n}\nfunction decode(data, options) {\n if (!(data instanceof Uint8Array)) {\n throw new Error(`${ common.decodeErrPrefix } data to decode must be a Uint8Array`);\n }\n options = Object.assign({}, defaultDecodeOptions, options);\n const tokeniser = options.tokenizer || new Tokeniser(data, options);\n const decoded = tokensToObject(tokeniser, options);\n if (decoded === DONE) {\n throw new Error(`${ common.decodeErrPrefix } did not find any content to decode`);\n }\n if (decoded === BREAK) {\n throw new Error(`${ common.decodeErrPrefix } got unexpected break`);\n }\n if (!tokeniser.done()) {\n throw new Error(`${ common.decodeErrPrefix } too many terminals, data makes no sense`);\n }\n return decoded;\n}\n\nexports.Tokeniser = Tokeniser;\nexports.decode = decode;\nexports.tokensToObject = tokensToObject;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar is = require('./is.js');\nvar token = require('./token.js');\nvar bl = require('./bl.js');\nvar common = require('./common.js');\nvar jump = require('./jump.js');\nvar byteUtils = require('./byte-utils.js');\nvar _0uint = require('./0uint.js');\nvar _1negint = require('./1negint.js');\nvar _2bytes = require('./2bytes.js');\nvar _3string = require('./3string.js');\nvar _4array = require('./4array.js');\nvar _5map = require('./5map.js');\nvar _6tag = require('./6tag.js');\nvar _7float = require('./7float.js');\n\nconst defaultEncodeOptions = {\n float64: false,\n mapSorter,\n quickEncodeToken: jump.quickEncodeToken\n};\nfunction makeCborEncoders() {\n const encoders = [];\n encoders[token.Type.uint.major] = _0uint.encodeUint;\n encoders[token.Type.negint.major] = _1negint.encodeNegint;\n encoders[token.Type.bytes.major] = _2bytes.encodeBytes;\n encoders[token.Type.string.major] = _3string.encodeString;\n encoders[token.Type.array.major] = _4array.encodeArray;\n encoders[token.Type.map.major] = _5map.encodeMap;\n encoders[token.Type.tag.major] = _6tag.encodeTag;\n encoders[token.Type.float.major] = _7float.encodeFloat;\n return encoders;\n}\nconst cborEncoders = makeCborEncoders();\nconst buf = new bl.Bl();\nclass Ref {\n constructor(obj, parent) {\n this.obj = obj;\n this.parent = parent;\n }\n includes(obj) {\n let p = this;\n do {\n if (p.obj === obj) {\n return true;\n }\n } while (p = p.parent);\n return false;\n }\n static createCheck(stack, obj) {\n if (stack && stack.includes(obj)) {\n throw new Error(`${ common.encodeErrPrefix } object contains circular references`);\n }\n return new Ref(obj, stack);\n }\n}\nconst simpleTokens = {\n null: new token.Token(token.Type.null, null),\n undefined: new token.Token(token.Type.undefined, undefined),\n true: new token.Token(token.Type.true, true),\n false: new token.Token(token.Type.false, false),\n emptyArray: new token.Token(token.Type.array, 0),\n emptyMap: new token.Token(token.Type.map, 0)\n};\nconst typeEncoders = {\n number(obj, _typ, _options, _refStack) {\n if (!Number.isInteger(obj) || !Number.isSafeInteger(obj)) {\n return new token.Token(token.Type.float, obj);\n } else if (obj >= 0) {\n return new token.Token(token.Type.uint, obj);\n } else {\n return new token.Token(token.Type.negint, obj);\n }\n },\n bigint(obj, _typ, _options, _refStack) {\n if (obj >= BigInt(0)) {\n return new token.Token(token.Type.uint, obj);\n } else {\n return new token.Token(token.Type.negint, obj);\n }\n },\n Uint8Array(obj, _typ, _options, _refStack) {\n return new token.Token(token.Type.bytes, obj);\n },\n string(obj, _typ, _options, _refStack) {\n return new token.Token(token.Type.string, obj);\n },\n boolean(obj, _typ, _options, _refStack) {\n return obj ? simpleTokens.true : simpleTokens.false;\n },\n null(_obj, _typ, _options, _refStack) {\n return simpleTokens.null;\n },\n undefined(_obj, _typ, _options, _refStack) {\n return simpleTokens.undefined;\n },\n ArrayBuffer(obj, _typ, _options, _refStack) {\n return new token.Token(token.Type.bytes, new Uint8Array(obj));\n },\n DataView(obj, _typ, _options, _refStack) {\n return new token.Token(token.Type.bytes, new Uint8Array(obj.buffer, obj.byteOffset, obj.byteLength));\n },\n Array(obj, _typ, options, refStack) {\n if (!obj.length) {\n if (options.addBreakTokens === true) {\n return [\n simpleTokens.emptyArray,\n new token.Token(token.Type.break)\n ];\n }\n return simpleTokens.emptyArray;\n }\n refStack = Ref.createCheck(refStack, obj);\n const entries = [];\n let i = 0;\n for (const e of obj) {\n entries[i++] = objectToTokens(e, options, refStack);\n }\n if (options.addBreakTokens) {\n return [\n new token.Token(token.Type.array, obj.length),\n entries,\n new token.Token(token.Type.break)\n ];\n }\n return [\n new token.Token(token.Type.array, obj.length),\n entries\n ];\n },\n Object(obj, typ, options, refStack) {\n const isMap = typ !== 'Object';\n const keys = isMap ? obj.keys() : Object.keys(obj);\n const length = isMap ? obj.size : keys.length;\n if (!length) {\n if (options.addBreakTokens === true) {\n return [\n simpleTokens.emptyMap,\n new token.Token(token.Type.break)\n ];\n }\n return simpleTokens.emptyMap;\n }\n refStack = Ref.createCheck(refStack, obj);\n const entries = [];\n let i = 0;\n for (const key of keys) {\n entries[i++] = [\n objectToTokens(key, options, refStack),\n objectToTokens(isMap ? obj.get(key) : obj[key], options, refStack)\n ];\n }\n sortMapEntries(entries, options);\n if (options.addBreakTokens) {\n return [\n new token.Token(token.Type.map, length),\n entries,\n new token.Token(token.Type.break)\n ];\n }\n return [\n new token.Token(token.Type.map, length),\n entries\n ];\n }\n};\ntypeEncoders.Map = typeEncoders.Object;\ntypeEncoders.Buffer = typeEncoders.Uint8Array;\nfor (const typ of 'Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64'.split(' ')) {\n typeEncoders[`${ typ }Array`] = typeEncoders.DataView;\n}\nfunction objectToTokens(obj, options = {}, refStack) {\n const typ = is.is(obj);\n const customTypeEncoder = options && options.typeEncoders && options.typeEncoders[typ] || typeEncoders[typ];\n if (typeof customTypeEncoder === 'function') {\n const tokens = customTypeEncoder(obj, typ, options, refStack);\n if (tokens != null) {\n return tokens;\n }\n }\n const typeEncoder = typeEncoders[typ];\n if (!typeEncoder) {\n throw new Error(`${ common.encodeErrPrefix } unsupported type: ${ typ }`);\n }\n return typeEncoder(obj, typ, options, refStack);\n}\nfunction sortMapEntries(entries, options) {\n if (options.mapSorter) {\n entries.sort(options.mapSorter);\n }\n}\nfunction mapSorter(e1, e2) {\n const keyToken1 = Array.isArray(e1[0]) ? e1[0][0] : e1[0];\n const keyToken2 = Array.isArray(e2[0]) ? e2[0][0] : e2[0];\n if (keyToken1.type !== keyToken2.type) {\n return keyToken1.type.compare(keyToken2.type);\n }\n const major = keyToken1.type.major;\n const tcmp = cborEncoders[major].compareTokens(keyToken1, keyToken2);\n if (tcmp === 0) {\n console.warn('WARNING: complex key types used, CBOR key sorting guarantees are gone');\n }\n return tcmp;\n}\nfunction tokensToEncoded(buf, tokens, encoders, options) {\n if (Array.isArray(tokens)) {\n for (const token of tokens) {\n tokensToEncoded(buf, token, encoders, options);\n }\n } else {\n encoders[tokens.type.major](buf, tokens, options);\n }\n}\nfunction encodeCustom(data, encoders, options) {\n const tokens = objectToTokens(data, options);\n if (!Array.isArray(tokens) && options.quickEncodeToken) {\n const quickBytes = options.quickEncodeToken(tokens);\n if (quickBytes) {\n return quickBytes;\n }\n const encoder = encoders[tokens.type.major];\n if (encoder.encodedSize) {\n const size = encoder.encodedSize(tokens, options);\n const buf = new bl.Bl(size);\n encoder(buf, tokens, options);\n if (buf.chunks.length !== 1) {\n throw new Error(`Unexpected error: pre-calculated length for ${ tokens } was wrong`);\n }\n return byteUtils.asU8A(buf.chunks[0]);\n }\n }\n buf.reset();\n tokensToEncoded(buf, tokens, encoders, options);\n return buf.toBytes(true);\n}\nfunction encode(data, options) {\n options = Object.assign({}, defaultEncodeOptions, options);\n return encodeCustom(data, cborEncoders, options);\n}\n\nexports.Ref = Ref;\nexports.encode = encode;\nexports.encodeCustom = encodeCustom;\nexports.makeCborEncoders = makeCborEncoders;\nexports.objectToTokens = objectToTokens;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst typeofs = [\n 'string',\n 'number',\n 'bigint',\n 'symbol'\n];\nconst objectTypeNames = [\n 'Function',\n 'Generator',\n 'AsyncGenerator',\n 'GeneratorFunction',\n 'AsyncGeneratorFunction',\n 'AsyncFunction',\n 'Observable',\n 'Array',\n 'Buffer',\n 'Object',\n 'RegExp',\n 'Date',\n 'Error',\n 'Map',\n 'Set',\n 'WeakMap',\n 'WeakSet',\n 'ArrayBuffer',\n 'SharedArrayBuffer',\n 'DataView',\n 'Promise',\n 'URL',\n 'HTMLElement',\n 'Int8Array',\n 'Uint8Array',\n 'Uint8ClampedArray',\n 'Int16Array',\n 'Uint16Array',\n 'Int32Array',\n 'Uint32Array',\n 'Float32Array',\n 'Float64Array',\n 'BigInt64Array',\n 'BigUint64Array'\n];\nfunction is(value) {\n if (value === null) {\n return 'null';\n }\n if (value === undefined) {\n return 'undefined';\n }\n if (value === true || value === false) {\n return 'boolean';\n }\n const typeOf = typeof value;\n if (typeofs.includes(typeOf)) {\n return typeOf;\n }\n if (typeOf === 'function') {\n return 'Function';\n }\n if (Array.isArray(value)) {\n return 'Array';\n }\n if (isBuffer(value)) {\n return 'Buffer';\n }\n const objectType = getObjectType(value);\n if (objectType) {\n return objectType;\n }\n return 'Object';\n}\nfunction isBuffer(value) {\n return value && value.constructor && value.constructor.isBuffer && value.constructor.isBuffer.call(null, value);\n}\nfunction getObjectType(value) {\n const objectTypeName = Object.prototype.toString.call(value).slice(8, -1);\n if (objectTypeNames.includes(objectTypeName)) {\n return objectTypeName;\n }\n return undefined;\n}\n\nexports.is = is;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar token = require('./token.js');\nvar _0uint = require('./0uint.js');\nvar _1negint = require('./1negint.js');\nvar _2bytes = require('./2bytes.js');\nvar _3string = require('./3string.js');\nvar _4array = require('./4array.js');\nvar _5map = require('./5map.js');\nvar _6tag = require('./6tag.js');\nvar _7float = require('./7float.js');\nvar common = require('./common.js');\nvar byteUtils = require('./byte-utils.js');\n\nfunction invalidMinor(data, pos, minor) {\n throw new Error(`${ common.decodeErrPrefix } encountered invalid minor (${ minor }) for major ${ data[pos] >>> 5 }`);\n}\nfunction errorer(msg) {\n return () => {\n throw new Error(`${ common.decodeErrPrefix } ${ msg }`);\n };\n}\nconst jump = [];\nfor (let i = 0; i <= 23; i++) {\n jump[i] = invalidMinor;\n}\njump[24] = _0uint.decodeUint8;\njump[25] = _0uint.decodeUint16;\njump[26] = _0uint.decodeUint32;\njump[27] = _0uint.decodeUint64;\njump[28] = invalidMinor;\njump[29] = invalidMinor;\njump[30] = invalidMinor;\njump[31] = invalidMinor;\nfor (let i = 32; i <= 55; i++) {\n jump[i] = invalidMinor;\n}\njump[56] = _1negint.decodeNegint8;\njump[57] = _1negint.decodeNegint16;\njump[58] = _1negint.decodeNegint32;\njump[59] = _1negint.decodeNegint64;\njump[60] = invalidMinor;\njump[61] = invalidMinor;\njump[62] = invalidMinor;\njump[63] = invalidMinor;\nfor (let i = 64; i <= 87; i++) {\n jump[i] = _2bytes.decodeBytesCompact;\n}\njump[88] = _2bytes.decodeBytes8;\njump[89] = _2bytes.decodeBytes16;\njump[90] = _2bytes.decodeBytes32;\njump[91] = _2bytes.decodeBytes64;\njump[92] = invalidMinor;\njump[93] = invalidMinor;\njump[94] = invalidMinor;\njump[95] = errorer('indefinite length bytes/strings are not supported');\nfor (let i = 96; i <= 119; i++) {\n jump[i] = _3string.decodeStringCompact;\n}\njump[120] = _3string.decodeString8;\njump[121] = _3string.decodeString16;\njump[122] = _3string.decodeString32;\njump[123] = _3string.decodeString64;\njump[124] = invalidMinor;\njump[125] = invalidMinor;\njump[126] = invalidMinor;\njump[127] = errorer('indefinite length bytes/strings are not supported');\nfor (let i = 128; i <= 151; i++) {\n jump[i] = _4array.decodeArrayCompact;\n}\njump[152] = _4array.decodeArray8;\njump[153] = _4array.decodeArray16;\njump[154] = _4array.decodeArray32;\njump[155] = _4array.decodeArray64;\njump[156] = invalidMinor;\njump[157] = invalidMinor;\njump[158] = invalidMinor;\njump[159] = _4array.decodeArrayIndefinite;\nfor (let i = 160; i <= 183; i++) {\n jump[i] = _5map.decodeMapCompact;\n}\njump[184] = _5map.decodeMap8;\njump[185] = _5map.decodeMap16;\njump[186] = _5map.decodeMap32;\njump[187] = _5map.decodeMap64;\njump[188] = invalidMinor;\njump[189] = invalidMinor;\njump[190] = invalidMinor;\njump[191] = _5map.decodeMapIndefinite;\nfor (let i = 192; i <= 215; i++) {\n jump[i] = _6tag.decodeTagCompact;\n}\njump[216] = _6tag.decodeTag8;\njump[217] = _6tag.decodeTag16;\njump[218] = _6tag.decodeTag32;\njump[219] = _6tag.decodeTag64;\njump[220] = invalidMinor;\njump[221] = invalidMinor;\njump[222] = invalidMinor;\njump[223] = invalidMinor;\nfor (let i = 224; i <= 243; i++) {\n jump[i] = errorer('simple values are not supported');\n}\njump[244] = invalidMinor;\njump[245] = invalidMinor;\njump[246] = invalidMinor;\njump[247] = _7float.decodeUndefined;\njump[248] = errorer('simple values are not supported');\njump[249] = _7float.decodeFloat16;\njump[250] = _7float.decodeFloat32;\njump[251] = _7float.decodeFloat64;\njump[252] = invalidMinor;\njump[253] = invalidMinor;\njump[254] = invalidMinor;\njump[255] = _7float.decodeBreak;\nconst quick = [];\nfor (let i = 0; i < 24; i++) {\n quick[i] = new token.Token(token.Type.uint, i, 1);\n}\nfor (let i = -1; i >= -24; i--) {\n quick[31 - i] = new token.Token(token.Type.negint, i, 1);\n}\nquick[64] = new token.Token(token.Type.bytes, new Uint8Array(0), 1);\nquick[96] = new token.Token(token.Type.string, '', 1);\nquick[128] = new token.Token(token.Type.array, 0, 1);\nquick[160] = new token.Token(token.Type.map, 0, 1);\nquick[244] = new token.Token(token.Type.false, false, 1);\nquick[245] = new token.Token(token.Type.true, true, 1);\nquick[246] = new token.Token(token.Type.null, null, 1);\nfunction quickEncodeToken(token$1) {\n switch (token$1.type) {\n case token.Type.false:\n return byteUtils.fromArray([244]);\n case token.Type.true:\n return byteUtils.fromArray([245]);\n case token.Type.null:\n return byteUtils.fromArray([246]);\n case token.Type.bytes:\n if (!token$1.value.length) {\n return byteUtils.fromArray([64]);\n }\n return;\n case token.Type.string:\n if (token$1.value === '') {\n return byteUtils.fromArray([96]);\n }\n return;\n case token.Type.array:\n if (token$1.value === 0) {\n return byteUtils.fromArray([128]);\n }\n return;\n case token.Type.map:\n if (token$1.value === 0) {\n return byteUtils.fromArray([160]);\n }\n return;\n case token.Type.uint:\n if (token$1.value < 24) {\n return byteUtils.fromArray([Number(token$1.value)]);\n }\n return;\n case token.Type.negint:\n if (token$1.value >= -24) {\n return byteUtils.fromArray([31 - Number(token$1.value)]);\n }\n }\n}\n\nexports.jump = jump;\nexports.quick = quick;\nexports.quickEncodeToken = quickEncodeToken;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nclass Type {\n constructor(major, name, terminal) {\n this.major = major;\n this.majorEncoded = major << 5;\n this.name = name;\n this.terminal = terminal;\n }\n toString() {\n return `Type[${ this.major }].${ this.name }`;\n }\n compare(typ) {\n return this.major < typ.major ? -1 : this.major > typ.major ? 1 : 0;\n }\n}\nType.uint = new Type(0, 'uint', true);\nType.negint = new Type(1, 'negint', true);\nType.bytes = new Type(2, 'bytes', true);\nType.string = new Type(3, 'string', true);\nType.array = new Type(4, 'array', false);\nType.map = new Type(5, 'map', false);\nType.tag = new Type(6, 'tag', false);\nType.float = new Type(7, 'float', true);\nType.false = new Type(7, 'false', true);\nType.true = new Type(7, 'true', true);\nType.null = new Type(7, 'null', true);\nType.undefined = new Type(7, 'undefined', true);\nType.break = new Type(7, 'break', true);\nclass Token {\n constructor(type, value, encodedLength) {\n this.type = type;\n this.value = value;\n this.encodedLength = encodedLength;\n this.encodedBytes = undefined;\n this.byteValue = undefined;\n }\n toString() {\n return `Token[${ this.type }].${ this.value }`;\n }\n}\n\nexports.Token = Token;\nexports.Type = Type;\n","module.exports = function (xs, fn) {\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n var x = fn(xs[i], i);\n if (isArray(x)) res.push.apply(res, x);\n else res.push(x);\n }\n return res;\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n","\"use strict\";\n/**\n * Returns a `Buffer` instance from the given data URI `uri`.\n *\n * @param {String} uri Data URI to turn into a Buffer instance\n * @return {Buffer} Buffer instance from Data URI\n * @api public\n */\nfunction dataUriToBuffer(uri) {\n if (!/^data:/i.test(uri)) {\n throw new TypeError('`uri` does not appear to be a Data URI (must begin with \"data:\")');\n }\n // strip newlines\n uri = uri.replace(/\\r?\\n/g, '');\n // split the URI up into the \"metadata\" and the \"data\" portions\n const firstComma = uri.indexOf(',');\n if (firstComma === -1 || firstComma <= 4) {\n throw new TypeError('malformed data: URI');\n }\n // remove the \"data:\" scheme and parse the metadata\n const meta = uri.substring(5, firstComma).split(';');\n let charset = '';\n let base64 = false;\n const type = meta[0] || 'text/plain';\n let typeFull = type;\n for (let i = 1; i < meta.length; i++) {\n if (meta[i] === 'base64') {\n base64 = true;\n }\n else {\n typeFull += `;${meta[i]}`;\n if (meta[i].indexOf('charset=') === 0) {\n charset = meta[i].substring(8);\n }\n }\n }\n // defaults to US-ASCII only if type is not provided\n if (!meta[0] && !charset.length) {\n typeFull += ';charset=US-ASCII';\n charset = 'US-ASCII';\n }\n // get the encoded data portion and decode URI-encoded chars\n const encoding = base64 ? 'base64' : 'ascii';\n const data = unescape(uri.substring(firstComma + 1));\n const buffer = Buffer.from(data, encoding);\n // set `.type` and `.typeFull` properties to MIME type\n buffer.type = type;\n buffer.typeFull = typeFull;\n // set the `.charset` property\n buffer.charset = charset;\n return buffer;\n}\nmodule.exports = dataUriToBuffer;\n//# sourceMappingURL=index.js.map","'use strict';\n\n/**\n * @typedef {{ [key: string]: any }} Extensions\n * @typedef {Error} Err\n * @property {string} message\n */\n\n/**\n *\n * @param {Error} obj\n * @param {Extensions} props\n * @returns {Error & Extensions}\n */\nfunction assign(obj, props) {\n for (const key in props) {\n Object.defineProperty(obj, key, {\n value: props[key],\n enumerable: true,\n configurable: true,\n });\n }\n\n return obj;\n}\n\n/**\n *\n * @param {any} err - An Error\n * @param {string|Extensions} code - A string code or props to set on the error\n * @param {Extensions} [props] - Props to set on the error\n * @returns {Error & Extensions}\n */\nfunction createError(err, code, props) {\n if (!err || typeof err === 'string') {\n throw new TypeError('Please pass an Error to err-code');\n }\n\n if (!props) {\n props = {};\n }\n\n if (typeof code === 'object') {\n props = code;\n code = '';\n }\n\n if (code) {\n props.code = code;\n }\n\n try {\n return assign(err, props);\n } catch (_) {\n props.message = err.message;\n props.stack = err.stack;\n\n const ErrClass = function () {};\n\n ErrClass.prototype = Object.create(Object.getPrototypeOf(err));\n\n // @ts-ignore\n const output = assign(new ErrClass(), props);\n\n return output;\n }\n}\n\nmodule.exports = createError;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar Path = require('path');\nvar fs = require('graceful-fs');\nvar util = require('util');\nvar glob = require('it-glob');\nvar errCode = require('err-code');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar Path__default = /*#__PURE__*/_interopDefaultLegacy(Path);\nvar fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);\nvar glob__default = /*#__PURE__*/_interopDefaultLegacy(glob);\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\n\nconst fsStat = util.promisify(fs__default[\"default\"].stat);\nasync function getFilesFromPath(paths, options) {\n const files = [];\n for await (const file of filesFromPath(paths, options)) {\n files.push(file);\n }\n return files;\n}\nasync function* filesFromPath(paths, options) {\n options = options || {};\n if (typeof paths === 'string') {\n paths = [paths];\n }\n const globSourceOptions = {\n recursive: true,\n glob: {\n dot: Boolean(options.hidden),\n ignore: Array.isArray(options.ignore) ? options.ignore : [],\n follow: options.followSymlinks != null ? options.followSymlinks : true\n }\n };\n for await (const path of paths) {\n if (typeof path !== 'string') {\n throw errCode__default[\"default\"](new Error('Path must be a string'), 'ERR_INVALID_PATH', { path });\n }\n const absolutePath = Path__default[\"default\"].resolve(process.cwd(), path);\n const stat = await fsStat(absolutePath);\n const prefix = options.pathPrefix || Path__default[\"default\"].dirname(absolutePath);\n let mode = options.mode;\n if (options.preserveMode) {\n mode = stat.mode;\n }\n let mtime = options.mtime;\n if (options.preserveMtime) {\n mtime = stat.mtime;\n }\n yield* toGlobSource({\n path,\n type: stat.isDirectory() ? 'dir' : 'file',\n prefix,\n mode,\n mtime,\n size: stat.size,\n preserveMode: options.preserveMode,\n preserveMtime: options.preserveMtime\n }, globSourceOptions);\n }\n}\nasync function* toGlobSource({path, type, prefix, mode, mtime, size, preserveMode, preserveMtime}, options) {\n options = options || {};\n const baseName = Path__default[\"default\"].basename(path);\n if (type === 'file') {\n yield {\n name: `/${ baseName.replace(prefix, '') }`,\n stream: () => fs__default[\"default\"].createReadStream(Path__default[\"default\"].isAbsolute(path) ? path : Path__default[\"default\"].join(process.cwd(), path)),\n mode,\n mtime,\n size\n };\n return;\n }\n const globOptions = Object.assign({}, options.glob, {\n cwd: path,\n nodir: false,\n realpath: false,\n absolute: true\n });\n for await (const p of glob__default[\"default\"](path, '**/*', globOptions)) {\n const stat = await fsStat(p);\n if (!stat.isFile()) {\n continue;\n }\n if (preserveMode || preserveMtime) {\n if (preserveMode) {\n mode = stat.mode;\n }\n if (preserveMtime) {\n mtime = stat.mtime;\n }\n }\n yield {\n name: toPosix(p.replace(prefix, '')),\n stream: () => fs__default[\"default\"].createReadStream(p),\n mode,\n mtime,\n size: stat.size\n };\n }\n}\nconst toPosix = path => path.replace(/\\\\/g, '/');\n\nexports.filesFromPath = filesFromPath;\nexports.getFilesFromPath = getFilesFromPath;\n","'use strict'\n\nmodule.exports = clone\n\nvar getPrototypeOf = Object.getPrototypeOf || function (obj) {\n return obj.__proto__\n}\n\nfunction clone (obj) {\n if (obj === null || typeof obj !== 'object')\n return obj\n\n if (obj instanceof Object)\n var copy = { __proto__: getPrototypeOf(obj) }\n else\n var copy = Object.create(null)\n\n Object.getOwnPropertyNames(obj).forEach(function (key) {\n Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))\n })\n\n return copy\n}\n","var fs = require('fs')\nvar polyfills = require('./polyfills.js')\nvar legacy = require('./legacy-streams.js')\nvar clone = require('./clone.js')\n\nvar util = require('util')\n\n/* istanbul ignore next - node 0.x polyfill */\nvar gracefulQueue\nvar previousSymbol\n\n/* istanbul ignore else - node 0.x polyfill */\nif (typeof Symbol === 'function' && typeof Symbol.for === 'function') {\n gracefulQueue = Symbol.for('graceful-fs.queue')\n // This is used in testing by future versions\n previousSymbol = Symbol.for('graceful-fs.previous')\n} else {\n gracefulQueue = '___graceful-fs.queue'\n previousSymbol = '___graceful-fs.previous'\n}\n\nfunction noop () {}\n\nfunction publishQueue(context, queue) {\n Object.defineProperty(context, gracefulQueue, {\n get: function() {\n return queue\n }\n })\n}\n\nvar debug = noop\nif (util.debuglog)\n debug = util.debuglog('gfs4')\nelse if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || ''))\n debug = function() {\n var m = util.format.apply(util, arguments)\n m = 'GFS4: ' + m.split(/\\n/).join('\\nGFS4: ')\n console.error(m)\n }\n\n// Once time initialization\nif (!fs[gracefulQueue]) {\n // This queue can be shared by multiple loaded instances\n var queue = global[gracefulQueue] || []\n publishQueue(fs, queue)\n\n // Patch fs.close/closeSync to shared queue version, because we need\n // to retry() whenever a close happens *anywhere* in the program.\n // This is essential when multiple graceful-fs instances are\n // in play at the same time.\n fs.close = (function (fs$close) {\n function close (fd, cb) {\n return fs$close.call(fs, fd, function (err) {\n // This function uses the graceful-fs shared queue\n if (!err) {\n resetQueue()\n }\n\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n })\n }\n\n Object.defineProperty(close, previousSymbol, {\n value: fs$close\n })\n return close\n })(fs.close)\n\n fs.closeSync = (function (fs$closeSync) {\n function closeSync (fd) {\n // This function uses the graceful-fs shared queue\n fs$closeSync.apply(fs, arguments)\n resetQueue()\n }\n\n Object.defineProperty(closeSync, previousSymbol, {\n value: fs$closeSync\n })\n return closeSync\n })(fs.closeSync)\n\n if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || '')) {\n process.on('exit', function() {\n debug(fs[gracefulQueue])\n require('assert').equal(fs[gracefulQueue].length, 0)\n })\n }\n}\n\nif (!global[gracefulQueue]) {\n publishQueue(global, fs[gracefulQueue]);\n}\n\nmodule.exports = patch(clone(fs))\nif (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {\n module.exports = patch(fs)\n fs.__patched = true;\n}\n\nfunction patch (fs) {\n // Everything that references the open() function needs to be in here\n polyfills(fs)\n fs.gracefulify = patch\n\n fs.createReadStream = createReadStream\n fs.createWriteStream = createWriteStream\n var fs$readFile = fs.readFile\n fs.readFile = readFile\n function readFile (path, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$readFile(path, options, cb)\n\n function go$readFile (path, options, cb, startTime) {\n return fs$readFile(path, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$writeFile = fs.writeFile\n fs.writeFile = writeFile\n function writeFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$writeFile(path, data, options, cb)\n\n function go$writeFile (path, data, options, cb, startTime) {\n return fs$writeFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$appendFile = fs.appendFile\n if (fs$appendFile)\n fs.appendFile = appendFile\n function appendFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$appendFile(path, data, options, cb)\n\n function go$appendFile (path, data, options, cb, startTime) {\n return fs$appendFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$copyFile = fs.copyFile\n if (fs$copyFile)\n fs.copyFile = copyFile\n function copyFile (src, dest, flags, cb) {\n if (typeof flags === 'function') {\n cb = flags\n flags = 0\n }\n return go$copyFile(src, dest, flags, cb)\n\n function go$copyFile (src, dest, flags, cb, startTime) {\n return fs$copyFile(src, dest, flags, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$readdir = fs.readdir\n fs.readdir = readdir\n var noReaddirOptionVersions = /^v[0-5]\\./\n function readdir (path, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n var go$readdir = noReaddirOptionVersions.test(process.version)\n ? function go$readdir (path, options, cb, startTime) {\n return fs$readdir(path, fs$readdirCallback(\n path, options, cb, startTime\n ))\n }\n : function go$readdir (path, options, cb, startTime) {\n return fs$readdir(path, options, fs$readdirCallback(\n path, options, cb, startTime\n ))\n }\n\n return go$readdir(path, options, cb)\n\n function fs$readdirCallback (path, options, cb, startTime) {\n return function (err, files) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([\n go$readdir,\n [path, options, cb],\n err,\n startTime || Date.now(),\n Date.now()\n ])\n else {\n if (files && files.sort)\n files.sort()\n\n if (typeof cb === 'function')\n cb.call(this, err, files)\n }\n }\n }\n }\n\n if (process.version.substr(0, 4) === 'v0.8') {\n var legStreams = legacy(fs)\n ReadStream = legStreams.ReadStream\n WriteStream = legStreams.WriteStream\n }\n\n var fs$ReadStream = fs.ReadStream\n if (fs$ReadStream) {\n ReadStream.prototype = Object.create(fs$ReadStream.prototype)\n ReadStream.prototype.open = ReadStream$open\n }\n\n var fs$WriteStream = fs.WriteStream\n if (fs$WriteStream) {\n WriteStream.prototype = Object.create(fs$WriteStream.prototype)\n WriteStream.prototype.open = WriteStream$open\n }\n\n Object.defineProperty(fs, 'ReadStream', {\n get: function () {\n return ReadStream\n },\n set: function (val) {\n ReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n Object.defineProperty(fs, 'WriteStream', {\n get: function () {\n return WriteStream\n },\n set: function (val) {\n WriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n // legacy names\n var FileReadStream = ReadStream\n Object.defineProperty(fs, 'FileReadStream', {\n get: function () {\n return FileReadStream\n },\n set: function (val) {\n FileReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n var FileWriteStream = WriteStream\n Object.defineProperty(fs, 'FileWriteStream', {\n get: function () {\n return FileWriteStream\n },\n set: function (val) {\n FileWriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n function ReadStream (path, options) {\n if (this instanceof ReadStream)\n return fs$ReadStream.apply(this, arguments), this\n else\n return ReadStream.apply(Object.create(ReadStream.prototype), arguments)\n }\n\n function ReadStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n if (that.autoClose)\n that.destroy()\n\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n that.read()\n }\n })\n }\n\n function WriteStream (path, options) {\n if (this instanceof WriteStream)\n return fs$WriteStream.apply(this, arguments), this\n else\n return WriteStream.apply(Object.create(WriteStream.prototype), arguments)\n }\n\n function WriteStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n that.destroy()\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n }\n })\n }\n\n function createReadStream (path, options) {\n return new fs.ReadStream(path, options)\n }\n\n function createWriteStream (path, options) {\n return new fs.WriteStream(path, options)\n }\n\n var fs$open = fs.open\n fs.open = open\n function open (path, flags, mode, cb) {\n if (typeof mode === 'function')\n cb = mode, mode = null\n\n return go$open(path, flags, mode, cb)\n\n function go$open (path, flags, mode, cb, startTime) {\n return fs$open(path, flags, mode, function (err, fd) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n return fs\n}\n\nfunction enqueue (elem) {\n debug('ENQUEUE', elem[0].name, elem[1])\n fs[gracefulQueue].push(elem)\n retry()\n}\n\n// keep track of the timeout between retry() calls\nvar retryTimer\n\n// reset the startTime and lastTime to now\n// this resets the start of the 60 second overall timeout as well as the\n// delay between attempts so that we'll retry these jobs sooner\nfunction resetQueue () {\n var now = Date.now()\n for (var i = 0; i < fs[gracefulQueue].length; ++i) {\n // entries that are only a length of 2 are from an older version, don't\n // bother modifying those since they'll be retried anyway.\n if (fs[gracefulQueue][i].length > 2) {\n fs[gracefulQueue][i][3] = now // startTime\n fs[gracefulQueue][i][4] = now // lastTime\n }\n }\n // call retry to make sure we're actively processing the queue\n retry()\n}\n\nfunction retry () {\n // clear the timer and remove it to help prevent unintended concurrency\n clearTimeout(retryTimer)\n retryTimer = undefined\n\n if (fs[gracefulQueue].length === 0)\n return\n\n var elem = fs[gracefulQueue].shift()\n var fn = elem[0]\n var args = elem[1]\n // these items may be unset if they were added by an older graceful-fs\n var err = elem[2]\n var startTime = elem[3]\n var lastTime = elem[4]\n\n // if we don't have a startTime we have no way of knowing if we've waited\n // long enough, so go ahead and retry this item now\n if (startTime === undefined) {\n debug('RETRY', fn.name, args)\n fn.apply(null, args)\n } else if (Date.now() - startTime >= 60000) {\n // it's been more than 60 seconds total, bail now\n debug('TIMEOUT', fn.name, args)\n var cb = args.pop()\n if (typeof cb === 'function')\n cb.call(null, err)\n } else {\n // the amount of time between the last attempt and right now\n var sinceAttempt = Date.now() - lastTime\n // the amount of time between when we first tried, and when we last tried\n // rounded up to at least 1\n var sinceStart = Math.max(lastTime - startTime, 1)\n // backoff. wait longer than the total time we've been retrying, but only\n // up to a maximum of 100ms\n var desiredDelay = Math.min(sinceStart * 1.2, 100)\n // it's been long enough since the last retry, do it again\n if (sinceAttempt >= desiredDelay) {\n debug('RETRY', fn.name, args)\n fn.apply(null, args.concat([startTime]))\n } else {\n // if we can't do this job yet, push it to the end of the queue\n // and let the next iteration check again\n fs[gracefulQueue].push(elem)\n }\n }\n\n // schedule our next run if one isn't already scheduled\n if (retryTimer === undefined) {\n retryTimer = setTimeout(retry, 0)\n }\n}\n","var Stream = require('stream').Stream\n\nmodule.exports = legacy\n\nfunction legacy (fs) {\n return {\n ReadStream: ReadStream,\n WriteStream: WriteStream\n }\n\n function ReadStream (path, options) {\n if (!(this instanceof ReadStream)) return new ReadStream(path, options);\n\n Stream.call(this);\n\n var self = this;\n\n this.path = path;\n this.fd = null;\n this.readable = true;\n this.paused = false;\n\n this.flags = 'r';\n this.mode = 438; /*=0666*/\n this.bufferSize = 64 * 1024;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.encoding) this.setEncoding(this.encoding);\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.end === undefined) {\n this.end = Infinity;\n } else if ('number' !== typeof this.end) {\n throw TypeError('end must be a Number');\n }\n\n if (this.start > this.end) {\n throw new Error('start must be <= end');\n }\n\n this.pos = this.start;\n }\n\n if (this.fd !== null) {\n process.nextTick(function() {\n self._read();\n });\n return;\n }\n\n fs.open(this.path, this.flags, this.mode, function (err, fd) {\n if (err) {\n self.emit('error', err);\n self.readable = false;\n return;\n }\n\n self.fd = fd;\n self.emit('open', fd);\n self._read();\n })\n }\n\n function WriteStream (path, options) {\n if (!(this instanceof WriteStream)) return new WriteStream(path, options);\n\n Stream.call(this);\n\n this.path = path;\n this.fd = null;\n this.writable = true;\n\n this.flags = 'w';\n this.encoding = 'binary';\n this.mode = 438; /*=0666*/\n this.bytesWritten = 0;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.start < 0) {\n throw new Error('start must be >= zero');\n }\n\n this.pos = this.start;\n }\n\n this.busy = false;\n this._queue = [];\n\n if (this.fd === null) {\n this._open = fs.open;\n this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);\n this.flush();\n }\n }\n}\n","var constants = require('constants')\n\nvar origCwd = process.cwd\nvar cwd = null\n\nvar platform = process.env.GRACEFUL_FS_PLATFORM || process.platform\n\nprocess.cwd = function() {\n if (!cwd)\n cwd = origCwd.call(process)\n return cwd\n}\ntry {\n process.cwd()\n} catch (er) {}\n\n// This check is needed until node.js 12 is required\nif (typeof process.chdir === 'function') {\n var chdir = process.chdir\n process.chdir = function (d) {\n cwd = null\n chdir.call(process, d)\n }\n if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir)\n}\n\nmodule.exports = patch\n\nfunction patch (fs) {\n // (re-)implement some things that are known busted or missing.\n\n // lchmod, broken prior to 0.6.2\n // back-port the fix here.\n if (constants.hasOwnProperty('O_SYMLINK') &&\n process.version.match(/^v0\\.6\\.[0-2]|^v0\\.5\\./)) {\n patchLchmod(fs)\n }\n\n // lutimes implementation, or no-op\n if (!fs.lutimes) {\n patchLutimes(fs)\n }\n\n // https://github.com/isaacs/node-graceful-fs/issues/4\n // Chown should not fail on einval or eperm if non-root.\n // It should not fail on enosys ever, as this just indicates\n // that a fs doesn't support the intended operation.\n\n fs.chown = chownFix(fs.chown)\n fs.fchown = chownFix(fs.fchown)\n fs.lchown = chownFix(fs.lchown)\n\n fs.chmod = chmodFix(fs.chmod)\n fs.fchmod = chmodFix(fs.fchmod)\n fs.lchmod = chmodFix(fs.lchmod)\n\n fs.chownSync = chownFixSync(fs.chownSync)\n fs.fchownSync = chownFixSync(fs.fchownSync)\n fs.lchownSync = chownFixSync(fs.lchownSync)\n\n fs.chmodSync = chmodFixSync(fs.chmodSync)\n fs.fchmodSync = chmodFixSync(fs.fchmodSync)\n fs.lchmodSync = chmodFixSync(fs.lchmodSync)\n\n fs.stat = statFix(fs.stat)\n fs.fstat = statFix(fs.fstat)\n fs.lstat = statFix(fs.lstat)\n\n fs.statSync = statFixSync(fs.statSync)\n fs.fstatSync = statFixSync(fs.fstatSync)\n fs.lstatSync = statFixSync(fs.lstatSync)\n\n // if lchmod/lchown do not exist, then make them no-ops\n if (fs.chmod && !fs.lchmod) {\n fs.lchmod = function (path, mode, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchmodSync = function () {}\n }\n if (fs.chown && !fs.lchown) {\n fs.lchown = function (path, uid, gid, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchownSync = function () {}\n }\n\n // on Windows, A/V software can lock the directory, causing this\n // to fail with an EACCES or EPERM if the directory contains newly\n // created files. Try again on failure, for up to 60 seconds.\n\n // Set the timeout this long because some Windows Anti-Virus, such as Parity\n // bit9, may lock files for up to a minute, causing npm package install\n // failures. Also, take care to yield the scheduler. Windows scheduling gives\n // CPU to a busy looping process, which can cause the program causing the lock\n // contention to be starved of CPU by node, so the contention doesn't resolve.\n if (platform === \"win32\") {\n fs.rename = typeof fs.rename !== 'function' ? fs.rename\n : (function (fs$rename) {\n function rename (from, to, cb) {\n var start = Date.now()\n var backoff = 0;\n fs$rename(from, to, function CB (er) {\n if (er\n && (er.code === \"EACCES\" || er.code === \"EPERM\")\n && Date.now() - start < 60000) {\n setTimeout(function() {\n fs.stat(to, function (stater, st) {\n if (stater && stater.code === \"ENOENT\")\n fs$rename(from, to, CB);\n else\n cb(er)\n })\n }, backoff)\n if (backoff < 100)\n backoff += 10;\n return;\n }\n if (cb) cb(er)\n })\n }\n if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename)\n return rename\n })(fs.rename)\n }\n\n // if read() returns EAGAIN, then just try it again.\n fs.read = typeof fs.read !== 'function' ? fs.read\n : (function (fs$read) {\n function read (fd, buffer, offset, length, position, callback_) {\n var callback\n if (callback_ && typeof callback_ === 'function') {\n var eagCounter = 0\n callback = function (er, _, __) {\n if (er && er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n callback_.apply(this, arguments)\n }\n }\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n\n // This ensures `util.promisify` works as it does for native `fs.read`.\n if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read)\n return read\n })(fs.read)\n\n fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync\n : (function (fs$readSync) { return function (fd, buffer, offset, length, position) {\n var eagCounter = 0\n while (true) {\n try {\n return fs$readSync.call(fs, fd, buffer, offset, length, position)\n } catch (er) {\n if (er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n continue\n }\n throw er\n }\n }\n }})(fs.readSync)\n\n function patchLchmod (fs) {\n fs.lchmod = function (path, mode, callback) {\n fs.open( path\n , constants.O_WRONLY | constants.O_SYMLINK\n , mode\n , function (err, fd) {\n if (err) {\n if (callback) callback(err)\n return\n }\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n fs.fchmod(fd, mode, function (err) {\n fs.close(fd, function(err2) {\n if (callback) callback(err || err2)\n })\n })\n })\n }\n\n fs.lchmodSync = function (path, mode) {\n var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)\n\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n var threw = true\n var ret\n try {\n ret = fs.fchmodSync(fd, mode)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n }\n\n function patchLutimes (fs) {\n if (constants.hasOwnProperty(\"O_SYMLINK\") && fs.futimes) {\n fs.lutimes = function (path, at, mt, cb) {\n fs.open(path, constants.O_SYMLINK, function (er, fd) {\n if (er) {\n if (cb) cb(er)\n return\n }\n fs.futimes(fd, at, mt, function (er) {\n fs.close(fd, function (er2) {\n if (cb) cb(er || er2)\n })\n })\n })\n }\n\n fs.lutimesSync = function (path, at, mt) {\n var fd = fs.openSync(path, constants.O_SYMLINK)\n var ret\n var threw = true\n try {\n ret = fs.futimesSync(fd, at, mt)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n\n } else if (fs.futimes) {\n fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }\n fs.lutimesSync = function () {}\n }\n }\n\n function chmodFix (orig) {\n if (!orig) return orig\n return function (target, mode, cb) {\n return orig.call(fs, target, mode, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chmodFixSync (orig) {\n if (!orig) return orig\n return function (target, mode) {\n try {\n return orig.call(fs, target, mode)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n\n function chownFix (orig) {\n if (!orig) return orig\n return function (target, uid, gid, cb) {\n return orig.call(fs, target, uid, gid, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chownFixSync (orig) {\n if (!orig) return orig\n return function (target, uid, gid) {\n try {\n return orig.call(fs, target, uid, gid)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n function statFix (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = null\n }\n function callback (er, stats) {\n if (stats) {\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n }\n if (cb) cb.apply(this, arguments)\n }\n return options ? orig.call(fs, target, options, callback)\n : orig.call(fs, target, callback)\n }\n }\n\n function statFixSync (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options) {\n var stats = options ? orig.call(fs, target, options)\n : orig.call(fs, target)\n if (stats) {\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n }\n return stats;\n }\n }\n\n // ENOSYS means that the fs doesn't support the op. Just ignore\n // that, because it doesn't matter.\n //\n // if there's no getuid, or if getuid() is something other\n // than 0, and the error is EINVAL or EPERM, then just ignore\n // it.\n //\n // This specific case is a silent failure in cp, install, tar,\n // and most other unix tools that manage permissions.\n //\n // When running as root, or if other types of errors are\n // encountered, then it's strict.\n function chownErOk (er) {\n if (!er)\n return true\n\n if (er.code === \"ENOSYS\")\n return true\n\n var nonroot = !process.getuid || process.getuid() !== 0\n if (nonroot) {\n if (er.code === \"EINVAL\" || er.code === \"EPERM\")\n return true\n }\n\n return false\n }\n}\n","'use strict'\n\n// @ts-ignore\nconst SparseArray = require('sparse-array')\nconst { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')\n\n/**\n * @typedef {import('./consumable-hash').InfiniteHash} InfiniteHash\n * @typedef {import('../').UserBucketOptions} UserBucketOptions\n */\n\n/**\n * @template V\n * @typedef {object} BucketChild\n * @property {string} key\n * @property {V} value\n * @property {InfiniteHash} hash\n */\n\n/**\n * @template B\n *\n * @typedef {object} SA\n * @property {number} length\n * @property {() => B[]} compactArray\n * @property {(i: number) => B} get\n * @property {(i: number, value: B) => void} set\n * @property { (fn: (acc: A, curr: B, index: number) => A, initial: A) => B} reduce\n * @property {(fn: (item: B) => boolean) => B | undefined} find\n * @property {() => number[]} bitField\n * @property {(i: number) => void} unset\n */\n\n/**\n * @template T\n *\n * @typedef {object} BucketPosition\n * @property {Bucket} bucket\n * @property {number} pos\n * @property {InfiniteHash} hash\n * @property {BucketChild} [existingChild]\n */\n\n/**\n * @typedef {object} BucketOptions\n * @property {number} bits\n * @property {(value: Uint8Array | InfiniteHash) => InfiniteHash} hash\n */\n\n/**\n * @template T\n */\nclass Bucket {\n /**\n * @param {BucketOptions} options\n * @param {Bucket} [parent]\n * @param {number} [posAtParent=0]\n */\n constructor (options, parent, posAtParent = 0) {\n this._options = options\n this._popCount = 0\n this._parent = parent\n this._posAtParent = posAtParent\n\n /** @type {SA | BucketChild>} */\n this._children = new SparseArray()\n\n /** @type {string | null} */\n this.key = null\n }\n\n /**\n * @param {string} key\n * @param {T} value\n */\n async put (key, value) {\n const place = await this._findNewBucketAndPos(key)\n\n await place.bucket._putAt(place, key, value)\n }\n\n /**\n * @param {string} key\n */\n async get (key) {\n const child = await this._findChild(key)\n\n if (child) {\n return child.value\n }\n }\n\n /**\n * @param {string} key\n */\n async del (key) {\n const place = await this._findPlace(key)\n const child = place.bucket._at(place.pos)\n\n if (child && child.key === key) {\n place.bucket._delAt(place.pos)\n }\n }\n\n /**\n * @returns {number}\n */\n leafCount () {\n const children = this._children.compactArray()\n\n return children.reduce((acc, child) => {\n if (child instanceof Bucket) {\n return acc + child.leafCount()\n }\n\n return acc + 1\n }, 0)\n }\n\n childrenCount () {\n return this._children.length\n }\n\n onlyChild () {\n return this._children.get(0)\n }\n\n /**\n * @returns {Iterable>}\n */\n * eachLeafSeries () {\n const children = this._children.compactArray()\n\n for (const child of children) {\n if (child instanceof Bucket) {\n yield * child.eachLeafSeries()\n } else {\n yield child\n }\n }\n\n // this is necessary because tsc requires a @return annotation as it\n // can't derive a return type due to the recursion, and eslint requires\n // a return statement when there is a @return annotation\n return []\n }\n\n /**\n * @param {(value: BucketChild, index: number) => T} map\n * @param {(reduced: any) => any} reduce\n */\n serialize (map, reduce) {\n /** @type {T[]} */\n const acc = []\n // serialize to a custom non-sparse representation\n return reduce(this._children.reduce((acc, child, index) => {\n if (child) {\n if (child instanceof Bucket) {\n acc.push(child.serialize(map, reduce))\n } else {\n acc.push(map(child, index))\n }\n }\n return acc\n }, acc))\n }\n\n /**\n * @param {(value: BucketChild) => Promise} asyncMap\n * @param {(reduced: any) => Promise} asyncReduce\n */\n asyncTransform (asyncMap, asyncReduce) {\n return asyncTransformBucket(this, asyncMap, asyncReduce)\n }\n\n toJSON () {\n return this.serialize(mapNode, reduceNodes)\n }\n\n prettyPrint () {\n return JSON.stringify(this.toJSON(), null, ' ')\n }\n\n tableSize () {\n return Math.pow(2, this._options.bits)\n }\n\n /**\n * @param {string} key\n * @returns {Promise | undefined>}\n */\n async _findChild (key) {\n const result = await this._findPlace(key)\n const child = result.bucket._at(result.pos)\n\n if (child instanceof Bucket) {\n // should not be possible, this._findPlace should always\n // return a location for a child, not a bucket\n return undefined\n }\n\n if (child && child.key === key) {\n return child\n }\n }\n\n /**\n * @param {string | InfiniteHash} key\n * @returns {Promise>}\n */\n async _findPlace (key) {\n const hashValue = this._options.hash(typeof key === 'string' ? uint8ArrayFromString(key) : key)\n const index = await hashValue.take(this._options.bits)\n\n const child = this._children.get(index)\n\n if (child instanceof Bucket) {\n return child._findPlace(hashValue)\n }\n\n return {\n bucket: this,\n pos: index,\n hash: hashValue,\n existingChild: child\n }\n }\n\n /**\n * @param {string | InfiniteHash} key\n * @returns {Promise>}\n */\n async _findNewBucketAndPos (key) {\n const place = await this._findPlace(key)\n\n if (place.existingChild && place.existingChild.key !== key) {\n // conflict\n const bucket = new Bucket(this._options, place.bucket, place.pos)\n place.bucket._putObjectAt(place.pos, bucket)\n\n // put the previous value\n const newPlace = await bucket._findPlace(place.existingChild.hash)\n newPlace.bucket._putAt(newPlace, place.existingChild.key, place.existingChild.value)\n\n return bucket._findNewBucketAndPos(place.hash)\n }\n\n // no conflict, we found the place\n return place\n }\n\n /**\n * @param {BucketPosition} place\n * @param {string} key\n * @param {T} value\n */\n _putAt (place, key, value) {\n this._putObjectAt(place.pos, {\n key: key,\n value: value,\n hash: place.hash\n })\n }\n\n /**\n * @param {number} pos\n * @param {Bucket | BucketChild} object\n */\n _putObjectAt (pos, object) {\n if (!this._children.get(pos)) {\n this._popCount++\n }\n this._children.set(pos, object)\n }\n\n /**\n * @param {number} pos\n */\n _delAt (pos) {\n if (pos === -1) {\n throw new Error('Invalid position')\n }\n\n if (this._children.get(pos)) {\n this._popCount--\n }\n this._children.unset(pos)\n this._level()\n }\n\n _level () {\n if (this._parent && this._popCount <= 1) {\n if (this._popCount === 1) {\n // remove myself from parent, replacing me with my only child\n const onlyChild = this._children.find(exists)\n\n if (onlyChild && !(onlyChild instanceof Bucket)) {\n const hash = onlyChild.hash\n hash.untake(this._options.bits)\n const place = {\n pos: this._posAtParent,\n hash: hash,\n bucket: this._parent\n }\n this._parent._putAt(place, onlyChild.key, onlyChild.value)\n }\n } else {\n this._parent._delAt(this._posAtParent)\n }\n }\n }\n\n /**\n * @param {number} index\n * @returns {BucketChild | Bucket | undefined}\n */\n _at (index) {\n return this._children.get(index)\n }\n}\n\n/**\n * @param {any} o\n */\nfunction exists (o) {\n return Boolean(o)\n}\n\n/**\n *\n * @param {*} node\n * @param {number} index\n */\nfunction mapNode (node, index) {\n return node.key\n}\n\n/**\n * @param {*} nodes\n */\nfunction reduceNodes (nodes) {\n return nodes\n}\n\n/**\n * @template T\n *\n * @param {Bucket} bucket\n * @param {(value: BucketChild) => Promise} asyncMap\n * @param {(reduced: any) => Promise} asyncReduce\n */\nasync function asyncTransformBucket (bucket, asyncMap, asyncReduce) {\n const output = []\n\n for (const child of bucket._children.compactArray()) {\n if (child instanceof Bucket) {\n await asyncTransformBucket(child, asyncMap, asyncReduce)\n } else {\n const mappedChildren = await asyncMap(child)\n\n output.push({\n bitField: bucket._children.bitField(),\n children: mappedChildren\n })\n }\n }\n\n return asyncReduce(output)\n}\n\nmodule.exports = Bucket\n","'use strict'\n\nconst START_MASKS = [\n 0b11111111,\n 0b11111110,\n 0b11111100,\n 0b11111000,\n 0b11110000,\n 0b11100000,\n 0b11000000,\n 0b10000000\n]\n\nconst STOP_MASKS = [\n 0b00000001,\n 0b00000011,\n 0b00000111,\n 0b00001111,\n 0b00011111,\n 0b00111111,\n 0b01111111,\n 0b11111111\n]\n\nmodule.exports = class ConsumableBuffer {\n /**\n * @param {Uint8Array} value\n */\n constructor (value) {\n this._value = value\n this._currentBytePos = value.length - 1\n this._currentBitPos = 7\n }\n\n availableBits () {\n return this._currentBitPos + 1 + this._currentBytePos * 8\n }\n\n totalBits () {\n return this._value.length * 8\n }\n\n /**\n * @param {number} bits\n */\n take (bits) {\n let pendingBits = bits\n let result = 0\n while (pendingBits && this._haveBits()) {\n const byte = this._value[this._currentBytePos]\n const availableBits = this._currentBitPos + 1\n const taking = Math.min(availableBits, pendingBits)\n const value = byteBitsToInt(byte, availableBits - taking, taking)\n result = (result << taking) + value\n\n pendingBits -= taking\n\n this._currentBitPos -= taking\n if (this._currentBitPos < 0) {\n this._currentBitPos = 7\n this._currentBytePos--\n }\n }\n\n return result\n }\n\n /**\n * @param {number} bits\n */\n untake (bits) {\n this._currentBitPos += bits\n while (this._currentBitPos > 7) {\n this._currentBitPos -= 8\n this._currentBytePos += 1\n }\n }\n\n _haveBits () {\n return this._currentBytePos >= 0\n }\n}\n\n/**\n * @param {number} byte\n * @param {number} start\n * @param {number} length\n */\nfunction byteBitsToInt (byte, start, length) {\n const mask = maskFor(start, length)\n return (byte & mask) >>> start\n}\n\n/**\n * @param {number} start\n * @param {number} length\n */\nfunction maskFor (start, length) {\n return START_MASKS[start] & STOP_MASKS[Math.min(length + start - 1, 7)]\n}\n","'use strict'\n\nconst ConsumableBuffer = require('./consumable-buffer')\nconst { concat: uint8ArrayConcat } = require('uint8arrays/concat')\n\n/**\n * @param {(value: Uint8Array) => Promise} hashFn\n */\nfunction wrapHash (hashFn) {\n /**\n * @param {InfiniteHash | Uint8Array} value\n */\n function hashing (value) {\n if (value instanceof InfiniteHash) {\n // already a hash. return it\n return value\n } else {\n return new InfiniteHash(value, hashFn)\n }\n }\n\n return hashing\n}\n\nclass InfiniteHash {\n /**\n *\n * @param {Uint8Array} value\n * @param {(value: Uint8Array) => Promise} hashFn\n */\n constructor (value, hashFn) {\n if (!(value instanceof Uint8Array)) {\n throw new Error('can only hash Uint8Arrays')\n }\n\n this._value = value\n this._hashFn = hashFn\n this._depth = -1\n this._availableBits = 0\n this._currentBufferIndex = 0\n\n /** @type {ConsumableBuffer[]} */\n this._buffers = []\n }\n\n /**\n * @param {number} bits\n */\n async take (bits) {\n let pendingBits = bits\n\n while (this._availableBits < pendingBits) {\n await this._produceMoreBits()\n }\n\n let result = 0\n\n while (pendingBits > 0) {\n const hash = this._buffers[this._currentBufferIndex]\n const available = Math.min(hash.availableBits(), pendingBits)\n const took = hash.take(available)\n result = (result << available) + took\n pendingBits -= available\n this._availableBits -= available\n\n if (hash.availableBits() === 0) {\n this._currentBufferIndex++\n }\n }\n\n return result\n }\n\n /**\n * @param {number} bits\n */\n untake (bits) {\n let pendingBits = bits\n\n while (pendingBits > 0) {\n const hash = this._buffers[this._currentBufferIndex]\n const availableForUntake = Math.min(hash.totalBits() - hash.availableBits(), pendingBits)\n hash.untake(availableForUntake)\n pendingBits -= availableForUntake\n this._availableBits += availableForUntake\n\n if (this._currentBufferIndex > 0 && hash.totalBits() === hash.availableBits()) {\n this._depth--\n this._currentBufferIndex--\n }\n }\n }\n\n async _produceMoreBits () {\n this._depth++\n\n const value = this._depth ? uint8ArrayConcat([this._value, Uint8Array.from([this._depth])]) : this._value\n const hashValue = await this._hashFn(value)\n const buffer = new ConsumableBuffer(hashValue)\n\n this._buffers.push(buffer)\n this._availableBits += buffer.availableBits()\n }\n}\n\nmodule.exports = wrapHash\nmodule.exports.InfiniteHash = InfiniteHash\n","'use strict'\n\nconst Bucket = require('./bucket')\nconst wrapHash = require('./consumable-hash')\n\n/**\n * @typedef {object} UserBucketOptions\n * @property {(value: Uint8Array) => Promise} hashFn\n * @property {number} [bits=8]\n */\n\n/**\n * @param {UserBucketOptions} options\n */\nfunction createHAMT (options) {\n if (!options || !options.hashFn) {\n throw new Error('please define an options.hashFn')\n }\n\n const bucketOptions = {\n bits: options.bits || 8,\n hash: wrapHash(options.hashFn)\n }\n\n return new Bucket(bucketOptions)\n}\n\nmodule.exports = {\n createHAMT,\n Bucket\n}\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FsBlockStore = void 0;\nconst fs_1 = __importDefault(require(\"fs\"));\nconst os_1 = __importDefault(require(\"os\"));\nconst multiformats_1 = require(\"multiformats\");\nconst blockstore_core_1 = require(\"blockstore-core\");\nclass FsBlockStore extends blockstore_core_1.BaseBlockstore {\n constructor() {\n super();\n this.path = `${os_1.default.tmpdir()}/${(parseInt(String(Math.random() * 1e9), 10)).toString() + Date.now()}`;\n this._opened = false;\n }\n async _open() {\n if (this._opening) {\n await this._opening;\n }\n else {\n this._opening = fs_1.default.promises.mkdir(this.path);\n await this._opening;\n this._opened = true;\n }\n }\n async put(cid, bytes) {\n if (!this._opened) {\n await this._open();\n }\n const cidStr = cid.toString();\n const location = `${this.path}/${cidStr}`;\n await fs_1.default.promises.writeFile(location, bytes);\n }\n async get(cid) {\n if (!this._opened) {\n await this._open();\n }\n const cidStr = cid.toString();\n const location = `${this.path}/${cidStr}`;\n const bytes = await fs_1.default.promises.readFile(location);\n return bytes;\n }\n async has(cid) {\n if (!this._opened) {\n await this._open();\n }\n const cidStr = cid.toString();\n const location = `${this.path}/${cidStr}`;\n try {\n await fs_1.default.promises.access(location);\n return true;\n }\n catch (err) {\n return false;\n }\n }\n async *blocks() {\n if (!this._opened) {\n await this._open();\n }\n const cids = await fs_1.default.promises.readdir(this.path);\n for (const cidStr of cids) {\n const location = `${this.path}/${cidStr}`;\n const bytes = await fs_1.default.promises.readFile(location);\n yield { cid: multiformats_1.CID.parse(cidStr), bytes };\n }\n }\n async close() {\n if (this._opened) {\n await fs_1.default.promises.rm(this.path, { recursive: true });\n }\n this._opened = false;\n }\n}\nexports.FsBlockStore = FsBlockStore;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MemoryBlockStore = void 0;\nconst multiformats_1 = require(\"multiformats\");\nconst blockstore_core_1 = require(\"blockstore-core\");\nclass MemoryBlockStore extends blockstore_core_1.BaseBlockstore {\n constructor() {\n super();\n this.store = new Map();\n }\n async *blocks() {\n for (const [cidStr, bytes] of this.store.entries()) {\n yield { cid: multiformats_1.CID.parse(cidStr), bytes };\n }\n }\n put(cid, bytes) {\n this.store.set(cid.toString(), bytes);\n return Promise.resolve();\n }\n get(cid) {\n const bytes = this.store.get(cid.toString());\n if (!bytes) {\n throw new Error(`block with cid ${cid.toString()} no found`);\n }\n return Promise.resolve(bytes);\n }\n has(cid) {\n return Promise.resolve(this.store.has(cid.toString()));\n }\n close() {\n this.store.clear();\n return Promise.resolve();\n }\n}\nexports.MemoryBlockStore = MemoryBlockStore;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unixfsImporterOptionsDefault = void 0;\nconst sha2_1 = require(\"multiformats/hashes/sha2\");\nexports.unixfsImporterOptionsDefault = {\n cidVersion: 1,\n chunker: 'fixed',\n maxChunkSize: 262144,\n hasher: sha2_1.sha256,\n rawLeaves: true,\n wrapWithDirectory: true,\n maxChildrenPerNode: 174\n};\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.pack = void 0;\nconst it_last_1 = __importDefault(require(\"it-last\"));\nconst it_pipe_1 = __importDefault(require(\"it-pipe\"));\nconst car_1 = require(\"@ipld/car\");\nconst ipfs_unixfs_importer_1 = require(\"ipfs-unixfs-importer\");\nconst normalise_input_1 = require(\"./utils/normalise-input\");\nconst memory_1 = require(\"../blockstore/memory\");\nconst constants_1 = require(\"./constants\");\nasync function pack({ input, blockstore: userBlockstore, hasher, maxChunkSize, maxChildrenPerNode, wrapWithDirectory, rawLeaves }) {\n if (!input || (Array.isArray(input) && !input.length)) {\n throw new Error('missing input file(s)');\n }\n const blockstore = userBlockstore ? userBlockstore : new memory_1.MemoryBlockStore();\n // Consume the source\n const rootEntry = await (0, it_last_1.default)((0, it_pipe_1.default)((0, normalise_input_1.getNormaliser)(input), (source) => (0, ipfs_unixfs_importer_1.importer)(source, blockstore, {\n ...constants_1.unixfsImporterOptionsDefault,\n hasher: hasher || constants_1.unixfsImporterOptionsDefault.hasher,\n maxChunkSize: maxChunkSize || constants_1.unixfsImporterOptionsDefault.maxChunkSize,\n maxChildrenPerNode: maxChildrenPerNode || constants_1.unixfsImporterOptionsDefault.maxChildrenPerNode,\n wrapWithDirectory: wrapWithDirectory === false ? false : constants_1.unixfsImporterOptionsDefault.wrapWithDirectory,\n rawLeaves: rawLeaves == null ? constants_1.unixfsImporterOptionsDefault.rawLeaves : rawLeaves\n })));\n if (!rootEntry || !rootEntry.cid) {\n throw new Error('given input could not be parsed correctly');\n }\n const root = rootEntry.cid;\n const { writer, out: carOut } = await car_1.CarWriter.create([root]);\n const carOutIter = carOut[Symbol.asyncIterator]();\n let writingPromise;\n const writeAll = async () => {\n for await (const block of blockstore.blocks()) {\n // `await` will block until all bytes in `carOut` are consumed by the user\n // so we have backpressure here\n await writer.put(block);\n }\n await writer.close();\n if (!userBlockstore) {\n await blockstore.close();\n }\n };\n const out = {\n [Symbol.asyncIterator]() {\n if (writingPromise != null) {\n throw new Error('Multiple iterator not supported');\n }\n // don't start writing until the user starts consuming the iterator\n writingPromise = writeAll();\n return {\n async next() {\n const result = await carOutIter.next();\n if (result.done) {\n await writingPromise; // any errors will propagate from here\n }\n return result;\n }\n };\n }\n };\n return { root, out };\n}\nexports.pack = pack;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getNormaliser = void 0;\nconst normalise_input_single_1 = require(\"ipfs-core-utils/files/normalise-input-single\");\nconst normalise_input_multiple_1 = require(\"ipfs-core-utils/files/normalise-input-multiple\");\nfunction isBytes(obj) {\n return ArrayBuffer.isView(obj) || obj instanceof ArrayBuffer;\n}\nfunction isBlob(obj) {\n return Boolean(obj.constructor) &&\n (obj.constructor.name === 'Blob' || obj.constructor.name === 'File') &&\n typeof obj.stream === 'function';\n}\nfunction isSingle(input) {\n return typeof input === 'string' || input instanceof String || isBytes(input) || isBlob(input) || '_readableState' in input;\n}\n/**\n * Get a single or multiple normaliser depending on the input.\n */\nfunction getNormaliser(input) {\n if (isSingle(input)) {\n return (0, normalise_input_single_1.normaliseInput)(input);\n }\n else {\n return (0, normalise_input_multiple_1.normaliseInput)(input);\n }\n}\nexports.getNormaliser = getNormaliser;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unpackStream = exports.unpack = void 0;\nconst browser_readablestream_to_it_1 = __importDefault(require(\"browser-readablestream-to-it\"));\nconst iterator_1 = require(\"@ipld/car/iterator\");\nconst ipfs_unixfs_exporter_1 = require(\"ipfs-unixfs-exporter\");\nconst verifying_get_only_blockstore_1 = require(\"./utils/verifying-get-only-blockstore\");\nconst memory_1 = require(\"../blockstore/memory\");\n// Export unixfs entries from car file\nasync function* unpack(carReader, roots) {\n const verifyingBlockService = verifying_get_only_blockstore_1.VerifyingGetOnlyBlockStore.fromCarReader(carReader);\n if (!roots || roots.length === 0) {\n roots = await carReader.getRoots();\n }\n for (const root of roots) {\n yield* (0, ipfs_unixfs_exporter_1.recursive)(root, verifyingBlockService, { /* options */});\n }\n}\nexports.unpack = unpack;\nasync function* unpackStream(readable, { roots, blockstore: userBlockstore } = {}) {\n const carIterator = await iterator_1.CarBlockIterator.fromIterable(asAsyncIterable(readable));\n const blockstore = userBlockstore || new memory_1.MemoryBlockStore();\n for await (const block of carIterator) {\n await blockstore.put(block.cid, block.bytes);\n }\n const verifyingBlockStore = verifying_get_only_blockstore_1.VerifyingGetOnlyBlockStore.fromBlockstore(blockstore);\n if (!roots || roots.length === 0) {\n roots = await carIterator.getRoots();\n }\n for (const root of roots) {\n yield* (0, ipfs_unixfs_exporter_1.recursive)(root, verifyingBlockStore);\n }\n}\nexports.unpackStream = unpackStream;\n/**\n * Upgrade a ReadableStream to an AsyncIterable if it isn't already\n *\n * ReadableStream (e.g res.body) is asyncIterable in node, but not in chrome, yet.\n * see: https://bugs.chromium.org/p/chromium/issues/detail?id=929585\n */\nfunction asAsyncIterable(readable) {\n // @ts-ignore how to convince tsc that we are checking the type here?\n return Symbol.asyncIterator in readable ? readable : (0, browser_readablestream_to_it_1.default)(readable);\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VerifyingGetOnlyBlockStore = void 0;\nconst equals_1 = require(\"uint8arrays/equals\");\nconst sha2_1 = require(\"multiformats/hashes/sha2\");\nconst blockstore_core_1 = require(\"blockstore-core\");\nclass VerifyingGetOnlyBlockStore extends blockstore_core_1.BaseBlockstore {\n constructor(blockstore) {\n super();\n this.store = blockstore;\n }\n async get(cid) {\n const res = await this.store.get(cid);\n if (!res) {\n throw new Error(`Incomplete CAR. Block missing for CID ${cid}`);\n }\n if (!isValid({ cid, bytes: res })) {\n throw new Error(`Invalid CAR. Hash of block data does not match CID ${cid}`);\n }\n return res;\n }\n static fromBlockstore(b) {\n return new VerifyingGetOnlyBlockStore(b);\n }\n static fromCarReader(cr) {\n return new VerifyingGetOnlyBlockStore({\n // Return bytes in the same fashion as a Blockstore implementation\n get: async (cid) => {\n const block = await cr.get(cid);\n return block === null || block === void 0 ? void 0 : block.bytes;\n }\n });\n }\n}\nexports.VerifyingGetOnlyBlockStore = VerifyingGetOnlyBlockStore;\nasync function isValid({ cid, bytes }) {\n const hash = await sha2_1.sha256.digest(bytes);\n return (0, equals_1.equals)(hash.digest, cid.multihash.digest);\n}\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar errCode = require('err-code');\nvar browserStreamToIt = require('browser-readablestream-to-it');\nvar itPeekable = require('it-peekable');\nvar map = require('it-map');\nvar utils = require('./utils.js');\nvar ipfsUnixfs = require('ipfs-unixfs');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\nvar browserStreamToIt__default = /*#__PURE__*/_interopDefaultLegacy(browserStreamToIt);\nvar itPeekable__default = /*#__PURE__*/_interopDefaultLegacy(itPeekable);\nvar map__default = /*#__PURE__*/_interopDefaultLegacy(map);\n\nasync function* normaliseCandidateMultiple(input, normaliseContent) {\n if (typeof input === 'string' || input instanceof String || utils.isBytes(input) || utils.isBlob(input) || input._readableState) {\n throw errCode__default[\"default\"](new Error('Unexpected input: single item passed - if you are using ipfs.addAll, please use ipfs.add instead'), 'ERR_UNEXPECTED_INPUT');\n }\n if (utils.isReadableStream(input)) {\n input = browserStreamToIt__default[\"default\"](input);\n }\n if (Symbol.iterator in input || Symbol.asyncIterator in input) {\n const peekable = itPeekable__default[\"default\"](input);\n const {value, done} = await peekable.peek();\n if (done) {\n yield* [];\n return;\n }\n peekable.push(value);\n if (Number.isInteger(value)) {\n throw errCode__default[\"default\"](new Error('Unexpected input: single item passed - if you are using ipfs.addAll, please use ipfs.add instead'), 'ERR_UNEXPECTED_INPUT');\n }\n if (value._readableState) {\n yield* map__default[\"default\"](peekable, value => toFileObject({ content: value }, normaliseContent));\n return;\n }\n if (utils.isBytes(value)) {\n yield toFileObject({ content: peekable }, normaliseContent);\n return;\n }\n if (utils.isFileObject(value) || value[Symbol.iterator] || value[Symbol.asyncIterator] || utils.isReadableStream(value) || utils.isBlob(value)) {\n yield* map__default[\"default\"](peekable, value => toFileObject(value, normaliseContent));\n return;\n }\n }\n if (utils.isFileObject(input)) {\n throw errCode__default[\"default\"](new Error('Unexpected input: single item passed - if you are using ipfs.addAll, please use ipfs.add instead'), 'ERR_UNEXPECTED_INPUT');\n }\n throw errCode__default[\"default\"](new Error('Unexpected input: ' + typeof input), 'ERR_UNEXPECTED_INPUT');\n}\nasync function toFileObject(input, normaliseContent) {\n const {path, mode, mtime, content} = input;\n const file = {\n path: path || '',\n mode: ipfsUnixfs.parseMode(mode),\n mtime: ipfsUnixfs.parseMtime(mtime)\n };\n if (content) {\n file.content = await normaliseContent(content);\n } else if (!path) {\n file.content = await normaliseContent(input);\n }\n return file;\n}\n\nexports.normaliseCandidateMultiple = normaliseCandidateMultiple;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar errCode = require('err-code');\nvar browserStreamToIt = require('browser-readablestream-to-it');\nvar itPeekable = require('it-peekable');\nvar utils = require('./utils.js');\nvar ipfsUnixfs = require('ipfs-unixfs');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\nvar browserStreamToIt__default = /*#__PURE__*/_interopDefaultLegacy(browserStreamToIt);\nvar itPeekable__default = /*#__PURE__*/_interopDefaultLegacy(itPeekable);\n\nasync function* normaliseCandidateSingle(input, normaliseContent) {\n if (input === null || input === undefined) {\n throw errCode__default[\"default\"](new Error(`Unexpected input: ${ input }`), 'ERR_UNEXPECTED_INPUT');\n }\n if (typeof input === 'string' || input instanceof String) {\n yield toFileObject(input.toString(), normaliseContent);\n return;\n }\n if (utils.isBytes(input) || utils.isBlob(input)) {\n yield toFileObject(input, normaliseContent);\n return;\n }\n if (utils.isReadableStream(input)) {\n input = browserStreamToIt__default[\"default\"](input);\n }\n if (Symbol.iterator in input || Symbol.asyncIterator in input) {\n const peekable = itPeekable__default[\"default\"](input);\n const {value, done} = await peekable.peek();\n if (done) {\n yield { content: [] };\n return;\n }\n peekable.push(value);\n if (Number.isInteger(value) || utils.isBytes(value) || typeof value === 'string' || value instanceof String) {\n yield toFileObject(peekable, normaliseContent);\n return;\n }\n throw errCode__default[\"default\"](new Error('Unexpected input: multiple items passed - if you are using ipfs.add, please use ipfs.addAll instead'), 'ERR_UNEXPECTED_INPUT');\n }\n if (utils.isFileObject(input)) {\n yield toFileObject(input, normaliseContent);\n return;\n }\n throw errCode__default[\"default\"](new Error('Unexpected input: cannot convert \"' + typeof input + '\" into ImportCandidate'), 'ERR_UNEXPECTED_INPUT');\n}\nasync function toFileObject(input, normaliseContent) {\n const {path, mode, mtime, content} = input;\n const file = {\n path: path || '',\n mode: ipfsUnixfs.parseMode(mode),\n mtime: ipfsUnixfs.parseMtime(mtime)\n };\n if (content) {\n file.content = await normaliseContent(content);\n } else if (!path) {\n file.content = await normaliseContent(input);\n }\n return file;\n}\n\nexports.normaliseCandidateSingle = normaliseCandidateSingle;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar errCode = require('err-code');\nvar fromString = require('uint8arrays/from-string');\nvar browserStreamToIt = require('browser-readablestream-to-it');\nvar blobToIt = require('blob-to-it');\nvar itPeekable = require('it-peekable');\nvar all = require('it-all');\nvar map = require('it-map');\nvar utils = require('./utils.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\nvar browserStreamToIt__default = /*#__PURE__*/_interopDefaultLegacy(browserStreamToIt);\nvar blobToIt__default = /*#__PURE__*/_interopDefaultLegacy(blobToIt);\nvar itPeekable__default = /*#__PURE__*/_interopDefaultLegacy(itPeekable);\nvar all__default = /*#__PURE__*/_interopDefaultLegacy(all);\nvar map__default = /*#__PURE__*/_interopDefaultLegacy(map);\n\nasync function* toAsyncIterable(thing) {\n yield thing;\n}\nasync function normaliseContent(input) {\n if (utils.isBytes(input)) {\n return toAsyncIterable(toBytes(input));\n }\n if (typeof input === 'string' || input instanceof String) {\n return toAsyncIterable(toBytes(input.toString()));\n }\n if (utils.isBlob(input)) {\n return blobToIt__default[\"default\"](input);\n }\n if (utils.isReadableStream(input)) {\n input = browserStreamToIt__default[\"default\"](input);\n }\n if (Symbol.iterator in input || Symbol.asyncIterator in input) {\n const peekable = itPeekable__default[\"default\"](input);\n const {value, done} = await peekable.peek();\n if (done) {\n return toAsyncIterable(new Uint8Array(0));\n }\n peekable.push(value);\n if (Number.isInteger(value)) {\n return toAsyncIterable(Uint8Array.from(await all__default[\"default\"](peekable)));\n }\n if (utils.isBytes(value) || typeof value === 'string' || value instanceof String) {\n return map__default[\"default\"](peekable, toBytes);\n }\n }\n throw errCode__default[\"default\"](new Error(`Unexpected input: ${ input }`), 'ERR_UNEXPECTED_INPUT');\n}\nfunction toBytes(chunk) {\n if (chunk instanceof Uint8Array) {\n return chunk;\n }\n if (ArrayBuffer.isView(chunk)) {\n return new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength);\n }\n if (chunk instanceof ArrayBuffer) {\n return new Uint8Array(chunk);\n }\n if (Array.isArray(chunk)) {\n return Uint8Array.from(chunk);\n }\n return fromString.fromString(chunk.toString());\n}\n\nexports.normaliseContent = normaliseContent;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar normaliseContent = require('./normalise-content.js');\nvar normaliseCandidateMultiple = require('./normalise-candidate-multiple.js');\n\nfunction normaliseInput(input) {\n return normaliseCandidateMultiple.normaliseCandidateMultiple(input, normaliseContent.normaliseContent);\n}\n\nexports.normaliseInput = normaliseInput;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar normaliseContent = require('./normalise-content.js');\nvar normaliseCandidateSingle = require('./normalise-candidate-single.js');\n\nfunction normaliseInput(input) {\n return normaliseCandidateSingle.normaliseCandidateSingle(input, normaliseContent.normaliseContent);\n}\n\nexports.normaliseInput = normaliseInput;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction isBytes(obj) {\n return ArrayBuffer.isView(obj) || obj instanceof ArrayBuffer;\n}\nfunction isBlob(obj) {\n return obj.constructor && (obj.constructor.name === 'Blob' || obj.constructor.name === 'File') && typeof obj.stream === 'function';\n}\nfunction isFileObject(obj) {\n return typeof obj === 'object' && (obj.path || obj.content);\n}\nconst isReadableStream = value => value && typeof value.getReader === 'function';\n\nexports.isBlob = isBlob;\nexports.isBytes = isBytes;\nexports.isFileObject = isFileObject;\nexports.isReadableStream = isReadableStream;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar errCode = require('err-code');\nvar cid = require('multiformats/cid');\nvar index = require('./resolvers/index.js');\nvar last = require('it-last');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\nvar last__default = /*#__PURE__*/_interopDefaultLegacy(last);\n\nconst toPathComponents = (path = '') => {\n return (path.trim().match(/([^\\\\^/]|\\\\\\/)+/g) || []).filter(Boolean);\n};\nconst cidAndRest = path => {\n if (path instanceof Uint8Array) {\n return {\n cid: cid.CID.decode(path),\n toResolve: []\n };\n }\n const cid$1 = cid.CID.asCID(path);\n if (cid$1) {\n return {\n cid: cid$1,\n toResolve: []\n };\n }\n if (typeof path === 'string') {\n if (path.indexOf('/ipfs/') === 0) {\n path = path.substring(6);\n }\n const output = toPathComponents(path);\n return {\n cid: cid.CID.parse(output[0]),\n toResolve: output.slice(1)\n };\n }\n throw errCode__default['default'](new Error(`Unknown path type ${ path }`), 'ERR_BAD_PATH');\n};\nasync function* walkPath(path, blockstore, options = {}) {\n let {cid, toResolve} = cidAndRest(path);\n let name = cid.toString();\n let entryPath = name;\n const startingDepth = toResolve.length;\n while (true) {\n const result = await index(cid, name, entryPath, toResolve, startingDepth, blockstore, options);\n if (!result.entry && !result.next) {\n throw errCode__default['default'](new Error(`Could not resolve ${ path }`), 'ERR_NOT_FOUND');\n }\n if (result.entry) {\n yield result.entry;\n }\n if (!result.next) {\n return;\n }\n toResolve = result.next.toResolve;\n cid = result.next.cid;\n name = result.next.name;\n entryPath = result.next.path;\n }\n}\nasync function exporter(path, blockstore, options = {}) {\n const result = await last__default['default'](walkPath(path, blockstore, options));\n if (!result) {\n throw errCode__default['default'](new Error(`Could not resolve ${ path }`), 'ERR_NOT_FOUND');\n }\n return result;\n}\nasync function* recursive(path, blockstore, options = {}) {\n const node = await exporter(path, blockstore, options);\n if (!node) {\n return;\n }\n yield node;\n if (node.type === 'directory') {\n for await (const child of recurse(node, options)) {\n yield child;\n }\n }\n async function* recurse(node, options) {\n for await (const file of node.content(options)) {\n yield file;\n if (file instanceof Uint8Array) {\n continue;\n }\n if (file.type === 'directory') {\n yield* recurse(file, options);\n }\n }\n }\n}\n\nexports.exporter = exporter;\nexports.recursive = recursive;\nexports.walkPath = walkPath;\n","'use strict';\n\nvar cid = require('multiformats/cid');\nvar errCode = require('err-code');\nvar dagCbor = require('@ipld/dag-cbor');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () {\n return e[k];\n }\n });\n }\n });\n }\n n['default'] = e;\n return Object.freeze(n);\n}\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\nvar dagCbor__namespace = /*#__PURE__*/_interopNamespace(dagCbor);\n\nconst resolve = async (cid$1, name, path, toResolve, resolve, depth, blockstore, options) => {\n const block = await blockstore.get(cid$1);\n const object = dagCbor__namespace.decode(block);\n let subObject = object;\n let subPath = path;\n while (toResolve.length) {\n const prop = toResolve[0];\n if (prop in subObject) {\n toResolve.shift();\n subPath = `${ subPath }/${ prop }`;\n const subObjectCid = cid.CID.asCID(subObject[prop]);\n if (subObjectCid) {\n return {\n entry: {\n type: 'object',\n name,\n path,\n cid: cid$1,\n node: block,\n depth,\n size: block.length,\n content: async function* () {\n yield object;\n }\n },\n next: {\n cid: subObjectCid,\n name: prop,\n path: subPath,\n toResolve\n }\n };\n }\n subObject = subObject[prop];\n } else {\n throw errCode__default['default'](new Error(`No property named ${ prop } found in cbor node ${ cid$1 }`), 'ERR_NO_PROP');\n }\n }\n return {\n entry: {\n type: 'object',\n name,\n path,\n cid: cid$1,\n node: block,\n depth,\n size: block.length,\n content: async function* () {\n yield object;\n }\n }\n };\n};\n\nmodule.exports = resolve;\n","'use strict';\n\nvar errCode = require('err-code');\nvar extractDataFromBlock = require('../utils/extract-data-from-block.js');\nvar validateOffsetAndLength = require('../utils/validate-offset-and-length.js');\nvar mh = require('multiformats/hashes/digest');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () {\n return e[k];\n }\n });\n }\n });\n }\n n['default'] = e;\n return Object.freeze(n);\n}\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\nvar mh__namespace = /*#__PURE__*/_interopNamespace(mh);\n\nconst rawContent = node => {\n async function* contentGenerator(options = {}) {\n const {offset, length} = validateOffsetAndLength(node.length, options.offset, options.length);\n yield extractDataFromBlock(node, 0, offset, offset + length);\n }\n return contentGenerator;\n};\nconst resolve = async (cid, name, path, toResolve, resolve, depth, blockstore, options) => {\n if (toResolve.length) {\n throw errCode__default['default'](new Error(`No link named ${ path } found in raw node ${ cid }`), 'ERR_NOT_FOUND');\n }\n const buf = await mh__namespace.decode(cid.multihash.bytes);\n return {\n entry: {\n type: 'identity',\n name,\n path,\n cid,\n content: rawContent(buf.digest),\n depth,\n size: buf.digest.length,\n node: buf.digest\n }\n };\n};\n\nmodule.exports = resolve;\n","'use strict';\n\nvar errCode = require('err-code');\nvar dagPb = require('@ipld/dag-pb');\nvar dagCbor = require('@ipld/dag-cbor');\nvar raw = require('multiformats/codecs/raw');\nvar identity = require('multiformats/hashes/identity');\nvar index = require('./unixfs-v1/index.js');\nvar raw$1 = require('./raw.js');\nvar dagCbor$1 = require('./dag-cbor.js');\nvar identity$1 = require('./identity.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () {\n return e[k];\n }\n });\n }\n });\n }\n n['default'] = e;\n return Object.freeze(n);\n}\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\nvar dagPb__namespace = /*#__PURE__*/_interopNamespace(dagPb);\nvar dagCbor__namespace = /*#__PURE__*/_interopNamespace(dagCbor);\nvar raw__namespace = /*#__PURE__*/_interopNamespace(raw);\n\nconst resolvers = {\n [dagPb__namespace.code]: index,\n [raw__namespace.code]: raw$1,\n [dagCbor__namespace.code]: dagCbor$1,\n [identity.identity.code]: identity$1\n};\nfunction resolve(cid, name, path, toResolve, depth, blockstore, options) {\n const resolver = resolvers[cid.code];\n if (!resolver) {\n throw errCode__default['default'](new Error(`No resolver for code ${ cid.code }`), 'ERR_NO_RESOLVER');\n }\n return resolver(cid, name, path, toResolve, resolve, depth, blockstore, options);\n}\n\nmodule.exports = resolve;\n","'use strict';\n\nvar errCode = require('err-code');\nvar extractDataFromBlock = require('../utils/extract-data-from-block.js');\nvar validateOffsetAndLength = require('../utils/validate-offset-and-length.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\n\nconst rawContent = node => {\n async function* contentGenerator(options = {}) {\n const {offset, length} = validateOffsetAndLength(node.length, options.offset, options.length);\n yield extractDataFromBlock(node, 0, offset, offset + length);\n }\n return contentGenerator;\n};\nconst resolve = async (cid, name, path, toResolve, resolve, depth, blockstore, options) => {\n if (toResolve.length) {\n throw errCode__default['default'](new Error(`No link named ${ path } found in raw node ${ cid }`), 'ERR_NOT_FOUND');\n }\n const block = await blockstore.get(cid, options);\n return {\n entry: {\n type: 'raw',\n name,\n path,\n cid,\n content: rawContent(block),\n depth,\n size: block.length,\n node: block\n }\n };\n};\n\nmodule.exports = resolve;\n","'use strict';\n\nconst directoryContent = (cid, node, unixfs, path, resolve, depth, blockstore) => {\n async function* yieldDirectoryContent(options = {}) {\n const offset = options.offset || 0;\n const length = options.length || node.Links.length;\n const links = node.Links.slice(offset, length);\n for (const link of links) {\n const result = await resolve(link.Hash, link.Name || '', `${ path }/${ link.Name || '' }`, [], depth + 1, blockstore, options);\n if (result.entry) {\n yield result.entry;\n }\n }\n }\n return yieldDirectoryContent;\n};\n\nmodule.exports = directoryContent;\n","'use strict';\n\nvar extractDataFromBlock = require('../../../utils/extract-data-from-block.js');\nvar validateOffsetAndLength = require('../../../utils/validate-offset-and-length.js');\nvar ipfsUnixfs = require('ipfs-unixfs');\nvar errCode = require('err-code');\nvar dagPb = require('@ipld/dag-pb');\nvar dagCbor = require('@ipld/dag-cbor');\nvar raw = require('multiformats/codecs/raw');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () {\n return e[k];\n }\n });\n }\n });\n }\n n['default'] = e;\n return Object.freeze(n);\n}\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\nvar dagPb__namespace = /*#__PURE__*/_interopNamespace(dagPb);\nvar dagCbor__namespace = /*#__PURE__*/_interopNamespace(dagCbor);\nvar raw__namespace = /*#__PURE__*/_interopNamespace(raw);\n\nasync function* emitBytes(blockstore, node, start, end, streamPosition = 0, options) {\n if (node instanceof Uint8Array) {\n const buf = extractDataFromBlock(node, streamPosition, start, end);\n if (buf.length) {\n yield buf;\n }\n streamPosition += buf.length;\n return streamPosition;\n }\n if (node.Data == null) {\n throw errCode__default['default'](new Error('no data in PBNode'), 'ERR_NOT_UNIXFS');\n }\n let file;\n try {\n file = ipfsUnixfs.UnixFS.unmarshal(node.Data);\n } catch (err) {\n throw errCode__default['default'](err, 'ERR_NOT_UNIXFS');\n }\n if (file.data && file.data.length) {\n const buf = extractDataFromBlock(file.data, streamPosition, start, end);\n if (buf.length) {\n yield buf;\n }\n streamPosition += file.data.length;\n }\n let childStart = streamPosition;\n for (let i = 0; i < node.Links.length; i++) {\n const childLink = node.Links[i];\n const childEnd = streamPosition + file.blockSizes[i];\n if (start >= childStart && start < childEnd || end > childStart && end <= childEnd || start < childStart && end > childEnd) {\n const block = await blockstore.get(childLink.Hash, { signal: options.signal });\n let child;\n switch (childLink.Hash.code) {\n case dagPb__namespace.code:\n child = await dagPb__namespace.decode(block);\n break;\n case raw__namespace.code:\n child = block;\n break;\n case dagCbor__namespace.code:\n child = await dagCbor__namespace.decode(block);\n break;\n default:\n throw Error(`Unsupported codec: ${ childLink.Hash.code }`);\n }\n for await (const buf of emitBytes(blockstore, child, start, end, streamPosition, options)) {\n streamPosition += buf.length;\n yield buf;\n }\n }\n streamPosition = childEnd;\n childStart = childEnd + 1;\n }\n}\nconst fileContent = (cid, node, unixfs, path, resolve, depth, blockstore) => {\n function yieldFileContent(options = {}) {\n const fileSize = unixfs.fileSize();\n if (fileSize === undefined) {\n throw new Error('File was a directory');\n }\n const {offset, length} = validateOffsetAndLength(fileSize, options.offset, options.length);\n const start = offset;\n const end = offset + length;\n return emitBytes(blockstore, node, start, end, 0, options);\n }\n return yieldFileContent;\n};\n\nmodule.exports = fileContent;\n","'use strict';\n\nvar dagPb = require('@ipld/dag-pb');\n\nconst hamtShardedDirectoryContent = (cid, node, unixfs, path, resolve, depth, blockstore) => {\n function yieldHamtDirectoryContent(options = {}) {\n return listDirectory(node, path, resolve, depth, blockstore, options);\n }\n return yieldHamtDirectoryContent;\n};\nasync function* listDirectory(node, path, resolve, depth, blockstore, options) {\n const links = node.Links;\n for (const link of links) {\n const name = link.Name != null ? link.Name.substring(2) : null;\n if (name) {\n const result = await resolve(link.Hash, name, `${ path }/${ name }`, [], depth + 1, blockstore, options);\n yield result.entry;\n } else {\n const block = await blockstore.get(link.Hash);\n node = dagPb.decode(block);\n for await (const file of listDirectory(node, path, resolve, depth, blockstore, options)) {\n yield file;\n }\n }\n }\n}\n\nmodule.exports = hamtShardedDirectoryContent;\n","'use strict';\n\nvar errCode = require('err-code');\nvar ipfsUnixfs = require('ipfs-unixfs');\nvar findCidInShard = require('../../utils/find-cid-in-shard.js');\nvar dagPb = require('@ipld/dag-pb');\nvar file = require('./content/file.js');\nvar directory = require('./content/directory.js');\nvar hamtShardedDirectory = require('./content/hamt-sharded-directory.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\n\nconst findLinkCid = (node, name) => {\n const link = node.Links.find(link => link.Name === name);\n return link && link.Hash;\n};\nconst contentExporters = {\n raw: file,\n file: file,\n directory: directory,\n 'hamt-sharded-directory': hamtShardedDirectory,\n metadata: (cid, node, unixfs, path, resolve, depth, blockstore) => {\n return () => [];\n },\n symlink: (cid, node, unixfs, path, resolve, depth, blockstore) => {\n return () => [];\n }\n};\nconst unixFsResolver = async (cid, name, path, toResolve, resolve, depth, blockstore, options) => {\n const block = await blockstore.get(cid, options);\n const node = dagPb.decode(block);\n let unixfs;\n let next;\n if (!name) {\n name = cid.toString();\n }\n if (node.Data == null) {\n throw errCode__default['default'](new Error('no data in PBNode'), 'ERR_NOT_UNIXFS');\n }\n try {\n unixfs = ipfsUnixfs.UnixFS.unmarshal(node.Data);\n } catch (err) {\n throw errCode__default['default'](err, 'ERR_NOT_UNIXFS');\n }\n if (!path) {\n path = name;\n }\n if (toResolve.length) {\n let linkCid;\n if (unixfs && unixfs.type === 'hamt-sharded-directory') {\n linkCid = await findCidInShard(node, toResolve[0], blockstore);\n } else {\n linkCid = findLinkCid(node, toResolve[0]);\n }\n if (!linkCid) {\n throw errCode__default['default'](new Error('file does not exist'), 'ERR_NOT_FOUND');\n }\n const nextName = toResolve.shift();\n const nextPath = `${ path }/${ nextName }`;\n next = {\n cid: linkCid,\n toResolve,\n name: nextName || '',\n path: nextPath\n };\n }\n return {\n entry: {\n type: unixfs.isDirectory() ? 'directory' : 'file',\n name,\n path,\n cid,\n content: contentExporters[unixfs.type](cid, node, unixfs, path, resolve, depth, blockstore),\n unixfs,\n depth,\n node,\n size: unixfs.fileSize()\n },\n next\n };\n};\n\nmodule.exports = unixFsResolver;\n","'use strict';\n\nfunction extractDataFromBlock(block, blockStart, requestedStart, requestedEnd) {\n const blockLength = block.length;\n const blockEnd = blockStart + blockLength;\n if (requestedStart >= blockEnd || requestedEnd < blockStart) {\n return new Uint8Array(0);\n }\n if (requestedEnd >= blockStart && requestedEnd < blockEnd) {\n block = block.slice(0, requestedEnd - blockStart);\n }\n if (requestedStart >= blockStart && requestedStart < blockEnd) {\n block = block.slice(requestedStart - blockStart);\n }\n return block;\n}\n\nmodule.exports = extractDataFromBlock;\n","'use strict';\n\nvar hamtSharding = require('hamt-sharding');\nvar dagPb = require('@ipld/dag-pb');\nvar murmur3 = require('@multiformats/murmur3');\n\nconst hashFn = async function (buf) {\n return (await murmur3.murmur3128.encode(buf)).slice(0, 8).reverse();\n};\nconst addLinksToHamtBucket = (links, bucket, rootBucket) => {\n return Promise.all(links.map(link => {\n if (link.Name == null) {\n throw new Error('Unexpected Link without a Name');\n }\n if (link.Name.length === 2) {\n const pos = parseInt(link.Name, 16);\n return bucket._putObjectAt(pos, new hamtSharding.Bucket({\n hash: rootBucket._options.hash,\n bits: rootBucket._options.bits\n }, bucket, pos));\n }\n return rootBucket.put(link.Name.substring(2), true);\n }));\n};\nconst toPrefix = position => {\n return position.toString(16).toUpperCase().padStart(2, '0').substring(0, 2);\n};\nconst toBucketPath = position => {\n let bucket = position.bucket;\n const path = [];\n while (bucket._parent) {\n path.push(bucket);\n bucket = bucket._parent;\n }\n path.push(bucket);\n return path.reverse();\n};\nconst findShardCid = async (node, name, blockstore, context, options) => {\n if (!context) {\n const rootBucket = hamtSharding.createHAMT({ hashFn });\n context = {\n rootBucket,\n hamtDepth: 1,\n lastBucket: rootBucket\n };\n }\n await addLinksToHamtBucket(node.Links, context.lastBucket, context.rootBucket);\n const position = await context.rootBucket._findNewBucketAndPos(name);\n let prefix = toPrefix(position.pos);\n const bucketPath = toBucketPath(position);\n if (bucketPath.length > context.hamtDepth) {\n context.lastBucket = bucketPath[context.hamtDepth];\n prefix = toPrefix(context.lastBucket._posAtParent);\n }\n const link = node.Links.find(link => {\n if (link.Name == null) {\n return false;\n }\n const entryPrefix = link.Name.substring(0, 2);\n const entryName = link.Name.substring(2);\n if (entryPrefix !== prefix) {\n return false;\n }\n if (entryName && entryName !== name) {\n return false;\n }\n return true;\n });\n if (!link) {\n return null;\n }\n if (link.Name != null && link.Name.substring(2) === name) {\n return link.Hash;\n }\n context.hamtDepth++;\n const block = await blockstore.get(link.Hash, options);\n node = dagPb.decode(block);\n return findShardCid(node, name, blockstore, context, options);\n};\n\nmodule.exports = findShardCid;\n","'use strict';\n\nvar errCode = require('err-code');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\n\nconst validateOffsetAndLength = (size, offset, length) => {\n if (!offset) {\n offset = 0;\n }\n if (offset < 0) {\n throw errCode__default['default'](new Error('Offset must be greater than or equal to 0'), 'ERR_INVALID_PARAMS');\n }\n if (offset > size) {\n throw errCode__default['default'](new Error('Offset must be less than the file size'), 'ERR_INVALID_PARAMS');\n }\n if (!length && length !== 0) {\n length = size - offset;\n }\n if (length < 0) {\n throw errCode__default['default'](new Error('Length must be greater than or equal to 0'), 'ERR_INVALID_PARAMS');\n }\n if (offset + length > size) {\n length = size - offset;\n }\n return {\n offset,\n length\n };\n};\n\nmodule.exports = validateOffsetAndLength;\n","'use strict';\n\nvar BufferList = require('bl/BufferList.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar BufferList__default = /*#__PURE__*/_interopDefaultLegacy(BufferList);\n\nasync function* fixedSizeChunker(source, options) {\n let bl = new BufferList__default['default']();\n let currentLength = 0;\n let emitted = false;\n const maxChunkSize = options.maxChunkSize;\n for await (const buffer of source) {\n bl.append(buffer);\n currentLength += buffer.length;\n while (currentLength >= maxChunkSize) {\n yield bl.slice(0, maxChunkSize);\n emitted = true;\n if (maxChunkSize === bl.length) {\n bl = new BufferList__default['default']();\n currentLength = 0;\n } else {\n const newBl = new BufferList__default['default']();\n newBl.append(bl.shallowSlice(maxChunkSize));\n bl = newBl;\n currentLength -= maxChunkSize;\n }\n }\n }\n if (!emitted || currentLength) {\n yield bl.slice(0, currentLength);\n }\n}\n\nmodule.exports = fixedSizeChunker;\n","'use strict';\n\nvar BufferList = require('bl/BufferList.js');\nvar rabinWasm = require('rabin-wasm');\nvar errCode = require('err-code');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar BufferList__default = /*#__PURE__*/_interopDefaultLegacy(BufferList);\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\n\nasync function* rabinChunker(source, options) {\n let min, max, avg;\n if (options.minChunkSize && options.maxChunkSize && options.avgChunkSize) {\n avg = options.avgChunkSize;\n min = options.minChunkSize;\n max = options.maxChunkSize;\n } else if (!options.avgChunkSize) {\n throw errCode__default['default'](new Error('please specify an average chunk size'), 'ERR_INVALID_AVG_CHUNK_SIZE');\n } else {\n avg = options.avgChunkSize;\n min = avg / 3;\n max = avg + avg / 2;\n }\n if (min < 16) {\n throw errCode__default['default'](new Error('rabin min must be greater than 16'), 'ERR_INVALID_MIN_CHUNK_SIZE');\n }\n if (max < min) {\n max = min;\n }\n if (avg < min) {\n avg = min;\n }\n const sizepow = Math.floor(Math.log2(avg));\n for await (const chunk of rabin(source, {\n min: min,\n max: max,\n bits: sizepow,\n window: options.window,\n polynomial: options.polynomial\n })) {\n yield chunk;\n }\n}\nasync function* rabin(source, options) {\n const r = await rabinWasm.create(options.bits, options.min, options.max, options.window);\n const buffers = new BufferList__default['default']();\n for await (const chunk of source) {\n buffers.append(chunk);\n const sizes = r.fingerprint(chunk);\n for (let i = 0; i < sizes.length; i++) {\n const size = sizes[i];\n const buf = buffers.slice(0, size);\n buffers.consume(size);\n yield buf;\n }\n }\n if (buffers.length) {\n yield buffers.slice(0);\n }\n}\n\nmodule.exports = rabinChunker;\n","'use strict';\n\nvar ipfsUnixfs = require('ipfs-unixfs');\nvar persist = require('../utils/persist.js');\nvar dagPb = require('@ipld/dag-pb');\n\nconst dirBuilder = async (item, blockstore, options) => {\n const unixfs = new ipfsUnixfs.UnixFS({\n type: 'directory',\n mtime: item.mtime,\n mode: item.mode\n });\n const buffer = dagPb.encode(dagPb.prepare({ Data: unixfs.marshal() }));\n const cid = await persist(buffer, blockstore, options);\n const path = item.path;\n return {\n cid,\n path,\n unixfs,\n size: buffer.length\n };\n};\n\nmodule.exports = dirBuilder;\n","'use strict';\n\nvar batch = require('it-batch');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar batch__default = /*#__PURE__*/_interopDefaultLegacy(batch);\n\nfunction balanced(source, reduce, options) {\n return reduceToParents(source, reduce, options);\n}\nasync function reduceToParents(source, reduce, options) {\n const roots = [];\n for await (const chunked of batch__default['default'](source, options.maxChildrenPerNode)) {\n roots.push(await reduce(chunked));\n }\n if (roots.length > 1) {\n return reduceToParents(roots, reduce, options);\n }\n return roots[0];\n}\n\nmodule.exports = balanced;\n","'use strict';\n\nvar ipfsUnixfs = require('ipfs-unixfs');\nvar persist = require('../../utils/persist.js');\nvar dagPb = require('@ipld/dag-pb');\nvar rawCodec = require('multiformats/codecs/raw');\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () {\n return e[k];\n }\n });\n }\n });\n }\n n['default'] = e;\n return Object.freeze(n);\n}\n\nvar dagPb__namespace = /*#__PURE__*/_interopNamespace(dagPb);\nvar rawCodec__namespace = /*#__PURE__*/_interopNamespace(rawCodec);\n\nasync function* bufferImporter(file, block, options) {\n for await (let buffer of file.content) {\n yield async () => {\n options.progress(buffer.length, file.path);\n let unixfs;\n const opts = {\n codec: dagPb__namespace,\n cidVersion: options.cidVersion,\n hasher: options.hasher,\n onlyHash: options.onlyHash\n };\n if (options.rawLeaves) {\n opts.codec = rawCodec__namespace;\n opts.cidVersion = 1;\n } else {\n unixfs = new ipfsUnixfs.UnixFS({\n type: options.leafType,\n data: buffer,\n mtime: file.mtime,\n mode: file.mode\n });\n buffer = dagPb__namespace.encode({\n Data: unixfs.marshal(),\n Links: []\n });\n }\n return {\n cid: await persist(buffer, block, opts),\n unixfs,\n size: buffer.length\n };\n };\n }\n}\n\nmodule.exports = bufferImporter;\n","'use strict';\n\nvar all = require('it-all');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar all__default = /*#__PURE__*/_interopDefaultLegacy(all);\n\nasync function flat(source, reduce) {\n return reduce(await all__default['default'](source));\n}\n\nmodule.exports = flat;\n","'use strict';\n\nvar errCode = require('err-code');\nvar ipfsUnixfs = require('ipfs-unixfs');\nvar persist = require('../../utils/persist.js');\nvar dagPb = require('@ipld/dag-pb');\nvar parallelBatch = require('it-parallel-batch');\nvar rawCodec = require('multiformats/codecs/raw');\nvar flat = require('./flat.js');\nvar balanced = require('./balanced.js');\nvar trickle = require('./trickle.js');\nvar bufferImporter = require('./buffer-importer.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () {\n return e[k];\n }\n });\n }\n });\n }\n n['default'] = e;\n return Object.freeze(n);\n}\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\nvar dagPb__namespace = /*#__PURE__*/_interopNamespace(dagPb);\nvar parallelBatch__default = /*#__PURE__*/_interopDefaultLegacy(parallelBatch);\nvar rawCodec__namespace = /*#__PURE__*/_interopNamespace(rawCodec);\n\nconst dagBuilders = {\n flat: flat,\n balanced: balanced,\n trickle: trickle\n};\nasync function* buildFileBatch(file, blockstore, options) {\n let count = -1;\n let previous;\n let bufferImporter$1;\n if (typeof options.bufferImporter === 'function') {\n bufferImporter$1 = options.bufferImporter;\n } else {\n bufferImporter$1 = bufferImporter;\n }\n for await (const entry of parallelBatch__default['default'](bufferImporter$1(file, blockstore, options), options.blockWriteConcurrency)) {\n count++;\n if (count === 0) {\n previous = entry;\n continue;\n } else if (count === 1 && previous) {\n yield previous;\n previous = null;\n }\n yield entry;\n }\n if (previous) {\n previous.single = true;\n yield previous;\n }\n}\nconst reduce = (file, blockstore, options) => {\n async function reducer(leaves) {\n if (leaves.length === 1 && leaves[0].single && options.reduceSingleLeafToSelf) {\n const leaf = leaves[0];\n if (leaf.cid.code === rawCodec__namespace.code && (file.mtime !== undefined || file.mode !== undefined)) {\n let buffer = await blockstore.get(leaf.cid);\n leaf.unixfs = new ipfsUnixfs.UnixFS({\n type: 'file',\n mtime: file.mtime,\n mode: file.mode,\n data: buffer\n });\n buffer = dagPb.encode(dagPb.prepare({ Data: leaf.unixfs.marshal() }));\n leaf.cid = await persist(buffer, blockstore, {\n ...options,\n codec: dagPb__namespace,\n hasher: options.hasher,\n cidVersion: options.cidVersion\n });\n leaf.size = buffer.length;\n }\n return {\n cid: leaf.cid,\n path: file.path,\n unixfs: leaf.unixfs,\n size: leaf.size\n };\n }\n const f = new ipfsUnixfs.UnixFS({\n type: 'file',\n mtime: file.mtime,\n mode: file.mode\n });\n const links = leaves.filter(leaf => {\n if (leaf.cid.code === rawCodec__namespace.code && leaf.size) {\n return true;\n }\n if (leaf.unixfs && !leaf.unixfs.data && leaf.unixfs.fileSize()) {\n return true;\n }\n return Boolean(leaf.unixfs && leaf.unixfs.data && leaf.unixfs.data.length);\n }).map(leaf => {\n if (leaf.cid.code === rawCodec__namespace.code) {\n f.addBlockSize(leaf.size);\n return {\n Name: '',\n Tsize: leaf.size,\n Hash: leaf.cid\n };\n }\n if (!leaf.unixfs || !leaf.unixfs.data) {\n f.addBlockSize(leaf.unixfs && leaf.unixfs.fileSize() || 0);\n } else {\n f.addBlockSize(leaf.unixfs.data.length);\n }\n return {\n Name: '',\n Tsize: leaf.size,\n Hash: leaf.cid\n };\n });\n const node = {\n Data: f.marshal(),\n Links: links\n };\n const buffer = dagPb.encode(dagPb.prepare(node));\n const cid = await persist(buffer, blockstore, options);\n return {\n cid,\n path: file.path,\n unixfs: f,\n size: buffer.length + node.Links.reduce((acc, curr) => acc + curr.Tsize, 0)\n };\n }\n return reducer;\n};\nfunction fileBuilder(file, block, options) {\n const dagBuilder = dagBuilders[options.strategy];\n if (!dagBuilder) {\n throw errCode__default['default'](new Error(`Unknown importer build strategy name: ${ options.strategy }`), 'ERR_BAD_STRATEGY');\n }\n return dagBuilder(buildFileBatch(file, block, options), reduce(file, block, options), options);\n}\n\nmodule.exports = fileBuilder;\n","'use strict';\n\nvar batch = require('it-batch');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar batch__default = /*#__PURE__*/_interopDefaultLegacy(batch);\n\nasync function trickleStream(source, reduce, options) {\n const root = new Root(options.layerRepeat);\n let iteration = 0;\n let maxDepth = 1;\n let subTree = root;\n for await (const layer of batch__default['default'](source, options.maxChildrenPerNode)) {\n if (subTree.isFull()) {\n if (subTree !== root) {\n root.addChild(await subTree.reduce(reduce));\n }\n if (iteration && iteration % options.layerRepeat === 0) {\n maxDepth++;\n }\n subTree = new SubTree(maxDepth, options.layerRepeat, iteration);\n iteration++;\n }\n subTree.append(layer);\n }\n if (subTree && subTree !== root) {\n root.addChild(await subTree.reduce(reduce));\n }\n return root.reduce(reduce);\n}\nclass SubTree {\n constructor(maxDepth, layerRepeat, iteration = 0) {\n this.maxDepth = maxDepth;\n this.layerRepeat = layerRepeat;\n this.currentDepth = 1;\n this.iteration = iteration;\n this.root = this.node = this.parent = {\n children: [],\n depth: this.currentDepth,\n maxDepth,\n maxChildren: (this.maxDepth - this.currentDepth) * this.layerRepeat\n };\n }\n isFull() {\n if (!this.root.data) {\n return false;\n }\n if (this.currentDepth < this.maxDepth && this.node.maxChildren) {\n this._addNextNodeToParent(this.node);\n return false;\n }\n const distantRelative = this._findParent(this.node, this.currentDepth);\n if (distantRelative) {\n this._addNextNodeToParent(distantRelative);\n return false;\n }\n return true;\n }\n _addNextNodeToParent(parent) {\n this.parent = parent;\n const nextNode = {\n children: [],\n depth: parent.depth + 1,\n parent,\n maxDepth: this.maxDepth,\n maxChildren: Math.floor(parent.children.length / this.layerRepeat) * this.layerRepeat\n };\n parent.children.push(nextNode);\n this.currentDepth = nextNode.depth;\n this.node = nextNode;\n }\n append(layer) {\n this.node.data = layer;\n }\n reduce(reduce) {\n return this._reduce(this.root, reduce);\n }\n async _reduce(node, reduce) {\n let children = [];\n if (node.children.length) {\n children = await Promise.all(node.children.filter(child => child.data).map(child => this._reduce(child, reduce)));\n }\n return reduce((node.data || []).concat(children));\n }\n _findParent(node, depth) {\n const parent = node.parent;\n if (!parent || parent.depth === 0) {\n return;\n }\n if (parent.children.length === parent.maxChildren || !parent.maxChildren) {\n return this._findParent(parent, depth);\n }\n return parent;\n }\n}\nclass Root extends SubTree {\n constructor(layerRepeat) {\n super(0, layerRepeat);\n this.root.depth = 0;\n this.currentDepth = 1;\n }\n addChild(child) {\n this.root.children.push(child);\n }\n reduce(reduce) {\n return reduce((this.root.data || []).concat(this.root.children));\n }\n}\n\nmodule.exports = trickleStream;\n","'use strict';\n\nvar dir = require('./dir.js');\nvar index = require('./file/index.js');\nvar errCode = require('err-code');\nvar rabin = require('../chunker/rabin.js');\nvar fixedSize = require('../chunker/fixed-size.js');\nvar validateChunks = require('./validate-chunks.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\n\nfunction isIterable(thing) {\n return Symbol.iterator in thing;\n}\nfunction isAsyncIterable(thing) {\n return Symbol.asyncIterator in thing;\n}\nfunction contentAsAsyncIterable(content) {\n try {\n if (content instanceof Uint8Array) {\n return async function* () {\n yield content;\n }();\n } else if (isIterable(content)) {\n return async function* () {\n yield* content;\n }();\n } else if (isAsyncIterable(content)) {\n return content;\n }\n } catch {\n throw errCode__default['default'](new Error('Content was invalid'), 'ERR_INVALID_CONTENT');\n }\n throw errCode__default['default'](new Error('Content was invalid'), 'ERR_INVALID_CONTENT');\n}\nasync function* dagBuilder(source, blockstore, options) {\n for await (const entry of source) {\n if (entry.path) {\n if (entry.path.substring(0, 2) === './') {\n options.wrapWithDirectory = true;\n }\n entry.path = entry.path.split('/').filter(path => path && path !== '.').join('/');\n }\n if (entry.content) {\n let chunker;\n if (typeof options.chunker === 'function') {\n chunker = options.chunker;\n } else if (options.chunker === 'rabin') {\n chunker = rabin;\n } else {\n chunker = fixedSize;\n }\n let chunkValidator;\n if (typeof options.chunkValidator === 'function') {\n chunkValidator = options.chunkValidator;\n } else {\n chunkValidator = validateChunks;\n }\n const file = {\n path: entry.path,\n mtime: entry.mtime,\n mode: entry.mode,\n content: chunker(chunkValidator(contentAsAsyncIterable(entry.content), options), options)\n };\n yield () => index(file, blockstore, options);\n } else if (entry.path) {\n const dir$1 = {\n path: entry.path,\n mtime: entry.mtime,\n mode: entry.mode\n };\n yield () => dir(dir$1, blockstore, options);\n } else {\n throw new Error('Import candidate must have content or path or both');\n }\n }\n}\n\nmodule.exports = dagBuilder;\n","'use strict';\n\nvar errCode = require('err-code');\nvar fromString = require('uint8arrays/from-string');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\n\nasync function* validateChunks(source) {\n for await (const content of source) {\n if (content.length === undefined) {\n throw errCode__default['default'](new Error('Content was invalid'), 'ERR_INVALID_CONTENT');\n }\n if (typeof content === 'string' || content instanceof String) {\n yield fromString.fromString(content.toString());\n } else if (Array.isArray(content)) {\n yield Uint8Array.from(content);\n } else if (content instanceof Uint8Array) {\n yield content;\n } else {\n throw errCode__default['default'](new Error('Content was invalid'), 'ERR_INVALID_CONTENT');\n }\n }\n}\n\nmodule.exports = validateChunks;\n","'use strict';\n\nvar dagPb = require('@ipld/dag-pb');\nvar ipfsUnixfs = require('ipfs-unixfs');\nvar dir = require('./dir.js');\nvar persist = require('./utils/persist.js');\n\nclass DirFlat extends dir {\n constructor(props, options) {\n super(props, options);\n this._children = {};\n }\n async put(name, value) {\n this.cid = undefined;\n this.size = undefined;\n this._children[name] = value;\n }\n get(name) {\n return Promise.resolve(this._children[name]);\n }\n childCount() {\n return Object.keys(this._children).length;\n }\n directChildrenCount() {\n return this.childCount();\n }\n onlyChild() {\n return this._children[Object.keys(this._children)[0]];\n }\n async *eachChildSeries() {\n const keys = Object.keys(this._children);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n yield {\n key: key,\n child: this._children[key]\n };\n }\n }\n async *flush(block) {\n const children = Object.keys(this._children);\n const links = [];\n for (let i = 0; i < children.length; i++) {\n let child = this._children[children[i]];\n if (child instanceof dir) {\n for await (const entry of child.flush(block)) {\n child = entry;\n yield child;\n }\n }\n if (child.size != null && child.cid) {\n links.push({\n Name: children[i],\n Tsize: child.size,\n Hash: child.cid\n });\n }\n }\n const unixfs = new ipfsUnixfs.UnixFS({\n type: 'directory',\n mtime: this.mtime,\n mode: this.mode\n });\n const node = {\n Data: unixfs.marshal(),\n Links: links\n };\n const buffer = dagPb.encode(dagPb.prepare(node));\n const cid = await persist(buffer, block, this.options);\n const size = buffer.length + node.Links.reduce((acc, curr) => acc + (curr.Tsize == null ? 0 : curr.Tsize), 0);\n this.cid = cid;\n this.size = size;\n yield {\n cid,\n unixfs,\n path: this.path,\n size\n };\n }\n}\n\nmodule.exports = DirFlat;\n","'use strict';\n\nvar dagPb = require('@ipld/dag-pb');\nvar ipfsUnixfs = require('ipfs-unixfs');\nvar dir = require('./dir.js');\nvar persist = require('./utils/persist.js');\nvar hamtSharding = require('hamt-sharding');\n\nclass DirSharded extends dir {\n constructor(props, options) {\n super(props, options);\n this._bucket = hamtSharding.createHAMT({\n hashFn: options.hamtHashFn,\n bits: options.hamtBucketBits\n });\n }\n async put(name, value) {\n await this._bucket.put(name, value);\n }\n get(name) {\n return this._bucket.get(name);\n }\n childCount() {\n return this._bucket.leafCount();\n }\n directChildrenCount() {\n return this._bucket.childrenCount();\n }\n onlyChild() {\n return this._bucket.onlyChild();\n }\n async *eachChildSeries() {\n for await (const {key, value} of this._bucket.eachLeafSeries()) {\n yield {\n key,\n child: value\n };\n }\n }\n async *flush(blockstore) {\n for await (const entry of flush(this._bucket, blockstore, this, this.options)) {\n yield {\n ...entry,\n path: this.path\n };\n }\n }\n}\nasync function* flush(bucket, blockstore, shardRoot, options) {\n const children = bucket._children;\n const links = [];\n let childrenSize = 0;\n for (let i = 0; i < children.length; i++) {\n const child = children.get(i);\n if (!child) {\n continue;\n }\n const labelPrefix = i.toString(16).toUpperCase().padStart(2, '0');\n if (child instanceof hamtSharding.Bucket) {\n let shard;\n for await (const subShard of await flush(child, blockstore, null, options)) {\n shard = subShard;\n }\n if (!shard) {\n throw new Error('Could not flush sharded directory, no subshard found');\n }\n links.push({\n Name: labelPrefix,\n Tsize: shard.size,\n Hash: shard.cid\n });\n childrenSize += shard.size;\n } else if (typeof child.value.flush === 'function') {\n const dir = child.value;\n let flushedDir;\n for await (const entry of dir.flush(blockstore)) {\n flushedDir = entry;\n yield flushedDir;\n }\n const label = labelPrefix + child.key;\n links.push({\n Name: label,\n Tsize: flushedDir.size,\n Hash: flushedDir.cid\n });\n childrenSize += flushedDir.size;\n } else {\n const value = child.value;\n if (!value.cid) {\n continue;\n }\n const label = labelPrefix + child.key;\n const size = value.size;\n links.push({\n Name: label,\n Tsize: size,\n Hash: value.cid\n });\n childrenSize += size;\n }\n }\n const data = Uint8Array.from(children.bitField().reverse());\n const dir = new ipfsUnixfs.UnixFS({\n type: 'hamt-sharded-directory',\n data,\n fanout: bucket.tableSize(),\n hashType: options.hamtHashCode,\n mtime: shardRoot && shardRoot.mtime,\n mode: shardRoot && shardRoot.mode\n });\n const node = {\n Data: dir.marshal(),\n Links: links\n };\n const buffer = dagPb.encode(dagPb.prepare(node));\n const cid = await persist(buffer, blockstore, options);\n const size = buffer.length + childrenSize;\n yield {\n cid,\n unixfs: dir,\n size\n };\n}\n\nmodule.exports = DirSharded;\n","'use strict';\n\nclass Dir {\n constructor(props, options) {\n this.options = options || {};\n this.root = props.root;\n this.dir = props.dir;\n this.path = props.path;\n this.dirty = props.dirty;\n this.flat = props.flat;\n this.parent = props.parent;\n this.parentKey = props.parentKey;\n this.unixfs = props.unixfs;\n this.mode = props.mode;\n this.mtime = props.mtime;\n this.cid = undefined;\n this.size = undefined;\n }\n async put(name, value) {\n }\n get(name) {\n return Promise.resolve(this);\n }\n async *eachChildSeries() {\n }\n async *flush(blockstore) {\n }\n}\n\nmodule.exports = Dir;\n","'use strict';\n\nvar dirSharded = require('./dir-sharded.js');\nvar dirFlat = require('./dir-flat.js');\n\nasync function flatToShard(child, dir, threshold, options) {\n let newDir = dir;\n if (dir instanceof dirFlat && dir.directChildrenCount() >= threshold) {\n newDir = await convertToShard(dir, options);\n }\n const parent = newDir.parent;\n if (parent) {\n if (newDir !== dir) {\n if (child) {\n child.parent = newDir;\n }\n if (!newDir.parentKey) {\n throw new Error('No parent key found');\n }\n await parent.put(newDir.parentKey, newDir);\n }\n return flatToShard(newDir, parent, threshold, options);\n }\n return newDir;\n}\nasync function convertToShard(oldDir, options) {\n const newDir = new dirSharded({\n root: oldDir.root,\n dir: true,\n parent: oldDir.parent,\n parentKey: oldDir.parentKey,\n path: oldDir.path,\n dirty: oldDir.dirty,\n flat: false,\n mtime: oldDir.mtime,\n mode: oldDir.mode\n }, options);\n for await (const {key, child} of oldDir.eachChildSeries()) {\n await newDir.put(key, child);\n }\n return newDir;\n}\n\nmodule.exports = flatToShard;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar parallelBatch = require('it-parallel-batch');\nvar options = require('./options.js');\nvar index = require('./dag-builder/index.js');\nvar treeBuilder = require('./tree-builder.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar parallelBatch__default = /*#__PURE__*/_interopDefaultLegacy(parallelBatch);\n\nasync function* importer(source, blockstore, options$1 = {}) {\n const opts = options(options$1);\n let dagBuilder;\n if (typeof options$1.dagBuilder === 'function') {\n dagBuilder = options$1.dagBuilder;\n } else {\n dagBuilder = index;\n }\n let treeBuilder$1;\n if (typeof options$1.treeBuilder === 'function') {\n treeBuilder$1 = options$1.treeBuilder;\n } else {\n treeBuilder$1 = treeBuilder;\n }\n let candidates;\n if (Symbol.asyncIterator in source || Symbol.iterator in source) {\n candidates = source;\n } else {\n candidates = [source];\n }\n for await (const entry of treeBuilder$1(parallelBatch__default['default'](dagBuilder(candidates, blockstore, opts), opts.fileImportConcurrency), blockstore, opts)) {\n yield {\n cid: entry.cid,\n path: entry.path,\n unixfs: entry.unixfs,\n size: entry.size\n };\n }\n}\n\nexports.importer = importer;\n","'use strict';\n\nvar mergeOptions = require('merge-options');\nvar sha2 = require('multiformats/hashes/sha2');\nvar murmur3 = require('@multiformats/murmur3');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar mergeOptions__default = /*#__PURE__*/_interopDefaultLegacy(mergeOptions);\n\nasync function hamtHashFn(buf) {\n return (await murmur3.murmur3128.encode(buf)).slice(0, 8).reverse();\n}\nconst defaultOptions = {\n chunker: 'fixed',\n strategy: 'balanced',\n rawLeaves: false,\n onlyHash: false,\n reduceSingleLeafToSelf: true,\n hasher: sha2.sha256,\n leafType: 'file',\n cidVersion: 0,\n progress: () => () => {\n },\n shardSplitThreshold: 1000,\n fileImportConcurrency: 50,\n blockWriteConcurrency: 10,\n minChunkSize: 262144,\n maxChunkSize: 262144,\n avgChunkSize: 262144,\n window: 16,\n polynomial: 17437180132763652,\n maxChildrenPerNode: 174,\n layerRepeat: 4,\n wrapWithDirectory: false,\n recursive: false,\n hidden: false,\n timeout: undefined,\n hamtHashFn,\n hamtHashCode: 34,\n hamtBucketBits: 8\n};\nvar defaultOptions$1 = (options = {}) => {\n const defaults = mergeOptions__default['default'].bind({ ignoreUndefined: true });\n return defaults(defaultOptions, options);\n};\n\nmodule.exports = defaultOptions$1;\n","'use strict';\n\nvar dirFlat = require('./dir-flat.js');\nvar flatToShard = require('./flat-to-shard.js');\nvar dir = require('./dir.js');\nvar toPathComponents = require('./utils/to-path-components.js');\n\nasync function addToTree(elem, tree, options) {\n const pathElems = toPathComponents(elem.path || '');\n const lastIndex = pathElems.length - 1;\n let parent = tree;\n let currentPath = '';\n for (let i = 0; i < pathElems.length; i++) {\n const pathElem = pathElems[i];\n currentPath += `${ currentPath ? '/' : '' }${ pathElem }`;\n const last = i === lastIndex;\n parent.dirty = true;\n parent.cid = undefined;\n parent.size = undefined;\n if (last) {\n await parent.put(pathElem, elem);\n tree = await flatToShard(null, parent, options.shardSplitThreshold, options);\n } else {\n let dir$1 = await parent.get(pathElem);\n if (!dir$1 || !(dir$1 instanceof dir)) {\n dir$1 = new dirFlat({\n root: false,\n dir: true,\n parent: parent,\n parentKey: pathElem,\n path: currentPath,\n dirty: true,\n flat: true,\n mtime: dir$1 && dir$1.unixfs && dir$1.unixfs.mtime,\n mode: dir$1 && dir$1.unixfs && dir$1.unixfs.mode\n }, options);\n }\n await parent.put(pathElem, dir$1);\n parent = dir$1;\n }\n }\n return tree;\n}\nasync function* flushAndYield(tree, blockstore) {\n if (!(tree instanceof dir)) {\n if (tree && tree.unixfs && tree.unixfs.isDirectory()) {\n yield tree;\n }\n return;\n }\n yield* tree.flush(blockstore);\n}\nasync function* treeBuilder(source, block, options) {\n let tree = new dirFlat({\n root: true,\n dir: true,\n path: '',\n dirty: true,\n flat: true\n }, options);\n for await (const entry of source) {\n if (!entry) {\n continue;\n }\n tree = await addToTree(entry, tree, options);\n if (!entry.unixfs || !entry.unixfs.isDirectory()) {\n yield entry;\n }\n }\n if (options.wrapWithDirectory) {\n yield* flushAndYield(tree, block);\n } else {\n for await (const unwrapped of tree.eachChildSeries()) {\n if (!unwrapped) {\n continue;\n }\n yield* flushAndYield(unwrapped.child, block);\n }\n }\n}\n\nmodule.exports = treeBuilder;\n","'use strict';\n\nvar cid = require('multiformats/cid');\nvar dagPb = require('@ipld/dag-pb');\nvar sha2 = require('multiformats/hashes/sha2');\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () {\n return e[k];\n }\n });\n }\n });\n }\n n['default'] = e;\n return Object.freeze(n);\n}\n\nvar dagPb__namespace = /*#__PURE__*/_interopNamespace(dagPb);\n\nconst persist = async (buffer, blockstore, options) => {\n if (!options.codec) {\n options.codec = dagPb__namespace;\n }\n if (!options.hasher) {\n options.hasher = sha2.sha256;\n }\n if (options.cidVersion === undefined) {\n options.cidVersion = 1;\n }\n if (options.codec === dagPb__namespace && options.hasher !== sha2.sha256) {\n options.cidVersion = 1;\n }\n const multihash = await options.hasher.digest(buffer);\n const cid$1 = cid.CID.create(options.cidVersion, options.codec.code, multihash);\n if (!options.onlyHash) {\n await blockstore.put(cid$1, buffer, { signal: options.signal });\n }\n return cid$1;\n};\n\nmodule.exports = persist;\n","'use strict';\n\nconst toPathComponents = (path = '') => {\n return (path.trim().match(/([^\\\\^/]|\\\\\\/)+/g) || []).filter(Boolean);\n};\n\nmodule.exports = toPathComponents;\n","'use strict'\n\nconst { Buffer } = require('buffer')\nconst symbol = Symbol.for('BufferList')\n\nfunction BufferList (buf) {\n if (!(this instanceof BufferList)) {\n return new BufferList(buf)\n }\n\n BufferList._init.call(this, buf)\n}\n\nBufferList._init = function _init (buf) {\n Object.defineProperty(this, symbol, { value: true })\n\n this._bufs = []\n this.length = 0\n\n if (buf) {\n this.append(buf)\n }\n}\n\nBufferList.prototype._new = function _new (buf) {\n return new BufferList(buf)\n}\n\nBufferList.prototype._offset = function _offset (offset) {\n if (offset === 0) {\n return [0, 0]\n }\n\n let tot = 0\n\n for (let i = 0; i < this._bufs.length; i++) {\n const _t = tot + this._bufs[i].length\n if (offset < _t || i === this._bufs.length - 1) {\n return [i, offset - tot]\n }\n tot = _t\n }\n}\n\nBufferList.prototype._reverseOffset = function (blOffset) {\n const bufferId = blOffset[0]\n let offset = blOffset[1]\n\n for (let i = 0; i < bufferId; i++) {\n offset += this._bufs[i].length\n }\n\n return offset\n}\n\nBufferList.prototype.get = function get (index) {\n if (index > this.length || index < 0) {\n return undefined\n }\n\n const offset = this._offset(index)\n\n return this._bufs[offset[0]][offset[1]]\n}\n\nBufferList.prototype.slice = function slice (start, end) {\n if (typeof start === 'number' && start < 0) {\n start += this.length\n }\n\n if (typeof end === 'number' && end < 0) {\n end += this.length\n }\n\n return this.copy(null, 0, start, end)\n}\n\nBufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) {\n if (typeof srcStart !== 'number' || srcStart < 0) {\n srcStart = 0\n }\n\n if (typeof srcEnd !== 'number' || srcEnd > this.length) {\n srcEnd = this.length\n }\n\n if (srcStart >= this.length) {\n return dst || Buffer.alloc(0)\n }\n\n if (srcEnd <= 0) {\n return dst || Buffer.alloc(0)\n }\n\n const copy = !!dst\n const off = this._offset(srcStart)\n const len = srcEnd - srcStart\n let bytes = len\n let bufoff = (copy && dstStart) || 0\n let start = off[1]\n\n // copy/slice everything\n if (srcStart === 0 && srcEnd === this.length) {\n if (!copy) {\n // slice, but full concat if multiple buffers\n return this._bufs.length === 1\n ? this._bufs[0]\n : Buffer.concat(this._bufs, this.length)\n }\n\n // copy, need to copy individual buffers\n for (let i = 0; i < this._bufs.length; i++) {\n this._bufs[i].copy(dst, bufoff)\n bufoff += this._bufs[i].length\n }\n\n return dst\n }\n\n // easy, cheap case where it's a subset of one of the buffers\n if (bytes <= this._bufs[off[0]].length - start) {\n return copy\n ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes)\n : this._bufs[off[0]].slice(start, start + bytes)\n }\n\n if (!copy) {\n // a slice, we need something to copy in to\n dst = Buffer.allocUnsafe(len)\n }\n\n for (let i = off[0]; i < this._bufs.length; i++) {\n const l = this._bufs[i].length - start\n\n if (bytes > l) {\n this._bufs[i].copy(dst, bufoff, start)\n bufoff += l\n } else {\n this._bufs[i].copy(dst, bufoff, start, start + bytes)\n bufoff += l\n break\n }\n\n bytes -= l\n\n if (start) {\n start = 0\n }\n }\n\n // safeguard so that we don't return uninitialized memory\n if (dst.length > bufoff) return dst.slice(0, bufoff)\n\n return dst\n}\n\nBufferList.prototype.shallowSlice = function shallowSlice (start, end) {\n start = start || 0\n end = typeof end !== 'number' ? this.length : end\n\n if (start < 0) {\n start += this.length\n }\n\n if (end < 0) {\n end += this.length\n }\n\n if (start === end) {\n return this._new()\n }\n\n const startOffset = this._offset(start)\n const endOffset = this._offset(end)\n const buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1)\n\n if (endOffset[1] === 0) {\n buffers.pop()\n } else {\n buffers[buffers.length - 1] = buffers[buffers.length - 1].slice(0, endOffset[1])\n }\n\n if (startOffset[1] !== 0) {\n buffers[0] = buffers[0].slice(startOffset[1])\n }\n\n return this._new(buffers)\n}\n\nBufferList.prototype.toString = function toString (encoding, start, end) {\n return this.slice(start, end).toString(encoding)\n}\n\nBufferList.prototype.consume = function consume (bytes) {\n // first, normalize the argument, in accordance with how Buffer does it\n bytes = Math.trunc(bytes)\n // do nothing if not a positive number\n if (Number.isNaN(bytes) || bytes <= 0) return this\n\n while (this._bufs.length) {\n if (bytes >= this._bufs[0].length) {\n bytes -= this._bufs[0].length\n this.length -= this._bufs[0].length\n this._bufs.shift()\n } else {\n this._bufs[0] = this._bufs[0].slice(bytes)\n this.length -= bytes\n break\n }\n }\n\n return this\n}\n\nBufferList.prototype.duplicate = function duplicate () {\n const copy = this._new()\n\n for (let i = 0; i < this._bufs.length; i++) {\n copy.append(this._bufs[i])\n }\n\n return copy\n}\n\nBufferList.prototype.append = function append (buf) {\n if (buf == null) {\n return this\n }\n\n if (buf.buffer) {\n // append a view of the underlying ArrayBuffer\n this._appendBuffer(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength))\n } else if (Array.isArray(buf)) {\n for (let i = 0; i < buf.length; i++) {\n this.append(buf[i])\n }\n } else if (this._isBufferList(buf)) {\n // unwrap argument into individual BufferLists\n for (let i = 0; i < buf._bufs.length; i++) {\n this.append(buf._bufs[i])\n }\n } else {\n // coerce number arguments to strings, since Buffer(number) does\n // uninitialized memory allocation\n if (typeof buf === 'number') {\n buf = buf.toString()\n }\n\n this._appendBuffer(Buffer.from(buf))\n }\n\n return this\n}\n\nBufferList.prototype._appendBuffer = function appendBuffer (buf) {\n this._bufs.push(buf)\n this.length += buf.length\n}\n\nBufferList.prototype.indexOf = function (search, offset, encoding) {\n if (encoding === undefined && typeof offset === 'string') {\n encoding = offset\n offset = undefined\n }\n\n if (typeof search === 'function' || Array.isArray(search)) {\n throw new TypeError('The \"value\" argument must be one of type string, Buffer, BufferList, or Uint8Array.')\n } else if (typeof search === 'number') {\n search = Buffer.from([search])\n } else if (typeof search === 'string') {\n search = Buffer.from(search, encoding)\n } else if (this._isBufferList(search)) {\n search = search.slice()\n } else if (Array.isArray(search.buffer)) {\n search = Buffer.from(search.buffer, search.byteOffset, search.byteLength)\n } else if (!Buffer.isBuffer(search)) {\n search = Buffer.from(search)\n }\n\n offset = Number(offset || 0)\n\n if (isNaN(offset)) {\n offset = 0\n }\n\n if (offset < 0) {\n offset = this.length + offset\n }\n\n if (offset < 0) {\n offset = 0\n }\n\n if (search.length === 0) {\n return offset > this.length ? this.length : offset\n }\n\n const blOffset = this._offset(offset)\n let blIndex = blOffset[0] // index of which internal buffer we're working on\n let buffOffset = blOffset[1] // offset of the internal buffer we're working on\n\n // scan over each buffer\n for (; blIndex < this._bufs.length; blIndex++) {\n const buff = this._bufs[blIndex]\n\n while (buffOffset < buff.length) {\n const availableWindow = buff.length - buffOffset\n\n if (availableWindow >= search.length) {\n const nativeSearchResult = buff.indexOf(search, buffOffset)\n\n if (nativeSearchResult !== -1) {\n return this._reverseOffset([blIndex, nativeSearchResult])\n }\n\n buffOffset = buff.length - search.length + 1 // end of native search window\n } else {\n const revOffset = this._reverseOffset([blIndex, buffOffset])\n\n if (this._match(revOffset, search)) {\n return revOffset\n }\n\n buffOffset++\n }\n }\n\n buffOffset = 0\n }\n\n return -1\n}\n\nBufferList.prototype._match = function (offset, search) {\n if (this.length - offset < search.length) {\n return false\n }\n\n for (let searchOffset = 0; searchOffset < search.length; searchOffset++) {\n if (this.get(offset + searchOffset) !== search[searchOffset]) {\n return false\n }\n }\n return true\n}\n\n;(function () {\n const methods = {\n readDoubleBE: 8,\n readDoubleLE: 8,\n readFloatBE: 4,\n readFloatLE: 4,\n readInt32BE: 4,\n readInt32LE: 4,\n readUInt32BE: 4,\n readUInt32LE: 4,\n readInt16BE: 2,\n readInt16LE: 2,\n readUInt16BE: 2,\n readUInt16LE: 2,\n readInt8: 1,\n readUInt8: 1,\n readIntBE: null,\n readIntLE: null,\n readUIntBE: null,\n readUIntLE: null\n }\n\n for (const m in methods) {\n (function (m) {\n if (methods[m] === null) {\n BufferList.prototype[m] = function (offset, byteLength) {\n return this.slice(offset, offset + byteLength)[m](0, byteLength)\n }\n } else {\n BufferList.prototype[m] = function (offset = 0) {\n return this.slice(offset, offset + methods[m])[m](0)\n }\n }\n }(m))\n }\n}())\n\n// Used internally by the class and also as an indicator of this object being\n// a `BufferList`. It's not possible to use `instanceof BufferList` in a browser\n// environment because there could be multiple different copies of the\n// BufferList class and some `BufferList`s might be `BufferList`s.\nBufferList.prototype._isBufferList = function _isBufferList (b) {\n return b instanceof BufferList || BufferList.isBufferList(b)\n}\n\nBufferList.isBufferList = function isBufferList (b) {\n return b != null && b[symbol]\n}\n\nmodule.exports = BufferList\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar errcode = require('err-code');\nvar unixfs = require('./unixfs.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar errcode__default = /*#__PURE__*/_interopDefaultLegacy(errcode);\n\nconst PBData = unixfs.Data;\nconst types = [\n 'raw',\n 'directory',\n 'file',\n 'metadata',\n 'symlink',\n 'hamt-sharded-directory'\n];\nconst dirTypes = [\n 'directory',\n 'hamt-sharded-directory'\n];\nconst DEFAULT_FILE_MODE = parseInt('0644', 8);\nconst DEFAULT_DIRECTORY_MODE = parseInt('0755', 8);\nfunction parseMode(mode) {\n if (mode == null) {\n return undefined;\n }\n if (typeof mode === 'number') {\n return mode & 4095;\n }\n mode = mode.toString();\n if (mode.substring(0, 1) === '0') {\n return parseInt(mode, 8) & 4095;\n }\n return parseInt(mode, 10) & 4095;\n}\nfunction parseMtime(input) {\n if (input == null) {\n return undefined;\n }\n let mtime;\n if (input.secs != null) {\n mtime = {\n secs: input.secs,\n nsecs: input.nsecs\n };\n }\n if (input.Seconds != null) {\n mtime = {\n secs: input.Seconds,\n nsecs: input.FractionalNanoseconds\n };\n }\n if (Array.isArray(input)) {\n mtime = {\n secs: input[0],\n nsecs: input[1]\n };\n }\n if (input instanceof Date) {\n const ms = input.getTime();\n const secs = Math.floor(ms / 1000);\n mtime = {\n secs: secs,\n nsecs: (ms - secs * 1000) * 1000\n };\n }\n if (!Object.prototype.hasOwnProperty.call(mtime, 'secs')) {\n return undefined;\n }\n if (mtime != null && mtime.nsecs != null && (mtime.nsecs < 0 || mtime.nsecs > 999999999)) {\n throw errcode__default['default'](new Error('mtime-nsecs must be within the range [0,999999999]'), 'ERR_INVALID_MTIME_NSECS');\n }\n return mtime;\n}\nclass UnixFS {\n static unmarshal(marshaled) {\n const message = PBData.decode(marshaled);\n const decoded = PBData.toObject(message, {\n defaults: false,\n arrays: true,\n longs: Number,\n objects: false\n });\n const data = new UnixFS({\n type: types[decoded.Type],\n data: decoded.Data,\n blockSizes: decoded.blocksizes,\n mode: decoded.mode,\n mtime: decoded.mtime ? {\n secs: decoded.mtime.Seconds,\n nsecs: decoded.mtime.FractionalNanoseconds\n } : undefined\n });\n data._originalMode = decoded.mode || 0;\n return data;\n }\n constructor(options = { type: 'file' }) {\n const {type, data, blockSizes, hashType, fanout, mtime, mode} = options;\n if (type && !types.includes(type)) {\n throw errcode__default['default'](new Error('Type: ' + type + ' is not valid'), 'ERR_INVALID_TYPE');\n }\n this.type = type || 'file';\n this.data = data;\n this.hashType = hashType;\n this.fanout = fanout;\n this.blockSizes = blockSizes || [];\n this._originalMode = 0;\n this.mode = parseMode(mode);\n if (mtime) {\n this.mtime = parseMtime(mtime);\n if (this.mtime && !this.mtime.nsecs) {\n this.mtime.nsecs = 0;\n }\n }\n }\n set mode(mode) {\n this._mode = this.isDirectory() ? DEFAULT_DIRECTORY_MODE : DEFAULT_FILE_MODE;\n const parsedMode = parseMode(mode);\n if (parsedMode !== undefined) {\n this._mode = parsedMode;\n }\n }\n get mode() {\n return this._mode;\n }\n isDirectory() {\n return Boolean(this.type && dirTypes.includes(this.type));\n }\n addBlockSize(size) {\n this.blockSizes.push(size);\n }\n removeBlockSize(index) {\n this.blockSizes.splice(index, 1);\n }\n fileSize() {\n if (this.isDirectory()) {\n return 0;\n }\n let sum = 0;\n this.blockSizes.forEach(size => {\n sum += size;\n });\n if (this.data) {\n sum += this.data.length;\n }\n return sum;\n }\n marshal() {\n let type;\n switch (this.type) {\n case 'raw':\n type = PBData.DataType.Raw;\n break;\n case 'directory':\n type = PBData.DataType.Directory;\n break;\n case 'file':\n type = PBData.DataType.File;\n break;\n case 'metadata':\n type = PBData.DataType.Metadata;\n break;\n case 'symlink':\n type = PBData.DataType.Symlink;\n break;\n case 'hamt-sharded-directory':\n type = PBData.DataType.HAMTShard;\n break;\n default:\n throw errcode__default['default'](new Error('Type: ' + type + ' is not valid'), 'ERR_INVALID_TYPE');\n }\n let data = this.data;\n if (!this.data || !this.data.length) {\n data = undefined;\n }\n let mode;\n if (this.mode != null) {\n mode = this._originalMode & 4294963200 | (parseMode(this.mode) || 0);\n if (mode === DEFAULT_FILE_MODE && !this.isDirectory()) {\n mode = undefined;\n }\n if (mode === DEFAULT_DIRECTORY_MODE && this.isDirectory()) {\n mode = undefined;\n }\n }\n let mtime;\n if (this.mtime != null) {\n const parsed = parseMtime(this.mtime);\n if (parsed) {\n mtime = {\n Seconds: parsed.secs,\n FractionalNanoseconds: parsed.nsecs\n };\n if (mtime.FractionalNanoseconds === 0) {\n delete mtime.FractionalNanoseconds;\n }\n }\n }\n const pbData = {\n Type: type,\n Data: data,\n filesize: this.isDirectory() ? undefined : this.fileSize(),\n blocksizes: this.blockSizes,\n hashType: this.hashType,\n fanout: this.fanout,\n mode,\n mtime\n };\n return PBData.encode(pbData).finish();\n }\n}\n\nexports.UnixFS = UnixFS;\nexports.parseMode = parseMode;\nexports.parseMtime = parseMtime;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar $protobuf = require('protobufjs/minimal.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar $protobuf__default = /*#__PURE__*/_interopDefaultLegacy($protobuf);\n\nconst $Reader = $protobuf__default['default'].Reader, $Writer = $protobuf__default['default'].Writer, $util = $protobuf__default['default'].util;\nconst $root = $protobuf__default['default'].roots['ipfs-unixfs'] || ($protobuf__default['default'].roots['ipfs-unixfs'] = {});\nconst Data = $root.Data = (() => {\n function Data(p) {\n this.blocksizes = [];\n if (p)\n for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)\n if (p[ks[i]] != null)\n this[ks[i]] = p[ks[i]];\n }\n Data.prototype.Type = 0;\n Data.prototype.Data = $util.newBuffer([]);\n Data.prototype.filesize = $util.Long ? $util.Long.fromBits(0, 0, true) : 0;\n Data.prototype.blocksizes = $util.emptyArray;\n Data.prototype.hashType = $util.Long ? $util.Long.fromBits(0, 0, true) : 0;\n Data.prototype.fanout = $util.Long ? $util.Long.fromBits(0, 0, true) : 0;\n Data.prototype.mode = 0;\n Data.prototype.mtime = null;\n Data.encode = function encode(m, w) {\n if (!w)\n w = $Writer.create();\n w.uint32(8).int32(m.Type);\n if (m.Data != null && Object.hasOwnProperty.call(m, 'Data'))\n w.uint32(18).bytes(m.Data);\n if (m.filesize != null && Object.hasOwnProperty.call(m, 'filesize'))\n w.uint32(24).uint64(m.filesize);\n if (m.blocksizes != null && m.blocksizes.length) {\n for (var i = 0; i < m.blocksizes.length; ++i)\n w.uint32(32).uint64(m.blocksizes[i]);\n }\n if (m.hashType != null && Object.hasOwnProperty.call(m, 'hashType'))\n w.uint32(40).uint64(m.hashType);\n if (m.fanout != null && Object.hasOwnProperty.call(m, 'fanout'))\n w.uint32(48).uint64(m.fanout);\n if (m.mode != null && Object.hasOwnProperty.call(m, 'mode'))\n w.uint32(56).uint32(m.mode);\n if (m.mtime != null && Object.hasOwnProperty.call(m, 'mtime'))\n $root.UnixTime.encode(m.mtime, w.uint32(66).fork()).ldelim();\n return w;\n };\n Data.decode = function decode(r, l) {\n if (!(r instanceof $Reader))\n r = $Reader.create(r);\n var c = l === undefined ? r.len : r.pos + l, m = new $root.Data();\n while (r.pos < c) {\n var t = r.uint32();\n switch (t >>> 3) {\n case 1:\n m.Type = r.int32();\n break;\n case 2:\n m.Data = r.bytes();\n break;\n case 3:\n m.filesize = r.uint64();\n break;\n case 4:\n if (!(m.blocksizes && m.blocksizes.length))\n m.blocksizes = [];\n if ((t & 7) === 2) {\n var c2 = r.uint32() + r.pos;\n while (r.pos < c2)\n m.blocksizes.push(r.uint64());\n } else\n m.blocksizes.push(r.uint64());\n break;\n case 5:\n m.hashType = r.uint64();\n break;\n case 6:\n m.fanout = r.uint64();\n break;\n case 7:\n m.mode = r.uint32();\n break;\n case 8:\n m.mtime = $root.UnixTime.decode(r, r.uint32());\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n if (!m.hasOwnProperty('Type'))\n throw $util.ProtocolError('missing required \\'Type\\'', { instance: m });\n return m;\n };\n Data.fromObject = function fromObject(d) {\n if (d instanceof $root.Data)\n return d;\n var m = new $root.Data();\n switch (d.Type) {\n case 'Raw':\n case 0:\n m.Type = 0;\n break;\n case 'Directory':\n case 1:\n m.Type = 1;\n break;\n case 'File':\n case 2:\n m.Type = 2;\n break;\n case 'Metadata':\n case 3:\n m.Type = 3;\n break;\n case 'Symlink':\n case 4:\n m.Type = 4;\n break;\n case 'HAMTShard':\n case 5:\n m.Type = 5;\n break;\n }\n if (d.Data != null) {\n if (typeof d.Data === 'string')\n $util.base64.decode(d.Data, m.Data = $util.newBuffer($util.base64.length(d.Data)), 0);\n else if (d.Data.length)\n m.Data = d.Data;\n }\n if (d.filesize != null) {\n if ($util.Long)\n (m.filesize = $util.Long.fromValue(d.filesize)).unsigned = true;\n else if (typeof d.filesize === 'string')\n m.filesize = parseInt(d.filesize, 10);\n else if (typeof d.filesize === 'number')\n m.filesize = d.filesize;\n else if (typeof d.filesize === 'object')\n m.filesize = new $util.LongBits(d.filesize.low >>> 0, d.filesize.high >>> 0).toNumber(true);\n }\n if (d.blocksizes) {\n if (!Array.isArray(d.blocksizes))\n throw TypeError('.Data.blocksizes: array expected');\n m.blocksizes = [];\n for (var i = 0; i < d.blocksizes.length; ++i) {\n if ($util.Long)\n (m.blocksizes[i] = $util.Long.fromValue(d.blocksizes[i])).unsigned = true;\n else if (typeof d.blocksizes[i] === 'string')\n m.blocksizes[i] = parseInt(d.blocksizes[i], 10);\n else if (typeof d.blocksizes[i] === 'number')\n m.blocksizes[i] = d.blocksizes[i];\n else if (typeof d.blocksizes[i] === 'object')\n m.blocksizes[i] = new $util.LongBits(d.blocksizes[i].low >>> 0, d.blocksizes[i].high >>> 0).toNumber(true);\n }\n }\n if (d.hashType != null) {\n if ($util.Long)\n (m.hashType = $util.Long.fromValue(d.hashType)).unsigned = true;\n else if (typeof d.hashType === 'string')\n m.hashType = parseInt(d.hashType, 10);\n else if (typeof d.hashType === 'number')\n m.hashType = d.hashType;\n else if (typeof d.hashType === 'object')\n m.hashType = new $util.LongBits(d.hashType.low >>> 0, d.hashType.high >>> 0).toNumber(true);\n }\n if (d.fanout != null) {\n if ($util.Long)\n (m.fanout = $util.Long.fromValue(d.fanout)).unsigned = true;\n else if (typeof d.fanout === 'string')\n m.fanout = parseInt(d.fanout, 10);\n else if (typeof d.fanout === 'number')\n m.fanout = d.fanout;\n else if (typeof d.fanout === 'object')\n m.fanout = new $util.LongBits(d.fanout.low >>> 0, d.fanout.high >>> 0).toNumber(true);\n }\n if (d.mode != null) {\n m.mode = d.mode >>> 0;\n }\n if (d.mtime != null) {\n if (typeof d.mtime !== 'object')\n throw TypeError('.Data.mtime: object expected');\n m.mtime = $root.UnixTime.fromObject(d.mtime);\n }\n return m;\n };\n Data.toObject = function toObject(m, o) {\n if (!o)\n o = {};\n var d = {};\n if (o.arrays || o.defaults) {\n d.blocksizes = [];\n }\n if (o.defaults) {\n d.Type = o.enums === String ? 'Raw' : 0;\n if (o.bytes === String)\n d.Data = '';\n else {\n d.Data = [];\n if (o.bytes !== Array)\n d.Data = $util.newBuffer(d.Data);\n }\n if ($util.Long) {\n var n = new $util.Long(0, 0, true);\n d.filesize = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n;\n } else\n d.filesize = o.longs === String ? '0' : 0;\n if ($util.Long) {\n var n = new $util.Long(0, 0, true);\n d.hashType = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n;\n } else\n d.hashType = o.longs === String ? '0' : 0;\n if ($util.Long) {\n var n = new $util.Long(0, 0, true);\n d.fanout = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n;\n } else\n d.fanout = o.longs === String ? '0' : 0;\n d.mode = 0;\n d.mtime = null;\n }\n if (m.Type != null && m.hasOwnProperty('Type')) {\n d.Type = o.enums === String ? $root.Data.DataType[m.Type] : m.Type;\n }\n if (m.Data != null && m.hasOwnProperty('Data')) {\n d.Data = o.bytes === String ? $util.base64.encode(m.Data, 0, m.Data.length) : o.bytes === Array ? Array.prototype.slice.call(m.Data) : m.Data;\n }\n if (m.filesize != null && m.hasOwnProperty('filesize')) {\n if (typeof m.filesize === 'number')\n d.filesize = o.longs === String ? String(m.filesize) : m.filesize;\n else\n d.filesize = o.longs === String ? $util.Long.prototype.toString.call(m.filesize) : o.longs === Number ? new $util.LongBits(m.filesize.low >>> 0, m.filesize.high >>> 0).toNumber(true) : m.filesize;\n }\n if (m.blocksizes && m.blocksizes.length) {\n d.blocksizes = [];\n for (var j = 0; j < m.blocksizes.length; ++j) {\n if (typeof m.blocksizes[j] === 'number')\n d.blocksizes[j] = o.longs === String ? String(m.blocksizes[j]) : m.blocksizes[j];\n else\n d.blocksizes[j] = o.longs === String ? $util.Long.prototype.toString.call(m.blocksizes[j]) : o.longs === Number ? new $util.LongBits(m.blocksizes[j].low >>> 0, m.blocksizes[j].high >>> 0).toNumber(true) : m.blocksizes[j];\n }\n }\n if (m.hashType != null && m.hasOwnProperty('hashType')) {\n if (typeof m.hashType === 'number')\n d.hashType = o.longs === String ? String(m.hashType) : m.hashType;\n else\n d.hashType = o.longs === String ? $util.Long.prototype.toString.call(m.hashType) : o.longs === Number ? new $util.LongBits(m.hashType.low >>> 0, m.hashType.high >>> 0).toNumber(true) : m.hashType;\n }\n if (m.fanout != null && m.hasOwnProperty('fanout')) {\n if (typeof m.fanout === 'number')\n d.fanout = o.longs === String ? String(m.fanout) : m.fanout;\n else\n d.fanout = o.longs === String ? $util.Long.prototype.toString.call(m.fanout) : o.longs === Number ? new $util.LongBits(m.fanout.low >>> 0, m.fanout.high >>> 0).toNumber(true) : m.fanout;\n }\n if (m.mode != null && m.hasOwnProperty('mode')) {\n d.mode = m.mode;\n }\n if (m.mtime != null && m.hasOwnProperty('mtime')) {\n d.mtime = $root.UnixTime.toObject(m.mtime, o);\n }\n return d;\n };\n Data.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf__default['default'].util.toJSONOptions);\n };\n Data.DataType = function () {\n const valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = 'Raw'] = 0;\n values[valuesById[1] = 'Directory'] = 1;\n values[valuesById[2] = 'File'] = 2;\n values[valuesById[3] = 'Metadata'] = 3;\n values[valuesById[4] = 'Symlink'] = 4;\n values[valuesById[5] = 'HAMTShard'] = 5;\n return values;\n }();\n return Data;\n})();\nconst UnixTime = $root.UnixTime = (() => {\n function UnixTime(p) {\n if (p)\n for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)\n if (p[ks[i]] != null)\n this[ks[i]] = p[ks[i]];\n }\n UnixTime.prototype.Seconds = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;\n UnixTime.prototype.FractionalNanoseconds = 0;\n UnixTime.encode = function encode(m, w) {\n if (!w)\n w = $Writer.create();\n w.uint32(8).int64(m.Seconds);\n if (m.FractionalNanoseconds != null && Object.hasOwnProperty.call(m, 'FractionalNanoseconds'))\n w.uint32(21).fixed32(m.FractionalNanoseconds);\n return w;\n };\n UnixTime.decode = function decode(r, l) {\n if (!(r instanceof $Reader))\n r = $Reader.create(r);\n var c = l === undefined ? r.len : r.pos + l, m = new $root.UnixTime();\n while (r.pos < c) {\n var t = r.uint32();\n switch (t >>> 3) {\n case 1:\n m.Seconds = r.int64();\n break;\n case 2:\n m.FractionalNanoseconds = r.fixed32();\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n if (!m.hasOwnProperty('Seconds'))\n throw $util.ProtocolError('missing required \\'Seconds\\'', { instance: m });\n return m;\n };\n UnixTime.fromObject = function fromObject(d) {\n if (d instanceof $root.UnixTime)\n return d;\n var m = new $root.UnixTime();\n if (d.Seconds != null) {\n if ($util.Long)\n (m.Seconds = $util.Long.fromValue(d.Seconds)).unsigned = false;\n else if (typeof d.Seconds === 'string')\n m.Seconds = parseInt(d.Seconds, 10);\n else if (typeof d.Seconds === 'number')\n m.Seconds = d.Seconds;\n else if (typeof d.Seconds === 'object')\n m.Seconds = new $util.LongBits(d.Seconds.low >>> 0, d.Seconds.high >>> 0).toNumber();\n }\n if (d.FractionalNanoseconds != null) {\n m.FractionalNanoseconds = d.FractionalNanoseconds >>> 0;\n }\n return m;\n };\n UnixTime.toObject = function toObject(m, o) {\n if (!o)\n o = {};\n var d = {};\n if (o.defaults) {\n if ($util.Long) {\n var n = new $util.Long(0, 0, false);\n d.Seconds = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n;\n } else\n d.Seconds = o.longs === String ? '0' : 0;\n d.FractionalNanoseconds = 0;\n }\n if (m.Seconds != null && m.hasOwnProperty('Seconds')) {\n if (typeof m.Seconds === 'number')\n d.Seconds = o.longs === String ? String(m.Seconds) : m.Seconds;\n else\n d.Seconds = o.longs === String ? $util.Long.prototype.toString.call(m.Seconds) : o.longs === Number ? new $util.LongBits(m.Seconds.low >>> 0, m.Seconds.high >>> 0).toNumber() : m.Seconds;\n }\n if (m.FractionalNanoseconds != null && m.hasOwnProperty('FractionalNanoseconds')) {\n d.FractionalNanoseconds = m.FractionalNanoseconds;\n }\n return d;\n };\n UnixTime.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf__default['default'].util.toJSONOptions);\n };\n return UnixTime;\n})();\nconst Metadata = $root.Metadata = (() => {\n function Metadata(p) {\n if (p)\n for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)\n if (p[ks[i]] != null)\n this[ks[i]] = p[ks[i]];\n }\n Metadata.prototype.MimeType = '';\n Metadata.encode = function encode(m, w) {\n if (!w)\n w = $Writer.create();\n if (m.MimeType != null && Object.hasOwnProperty.call(m, 'MimeType'))\n w.uint32(10).string(m.MimeType);\n return w;\n };\n Metadata.decode = function decode(r, l) {\n if (!(r instanceof $Reader))\n r = $Reader.create(r);\n var c = l === undefined ? r.len : r.pos + l, m = new $root.Metadata();\n while (r.pos < c) {\n var t = r.uint32();\n switch (t >>> 3) {\n case 1:\n m.MimeType = r.string();\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n return m;\n };\n Metadata.fromObject = function fromObject(d) {\n if (d instanceof $root.Metadata)\n return d;\n var m = new $root.Metadata();\n if (d.MimeType != null) {\n m.MimeType = String(d.MimeType);\n }\n return m;\n };\n Metadata.toObject = function toObject(m, o) {\n if (!o)\n o = {};\n var d = {};\n if (o.defaults) {\n d.MimeType = '';\n }\n if (m.MimeType != null && m.hasOwnProperty('MimeType')) {\n d.MimeType = m.MimeType;\n }\n return d;\n };\n Metadata.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf__default['default'].util.toJSONOptions);\n };\n return Metadata;\n})();\n\nexports.Data = Data;\nexports.Metadata = Metadata;\nexports.UnixTime = UnixTime;\nexports['default'] = $root;\n","'use strict';\n\nmodule.exports = value => {\n\tif (Object.prototype.toString.call(value) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn prototype === null || prototype === Object.prototype;\n};\n","'use strict'\n\n/**\n * Collects all values from an (async) iterable into an array and returns it.\n *\n * @template T\n * @param {AsyncIterable|Iterable} source\n */\nconst all = async (source) => {\n const arr = []\n\n for await (const entry of source) {\n arr.push(entry)\n }\n\n return arr\n}\n\nmodule.exports = all\n","'use strict'\n\n/**\n * Takes an (async) iterable that emits things and returns an async iterable that\n * emits those things in fixed-sized batches.\n *\n * @template T\n * @param {AsyncIterable|Iterable} source\n * @param {number} [size=1]\n * @returns {AsyncIterable}\n */\nasync function * batch (source, size = 1) {\n /** @type {T[]} */\n let things = []\n\n if (size < 1) {\n size = 1\n }\n\n for await (const thing of source) {\n things.push(thing)\n\n while (things.length >= size) {\n yield things.slice(0, size)\n\n things = things.slice(size)\n }\n }\n\n while (things.length) {\n yield things.slice(0, size)\n\n things = things.slice(size)\n }\n}\n\nmodule.exports = batch\n","'use strict'\n\n/**\n * Drains an (async) iterable discarding its' content and does not return\n * anything.\n *\n * @template T\n * @param {AsyncIterable|Iterable} source\n * @returns {Promise}\n */\nconst drain = async (source) => {\n for await (const _ of source) { } // eslint-disable-line no-unused-vars,no-empty\n}\n\nmodule.exports = drain\n","'use strict'\n\n/**\n * Filters the passed (async) iterable by using the filter function\n *\n * @template T\n * @param {AsyncIterable|Iterable} source\n * @param {function(T):boolean|Promise} fn\n */\nconst filter = async function * (source, fn) {\n for await (const entry of source) {\n if (await fn(entry)) {\n yield entry\n }\n }\n}\n\nmodule.exports = filter\n","'use strict'\n\nconst fs = require('fs').promises\nconst path = require('path')\nconst minimatch = require('minimatch')\n\n/**\n * @typedef {string} Glob\n * @typedef {Object} OptionsExt\n * @property {Glob[]} [ignore] - Glob patterns to ignore\n * @property {string} [cwd=process.cwd()]\n * @property {boolean} [absolute=false] - If true produces absolute paths\n * @property {boolean} [nodir] - If true yields file paths and skip directories\n *\n * @typedef {OptionsExt & minimatch.IOptions} Options\n */\n\n/**\n * Async iterable filename pattern matcher\n *\n * @param {string} dir\n * @param {string} pattern\n * @param {Options} [options]\n * @returns {AsyncIterable}\n */\nasync function * glob (dir, pattern, options = {}) {\n const absoluteDir = path.resolve(dir)\n const relativeDir = path.relative(options.cwd || process.cwd(), dir)\n\n const stats = await fs.stat(absoluteDir)\n\n if (stats.isDirectory()) {\n for await (const entry of _glob(absoluteDir, '', pattern, options)) {\n yield entry\n }\n\n return\n }\n\n if (minimatch(relativeDir, pattern, options)) {\n yield options.absolute ? absoluteDir : relativeDir\n }\n}\n\n/**\n * @param {string} base\n * @param {string} dir\n * @param {Glob} pattern\n * @param {Options} options\n * @returns {AsyncIterable}\n */\nasync function * _glob (base, dir, pattern, options) {\n for await (const entry of await fs.readdir(path.join(base, dir))) {\n const relativeEntryPath = path.join(dir, entry)\n const absoluteEntryPath = path.join(base, dir, entry)\n const stats = await fs.stat(absoluteEntryPath)\n let match = minimatch(relativeEntryPath, pattern, options)\n\n if (options.ignore && match && options.ignore.reduce((acc, curr) => {\n return acc || minimatch(relativeEntryPath, curr, options)\n }, false)) {\n match = false\n }\n\n if (match && !(stats.isDirectory() && options.nodir)) {\n yield options.absolute ? absoluteEntryPath : relativeEntryPath\n }\n\n if (stats.isDirectory()) {\n yield * _glob(base, relativeEntryPath, pattern, options)\n }\n }\n}\n\nmodule.exports = glob\n","'use strict'\n\n/**\n * Returns the last item of an (async) iterable, unless empty, in which case\n * return `undefined`.\n *\n * @template T\n * @param {AsyncIterable|Iterable} source\n */\nconst last = async (source) => {\n let res\n\n for await (const entry of source) {\n res = entry\n }\n\n return res\n}\n\nmodule.exports = last\n","'use strict'\n\n/**\n * Takes an (async) iterable and returns one with each item mapped by the passed\n * function.\n *\n * @template I,O\n * @param {AsyncIterable|Iterable} source\n * @param {function(I):O|Promise} func\n * @returns {AsyncIterable}\n */\nconst map = async function * (source, func) {\n for await (const val of source) {\n yield func(val)\n }\n}\n\nmodule.exports = map\n","'use strict'\n\nconst batch = require('it-batch')\n\n/**\n * @template T\n * @typedef {{ok:true, value:T}} Success\n */\n\n/**\n * @typedef {{ok:false, err:Error}} Failure\n */\n\n/**\n * Takes an (async) iterator that emits promise-returning functions,\n * invokes them in parallel and emits the results as they become available but\n * in the same order as the input\n *\n * @template T\n * @param {AsyncIterable<() => Promise>} source\n * @param {number} [size=1]\n * @returns {AsyncIterable}\n */\nasync function * parallelBatch (source, size = 1) {\n for await (const tasks of batch(source, size)) {\n /** @type {Promise|Failure>[]} */\n const things = tasks.map(\n /**\n * @param {() => Promise} p\n */\n p => {\n return p().then(value => ({ ok: true, value }), err => ({ ok: false, err }))\n })\n\n for (let i = 0; i < things.length; i++) {\n const result = await things[i]\n\n if (result.ok) {\n yield result.value\n } else {\n throw result.err\n }\n }\n }\n}\n\nmodule.exports = parallelBatch\n","'use strict'\n\n/**\n * @template T\n * @typedef {Object} Peek\n * @property {() => IteratorResult} peek\n */\n\n/**\n * @template T\n * @typedef {Object} AsyncPeek\n * @property {() => Promise>} peek\n */\n\n/**\n * @template T\n * @typedef {Object} Push\n * @property {(value:T) => void} push\n */\n\n/**\n * @template T\n * @typedef {Iterable & Peek & Push & Iterator} Peekable\n */\n\n/**\n * @template T\n * @typedef {AsyncIterable & AsyncPeek & Push & AsyncIterator} AsyncPeekable\n */\n\n/**\n * @template {Iterable | AsyncIterable} I\n * @param {I} iterable\n * @returns {I extends Iterable\n * ? Peekable\n * : I extends AsyncIterable\n * ? AsyncPeekable\n * : never\n * }\n */\nfunction peekableIterator (iterable) {\n // @ts-ignore\n const [iterator, symbol] = iterable[Symbol.asyncIterator]\n // @ts-ignore\n ? [iterable[Symbol.asyncIterator](), Symbol.asyncIterator]\n // @ts-ignore\n : [iterable[Symbol.iterator](), Symbol.iterator]\n\n /** @type {any[]} */\n const queue = []\n\n // @ts-ignore\n return {\n peek: () => {\n return iterator.next()\n },\n push: (value) => {\n queue.push(value)\n },\n next: () => {\n if (queue.length) {\n return {\n done: false,\n value: queue.shift()\n }\n }\n\n return iterator.next()\n },\n [symbol] () {\n return this\n }\n }\n}\n\nmodule.exports = peekableIterator\n","const rawPipe = (...fns) => {\n let res\n while (fns.length) {\n res = fns.shift()(res)\n }\n return res\n}\n\nconst isIterable = obj => obj && (\n typeof obj[Symbol.asyncIterator] === 'function' ||\n typeof obj[Symbol.iterator] === 'function' ||\n typeof obj.next === 'function' // Probably, right?\n)\n\nconst isDuplex = obj => obj && typeof obj.sink === 'function' && isIterable(obj.source)\n\nconst duplexPipelineFn = duplex => source => {\n duplex.sink(source) // TODO: error on sink side is unhandled rejection - this is the same as pull streams\n return duplex.source\n}\n\nconst pipe = (...fns) => {\n // Duplex at start: wrap in function and return duplex source\n if (isDuplex(fns[0])) {\n const duplex = fns[0]\n fns[0] = () => duplex.source\n // Iterable at start: wrap in function\n } else if (isIterable(fns[0])) {\n const source = fns[0]\n fns[0] = () => source\n }\n\n if (fns.length > 1) {\n // Duplex at end: use duplex sink\n if (isDuplex(fns[fns.length - 1])) {\n fns[fns.length - 1] = fns[fns.length - 1].sink\n }\n }\n\n if (fns.length > 2) {\n // Duplex in the middle, consume source with duplex sink and return duplex source\n for (let i = 1; i < fns.length - 1; i++) {\n if (isDuplex(fns[i])) {\n fns[i] = duplexPipelineFn(fns[i])\n }\n }\n }\n\n return rawPipe(...fns)\n}\n\nmodule.exports = pipe\nmodule.exports.pipe = pipe\nmodule.exports.rawPipe = rawPipe\nmodule.exports.isIterable = isIterable\nmodule.exports.isDuplex = isDuplex\n","'use strict'\n\n/**\n * Stop iteration after n items have been received.\n *\n * @template T\n * @param {AsyncIterable|Iterable} source\n * @param {number} limit\n * @returns {AsyncIterable}\n */\nconst take = async function * (source, limit) {\n let items = 0\n\n if (limit < 1) {\n return\n }\n\n for await (const entry of source) {\n yield entry\n\n items++\n\n if (items === limit) {\n return\n }\n }\n}\n\nmodule.exports = take\n","'use strict';\nconst isOptionObject = require('is-plain-obj');\n\nconst {hasOwnProperty} = Object.prototype;\nconst {propertyIsEnumerable} = Object;\nconst defineProperty = (object, name, value) => Object.defineProperty(object, name, {\n\tvalue,\n\twritable: true,\n\tenumerable: true,\n\tconfigurable: true\n});\n\nconst globalThis = this;\nconst defaultMergeOptions = {\n\tconcatArrays: false,\n\tignoreUndefined: false\n};\n\nconst getEnumerableOwnPropertyKeys = value => {\n\tconst keys = [];\n\n\tfor (const key in value) {\n\t\tif (hasOwnProperty.call(value, key)) {\n\t\t\tkeys.push(key);\n\t\t}\n\t}\n\n\t/* istanbul ignore else */\n\tif (Object.getOwnPropertySymbols) {\n\t\tconst symbols = Object.getOwnPropertySymbols(value);\n\n\t\tfor (const symbol of symbols) {\n\t\t\tif (propertyIsEnumerable.call(value, symbol)) {\n\t\t\t\tkeys.push(symbol);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn keys;\n};\n\nfunction clone(value) {\n\tif (Array.isArray(value)) {\n\t\treturn cloneArray(value);\n\t}\n\n\tif (isOptionObject(value)) {\n\t\treturn cloneOptionObject(value);\n\t}\n\n\treturn value;\n}\n\nfunction cloneArray(array) {\n\tconst result = array.slice(0, 0);\n\n\tgetEnumerableOwnPropertyKeys(array).forEach(key => {\n\t\tdefineProperty(result, key, clone(array[key]));\n\t});\n\n\treturn result;\n}\n\nfunction cloneOptionObject(object) {\n\tconst result = Object.getPrototypeOf(object) === null ? Object.create(null) : {};\n\n\tgetEnumerableOwnPropertyKeys(object).forEach(key => {\n\t\tdefineProperty(result, key, clone(object[key]));\n\t});\n\n\treturn result;\n}\n\n/**\n * @param {*} merged already cloned\n * @param {*} source something to merge\n * @param {string[]} keys keys to merge\n * @param {Object} config Config Object\n * @returns {*} cloned Object\n */\nconst mergeKeys = (merged, source, keys, config) => {\n\tkeys.forEach(key => {\n\t\tif (typeof source[key] === 'undefined' && config.ignoreUndefined) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Do not recurse into prototype chain of merged\n\t\tif (key in merged && merged[key] !== Object.getPrototypeOf(merged)) {\n\t\t\tdefineProperty(merged, key, merge(merged[key], source[key], config));\n\t\t} else {\n\t\t\tdefineProperty(merged, key, clone(source[key]));\n\t\t}\n\t});\n\n\treturn merged;\n};\n\n/**\n * @param {*} merged already cloned\n * @param {*} source something to merge\n * @param {Object} config Config Object\n * @returns {*} cloned Object\n *\n * see [Array.prototype.concat ( ...arguments )](http://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.concat)\n */\nconst concatArrays = (merged, source, config) => {\n\tlet result = merged.slice(0, 0);\n\tlet resultIndex = 0;\n\n\t[merged, source].forEach(array => {\n\t\tconst indices = [];\n\n\t\t// `result.concat(array)` with cloning\n\t\tfor (let k = 0; k < array.length; k++) {\n\t\t\tif (!hasOwnProperty.call(array, k)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tindices.push(String(k));\n\n\t\t\tif (array === merged) {\n\t\t\t\t// Already cloned\n\t\t\t\tdefineProperty(result, resultIndex++, array[k]);\n\t\t\t} else {\n\t\t\t\tdefineProperty(result, resultIndex++, clone(array[k]));\n\t\t\t}\n\t\t}\n\n\t\t// Merge non-index keys\n\t\tresult = mergeKeys(result, array, getEnumerableOwnPropertyKeys(array).filter(key => !indices.includes(key)), config);\n\t});\n\n\treturn result;\n};\n\n/**\n * @param {*} merged already cloned\n * @param {*} source something to merge\n * @param {Object} config Config Object\n * @returns {*} cloned Object\n */\nfunction merge(merged, source, config) {\n\tif (config.concatArrays && Array.isArray(merged) && Array.isArray(source)) {\n\t\treturn concatArrays(merged, source, config);\n\t}\n\n\tif (!isOptionObject(source) || !isOptionObject(merged)) {\n\t\treturn clone(source);\n\t}\n\n\treturn mergeKeys(merged, source, getEnumerableOwnPropertyKeys(source), config);\n}\n\nmodule.exports = function (...options) {\n\tconst config = merge(clone(defaultMergeOptions), (this !== globalThis && this) || {}, defaultMergeOptions);\n\tlet merged = {_: {}};\n\n\tfor (const option of options) {\n\t\tif (option === undefined) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!isOptionObject(option)) {\n\t\t\tthrow new TypeError('`' + option + '` is not an Option Object');\n\t\t}\n\n\t\tmerged = merge(merged, {_: option}, config);\n\t}\n\n\treturn merged._;\n};\n","module.exports = minimatch\nminimatch.Minimatch = Minimatch\n\nvar path = { sep: '/' }\ntry {\n path = require('path')\n} catch (er) {}\n\nvar GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}\nvar expand = require('brace-expansion')\n\nvar plTypes = {\n '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},\n '?': { open: '(?:', close: ')?' },\n '+': { open: '(?:', close: ')+' },\n '*': { open: '(?:', close: ')*' },\n '@': { open: '(?:', close: ')' }\n}\n\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nvar qmark = '[^/]'\n\n// * => any number of characters\nvar star = qmark + '*?'\n\n// ** when dots are allowed. Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nvar twoStarDot = '(?:(?!(?:\\\\\\/|^)(?:\\\\.{1,2})($|\\\\\\/)).)*?'\n\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nvar twoStarNoDot = '(?:(?!(?:\\\\\\/|^)\\\\.).)*?'\n\n// characters that need to be escaped in RegExp.\nvar reSpecials = charSet('().*{}+?[]^$\\\\!')\n\n// \"abc\" -> { a:true, b:true, c:true }\nfunction charSet (s) {\n return s.split('').reduce(function (set, c) {\n set[c] = true\n return set\n }, {})\n}\n\n// normalizes slashes.\nvar slashSplit = /\\/+/\n\nminimatch.filter = filter\nfunction filter (pattern, options) {\n options = options || {}\n return function (p, i, list) {\n return minimatch(p, pattern, options)\n }\n}\n\nfunction ext (a, b) {\n a = a || {}\n b = b || {}\n var t = {}\n Object.keys(b).forEach(function (k) {\n t[k] = b[k]\n })\n Object.keys(a).forEach(function (k) {\n t[k] = a[k]\n })\n return t\n}\n\nminimatch.defaults = function (def) {\n if (!def || !Object.keys(def).length) return minimatch\n\n var orig = minimatch\n\n var m = function minimatch (p, pattern, options) {\n return orig.minimatch(p, pattern, ext(def, options))\n }\n\n m.Minimatch = function Minimatch (pattern, options) {\n return new orig.Minimatch(pattern, ext(def, options))\n }\n\n return m\n}\n\nMinimatch.defaults = function (def) {\n if (!def || !Object.keys(def).length) return Minimatch\n return minimatch.defaults(def).Minimatch\n}\n\nfunction minimatch (p, pattern, options) {\n if (typeof pattern !== 'string') {\n throw new TypeError('glob pattern string required')\n }\n\n if (!options) options = {}\n\n // shortcut: comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n return false\n }\n\n // \"\" only matches \"\"\n if (pattern.trim() === '') return p === ''\n\n return new Minimatch(pattern, options).match(p)\n}\n\nfunction Minimatch (pattern, options) {\n if (!(this instanceof Minimatch)) {\n return new Minimatch(pattern, options)\n }\n\n if (typeof pattern !== 'string') {\n throw new TypeError('glob pattern string required')\n }\n\n if (!options) options = {}\n pattern = pattern.trim()\n\n // windows support: need to use /, not \\\n if (path.sep !== '/') {\n pattern = pattern.split(path.sep).join('/')\n }\n\n this.options = options\n this.set = []\n this.pattern = pattern\n this.regexp = null\n this.negate = false\n this.comment = false\n this.empty = false\n\n // make the set of regexps etc.\n this.make()\n}\n\nMinimatch.prototype.debug = function () {}\n\nMinimatch.prototype.make = make\nfunction make () {\n // don't do it more than once.\n if (this._made) return\n\n var pattern = this.pattern\n var options = this.options\n\n // empty patterns and comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n this.comment = true\n return\n }\n if (!pattern) {\n this.empty = true\n return\n }\n\n // step 1: figure out negation, etc.\n this.parseNegate()\n\n // step 2: expand braces\n var set = this.globSet = this.braceExpand()\n\n if (options.debug) this.debug = console.error\n\n this.debug(this.pattern, set)\n\n // step 3: now we have a set, so turn each one into a series of path-portion\n // matching patterns.\n // These will be regexps, except in the case of \"**\", which is\n // set to the GLOBSTAR object for globstar behavior,\n // and will not contain any / characters\n set = this.globParts = set.map(function (s) {\n return s.split(slashSplit)\n })\n\n this.debug(this.pattern, set)\n\n // glob --> regexps\n set = set.map(function (s, si, set) {\n return s.map(this.parse, this)\n }, this)\n\n this.debug(this.pattern, set)\n\n // filter out everything that didn't compile properly.\n set = set.filter(function (s) {\n return s.indexOf(false) === -1\n })\n\n this.debug(this.pattern, set)\n\n this.set = set\n}\n\nMinimatch.prototype.parseNegate = parseNegate\nfunction parseNegate () {\n var pattern = this.pattern\n var negate = false\n var options = this.options\n var negateOffset = 0\n\n if (options.nonegate) return\n\n for (var i = 0, l = pattern.length\n ; i < l && pattern.charAt(i) === '!'\n ; i++) {\n negate = !negate\n negateOffset++\n }\n\n if (negateOffset) this.pattern = pattern.substr(negateOffset)\n this.negate = negate\n}\n\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nminimatch.braceExpand = function (pattern, options) {\n return braceExpand(pattern, options)\n}\n\nMinimatch.prototype.braceExpand = braceExpand\n\nfunction braceExpand (pattern, options) {\n if (!options) {\n if (this instanceof Minimatch) {\n options = this.options\n } else {\n options = {}\n }\n }\n\n pattern = typeof pattern === 'undefined'\n ? this.pattern : pattern\n\n if (typeof pattern === 'undefined') {\n throw new TypeError('undefined pattern')\n }\n\n if (options.nobrace ||\n !pattern.match(/\\{.*\\}/)) {\n // shortcut. no need to expand.\n return [pattern]\n }\n\n return expand(pattern)\n}\n\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion. Otherwise, any series\n// of * is equivalent to a single *. Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\nMinimatch.prototype.parse = parse\nvar SUBPARSE = {}\nfunction parse (pattern, isSub) {\n if (pattern.length > 1024 * 64) {\n throw new TypeError('pattern is too long')\n }\n\n var options = this.options\n\n // shortcuts\n if (!options.noglobstar && pattern === '**') return GLOBSTAR\n if (pattern === '') return ''\n\n var re = ''\n var hasMagic = !!options.nocase\n var escaping = false\n // ? => one single character\n var patternListStack = []\n var negativeLists = []\n var stateChar\n var inClass = false\n var reClassStart = -1\n var classStart = -1\n // . and .. never match anything that doesn't start with .,\n // even when options.dot is set.\n var patternStart = pattern.charAt(0) === '.' ? '' // anything\n // not (start or / followed by . or .. followed by / or end)\n : options.dot ? '(?!(?:^|\\\\\\/)\\\\.{1,2}(?:$|\\\\\\/))'\n : '(?!\\\\.)'\n var self = this\n\n function clearStateChar () {\n if (stateChar) {\n // we had some state-tracking character\n // that wasn't consumed by this pass.\n switch (stateChar) {\n case '*':\n re += star\n hasMagic = true\n break\n case '?':\n re += qmark\n hasMagic = true\n break\n default:\n re += '\\\\' + stateChar\n break\n }\n self.debug('clearStateChar %j %j', stateChar, re)\n stateChar = false\n }\n }\n\n for (var i = 0, len = pattern.length, c\n ; (i < len) && (c = pattern.charAt(i))\n ; i++) {\n this.debug('%s\\t%s %s %j', pattern, i, re, c)\n\n // skip over any that are escaped.\n if (escaping && reSpecials[c]) {\n re += '\\\\' + c\n escaping = false\n continue\n }\n\n switch (c) {\n case '/':\n // completely not allowed, even escaped.\n // Should already be path-split by now.\n return false\n\n case '\\\\':\n clearStateChar()\n escaping = true\n continue\n\n // the various stateChar values\n // for the \"extglob\" stuff.\n case '?':\n case '*':\n case '+':\n case '@':\n case '!':\n this.debug('%s\\t%s %s %j <-- stateChar', pattern, i, re, c)\n\n // all of those are literals inside a class, except that\n // the glob [!a] means [^a] in regexp\n if (inClass) {\n this.debug(' in class')\n if (c === '!' && i === classStart + 1) c = '^'\n re += c\n continue\n }\n\n // if we already have a stateChar, then it means\n // that there was something like ** or +? in there.\n // Handle the stateChar, then proceed with this one.\n self.debug('call clearStateChar %j', stateChar)\n clearStateChar()\n stateChar = c\n // if extglob is disabled, then +(asdf|foo) isn't a thing.\n // just clear the statechar *now*, rather than even diving into\n // the patternList stuff.\n if (options.noext) clearStateChar()\n continue\n\n case '(':\n if (inClass) {\n re += '('\n continue\n }\n\n if (!stateChar) {\n re += '\\\\('\n continue\n }\n\n patternListStack.push({\n type: stateChar,\n start: i - 1,\n reStart: re.length,\n open: plTypes[stateChar].open,\n close: plTypes[stateChar].close\n })\n // negation is (?:(?!js)[^/]*)\n re += stateChar === '!' ? '(?:(?!(?:' : '(?:'\n this.debug('plType %j %j', stateChar, re)\n stateChar = false\n continue\n\n case ')':\n if (inClass || !patternListStack.length) {\n re += '\\\\)'\n continue\n }\n\n clearStateChar()\n hasMagic = true\n var pl = patternListStack.pop()\n // negation is (?:(?!js)[^/]*)\n // The others are (?:)\n re += pl.close\n if (pl.type === '!') {\n negativeLists.push(pl)\n }\n pl.reEnd = re.length\n continue\n\n case '|':\n if (inClass || !patternListStack.length || escaping) {\n re += '\\\\|'\n escaping = false\n continue\n }\n\n clearStateChar()\n re += '|'\n continue\n\n // these are mostly the same in regexp and glob\n case '[':\n // swallow any state-tracking char before the [\n clearStateChar()\n\n if (inClass) {\n re += '\\\\' + c\n continue\n }\n\n inClass = true\n classStart = i\n reClassStart = re.length\n re += c\n continue\n\n case ']':\n // a right bracket shall lose its special\n // meaning and represent itself in\n // a bracket expression if it occurs\n // first in the list. -- POSIX.2 2.8.3.2\n if (i === classStart + 1 || !inClass) {\n re += '\\\\' + c\n escaping = false\n continue\n }\n\n // handle the case where we left a class open.\n // \"[z-a]\" is valid, equivalent to \"\\[z-a\\]\"\n if (inClass) {\n // split where the last [ was, make sure we don't have\n // an invalid re. if so, re-walk the contents of the\n // would-be class to re-translate any characters that\n // were passed through as-is\n // TODO: It would probably be faster to determine this\n // without a try/catch and a new RegExp, but it's tricky\n // to do safely. For now, this is safe and works.\n var cs = pattern.substring(classStart + 1, i)\n try {\n RegExp('[' + cs + ']')\n } catch (er) {\n // not a valid class!\n var sp = this.parse(cs, SUBPARSE)\n re = re.substr(0, reClassStart) + '\\\\[' + sp[0] + '\\\\]'\n hasMagic = hasMagic || sp[1]\n inClass = false\n continue\n }\n }\n\n // finish up the class.\n hasMagic = true\n inClass = false\n re += c\n continue\n\n default:\n // swallow any state char that wasn't consumed\n clearStateChar()\n\n if (escaping) {\n // no need\n escaping = false\n } else if (reSpecials[c]\n && !(c === '^' && inClass)) {\n re += '\\\\'\n }\n\n re += c\n\n } // switch\n } // for\n\n // handle the case where we left a class open.\n // \"[abc\" is valid, equivalent to \"\\[abc\"\n if (inClass) {\n // split where the last [ was, and escape it\n // this is a huge pita. We now have to re-walk\n // the contents of the would-be class to re-translate\n // any characters that were passed through as-is\n cs = pattern.substr(classStart + 1)\n sp = this.parse(cs, SUBPARSE)\n re = re.substr(0, reClassStart) + '\\\\[' + sp[0]\n hasMagic = hasMagic || sp[1]\n }\n\n // handle the case where we had a +( thing at the *end*\n // of the pattern.\n // each pattern list stack adds 3 chars, and we need to go through\n // and escape any | chars that were passed through as-is for the regexp.\n // Go through and escape them, taking care not to double-escape any\n // | chars that were already escaped.\n for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {\n var tail = re.slice(pl.reStart + pl.open.length)\n this.debug('setting tail', re, pl)\n // maybe some even number of \\, then maybe 1 \\, followed by a |\n tail = tail.replace(/((?:\\\\{2}){0,64})(\\\\?)\\|/g, function (_, $1, $2) {\n if (!$2) {\n // the | isn't already escaped, so escape it.\n $2 = '\\\\'\n }\n\n // need to escape all those slashes *again*, without escaping the\n // one that we need for escaping the | character. As it works out,\n // escaping an even number of slashes can be done by simply repeating\n // it exactly after itself. That's why this trick works.\n //\n // I am sorry that you have to see this.\n return $1 + $1 + $2 + '|'\n })\n\n this.debug('tail=%j\\n %s', tail, tail, pl, re)\n var t = pl.type === '*' ? star\n : pl.type === '?' ? qmark\n : '\\\\' + pl.type\n\n hasMagic = true\n re = re.slice(0, pl.reStart) + t + '\\\\(' + tail\n }\n\n // handle trailing things that only matter at the very end.\n clearStateChar()\n if (escaping) {\n // trailing \\\\\n re += '\\\\\\\\'\n }\n\n // only need to apply the nodot start if the re starts with\n // something that could conceivably capture a dot\n var addPatternStart = false\n switch (re.charAt(0)) {\n case '.':\n case '[':\n case '(': addPatternStart = true\n }\n\n // Hack to work around lack of negative lookbehind in JS\n // A pattern like: *.!(x).!(y|z) needs to ensure that a name\n // like 'a.xyz.yz' doesn't match. So, the first negative\n // lookahead, has to look ALL the way ahead, to the end of\n // the pattern.\n for (var n = negativeLists.length - 1; n > -1; n--) {\n var nl = negativeLists[n]\n\n var nlBefore = re.slice(0, nl.reStart)\n var nlFirst = re.slice(nl.reStart, nl.reEnd - 8)\n var nlLast = re.slice(nl.reEnd - 8, nl.reEnd)\n var nlAfter = re.slice(nl.reEnd)\n\n nlLast += nlAfter\n\n // Handle nested stuff like *(*.js|!(*.json)), where open parens\n // mean that we should *not* include the ) in the bit that is considered\n // \"after\" the negated section.\n var openParensBefore = nlBefore.split('(').length - 1\n var cleanAfter = nlAfter\n for (i = 0; i < openParensBefore; i++) {\n cleanAfter = cleanAfter.replace(/\\)[+*?]?/, '')\n }\n nlAfter = cleanAfter\n\n var dollar = ''\n if (nlAfter === '' && isSub !== SUBPARSE) {\n dollar = '$'\n }\n var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast\n re = newRe\n }\n\n // if the re is not \"\" at this point, then we need to make sure\n // it doesn't match against an empty path part.\n // Otherwise a/* will match a/, which it should not.\n if (re !== '' && hasMagic) {\n re = '(?=.)' + re\n }\n\n if (addPatternStart) {\n re = patternStart + re\n }\n\n // parsing just a piece of a larger pattern.\n if (isSub === SUBPARSE) {\n return [re, hasMagic]\n }\n\n // skip the regexp for non-magical patterns\n // unescape anything in it, though, so that it'll be\n // an exact match against a file etc.\n if (!hasMagic) {\n return globUnescape(pattern)\n }\n\n var flags = options.nocase ? 'i' : ''\n try {\n var regExp = new RegExp('^' + re + '$', flags)\n } catch (er) {\n // If it was an invalid regular expression, then it can't match\n // anything. This trick looks for a character after the end of\n // the string, which is of course impossible, except in multi-line\n // mode, but it's not a /m regex.\n return new RegExp('$.')\n }\n\n regExp._glob = pattern\n regExp._src = re\n\n return regExp\n}\n\nminimatch.makeRe = function (pattern, options) {\n return new Minimatch(pattern, options || {}).makeRe()\n}\n\nMinimatch.prototype.makeRe = makeRe\nfunction makeRe () {\n if (this.regexp || this.regexp === false) return this.regexp\n\n // at this point, this.set is a 2d array of partial\n // pattern strings, or \"**\".\n //\n // It's better to use .match(). This function shouldn't\n // be used, really, but it's pretty convenient sometimes,\n // when you just want to work with a regex.\n var set = this.set\n\n if (!set.length) {\n this.regexp = false\n return this.regexp\n }\n var options = this.options\n\n var twoStar = options.noglobstar ? star\n : options.dot ? twoStarDot\n : twoStarNoDot\n var flags = options.nocase ? 'i' : ''\n\n var re = set.map(function (pattern) {\n return pattern.map(function (p) {\n return (p === GLOBSTAR) ? twoStar\n : (typeof p === 'string') ? regExpEscape(p)\n : p._src\n }).join('\\\\\\/')\n }).join('|')\n\n // must match entire pattern\n // ending in a * or ** will make it less strict.\n re = '^(?:' + re + ')$'\n\n // can match anything, as long as it's not this.\n if (this.negate) re = '^(?!' + re + ').*$'\n\n try {\n this.regexp = new RegExp(re, flags)\n } catch (ex) {\n this.regexp = false\n }\n return this.regexp\n}\n\nminimatch.match = function (list, pattern, options) {\n options = options || {}\n var mm = new Minimatch(pattern, options)\n list = list.filter(function (f) {\n return mm.match(f)\n })\n if (mm.options.nonull && !list.length) {\n list.push(pattern)\n }\n return list\n}\n\nMinimatch.prototype.match = match\nfunction match (f, partial) {\n this.debug('match', f, this.pattern)\n // short-circuit in the case of busted things.\n // comments, etc.\n if (this.comment) return false\n if (this.empty) return f === ''\n\n if (f === '/' && partial) return true\n\n var options = this.options\n\n // windows: need to use /, not \\\n if (path.sep !== '/') {\n f = f.split(path.sep).join('/')\n }\n\n // treat the test path as a set of pathparts.\n f = f.split(slashSplit)\n this.debug(this.pattern, 'split', f)\n\n // just ONE of the pattern sets in this.set needs to match\n // in order for it to be valid. If negating, then just one\n // match means that we have failed.\n // Either way, return on the first hit.\n\n var set = this.set\n this.debug(this.pattern, 'set', set)\n\n // Find the basename of the path by looking for the last non-empty segment\n var filename\n var i\n for (i = f.length - 1; i >= 0; i--) {\n filename = f[i]\n if (filename) break\n }\n\n for (i = 0; i < set.length; i++) {\n var pattern = set[i]\n var file = f\n if (options.matchBase && pattern.length === 1) {\n file = [filename]\n }\n var hit = this.matchOne(file, pattern, partial)\n if (hit) {\n if (options.flipNegate) return true\n return !this.negate\n }\n }\n\n // didn't get any hits. this is success if it's a negative\n // pattern, failure otherwise.\n if (options.flipNegate) return false\n return this.negate\n}\n\n// set partial to true to test if, for example,\n// \"/a/b\" matches the start of \"/*/b/*/d\"\n// Partial means, if you run out of file before you run\n// out of pattern, then that's fine, as long as all\n// the parts match.\nMinimatch.prototype.matchOne = function (file, pattern, partial) {\n var options = this.options\n\n this.debug('matchOne',\n { 'this': this, file: file, pattern: pattern })\n\n this.debug('matchOne', file.length, pattern.length)\n\n for (var fi = 0,\n pi = 0,\n fl = file.length,\n pl = pattern.length\n ; (fi < fl) && (pi < pl)\n ; fi++, pi++) {\n this.debug('matchOne loop')\n var p = pattern[pi]\n var f = file[fi]\n\n this.debug(pattern, p, f)\n\n // should be impossible.\n // some invalid regexp stuff in the set.\n if (p === false) return false\n\n if (p === GLOBSTAR) {\n this.debug('GLOBSTAR', [pattern, p, f])\n\n // \"**\"\n // a/**/b/**/c would match the following:\n // a/b/x/y/z/c\n // a/x/y/z/b/c\n // a/b/x/b/x/c\n // a/b/c\n // To do this, take the rest of the pattern after\n // the **, and see if it would match the file remainder.\n // If so, return success.\n // If not, the ** \"swallows\" a segment, and try again.\n // This is recursively awful.\n //\n // a/**/b/**/c matching a/b/x/y/z/c\n // - a matches a\n // - doublestar\n // - matchOne(b/x/y/z/c, b/**/c)\n // - b matches b\n // - doublestar\n // - matchOne(x/y/z/c, c) -> no\n // - matchOne(y/z/c, c) -> no\n // - matchOne(z/c, c) -> no\n // - matchOne(c, c) yes, hit\n var fr = fi\n var pr = pi + 1\n if (pr === pl) {\n this.debug('** at the end')\n // a ** at the end will just swallow the rest.\n // We have found a match.\n // however, it will not swallow /.x, unless\n // options.dot is set.\n // . and .. are *never* matched by **, for explosively\n // exponential reasons.\n for (; fi < fl; fi++) {\n if (file[fi] === '.' || file[fi] === '..' ||\n (!options.dot && file[fi].charAt(0) === '.')) return false\n }\n return true\n }\n\n // ok, let's see if we can swallow whatever we can.\n while (fr < fl) {\n var swallowee = file[fr]\n\n this.debug('\\nglobstar while', file, fr, pattern, pr, swallowee)\n\n // XXX remove this slice. Just pass the start index.\n if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {\n this.debug('globstar found match!', fr, fl, swallowee)\n // found a match.\n return true\n } else {\n // can't swallow \".\" or \"..\" ever.\n // can only swallow \".foo\" when explicitly asked.\n if (swallowee === '.' || swallowee === '..' ||\n (!options.dot && swallowee.charAt(0) === '.')) {\n this.debug('dot detected!', file, fr, pattern, pr)\n break\n }\n\n // ** swallows a segment, and continue.\n this.debug('globstar swallow a segment, and continue')\n fr++\n }\n }\n\n // no match was found.\n // However, in partial mode, we can't say this is necessarily over.\n // If there's more *pattern* left, then\n if (partial) {\n // ran out of file\n this.debug('\\n>>> no match, partial?', file, fr, pattern, pr)\n if (fr === fl) return true\n }\n return false\n }\n\n // something other than **\n // non-magic patterns just have to match exactly\n // patterns with magic have been turned into regexps.\n var hit\n if (typeof p === 'string') {\n if (options.nocase) {\n hit = f.toLowerCase() === p.toLowerCase()\n } else {\n hit = f === p\n }\n this.debug('string match', p, f, hit)\n } else {\n hit = f.match(p)\n this.debug('pattern match', p, f, hit)\n }\n\n if (!hit) return false\n }\n\n // Note: ending in / means that we'll get a final \"\"\n // at the end of the pattern. This can only match a\n // corresponding \"\" at the end of the file.\n // If the file ends in /, then it can only match a\n // a pattern that ends in /, unless the pattern just\n // doesn't have any more for it. But, a/b/ should *not*\n // match \"a/b/*\", even though \"\" matches against the\n // [^/]*? pattern, except in partial mode, where it might\n // simply not be reached yet.\n // However, a/b/ should still satisfy a/*\n\n // now either we fell off the end of the pattern, or we're done.\n if (fi === fl && pi === pl) {\n // ran out of pattern and filename at the same time.\n // an exact hit!\n return true\n } else if (fi === fl) {\n // ran out of file, but still had pattern left.\n // this is ok if we're doing the match as part of\n // a glob fs traversal.\n return partial\n } else if (pi === pl) {\n // ran out of pattern, still have file left.\n // this is only acceptable if we're on the very last\n // empty segment of a file with a trailing slash.\n // a/* should match a/b/\n var emptyFileEnd = (fi === fl - 1) && (file[fi] === '')\n return emptyFileEnd\n }\n\n // should be unreachable.\n throw new Error('wtf?')\n}\n\n// replace stuff like \\* with *\nfunction globUnescape (s) {\n return s.replace(/\\\\(.)/g, '$1')\n}\n\nfunction regExpEscape (s) {\n return s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n}\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar baseX$1 = require('../../vendor/base-x.js');\nvar bytes = require('../bytes.js');\n\nclass Encoder {\n constructor(name, prefix, baseEncode) {\n this.name = name;\n this.prefix = prefix;\n this.baseEncode = baseEncode;\n }\n encode(bytes) {\n if (bytes instanceof Uint8Array) {\n return `${ this.prefix }${ this.baseEncode(bytes) }`;\n } else {\n throw Error('Unknown type, must be binary type');\n }\n }\n}\nclass Decoder {\n constructor(name, prefix, baseDecode) {\n this.name = name;\n this.prefix = prefix;\n this.baseDecode = baseDecode;\n }\n decode(text) {\n if (typeof text === 'string') {\n switch (text[0]) {\n case this.prefix: {\n return this.baseDecode(text.slice(1));\n }\n default: {\n throw Error(`Unable to decode multibase string ${ JSON.stringify(text) }, ${ this.name } decoder only supports inputs prefixed with ${ this.prefix }`);\n }\n }\n } else {\n throw Error('Can only multibase decode strings');\n }\n }\n or(decoder) {\n return or(this, decoder);\n }\n}\nclass ComposedDecoder {\n constructor(decoders) {\n this.decoders = decoders;\n }\n or(decoder) {\n return or(this, decoder);\n }\n decode(input) {\n const prefix = input[0];\n const decoder = this.decoders[prefix];\n if (decoder) {\n return decoder.decode(input);\n } else {\n throw RangeError(`Unable to decode multibase string ${ JSON.stringify(input) }, only inputs prefixed with ${ Object.keys(this.decoders) } are supported`);\n }\n }\n}\nconst or = (left, right) => new ComposedDecoder({\n ...left.decoders || { [left.prefix]: left },\n ...right.decoders || { [right.prefix]: right }\n});\nclass Codec {\n constructor(name, prefix, baseEncode, baseDecode) {\n this.name = name;\n this.prefix = prefix;\n this.baseEncode = baseEncode;\n this.baseDecode = baseDecode;\n this.encoder = new Encoder(name, prefix, baseEncode);\n this.decoder = new Decoder(name, prefix, baseDecode);\n }\n encode(input) {\n return this.encoder.encode(input);\n }\n decode(input) {\n return this.decoder.decode(input);\n }\n}\nconst from = ({name, prefix, encode, decode}) => new Codec(name, prefix, encode, decode);\nconst baseX = ({prefix, name, alphabet}) => {\n const {encode, decode} = baseX$1(alphabet, name);\n return from({\n prefix,\n name,\n encode,\n decode: text => bytes.coerce(decode(text))\n });\n};\nconst decode = (string, alphabet, bitsPerChar, name) => {\n const codes = {};\n for (let i = 0; i < alphabet.length; ++i) {\n codes[alphabet[i]] = i;\n }\n let end = string.length;\n while (string[end - 1] === '=') {\n --end;\n }\n const out = new Uint8Array(end * bitsPerChar / 8 | 0);\n let bits = 0;\n let buffer = 0;\n let written = 0;\n for (let i = 0; i < end; ++i) {\n const value = codes[string[i]];\n if (value === undefined) {\n throw new SyntaxError(`Non-${ name } character`);\n }\n buffer = buffer << bitsPerChar | value;\n bits += bitsPerChar;\n if (bits >= 8) {\n bits -= 8;\n out[written++] = 255 & buffer >> bits;\n }\n }\n if (bits >= bitsPerChar || 255 & buffer << 8 - bits) {\n throw new SyntaxError('Unexpected end of data');\n }\n return out;\n};\nconst encode = (data, alphabet, bitsPerChar) => {\n const pad = alphabet[alphabet.length - 1] === '=';\n const mask = (1 << bitsPerChar) - 1;\n let out = '';\n let bits = 0;\n let buffer = 0;\n for (let i = 0; i < data.length; ++i) {\n buffer = buffer << 8 | data[i];\n bits += 8;\n while (bits > bitsPerChar) {\n bits -= bitsPerChar;\n out += alphabet[mask & buffer >> bits];\n }\n }\n if (bits) {\n out += alphabet[mask & buffer << bitsPerChar - bits];\n }\n if (pad) {\n while (out.length * bitsPerChar & 7) {\n out += '=';\n }\n }\n return out;\n};\nconst rfc4648 = ({name, prefix, bitsPerChar, alphabet}) => {\n return from({\n prefix,\n name,\n encode(input) {\n return encode(input, alphabet, bitsPerChar);\n },\n decode(input) {\n return decode(input, alphabet, bitsPerChar, name);\n }\n });\n};\n\nexports.Codec = Codec;\nexports.baseX = baseX;\nexports.from = from;\nexports.or = or;\nexports.rfc4648 = rfc4648;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar base = require('./base.js');\n\nconst base10 = base.baseX({\n prefix: '9',\n name: 'base10',\n alphabet: '0123456789'\n});\n\nexports.base10 = base10;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar base = require('./base.js');\n\nconst base16 = base.rfc4648({\n prefix: 'f',\n name: 'base16',\n alphabet: '0123456789abcdef',\n bitsPerChar: 4\n});\nconst base16upper = base.rfc4648({\n prefix: 'F',\n name: 'base16upper',\n alphabet: '0123456789ABCDEF',\n bitsPerChar: 4\n});\n\nexports.base16 = base16;\nexports.base16upper = base16upper;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar base = require('./base.js');\n\nconst base2 = base.rfc4648({\n prefix: '0',\n name: 'base2',\n alphabet: '01',\n bitsPerChar: 1\n});\n\nexports.base2 = base2;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar base = require('./base.js');\n\nconst base32 = base.rfc4648({\n prefix: 'b',\n name: 'base32',\n alphabet: 'abcdefghijklmnopqrstuvwxyz234567',\n bitsPerChar: 5\n});\nconst base32upper = base.rfc4648({\n prefix: 'B',\n name: 'base32upper',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567',\n bitsPerChar: 5\n});\nconst base32pad = base.rfc4648({\n prefix: 'c',\n name: 'base32pad',\n alphabet: 'abcdefghijklmnopqrstuvwxyz234567=',\n bitsPerChar: 5\n});\nconst base32padupper = base.rfc4648({\n prefix: 'C',\n name: 'base32padupper',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=',\n bitsPerChar: 5\n});\nconst base32hex = base.rfc4648({\n prefix: 'v',\n name: 'base32hex',\n alphabet: '0123456789abcdefghijklmnopqrstuv',\n bitsPerChar: 5\n});\nconst base32hexupper = base.rfc4648({\n prefix: 'V',\n name: 'base32hexupper',\n alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV',\n bitsPerChar: 5\n});\nconst base32hexpad = base.rfc4648({\n prefix: 't',\n name: 'base32hexpad',\n alphabet: '0123456789abcdefghijklmnopqrstuv=',\n bitsPerChar: 5\n});\nconst base32hexpadupper = base.rfc4648({\n prefix: 'T',\n name: 'base32hexpadupper',\n alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=',\n bitsPerChar: 5\n});\nconst base32z = base.rfc4648({\n prefix: 'h',\n name: 'base32z',\n alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769',\n bitsPerChar: 5\n});\n\nexports.base32 = base32;\nexports.base32hex = base32hex;\nexports.base32hexpad = base32hexpad;\nexports.base32hexpadupper = base32hexpadupper;\nexports.base32hexupper = base32hexupper;\nexports.base32pad = base32pad;\nexports.base32padupper = base32padupper;\nexports.base32upper = base32upper;\nexports.base32z = base32z;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar base = require('./base.js');\n\nconst base36 = base.baseX({\n prefix: 'k',\n name: 'base36',\n alphabet: '0123456789abcdefghijklmnopqrstuvwxyz'\n});\nconst base36upper = base.baseX({\n prefix: 'K',\n name: 'base36upper',\n alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'\n});\n\nexports.base36 = base36;\nexports.base36upper = base36upper;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar base = require('./base.js');\n\nconst base58btc = base.baseX({\n name: 'base58btc',\n prefix: 'z',\n alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'\n});\nconst base58flickr = base.baseX({\n name: 'base58flickr',\n prefix: 'Z',\n alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'\n});\n\nexports.base58btc = base58btc;\nexports.base58flickr = base58flickr;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar base = require('./base.js');\n\nconst base64 = base.rfc4648({\n prefix: 'm',\n name: 'base64',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n bitsPerChar: 6\n});\nconst base64pad = base.rfc4648({\n prefix: 'M',\n name: 'base64pad',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',\n bitsPerChar: 6\n});\nconst base64url = base.rfc4648({\n prefix: 'u',\n name: 'base64url',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_',\n bitsPerChar: 6\n});\nconst base64urlpad = base.rfc4648({\n prefix: 'U',\n name: 'base64urlpad',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=',\n bitsPerChar: 6\n});\n\nexports.base64 = base64;\nexports.base64pad = base64pad;\nexports.base64url = base64url;\nexports.base64urlpad = base64urlpad;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar base = require('./base.js');\n\nconst base8 = base.rfc4648({\n prefix: '7',\n name: 'base8',\n alphabet: '01234567',\n bitsPerChar: 3\n});\n\nexports.base8 = base8;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar base = require('./base.js');\nvar bytes = require('../bytes.js');\n\nconst identity = base.from({\n prefix: '\\0',\n name: 'identity',\n encode: buf => bytes.toString(buf),\n decode: str => bytes.fromString(str)\n});\n\nexports.identity = identity;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar identity = require('./bases/identity.js');\nvar base2 = require('./bases/base2.js');\nvar base8 = require('./bases/base8.js');\nvar base10 = require('./bases/base10.js');\nvar base16 = require('./bases/base16.js');\nvar base32 = require('./bases/base32.js');\nvar base36 = require('./bases/base36.js');\nvar base58 = require('./bases/base58.js');\nvar base64 = require('./bases/base64.js');\nvar sha2 = require('./hashes/sha2.js');\nvar identity$1 = require('./hashes/identity.js');\nvar raw = require('./codecs/raw.js');\nvar json = require('./codecs/json.js');\nrequire('./index.js');\nvar cid = require('./cid.js');\nvar hasher = require('./hashes/hasher.js');\nvar digest = require('./hashes/digest.js');\nvar varint = require('./varint.js');\nvar bytes = require('./bytes.js');\n\nconst bases = {\n ...identity,\n ...base2,\n ...base8,\n ...base10,\n ...base16,\n ...base32,\n ...base36,\n ...base58,\n ...base64\n};\nconst hashes = {\n ...sha2,\n ...identity$1\n};\nconst codecs = {\n raw,\n json\n};\n\nexports.CID = cid.CID;\nexports.hasher = hasher;\nexports.digest = digest;\nexports.varint = varint;\nexports.bytes = bytes;\nexports.bases = bases;\nexports.codecs = codecs;\nexports.hashes = hashes;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nrequire('./index.js');\nvar cid = require('./cid.js');\nvar bytes = require('./bytes.js');\n\nconst readonly = ({enumerable = true, configurable = false} = {}) => ({\n enumerable,\n configurable,\n writable: false\n});\nconst links = function* (source, base) {\n if (source == null)\n return;\n if (source instanceof Uint8Array)\n return;\n for (const [key, value] of Object.entries(source)) {\n const path = [\n ...base,\n key\n ];\n if (value != null && typeof value === 'object') {\n if (Array.isArray(value)) {\n for (const [index, element] of value.entries()) {\n const elementPath = [\n ...path,\n index\n ];\n const cid$1 = cid.CID.asCID(element);\n if (cid$1) {\n yield [\n elementPath.join('/'),\n cid$1\n ];\n } else if (typeof element === 'object') {\n yield* links(element, elementPath);\n }\n }\n } else {\n const cid$1 = cid.CID.asCID(value);\n if (cid$1) {\n yield [\n path.join('/'),\n cid$1\n ];\n } else {\n yield* links(value, path);\n }\n }\n }\n }\n};\nconst tree = function* (source, base) {\n if (source == null)\n return;\n for (const [key, value] of Object.entries(source)) {\n const path = [\n ...base,\n key\n ];\n yield path.join('/');\n if (value != null && !(value instanceof Uint8Array) && typeof value === 'object' && !cid.CID.asCID(value)) {\n if (Array.isArray(value)) {\n for (const [index, element] of value.entries()) {\n const elementPath = [\n ...path,\n index\n ];\n yield elementPath.join('/');\n if (typeof element === 'object' && !cid.CID.asCID(element)) {\n yield* tree(element, elementPath);\n }\n }\n } else {\n yield* tree(value, path);\n }\n }\n }\n};\nconst get = (source, path) => {\n let node = source;\n for (const [index, key] of path.entries()) {\n node = node[key];\n if (node == null) {\n throw new Error(`Object has no property at ${ path.slice(0, index + 1).map(part => `[${ JSON.stringify(part) }]`).join('') }`);\n }\n const cid$1 = cid.CID.asCID(node);\n if (cid$1) {\n return {\n value: cid$1,\n remaining: path.slice(index + 1).join('/')\n };\n }\n }\n return { value: node };\n};\nclass Block {\n constructor({cid, bytes, value}) {\n if (!cid || !bytes || typeof value === 'undefined')\n throw new Error('Missing required argument');\n this.cid = cid;\n this.bytes = bytes;\n this.value = value;\n this.asBlock = this;\n Object.defineProperties(this, {\n cid: readonly(),\n bytes: readonly(),\n value: readonly(),\n asBlock: readonly()\n });\n }\n links() {\n return links(this.value, []);\n }\n tree() {\n return tree(this.value, []);\n }\n get(path = '/') {\n return get(this.value, path.split('/').filter(Boolean));\n }\n}\nconst encode = async ({value, codec, hasher}) => {\n if (typeof value === 'undefined')\n throw new Error('Missing required argument \"value\"');\n if (!codec || !hasher)\n throw new Error('Missing required argument: codec or hasher');\n const bytes = codec.encode(value);\n const hash = await hasher.digest(bytes);\n const cid$1 = cid.CID.create(1, codec.code, hash);\n return new Block({\n value,\n bytes,\n cid: cid$1\n });\n};\nconst decode = async ({bytes, codec, hasher}) => {\n if (!bytes)\n throw new Error('Missing required argument \"bytes\"');\n if (!codec || !hasher)\n throw new Error('Missing required argument: codec or hasher');\n const value = codec.decode(bytes);\n const hash = await hasher.digest(bytes);\n const cid$1 = cid.CID.create(1, codec.code, hash);\n return new Block({\n value,\n bytes,\n cid: cid$1\n });\n};\nconst createUnsafe = ({\n bytes,\n cid,\n value: maybeValue,\n codec\n}) => {\n const value = maybeValue !== undefined ? maybeValue : codec && codec.decode(bytes);\n if (value === undefined)\n throw new Error('Missing required argument, must either provide \"value\" or \"codec\"');\n return new Block({\n cid,\n bytes,\n value\n });\n};\nconst create = async ({bytes: bytes$1, cid, hasher, codec}) => {\n if (!bytes$1)\n throw new Error('Missing required argument \"bytes\"');\n if (!hasher)\n throw new Error('Missing required argument \"hasher\"');\n const value = codec.decode(bytes$1);\n const hash = await hasher.digest(bytes$1);\n if (!bytes.equals(cid.multihash.bytes, hash.bytes)) {\n throw new Error('CID hash does not match bytes');\n }\n return createUnsafe({\n bytes: bytes$1,\n cid,\n value,\n codec\n });\n};\n\nexports.Block = Block;\nexports.create = create;\nexports.createUnsafe = createUnsafe;\nexports.decode = decode;\nexports.encode = encode;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst empty = new Uint8Array(0);\nconst toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '');\nconst fromHex = hex => {\n const hexes = hex.match(/../g);\n return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : empty;\n};\nconst equals = (aa, bb) => {\n if (aa === bb)\n return true;\n if (aa.byteLength !== bb.byteLength) {\n return false;\n }\n for (let ii = 0; ii < aa.byteLength; ii++) {\n if (aa[ii] !== bb[ii]) {\n return false;\n }\n }\n return true;\n};\nconst coerce = o => {\n if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array')\n return o;\n if (o instanceof ArrayBuffer)\n return new Uint8Array(o);\n if (ArrayBuffer.isView(o)) {\n return new Uint8Array(o.buffer, o.byteOffset, o.byteLength);\n }\n throw new Error('Unknown type, must be binary type');\n};\nconst isBinary = o => o instanceof ArrayBuffer || ArrayBuffer.isView(o);\nconst fromString = str => new TextEncoder().encode(str);\nconst toString = b => new TextDecoder().decode(b);\n\nexports.coerce = coerce;\nexports.empty = empty;\nexports.equals = equals;\nexports.fromHex = fromHex;\nexports.fromString = fromString;\nexports.isBinary = isBinary;\nexports.toHex = toHex;\nexports.toString = toString;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar varint = require('./varint.js');\nvar digest = require('./hashes/digest.js');\nvar base58 = require('./bases/base58.js');\nvar base32 = require('./bases/base32.js');\nvar bytes = require('./bytes.js');\n\nclass CID {\n constructor(version, code, multihash, bytes) {\n this.code = code;\n this.version = version;\n this.multihash = multihash;\n this.bytes = bytes;\n this.byteOffset = bytes.byteOffset;\n this.byteLength = bytes.byteLength;\n this.asCID = this;\n this._baseCache = new Map();\n Object.defineProperties(this, {\n byteOffset: hidden,\n byteLength: hidden,\n code: readonly,\n version: readonly,\n multihash: readonly,\n bytes: readonly,\n _baseCache: hidden,\n asCID: hidden\n });\n }\n toV0() {\n switch (this.version) {\n case 0: {\n return this;\n }\n default: {\n const {code, multihash} = this;\n if (code !== DAG_PB_CODE) {\n throw new Error('Cannot convert a non dag-pb CID to CIDv0');\n }\n if (multihash.code !== SHA_256_CODE) {\n throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0');\n }\n return CID.createV0(multihash);\n }\n }\n }\n toV1() {\n switch (this.version) {\n case 0: {\n const {code, digest: digest$1} = this.multihash;\n const multihash = digest.create(code, digest$1);\n return CID.createV1(this.code, multihash);\n }\n case 1: {\n return this;\n }\n default: {\n throw Error(`Can not convert CID version ${ this.version } to version 0. This is a bug please report`);\n }\n }\n }\n equals(other) {\n return other && this.code === other.code && this.version === other.version && digest.equals(this.multihash, other.multihash);\n }\n toString(base) {\n const {bytes, version, _baseCache} = this;\n switch (version) {\n case 0:\n return toStringV0(bytes, _baseCache, base || base58.base58btc.encoder);\n default:\n return toStringV1(bytes, _baseCache, base || base32.base32.encoder);\n }\n }\n toJSON() {\n return {\n code: this.code,\n version: this.version,\n hash: this.multihash.bytes\n };\n }\n get [Symbol.toStringTag]() {\n return 'CID';\n }\n [Symbol.for('nodejs.util.inspect.custom')]() {\n return 'CID(' + this.toString() + ')';\n }\n static isCID(value) {\n deprecate(/^0\\.0/, IS_CID_DEPRECATION);\n return !!(value && (value[cidSymbol] || value.asCID === value));\n }\n get toBaseEncodedString() {\n throw new Error('Deprecated, use .toString()');\n }\n get codec() {\n throw new Error('\"codec\" property is deprecated, use integer \"code\" property instead');\n }\n get buffer() {\n throw new Error('Deprecated .buffer property, use .bytes to get Uint8Array instead');\n }\n get multibaseName() {\n throw new Error('\"multibaseName\" property is deprecated');\n }\n get prefix() {\n throw new Error('\"prefix\" property is deprecated');\n }\n static asCID(value) {\n if (value instanceof CID) {\n return value;\n } else if (value != null && value.asCID === value) {\n const {version, code, multihash, bytes} = value;\n return new CID(version, code, multihash, bytes || encodeCID(version, code, multihash.bytes));\n } else if (value != null && value[cidSymbol] === true) {\n const {version, multihash, code} = value;\n const digest$1 = digest.decode(multihash);\n return CID.create(version, code, digest$1);\n } else {\n return null;\n }\n }\n static create(version, code, digest) {\n if (typeof code !== 'number') {\n throw new Error('String codecs are no longer supported');\n }\n switch (version) {\n case 0: {\n if (code !== DAG_PB_CODE) {\n throw new Error(`Version 0 CID must use dag-pb (code: ${ DAG_PB_CODE }) block encoding`);\n } else {\n return new CID(version, code, digest, digest.bytes);\n }\n }\n case 1: {\n const bytes = encodeCID(version, code, digest.bytes);\n return new CID(version, code, digest, bytes);\n }\n default: {\n throw new Error('Invalid version');\n }\n }\n }\n static createV0(digest) {\n return CID.create(0, DAG_PB_CODE, digest);\n }\n static createV1(code, digest) {\n return CID.create(1, code, digest);\n }\n static decode(bytes) {\n const [cid, remainder] = CID.decodeFirst(bytes);\n if (remainder.length) {\n throw new Error('Incorrect length');\n }\n return cid;\n }\n static decodeFirst(bytes$1) {\n const specs = CID.inspectBytes(bytes$1);\n const prefixSize = specs.size - specs.multihashSize;\n const multihashBytes = bytes.coerce(bytes$1.subarray(prefixSize, prefixSize + specs.multihashSize));\n if (multihashBytes.byteLength !== specs.multihashSize) {\n throw new Error('Incorrect length');\n }\n const digestBytes = multihashBytes.subarray(specs.multihashSize - specs.digestSize);\n const digest$1 = new digest.Digest(specs.multihashCode, specs.digestSize, digestBytes, multihashBytes);\n const cid = specs.version === 0 ? CID.createV0(digest$1) : CID.createV1(specs.codec, digest$1);\n return [\n cid,\n bytes$1.subarray(specs.size)\n ];\n }\n static inspectBytes(initialBytes) {\n let offset = 0;\n const next = () => {\n const [i, length] = varint.decode(initialBytes.subarray(offset));\n offset += length;\n return i;\n };\n let version = next();\n let codec = DAG_PB_CODE;\n if (version === 18) {\n version = 0;\n offset = 0;\n } else if (version === 1) {\n codec = next();\n }\n if (version !== 0 && version !== 1) {\n throw new RangeError(`Invalid CID version ${ version }`);\n }\n const prefixSize = offset;\n const multihashCode = next();\n const digestSize = next();\n const size = offset + digestSize;\n const multihashSize = size - prefixSize;\n return {\n version,\n codec,\n multihashCode,\n digestSize,\n multihashSize,\n size\n };\n }\n static parse(source, base) {\n const [prefix, bytes] = parseCIDtoBytes(source, base);\n const cid = CID.decode(bytes);\n cid._baseCache.set(prefix, source);\n return cid;\n }\n}\nconst parseCIDtoBytes = (source, base) => {\n switch (source[0]) {\n case 'Q': {\n const decoder = base || base58.base58btc;\n return [\n base58.base58btc.prefix,\n decoder.decode(`${ base58.base58btc.prefix }${ source }`)\n ];\n }\n case base58.base58btc.prefix: {\n const decoder = base || base58.base58btc;\n return [\n base58.base58btc.prefix,\n decoder.decode(source)\n ];\n }\n case base32.base32.prefix: {\n const decoder = base || base32.base32;\n return [\n base32.base32.prefix,\n decoder.decode(source)\n ];\n }\n default: {\n if (base == null) {\n throw Error('To parse non base32 or base58btc encoded CID multibase decoder must be provided');\n }\n return [\n source[0],\n base.decode(source)\n ];\n }\n }\n};\nconst toStringV0 = (bytes, cache, base) => {\n const {prefix} = base;\n if (prefix !== base58.base58btc.prefix) {\n throw Error(`Cannot string encode V0 in ${ base.name } encoding`);\n }\n const cid = cache.get(prefix);\n if (cid == null) {\n const cid = base.encode(bytes).slice(1);\n cache.set(prefix, cid);\n return cid;\n } else {\n return cid;\n }\n};\nconst toStringV1 = (bytes, cache, base) => {\n const {prefix} = base;\n const cid = cache.get(prefix);\n if (cid == null) {\n const cid = base.encode(bytes);\n cache.set(prefix, cid);\n return cid;\n } else {\n return cid;\n }\n};\nconst DAG_PB_CODE = 112;\nconst SHA_256_CODE = 18;\nconst encodeCID = (version, code, multihash) => {\n const codeOffset = varint.encodingLength(version);\n const hashOffset = codeOffset + varint.encodingLength(code);\n const bytes = new Uint8Array(hashOffset + multihash.byteLength);\n varint.encodeTo(version, bytes, 0);\n varint.encodeTo(code, bytes, codeOffset);\n bytes.set(multihash, hashOffset);\n return bytes;\n};\nconst cidSymbol = Symbol.for('@ipld/js-cid/CID');\nconst readonly = {\n writable: false,\n configurable: false,\n enumerable: true\n};\nconst hidden = {\n writable: false,\n enumerable: false,\n configurable: false\n};\nconst version = '0.0.0-dev';\nconst deprecate = (range, message) => {\n if (range.test(version)) {\n console.warn(message);\n } else {\n throw new Error(message);\n }\n};\nconst IS_CID_DEPRECATION = `CID.isCID(v) is deprecated and will be removed in the next major release.\nFollowing code pattern:\n\nif (CID.isCID(value)) {\n doSomethingWithCID(value)\n}\n\nIs replaced with:\n\nconst cid = CID.asCID(value)\nif (cid) {\n // Make sure to use cid instead of value\n doSomethingWithCID(cid)\n}\n`;\n\nexports.CID = CID;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst textEncoder = new TextEncoder();\nconst textDecoder = new TextDecoder();\nconst name = 'json';\nconst code = 512;\nconst encode = node => textEncoder.encode(JSON.stringify(node));\nconst decode = data => JSON.parse(textDecoder.decode(data));\n\nexports.code = code;\nexports.decode = decode;\nexports.encode = encode;\nexports.name = name;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar bytes = require('../bytes.js');\n\nconst name = 'raw';\nconst code = 85;\nconst encode = node => bytes.coerce(node);\nconst decode = data => bytes.coerce(data);\n\nexports.code = code;\nexports.decode = decode;\nexports.encode = encode;\nexports.name = name;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar bytes = require('../bytes.js');\nvar varint = require('../varint.js');\n\nconst create = (code, digest) => {\n const size = digest.byteLength;\n const sizeOffset = varint.encodingLength(code);\n const digestOffset = sizeOffset + varint.encodingLength(size);\n const bytes = new Uint8Array(digestOffset + size);\n varint.encodeTo(code, bytes, 0);\n varint.encodeTo(size, bytes, sizeOffset);\n bytes.set(digest, digestOffset);\n return new Digest(code, size, digest, bytes);\n};\nconst decode = multihash => {\n const bytes$1 = bytes.coerce(multihash);\n const [code, sizeOffset] = varint.decode(bytes$1);\n const [size, digestOffset] = varint.decode(bytes$1.subarray(sizeOffset));\n const digest = bytes$1.subarray(sizeOffset + digestOffset);\n if (digest.byteLength !== size) {\n throw new Error('Incorrect length');\n }\n return new Digest(code, size, digest, bytes$1);\n};\nconst equals = (a, b) => {\n if (a === b) {\n return true;\n } else {\n return a.code === b.code && a.size === b.size && bytes.equals(a.bytes, b.bytes);\n }\n};\nclass Digest {\n constructor(code, size, digest, bytes) {\n this.code = code;\n this.size = size;\n this.digest = digest;\n this.bytes = bytes;\n }\n}\n\nexports.Digest = Digest;\nexports.create = create;\nexports.decode = decode;\nexports.equals = equals;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar digest = require('./digest.js');\n\nconst from = ({name, code, encode}) => new Hasher(name, code, encode);\nclass Hasher {\n constructor(name, code, encode) {\n this.name = name;\n this.code = code;\n this.encode = encode;\n }\n digest(input) {\n if (input instanceof Uint8Array) {\n const result = this.encode(input);\n return result instanceof Uint8Array ? digest.create(this.code, result) : result.then(digest$1 => digest.create(this.code, digest$1));\n } else {\n throw Error('Unknown type, must be binary type');\n }\n }\n}\n\nexports.Hasher = Hasher;\nexports.from = from;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar bytes = require('../bytes.js');\nvar digest$1 = require('./digest.js');\n\nconst code = 0;\nconst name = 'identity';\nconst encode = bytes.coerce;\nconst digest = input => digest$1.create(code, encode(input));\nconst identity = {\n code,\n name,\n encode,\n digest\n};\n\nexports.identity = identity;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar crypto = require('crypto');\nvar hasher = require('./hasher.js');\nvar bytes = require('../bytes.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar crypto__default = /*#__PURE__*/_interopDefaultLegacy(crypto);\n\nconst sha256 = hasher.from({\n name: 'sha2-256',\n code: 18,\n encode: input => bytes.coerce(crypto__default[\"default\"].createHash('sha256').update(input).digest())\n});\nconst sha512 = hasher.from({\n name: 'sha2-512',\n code: 19,\n encode: input => bytes.coerce(crypto__default[\"default\"].createHash('sha512').update(input).digest())\n});\n\nexports.sha256 = sha256;\nexports.sha512 = sha512;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar cid = require('./cid.js');\nvar varint = require('./varint.js');\nvar bytes = require('./bytes.js');\nvar hasher = require('./hashes/hasher.js');\nvar digest = require('./hashes/digest.js');\n\n\n\nexports.CID = cid.CID;\nexports.varint = varint;\nexports.bytes = bytes;\nexports.hasher = hasher;\nexports.digest = digest;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar varint$1 = require('../vendor/varint.js');\n\nconst decode = data => {\n const code = varint$1.decode(data);\n return [\n code,\n varint$1.decode.bytes\n ];\n};\nconst encodeTo = (int, target, offset = 0) => {\n varint$1.encode(int, target, offset);\n return target;\n};\nconst encodingLength = int => {\n return varint$1.encodingLength(int);\n};\n\nexports.decode = decode;\nexports.encodeTo = encodeTo;\nexports.encodingLength = encodingLength;\n","'use strict';\n\nfunction base(ALPHABET, name) {\n if (ALPHABET.length >= 255) {\n throw new TypeError('Alphabet too long');\n }\n var BASE_MAP = new Uint8Array(256);\n for (var j = 0; j < BASE_MAP.length; j++) {\n BASE_MAP[j] = 255;\n }\n for (var i = 0; i < ALPHABET.length; i++) {\n var x = ALPHABET.charAt(i);\n var xc = x.charCodeAt(0);\n if (BASE_MAP[xc] !== 255) {\n throw new TypeError(x + ' is ambiguous');\n }\n BASE_MAP[xc] = i;\n }\n var BASE = ALPHABET.length;\n var LEADER = ALPHABET.charAt(0);\n var FACTOR = Math.log(BASE) / Math.log(256);\n var iFACTOR = Math.log(256) / Math.log(BASE);\n function encode(source) {\n if (source instanceof Uint8Array);\n else if (ArrayBuffer.isView(source)) {\n source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);\n } else if (Array.isArray(source)) {\n source = Uint8Array.from(source);\n }\n if (!(source instanceof Uint8Array)) {\n throw new TypeError('Expected Uint8Array');\n }\n if (source.length === 0) {\n return '';\n }\n var zeroes = 0;\n var length = 0;\n var pbegin = 0;\n var pend = source.length;\n while (pbegin !== pend && source[pbegin] === 0) {\n pbegin++;\n zeroes++;\n }\n var size = (pend - pbegin) * iFACTOR + 1 >>> 0;\n var b58 = new Uint8Array(size);\n while (pbegin !== pend) {\n var carry = source[pbegin];\n var i = 0;\n for (var it1 = size - 1; (carry !== 0 || i < length) && it1 !== -1; it1--, i++) {\n carry += 256 * b58[it1] >>> 0;\n b58[it1] = carry % BASE >>> 0;\n carry = carry / BASE >>> 0;\n }\n if (carry !== 0) {\n throw new Error('Non-zero carry');\n }\n length = i;\n pbegin++;\n }\n var it2 = size - length;\n while (it2 !== size && b58[it2] === 0) {\n it2++;\n }\n var str = LEADER.repeat(zeroes);\n for (; it2 < size; ++it2) {\n str += ALPHABET.charAt(b58[it2]);\n }\n return str;\n }\n function decodeUnsafe(source) {\n if (typeof source !== 'string') {\n throw new TypeError('Expected String');\n }\n if (source.length === 0) {\n return new Uint8Array();\n }\n var psz = 0;\n if (source[psz] === ' ') {\n return;\n }\n var zeroes = 0;\n var length = 0;\n while (source[psz] === LEADER) {\n zeroes++;\n psz++;\n }\n var size = (source.length - psz) * FACTOR + 1 >>> 0;\n var b256 = new Uint8Array(size);\n while (source[psz]) {\n var carry = BASE_MAP[source.charCodeAt(psz)];\n if (carry === 255) {\n return;\n }\n var i = 0;\n for (var it3 = size - 1; (carry !== 0 || i < length) && it3 !== -1; it3--, i++) {\n carry += BASE * b256[it3] >>> 0;\n b256[it3] = carry % 256 >>> 0;\n carry = carry / 256 >>> 0;\n }\n if (carry !== 0) {\n throw new Error('Non-zero carry');\n }\n length = i;\n psz++;\n }\n if (source[psz] === ' ') {\n return;\n }\n var it4 = size - length;\n while (it4 !== size && b256[it4] === 0) {\n it4++;\n }\n var vch = new Uint8Array(zeroes + (size - it4));\n var j = zeroes;\n while (it4 !== size) {\n vch[j++] = b256[it4++];\n }\n return vch;\n }\n function decode(string) {\n var buffer = decodeUnsafe(string);\n if (buffer) {\n return buffer;\n }\n throw new Error(`Non-${ name } character`);\n }\n return {\n encode: encode,\n decodeUnsafe: decodeUnsafe,\n decode: decode\n };\n}\nvar src = base;\nvar _brrp__multiformats_scope_baseX = src;\n\nmodule.exports = _brrp__multiformats_scope_baseX;\n","'use strict';\n\nvar encode_1 = encode;\nvar MSB = 128, REST = 127, MSBALL = ~REST, INT = Math.pow(2, 31);\nfunction encode(num, out, offset) {\n out = out || [];\n offset = offset || 0;\n var oldOffset = offset;\n while (num >= INT) {\n out[offset++] = num & 255 | MSB;\n num /= 128;\n }\n while (num & MSBALL) {\n out[offset++] = num & 255 | MSB;\n num >>>= 7;\n }\n out[offset] = num | 0;\n encode.bytes = offset - oldOffset + 1;\n return out;\n}\nvar decode = read;\nvar MSB$1 = 128, REST$1 = 127;\nfunction read(buf, offset) {\n var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf.length;\n do {\n if (counter >= l) {\n read.bytes = 0;\n throw new RangeError('Could not decode varint');\n }\n b = buf[counter++];\n res += shift < 28 ? (b & REST$1) << shift : (b & REST$1) * Math.pow(2, shift);\n shift += 7;\n } while (b >= MSB$1);\n read.bytes = counter - offset;\n return res;\n}\nvar N1 = Math.pow(2, 7);\nvar N2 = Math.pow(2, 14);\nvar N3 = Math.pow(2, 21);\nvar N4 = Math.pow(2, 28);\nvar N5 = Math.pow(2, 35);\nvar N6 = Math.pow(2, 42);\nvar N7 = Math.pow(2, 49);\nvar N8 = Math.pow(2, 56);\nvar N9 = Math.pow(2, 63);\nvar length = function (value) {\n return value < N1 ? 1 : value < N2 ? 2 : value < N3 ? 3 : value < N4 ? 4 : value < N5 ? 5 : value < N6 ? 6 : value < N7 ? 7 : value < N8 ? 8 : value < N9 ? 9 : 10;\n};\nvar varint = {\n encode: encode_1,\n decode: decode,\n encodingLength: length\n};\nvar _brrp_varint = varint;\nvar varint$1 = _brrp_varint;\n\nmodule.exports = varint$1;\n","module.exports = require('./lib/murmurHash3js');\n","/* jshint -W086: true */\n// +----------------------------------------------------------------------+\n// | murmurHash3js.js v3.0.1 // https://github.com/pid/murmurHash3js\n// | A javascript implementation of MurmurHash3's x86 hashing algorithms. |\n// |----------------------------------------------------------------------|\n// | Copyright (c) 2012-2015 Karan Lyons |\n// | https://github.com/karanlyons/murmurHash3.js/blob/c1778f75792abef7bdd74bc85d2d4e1a3d25cfe9/murmurHash3.js |\n// | Freely distributable under the MIT license. |\n// +----------------------------------------------------------------------+\n\n;(function (root, undefined) {\n 'use strict';\n\n // Create a local object that'll be exported or referenced globally.\n var library = {\n 'version': '3.0.0',\n 'x86': {},\n 'x64': {},\n 'inputValidation': true\n };\n\n // PRIVATE FUNCTIONS\n // -----------------\n\n function _validBytes(bytes) {\n // check the input is an array or a typed array\n if (!Array.isArray(bytes) && !ArrayBuffer.isView(bytes)) {\n return false;\n }\n\n // check all bytes are actually bytes\n for (var i = 0; i < bytes.length; i++) {\n if (!Number.isInteger(bytes[i]) || bytes[i] < 0 || bytes[i] > 255) {\n return false;\n }\n }\n return true;\n }\n\n function _x86Multiply(m, n) {\n //\n // Given two 32bit ints, returns the two multiplied together as a\n // 32bit int.\n //\n\n return ((m & 0xffff) * n) + ((((m >>> 16) * n) & 0xffff) << 16);\n }\n\n function _x86Rotl(m, n) {\n //\n // Given a 32bit int and an int representing a number of bit positions,\n // returns the 32bit int rotated left by that number of positions.\n //\n\n return (m << n) | (m >>> (32 - n));\n }\n\n function _x86Fmix(h) {\n //\n // Given a block, returns murmurHash3's final x86 mix of that block.\n //\n\n h ^= h >>> 16;\n h = _x86Multiply(h, 0x85ebca6b);\n h ^= h >>> 13;\n h = _x86Multiply(h, 0xc2b2ae35);\n h ^= h >>> 16;\n\n return h;\n }\n\n function _x64Add(m, n) {\n //\n // Given two 64bit ints (as an array of two 32bit ints) returns the two\n // added together as a 64bit int (as an array of two 32bit ints).\n //\n\n m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];\n n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];\n var o = [0, 0, 0, 0];\n\n o[3] += m[3] + n[3];\n o[2] += o[3] >>> 16;\n o[3] &= 0xffff;\n\n o[2] += m[2] + n[2];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n\n o[1] += m[1] + n[1];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n\n o[0] += m[0] + n[0];\n o[0] &= 0xffff;\n\n return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];\n }\n\n function _x64Multiply(m, n) {\n //\n // Given two 64bit ints (as an array of two 32bit ints) returns the two\n // multiplied together as a 64bit int (as an array of two 32bit ints).\n //\n\n m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];\n n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];\n var o = [0, 0, 0, 0];\n\n o[3] += m[3] * n[3];\n o[2] += o[3] >>> 16;\n o[3] &= 0xffff;\n\n o[2] += m[2] * n[3];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n\n o[2] += m[3] * n[2];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n\n o[1] += m[1] * n[3];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n\n o[1] += m[2] * n[2];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n\n o[1] += m[3] * n[1];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n\n o[0] += (m[0] * n[3]) + (m[1] * n[2]) + (m[2] * n[1]) + (m[3] * n[0]);\n o[0] &= 0xffff;\n\n return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];\n }\n\n function _x64Rotl(m, n) {\n //\n // Given a 64bit int (as an array of two 32bit ints) and an int\n // representing a number of bit positions, returns the 64bit int (as an\n // array of two 32bit ints) rotated left by that number of positions.\n //\n\n n %= 64;\n\n if (n === 32) {\n return [m[1], m[0]];\n } else if (n < 32) {\n return [(m[0] << n) | (m[1] >>> (32 - n)), (m[1] << n) | (m[0] >>> (32 - n))];\n } else {\n n -= 32;\n return [(m[1] << n) | (m[0] >>> (32 - n)), (m[0] << n) | (m[1] >>> (32 - n))];\n }\n }\n\n function _x64LeftShift(m, n) {\n //\n // Given a 64bit int (as an array of two 32bit ints) and an int\n // representing a number of bit positions, returns the 64bit int (as an\n // array of two 32bit ints) shifted left by that number of positions.\n //\n\n n %= 64;\n\n if (n === 0) {\n return m;\n } else if (n < 32) {\n return [(m[0] << n) | (m[1] >>> (32 - n)), m[1] << n];\n } else {\n return [m[1] << (n - 32), 0];\n }\n }\n\n function _x64Xor(m, n) {\n //\n // Given two 64bit ints (as an array of two 32bit ints) returns the two\n // xored together as a 64bit int (as an array of two 32bit ints).\n //\n\n return [m[0] ^ n[0], m[1] ^ n[1]];\n }\n\n function _x64Fmix(h) {\n //\n // Given a block, returns murmurHash3's final x64 mix of that block.\n // (`[0, h[0] >>> 1]` is a 33 bit unsigned right shift. This is the\n // only place where we need to right shift 64bit ints.)\n //\n\n h = _x64Xor(h, [0, h[0] >>> 1]);\n h = _x64Multiply(h, [0xff51afd7, 0xed558ccd]);\n h = _x64Xor(h, [0, h[0] >>> 1]);\n h = _x64Multiply(h, [0xc4ceb9fe, 0x1a85ec53]);\n h = _x64Xor(h, [0, h[0] >>> 1]);\n\n return h;\n }\n\n // PUBLIC FUNCTIONS\n // ----------------\n\n library.x86.hash32 = function (bytes, seed) {\n //\n // Given a string and an optional seed as an int, returns a 32 bit hash\n // using the x86 flavor of MurmurHash3, as an unsigned int.\n //\n if (library.inputValidation && !_validBytes(bytes)) {\n return undefined;\n }\n seed = seed || 0;\n\n var remainder = bytes.length % 4;\n var blocks = bytes.length - remainder;\n\n var h1 = seed;\n\n var k1 = 0;\n\n var c1 = 0xcc9e2d51;\n var c2 = 0x1b873593;\n\n for (var i = 0; i < blocks; i = i + 4) {\n k1 = (bytes[i]) | (bytes[i + 1] << 8) | (bytes[i + 2] << 16) | (bytes[i + 3] << 24);\n\n k1 = _x86Multiply(k1, c1);\n k1 = _x86Rotl(k1, 15);\n k1 = _x86Multiply(k1, c2);\n\n h1 ^= k1;\n h1 = _x86Rotl(h1, 13);\n h1 = _x86Multiply(h1, 5) + 0xe6546b64;\n }\n\n k1 = 0;\n\n switch (remainder) {\n case 3:\n k1 ^= bytes[i + 2] << 16;\n\n case 2:\n k1 ^= bytes[i + 1] << 8;\n\n case 1:\n k1 ^= bytes[i];\n k1 = _x86Multiply(k1, c1);\n k1 = _x86Rotl(k1, 15);\n k1 = _x86Multiply(k1, c2);\n h1 ^= k1;\n }\n\n h1 ^= bytes.length;\n h1 = _x86Fmix(h1);\n\n return h1 >>> 0;\n };\n\n library.x86.hash128 = function (bytes, seed) {\n //\n // Given a string and an optional seed as an int, returns a 128 bit\n // hash using the x86 flavor of MurmurHash3, as an unsigned hex.\n //\n if (library.inputValidation && !_validBytes(bytes)) {\n return undefined;\n }\n\n seed = seed || 0;\n var remainder = bytes.length % 16;\n var blocks = bytes.length - remainder;\n\n var h1 = seed;\n var h2 = seed;\n var h3 = seed;\n var h4 = seed;\n\n var k1 = 0;\n var k2 = 0;\n var k3 = 0;\n var k4 = 0;\n\n var c1 = 0x239b961b;\n var c2 = 0xab0e9789;\n var c3 = 0x38b34ae5;\n var c4 = 0xa1e38b93;\n\n for (var i = 0; i < blocks; i = i + 16) {\n k1 = (bytes[i]) | (bytes[i + 1] << 8) | (bytes[i + 2] << 16) | (bytes[i + 3] << 24);\n k2 = (bytes[i + 4]) | (bytes[i + 5] << 8) | (bytes[i + 6] << 16) | (bytes[i + 7] << 24);\n k3 = (bytes[i + 8]) | (bytes[i + 9] << 8) | (bytes[i + 10] << 16) | (bytes[i + 11] << 24);\n k4 = (bytes[i + 12]) | (bytes[i + 13] << 8) | (bytes[i + 14] << 16) | (bytes[i + 15] << 24);\n\n k1 = _x86Multiply(k1, c1);\n k1 = _x86Rotl(k1, 15);\n k1 = _x86Multiply(k1, c2);\n h1 ^= k1;\n\n h1 = _x86Rotl(h1, 19);\n h1 += h2;\n h1 = _x86Multiply(h1, 5) + 0x561ccd1b;\n\n k2 = _x86Multiply(k2, c2);\n k2 = _x86Rotl(k2, 16);\n k2 = _x86Multiply(k2, c3);\n h2 ^= k2;\n\n h2 = _x86Rotl(h2, 17);\n h2 += h3;\n h2 = _x86Multiply(h2, 5) + 0x0bcaa747;\n\n k3 = _x86Multiply(k3, c3);\n k3 = _x86Rotl(k3, 17);\n k3 = _x86Multiply(k3, c4);\n h3 ^= k3;\n\n h3 = _x86Rotl(h3, 15);\n h3 += h4;\n h3 = _x86Multiply(h3, 5) + 0x96cd1c35;\n\n k4 = _x86Multiply(k4, c4);\n k4 = _x86Rotl(k4, 18);\n k4 = _x86Multiply(k4, c1);\n h4 ^= k4;\n\n h4 = _x86Rotl(h4, 13);\n h4 += h1;\n h4 = _x86Multiply(h4, 5) + 0x32ac3b17;\n }\n\n k1 = 0;\n k2 = 0;\n k3 = 0;\n k4 = 0;\n\n switch (remainder) {\n case 15:\n k4 ^= bytes[i + 14] << 16;\n\n case 14:\n k4 ^= bytes[i + 13] << 8;\n\n case 13:\n k4 ^= bytes[i + 12];\n k4 = _x86Multiply(k4, c4);\n k4 = _x86Rotl(k4, 18);\n k4 = _x86Multiply(k4, c1);\n h4 ^= k4;\n\n case 12:\n k3 ^= bytes[i + 11] << 24;\n\n case 11:\n k3 ^= bytes[i + 10] << 16;\n\n case 10:\n k3 ^= bytes[i + 9] << 8;\n\n case 9:\n k3 ^= bytes[i + 8];\n k3 = _x86Multiply(k3, c3);\n k3 = _x86Rotl(k3, 17);\n k3 = _x86Multiply(k3, c4);\n h3 ^= k3;\n\n case 8:\n k2 ^= bytes[i + 7] << 24;\n\n case 7:\n k2 ^= bytes[i + 6] << 16;\n\n case 6:\n k2 ^= bytes[i + 5] << 8;\n\n case 5:\n k2 ^= bytes[i + 4];\n k2 = _x86Multiply(k2, c2);\n k2 = _x86Rotl(k2, 16);\n k2 = _x86Multiply(k2, c3);\n h2 ^= k2;\n\n case 4:\n k1 ^= bytes[i + 3] << 24;\n\n case 3:\n k1 ^= bytes[i + 2] << 16;\n\n case 2:\n k1 ^= bytes[i + 1] << 8;\n\n case 1:\n k1 ^= bytes[i];\n k1 = _x86Multiply(k1, c1);\n k1 = _x86Rotl(k1, 15);\n k1 = _x86Multiply(k1, c2);\n h1 ^= k1;\n }\n\n h1 ^= bytes.length;\n h2 ^= bytes.length;\n h3 ^= bytes.length;\n h4 ^= bytes.length;\n\n h1 += h2;\n h1 += h3;\n h1 += h4;\n h2 += h1;\n h3 += h1;\n h4 += h1;\n\n h1 = _x86Fmix(h1);\n h2 = _x86Fmix(h2);\n h3 = _x86Fmix(h3);\n h4 = _x86Fmix(h4);\n\n h1 += h2;\n h1 += h3;\n h1 += h4;\n h2 += h1;\n h3 += h1;\n h4 += h1;\n\n return (\"00000000\" + (h1 >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h2 >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h3 >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h4 >>> 0).toString(16)).slice(-8);\n };\n\n library.x64.hash128 = function (bytes, seed) {\n //\n // Given a string and an optional seed as an int, returns a 128 bit\n // hash using the x64 flavor of MurmurHash3, as an unsigned hex.\n //\n if (library.inputValidation && !_validBytes(bytes)) {\n return undefined;\n }\n seed = seed || 0;\n\n var remainder = bytes.length % 16;\n var blocks = bytes.length - remainder;\n\n var h1 = [0, seed];\n var h2 = [0, seed];\n\n var k1 = [0, 0];\n var k2 = [0, 0];\n\n var c1 = [0x87c37b91, 0x114253d5];\n var c2 = [0x4cf5ad43, 0x2745937f];\n\n for (var i = 0; i < blocks; i = i + 16) {\n k1 = [(bytes[i + 4]) | (bytes[i + 5] << 8) | (bytes[i + 6] << 16) | (bytes[i + 7] << 24), (bytes[i]) |\n (bytes[i + 1] << 8) | (bytes[i + 2] << 16) | (bytes[i + 3] << 24)];\n k2 = [(bytes[i + 12]) | (bytes[i + 13] << 8) | (bytes[i + 14] << 16) | (bytes[i + 15] << 24), (bytes[i + 8]) |\n (bytes[i + 9] << 8) | (bytes[i + 10] << 16) | (bytes[i + 11] << 24)];\n\n k1 = _x64Multiply(k1, c1);\n k1 = _x64Rotl(k1, 31);\n k1 = _x64Multiply(k1, c2);\n h1 = _x64Xor(h1, k1);\n\n h1 = _x64Rotl(h1, 27);\n h1 = _x64Add(h1, h2);\n h1 = _x64Add(_x64Multiply(h1, [0, 5]), [0, 0x52dce729]);\n\n k2 = _x64Multiply(k2, c2);\n k2 = _x64Rotl(k2, 33);\n k2 = _x64Multiply(k2, c1);\n h2 = _x64Xor(h2, k2);\n\n h2 = _x64Rotl(h2, 31);\n h2 = _x64Add(h2, h1);\n h2 = _x64Add(_x64Multiply(h2, [0, 5]), [0, 0x38495ab5]);\n }\n\n k1 = [0, 0];\n k2 = [0, 0];\n\n switch (remainder) {\n case 15:\n k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 14]], 48));\n\n case 14:\n k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 13]], 40));\n\n case 13:\n k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 12]], 32));\n\n case 12:\n k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 11]], 24));\n\n case 11:\n k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 10]], 16));\n\n case 10:\n k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 9]], 8));\n\n case 9:\n k2 = _x64Xor(k2, [0, bytes[i + 8]]);\n k2 = _x64Multiply(k2, c2);\n k2 = _x64Rotl(k2, 33);\n k2 = _x64Multiply(k2, c1);\n h2 = _x64Xor(h2, k2);\n\n case 8:\n k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 7]], 56));\n\n case 7:\n k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 6]], 48));\n\n case 6:\n k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 5]], 40));\n\n case 5:\n k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 4]], 32));\n\n case 4:\n k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 3]], 24));\n\n case 3:\n k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 2]], 16));\n\n case 2:\n k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 1]], 8));\n\n case 1:\n k1 = _x64Xor(k1, [0, bytes[i]]);\n k1 = _x64Multiply(k1, c1);\n k1 = _x64Rotl(k1, 31);\n k1 = _x64Multiply(k1, c2);\n h1 = _x64Xor(h1, k1);\n }\n\n h1 = _x64Xor(h1, [0, bytes.length]);\n h2 = _x64Xor(h2, [0, bytes.length]);\n\n h1 = _x64Add(h1, h2);\n h2 = _x64Add(h2, h1);\n\n h1 = _x64Fmix(h1);\n h2 = _x64Fmix(h2);\n\n h1 = _x64Add(h1, h2);\n h2 = _x64Add(h2, h1);\n\n return (\"00000000\" + (h1[0] >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h1[1] >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h2[0] >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h2[1] >>> 0).toString(16)).slice(-8);\n };\n\n // INITIALIZATION\n // --------------\n\n // Export murmurHash3 for CommonJS, either as an AMD module or just as part\n // of the global object.\n if (typeof exports !== 'undefined') {\n\n if (typeof module !== 'undefined' && module.exports) {\n exports = module.exports = library;\n }\n\n exports.murmurHash3 = library;\n\n } else if (typeof define === 'function' && define.amd) {\n\n define([], function () {\n return library;\n });\n } else {\n\n // Use murmurHash3.noConflict to restore `murmurHash3` back to its\n // original value. Returns a reference to the library object, to allow\n // it to be used under a different name.\n library._murmurHash3 = root.murmurHash3;\n\n library.noConflict = function () {\n root.murmurHash3 = library._murmurHash3;\n library._murmurHash3 = undefined;\n library.noConflict = undefined;\n\n return library;\n };\n\n root.murmurHash3 = library;\n }\n})(this);\n","'use strict';\nconst retry = require('retry');\n\nconst networkErrorMsgs = [\n\t'Failed to fetch', // Chrome\n\t'NetworkError when attempting to fetch resource.', // Firefox\n\t'The Internet connection appears to be offline.', // Safari\n\t'Network request failed' // `cross-fetch`\n];\n\nclass AbortError extends Error {\n\tconstructor(message) {\n\t\tsuper();\n\n\t\tif (message instanceof Error) {\n\t\t\tthis.originalError = message;\n\t\t\t({message} = message);\n\t\t} else {\n\t\t\tthis.originalError = new Error(message);\n\t\t\tthis.originalError.stack = this.stack;\n\t\t}\n\n\t\tthis.name = 'AbortError';\n\t\tthis.message = message;\n\t}\n}\n\nconst decorateErrorWithCounts = (error, attemptNumber, options) => {\n\t// Minus 1 from attemptNumber because the first attempt does not count as a retry\n\tconst retriesLeft = options.retries - (attemptNumber - 1);\n\n\terror.attemptNumber = attemptNumber;\n\terror.retriesLeft = retriesLeft;\n\treturn error;\n};\n\nconst isNetworkError = errorMessage => networkErrorMsgs.includes(errorMessage);\n\nconst pRetry = (input, options) => new Promise((resolve, reject) => {\n\toptions = {\n\t\tonFailedAttempt: () => {},\n\t\tretries: 10,\n\t\t...options\n\t};\n\n\tconst operation = retry.operation(options);\n\n\toperation.attempt(async attemptNumber => {\n\t\ttry {\n\t\t\tresolve(await input(attemptNumber));\n\t\t} catch (error) {\n\t\t\tif (!(error instanceof Error)) {\n\t\t\t\treject(new TypeError(`Non-error was thrown: \"${error}\". You should only throw errors.`));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (error instanceof AbortError) {\n\t\t\t\toperation.stop();\n\t\t\t\treject(error.originalError);\n\t\t\t} else if (error instanceof TypeError && !isNetworkError(error.message)) {\n\t\t\t\toperation.stop();\n\t\t\t\treject(error);\n\t\t\t} else {\n\t\t\t\tdecorateErrorWithCounts(error, attemptNumber, options);\n\n\t\t\t\ttry {\n\t\t\t\t\tawait options.onFailedAttempt(error);\n\t\t\t\t} catch (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (!operation.retry(error)) {\n\t\t\t\t\treject(operation.mainError());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n});\n\nmodule.exports = pRetry;\n// TODO: remove this in the next major version\nmodule.exports.default = pRetry;\n\nmodule.exports.AbortError = AbortError;\n","// minimal library entry point.\n\n\"use strict\";\nmodule.exports = require(\"./src/index-minimal\");\n","\"use strict\";\nvar protobuf = exports;\n\n/**\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\n * @name build\n * @type {string}\n * @const\n */\nprotobuf.build = \"minimal\";\n\n// Serialization\nprotobuf.Writer = require(\"./writer\");\nprotobuf.BufferWriter = require(\"./writer_buffer\");\nprotobuf.Reader = require(\"./reader\");\nprotobuf.BufferReader = require(\"./reader_buffer\");\n\n// Utility\nprotobuf.util = require(\"./util/minimal\");\nprotobuf.rpc = require(\"./rpc\");\nprotobuf.roots = require(\"./roots\");\nprotobuf.configure = configure;\n\n/* istanbul ignore next */\n/**\n * Reconfigures the library according to the environment.\n * @returns {undefined}\n */\nfunction configure() {\n protobuf.util._configure();\n protobuf.Writer._configure(protobuf.BufferWriter);\n protobuf.Reader._configure(protobuf.BufferReader);\n}\n\n// Set up buffer utility according to the environment\nconfigure();\n","\"use strict\";\nmodule.exports = Reader;\n\nvar util = require(\"./util/minimal\");\n\nvar BufferReader; // cyclic\n\nvar LongBits = util.LongBits,\n utf8 = util.utf8;\n\n/* istanbul ignore next */\nfunction indexOutOfRange(reader, writeLength) {\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\n}\n\n/**\n * Constructs a new reader instance using the specified buffer.\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n * @param {Uint8Array} buffer Buffer to read from\n */\nfunction Reader(buffer) {\n\n /**\n * Read buffer.\n * @type {Uint8Array}\n */\n this.buf = buffer;\n\n /**\n * Read buffer position.\n * @type {number}\n */\n this.pos = 0;\n\n /**\n * Read buffer length.\n * @type {number}\n */\n this.len = buffer.length;\n}\n\nvar create_array = typeof Uint8Array !== \"undefined\"\n ? function create_typed_array(buffer) {\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n }\n /* istanbul ignore next */\n : function create_array(buffer) {\n if (Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n };\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup(buffer) {\n return (Reader.create = function create_buffer(buffer) {\n return util.Buffer.isBuffer(buffer)\n ? new BufferReader(buffer)\n /* istanbul ignore next */\n : create_array(buffer);\n })(buffer);\n }\n /* istanbul ignore next */\n : create_array;\n};\n\n/**\n * Creates a new reader using the specified buffer.\n * @function\n * @param {Uint8Array|Buffer} buffer Buffer to read from\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\n * @throws {Error} If `buffer` is not a valid buffer\n */\nReader.create = create();\n\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\n\n/**\n * Reads a varint as an unsigned 32 bit value.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.uint32 = (function read_uint32_setup() {\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\n return function read_uint32() {\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\n\n /* istanbul ignore if */\n if ((this.pos += 5) > this.len) {\n this.pos = this.len;\n throw indexOutOfRange(this, 10);\n }\n return value;\n };\n})();\n\n/**\n * Reads a varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.int32 = function read_int32() {\n return this.uint32() | 0;\n};\n\n/**\n * Reads a zig-zag encoded varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.sint32 = function read_sint32() {\n var value = this.uint32();\n return value >>> 1 ^ -(value & 1) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readLongVarint() {\n // tends to deopt with local vars for octet etc.\n var bits = new LongBits(0, 0);\n var i = 0;\n if (this.len - this.pos > 4) { // fast route (lo)\n for (; i < 4; ++i) {\n // 1st..4th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 5th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n i = 0;\n } else {\n for (; i < 3; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 1st..3th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 4th\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\n return bits;\n }\n if (this.len - this.pos > 4) { // fast route (hi)\n for (; i < 5; ++i) {\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n } else {\n for (; i < 5; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n }\n /* istanbul ignore next */\n throw Error(\"invalid varint encoding\");\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads a varint as a signed 64 bit value.\n * @name Reader#int64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as an unsigned 64 bit value.\n * @name Reader#uint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a zig-zag encoded varint as a signed 64 bit value.\n * @name Reader#sint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as a boolean.\n * @returns {boolean} Value read\n */\nReader.prototype.bool = function read_bool() {\n return this.uint32() !== 0;\n};\n\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\n return (buf[end - 4]\n | buf[end - 3] << 8\n | buf[end - 2] << 16\n | buf[end - 1] << 24) >>> 0;\n}\n\n/**\n * Reads fixed 32 bits as an unsigned 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.fixed32 = function read_fixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4);\n};\n\n/**\n * Reads fixed 32 bits as a signed 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.sfixed32 = function read_sfixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readFixed64(/* this: Reader */) {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 8);\n\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads fixed 64 bits.\n * @name Reader#fixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads zig-zag encoded fixed 64 bits.\n * @name Reader#sfixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a float (32 bit) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.float = function read_float() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readFloatLE(this.buf, this.pos);\n this.pos += 4;\n return value;\n};\n\n/**\n * Reads a double (64 bit float) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.double = function read_double() {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readDoubleLE(this.buf, this.pos);\n this.pos += 8;\n return value;\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @returns {Uint8Array} Value read\n */\nReader.prototype.bytes = function read_bytes() {\n var length = this.uint32(),\n start = this.pos,\n end = this.pos + length;\n\n /* istanbul ignore if */\n if (end > this.len)\n throw indexOutOfRange(this, length);\n\n this.pos += length;\n if (Array.isArray(this.buf)) // plain array\n return this.buf.slice(start, end);\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\n ? new this.buf.constructor(0)\n : this._slice.call(this.buf, start, end);\n};\n\n/**\n * Reads a string preceeded by its byte length as a varint.\n * @returns {string} Value read\n */\nReader.prototype.string = function read_string() {\n var bytes = this.bytes();\n return utf8.read(bytes, 0, bytes.length);\n};\n\n/**\n * Skips the specified number of bytes if specified, otherwise skips a varint.\n * @param {number} [length] Length if known, otherwise a varint is assumed\n * @returns {Reader} `this`\n */\nReader.prototype.skip = function skip(length) {\n if (typeof length === \"number\") {\n /* istanbul ignore if */\n if (this.pos + length > this.len)\n throw indexOutOfRange(this, length);\n this.pos += length;\n } else {\n do {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n } while (this.buf[this.pos++] & 128);\n }\n return this;\n};\n\n/**\n * Skips the next element of the specified wire type.\n * @param {number} wireType Wire type received\n * @returns {Reader} `this`\n */\nReader.prototype.skipType = function(wireType) {\n switch (wireType) {\n case 0:\n this.skip();\n break;\n case 1:\n this.skip(8);\n break;\n case 2:\n this.skip(this.uint32());\n break;\n case 3:\n while ((wireType = this.uint32() & 7) !== 4) {\n this.skipType(wireType);\n }\n break;\n case 5:\n this.skip(4);\n break;\n\n /* istanbul ignore next */\n default:\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n }\n return this;\n};\n\nReader._configure = function(BufferReader_) {\n BufferReader = BufferReader_;\n Reader.create = create();\n BufferReader._configure();\n\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\n util.merge(Reader.prototype, {\n\n int64: function read_int64() {\n return readLongVarint.call(this)[fn](false);\n },\n\n uint64: function read_uint64() {\n return readLongVarint.call(this)[fn](true);\n },\n\n sint64: function read_sint64() {\n return readLongVarint.call(this).zzDecode()[fn](false);\n },\n\n fixed64: function read_fixed64() {\n return readFixed64.call(this)[fn](true);\n },\n\n sfixed64: function read_sfixed64() {\n return readFixed64.call(this)[fn](false);\n }\n\n });\n};\n","\"use strict\";\nmodule.exports = BufferReader;\n\n// extends Reader\nvar Reader = require(\"./reader\");\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\n\nvar util = require(\"./util/minimal\");\n\n/**\n * Constructs a new buffer reader instance.\n * @classdesc Wire format reader using node buffers.\n * @extends Reader\n * @constructor\n * @param {Buffer} buffer Buffer to read from\n */\nfunction BufferReader(buffer) {\n Reader.call(this, buffer);\n\n /**\n * Read buffer.\n * @name BufferReader#buf\n * @type {Buffer}\n */\n}\n\nBufferReader._configure = function () {\n /* istanbul ignore else */\n if (util.Buffer)\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\n};\n\n\n/**\n * @override\n */\nBufferReader.prototype.string = function read_string_buffer() {\n var len = this.uint32(); // modifies pos\n return this.buf.utf8Slice\n ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len))\n : this.buf.toString(\"utf-8\", this.pos, this.pos = Math.min(this.pos + len, this.len));\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @name BufferReader#bytes\n * @function\n * @returns {Buffer} Value read\n */\n\nBufferReader._configure();\n","\"use strict\";\nmodule.exports = {};\n\n/**\n * Named roots.\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\n * Can also be used manually to make roots available accross modules.\n * @name roots\n * @type {Object.}\n * @example\n * // pbjs -r myroot -o compiled.js ...\n *\n * // in another module:\n * require(\"./compiled.js\");\n *\n * // in any subsequent module:\n * var root = protobuf.roots[\"myroot\"];\n */\n","\"use strict\";\n\n/**\n * Streaming RPC helpers.\n * @namespace\n */\nvar rpc = exports;\n\n/**\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\n * @typedef RPCImpl\n * @type {function}\n * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called\n * @param {Uint8Array} requestData Request data\n * @param {RPCImplCallback} callback Callback function\n * @returns {undefined}\n * @example\n * function rpcImpl(method, requestData, callback) {\n * if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\n * throw Error(\"no such method\");\n * asynchronouslyObtainAResponse(requestData, function(err, responseData) {\n * callback(err, responseData);\n * });\n * }\n */\n\n/**\n * Node-style callback as used by {@link RPCImpl}.\n * @typedef RPCImplCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\n * @returns {undefined}\n */\n\nrpc.Service = require(\"./rpc/service\");\n","\"use strict\";\nmodule.exports = Service;\n\nvar util = require(\"../util/minimal\");\n\n// Extends EventEmitter\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\n\n/**\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\n *\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\n * @typedef rpc.ServiceMethodCallback\n * @template TRes extends Message\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {TRes} [response] Response message\n * @returns {undefined}\n */\n\n/**\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\n * @typedef rpc.ServiceMethod\n * @template TReq extends Message\n * @template TRes extends Message\n * @type {function}\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message\n * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined`\n */\n\n/**\n * Constructs a new RPC service instance.\n * @classdesc An RPC service as returned by {@link Service#create}.\n * @exports rpc.Service\n * @extends util.EventEmitter\n * @constructor\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\n\n if (typeof rpcImpl !== \"function\")\n throw TypeError(\"rpcImpl must be a function\");\n\n util.EventEmitter.call(this);\n\n /**\n * RPC implementation. Becomes `null` once the service is ended.\n * @type {RPCImpl|null}\n */\n this.rpcImpl = rpcImpl;\n\n /**\n * Whether requests are length-delimited.\n * @type {boolean}\n */\n this.requestDelimited = Boolean(requestDelimited);\n\n /**\n * Whether responses are length-delimited.\n * @type {boolean}\n */\n this.responseDelimited = Boolean(responseDelimited);\n}\n\n/**\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\n * @param {Method|rpc.ServiceMethod} method Reflected or static method\n * @param {Constructor} requestCtor Request constructor\n * @param {Constructor} responseCtor Response constructor\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} callback Service callback\n * @returns {undefined}\n * @template TReq extends Message\n * @template TRes extends Message\n */\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\n\n if (!request)\n throw TypeError(\"request must be specified\");\n\n var self = this;\n if (!callback)\n return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\n\n if (!self.rpcImpl) {\n setTimeout(function() { callback(Error(\"already ended\")); }, 0);\n return undefined;\n }\n\n try {\n return self.rpcImpl(\n method,\n requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\n function rpcCallback(err, response) {\n\n if (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n\n if (response === null) {\n self.end(/* endedByRPC */ true);\n return undefined;\n }\n\n if (!(response instanceof responseCtor)) {\n try {\n response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\n } catch (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n }\n\n self.emit(\"data\", response, method);\n return callback(null, response);\n }\n );\n } catch (err) {\n self.emit(\"error\", err, method);\n setTimeout(function() { callback(err); }, 0);\n return undefined;\n }\n};\n\n/**\n * Ends this service and emits the `end` event.\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\n * @returns {rpc.Service} `this`\n */\nService.prototype.end = function end(endedByRPC) {\n if (this.rpcImpl) {\n if (!endedByRPC) // signal end to rpcImpl\n this.rpcImpl(null, null, null);\n this.rpcImpl = null;\n this.emit(\"end\").off();\n }\n return this;\n};\n","\"use strict\";\nmodule.exports = LongBits;\n\nvar util = require(\"../util/minimal\");\n\n/**\n * Constructs new long bits.\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\n * @memberof util\n * @constructor\n * @param {number} lo Low 32 bits, unsigned\n * @param {number} hi High 32 bits, unsigned\n */\nfunction LongBits(lo, hi) {\n\n // note that the casts below are theoretically unnecessary as of today, but older statically\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\n\n /**\n * Low bits.\n * @type {number}\n */\n this.lo = lo >>> 0;\n\n /**\n * High bits.\n * @type {number}\n */\n this.hi = hi >>> 0;\n}\n\n/**\n * Zero bits.\n * @memberof util.LongBits\n * @type {util.LongBits}\n */\nvar zero = LongBits.zero = new LongBits(0, 0);\n\nzero.toNumber = function() { return 0; };\nzero.zzEncode = zero.zzDecode = function() { return this; };\nzero.length = function() { return 1; };\n\n/**\n * Zero hash.\n * @memberof util.LongBits\n * @type {string}\n */\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\n\n/**\n * Constructs new long bits from the specified number.\n * @param {number} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.fromNumber = function fromNumber(value) {\n if (value === 0)\n return zero;\n var sign = value < 0;\n if (sign)\n value = -value;\n var lo = value >>> 0,\n hi = (value - lo) / 4294967296 >>> 0;\n if (sign) {\n hi = ~hi >>> 0;\n lo = ~lo >>> 0;\n if (++lo > 4294967295) {\n lo = 0;\n if (++hi > 4294967295)\n hi = 0;\n }\n }\n return new LongBits(lo, hi);\n};\n\n/**\n * Constructs new long bits from a number, long or string.\n * @param {Long|number|string} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.from = function from(value) {\n if (typeof value === \"number\")\n return LongBits.fromNumber(value);\n if (util.isString(value)) {\n /* istanbul ignore else */\n if (util.Long)\n value = util.Long.fromString(value);\n else\n return LongBits.fromNumber(parseInt(value, 10));\n }\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\n};\n\n/**\n * Converts this long bits to a possibly unsafe JavaScript number.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {number} Possibly unsafe number\n */\nLongBits.prototype.toNumber = function toNumber(unsigned) {\n if (!unsigned && this.hi >>> 31) {\n var lo = ~this.lo + 1 >>> 0,\n hi = ~this.hi >>> 0;\n if (!lo)\n hi = hi + 1 >>> 0;\n return -(lo + hi * 4294967296);\n }\n return this.lo + this.hi * 4294967296;\n};\n\n/**\n * Converts this long bits to a long.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long} Long\n */\nLongBits.prototype.toLong = function toLong(unsigned) {\n return util.Long\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\n /* istanbul ignore next */\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\n};\n\nvar charCodeAt = String.prototype.charCodeAt;\n\n/**\n * Constructs new long bits from the specified 8 characters long hash.\n * @param {string} hash Hash\n * @returns {util.LongBits} Bits\n */\nLongBits.fromHash = function fromHash(hash) {\n if (hash === zeroHash)\n return zero;\n return new LongBits(\n ( charCodeAt.call(hash, 0)\n | charCodeAt.call(hash, 1) << 8\n | charCodeAt.call(hash, 2) << 16\n | charCodeAt.call(hash, 3) << 24) >>> 0\n ,\n ( charCodeAt.call(hash, 4)\n | charCodeAt.call(hash, 5) << 8\n | charCodeAt.call(hash, 6) << 16\n | charCodeAt.call(hash, 7) << 24) >>> 0\n );\n};\n\n/**\n * Converts this long bits to a 8 characters long hash.\n * @returns {string} Hash\n */\nLongBits.prototype.toHash = function toHash() {\n return String.fromCharCode(\n this.lo & 255,\n this.lo >>> 8 & 255,\n this.lo >>> 16 & 255,\n this.lo >>> 24 ,\n this.hi & 255,\n this.hi >>> 8 & 255,\n this.hi >>> 16 & 255,\n this.hi >>> 24\n );\n};\n\n/**\n * Zig-zag encodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzEncode = function zzEncode() {\n var mask = this.hi >> 31;\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Zig-zag decodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzDecode = function zzDecode() {\n var mask = -(this.lo & 1);\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Calculates the length of this longbits when encoded as a varint.\n * @returns {number} Length\n */\nLongBits.prototype.length = function length() {\n var part0 = this.lo,\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\n part2 = this.hi >>> 24;\n return part2 === 0\n ? part1 === 0\n ? part0 < 16384\n ? part0 < 128 ? 1 : 2\n : part0 < 2097152 ? 3 : 4\n : part1 < 16384\n ? part1 < 128 ? 5 : 6\n : part1 < 2097152 ? 7 : 8\n : part2 < 128 ? 9 : 10;\n};\n","\"use strict\";\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = require(\"@protobufjs/aspromise\");\n\n// converts to / from base64 encoded strings\nutil.base64 = require(\"@protobufjs/base64\");\n\n// base class of rpc.Service\nutil.EventEmitter = require(\"@protobufjs/eventemitter\");\n\n// float handling accross browsers\nutil.float = require(\"@protobufjs/float\");\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = require(\"@protobufjs/inquire\");\n\n// converts to / from utf8 encoded strings\nutil.utf8 = require(\"@protobufjs/utf8\");\n\n// provides a node-like buffer pool in the browser\nutil.pool = require(\"@protobufjs/pool\");\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = require(\"./longbits\");\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n */\nutil.isNode = Boolean(typeof global !== \"undefined\"\n && global\n && global.process\n && global.process.versions\n && global.process.versions.node);\n\n/**\n * Global object reference.\n * @memberof util\n * @type {Object}\n */\nutil.global = util.isNode && global\n || typeof window !== \"undefined\" && window\n || typeof self !== \"undefined\" && self\n || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n var value = obj[prop];\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor}\n */\nutil.Buffer = (function() {\n try {\n var Buffer = util.inquire(\"buffer\").Buffer;\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n } catch (e) {\n /* istanbul ignore next */\n return null;\n }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n /* istanbul ignore next */\n return typeof sizeOrArray === \"number\"\n ? util.Buffer\n ? util._Buffer_allocUnsafe(sizeOrArray)\n : new util.Array(sizeOrArray)\n : util.Buffer\n ? util._Buffer_from(sizeOrArray)\n : typeof Uint8Array === \"undefined\"\n ? sizeOrArray\n : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/**\n * Any compatible Long instance.\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\n * @interface Long\n * @property {number} low Low bits\n * @property {number} high High bits\n * @property {boolean} unsigned Whether unsigned or not\n */\n\n/**\n * Long.js's Long class if available.\n * @type {Constructor}\n */\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n || /* istanbul ignore next */ util.global.Long\n || util.inquire(\"long\");\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/**\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n return value\n ? util.LongBits.from(value).toHash()\n : util.LongBits.zeroHash;\n};\n\n/**\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n var bits = util.LongBits.fromHash(hash);\n if (util.Long)\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.} dst Destination object\n * @param {Object.} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n if (dst[keys[i]] === undefined || !ifNotSet)\n dst[keys[i]] = src[keys[i]];\n return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor} Custom error constructor\n */\nfunction newError(name) {\n\n function CustomError(message, properties) {\n\n if (!(this instanceof CustomError))\n return new CustomError(message, properties);\n\n // Error.call(this, message);\n // ^ just returns a new error instance because the ctor can be called as a function\n\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) // node\n Error.captureStackTrace(this, CustomError);\n else\n Object.defineProperty(this, \"stack\", { value: new Error().stack || \"\" });\n\n if (properties)\n merge(this, properties);\n }\n\n (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError;\n\n Object.defineProperty(CustomError.prototype, \"name\", { get: function() { return name; } });\n\n CustomError.prototype.toString = function toString() {\n return this.name + \": \" + this.message;\n };\n\n return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message\n * @constructor\n * @param {string} message Error message\n * @param {Object.} [properties] Additional properties\n * @example\n * try {\n * MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n * if (e instanceof ProtocolError && e.instance)\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n var fieldMap = {};\n for (var i = 0; i < fieldNames.length; ++i)\n fieldMap[fieldNames[i]] = 1;\n\n /**\n * @returns {string|undefined} Set field name, if any\n * @this Object\n * @ignore\n */\n return function() { // eslint-disable-line consistent-return\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n return keys[i];\n };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n /**\n * @param {string} name Field name\n * @returns {undefined}\n * @this Object\n * @ignore\n */\n return function(name) {\n for (var i = 0; i < fieldNames.length; ++i)\n if (fieldNames[i] !== name)\n delete this[fieldNames[i]];\n };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n longs: String,\n enums: String,\n bytes: String,\n json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n var Buffer = util.Buffer;\n /* istanbul ignore if */\n if (!Buffer) {\n util._Buffer_from = util._Buffer_allocUnsafe = null;\n return;\n }\n // because node 4.x buffers are incompatible & immutable\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n /* istanbul ignore next */\n function Buffer_from(value, encoding) {\n return new Buffer(value, encoding);\n };\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n /* istanbul ignore next */\n function Buffer_allocUnsafe(size) {\n return new Buffer(size);\n };\n};\n","\"use strict\";\nmodule.exports = Writer;\n\nvar util = require(\"./util/minimal\");\n\nvar BufferWriter; // cyclic\n\nvar LongBits = util.LongBits,\n base64 = util.base64,\n utf8 = util.utf8;\n\n/**\n * Constructs a new writer operation instance.\n * @classdesc Scheduled writer operation.\n * @constructor\n * @param {function(*, Uint8Array, number)} fn Function to call\n * @param {number} len Value byte length\n * @param {*} val Value to write\n * @ignore\n */\nfunction Op(fn, len, val) {\n\n /**\n * Function to call.\n * @type {function(Uint8Array, number, *)}\n */\n this.fn = fn;\n\n /**\n * Value byte length.\n * @type {number}\n */\n this.len = len;\n\n /**\n * Next operation.\n * @type {Writer.Op|undefined}\n */\n this.next = undefined;\n\n /**\n * Value to write.\n * @type {*}\n */\n this.val = val; // type varies\n}\n\n/* istanbul ignore next */\nfunction noop() {} // eslint-disable-line no-empty-function\n\n/**\n * Constructs a new writer state instance.\n * @classdesc Copied writer state.\n * @memberof Writer\n * @constructor\n * @param {Writer} writer Writer to copy state from\n * @ignore\n */\nfunction State(writer) {\n\n /**\n * Current head.\n * @type {Writer.Op}\n */\n this.head = writer.head;\n\n /**\n * Current tail.\n * @type {Writer.Op}\n */\n this.tail = writer.tail;\n\n /**\n * Current buffer length.\n * @type {number}\n */\n this.len = writer.len;\n\n /**\n * Next state.\n * @type {State|null}\n */\n this.next = writer.states;\n}\n\n/**\n * Constructs a new writer instance.\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n */\nfunction Writer() {\n\n /**\n * Current length.\n * @type {number}\n */\n this.len = 0;\n\n /**\n * Operations head.\n * @type {Object}\n */\n this.head = new Op(noop, 0, 0);\n\n /**\n * Operations tail\n * @type {Object}\n */\n this.tail = this.head;\n\n /**\n * Linked forked states.\n * @type {Object|null}\n */\n this.states = null;\n\n // When a value is written, the writer calculates its byte length and puts it into a linked\n // list of operations to perform when finish() is called. This both allows us to allocate\n // buffers of the exact required size and reduces the amount of work we have to do compared\n // to first calculating over objects and then encoding over objects. In our case, the encoding\n // part is just a linked list walk calling operations with already prepared values.\n}\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup() {\n return (Writer.create = function create_buffer() {\n return new BufferWriter();\n })();\n }\n /* istanbul ignore next */\n : function create_array() {\n return new Writer();\n };\n};\n\n/**\n * Creates a new writer.\n * @function\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\n */\nWriter.create = create();\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\nWriter.alloc = function alloc(size) {\n return new util.Array(size);\n};\n\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\n/* istanbul ignore else */\nif (util.Array !== Array)\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\n\n/**\n * Pushes a new operation to the queue.\n * @param {function(Uint8Array, number, *)} fn Function to call\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @returns {Writer} `this`\n * @private\n */\nWriter.prototype._push = function push(fn, len, val) {\n this.tail = this.tail.next = new Op(fn, len, val);\n this.len += len;\n return this;\n};\n\nfunction writeByte(val, buf, pos) {\n buf[pos] = val & 255;\n}\n\nfunction writeVarint32(val, buf, pos) {\n while (val > 127) {\n buf[pos++] = val & 127 | 128;\n val >>>= 7;\n }\n buf[pos] = val;\n}\n\n/**\n * Constructs a new varint writer operation instance.\n * @classdesc Scheduled varint writer operation.\n * @extends Op\n * @constructor\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @ignore\n */\nfunction VarintOp(len, val) {\n this.len = len;\n this.next = undefined;\n this.val = val;\n}\n\nVarintOp.prototype = Object.create(Op.prototype);\nVarintOp.prototype.fn = writeVarint32;\n\n/**\n * Writes an unsigned 32 bit value as a varint.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.uint32 = function write_uint32(value) {\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\n // uint32 is by far the most frequently used operation and benefits significantly from this.\n this.len += (this.tail = this.tail.next = new VarintOp(\n (value = value >>> 0)\n < 128 ? 1\n : value < 16384 ? 2\n : value < 2097152 ? 3\n : value < 268435456 ? 4\n : 5,\n value)).len;\n return this;\n};\n\n/**\n * Writes a signed 32 bit value as a varint.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.int32 = function write_int32(value) {\n return value < 0\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\n : this.uint32(value);\n};\n\n/**\n * Writes a 32 bit value as a varint, zig-zag encoded.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sint32 = function write_sint32(value) {\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\n};\n\nfunction writeVarint64(val, buf, pos) {\n while (val.hi) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\n val.hi >>>= 7;\n }\n while (val.lo > 127) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = val.lo >>> 7;\n }\n buf[pos++] = val.lo;\n}\n\n/**\n * Writes an unsigned 64 bit value as a varint.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.uint64 = function write_uint64(value) {\n var bits = LongBits.from(value);\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a signed 64 bit value as a varint.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.int64 = Writer.prototype.uint64;\n\n/**\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sint64 = function write_sint64(value) {\n var bits = LongBits.from(value).zzEncode();\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a boolish value as a varint.\n * @param {boolean} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bool = function write_bool(value) {\n return this._push(writeByte, 1, value ? 1 : 0);\n};\n\nfunction writeFixed32(val, buf, pos) {\n buf[pos ] = val & 255;\n buf[pos + 1] = val >>> 8 & 255;\n buf[pos + 2] = val >>> 16 & 255;\n buf[pos + 3] = val >>> 24;\n}\n\n/**\n * Writes an unsigned 32 bit value as fixed 32 bits.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.fixed32 = function write_fixed32(value) {\n return this._push(writeFixed32, 4, value >>> 0);\n};\n\n/**\n * Writes a signed 32 bit value as fixed 32 bits.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\n\n/**\n * Writes an unsigned 64 bit value as fixed 64 bits.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.fixed64 = function write_fixed64(value) {\n var bits = LongBits.from(value);\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\n};\n\n/**\n * Writes a signed 64 bit value as fixed 64 bits.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\n\n/**\n * Writes a float (32 bit).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.float = function write_float(value) {\n return this._push(util.float.writeFloatLE, 4, value);\n};\n\n/**\n * Writes a double (64 bit float).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.double = function write_double(value) {\n return this._push(util.float.writeDoubleLE, 8, value);\n};\n\nvar writeBytes = util.Array.prototype.set\n ? function writeBytes_set(val, buf, pos) {\n buf.set(val, pos); // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytes_for(val, buf, pos) {\n for (var i = 0; i < val.length; ++i)\n buf[pos + i] = val[i];\n };\n\n/**\n * Writes a sequence of bytes.\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bytes = function write_bytes(value) {\n var len = value.length >>> 0;\n if (!len)\n return this._push(writeByte, 1, 0);\n if (util.isString(value)) {\n var buf = Writer.alloc(len = base64.length(value));\n base64.decode(value, buf, 0);\n value = buf;\n }\n return this.uint32(len)._push(writeBytes, len, value);\n};\n\n/**\n * Writes a string.\n * @param {string} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.string = function write_string(value) {\n var len = utf8.length(value);\n return len\n ? this.uint32(len)._push(utf8.write, len, value)\n : this._push(writeByte, 1, 0);\n};\n\n/**\n * Forks this writer's state by pushing it to a stack.\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\n * @returns {Writer} `this`\n */\nWriter.prototype.fork = function fork() {\n this.states = new State(this);\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n return this;\n};\n\n/**\n * Resets this instance to the last state.\n * @returns {Writer} `this`\n */\nWriter.prototype.reset = function reset() {\n if (this.states) {\n this.head = this.states.head;\n this.tail = this.states.tail;\n this.len = this.states.len;\n this.states = this.states.next;\n } else {\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n }\n return this;\n};\n\n/**\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\n * @returns {Writer} `this`\n */\nWriter.prototype.ldelim = function ldelim() {\n var head = this.head,\n tail = this.tail,\n len = this.len;\n this.reset().uint32(len);\n if (len) {\n this.tail.next = head.next; // skip noop\n this.tail = tail;\n this.len += len;\n }\n return this;\n};\n\n/**\n * Finishes the write operation.\n * @returns {Uint8Array} Finished buffer\n */\nWriter.prototype.finish = function finish() {\n var head = this.head.next, // skip noop\n buf = this.constructor.alloc(this.len),\n pos = 0;\n while (head) {\n head.fn(head.val, buf, pos);\n pos += head.len;\n head = head.next;\n }\n // this.head = this.tail = null;\n return buf;\n};\n\nWriter._configure = function(BufferWriter_) {\n BufferWriter = BufferWriter_;\n Writer.create = create();\n BufferWriter._configure();\n};\n","\"use strict\";\nmodule.exports = BufferWriter;\n\n// extends Writer\nvar Writer = require(\"./writer\");\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\n\nvar util = require(\"./util/minimal\");\n\n/**\n * Constructs a new buffer writer instance.\n * @classdesc Wire format writer using node buffers.\n * @extends Writer\n * @constructor\n */\nfunction BufferWriter() {\n Writer.call(this);\n}\n\nBufferWriter._configure = function () {\n /**\n * Allocates a buffer of the specified size.\n * @function\n * @param {number} size Buffer size\n * @returns {Buffer} Buffer\n */\n BufferWriter.alloc = util._Buffer_allocUnsafe;\n\n BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === \"set\"\n ? function writeBytesBuffer_set(val, buf, pos) {\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\n // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytesBuffer_copy(val, buf, pos) {\n if (val.copy) // Buffer values\n val.copy(buf, pos, 0, val.length);\n else for (var i = 0; i < val.length;) // plain array values\n buf[pos++] = val[i++];\n };\n};\n\n\n/**\n * @override\n */\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\n if (util.isString(value))\n value = util._Buffer_from(value, \"base64\");\n var len = value.length >>> 0;\n this.uint32(len);\n if (len)\n this._push(BufferWriter.writeBytesBuffer, len, value);\n return this;\n};\n\nfunction writeStringBuffer(val, buf, pos) {\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\n util.utf8.write(val, buf, pos);\n else if (buf.utf8Write)\n buf.utf8Write(val, pos);\n else\n buf.write(val, pos);\n}\n\n/**\n * @override\n */\nBufferWriter.prototype.string = function write_string_buffer(value) {\n var len = util.Buffer.byteLength(value);\n this.uint32(len);\n if (len)\n this._push(writeStringBuffer, len, value);\n return this;\n};\n\n\n/**\n * Finishes the write operation.\n * @name BufferWriter#finish\n * @function\n * @returns {Buffer} Finished buffer\n */\n\nBufferWriter._configure();\n",null,"const Rabin = require('./rabin')\nconst getRabin = require('../dist/rabin-wasm.node.js')\n\nconst create = async (avg, min, max, windowSize, polynomial) => {\n const compiled = await getRabin()\n return new Rabin(compiled, avg, min, max, windowSize, polynomial)\n}\n\nmodule.exports = {\n Rabin,\n create\n}\n","/**\n * Rabin fingerprinting\n *\n * @class Rabin\n */\nclass Rabin {\n /**\n * Creates an instance of Rabin.\n * @param { import(\"./../dist/rabin-wasm\") } asModule\n * @param {number} [bits=12]\n * @param {number} [min=8 * 1024]\n * @param {number} [max=32 * 1024]\n * @param {number} polynomial\n * @memberof Rabin\n */\n constructor(asModule, bits = 12, min = 8 * 1024, max = 32 * 1024, windowSize = 64, polynomial) {\n this.bits = bits\n this.min = min\n this.max = max\n this.asModule = asModule\n this.rabin = new asModule.Rabin(bits, min, max, windowSize, polynomial)\n this.polynomial = polynomial\n }\n\n /**\n * Fingerprints the buffer\n *\n * @param {Uint8Array} buf\n * @returns {Array}\n * @memberof Rabin\n */\n fingerprint(buf) {\n const {\n __retain,\n __release,\n __allocArray,\n __getInt32Array,\n Int32Array_ID,\n Uint8Array_ID\n } = this.asModule\n\n const lengths = new Int32Array(Math.ceil(buf.length/this.min))\n const lengthsPtr = __retain(__allocArray(Int32Array_ID, lengths))\n const pointer = __retain(__allocArray(Uint8Array_ID, buf))\n\n const out = this.rabin.fingerprint(pointer, lengthsPtr)\n const processed = __getInt32Array(out)\n\n __release(pointer)\n __release(lengthsPtr)\n\n const end = processed.indexOf(0);\n return end >= 0 ? processed.subarray(0, end) : processed;\n }\n}\n\nmodule.exports = Rabin","module.exports = require('./lib/retry');","var RetryOperation = require('./retry_operation');\n\nexports.operation = function(options) {\n var timeouts = exports.timeouts(options);\n return new RetryOperation(timeouts, {\n forever: options && (options.forever || options.retries === Infinity),\n unref: options && options.unref,\n maxRetryTime: options && options.maxRetryTime\n });\n};\n\nexports.timeouts = function(options) {\n if (options instanceof Array) {\n return [].concat(options);\n }\n\n var opts = {\n retries: 10,\n factor: 2,\n minTimeout: 1 * 1000,\n maxTimeout: Infinity,\n randomize: false\n };\n for (var key in options) {\n opts[key] = options[key];\n }\n\n if (opts.minTimeout > opts.maxTimeout) {\n throw new Error('minTimeout is greater than maxTimeout');\n }\n\n var timeouts = [];\n for (var i = 0; i < opts.retries; i++) {\n timeouts.push(this.createTimeout(i, opts));\n }\n\n if (options && options.forever && !timeouts.length) {\n timeouts.push(this.createTimeout(i, opts));\n }\n\n // sort the array numerically ascending\n timeouts.sort(function(a,b) {\n return a - b;\n });\n\n return timeouts;\n};\n\nexports.createTimeout = function(attempt, opts) {\n var random = (opts.randomize)\n ? (Math.random() + 1)\n : 1;\n\n var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));\n timeout = Math.min(timeout, opts.maxTimeout);\n\n return timeout;\n};\n\nexports.wrap = function(obj, options, methods) {\n if (options instanceof Array) {\n methods = options;\n options = null;\n }\n\n if (!methods) {\n methods = [];\n for (var key in obj) {\n if (typeof obj[key] === 'function') {\n methods.push(key);\n }\n }\n }\n\n for (var i = 0; i < methods.length; i++) {\n var method = methods[i];\n var original = obj[method];\n\n obj[method] = function retryWrapper(original) {\n var op = exports.operation(options);\n var args = Array.prototype.slice.call(arguments, 1);\n var callback = args.pop();\n\n args.push(function(err) {\n if (op.retry(err)) {\n return;\n }\n if (err) {\n arguments[0] = op.mainError();\n }\n callback.apply(this, arguments);\n });\n\n op.attempt(function() {\n original.apply(obj, args);\n });\n }.bind(obj, original);\n obj[method].options = options;\n }\n};\n","function RetryOperation(timeouts, options) {\n // Compatibility for the old (timeouts, retryForever) signature\n if (typeof options === 'boolean') {\n options = { forever: options };\n }\n\n this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));\n this._timeouts = timeouts;\n this._options = options || {};\n this._maxRetryTime = options && options.maxRetryTime || Infinity;\n this._fn = null;\n this._errors = [];\n this._attempts = 1;\n this._operationTimeout = null;\n this._operationTimeoutCb = null;\n this._timeout = null;\n this._operationStart = null;\n this._timer = null;\n\n if (this._options.forever) {\n this._cachedTimeouts = this._timeouts.slice(0);\n }\n}\nmodule.exports = RetryOperation;\n\nRetryOperation.prototype.reset = function() {\n this._attempts = 1;\n this._timeouts = this._originalTimeouts.slice(0);\n}\n\nRetryOperation.prototype.stop = function() {\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n if (this._timer) {\n clearTimeout(this._timer);\n }\n\n this._timeouts = [];\n this._cachedTimeouts = null;\n};\n\nRetryOperation.prototype.retry = function(err) {\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n\n if (!err) {\n return false;\n }\n var currentTime = new Date().getTime();\n if (err && currentTime - this._operationStart >= this._maxRetryTime) {\n this._errors.push(err);\n this._errors.unshift(new Error('RetryOperation timeout occurred'));\n return false;\n }\n\n this._errors.push(err);\n\n var timeout = this._timeouts.shift();\n if (timeout === undefined) {\n if (this._cachedTimeouts) {\n // retry forever, only keep last error\n this._errors.splice(0, this._errors.length - 1);\n timeout = this._cachedTimeouts.slice(-1);\n } else {\n return false;\n }\n }\n\n var self = this;\n this._timer = setTimeout(function() {\n self._attempts++;\n\n if (self._operationTimeoutCb) {\n self._timeout = setTimeout(function() {\n self._operationTimeoutCb(self._attempts);\n }, self._operationTimeout);\n\n if (self._options.unref) {\n self._timeout.unref();\n }\n }\n\n self._fn(self._attempts);\n }, timeout);\n\n if (this._options.unref) {\n this._timer.unref();\n }\n\n return true;\n};\n\nRetryOperation.prototype.attempt = function(fn, timeoutOps) {\n this._fn = fn;\n\n if (timeoutOps) {\n if (timeoutOps.timeout) {\n this._operationTimeout = timeoutOps.timeout;\n }\n if (timeoutOps.cb) {\n this._operationTimeoutCb = timeoutOps.cb;\n }\n }\n\n var self = this;\n if (this._operationTimeoutCb) {\n this._timeout = setTimeout(function() {\n self._operationTimeoutCb();\n }, self._operationTimeout);\n }\n\n this._operationStart = new Date().getTime();\n\n this._fn(this._attempts);\n};\n\nRetryOperation.prototype.try = function(fn) {\n console.log('Using RetryOperation.try() is deprecated');\n this.attempt(fn);\n};\n\nRetryOperation.prototype.start = function(fn) {\n console.log('Using RetryOperation.start() is deprecated');\n this.attempt(fn);\n};\n\nRetryOperation.prototype.start = RetryOperation.prototype.try;\n\nRetryOperation.prototype.errors = function() {\n return this._errors;\n};\n\nRetryOperation.prototype.attempts = function() {\n return this._attempts;\n};\n\nRetryOperation.prototype.mainError = function() {\n if (this._errors.length === 0) {\n return null;\n }\n\n var counts = {};\n var mainError = null;\n var mainErrorCount = 0;\n\n for (var i = 0; i < this._errors.length; i++) {\n var error = this._errors[i];\n var message = error.message;\n var count = (counts[message] || 0) + 1;\n\n counts[message] = count;\n\n if (count >= mainErrorCount) {\n mainError = error;\n mainErrorCount = count;\n }\n }\n\n return mainError;\n};\n","'use strict'\n\n// JS treats subjects of bitwise operators as SIGNED 32 bit numbers,\n// which means the maximum amount of bits we can store inside each byte\n// is 7..\nconst BITS_PER_BYTE = 7\n\nmodule.exports = class SparseArray {\n constructor () {\n this._bitArrays = []\n this._data = []\n this._length = 0\n this._changedLength = false\n this._changedData = false\n }\n\n set (index, value) {\n let pos = this._internalPositionFor(index, false)\n if (value === undefined) {\n // unsetting\n if (pos !== -1) {\n // remove item from bit array and array itself\n this._unsetInternalPos(pos)\n this._unsetBit(index)\n this._changedLength = true\n this._changedData = true\n }\n } else {\n let needsSort = false\n if (pos === -1) {\n pos = this._data.length\n this._setBit(index)\n this._changedData = true\n } else {\n needsSort = true\n }\n this._setInternalPos(pos, index, value, needsSort)\n this._changedLength = true\n }\n }\n\n unset (index) {\n this.set(index, undefined)\n }\n\n get (index) {\n this._sortData()\n const pos = this._internalPositionFor(index, true)\n if (pos === -1) {\n return undefined\n }\n return this._data[pos][1]\n }\n\n push (value) {\n this.set(this.length, value)\n return this.length\n }\n\n get length () {\n this._sortData()\n if (this._changedLength) {\n const last = this._data[this._data.length - 1]\n this._length = last ? last[0] + 1 : 0\n this._changedLength = false\n }\n return this._length\n }\n\n forEach (iterator) {\n let i = 0\n while(i < this.length) {\n iterator(this.get(i), i, this)\n i++\n }\n }\n\n map (iterator) {\n let i = 0\n let mapped = new Array(this.length)\n while(i < this.length) {\n mapped[i] = iterator(this.get(i), i, this)\n i++\n }\n return mapped\n }\n\n reduce (reducer, initialValue) {\n let i = 0\n let acc = initialValue\n while(i < this.length) {\n const value = this.get(i)\n acc = reducer(acc, value, i)\n i++\n }\n return acc\n }\n\n find (finder) {\n let i = 0, found, last\n while ((i < this.length) && !found) {\n last = this.get(i)\n found = finder(last)\n i++\n }\n return found ? last : undefined\n }\n\n _internalPositionFor (index, noCreate) {\n const bytePos = this._bytePosFor(index, noCreate)\n if (bytePos >= this._bitArrays.length) {\n return -1\n }\n const byte = this._bitArrays[bytePos]\n const bitPos = index - bytePos * BITS_PER_BYTE\n const exists = (byte & (1 << bitPos)) > 0\n if (!exists) {\n return -1\n }\n const previousPopCount = this._bitArrays.slice(0, bytePos).reduce(popCountReduce, 0)\n\n const mask = ~(0xffffffff << (bitPos + 1))\n const bytePopCount = popCount(byte & mask)\n const arrayPos = previousPopCount + bytePopCount - 1\n return arrayPos\n }\n\n _bytePosFor (index, noCreate) {\n const bytePos = Math.floor(index / BITS_PER_BYTE)\n const targetLength = bytePos + 1\n while (!noCreate && this._bitArrays.length < targetLength) {\n this._bitArrays.push(0)\n }\n return bytePos\n }\n\n _setBit (index) {\n const bytePos = this._bytePosFor(index, false)\n this._bitArrays[bytePos] |= (1 << (index - (bytePos * BITS_PER_BYTE)))\n }\n\n _unsetBit(index) {\n const bytePos = this._bytePosFor(index, false)\n this._bitArrays[bytePos] &= ~(1 << (index - (bytePos * BITS_PER_BYTE)))\n }\n\n _setInternalPos(pos, index, value, needsSort) {\n const data =this._data\n const elem = [index, value]\n if (needsSort) {\n this._sortData()\n data[pos] = elem\n } else {\n // new element. just shove it into the array\n // but be nice about where we shove it\n // in order to make sorting it later easier\n if (data.length) {\n if (data[data.length - 1][0] >= index) {\n data.push(elem)\n } else if (data[0][0] <= index) {\n data.unshift(elem)\n } else {\n const randomIndex = Math.round(data.length / 2)\n this._data = data.slice(0, randomIndex).concat(elem).concat(data.slice(randomIndex))\n }\n } else {\n this._data.push(elem)\n }\n this._changedData = true\n this._changedLength = true\n }\n }\n\n _unsetInternalPos (pos) {\n this._data.splice(pos, 1)\n }\n\n _sortData () {\n if (this._changedData) {\n this._data.sort(sortInternal)\n }\n\n this._changedData = false\n }\n\n bitField () {\n const bytes = []\n let pendingBitsForResultingByte = 8\n let pendingBitsForNewByte = 0\n let resultingByte = 0\n let newByte\n const pending = this._bitArrays.slice()\n while (pending.length || pendingBitsForNewByte) {\n if (pendingBitsForNewByte === 0) {\n newByte = pending.shift()\n pendingBitsForNewByte = 7\n }\n\n const usingBits = Math.min(pendingBitsForNewByte, pendingBitsForResultingByte)\n const mask = ~(0b11111111 << usingBits)\n const masked = newByte & mask\n resultingByte |= masked << (8 - pendingBitsForResultingByte)\n newByte = newByte >>> usingBits\n pendingBitsForNewByte -= usingBits\n pendingBitsForResultingByte -= usingBits\n\n if (!pendingBitsForResultingByte || (!pendingBitsForNewByte && !pending.length)) {\n bytes.push(resultingByte)\n resultingByte = 0\n pendingBitsForResultingByte = 8\n }\n }\n\n // remove trailing zeroes\n for(var i = bytes.length - 1; i > 0; i--) {\n const value = bytes[i]\n if (value === 0) {\n bytes.pop()\n } else {\n break\n }\n }\n\n return bytes\n }\n\n compactArray () {\n this._sortData()\n return this._data.map(valueOnly)\n }\n}\n\nfunction popCountReduce (count, byte) {\n return count + popCount(byte)\n}\n\nfunction popCount(_v) {\n let v = _v\n v = v - ((v >> 1) & 0x55555555) // reuse input as temporary\n v = (v & 0x33333333) + ((v >> 2) & 0x33333333) // temp\n return ((v + (v >> 4) & 0xF0F0F0F) * 0x1010101) >> 24\n}\n\nfunction sortInternal (a, b) {\n return a[0] - b[0]\n}\n\nfunction valueOnly (elem) {\n return elem[1]\n}","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.streamingIterables = {}));\n})(this, (function (exports) { 'use strict';\n\n async function* _batch(size, iterable) {\n let dataBatch = [];\n for await (const data of iterable) {\n dataBatch.push(data);\n if (dataBatch.length === size) {\n yield dataBatch;\n dataBatch = [];\n }\n }\n if (dataBatch.length > 0) {\n yield dataBatch;\n }\n }\n function* _syncBatch(size, iterable) {\n let dataBatch = [];\n for (const data of iterable) {\n dataBatch.push(data);\n if (dataBatch.length === size) {\n yield dataBatch;\n dataBatch = [];\n }\n }\n if (dataBatch.length > 0) {\n yield dataBatch;\n }\n }\n function batch(size, iterable) {\n if (iterable === undefined) {\n return curriedIterable => batch(size, curriedIterable);\n }\n if (iterable[Symbol.asyncIterator]) {\n return _batch(size, iterable);\n }\n return _syncBatch(size, iterable);\n }\n\n const TIMEOUT = Symbol('TIMEOUT');\n const createTimer = (duration) => {\n let timeoutId;\n return [\n new Promise(resolve => {\n timeoutId = setTimeout(() => resolve(TIMEOUT), duration);\n }),\n () => {\n clearTimeout(timeoutId);\n },\n ];\n };\n // Like `batch` but flushes early if the `timeout` is reached\n // NOTE: The strategy is to only hold onto a single item for a maximum of `timeout` ms.\n async function* _batchWithTimeout(size, timeout, iterable) {\n const iterator = iterable[Symbol.asyncIterator]();\n let pendingData;\n let batchData = [];\n let timer;\n let clearTimer;\n const startTimer = () => {\n deleteTimer();\n [timer, clearTimer] = createTimer(timeout);\n };\n const deleteTimer = () => {\n if (clearTimer) {\n clearTimer();\n }\n timer = undefined;\n };\n pendingData = iterator.next();\n while (true) {\n const res = await (timer ? Promise.race([pendingData, timer]) : pendingData);\n if (res === TIMEOUT || res.done) {\n // Flush early (before we reach the batch size)\n if (batchData.length) {\n yield batchData;\n batchData = [];\n }\n deleteTimer();\n // And exit appropriately\n if (res !== TIMEOUT) {\n // done\n break;\n }\n continue;\n }\n // Fetch next item early doors (before we potentially yield)\n pendingData = iterator.next();\n // Then handle the value\n batchData.push(res.value);\n if (batchData.length === 1) {\n // Start timer once we have at least 1 item ready to go\n startTimer();\n }\n if (batchData.length === size) {\n yield batchData;\n batchData = [];\n deleteTimer();\n continue;\n }\n }\n }\n function batchWithTimeout(size, timeout, iterable) {\n if (iterable === undefined) {\n return curriedIterable => batchWithTimeout(size, timeout, curriedIterable);\n }\n if (iterable[Symbol.asyncIterator] && timeout !== Infinity) {\n return _batchWithTimeout(size, timeout, iterable);\n }\n // For sync iterables or an infinite timeout, the timeout is irrelevant so just fallback to regular `batch`.\n return batch(size, iterable);\n }\n\n function getIterator(iterable) {\n if (typeof iterable.next === 'function') {\n return iterable;\n }\n if (typeof iterable[Symbol.iterator] === 'function') {\n return iterable[Symbol.iterator]();\n }\n if (typeof iterable[Symbol.asyncIterator] === 'function') {\n return iterable[Symbol.asyncIterator]();\n }\n throw new TypeError('\"values\" does not to conform to any of the iterator or iterable protocols');\n }\n\n function defer() {\n let reject;\n let resolve;\n const promise = new Promise((resolveFunc, rejectFunc) => {\n resolve = resolveFunc;\n reject = rejectFunc;\n });\n return {\n promise,\n reject,\n resolve,\n };\n }\n\n function _buffer(size, iterable) {\n const iterator = getIterator(iterable);\n const resultQueue = [];\n const readQueue = [];\n let reading = false;\n let ended = false;\n function fulfillReadQueue() {\n while (readQueue.length > 0 && resultQueue.length > 0) {\n const readDeferred = readQueue.shift();\n const { error, value } = resultQueue.shift();\n if (error) {\n readDeferred.reject(error);\n }\n else {\n readDeferred.resolve({ done: false, value });\n }\n }\n while (readQueue.length > 0 && ended) {\n const { resolve } = readQueue.shift();\n resolve({ done: true, value: undefined });\n }\n }\n async function fillQueue() {\n if (ended) {\n return;\n }\n if (reading) {\n return;\n }\n if (resultQueue.length >= size) {\n return;\n }\n reading = true;\n try {\n const { done, value } = await iterator.next();\n if (done) {\n ended = true;\n }\n else {\n resultQueue.push({ value });\n }\n }\n catch (error) {\n ended = true;\n resultQueue.push({ error });\n }\n fulfillReadQueue();\n reading = false;\n fillQueue();\n }\n async function next() {\n if (resultQueue.length > 0) {\n const { error, value } = resultQueue.shift();\n if (error) {\n throw error;\n }\n fillQueue();\n return { done: false, value };\n }\n if (ended) {\n return { done: true, value: undefined }; // stupid ts\n }\n const deferred = defer();\n readQueue.push(deferred);\n fillQueue();\n return deferred.promise;\n }\n const asyncIterableIterator = {\n next,\n [Symbol.asyncIterator]: () => asyncIterableIterator,\n };\n return asyncIterableIterator;\n }\n function* syncBuffer(size, iterable) {\n const valueQueue = [];\n let e;\n try {\n for (const value of iterable) {\n valueQueue.push(value);\n if (valueQueue.length <= size) {\n continue;\n }\n yield valueQueue.shift();\n }\n }\n catch (error) {\n e = error;\n }\n for (const value of valueQueue) {\n yield value;\n }\n if (e) {\n throw e;\n }\n }\n function buffer(size, iterable) {\n if (iterable === undefined) {\n return curriedIterable => buffer(size, curriedIterable);\n }\n if (size === 0) {\n return iterable;\n }\n if (iterable[Symbol.asyncIterator]) {\n return _buffer(size, iterable);\n }\n return syncBuffer(size, iterable);\n }\n\n async function _collect(iterable) {\n const values = [];\n for await (const value of iterable) {\n values.push(value);\n }\n return values;\n }\n function collect(iterable) {\n if (iterable[Symbol.asyncIterator]) {\n return _collect(iterable);\n }\n return Array.from(iterable);\n }\n\n async function* _concat(iterables) {\n for await (const iterable of iterables) {\n yield* iterable;\n }\n }\n function* _syncConcat(iterables) {\n for (const iterable of iterables) {\n yield* iterable;\n }\n }\n function concat(...iterables) {\n const hasAnyAsync = iterables.find(itr => itr[Symbol.asyncIterator] !== undefined);\n if (hasAnyAsync) {\n return _concat(iterables);\n }\n else {\n return _syncConcat(iterables);\n }\n }\n\n async function _consume(iterable) {\n for await (const val of iterable) {\n // do nothing\n }\n }\n function consume(iterable) {\n if (iterable[Symbol.asyncIterator]) {\n return _consume(iterable);\n }\n for (const val of iterable) {\n // do nothing\n }\n }\n\n async function* _filter(filterFunc, iterable) {\n for await (const data of iterable) {\n if (await filterFunc(data)) {\n yield data;\n }\n }\n }\n function filter(filterFunc, iterable) {\n if (iterable === undefined) {\n return (curriedIterable) => _filter(filterFunc, curriedIterable);\n }\n return _filter(filterFunc, iterable);\n }\n\n async function* flatten(iterable) {\n for await (const maybeItr of iterable) {\n if (maybeItr && typeof maybeItr !== 'string' && (maybeItr[Symbol.iterator] || maybeItr[Symbol.asyncIterator])) {\n yield* flatten(maybeItr);\n }\n else {\n yield maybeItr;\n }\n }\n }\n\n async function* _map(func, iterable) {\n for await (const val of iterable) {\n yield await func(val);\n }\n }\n function map(func, iterable) {\n if (iterable === undefined) {\n return curriedIterable => _map(func, curriedIterable);\n }\n return _map(func, iterable);\n }\n\n function flatMap(func, iterable) {\n if (iterable === undefined) {\n return curriedIterable => flatMap(func, curriedIterable);\n }\n return filter(i => i !== undefined && i !== null, flatten(map(func, iterable)));\n }\n\n function _flatTransform(concurrency, func, iterable) {\n const iterator = getIterator(iterable);\n const resultQueue = [];\n const readQueue = [];\n let ended = false;\n let reading = false;\n let inflightCount = 0;\n let lastError = null;\n function fulfillReadQueue() {\n while (readQueue.length > 0 && resultQueue.length > 0) {\n const { resolve } = readQueue.shift();\n const value = resultQueue.shift();\n resolve({ done: false, value });\n }\n while (readQueue.length > 0 && inflightCount === 0 && ended) {\n const { resolve, reject } = readQueue.shift();\n if (lastError) {\n reject(lastError);\n lastError = null;\n }\n else {\n resolve({ done: true, value: undefined });\n }\n }\n }\n async function fillQueue() {\n if (ended) {\n fulfillReadQueue();\n return;\n }\n if (reading) {\n return;\n }\n if (inflightCount + resultQueue.length >= concurrency) {\n return;\n }\n reading = true;\n inflightCount++;\n try {\n const { done, value } = await iterator.next();\n if (done) {\n ended = true;\n inflightCount--;\n fulfillReadQueue();\n }\n else {\n mapAndQueue(value);\n }\n }\n catch (error) {\n ended = true;\n inflightCount--;\n lastError = error;\n fulfillReadQueue();\n }\n reading = false;\n fillQueue();\n }\n async function mapAndQueue(itrValue) {\n try {\n const value = await func(itrValue);\n if (value && value[Symbol.asyncIterator]) {\n for await (const asyncVal of value) {\n resultQueue.push(asyncVal);\n }\n }\n else {\n resultQueue.push(value);\n }\n }\n catch (error) {\n ended = true;\n lastError = error;\n }\n inflightCount--;\n fulfillReadQueue();\n fillQueue();\n }\n async function next() {\n if (resultQueue.length === 0) {\n const deferred = defer();\n readQueue.push(deferred);\n fillQueue();\n return deferred.promise;\n }\n const value = resultQueue.shift();\n fillQueue();\n return { done: false, value };\n }\n const asyncIterableIterator = {\n next,\n [Symbol.asyncIterator]: () => asyncIterableIterator,\n };\n return asyncIterableIterator;\n }\n function flatTransform(concurrency, func, iterable) {\n if (func === undefined) {\n return (curriedFunc, curriedIterable) => curriedIterable\n ? flatTransform(concurrency, curriedFunc, curriedIterable)\n : flatTransform(concurrency, curriedFunc);\n }\n if (iterable === undefined) {\n return (curriedIterable) => flatTransform(concurrency, func, curriedIterable);\n }\n return filter(i => i !== undefined && i !== null, flatten(_flatTransform(concurrency, func, iterable)));\n }\n\n async function onceReadable(stream) {\n return new Promise(resolve => {\n stream.once('readable', () => {\n resolve();\n });\n });\n }\n async function* _fromStream(stream) {\n while (true) {\n const data = stream.read();\n if (data !== null) {\n yield data;\n continue;\n }\n if (stream._readableState.ended) {\n break;\n }\n await onceReadable(stream);\n }\n }\n function fromStream(stream) {\n if (typeof stream[Symbol.asyncIterator] === 'function') {\n return stream;\n }\n return _fromStream(stream);\n }\n\n async function* merge(...iterables) {\n const sources = new Set(iterables.map(getIterator));\n while (sources.size > 0) {\n for (const iterator of sources) {\n const nextVal = await iterator.next();\n if (nextVal.done) {\n sources.delete(iterator);\n }\n else {\n yield nextVal.value;\n }\n }\n }\n }\n\n function pipeline(firstFn, ...fns) {\n let previousFn = firstFn();\n for (const func of fns) {\n previousFn = func(previousFn);\n }\n return previousFn;\n }\n\n async function* _parallelMap(concurrency, func, iterable) {\n let transformError = null;\n const wrapFunc = value => ({\n value: func(value),\n });\n const stopOnError = async function* (source) {\n for await (const value of source) {\n if (transformError) {\n return;\n }\n yield value;\n }\n };\n const output = pipeline(() => iterable, buffer(1), stopOnError, map(wrapFunc), buffer(concurrency - 1));\n const itr = getIterator(output);\n while (true) {\n const { value, done } = await itr.next();\n if (done) {\n break;\n }\n try {\n const val = await value.value;\n if (!transformError) {\n yield val;\n }\n }\n catch (error) {\n transformError = error;\n }\n }\n if (transformError) {\n throw transformError;\n }\n }\n function parallelMap(concurrency, func, iterable) {\n if (func === undefined) {\n return (curriedFunc, curriedIterable) => parallelMap(concurrency, curriedFunc, curriedIterable);\n }\n if (iterable === undefined) {\n return curriedIterable => parallelMap(concurrency, func, curriedIterable);\n }\n if (concurrency === 1) {\n return map(func, iterable);\n }\n return _parallelMap(concurrency, func, iterable);\n }\n\n function parallelFlatMap(concurrency, func, iterable) {\n if (func === undefined) {\n return (curriedFunc, curriedIterable) => curriedIterable\n ? parallelFlatMap(concurrency, curriedFunc, curriedIterable)\n : parallelFlatMap(concurrency, curriedFunc);\n }\n if (iterable === undefined) {\n return (curriedIterable) => parallelFlatMap(concurrency, func, curriedIterable);\n }\n return filter(i => i !== undefined && i !== null, flatten(parallelMap(concurrency, func, iterable)));\n }\n\n async function* parallelMerge(...iterables) {\n const inputs = iterables.map(getIterator);\n const concurrentWork = new Set();\n const values = new Map();\n let lastError = null;\n let errCb = null;\n let valueCb = null;\n const notifyError = err => {\n lastError = err;\n if (errCb) {\n errCb(err);\n }\n };\n const notifyDone = value => {\n if (valueCb) {\n valueCb(value);\n }\n };\n const waitForQueue = () => new Promise((resolve, reject) => {\n if (lastError) {\n reject(lastError);\n }\n if (values.size > 0) {\n return resolve();\n }\n valueCb = resolve;\n errCb = reject;\n });\n const queueNext = input => {\n const nextVal = Promise.resolve(input.next()).then(async ({ done, value }) => {\n if (!done) {\n values.set(input, value);\n }\n concurrentWork.delete(nextVal);\n });\n concurrentWork.add(nextVal);\n nextVal.then(notifyDone, notifyError);\n };\n for (const input of inputs) {\n queueNext(input);\n }\n while (true) {\n // We technically don't have to check `values.size` as the for loop should have emptied it\n // However I haven't yet found specs verifying that behavior, only tests\n // the guard in waitForQueue() checking for values is in place for the same reason\n if (concurrentWork.size === 0 && values.size === 0) {\n return;\n }\n await waitForQueue();\n for (const [input, value] of values) {\n values.delete(input);\n yield value;\n queueNext(input);\n }\n }\n }\n\n async function _reduce(func, start, iterable) {\n let value = start;\n for await (const nextItem of iterable) {\n value = await func(value, nextItem);\n }\n return value;\n }\n function reduce(func, start, iterable) {\n if (start === undefined) {\n return (curriedStart, curriedIterable) => curriedIterable ? _reduce(func, curriedStart, curriedIterable) : reduce(func, curriedStart);\n }\n if (iterable === undefined) {\n return (curriedIterable) => reduce(func, start, curriedIterable);\n }\n return _reduce(func, start, iterable);\n }\n\n async function* _take(count, iterable) {\n let taken = 0;\n for await (const val of iterable) {\n yield await val;\n taken++;\n if (taken >= count) {\n break;\n }\n }\n }\n function* _syncTake(count, iterable) {\n let taken = 0;\n for (const val of iterable) {\n yield val;\n taken++;\n if (taken >= count) {\n break;\n }\n }\n }\n function take(count, iterable) {\n if (iterable === undefined) {\n return curriedIterable => take(count, curriedIterable);\n }\n if (iterable[Symbol.asyncIterator]) {\n return _take(count, iterable);\n }\n return _syncTake(count, iterable);\n }\n\n async function* _asyncTap(func, iterable) {\n for await (const val of iterable) {\n await func(val);\n yield val;\n }\n }\n function tap(func, iterable) {\n if (iterable === undefined) {\n return (curriedIterable) => _asyncTap(func, curriedIterable);\n }\n return _asyncTap(func, iterable);\n }\n\n const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));\n function _throttle(limit, interval, iterable) {\n if (!Number.isFinite(limit)) {\n throw new TypeError('Expected `limit` to be a finite number');\n }\n if (limit <= 0) {\n throw new TypeError('Expected `limit` to be greater than 0');\n }\n if (!Number.isFinite(interval)) {\n throw new TypeError('Expected `interval` to be a finite number');\n }\n return (async function* __throttle() {\n let sent = 0;\n let time;\n for await (const val of iterable) {\n if (sent < limit) {\n if (typeof time === 'undefined') {\n time = Date.now();\n }\n sent++;\n yield val;\n continue;\n }\n // Only wait if the interval hasn't already passed while we were\n // yielding the previous values.\n const elapsedMs = Date.now() - time;\n const waitFor = interval - elapsedMs;\n if (waitFor > 0) {\n await sleep(waitFor);\n }\n time = Date.now();\n sent = 1;\n yield val;\n }\n })();\n }\n function throttle(limit, interval, iterable) {\n if (iterable === undefined) {\n return (curriedIterable) => _throttle(limit, interval, curriedIterable);\n }\n return _throttle(limit, interval, iterable);\n }\n\n function addTime(a, b) {\n let seconds = a[0] + b[0];\n let nanoseconds = a[1] + b[1];\n if (nanoseconds >= 1000000000) {\n const remainder = nanoseconds % 1000000000;\n seconds += (nanoseconds - remainder) / 1000000000;\n nanoseconds = remainder;\n }\n return [seconds, nanoseconds];\n }\n async function* _asyncTime(config, iterable) {\n const itr = iterable[Symbol.asyncIterator]();\n let total = [0, 0];\n while (true) {\n const start = process.hrtime();\n const { value, done } = await itr.next();\n const delta = process.hrtime(start);\n total = addTime(total, delta);\n if (config.progress) {\n config.progress(delta, total);\n }\n if (done) {\n if (config.total) {\n config.total(total);\n }\n return value;\n }\n yield value;\n }\n }\n function* _syncTime(config, iterable) {\n const itr = iterable[Symbol.iterator]();\n let total = [0, 0];\n while (true) {\n const start = process.hrtime();\n const { value, done } = itr.next();\n const delta = process.hrtime(start);\n total = addTime(total, delta);\n if (config.progress) {\n config.progress(delta, total);\n }\n if (done) {\n if (config.total) {\n config.total(total);\n }\n return value;\n }\n yield value;\n }\n }\n function time(config = {}, iterable) {\n if (iterable === undefined) {\n return curriedIterable => time(config, curriedIterable);\n }\n if (iterable[Symbol.asyncIterator] !== undefined) {\n return _asyncTime(config, iterable);\n }\n else {\n return _syncTime(config, iterable);\n }\n }\n\n function _transform(concurrency, func, iterable) {\n const iterator = getIterator(iterable);\n const resultQueue = [];\n const readQueue = [];\n let ended = false;\n let reading = false;\n let inflightCount = 0;\n let lastError = null;\n function fulfillReadQueue() {\n while (readQueue.length > 0 && resultQueue.length > 0) {\n const { resolve } = readQueue.shift();\n const value = resultQueue.shift();\n resolve({ done: false, value });\n }\n while (readQueue.length > 0 && inflightCount === 0 && ended) {\n const { resolve, reject } = readQueue.shift();\n if (lastError) {\n reject(lastError);\n lastError = null;\n }\n else {\n resolve({ done: true, value: undefined });\n }\n }\n }\n async function fillQueue() {\n if (ended) {\n fulfillReadQueue();\n return;\n }\n if (reading) {\n return;\n }\n if (inflightCount + resultQueue.length >= concurrency) {\n return;\n }\n reading = true;\n inflightCount++;\n try {\n const { done, value } = await iterator.next();\n if (done) {\n ended = true;\n inflightCount--;\n fulfillReadQueue();\n }\n else {\n mapAndQueue(value);\n }\n }\n catch (error) {\n ended = true;\n inflightCount--;\n lastError = error;\n fulfillReadQueue();\n }\n reading = false;\n fillQueue();\n }\n async function mapAndQueue(itrValue) {\n try {\n const value = await func(itrValue);\n resultQueue.push(value);\n }\n catch (error) {\n ended = true;\n lastError = error;\n }\n inflightCount--;\n fulfillReadQueue();\n fillQueue();\n }\n async function next() {\n if (resultQueue.length === 0) {\n const deferred = defer();\n readQueue.push(deferred);\n fillQueue();\n return deferred.promise;\n }\n const value = resultQueue.shift();\n fillQueue();\n return { done: false, value };\n }\n const asyncIterableIterator = {\n next,\n [Symbol.asyncIterator]: () => asyncIterableIterator,\n };\n return asyncIterableIterator;\n }\n function transform(concurrency, func, iterable) {\n if (func === undefined) {\n return (curriedFunc, curriedIterable) => curriedIterable\n ? transform(concurrency, curriedFunc, curriedIterable)\n : transform(concurrency, curriedFunc);\n }\n if (iterable === undefined) {\n return (curriedIterable) => transform(concurrency, func, curriedIterable);\n }\n return _transform(concurrency, func, iterable);\n }\n\n async function _writeToStream(stream, iterable) {\n let lastError = null;\n let errCb = null;\n let drainCb = null;\n const notifyError = err => {\n lastError = err;\n if (errCb) {\n errCb(err);\n }\n };\n const notifyDrain = () => {\n if (drainCb) {\n drainCb();\n }\n };\n const cleanup = () => {\n stream.removeListener('error', notifyError);\n stream.removeListener('drain', notifyDrain);\n };\n stream.once('error', notifyError);\n const waitForDrain = () => new Promise((resolve, reject) => {\n if (lastError) {\n return reject(lastError);\n }\n stream.once('drain', notifyDrain);\n drainCb = resolve;\n errCb = reject;\n });\n for await (const value of iterable) {\n if (stream.write(value) === false) {\n await waitForDrain();\n }\n if (lastError) {\n break;\n }\n }\n cleanup();\n if (lastError) {\n throw lastError;\n }\n }\n function writeToStream(stream, iterable) {\n if (iterable === undefined) {\n return (curriedIterable) => _writeToStream(stream, curriedIterable);\n }\n return _writeToStream(stream, iterable);\n }\n\n exports.batch = batch;\n exports.batchWithTimeout = batchWithTimeout;\n exports.buffer = buffer;\n exports.collect = collect;\n exports.concat = concat;\n exports.consume = consume;\n exports.filter = filter;\n exports.flatMap = flatMap;\n exports.flatTransform = flatTransform;\n exports.flatten = flatten;\n exports.fromStream = fromStream;\n exports.getIterator = getIterator;\n exports.map = map;\n exports.merge = merge;\n exports.parallelFlatMap = parallelFlatMap;\n exports.parallelMap = parallelMap;\n exports.parallelMerge = parallelMerge;\n exports.pipeline = pipeline;\n exports.reduce = reduce;\n exports.take = take;\n exports.tap = tap;\n exports.throttle = throttle;\n exports.time = time;\n exports.transform = transform;\n exports.writeToStream = writeToStream;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction throttledQueue(maxRequestsPerInterval, interval, evenlySpaced) {\n if (evenlySpaced === void 0) { evenlySpaced = false; }\n /**\n * If all requests should be evenly spaced, adjust to suit.\n */\n if (evenlySpaced) {\n interval = interval / maxRequestsPerInterval;\n maxRequestsPerInterval = 1;\n }\n var queue = [];\n var lastIntervalStart = 0;\n var numRequestsPerInterval = 0;\n var timeout;\n /**\n * Gets called at a set interval to remove items from the queue.\n * This is a self-adjusting timer, since the browser's setTimeout is highly inaccurate.\n */\n var dequeue = function () {\n var intervalEnd = lastIntervalStart + interval;\n var now = Date.now();\n /**\n * Adjust the timer if it was called too early.\n */\n if (now < intervalEnd) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n timeout !== undefined && clearTimeout(timeout);\n timeout = setTimeout(dequeue, intervalEnd - now);\n return;\n }\n lastIntervalStart = now;\n numRequestsPerInterval = 0;\n for (var _i = 0, _a = queue.splice(0, maxRequestsPerInterval); _i < _a.length; _i++) {\n var callback = _a[_i];\n numRequestsPerInterval++;\n void callback();\n }\n if (queue.length) {\n timeout = setTimeout(dequeue, interval);\n }\n else {\n timeout = undefined;\n }\n };\n return function (fn) { return new Promise(function (resolve, reject) {\n var callback = function () { return Promise.resolve().then(fn).then(resolve).catch(reject); };\n var now = Date.now();\n if (timeout === undefined && (now - lastIntervalStart) > interval) {\n lastIntervalStart = now;\n numRequestsPerInterval = 0;\n }\n if (numRequestsPerInterval++ < maxRequestsPerInterval) {\n void callback();\n }\n else {\n queue.push(callback);\n if (timeout === undefined) {\n timeout = setTimeout(dequeue, lastIntervalStart + interval - now);\n }\n }\n }); };\n}\nmodule.exports = throttledQueue;\nexports.default = throttledQueue;\n//# sourceMappingURL=throttledQueue.js.map","module.exports = require('./lib/tunnel');\n","'use strict';\n\nvar net = require('net');\nvar tls = require('tls');\nvar http = require('http');\nvar https = require('https');\nvar events = require('events');\nvar assert = require('assert');\nvar util = require('util');\n\n\nexports.httpOverHttp = httpOverHttp;\nexports.httpsOverHttp = httpsOverHttp;\nexports.httpOverHttps = httpOverHttps;\nexports.httpsOverHttps = httpsOverHttps;\n\n\nfunction httpOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n return agent;\n}\n\nfunction httpsOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\nfunction httpOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n return agent;\n}\n\nfunction httpsOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\n\nfunction TunnelingAgent(options) {\n var self = this;\n self.options = options || {};\n self.proxyOptions = self.options.proxy || {};\n self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;\n self.requests = [];\n self.sockets = [];\n\n self.on('free', function onFree(socket, host, port, localAddress) {\n var options = toOptions(host, port, localAddress);\n for (var i = 0, len = self.requests.length; i < len; ++i) {\n var pending = self.requests[i];\n if (pending.host === options.host && pending.port === options.port) {\n // Detect the request to connect same origin server,\n // reuse the connection.\n self.requests.splice(i, 1);\n pending.request.onSocket(socket);\n return;\n }\n }\n socket.destroy();\n self.removeSocket(socket);\n });\n}\nutil.inherits(TunnelingAgent, events.EventEmitter);\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {\n var self = this;\n var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));\n\n if (self.sockets.length >= this.maxSockets) {\n // We are over limit so we'll add it to the queue.\n self.requests.push(options);\n return;\n }\n\n // If we are under maxSockets create a new one.\n self.createSocket(options, function(socket) {\n socket.on('free', onFree);\n socket.on('close', onCloseOrRemove);\n socket.on('agentRemove', onCloseOrRemove);\n req.onSocket(socket);\n\n function onFree() {\n self.emit('free', socket, options);\n }\n\n function onCloseOrRemove(err) {\n self.removeSocket(socket);\n socket.removeListener('free', onFree);\n socket.removeListener('close', onCloseOrRemove);\n socket.removeListener('agentRemove', onCloseOrRemove);\n }\n });\n};\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n var self = this;\n var placeholder = {};\n self.sockets.push(placeholder);\n\n var connectOptions = mergeOptions({}, self.proxyOptions, {\n method: 'CONNECT',\n path: options.host + ':' + options.port,\n agent: false,\n headers: {\n host: options.host + ':' + options.port\n }\n });\n if (options.localAddress) {\n connectOptions.localAddress = options.localAddress;\n }\n if (connectOptions.proxyAuth) {\n connectOptions.headers = connectOptions.headers || {};\n connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n new Buffer(connectOptions.proxyAuth).toString('base64');\n }\n\n debug('making CONNECT request');\n var connectReq = self.request(connectOptions);\n connectReq.useChunkedEncodingByDefault = false; // for v0.6\n connectReq.once('response', onResponse); // for v0.6\n connectReq.once('upgrade', onUpgrade); // for v0.6\n connectReq.once('connect', onConnect); // for v0.7 or later\n connectReq.once('error', onError);\n connectReq.end();\n\n function onResponse(res) {\n // Very hacky. This is necessary to avoid http-parser leaks.\n res.upgrade = true;\n }\n\n function onUpgrade(res, socket, head) {\n // Hacky.\n process.nextTick(function() {\n onConnect(res, socket, head);\n });\n }\n\n function onConnect(res, socket, head) {\n connectReq.removeAllListeners();\n socket.removeAllListeners();\n\n if (res.statusCode !== 200) {\n debug('tunneling socket could not be established, statusCode=%d',\n res.statusCode);\n socket.destroy();\n var error = new Error('tunneling socket could not be established, ' +\n 'statusCode=' + res.statusCode);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n if (head.length > 0) {\n debug('got illegal response body from proxy');\n socket.destroy();\n var error = new Error('got illegal response body from proxy');\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n debug('tunneling connection has established');\n self.sockets[self.sockets.indexOf(placeholder)] = socket;\n return cb(socket);\n }\n\n function onError(cause) {\n connectReq.removeAllListeners();\n\n debug('tunneling socket could not be established, cause=%s\\n',\n cause.message, cause.stack);\n var error = new Error('tunneling socket could not be established, ' +\n 'cause=' + cause.message);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n }\n};\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n var pos = this.sockets.indexOf(socket)\n if (pos === -1) {\n return;\n }\n this.sockets.splice(pos, 1);\n\n var pending = this.requests.shift();\n if (pending) {\n // If we have pending requests and a socket gets closed a new one\n // needs to be created to take over in the pool for the one that closed.\n this.createSocket(pending, function(socket) {\n pending.request.onSocket(socket);\n });\n }\n};\n\nfunction createSecureSocket(options, cb) {\n var self = this;\n TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n var hostHeader = options.request.getHeader('host');\n var tlsOptions = mergeOptions({}, self.options, {\n socket: socket,\n servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host\n });\n\n // 0 is dummy port for v0.6\n var secureSocket = tls.connect(0, tlsOptions);\n self.sockets[self.sockets.indexOf(socket)] = secureSocket;\n cb(secureSocket);\n });\n}\n\n\nfunction toOptions(host, port, localAddress) {\n if (typeof host === 'string') { // since v0.10\n return {\n host: host,\n port: port,\n localAddress: localAddress\n };\n }\n return host; // for v0.11 or later\n}\n\nfunction mergeOptions(target) {\n for (var i = 1, len = arguments.length; i < len; ++i) {\n var overrides = arguments[i];\n if (typeof overrides === 'object') {\n var keys = Object.keys(overrides);\n for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n var k = keys[j];\n if (overrides[k] !== undefined) {\n target[k] = overrides[k];\n }\n }\n }\n }\n return target;\n}\n\n\nvar debug;\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n debug = function() {\n var args = Array.prototype.slice.call(arguments);\n if (typeof args[0] === 'string') {\n args[0] = 'TUNNEL: ' + args[0];\n } else {\n args.unshift('TUNNEL:');\n }\n console.error.apply(console, args);\n }\n} else {\n debug = function() {};\n}\nexports.debug = debug; // for test\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction concat(arrays, length) {\n if (!length) {\n length = arrays.reduce((acc, curr) => acc + curr.length, 0);\n }\n const output = new Uint8Array(length);\n let offset = 0;\n for (const arr of arrays) {\n output.set(arr, offset);\n offset += arr.length;\n }\n return output;\n}\n\nexports.concat = concat;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction equals(a, b) {\n if (a === b) {\n return true;\n }\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n for (let i = 0; i < a.byteLength; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\n\nexports.equals = equals;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar bases = require('./util/bases.js');\n\nfunction fromString(string, encoding = 'utf8') {\n const base = bases[encoding];\n if (!base) {\n throw new Error(`Unsupported encoding \"${ encoding }\"`);\n }\n return base.decoder.decode(`${ base.prefix }${ string }`);\n}\n\nexports.fromString = fromString;\n","'use strict';\n\nvar basics = require('multiformats/basics');\n\nfunction createCodec(name, prefix, encode, decode) {\n return {\n name,\n prefix,\n encoder: {\n name,\n prefix,\n encode\n },\n decoder: { decode }\n };\n}\nconst string = createCodec('utf8', 'u', buf => {\n const decoder = new TextDecoder('utf8');\n return 'u' + decoder.decode(buf);\n}, str => {\n const encoder = new TextEncoder();\n return encoder.encode(str.substring(1));\n});\nconst ascii = createCodec('ascii', 'a', buf => {\n let string = 'a';\n for (let i = 0; i < buf.length; i++) {\n string += String.fromCharCode(buf[i]);\n }\n return string;\n}, str => {\n str = str.substring(1);\n const buf = new Uint8Array(str.length);\n for (let i = 0; i < str.length; i++) {\n buf[i] = str.charCodeAt(i);\n }\n return buf;\n});\nconst BASES = {\n utf8: string,\n 'utf-8': string,\n hex: basics.bases.base16,\n latin1: ascii,\n ascii: ascii,\n binary: ascii,\n ...basics.bases\n};\n\nmodule.exports = BASES;\n","module.exports = read\n\nvar MSB = 0x80\n , REST = 0x7F\n\nfunction read(buf, offset) {\n var res = 0\n , offset = offset || 0\n , shift = 0\n , counter = offset\n , b\n , l = buf.length\n\n do {\n if (counter >= l || shift > 49) {\n read.bytes = 0\n throw new RangeError('Could not decode varint')\n }\n b = buf[counter++]\n res += shift < 28\n ? (b & REST) << shift\n : (b & REST) * Math.pow(2, shift)\n shift += 7\n } while (b >= MSB)\n\n read.bytes = counter - offset\n\n return res\n}\n","module.exports = encode\n\nvar MSB = 0x80\n , REST = 0x7F\n , MSBALL = ~REST\n , INT = Math.pow(2, 31)\n\nfunction encode(num, out, offset) {\n if (Number.MAX_SAFE_INTEGER && num > Number.MAX_SAFE_INTEGER) {\n encode.bytes = 0\n throw new RangeError('Could not encode varint')\n }\n out = out || []\n offset = offset || 0\n var oldOffset = offset\n\n while(num >= INT) {\n out[offset++] = (num & 0xFF) | MSB\n num /= 128\n }\n while(num & MSBALL) {\n out[offset++] = (num & 0xFF) | MSB\n num >>>= 7\n }\n out[offset] = num | 0\n \n encode.bytes = offset - oldOffset + 1\n \n return out\n}\n","module.exports = {\n encode: require('./encode.js')\n , decode: require('./decode.js')\n , encodingLength: require('./length.js')\n}\n","\nvar N1 = Math.pow(2, 7)\nvar N2 = Math.pow(2, 14)\nvar N3 = Math.pow(2, 21)\nvar N4 = Math.pow(2, 28)\nvar N5 = Math.pow(2, 35)\nvar N6 = Math.pow(2, 42)\nvar N7 = Math.pow(2, 49)\nvar N8 = Math.pow(2, 56)\nvar N9 = Math.pow(2, 63)\n\nmodule.exports = function (value) {\n return (\n value < N1 ? 1\n : value < N2 ? 2\n : value < N3 ? 3\n : value < N4 ? 4\n : value < N5 ? 5\n : value < N6 ? 6\n : value < N7 ? 7\n : value < N8 ? 8\n : value < N9 ? 9\n : 10\n )\n}\n","\"use strict\"\n\nexports.TextEncoder =\n typeof TextEncoder !== \"undefined\" ? TextEncoder : require(\"util\").TextEncoder\n\nexports.TextDecoder =\n typeof TextDecoder !== \"undefined\" ? TextDecoder : require(\"util\").TextDecoder\n","/**\n * web-streams-polyfill v3.2.1\n */\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.WebStreamsPolyfill = {}));\n}(this, (function (exports) { 'use strict';\n\n /// \n var SymbolPolyfill = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ?\n Symbol :\n function (description) { return \"Symbol(\" + description + \")\"; };\n\n /// \n function noop() {\n return undefined;\n }\n function getGlobals() {\n if (typeof self !== 'undefined') {\n return self;\n }\n else if (typeof window !== 'undefined') {\n return window;\n }\n else if (typeof global !== 'undefined') {\n return global;\n }\n return undefined;\n }\n var globals = getGlobals();\n\n function typeIsObject(x) {\n return (typeof x === 'object' && x !== null) || typeof x === 'function';\n }\n var rethrowAssertionErrorRejection = noop;\n\n var originalPromise = Promise;\n var originalPromiseThen = Promise.prototype.then;\n var originalPromiseResolve = Promise.resolve.bind(originalPromise);\n var originalPromiseReject = Promise.reject.bind(originalPromise);\n function newPromise(executor) {\n return new originalPromise(executor);\n }\n function promiseResolvedWith(value) {\n return originalPromiseResolve(value);\n }\n function promiseRejectedWith(reason) {\n return originalPromiseReject(reason);\n }\n function PerformPromiseThen(promise, onFulfilled, onRejected) {\n // There doesn't appear to be any way to correctly emulate the behaviour from JavaScript, so this is just an\n // approximation.\n return originalPromiseThen.call(promise, onFulfilled, onRejected);\n }\n function uponPromise(promise, onFulfilled, onRejected) {\n PerformPromiseThen(PerformPromiseThen(promise, onFulfilled, onRejected), undefined, rethrowAssertionErrorRejection);\n }\n function uponFulfillment(promise, onFulfilled) {\n uponPromise(promise, onFulfilled);\n }\n function uponRejection(promise, onRejected) {\n uponPromise(promise, undefined, onRejected);\n }\n function transformPromiseWith(promise, fulfillmentHandler, rejectionHandler) {\n return PerformPromiseThen(promise, fulfillmentHandler, rejectionHandler);\n }\n function setPromiseIsHandledToTrue(promise) {\n PerformPromiseThen(promise, undefined, rethrowAssertionErrorRejection);\n }\n var queueMicrotask = (function () {\n var globalQueueMicrotask = globals && globals.queueMicrotask;\n if (typeof globalQueueMicrotask === 'function') {\n return globalQueueMicrotask;\n }\n var resolvedPromise = promiseResolvedWith(undefined);\n return function (fn) { return PerformPromiseThen(resolvedPromise, fn); };\n })();\n function reflectCall(F, V, args) {\n if (typeof F !== 'function') {\n throw new TypeError('Argument is not a function');\n }\n return Function.prototype.apply.call(F, V, args);\n }\n function promiseCall(F, V, args) {\n try {\n return promiseResolvedWith(reflectCall(F, V, args));\n }\n catch (value) {\n return promiseRejectedWith(value);\n }\n }\n\n // Original from Chromium\n // https://chromium.googlesource.com/chromium/src/+/0aee4434a4dba42a42abaea9bfbc0cd196a63bc1/third_party/blink/renderer/core/streams/SimpleQueue.js\n var QUEUE_MAX_ARRAY_SIZE = 16384;\n /**\n * Simple queue structure.\n *\n * Avoids scalability issues with using a packed array directly by using\n * multiple arrays in a linked list and keeping the array size bounded.\n */\n var SimpleQueue = /** @class */ (function () {\n function SimpleQueue() {\n this._cursor = 0;\n this._size = 0;\n // _front and _back are always defined.\n this._front = {\n _elements: [],\n _next: undefined\n };\n this._back = this._front;\n // The cursor is used to avoid calling Array.shift().\n // It contains the index of the front element of the array inside the\n // front-most node. It is always in the range [0, QUEUE_MAX_ARRAY_SIZE).\n this._cursor = 0;\n // When there is only one node, size === elements.length - cursor.\n this._size = 0;\n }\n Object.defineProperty(SimpleQueue.prototype, \"length\", {\n get: function () {\n return this._size;\n },\n enumerable: false,\n configurable: true\n });\n // For exception safety, this method is structured in order:\n // 1. Read state\n // 2. Calculate required state mutations\n // 3. Perform state mutations\n SimpleQueue.prototype.push = function (element) {\n var oldBack = this._back;\n var newBack = oldBack;\n if (oldBack._elements.length === QUEUE_MAX_ARRAY_SIZE - 1) {\n newBack = {\n _elements: [],\n _next: undefined\n };\n }\n // push() is the mutation most likely to throw an exception, so it\n // goes first.\n oldBack._elements.push(element);\n if (newBack !== oldBack) {\n this._back = newBack;\n oldBack._next = newBack;\n }\n ++this._size;\n };\n // Like push(), shift() follows the read -> calculate -> mutate pattern for\n // exception safety.\n SimpleQueue.prototype.shift = function () { // must not be called on an empty queue\n var oldFront = this._front;\n var newFront = oldFront;\n var oldCursor = this._cursor;\n var newCursor = oldCursor + 1;\n var elements = oldFront._elements;\n var element = elements[oldCursor];\n if (newCursor === QUEUE_MAX_ARRAY_SIZE) {\n newFront = oldFront._next;\n newCursor = 0;\n }\n // No mutations before this point.\n --this._size;\n this._cursor = newCursor;\n if (oldFront !== newFront) {\n this._front = newFront;\n }\n // Permit shifted element to be garbage collected.\n elements[oldCursor] = undefined;\n return element;\n };\n // The tricky thing about forEach() is that it can be called\n // re-entrantly. The queue may be mutated inside the callback. It is easy to\n // see that push() within the callback has no negative effects since the end\n // of the queue is checked for on every iteration. If shift() is called\n // repeatedly within the callback then the next iteration may return an\n // element that has been removed. In this case the callback will be called\n // with undefined values until we either \"catch up\" with elements that still\n // exist or reach the back of the queue.\n SimpleQueue.prototype.forEach = function (callback) {\n var i = this._cursor;\n var node = this._front;\n var elements = node._elements;\n while (i !== elements.length || node._next !== undefined) {\n if (i === elements.length) {\n node = node._next;\n elements = node._elements;\n i = 0;\n if (elements.length === 0) {\n break;\n }\n }\n callback(elements[i]);\n ++i;\n }\n };\n // Return the element that would be returned if shift() was called now,\n // without modifying the queue.\n SimpleQueue.prototype.peek = function () { // must not be called on an empty queue\n var front = this._front;\n var cursor = this._cursor;\n return front._elements[cursor];\n };\n return SimpleQueue;\n }());\n\n function ReadableStreamReaderGenericInitialize(reader, stream) {\n reader._ownerReadableStream = stream;\n stream._reader = reader;\n if (stream._state === 'readable') {\n defaultReaderClosedPromiseInitialize(reader);\n }\n else if (stream._state === 'closed') {\n defaultReaderClosedPromiseInitializeAsResolved(reader);\n }\n else {\n defaultReaderClosedPromiseInitializeAsRejected(reader, stream._storedError);\n }\n }\n // A client of ReadableStreamDefaultReader and ReadableStreamBYOBReader may use these functions directly to bypass state\n // check.\n function ReadableStreamReaderGenericCancel(reader, reason) {\n var stream = reader._ownerReadableStream;\n return ReadableStreamCancel(stream, reason);\n }\n function ReadableStreamReaderGenericRelease(reader) {\n if (reader._ownerReadableStream._state === 'readable') {\n defaultReaderClosedPromiseReject(reader, new TypeError(\"Reader was released and can no longer be used to monitor the stream's closedness\"));\n }\n else {\n defaultReaderClosedPromiseResetToRejected(reader, new TypeError(\"Reader was released and can no longer be used to monitor the stream's closedness\"));\n }\n reader._ownerReadableStream._reader = undefined;\n reader._ownerReadableStream = undefined;\n }\n // Helper functions for the readers.\n function readerLockException(name) {\n return new TypeError('Cannot ' + name + ' a stream using a released reader');\n }\n // Helper functions for the ReadableStreamDefaultReader.\n function defaultReaderClosedPromiseInitialize(reader) {\n reader._closedPromise = newPromise(function (resolve, reject) {\n reader._closedPromise_resolve = resolve;\n reader._closedPromise_reject = reject;\n });\n }\n function defaultReaderClosedPromiseInitializeAsRejected(reader, reason) {\n defaultReaderClosedPromiseInitialize(reader);\n defaultReaderClosedPromiseReject(reader, reason);\n }\n function defaultReaderClosedPromiseInitializeAsResolved(reader) {\n defaultReaderClosedPromiseInitialize(reader);\n defaultReaderClosedPromiseResolve(reader);\n }\n function defaultReaderClosedPromiseReject(reader, reason) {\n if (reader._closedPromise_reject === undefined) {\n return;\n }\n setPromiseIsHandledToTrue(reader._closedPromise);\n reader._closedPromise_reject(reason);\n reader._closedPromise_resolve = undefined;\n reader._closedPromise_reject = undefined;\n }\n function defaultReaderClosedPromiseResetToRejected(reader, reason) {\n defaultReaderClosedPromiseInitializeAsRejected(reader, reason);\n }\n function defaultReaderClosedPromiseResolve(reader) {\n if (reader._closedPromise_resolve === undefined) {\n return;\n }\n reader._closedPromise_resolve(undefined);\n reader._closedPromise_resolve = undefined;\n reader._closedPromise_reject = undefined;\n }\n\n var AbortSteps = SymbolPolyfill('[[AbortSteps]]');\n var ErrorSteps = SymbolPolyfill('[[ErrorSteps]]');\n var CancelSteps = SymbolPolyfill('[[CancelSteps]]');\n var PullSteps = SymbolPolyfill('[[PullSteps]]');\n\n /// \n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite#Polyfill\n var NumberIsFinite = Number.isFinite || function (x) {\n return typeof x === 'number' && isFinite(x);\n };\n\n /// \n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc#Polyfill\n var MathTrunc = Math.trunc || function (v) {\n return v < 0 ? Math.ceil(v) : Math.floor(v);\n };\n\n // https://heycam.github.io/webidl/#idl-dictionaries\n function isDictionary(x) {\n return typeof x === 'object' || typeof x === 'function';\n }\n function assertDictionary(obj, context) {\n if (obj !== undefined && !isDictionary(obj)) {\n throw new TypeError(context + \" is not an object.\");\n }\n }\n // https://heycam.github.io/webidl/#idl-callback-functions\n function assertFunction(x, context) {\n if (typeof x !== 'function') {\n throw new TypeError(context + \" is not a function.\");\n }\n }\n // https://heycam.github.io/webidl/#idl-object\n function isObject(x) {\n return (typeof x === 'object' && x !== null) || typeof x === 'function';\n }\n function assertObject(x, context) {\n if (!isObject(x)) {\n throw new TypeError(context + \" is not an object.\");\n }\n }\n function assertRequiredArgument(x, position, context) {\n if (x === undefined) {\n throw new TypeError(\"Parameter \" + position + \" is required in '\" + context + \"'.\");\n }\n }\n function assertRequiredField(x, field, context) {\n if (x === undefined) {\n throw new TypeError(field + \" is required in '\" + context + \"'.\");\n }\n }\n // https://heycam.github.io/webidl/#idl-unrestricted-double\n function convertUnrestrictedDouble(value) {\n return Number(value);\n }\n function censorNegativeZero(x) {\n return x === 0 ? 0 : x;\n }\n function integerPart(x) {\n return censorNegativeZero(MathTrunc(x));\n }\n // https://heycam.github.io/webidl/#idl-unsigned-long-long\n function convertUnsignedLongLongWithEnforceRange(value, context) {\n var lowerBound = 0;\n var upperBound = Number.MAX_SAFE_INTEGER;\n var x = Number(value);\n x = censorNegativeZero(x);\n if (!NumberIsFinite(x)) {\n throw new TypeError(context + \" is not a finite number\");\n }\n x = integerPart(x);\n if (x < lowerBound || x > upperBound) {\n throw new TypeError(context + \" is outside the accepted range of \" + lowerBound + \" to \" + upperBound + \", inclusive\");\n }\n if (!NumberIsFinite(x) || x === 0) {\n return 0;\n }\n // TODO Use BigInt if supported?\n // let xBigInt = BigInt(integerPart(x));\n // xBigInt = BigInt.asUintN(64, xBigInt);\n // return Number(xBigInt);\n return x;\n }\n\n function assertReadableStream(x, context) {\n if (!IsReadableStream(x)) {\n throw new TypeError(context + \" is not a ReadableStream.\");\n }\n }\n\n // Abstract operations for the ReadableStream.\n function AcquireReadableStreamDefaultReader(stream) {\n return new ReadableStreamDefaultReader(stream);\n }\n // ReadableStream API exposed for controllers.\n function ReadableStreamAddReadRequest(stream, readRequest) {\n stream._reader._readRequests.push(readRequest);\n }\n function ReadableStreamFulfillReadRequest(stream, chunk, done) {\n var reader = stream._reader;\n var readRequest = reader._readRequests.shift();\n if (done) {\n readRequest._closeSteps();\n }\n else {\n readRequest._chunkSteps(chunk);\n }\n }\n function ReadableStreamGetNumReadRequests(stream) {\n return stream._reader._readRequests.length;\n }\n function ReadableStreamHasDefaultReader(stream) {\n var reader = stream._reader;\n if (reader === undefined) {\n return false;\n }\n if (!IsReadableStreamDefaultReader(reader)) {\n return false;\n }\n return true;\n }\n /**\n * A default reader vended by a {@link ReadableStream}.\n *\n * @public\n */\n var ReadableStreamDefaultReader = /** @class */ (function () {\n function ReadableStreamDefaultReader(stream) {\n assertRequiredArgument(stream, 1, 'ReadableStreamDefaultReader');\n assertReadableStream(stream, 'First parameter');\n if (IsReadableStreamLocked(stream)) {\n throw new TypeError('This stream has already been locked for exclusive reading by another reader');\n }\n ReadableStreamReaderGenericInitialize(this, stream);\n this._readRequests = new SimpleQueue();\n }\n Object.defineProperty(ReadableStreamDefaultReader.prototype, \"closed\", {\n /**\n * Returns a promise that will be fulfilled when the stream becomes closed,\n * or rejected if the stream ever errors or the reader's lock is released before the stream finishes closing.\n */\n get: function () {\n if (!IsReadableStreamDefaultReader(this)) {\n return promiseRejectedWith(defaultReaderBrandCheckException('closed'));\n }\n return this._closedPromise;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}.\n */\n ReadableStreamDefaultReader.prototype.cancel = function (reason) {\n if (reason === void 0) { reason = undefined; }\n if (!IsReadableStreamDefaultReader(this)) {\n return promiseRejectedWith(defaultReaderBrandCheckException('cancel'));\n }\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('cancel'));\n }\n return ReadableStreamReaderGenericCancel(this, reason);\n };\n /**\n * Returns a promise that allows access to the next chunk from the stream's internal queue, if available.\n *\n * If reading a chunk causes the queue to become empty, more data will be pulled from the underlying source.\n */\n ReadableStreamDefaultReader.prototype.read = function () {\n if (!IsReadableStreamDefaultReader(this)) {\n return promiseRejectedWith(defaultReaderBrandCheckException('read'));\n }\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('read from'));\n }\n var resolvePromise;\n var rejectPromise;\n var promise = newPromise(function (resolve, reject) {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n var readRequest = {\n _chunkSteps: function (chunk) { return resolvePromise({ value: chunk, done: false }); },\n _closeSteps: function () { return resolvePromise({ value: undefined, done: true }); },\n _errorSteps: function (e) { return rejectPromise(e); }\n };\n ReadableStreamDefaultReaderRead(this, readRequest);\n return promise;\n };\n /**\n * Releases the reader's lock on the corresponding stream. After the lock is released, the reader is no longer active.\n * If the associated stream is errored when the lock is released, the reader will appear errored in the same way\n * from now on; otherwise, the reader will appear closed.\n *\n * A reader's lock cannot be released while it still has a pending read request, i.e., if a promise returned by\n * the reader's {@link ReadableStreamDefaultReader.read | read()} method has not yet been settled. Attempting to\n * do so will throw a `TypeError` and leave the reader locked to the stream.\n */\n ReadableStreamDefaultReader.prototype.releaseLock = function () {\n if (!IsReadableStreamDefaultReader(this)) {\n throw defaultReaderBrandCheckException('releaseLock');\n }\n if (this._ownerReadableStream === undefined) {\n return;\n }\n if (this._readRequests.length > 0) {\n throw new TypeError('Tried to release a reader lock when that reader has pending read() calls un-settled');\n }\n ReadableStreamReaderGenericRelease(this);\n };\n return ReadableStreamDefaultReader;\n }());\n Object.defineProperties(ReadableStreamDefaultReader.prototype, {\n cancel: { enumerable: true },\n read: { enumerable: true },\n releaseLock: { enumerable: true },\n closed: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamDefaultReader.prototype, SymbolPolyfill.toStringTag, {\n value: 'ReadableStreamDefaultReader',\n configurable: true\n });\n }\n // Abstract operations for the readers.\n function IsReadableStreamDefaultReader(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_readRequests')) {\n return false;\n }\n return x instanceof ReadableStreamDefaultReader;\n }\n function ReadableStreamDefaultReaderRead(reader, readRequest) {\n var stream = reader._ownerReadableStream;\n stream._disturbed = true;\n if (stream._state === 'closed') {\n readRequest._closeSteps();\n }\n else if (stream._state === 'errored') {\n readRequest._errorSteps(stream._storedError);\n }\n else {\n stream._readableStreamController[PullSteps](readRequest);\n }\n }\n // Helper functions for the ReadableStreamDefaultReader.\n function defaultReaderBrandCheckException(name) {\n return new TypeError(\"ReadableStreamDefaultReader.prototype.\" + name + \" can only be used on a ReadableStreamDefaultReader\");\n }\n\n /// \n var _a;\n var AsyncIteratorPrototype;\n if (typeof SymbolPolyfill.asyncIterator === 'symbol') {\n // We're running inside a ES2018+ environment, but we're compiling to an older syntax.\n // We cannot access %AsyncIteratorPrototype% without non-ES2018 syntax, but we can re-create it.\n AsyncIteratorPrototype = (_a = {},\n // 25.1.3.1 %AsyncIteratorPrototype% [ @@asyncIterator ] ( )\n // https://tc39.github.io/ecma262/#sec-asynciteratorprototype-asynciterator\n _a[SymbolPolyfill.asyncIterator] = function () {\n return this;\n },\n _a);\n Object.defineProperty(AsyncIteratorPrototype, SymbolPolyfill.asyncIterator, { enumerable: false });\n }\n\n /// \n var ReadableStreamAsyncIteratorImpl = /** @class */ (function () {\n function ReadableStreamAsyncIteratorImpl(reader, preventCancel) {\n this._ongoingPromise = undefined;\n this._isFinished = false;\n this._reader = reader;\n this._preventCancel = preventCancel;\n }\n ReadableStreamAsyncIteratorImpl.prototype.next = function () {\n var _this = this;\n var nextSteps = function () { return _this._nextSteps(); };\n this._ongoingPromise = this._ongoingPromise ?\n transformPromiseWith(this._ongoingPromise, nextSteps, nextSteps) :\n nextSteps();\n return this._ongoingPromise;\n };\n ReadableStreamAsyncIteratorImpl.prototype.return = function (value) {\n var _this = this;\n var returnSteps = function () { return _this._returnSteps(value); };\n return this._ongoingPromise ?\n transformPromiseWith(this._ongoingPromise, returnSteps, returnSteps) :\n returnSteps();\n };\n ReadableStreamAsyncIteratorImpl.prototype._nextSteps = function () {\n var _this = this;\n if (this._isFinished) {\n return Promise.resolve({ value: undefined, done: true });\n }\n var reader = this._reader;\n if (reader._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('iterate'));\n }\n var resolvePromise;\n var rejectPromise;\n var promise = newPromise(function (resolve, reject) {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n var readRequest = {\n _chunkSteps: function (chunk) {\n _this._ongoingPromise = undefined;\n // This needs to be delayed by one microtask, otherwise we stop pulling too early which breaks a test.\n // FIXME Is this a bug in the specification, or in the test?\n queueMicrotask(function () { return resolvePromise({ value: chunk, done: false }); });\n },\n _closeSteps: function () {\n _this._ongoingPromise = undefined;\n _this._isFinished = true;\n ReadableStreamReaderGenericRelease(reader);\n resolvePromise({ value: undefined, done: true });\n },\n _errorSteps: function (reason) {\n _this._ongoingPromise = undefined;\n _this._isFinished = true;\n ReadableStreamReaderGenericRelease(reader);\n rejectPromise(reason);\n }\n };\n ReadableStreamDefaultReaderRead(reader, readRequest);\n return promise;\n };\n ReadableStreamAsyncIteratorImpl.prototype._returnSteps = function (value) {\n if (this._isFinished) {\n return Promise.resolve({ value: value, done: true });\n }\n this._isFinished = true;\n var reader = this._reader;\n if (reader._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('finish iterating'));\n }\n if (!this._preventCancel) {\n var result = ReadableStreamReaderGenericCancel(reader, value);\n ReadableStreamReaderGenericRelease(reader);\n return transformPromiseWith(result, function () { return ({ value: value, done: true }); });\n }\n ReadableStreamReaderGenericRelease(reader);\n return promiseResolvedWith({ value: value, done: true });\n };\n return ReadableStreamAsyncIteratorImpl;\n }());\n var ReadableStreamAsyncIteratorPrototype = {\n next: function () {\n if (!IsReadableStreamAsyncIterator(this)) {\n return promiseRejectedWith(streamAsyncIteratorBrandCheckException('next'));\n }\n return this._asyncIteratorImpl.next();\n },\n return: function (value) {\n if (!IsReadableStreamAsyncIterator(this)) {\n return promiseRejectedWith(streamAsyncIteratorBrandCheckException('return'));\n }\n return this._asyncIteratorImpl.return(value);\n }\n };\n if (AsyncIteratorPrototype !== undefined) {\n Object.setPrototypeOf(ReadableStreamAsyncIteratorPrototype, AsyncIteratorPrototype);\n }\n // Abstract operations for the ReadableStream.\n function AcquireReadableStreamAsyncIterator(stream, preventCancel) {\n var reader = AcquireReadableStreamDefaultReader(stream);\n var impl = new ReadableStreamAsyncIteratorImpl(reader, preventCancel);\n var iterator = Object.create(ReadableStreamAsyncIteratorPrototype);\n iterator._asyncIteratorImpl = impl;\n return iterator;\n }\n function IsReadableStreamAsyncIterator(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_asyncIteratorImpl')) {\n return false;\n }\n try {\n // noinspection SuspiciousTypeOfGuard\n return x._asyncIteratorImpl instanceof\n ReadableStreamAsyncIteratorImpl;\n }\n catch (_a) {\n return false;\n }\n }\n // Helper functions for the ReadableStream.\n function streamAsyncIteratorBrandCheckException(name) {\n return new TypeError(\"ReadableStreamAsyncIterator.\" + name + \" can only be used on a ReadableSteamAsyncIterator\");\n }\n\n /// \n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN#Polyfill\n var NumberIsNaN = Number.isNaN || function (x) {\n // eslint-disable-next-line no-self-compare\n return x !== x;\n };\n\n function CreateArrayFromList(elements) {\n // We use arrays to represent lists, so this is basically a no-op.\n // Do a slice though just in case we happen to depend on the unique-ness.\n return elements.slice();\n }\n function CopyDataBlockBytes(dest, destOffset, src, srcOffset, n) {\n new Uint8Array(dest).set(new Uint8Array(src, srcOffset, n), destOffset);\n }\n // Not implemented correctly\n function TransferArrayBuffer(O) {\n return O;\n }\n // Not implemented correctly\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n function IsDetachedBuffer(O) {\n return false;\n }\n function ArrayBufferSlice(buffer, begin, end) {\n // ArrayBuffer.prototype.slice is not available on IE10\n // https://www.caniuse.com/mdn-javascript_builtins_arraybuffer_slice\n if (buffer.slice) {\n return buffer.slice(begin, end);\n }\n var length = end - begin;\n var slice = new ArrayBuffer(length);\n CopyDataBlockBytes(slice, 0, buffer, begin, length);\n return slice;\n }\n\n function IsNonNegativeNumber(v) {\n if (typeof v !== 'number') {\n return false;\n }\n if (NumberIsNaN(v)) {\n return false;\n }\n if (v < 0) {\n return false;\n }\n return true;\n }\n function CloneAsUint8Array(O) {\n var buffer = ArrayBufferSlice(O.buffer, O.byteOffset, O.byteOffset + O.byteLength);\n return new Uint8Array(buffer);\n }\n\n function DequeueValue(container) {\n var pair = container._queue.shift();\n container._queueTotalSize -= pair.size;\n if (container._queueTotalSize < 0) {\n container._queueTotalSize = 0;\n }\n return pair.value;\n }\n function EnqueueValueWithSize(container, value, size) {\n if (!IsNonNegativeNumber(size) || size === Infinity) {\n throw new RangeError('Size must be a finite, non-NaN, non-negative number.');\n }\n container._queue.push({ value: value, size: size });\n container._queueTotalSize += size;\n }\n function PeekQueueValue(container) {\n var pair = container._queue.peek();\n return pair.value;\n }\n function ResetQueue(container) {\n container._queue = new SimpleQueue();\n container._queueTotalSize = 0;\n }\n\n /**\n * A pull-into request in a {@link ReadableByteStreamController}.\n *\n * @public\n */\n var ReadableStreamBYOBRequest = /** @class */ (function () {\n function ReadableStreamBYOBRequest() {\n throw new TypeError('Illegal constructor');\n }\n Object.defineProperty(ReadableStreamBYOBRequest.prototype, \"view\", {\n /**\n * Returns the view for writing in to, or `null` if the BYOB request has already been responded to.\n */\n get: function () {\n if (!IsReadableStreamBYOBRequest(this)) {\n throw byobRequestBrandCheckException('view');\n }\n return this._view;\n },\n enumerable: false,\n configurable: true\n });\n ReadableStreamBYOBRequest.prototype.respond = function (bytesWritten) {\n if (!IsReadableStreamBYOBRequest(this)) {\n throw byobRequestBrandCheckException('respond');\n }\n assertRequiredArgument(bytesWritten, 1, 'respond');\n bytesWritten = convertUnsignedLongLongWithEnforceRange(bytesWritten, 'First parameter');\n if (this._associatedReadableByteStreamController === undefined) {\n throw new TypeError('This BYOB request has been invalidated');\n }\n if (IsDetachedBuffer(this._view.buffer)) ;\n ReadableByteStreamControllerRespond(this._associatedReadableByteStreamController, bytesWritten);\n };\n ReadableStreamBYOBRequest.prototype.respondWithNewView = function (view) {\n if (!IsReadableStreamBYOBRequest(this)) {\n throw byobRequestBrandCheckException('respondWithNewView');\n }\n assertRequiredArgument(view, 1, 'respondWithNewView');\n if (!ArrayBuffer.isView(view)) {\n throw new TypeError('You can only respond with array buffer views');\n }\n if (this._associatedReadableByteStreamController === undefined) {\n throw new TypeError('This BYOB request has been invalidated');\n }\n if (IsDetachedBuffer(view.buffer)) ;\n ReadableByteStreamControllerRespondWithNewView(this._associatedReadableByteStreamController, view);\n };\n return ReadableStreamBYOBRequest;\n }());\n Object.defineProperties(ReadableStreamBYOBRequest.prototype, {\n respond: { enumerable: true },\n respondWithNewView: { enumerable: true },\n view: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamBYOBRequest.prototype, SymbolPolyfill.toStringTag, {\n value: 'ReadableStreamBYOBRequest',\n configurable: true\n });\n }\n /**\n * Allows control of a {@link ReadableStream | readable byte stream}'s state and internal queue.\n *\n * @public\n */\n var ReadableByteStreamController = /** @class */ (function () {\n function ReadableByteStreamController() {\n throw new TypeError('Illegal constructor');\n }\n Object.defineProperty(ReadableByteStreamController.prototype, \"byobRequest\", {\n /**\n * Returns the current BYOB pull request, or `null` if there isn't one.\n */\n get: function () {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('byobRequest');\n }\n return ReadableByteStreamControllerGetBYOBRequest(this);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ReadableByteStreamController.prototype, \"desiredSize\", {\n /**\n * Returns the desired size to fill the controlled stream's internal queue. It can be negative, if the queue is\n * over-full. An underlying byte source ought to use this information to determine when and how to apply backpressure.\n */\n get: function () {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('desiredSize');\n }\n return ReadableByteStreamControllerGetDesiredSize(this);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Closes the controlled readable stream. Consumers will still be able to read any previously-enqueued chunks from\n * the stream, but once those are read, the stream will become closed.\n */\n ReadableByteStreamController.prototype.close = function () {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('close');\n }\n if (this._closeRequested) {\n throw new TypeError('The stream has already been closed; do not close it again!');\n }\n var state = this._controlledReadableByteStream._state;\n if (state !== 'readable') {\n throw new TypeError(\"The stream (in \" + state + \" state) is not in the readable state and cannot be closed\");\n }\n ReadableByteStreamControllerClose(this);\n };\n ReadableByteStreamController.prototype.enqueue = function (chunk) {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('enqueue');\n }\n assertRequiredArgument(chunk, 1, 'enqueue');\n if (!ArrayBuffer.isView(chunk)) {\n throw new TypeError('chunk must be an array buffer view');\n }\n if (chunk.byteLength === 0) {\n throw new TypeError('chunk must have non-zero byteLength');\n }\n if (chunk.buffer.byteLength === 0) {\n throw new TypeError(\"chunk's buffer must have non-zero byteLength\");\n }\n if (this._closeRequested) {\n throw new TypeError('stream is closed or draining');\n }\n var state = this._controlledReadableByteStream._state;\n if (state !== 'readable') {\n throw new TypeError(\"The stream (in \" + state + \" state) is not in the readable state and cannot be enqueued to\");\n }\n ReadableByteStreamControllerEnqueue(this, chunk);\n };\n /**\n * Errors the controlled readable stream, making all future interactions with it fail with the given error `e`.\n */\n ReadableByteStreamController.prototype.error = function (e) {\n if (e === void 0) { e = undefined; }\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('error');\n }\n ReadableByteStreamControllerError(this, e);\n };\n /** @internal */\n ReadableByteStreamController.prototype[CancelSteps] = function (reason) {\n ReadableByteStreamControllerClearPendingPullIntos(this);\n ResetQueue(this);\n var result = this._cancelAlgorithm(reason);\n ReadableByteStreamControllerClearAlgorithms(this);\n return result;\n };\n /** @internal */\n ReadableByteStreamController.prototype[PullSteps] = function (readRequest) {\n var stream = this._controlledReadableByteStream;\n if (this._queueTotalSize > 0) {\n var entry = this._queue.shift();\n this._queueTotalSize -= entry.byteLength;\n ReadableByteStreamControllerHandleQueueDrain(this);\n var view = new Uint8Array(entry.buffer, entry.byteOffset, entry.byteLength);\n readRequest._chunkSteps(view);\n return;\n }\n var autoAllocateChunkSize = this._autoAllocateChunkSize;\n if (autoAllocateChunkSize !== undefined) {\n var buffer = void 0;\n try {\n buffer = new ArrayBuffer(autoAllocateChunkSize);\n }\n catch (bufferE) {\n readRequest._errorSteps(bufferE);\n return;\n }\n var pullIntoDescriptor = {\n buffer: buffer,\n bufferByteLength: autoAllocateChunkSize,\n byteOffset: 0,\n byteLength: autoAllocateChunkSize,\n bytesFilled: 0,\n elementSize: 1,\n viewConstructor: Uint8Array,\n readerType: 'default'\n };\n this._pendingPullIntos.push(pullIntoDescriptor);\n }\n ReadableStreamAddReadRequest(stream, readRequest);\n ReadableByteStreamControllerCallPullIfNeeded(this);\n };\n return ReadableByteStreamController;\n }());\n Object.defineProperties(ReadableByteStreamController.prototype, {\n close: { enumerable: true },\n enqueue: { enumerable: true },\n error: { enumerable: true },\n byobRequest: { enumerable: true },\n desiredSize: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ReadableByteStreamController.prototype, SymbolPolyfill.toStringTag, {\n value: 'ReadableByteStreamController',\n configurable: true\n });\n }\n // Abstract operations for the ReadableByteStreamController.\n function IsReadableByteStreamController(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledReadableByteStream')) {\n return false;\n }\n return x instanceof ReadableByteStreamController;\n }\n function IsReadableStreamBYOBRequest(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_associatedReadableByteStreamController')) {\n return false;\n }\n return x instanceof ReadableStreamBYOBRequest;\n }\n function ReadableByteStreamControllerCallPullIfNeeded(controller) {\n var shouldPull = ReadableByteStreamControllerShouldCallPull(controller);\n if (!shouldPull) {\n return;\n }\n if (controller._pulling) {\n controller._pullAgain = true;\n return;\n }\n controller._pulling = true;\n // TODO: Test controller argument\n var pullPromise = controller._pullAlgorithm();\n uponPromise(pullPromise, function () {\n controller._pulling = false;\n if (controller._pullAgain) {\n controller._pullAgain = false;\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n }, function (e) {\n ReadableByteStreamControllerError(controller, e);\n });\n }\n function ReadableByteStreamControllerClearPendingPullIntos(controller) {\n ReadableByteStreamControllerInvalidateBYOBRequest(controller);\n controller._pendingPullIntos = new SimpleQueue();\n }\n function ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor) {\n var done = false;\n if (stream._state === 'closed') {\n done = true;\n }\n var filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor);\n if (pullIntoDescriptor.readerType === 'default') {\n ReadableStreamFulfillReadRequest(stream, filledView, done);\n }\n else {\n ReadableStreamFulfillReadIntoRequest(stream, filledView, done);\n }\n }\n function ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor) {\n var bytesFilled = pullIntoDescriptor.bytesFilled;\n var elementSize = pullIntoDescriptor.elementSize;\n return new pullIntoDescriptor.viewConstructor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, bytesFilled / elementSize);\n }\n function ReadableByteStreamControllerEnqueueChunkToQueue(controller, buffer, byteOffset, byteLength) {\n controller._queue.push({ buffer: buffer, byteOffset: byteOffset, byteLength: byteLength });\n controller._queueTotalSize += byteLength;\n }\n function ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor) {\n var elementSize = pullIntoDescriptor.elementSize;\n var currentAlignedBytes = pullIntoDescriptor.bytesFilled - pullIntoDescriptor.bytesFilled % elementSize;\n var maxBytesToCopy = Math.min(controller._queueTotalSize, pullIntoDescriptor.byteLength - pullIntoDescriptor.bytesFilled);\n var maxBytesFilled = pullIntoDescriptor.bytesFilled + maxBytesToCopy;\n var maxAlignedBytes = maxBytesFilled - maxBytesFilled % elementSize;\n var totalBytesToCopyRemaining = maxBytesToCopy;\n var ready = false;\n if (maxAlignedBytes > currentAlignedBytes) {\n totalBytesToCopyRemaining = maxAlignedBytes - pullIntoDescriptor.bytesFilled;\n ready = true;\n }\n var queue = controller._queue;\n while (totalBytesToCopyRemaining > 0) {\n var headOfQueue = queue.peek();\n var bytesToCopy = Math.min(totalBytesToCopyRemaining, headOfQueue.byteLength);\n var destStart = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled;\n CopyDataBlockBytes(pullIntoDescriptor.buffer, destStart, headOfQueue.buffer, headOfQueue.byteOffset, bytesToCopy);\n if (headOfQueue.byteLength === bytesToCopy) {\n queue.shift();\n }\n else {\n headOfQueue.byteOffset += bytesToCopy;\n headOfQueue.byteLength -= bytesToCopy;\n }\n controller._queueTotalSize -= bytesToCopy;\n ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesToCopy, pullIntoDescriptor);\n totalBytesToCopyRemaining -= bytesToCopy;\n }\n return ready;\n }\n function ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, size, pullIntoDescriptor) {\n pullIntoDescriptor.bytesFilled += size;\n }\n function ReadableByteStreamControllerHandleQueueDrain(controller) {\n if (controller._queueTotalSize === 0 && controller._closeRequested) {\n ReadableByteStreamControllerClearAlgorithms(controller);\n ReadableStreamClose(controller._controlledReadableByteStream);\n }\n else {\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n }\n function ReadableByteStreamControllerInvalidateBYOBRequest(controller) {\n if (controller._byobRequest === null) {\n return;\n }\n controller._byobRequest._associatedReadableByteStreamController = undefined;\n controller._byobRequest._view = null;\n controller._byobRequest = null;\n }\n function ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller) {\n while (controller._pendingPullIntos.length > 0) {\n if (controller._queueTotalSize === 0) {\n return;\n }\n var pullIntoDescriptor = controller._pendingPullIntos.peek();\n if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor)) {\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor);\n }\n }\n }\n function ReadableByteStreamControllerPullInto(controller, view, readIntoRequest) {\n var stream = controller._controlledReadableByteStream;\n var elementSize = 1;\n if (view.constructor !== DataView) {\n elementSize = view.constructor.BYTES_PER_ELEMENT;\n }\n var ctor = view.constructor;\n // try {\n var buffer = TransferArrayBuffer(view.buffer);\n // } catch (e) {\n // readIntoRequest._errorSteps(e);\n // return;\n // }\n var pullIntoDescriptor = {\n buffer: buffer,\n bufferByteLength: buffer.byteLength,\n byteOffset: view.byteOffset,\n byteLength: view.byteLength,\n bytesFilled: 0,\n elementSize: elementSize,\n viewConstructor: ctor,\n readerType: 'byob'\n };\n if (controller._pendingPullIntos.length > 0) {\n controller._pendingPullIntos.push(pullIntoDescriptor);\n // No ReadableByteStreamControllerCallPullIfNeeded() call since:\n // - No change happens on desiredSize\n // - The source has already been notified of that there's at least 1 pending read(view)\n ReadableStreamAddReadIntoRequest(stream, readIntoRequest);\n return;\n }\n if (stream._state === 'closed') {\n var emptyView = new ctor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, 0);\n readIntoRequest._closeSteps(emptyView);\n return;\n }\n if (controller._queueTotalSize > 0) {\n if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor)) {\n var filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor);\n ReadableByteStreamControllerHandleQueueDrain(controller);\n readIntoRequest._chunkSteps(filledView);\n return;\n }\n if (controller._closeRequested) {\n var e = new TypeError('Insufficient bytes to fill elements in the given buffer');\n ReadableByteStreamControllerError(controller, e);\n readIntoRequest._errorSteps(e);\n return;\n }\n }\n controller._pendingPullIntos.push(pullIntoDescriptor);\n ReadableStreamAddReadIntoRequest(stream, readIntoRequest);\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n function ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor) {\n var stream = controller._controlledReadableByteStream;\n if (ReadableStreamHasBYOBReader(stream)) {\n while (ReadableStreamGetNumReadIntoRequests(stream) > 0) {\n var pullIntoDescriptor = ReadableByteStreamControllerShiftPendingPullInto(controller);\n ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor);\n }\n }\n }\n function ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, pullIntoDescriptor) {\n ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesWritten, pullIntoDescriptor);\n if (pullIntoDescriptor.bytesFilled < pullIntoDescriptor.elementSize) {\n return;\n }\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n var remainderSize = pullIntoDescriptor.bytesFilled % pullIntoDescriptor.elementSize;\n if (remainderSize > 0) {\n var end = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled;\n var remainder = ArrayBufferSlice(pullIntoDescriptor.buffer, end - remainderSize, end);\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, remainder, 0, remainder.byteLength);\n }\n pullIntoDescriptor.bytesFilled -= remainderSize;\n ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor);\n ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);\n }\n function ReadableByteStreamControllerRespondInternal(controller, bytesWritten) {\n var firstDescriptor = controller._pendingPullIntos.peek();\n ReadableByteStreamControllerInvalidateBYOBRequest(controller);\n var state = controller._controlledReadableByteStream._state;\n if (state === 'closed') {\n ReadableByteStreamControllerRespondInClosedState(controller);\n }\n else {\n ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, firstDescriptor);\n }\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n function ReadableByteStreamControllerShiftPendingPullInto(controller) {\n var descriptor = controller._pendingPullIntos.shift();\n return descriptor;\n }\n function ReadableByteStreamControllerShouldCallPull(controller) {\n var stream = controller._controlledReadableByteStream;\n if (stream._state !== 'readable') {\n return false;\n }\n if (controller._closeRequested) {\n return false;\n }\n if (!controller._started) {\n return false;\n }\n if (ReadableStreamHasDefaultReader(stream) && ReadableStreamGetNumReadRequests(stream) > 0) {\n return true;\n }\n if (ReadableStreamHasBYOBReader(stream) && ReadableStreamGetNumReadIntoRequests(stream) > 0) {\n return true;\n }\n var desiredSize = ReadableByteStreamControllerGetDesiredSize(controller);\n if (desiredSize > 0) {\n return true;\n }\n return false;\n }\n function ReadableByteStreamControllerClearAlgorithms(controller) {\n controller._pullAlgorithm = undefined;\n controller._cancelAlgorithm = undefined;\n }\n // A client of ReadableByteStreamController may use these functions directly to bypass state check.\n function ReadableByteStreamControllerClose(controller) {\n var stream = controller._controlledReadableByteStream;\n if (controller._closeRequested || stream._state !== 'readable') {\n return;\n }\n if (controller._queueTotalSize > 0) {\n controller._closeRequested = true;\n return;\n }\n if (controller._pendingPullIntos.length > 0) {\n var firstPendingPullInto = controller._pendingPullIntos.peek();\n if (firstPendingPullInto.bytesFilled > 0) {\n var e = new TypeError('Insufficient bytes to fill elements in the given buffer');\n ReadableByteStreamControllerError(controller, e);\n throw e;\n }\n }\n ReadableByteStreamControllerClearAlgorithms(controller);\n ReadableStreamClose(stream);\n }\n function ReadableByteStreamControllerEnqueue(controller, chunk) {\n var stream = controller._controlledReadableByteStream;\n if (controller._closeRequested || stream._state !== 'readable') {\n return;\n }\n var buffer = chunk.buffer;\n var byteOffset = chunk.byteOffset;\n var byteLength = chunk.byteLength;\n var transferredBuffer = TransferArrayBuffer(buffer);\n if (controller._pendingPullIntos.length > 0) {\n var firstPendingPullInto = controller._pendingPullIntos.peek();\n if (IsDetachedBuffer(firstPendingPullInto.buffer)) ;\n firstPendingPullInto.buffer = TransferArrayBuffer(firstPendingPullInto.buffer);\n }\n ReadableByteStreamControllerInvalidateBYOBRequest(controller);\n if (ReadableStreamHasDefaultReader(stream)) {\n if (ReadableStreamGetNumReadRequests(stream) === 0) {\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);\n }\n else {\n if (controller._pendingPullIntos.length > 0) {\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n }\n var transferredView = new Uint8Array(transferredBuffer, byteOffset, byteLength);\n ReadableStreamFulfillReadRequest(stream, transferredView, false);\n }\n }\n else if (ReadableStreamHasBYOBReader(stream)) {\n // TODO: Ideally in this branch detaching should happen only if the buffer is not consumed fully.\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);\n ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);\n }\n else {\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);\n }\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n function ReadableByteStreamControllerError(controller, e) {\n var stream = controller._controlledReadableByteStream;\n if (stream._state !== 'readable') {\n return;\n }\n ReadableByteStreamControllerClearPendingPullIntos(controller);\n ResetQueue(controller);\n ReadableByteStreamControllerClearAlgorithms(controller);\n ReadableStreamError(stream, e);\n }\n function ReadableByteStreamControllerGetBYOBRequest(controller) {\n if (controller._byobRequest === null && controller._pendingPullIntos.length > 0) {\n var firstDescriptor = controller._pendingPullIntos.peek();\n var view = new Uint8Array(firstDescriptor.buffer, firstDescriptor.byteOffset + firstDescriptor.bytesFilled, firstDescriptor.byteLength - firstDescriptor.bytesFilled);\n var byobRequest = Object.create(ReadableStreamBYOBRequest.prototype);\n SetUpReadableStreamBYOBRequest(byobRequest, controller, view);\n controller._byobRequest = byobRequest;\n }\n return controller._byobRequest;\n }\n function ReadableByteStreamControllerGetDesiredSize(controller) {\n var state = controller._controlledReadableByteStream._state;\n if (state === 'errored') {\n return null;\n }\n if (state === 'closed') {\n return 0;\n }\n return controller._strategyHWM - controller._queueTotalSize;\n }\n function ReadableByteStreamControllerRespond(controller, bytesWritten) {\n var firstDescriptor = controller._pendingPullIntos.peek();\n var state = controller._controlledReadableByteStream._state;\n if (state === 'closed') {\n if (bytesWritten !== 0) {\n throw new TypeError('bytesWritten must be 0 when calling respond() on a closed stream');\n }\n }\n else {\n if (bytesWritten === 0) {\n throw new TypeError('bytesWritten must be greater than 0 when calling respond() on a readable stream');\n }\n if (firstDescriptor.bytesFilled + bytesWritten > firstDescriptor.byteLength) {\n throw new RangeError('bytesWritten out of range');\n }\n }\n firstDescriptor.buffer = TransferArrayBuffer(firstDescriptor.buffer);\n ReadableByteStreamControllerRespondInternal(controller, bytesWritten);\n }\n function ReadableByteStreamControllerRespondWithNewView(controller, view) {\n var firstDescriptor = controller._pendingPullIntos.peek();\n var state = controller._controlledReadableByteStream._state;\n if (state === 'closed') {\n if (view.byteLength !== 0) {\n throw new TypeError('The view\\'s length must be 0 when calling respondWithNewView() on a closed stream');\n }\n }\n else {\n if (view.byteLength === 0) {\n throw new TypeError('The view\\'s length must be greater than 0 when calling respondWithNewView() on a readable stream');\n }\n }\n if (firstDescriptor.byteOffset + firstDescriptor.bytesFilled !== view.byteOffset) {\n throw new RangeError('The region specified by view does not match byobRequest');\n }\n if (firstDescriptor.bufferByteLength !== view.buffer.byteLength) {\n throw new RangeError('The buffer of view has different capacity than byobRequest');\n }\n if (firstDescriptor.bytesFilled + view.byteLength > firstDescriptor.byteLength) {\n throw new RangeError('The region specified by view is larger than byobRequest');\n }\n var viewByteLength = view.byteLength;\n firstDescriptor.buffer = TransferArrayBuffer(view.buffer);\n ReadableByteStreamControllerRespondInternal(controller, viewByteLength);\n }\n function SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize) {\n controller._controlledReadableByteStream = stream;\n controller._pullAgain = false;\n controller._pulling = false;\n controller._byobRequest = null;\n // Need to set the slots so that the assert doesn't fire. In the spec the slots already exist implicitly.\n controller._queue = controller._queueTotalSize = undefined;\n ResetQueue(controller);\n controller._closeRequested = false;\n controller._started = false;\n controller._strategyHWM = highWaterMark;\n controller._pullAlgorithm = pullAlgorithm;\n controller._cancelAlgorithm = cancelAlgorithm;\n controller._autoAllocateChunkSize = autoAllocateChunkSize;\n controller._pendingPullIntos = new SimpleQueue();\n stream._readableStreamController = controller;\n var startResult = startAlgorithm();\n uponPromise(promiseResolvedWith(startResult), function () {\n controller._started = true;\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }, function (r) {\n ReadableByteStreamControllerError(controller, r);\n });\n }\n function SetUpReadableByteStreamControllerFromUnderlyingSource(stream, underlyingByteSource, highWaterMark) {\n var controller = Object.create(ReadableByteStreamController.prototype);\n var startAlgorithm = function () { return undefined; };\n var pullAlgorithm = function () { return promiseResolvedWith(undefined); };\n var cancelAlgorithm = function () { return promiseResolvedWith(undefined); };\n if (underlyingByteSource.start !== undefined) {\n startAlgorithm = function () { return underlyingByteSource.start(controller); };\n }\n if (underlyingByteSource.pull !== undefined) {\n pullAlgorithm = function () { return underlyingByteSource.pull(controller); };\n }\n if (underlyingByteSource.cancel !== undefined) {\n cancelAlgorithm = function (reason) { return underlyingByteSource.cancel(reason); };\n }\n var autoAllocateChunkSize = underlyingByteSource.autoAllocateChunkSize;\n if (autoAllocateChunkSize === 0) {\n throw new TypeError('autoAllocateChunkSize must be greater than 0');\n }\n SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize);\n }\n function SetUpReadableStreamBYOBRequest(request, controller, view) {\n request._associatedReadableByteStreamController = controller;\n request._view = view;\n }\n // Helper functions for the ReadableStreamBYOBRequest.\n function byobRequestBrandCheckException(name) {\n return new TypeError(\"ReadableStreamBYOBRequest.prototype.\" + name + \" can only be used on a ReadableStreamBYOBRequest\");\n }\n // Helper functions for the ReadableByteStreamController.\n function byteStreamControllerBrandCheckException(name) {\n return new TypeError(\"ReadableByteStreamController.prototype.\" + name + \" can only be used on a ReadableByteStreamController\");\n }\n\n // Abstract operations for the ReadableStream.\n function AcquireReadableStreamBYOBReader(stream) {\n return new ReadableStreamBYOBReader(stream);\n }\n // ReadableStream API exposed for controllers.\n function ReadableStreamAddReadIntoRequest(stream, readIntoRequest) {\n stream._reader._readIntoRequests.push(readIntoRequest);\n }\n function ReadableStreamFulfillReadIntoRequest(stream, chunk, done) {\n var reader = stream._reader;\n var readIntoRequest = reader._readIntoRequests.shift();\n if (done) {\n readIntoRequest._closeSteps(chunk);\n }\n else {\n readIntoRequest._chunkSteps(chunk);\n }\n }\n function ReadableStreamGetNumReadIntoRequests(stream) {\n return stream._reader._readIntoRequests.length;\n }\n function ReadableStreamHasBYOBReader(stream) {\n var reader = stream._reader;\n if (reader === undefined) {\n return false;\n }\n if (!IsReadableStreamBYOBReader(reader)) {\n return false;\n }\n return true;\n }\n /**\n * A BYOB reader vended by a {@link ReadableStream}.\n *\n * @public\n */\n var ReadableStreamBYOBReader = /** @class */ (function () {\n function ReadableStreamBYOBReader(stream) {\n assertRequiredArgument(stream, 1, 'ReadableStreamBYOBReader');\n assertReadableStream(stream, 'First parameter');\n if (IsReadableStreamLocked(stream)) {\n throw new TypeError('This stream has already been locked for exclusive reading by another reader');\n }\n if (!IsReadableByteStreamController(stream._readableStreamController)) {\n throw new TypeError('Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte ' +\n 'source');\n }\n ReadableStreamReaderGenericInitialize(this, stream);\n this._readIntoRequests = new SimpleQueue();\n }\n Object.defineProperty(ReadableStreamBYOBReader.prototype, \"closed\", {\n /**\n * Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or\n * the reader's lock is released before the stream finishes closing.\n */\n get: function () {\n if (!IsReadableStreamBYOBReader(this)) {\n return promiseRejectedWith(byobReaderBrandCheckException('closed'));\n }\n return this._closedPromise;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}.\n */\n ReadableStreamBYOBReader.prototype.cancel = function (reason) {\n if (reason === void 0) { reason = undefined; }\n if (!IsReadableStreamBYOBReader(this)) {\n return promiseRejectedWith(byobReaderBrandCheckException('cancel'));\n }\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('cancel'));\n }\n return ReadableStreamReaderGenericCancel(this, reason);\n };\n /**\n * Attempts to reads bytes into view, and returns a promise resolved with the result.\n *\n * If reading a chunk causes the queue to become empty, more data will be pulled from the underlying source.\n */\n ReadableStreamBYOBReader.prototype.read = function (view) {\n if (!IsReadableStreamBYOBReader(this)) {\n return promiseRejectedWith(byobReaderBrandCheckException('read'));\n }\n if (!ArrayBuffer.isView(view)) {\n return promiseRejectedWith(new TypeError('view must be an array buffer view'));\n }\n if (view.byteLength === 0) {\n return promiseRejectedWith(new TypeError('view must have non-zero byteLength'));\n }\n if (view.buffer.byteLength === 0) {\n return promiseRejectedWith(new TypeError(\"view's buffer must have non-zero byteLength\"));\n }\n if (IsDetachedBuffer(view.buffer)) ;\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('read from'));\n }\n var resolvePromise;\n var rejectPromise;\n var promise = newPromise(function (resolve, reject) {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n var readIntoRequest = {\n _chunkSteps: function (chunk) { return resolvePromise({ value: chunk, done: false }); },\n _closeSteps: function (chunk) { return resolvePromise({ value: chunk, done: true }); },\n _errorSteps: function (e) { return rejectPromise(e); }\n };\n ReadableStreamBYOBReaderRead(this, view, readIntoRequest);\n return promise;\n };\n /**\n * Releases the reader's lock on the corresponding stream. After the lock is released, the reader is no longer active.\n * If the associated stream is errored when the lock is released, the reader will appear errored in the same way\n * from now on; otherwise, the reader will appear closed.\n *\n * A reader's lock cannot be released while it still has a pending read request, i.e., if a promise returned by\n * the reader's {@link ReadableStreamBYOBReader.read | read()} method has not yet been settled. Attempting to\n * do so will throw a `TypeError` and leave the reader locked to the stream.\n */\n ReadableStreamBYOBReader.prototype.releaseLock = function () {\n if (!IsReadableStreamBYOBReader(this)) {\n throw byobReaderBrandCheckException('releaseLock');\n }\n if (this._ownerReadableStream === undefined) {\n return;\n }\n if (this._readIntoRequests.length > 0) {\n throw new TypeError('Tried to release a reader lock when that reader has pending read() calls un-settled');\n }\n ReadableStreamReaderGenericRelease(this);\n };\n return ReadableStreamBYOBReader;\n }());\n Object.defineProperties(ReadableStreamBYOBReader.prototype, {\n cancel: { enumerable: true },\n read: { enumerable: true },\n releaseLock: { enumerable: true },\n closed: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamBYOBReader.prototype, SymbolPolyfill.toStringTag, {\n value: 'ReadableStreamBYOBReader',\n configurable: true\n });\n }\n // Abstract operations for the readers.\n function IsReadableStreamBYOBReader(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_readIntoRequests')) {\n return false;\n }\n return x instanceof ReadableStreamBYOBReader;\n }\n function ReadableStreamBYOBReaderRead(reader, view, readIntoRequest) {\n var stream = reader._ownerReadableStream;\n stream._disturbed = true;\n if (stream._state === 'errored') {\n readIntoRequest._errorSteps(stream._storedError);\n }\n else {\n ReadableByteStreamControllerPullInto(stream._readableStreamController, view, readIntoRequest);\n }\n }\n // Helper functions for the ReadableStreamBYOBReader.\n function byobReaderBrandCheckException(name) {\n return new TypeError(\"ReadableStreamBYOBReader.prototype.\" + name + \" can only be used on a ReadableStreamBYOBReader\");\n }\n\n function ExtractHighWaterMark(strategy, defaultHWM) {\n var highWaterMark = strategy.highWaterMark;\n if (highWaterMark === undefined) {\n return defaultHWM;\n }\n if (NumberIsNaN(highWaterMark) || highWaterMark < 0) {\n throw new RangeError('Invalid highWaterMark');\n }\n return highWaterMark;\n }\n function ExtractSizeAlgorithm(strategy) {\n var size = strategy.size;\n if (!size) {\n return function () { return 1; };\n }\n return size;\n }\n\n function convertQueuingStrategy(init, context) {\n assertDictionary(init, context);\n var highWaterMark = init === null || init === void 0 ? void 0 : init.highWaterMark;\n var size = init === null || init === void 0 ? void 0 : init.size;\n return {\n highWaterMark: highWaterMark === undefined ? undefined : convertUnrestrictedDouble(highWaterMark),\n size: size === undefined ? undefined : convertQueuingStrategySize(size, context + \" has member 'size' that\")\n };\n }\n function convertQueuingStrategySize(fn, context) {\n assertFunction(fn, context);\n return function (chunk) { return convertUnrestrictedDouble(fn(chunk)); };\n }\n\n function convertUnderlyingSink(original, context) {\n assertDictionary(original, context);\n var abort = original === null || original === void 0 ? void 0 : original.abort;\n var close = original === null || original === void 0 ? void 0 : original.close;\n var start = original === null || original === void 0 ? void 0 : original.start;\n var type = original === null || original === void 0 ? void 0 : original.type;\n var write = original === null || original === void 0 ? void 0 : original.write;\n return {\n abort: abort === undefined ?\n undefined :\n convertUnderlyingSinkAbortCallback(abort, original, context + \" has member 'abort' that\"),\n close: close === undefined ?\n undefined :\n convertUnderlyingSinkCloseCallback(close, original, context + \" has member 'close' that\"),\n start: start === undefined ?\n undefined :\n convertUnderlyingSinkStartCallback(start, original, context + \" has member 'start' that\"),\n write: write === undefined ?\n undefined :\n convertUnderlyingSinkWriteCallback(write, original, context + \" has member 'write' that\"),\n type: type\n };\n }\n function convertUnderlyingSinkAbortCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (reason) { return promiseCall(fn, original, [reason]); };\n }\n function convertUnderlyingSinkCloseCallback(fn, original, context) {\n assertFunction(fn, context);\n return function () { return promiseCall(fn, original, []); };\n }\n function convertUnderlyingSinkStartCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (controller) { return reflectCall(fn, original, [controller]); };\n }\n function convertUnderlyingSinkWriteCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (chunk, controller) { return promiseCall(fn, original, [chunk, controller]); };\n }\n\n function assertWritableStream(x, context) {\n if (!IsWritableStream(x)) {\n throw new TypeError(context + \" is not a WritableStream.\");\n }\n }\n\n function isAbortSignal(value) {\n if (typeof value !== 'object' || value === null) {\n return false;\n }\n try {\n return typeof value.aborted === 'boolean';\n }\n catch (_a) {\n // AbortSignal.prototype.aborted throws if its brand check fails\n return false;\n }\n }\n var supportsAbortController = typeof AbortController === 'function';\n /**\n * Construct a new AbortController, if supported by the platform.\n *\n * @internal\n */\n function createAbortController() {\n if (supportsAbortController) {\n return new AbortController();\n }\n return undefined;\n }\n\n /**\n * A writable stream represents a destination for data, into which you can write.\n *\n * @public\n */\n var WritableStream = /** @class */ (function () {\n function WritableStream(rawUnderlyingSink, rawStrategy) {\n if (rawUnderlyingSink === void 0) { rawUnderlyingSink = {}; }\n if (rawStrategy === void 0) { rawStrategy = {}; }\n if (rawUnderlyingSink === undefined) {\n rawUnderlyingSink = null;\n }\n else {\n assertObject(rawUnderlyingSink, 'First parameter');\n }\n var strategy = convertQueuingStrategy(rawStrategy, 'Second parameter');\n var underlyingSink = convertUnderlyingSink(rawUnderlyingSink, 'First parameter');\n InitializeWritableStream(this);\n var type = underlyingSink.type;\n if (type !== undefined) {\n throw new RangeError('Invalid type is specified');\n }\n var sizeAlgorithm = ExtractSizeAlgorithm(strategy);\n var highWaterMark = ExtractHighWaterMark(strategy, 1);\n SetUpWritableStreamDefaultControllerFromUnderlyingSink(this, underlyingSink, highWaterMark, sizeAlgorithm);\n }\n Object.defineProperty(WritableStream.prototype, \"locked\", {\n /**\n * Returns whether or not the writable stream is locked to a writer.\n */\n get: function () {\n if (!IsWritableStream(this)) {\n throw streamBrandCheckException$2('locked');\n }\n return IsWritableStreamLocked(this);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be\n * immediately moved to an errored state, with any queued-up writes discarded. This will also execute any abort\n * mechanism of the underlying sink.\n *\n * The returned promise will fulfill if the stream shuts down successfully, or reject if the underlying sink signaled\n * that there was an error doing so. Additionally, it will reject with a `TypeError` (without attempting to cancel\n * the stream) if the stream is currently locked.\n */\n WritableStream.prototype.abort = function (reason) {\n if (reason === void 0) { reason = undefined; }\n if (!IsWritableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException$2('abort'));\n }\n if (IsWritableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError('Cannot abort a stream that already has a writer'));\n }\n return WritableStreamAbort(this, reason);\n };\n /**\n * Closes the stream. The underlying sink will finish processing any previously-written chunks, before invoking its\n * close behavior. During this time any further attempts to write will fail (without erroring the stream).\n *\n * The method returns a promise that will fulfill if all remaining chunks are successfully written and the stream\n * successfully closes, or rejects if an error is encountered during this process. Additionally, it will reject with\n * a `TypeError` (without attempting to cancel the stream) if the stream is currently locked.\n */\n WritableStream.prototype.close = function () {\n if (!IsWritableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException$2('close'));\n }\n if (IsWritableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError('Cannot close a stream that already has a writer'));\n }\n if (WritableStreamCloseQueuedOrInFlight(this)) {\n return promiseRejectedWith(new TypeError('Cannot close an already-closing stream'));\n }\n return WritableStreamClose(this);\n };\n /**\n * Creates a {@link WritableStreamDefaultWriter | writer} and locks the stream to the new writer. While the stream\n * is locked, no other writer can be acquired until this one is released.\n *\n * This functionality is especially useful for creating abstractions that desire the ability to write to a stream\n * without interruption or interleaving. By getting a writer for the stream, you can ensure nobody else can write at\n * the same time, which would cause the resulting written data to be unpredictable and probably useless.\n */\n WritableStream.prototype.getWriter = function () {\n if (!IsWritableStream(this)) {\n throw streamBrandCheckException$2('getWriter');\n }\n return AcquireWritableStreamDefaultWriter(this);\n };\n return WritableStream;\n }());\n Object.defineProperties(WritableStream.prototype, {\n abort: { enumerable: true },\n close: { enumerable: true },\n getWriter: { enumerable: true },\n locked: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(WritableStream.prototype, SymbolPolyfill.toStringTag, {\n value: 'WritableStream',\n configurable: true\n });\n }\n // Abstract operations for the WritableStream.\n function AcquireWritableStreamDefaultWriter(stream) {\n return new WritableStreamDefaultWriter(stream);\n }\n // Throws if and only if startAlgorithm throws.\n function CreateWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm) {\n if (highWaterMark === void 0) { highWaterMark = 1; }\n if (sizeAlgorithm === void 0) { sizeAlgorithm = function () { return 1; }; }\n var stream = Object.create(WritableStream.prototype);\n InitializeWritableStream(stream);\n var controller = Object.create(WritableStreamDefaultController.prototype);\n SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm);\n return stream;\n }\n function InitializeWritableStream(stream) {\n stream._state = 'writable';\n // The error that will be reported by new method calls once the state becomes errored. Only set when [[state]] is\n // 'erroring' or 'errored'. May be set to an undefined value.\n stream._storedError = undefined;\n stream._writer = undefined;\n // Initialize to undefined first because the constructor of the controller checks this\n // variable to validate the caller.\n stream._writableStreamController = undefined;\n // This queue is placed here instead of the writer class in order to allow for passing a writer to the next data\n // producer without waiting for the queued writes to finish.\n stream._writeRequests = new SimpleQueue();\n // Write requests are removed from _writeRequests when write() is called on the underlying sink. This prevents\n // them from being erroneously rejected on error. If a write() call is in-flight, the request is stored here.\n stream._inFlightWriteRequest = undefined;\n // The promise that was returned from writer.close(). Stored here because it may be fulfilled after the writer\n // has been detached.\n stream._closeRequest = undefined;\n // Close request is removed from _closeRequest when close() is called on the underlying sink. This prevents it\n // from being erroneously rejected on error. If a close() call is in-flight, the request is stored here.\n stream._inFlightCloseRequest = undefined;\n // The promise that was returned from writer.abort(). This may also be fulfilled after the writer has detached.\n stream._pendingAbortRequest = undefined;\n // The backpressure signal set by the controller.\n stream._backpressure = false;\n }\n function IsWritableStream(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_writableStreamController')) {\n return false;\n }\n return x instanceof WritableStream;\n }\n function IsWritableStreamLocked(stream) {\n if (stream._writer === undefined) {\n return false;\n }\n return true;\n }\n function WritableStreamAbort(stream, reason) {\n var _a;\n if (stream._state === 'closed' || stream._state === 'errored') {\n return promiseResolvedWith(undefined);\n }\n stream._writableStreamController._abortReason = reason;\n (_a = stream._writableStreamController._abortController) === null || _a === void 0 ? void 0 : _a.abort();\n // TypeScript narrows the type of `stream._state` down to 'writable' | 'erroring',\n // but it doesn't know that signaling abort runs author code that might have changed the state.\n // Widen the type again by casting to WritableStreamState.\n var state = stream._state;\n if (state === 'closed' || state === 'errored') {\n return promiseResolvedWith(undefined);\n }\n if (stream._pendingAbortRequest !== undefined) {\n return stream._pendingAbortRequest._promise;\n }\n var wasAlreadyErroring = false;\n if (state === 'erroring') {\n wasAlreadyErroring = true;\n // reason will not be used, so don't keep a reference to it.\n reason = undefined;\n }\n var promise = newPromise(function (resolve, reject) {\n stream._pendingAbortRequest = {\n _promise: undefined,\n _resolve: resolve,\n _reject: reject,\n _reason: reason,\n _wasAlreadyErroring: wasAlreadyErroring\n };\n });\n stream._pendingAbortRequest._promise = promise;\n if (!wasAlreadyErroring) {\n WritableStreamStartErroring(stream, reason);\n }\n return promise;\n }\n function WritableStreamClose(stream) {\n var state = stream._state;\n if (state === 'closed' || state === 'errored') {\n return promiseRejectedWith(new TypeError(\"The stream (in \" + state + \" state) is not in the writable state and cannot be closed\"));\n }\n var promise = newPromise(function (resolve, reject) {\n var closeRequest = {\n _resolve: resolve,\n _reject: reject\n };\n stream._closeRequest = closeRequest;\n });\n var writer = stream._writer;\n if (writer !== undefined && stream._backpressure && state === 'writable') {\n defaultWriterReadyPromiseResolve(writer);\n }\n WritableStreamDefaultControllerClose(stream._writableStreamController);\n return promise;\n }\n // WritableStream API exposed for controllers.\n function WritableStreamAddWriteRequest(stream) {\n var promise = newPromise(function (resolve, reject) {\n var writeRequest = {\n _resolve: resolve,\n _reject: reject\n };\n stream._writeRequests.push(writeRequest);\n });\n return promise;\n }\n function WritableStreamDealWithRejection(stream, error) {\n var state = stream._state;\n if (state === 'writable') {\n WritableStreamStartErroring(stream, error);\n return;\n }\n WritableStreamFinishErroring(stream);\n }\n function WritableStreamStartErroring(stream, reason) {\n var controller = stream._writableStreamController;\n stream._state = 'erroring';\n stream._storedError = reason;\n var writer = stream._writer;\n if (writer !== undefined) {\n WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, reason);\n }\n if (!WritableStreamHasOperationMarkedInFlight(stream) && controller._started) {\n WritableStreamFinishErroring(stream);\n }\n }\n function WritableStreamFinishErroring(stream) {\n stream._state = 'errored';\n stream._writableStreamController[ErrorSteps]();\n var storedError = stream._storedError;\n stream._writeRequests.forEach(function (writeRequest) {\n writeRequest._reject(storedError);\n });\n stream._writeRequests = new SimpleQueue();\n if (stream._pendingAbortRequest === undefined) {\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return;\n }\n var abortRequest = stream._pendingAbortRequest;\n stream._pendingAbortRequest = undefined;\n if (abortRequest._wasAlreadyErroring) {\n abortRequest._reject(storedError);\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return;\n }\n var promise = stream._writableStreamController[AbortSteps](abortRequest._reason);\n uponPromise(promise, function () {\n abortRequest._resolve();\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n }, function (reason) {\n abortRequest._reject(reason);\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n });\n }\n function WritableStreamFinishInFlightWrite(stream) {\n stream._inFlightWriteRequest._resolve(undefined);\n stream._inFlightWriteRequest = undefined;\n }\n function WritableStreamFinishInFlightWriteWithError(stream, error) {\n stream._inFlightWriteRequest._reject(error);\n stream._inFlightWriteRequest = undefined;\n WritableStreamDealWithRejection(stream, error);\n }\n function WritableStreamFinishInFlightClose(stream) {\n stream._inFlightCloseRequest._resolve(undefined);\n stream._inFlightCloseRequest = undefined;\n var state = stream._state;\n if (state === 'erroring') {\n // The error was too late to do anything, so it is ignored.\n stream._storedError = undefined;\n if (stream._pendingAbortRequest !== undefined) {\n stream._pendingAbortRequest._resolve();\n stream._pendingAbortRequest = undefined;\n }\n }\n stream._state = 'closed';\n var writer = stream._writer;\n if (writer !== undefined) {\n defaultWriterClosedPromiseResolve(writer);\n }\n }\n function WritableStreamFinishInFlightCloseWithError(stream, error) {\n stream._inFlightCloseRequest._reject(error);\n stream._inFlightCloseRequest = undefined;\n // Never execute sink abort() after sink close().\n if (stream._pendingAbortRequest !== undefined) {\n stream._pendingAbortRequest._reject(error);\n stream._pendingAbortRequest = undefined;\n }\n WritableStreamDealWithRejection(stream, error);\n }\n // TODO(ricea): Fix alphabetical order.\n function WritableStreamCloseQueuedOrInFlight(stream) {\n if (stream._closeRequest === undefined && stream._inFlightCloseRequest === undefined) {\n return false;\n }\n return true;\n }\n function WritableStreamHasOperationMarkedInFlight(stream) {\n if (stream._inFlightWriteRequest === undefined && stream._inFlightCloseRequest === undefined) {\n return false;\n }\n return true;\n }\n function WritableStreamMarkCloseRequestInFlight(stream) {\n stream._inFlightCloseRequest = stream._closeRequest;\n stream._closeRequest = undefined;\n }\n function WritableStreamMarkFirstWriteRequestInFlight(stream) {\n stream._inFlightWriteRequest = stream._writeRequests.shift();\n }\n function WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream) {\n if (stream._closeRequest !== undefined) {\n stream._closeRequest._reject(stream._storedError);\n stream._closeRequest = undefined;\n }\n var writer = stream._writer;\n if (writer !== undefined) {\n defaultWriterClosedPromiseReject(writer, stream._storedError);\n }\n }\n function WritableStreamUpdateBackpressure(stream, backpressure) {\n var writer = stream._writer;\n if (writer !== undefined && backpressure !== stream._backpressure) {\n if (backpressure) {\n defaultWriterReadyPromiseReset(writer);\n }\n else {\n defaultWriterReadyPromiseResolve(writer);\n }\n }\n stream._backpressure = backpressure;\n }\n /**\n * A default writer vended by a {@link WritableStream}.\n *\n * @public\n */\n var WritableStreamDefaultWriter = /** @class */ (function () {\n function WritableStreamDefaultWriter(stream) {\n assertRequiredArgument(stream, 1, 'WritableStreamDefaultWriter');\n assertWritableStream(stream, 'First parameter');\n if (IsWritableStreamLocked(stream)) {\n throw new TypeError('This stream has already been locked for exclusive writing by another writer');\n }\n this._ownerWritableStream = stream;\n stream._writer = this;\n var state = stream._state;\n if (state === 'writable') {\n if (!WritableStreamCloseQueuedOrInFlight(stream) && stream._backpressure) {\n defaultWriterReadyPromiseInitialize(this);\n }\n else {\n defaultWriterReadyPromiseInitializeAsResolved(this);\n }\n defaultWriterClosedPromiseInitialize(this);\n }\n else if (state === 'erroring') {\n defaultWriterReadyPromiseInitializeAsRejected(this, stream._storedError);\n defaultWriterClosedPromiseInitialize(this);\n }\n else if (state === 'closed') {\n defaultWriterReadyPromiseInitializeAsResolved(this);\n defaultWriterClosedPromiseInitializeAsResolved(this);\n }\n else {\n var storedError = stream._storedError;\n defaultWriterReadyPromiseInitializeAsRejected(this, storedError);\n defaultWriterClosedPromiseInitializeAsRejected(this, storedError);\n }\n }\n Object.defineProperty(WritableStreamDefaultWriter.prototype, \"closed\", {\n /**\n * Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or\n * the writer’s lock is released before the stream finishes closing.\n */\n get: function () {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('closed'));\n }\n return this._closedPromise;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(WritableStreamDefaultWriter.prototype, \"desiredSize\", {\n /**\n * Returns the desired size to fill the stream’s internal queue. It can be negative, if the queue is over-full.\n * A producer can use this information to determine the right amount of data to write.\n *\n * It will be `null` if the stream cannot be successfully written to (due to either being errored, or having an abort\n * queued up). It will return zero if the stream is closed. And the getter will throw an exception if invoked when\n * the writer’s lock is released.\n */\n get: function () {\n if (!IsWritableStreamDefaultWriter(this)) {\n throw defaultWriterBrandCheckException('desiredSize');\n }\n if (this._ownerWritableStream === undefined) {\n throw defaultWriterLockException('desiredSize');\n }\n return WritableStreamDefaultWriterGetDesiredSize(this);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(WritableStreamDefaultWriter.prototype, \"ready\", {\n /**\n * Returns a promise that will be fulfilled when the desired size to fill the stream’s internal queue transitions\n * from non-positive to positive, signaling that it is no longer applying backpressure. Once the desired size dips\n * back to zero or below, the getter will return a new promise that stays pending until the next transition.\n *\n * If the stream becomes errored or aborted, or the writer’s lock is released, the returned promise will become\n * rejected.\n */\n get: function () {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('ready'));\n }\n return this._readyPromise;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * If the reader is active, behaves the same as {@link WritableStream.abort | stream.abort(reason)}.\n */\n WritableStreamDefaultWriter.prototype.abort = function (reason) {\n if (reason === void 0) { reason = undefined; }\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('abort'));\n }\n if (this._ownerWritableStream === undefined) {\n return promiseRejectedWith(defaultWriterLockException('abort'));\n }\n return WritableStreamDefaultWriterAbort(this, reason);\n };\n /**\n * If the reader is active, behaves the same as {@link WritableStream.close | stream.close()}.\n */\n WritableStreamDefaultWriter.prototype.close = function () {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('close'));\n }\n var stream = this._ownerWritableStream;\n if (stream === undefined) {\n return promiseRejectedWith(defaultWriterLockException('close'));\n }\n if (WritableStreamCloseQueuedOrInFlight(stream)) {\n return promiseRejectedWith(new TypeError('Cannot close an already-closing stream'));\n }\n return WritableStreamDefaultWriterClose(this);\n };\n /**\n * Releases the writer’s lock on the corresponding stream. After the lock is released, the writer is no longer active.\n * If the associated stream is errored when the lock is released, the writer will appear errored in the same way from\n * now on; otherwise, the writer will appear closed.\n *\n * Note that the lock can still be released even if some ongoing writes have not yet finished (i.e. even if the\n * promises returned from previous calls to {@link WritableStreamDefaultWriter.write | write()} have not yet settled).\n * It’s not necessary to hold the lock on the writer for the duration of the write; the lock instead simply prevents\n * other producers from writing in an interleaved manner.\n */\n WritableStreamDefaultWriter.prototype.releaseLock = function () {\n if (!IsWritableStreamDefaultWriter(this)) {\n throw defaultWriterBrandCheckException('releaseLock');\n }\n var stream = this._ownerWritableStream;\n if (stream === undefined) {\n return;\n }\n WritableStreamDefaultWriterRelease(this);\n };\n WritableStreamDefaultWriter.prototype.write = function (chunk) {\n if (chunk === void 0) { chunk = undefined; }\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('write'));\n }\n if (this._ownerWritableStream === undefined) {\n return promiseRejectedWith(defaultWriterLockException('write to'));\n }\n return WritableStreamDefaultWriterWrite(this, chunk);\n };\n return WritableStreamDefaultWriter;\n }());\n Object.defineProperties(WritableStreamDefaultWriter.prototype, {\n abort: { enumerable: true },\n close: { enumerable: true },\n releaseLock: { enumerable: true },\n write: { enumerable: true },\n closed: { enumerable: true },\n desiredSize: { enumerable: true },\n ready: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(WritableStreamDefaultWriter.prototype, SymbolPolyfill.toStringTag, {\n value: 'WritableStreamDefaultWriter',\n configurable: true\n });\n }\n // Abstract operations for the WritableStreamDefaultWriter.\n function IsWritableStreamDefaultWriter(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_ownerWritableStream')) {\n return false;\n }\n return x instanceof WritableStreamDefaultWriter;\n }\n // A client of WritableStreamDefaultWriter may use these functions directly to bypass state check.\n function WritableStreamDefaultWriterAbort(writer, reason) {\n var stream = writer._ownerWritableStream;\n return WritableStreamAbort(stream, reason);\n }\n function WritableStreamDefaultWriterClose(writer) {\n var stream = writer._ownerWritableStream;\n return WritableStreamClose(stream);\n }\n function WritableStreamDefaultWriterCloseWithErrorPropagation(writer) {\n var stream = writer._ownerWritableStream;\n var state = stream._state;\n if (WritableStreamCloseQueuedOrInFlight(stream) || state === 'closed') {\n return promiseResolvedWith(undefined);\n }\n if (state === 'errored') {\n return promiseRejectedWith(stream._storedError);\n }\n return WritableStreamDefaultWriterClose(writer);\n }\n function WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, error) {\n if (writer._closedPromiseState === 'pending') {\n defaultWriterClosedPromiseReject(writer, error);\n }\n else {\n defaultWriterClosedPromiseResetToRejected(writer, error);\n }\n }\n function WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, error) {\n if (writer._readyPromiseState === 'pending') {\n defaultWriterReadyPromiseReject(writer, error);\n }\n else {\n defaultWriterReadyPromiseResetToRejected(writer, error);\n }\n }\n function WritableStreamDefaultWriterGetDesiredSize(writer) {\n var stream = writer._ownerWritableStream;\n var state = stream._state;\n if (state === 'errored' || state === 'erroring') {\n return null;\n }\n if (state === 'closed') {\n return 0;\n }\n return WritableStreamDefaultControllerGetDesiredSize(stream._writableStreamController);\n }\n function WritableStreamDefaultWriterRelease(writer) {\n var stream = writer._ownerWritableStream;\n var releasedError = new TypeError(\"Writer was released and can no longer be used to monitor the stream's closedness\");\n WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, releasedError);\n // The state transitions to \"errored\" before the sink abort() method runs, but the writer.closed promise is not\n // rejected until afterwards. This means that simply testing state will not work.\n WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, releasedError);\n stream._writer = undefined;\n writer._ownerWritableStream = undefined;\n }\n function WritableStreamDefaultWriterWrite(writer, chunk) {\n var stream = writer._ownerWritableStream;\n var controller = stream._writableStreamController;\n var chunkSize = WritableStreamDefaultControllerGetChunkSize(controller, chunk);\n if (stream !== writer._ownerWritableStream) {\n return promiseRejectedWith(defaultWriterLockException('write to'));\n }\n var state = stream._state;\n if (state === 'errored') {\n return promiseRejectedWith(stream._storedError);\n }\n if (WritableStreamCloseQueuedOrInFlight(stream) || state === 'closed') {\n return promiseRejectedWith(new TypeError('The stream is closing or closed and cannot be written to'));\n }\n if (state === 'erroring') {\n return promiseRejectedWith(stream._storedError);\n }\n var promise = WritableStreamAddWriteRequest(stream);\n WritableStreamDefaultControllerWrite(controller, chunk, chunkSize);\n return promise;\n }\n var closeSentinel = {};\n /**\n * Allows control of a {@link WritableStream | writable stream}'s state and internal queue.\n *\n * @public\n */\n var WritableStreamDefaultController = /** @class */ (function () {\n function WritableStreamDefaultController() {\n throw new TypeError('Illegal constructor');\n }\n Object.defineProperty(WritableStreamDefaultController.prototype, \"abortReason\", {\n /**\n * The reason which was passed to `WritableStream.abort(reason)` when the stream was aborted.\n *\n * @deprecated\n * This property has been removed from the specification, see https://github.com/whatwg/streams/pull/1177.\n * Use {@link WritableStreamDefaultController.signal}'s `reason` instead.\n */\n get: function () {\n if (!IsWritableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$2('abortReason');\n }\n return this._abortReason;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(WritableStreamDefaultController.prototype, \"signal\", {\n /**\n * An `AbortSignal` that can be used to abort the pending write or close operation when the stream is aborted.\n */\n get: function () {\n if (!IsWritableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$2('signal');\n }\n if (this._abortController === undefined) {\n // Older browsers or older Node versions may not support `AbortController` or `AbortSignal`.\n // We don't want to bundle and ship an `AbortController` polyfill together with our polyfill,\n // so instead we only implement support for `signal` if we find a global `AbortController` constructor.\n throw new TypeError('WritableStreamDefaultController.prototype.signal is not supported');\n }\n return this._abortController.signal;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Closes the controlled writable stream, making all future interactions with it fail with the given error `e`.\n *\n * This method is rarely used, since usually it suffices to return a rejected promise from one of the underlying\n * sink's methods. However, it can be useful for suddenly shutting down a stream in response to an event outside the\n * normal lifecycle of interactions with the underlying sink.\n */\n WritableStreamDefaultController.prototype.error = function (e) {\n if (e === void 0) { e = undefined; }\n if (!IsWritableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$2('error');\n }\n var state = this._controlledWritableStream._state;\n if (state !== 'writable') {\n // The stream is closed, errored or will be soon. The sink can't do anything useful if it gets an error here, so\n // just treat it as a no-op.\n return;\n }\n WritableStreamDefaultControllerError(this, e);\n };\n /** @internal */\n WritableStreamDefaultController.prototype[AbortSteps] = function (reason) {\n var result = this._abortAlgorithm(reason);\n WritableStreamDefaultControllerClearAlgorithms(this);\n return result;\n };\n /** @internal */\n WritableStreamDefaultController.prototype[ErrorSteps] = function () {\n ResetQueue(this);\n };\n return WritableStreamDefaultController;\n }());\n Object.defineProperties(WritableStreamDefaultController.prototype, {\n abortReason: { enumerable: true },\n signal: { enumerable: true },\n error: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(WritableStreamDefaultController.prototype, SymbolPolyfill.toStringTag, {\n value: 'WritableStreamDefaultController',\n configurable: true\n });\n }\n // Abstract operations implementing interface required by the WritableStream.\n function IsWritableStreamDefaultController(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledWritableStream')) {\n return false;\n }\n return x instanceof WritableStreamDefaultController;\n }\n function SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm) {\n controller._controlledWritableStream = stream;\n stream._writableStreamController = controller;\n // Need to set the slots so that the assert doesn't fire. In the spec the slots already exist implicitly.\n controller._queue = undefined;\n controller._queueTotalSize = undefined;\n ResetQueue(controller);\n controller._abortReason = undefined;\n controller._abortController = createAbortController();\n controller._started = false;\n controller._strategySizeAlgorithm = sizeAlgorithm;\n controller._strategyHWM = highWaterMark;\n controller._writeAlgorithm = writeAlgorithm;\n controller._closeAlgorithm = closeAlgorithm;\n controller._abortAlgorithm = abortAlgorithm;\n var backpressure = WritableStreamDefaultControllerGetBackpressure(controller);\n WritableStreamUpdateBackpressure(stream, backpressure);\n var startResult = startAlgorithm();\n var startPromise = promiseResolvedWith(startResult);\n uponPromise(startPromise, function () {\n controller._started = true;\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n }, function (r) {\n controller._started = true;\n WritableStreamDealWithRejection(stream, r);\n });\n }\n function SetUpWritableStreamDefaultControllerFromUnderlyingSink(stream, underlyingSink, highWaterMark, sizeAlgorithm) {\n var controller = Object.create(WritableStreamDefaultController.prototype);\n var startAlgorithm = function () { return undefined; };\n var writeAlgorithm = function () { return promiseResolvedWith(undefined); };\n var closeAlgorithm = function () { return promiseResolvedWith(undefined); };\n var abortAlgorithm = function () { return promiseResolvedWith(undefined); };\n if (underlyingSink.start !== undefined) {\n startAlgorithm = function () { return underlyingSink.start(controller); };\n }\n if (underlyingSink.write !== undefined) {\n writeAlgorithm = function (chunk) { return underlyingSink.write(chunk, controller); };\n }\n if (underlyingSink.close !== undefined) {\n closeAlgorithm = function () { return underlyingSink.close(); };\n }\n if (underlyingSink.abort !== undefined) {\n abortAlgorithm = function (reason) { return underlyingSink.abort(reason); };\n }\n SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm);\n }\n // ClearAlgorithms may be called twice. Erroring the same stream in multiple ways will often result in redundant calls.\n function WritableStreamDefaultControllerClearAlgorithms(controller) {\n controller._writeAlgorithm = undefined;\n controller._closeAlgorithm = undefined;\n controller._abortAlgorithm = undefined;\n controller._strategySizeAlgorithm = undefined;\n }\n function WritableStreamDefaultControllerClose(controller) {\n EnqueueValueWithSize(controller, closeSentinel, 0);\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n }\n function WritableStreamDefaultControllerGetChunkSize(controller, chunk) {\n try {\n return controller._strategySizeAlgorithm(chunk);\n }\n catch (chunkSizeE) {\n WritableStreamDefaultControllerErrorIfNeeded(controller, chunkSizeE);\n return 1;\n }\n }\n function WritableStreamDefaultControllerGetDesiredSize(controller) {\n return controller._strategyHWM - controller._queueTotalSize;\n }\n function WritableStreamDefaultControllerWrite(controller, chunk, chunkSize) {\n try {\n EnqueueValueWithSize(controller, chunk, chunkSize);\n }\n catch (enqueueE) {\n WritableStreamDefaultControllerErrorIfNeeded(controller, enqueueE);\n return;\n }\n var stream = controller._controlledWritableStream;\n if (!WritableStreamCloseQueuedOrInFlight(stream) && stream._state === 'writable') {\n var backpressure = WritableStreamDefaultControllerGetBackpressure(controller);\n WritableStreamUpdateBackpressure(stream, backpressure);\n }\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n }\n // Abstract operations for the WritableStreamDefaultController.\n function WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller) {\n var stream = controller._controlledWritableStream;\n if (!controller._started) {\n return;\n }\n if (stream._inFlightWriteRequest !== undefined) {\n return;\n }\n var state = stream._state;\n if (state === 'erroring') {\n WritableStreamFinishErroring(stream);\n return;\n }\n if (controller._queue.length === 0) {\n return;\n }\n var value = PeekQueueValue(controller);\n if (value === closeSentinel) {\n WritableStreamDefaultControllerProcessClose(controller);\n }\n else {\n WritableStreamDefaultControllerProcessWrite(controller, value);\n }\n }\n function WritableStreamDefaultControllerErrorIfNeeded(controller, error) {\n if (controller._controlledWritableStream._state === 'writable') {\n WritableStreamDefaultControllerError(controller, error);\n }\n }\n function WritableStreamDefaultControllerProcessClose(controller) {\n var stream = controller._controlledWritableStream;\n WritableStreamMarkCloseRequestInFlight(stream);\n DequeueValue(controller);\n var sinkClosePromise = controller._closeAlgorithm();\n WritableStreamDefaultControllerClearAlgorithms(controller);\n uponPromise(sinkClosePromise, function () {\n WritableStreamFinishInFlightClose(stream);\n }, function (reason) {\n WritableStreamFinishInFlightCloseWithError(stream, reason);\n });\n }\n function WritableStreamDefaultControllerProcessWrite(controller, chunk) {\n var stream = controller._controlledWritableStream;\n WritableStreamMarkFirstWriteRequestInFlight(stream);\n var sinkWritePromise = controller._writeAlgorithm(chunk);\n uponPromise(sinkWritePromise, function () {\n WritableStreamFinishInFlightWrite(stream);\n var state = stream._state;\n DequeueValue(controller);\n if (!WritableStreamCloseQueuedOrInFlight(stream) && state === 'writable') {\n var backpressure = WritableStreamDefaultControllerGetBackpressure(controller);\n WritableStreamUpdateBackpressure(stream, backpressure);\n }\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n }, function (reason) {\n if (stream._state === 'writable') {\n WritableStreamDefaultControllerClearAlgorithms(controller);\n }\n WritableStreamFinishInFlightWriteWithError(stream, reason);\n });\n }\n function WritableStreamDefaultControllerGetBackpressure(controller) {\n var desiredSize = WritableStreamDefaultControllerGetDesiredSize(controller);\n return desiredSize <= 0;\n }\n // A client of WritableStreamDefaultController may use these functions directly to bypass state check.\n function WritableStreamDefaultControllerError(controller, error) {\n var stream = controller._controlledWritableStream;\n WritableStreamDefaultControllerClearAlgorithms(controller);\n WritableStreamStartErroring(stream, error);\n }\n // Helper functions for the WritableStream.\n function streamBrandCheckException$2(name) {\n return new TypeError(\"WritableStream.prototype.\" + name + \" can only be used on a WritableStream\");\n }\n // Helper functions for the WritableStreamDefaultController.\n function defaultControllerBrandCheckException$2(name) {\n return new TypeError(\"WritableStreamDefaultController.prototype.\" + name + \" can only be used on a WritableStreamDefaultController\");\n }\n // Helper functions for the WritableStreamDefaultWriter.\n function defaultWriterBrandCheckException(name) {\n return new TypeError(\"WritableStreamDefaultWriter.prototype.\" + name + \" can only be used on a WritableStreamDefaultWriter\");\n }\n function defaultWriterLockException(name) {\n return new TypeError('Cannot ' + name + ' a stream using a released writer');\n }\n function defaultWriterClosedPromiseInitialize(writer) {\n writer._closedPromise = newPromise(function (resolve, reject) {\n writer._closedPromise_resolve = resolve;\n writer._closedPromise_reject = reject;\n writer._closedPromiseState = 'pending';\n });\n }\n function defaultWriterClosedPromiseInitializeAsRejected(writer, reason) {\n defaultWriterClosedPromiseInitialize(writer);\n defaultWriterClosedPromiseReject(writer, reason);\n }\n function defaultWriterClosedPromiseInitializeAsResolved(writer) {\n defaultWriterClosedPromiseInitialize(writer);\n defaultWriterClosedPromiseResolve(writer);\n }\n function defaultWriterClosedPromiseReject(writer, reason) {\n if (writer._closedPromise_reject === undefined) {\n return;\n }\n setPromiseIsHandledToTrue(writer._closedPromise);\n writer._closedPromise_reject(reason);\n writer._closedPromise_resolve = undefined;\n writer._closedPromise_reject = undefined;\n writer._closedPromiseState = 'rejected';\n }\n function defaultWriterClosedPromiseResetToRejected(writer, reason) {\n defaultWriterClosedPromiseInitializeAsRejected(writer, reason);\n }\n function defaultWriterClosedPromiseResolve(writer) {\n if (writer._closedPromise_resolve === undefined) {\n return;\n }\n writer._closedPromise_resolve(undefined);\n writer._closedPromise_resolve = undefined;\n writer._closedPromise_reject = undefined;\n writer._closedPromiseState = 'resolved';\n }\n function defaultWriterReadyPromiseInitialize(writer) {\n writer._readyPromise = newPromise(function (resolve, reject) {\n writer._readyPromise_resolve = resolve;\n writer._readyPromise_reject = reject;\n });\n writer._readyPromiseState = 'pending';\n }\n function defaultWriterReadyPromiseInitializeAsRejected(writer, reason) {\n defaultWriterReadyPromiseInitialize(writer);\n defaultWriterReadyPromiseReject(writer, reason);\n }\n function defaultWriterReadyPromiseInitializeAsResolved(writer) {\n defaultWriterReadyPromiseInitialize(writer);\n defaultWriterReadyPromiseResolve(writer);\n }\n function defaultWriterReadyPromiseReject(writer, reason) {\n if (writer._readyPromise_reject === undefined) {\n return;\n }\n setPromiseIsHandledToTrue(writer._readyPromise);\n writer._readyPromise_reject(reason);\n writer._readyPromise_resolve = undefined;\n writer._readyPromise_reject = undefined;\n writer._readyPromiseState = 'rejected';\n }\n function defaultWriterReadyPromiseReset(writer) {\n defaultWriterReadyPromiseInitialize(writer);\n }\n function defaultWriterReadyPromiseResetToRejected(writer, reason) {\n defaultWriterReadyPromiseInitializeAsRejected(writer, reason);\n }\n function defaultWriterReadyPromiseResolve(writer) {\n if (writer._readyPromise_resolve === undefined) {\n return;\n }\n writer._readyPromise_resolve(undefined);\n writer._readyPromise_resolve = undefined;\n writer._readyPromise_reject = undefined;\n writer._readyPromiseState = 'fulfilled';\n }\n\n /// \n var NativeDOMException = typeof DOMException !== 'undefined' ? DOMException : undefined;\n\n /// \n function isDOMExceptionConstructor(ctor) {\n if (!(typeof ctor === 'function' || typeof ctor === 'object')) {\n return false;\n }\n try {\n new ctor();\n return true;\n }\n catch (_a) {\n return false;\n }\n }\n function createDOMExceptionPolyfill() {\n // eslint-disable-next-line no-shadow\n var ctor = function DOMException(message, name) {\n this.message = message || '';\n this.name = name || 'Error';\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n };\n ctor.prototype = Object.create(Error.prototype);\n Object.defineProperty(ctor.prototype, 'constructor', { value: ctor, writable: true, configurable: true });\n return ctor;\n }\n // eslint-disable-next-line no-redeclare\n var DOMException$1 = isDOMExceptionConstructor(NativeDOMException) ? NativeDOMException : createDOMExceptionPolyfill();\n\n function ReadableStreamPipeTo(source, dest, preventClose, preventAbort, preventCancel, signal) {\n var reader = AcquireReadableStreamDefaultReader(source);\n var writer = AcquireWritableStreamDefaultWriter(dest);\n source._disturbed = true;\n var shuttingDown = false;\n // This is used to keep track of the spec's requirement that we wait for ongoing writes during shutdown.\n var currentWrite = promiseResolvedWith(undefined);\n return newPromise(function (resolve, reject) {\n var abortAlgorithm;\n if (signal !== undefined) {\n abortAlgorithm = function () {\n var error = new DOMException$1('Aborted', 'AbortError');\n var actions = [];\n if (!preventAbort) {\n actions.push(function () {\n if (dest._state === 'writable') {\n return WritableStreamAbort(dest, error);\n }\n return promiseResolvedWith(undefined);\n });\n }\n if (!preventCancel) {\n actions.push(function () {\n if (source._state === 'readable') {\n return ReadableStreamCancel(source, error);\n }\n return promiseResolvedWith(undefined);\n });\n }\n shutdownWithAction(function () { return Promise.all(actions.map(function (action) { return action(); })); }, true, error);\n };\n if (signal.aborted) {\n abortAlgorithm();\n return;\n }\n signal.addEventListener('abort', abortAlgorithm);\n }\n // Using reader and writer, read all chunks from this and write them to dest\n // - Backpressure must be enforced\n // - Shutdown must stop all activity\n function pipeLoop() {\n return newPromise(function (resolveLoop, rejectLoop) {\n function next(done) {\n if (done) {\n resolveLoop();\n }\n else {\n // Use `PerformPromiseThen` instead of `uponPromise` to avoid\n // adding unnecessary `.catch(rethrowAssertionErrorRejection)` handlers\n PerformPromiseThen(pipeStep(), next, rejectLoop);\n }\n }\n next(false);\n });\n }\n function pipeStep() {\n if (shuttingDown) {\n return promiseResolvedWith(true);\n }\n return PerformPromiseThen(writer._readyPromise, function () {\n return newPromise(function (resolveRead, rejectRead) {\n ReadableStreamDefaultReaderRead(reader, {\n _chunkSteps: function (chunk) {\n currentWrite = PerformPromiseThen(WritableStreamDefaultWriterWrite(writer, chunk), undefined, noop);\n resolveRead(false);\n },\n _closeSteps: function () { return resolveRead(true); },\n _errorSteps: rejectRead\n });\n });\n });\n }\n // Errors must be propagated forward\n isOrBecomesErrored(source, reader._closedPromise, function (storedError) {\n if (!preventAbort) {\n shutdownWithAction(function () { return WritableStreamAbort(dest, storedError); }, true, storedError);\n }\n else {\n shutdown(true, storedError);\n }\n });\n // Errors must be propagated backward\n isOrBecomesErrored(dest, writer._closedPromise, function (storedError) {\n if (!preventCancel) {\n shutdownWithAction(function () { return ReadableStreamCancel(source, storedError); }, true, storedError);\n }\n else {\n shutdown(true, storedError);\n }\n });\n // Closing must be propagated forward\n isOrBecomesClosed(source, reader._closedPromise, function () {\n if (!preventClose) {\n shutdownWithAction(function () { return WritableStreamDefaultWriterCloseWithErrorPropagation(writer); });\n }\n else {\n shutdown();\n }\n });\n // Closing must be propagated backward\n if (WritableStreamCloseQueuedOrInFlight(dest) || dest._state === 'closed') {\n var destClosed_1 = new TypeError('the destination writable stream closed before all data could be piped to it');\n if (!preventCancel) {\n shutdownWithAction(function () { return ReadableStreamCancel(source, destClosed_1); }, true, destClosed_1);\n }\n else {\n shutdown(true, destClosed_1);\n }\n }\n setPromiseIsHandledToTrue(pipeLoop());\n function waitForWritesToFinish() {\n // Another write may have started while we were waiting on this currentWrite, so we have to be sure to wait\n // for that too.\n var oldCurrentWrite = currentWrite;\n return PerformPromiseThen(currentWrite, function () { return oldCurrentWrite !== currentWrite ? waitForWritesToFinish() : undefined; });\n }\n function isOrBecomesErrored(stream, promise, action) {\n if (stream._state === 'errored') {\n action(stream._storedError);\n }\n else {\n uponRejection(promise, action);\n }\n }\n function isOrBecomesClosed(stream, promise, action) {\n if (stream._state === 'closed') {\n action();\n }\n else {\n uponFulfillment(promise, action);\n }\n }\n function shutdownWithAction(action, originalIsError, originalError) {\n if (shuttingDown) {\n return;\n }\n shuttingDown = true;\n if (dest._state === 'writable' && !WritableStreamCloseQueuedOrInFlight(dest)) {\n uponFulfillment(waitForWritesToFinish(), doTheRest);\n }\n else {\n doTheRest();\n }\n function doTheRest() {\n uponPromise(action(), function () { return finalize(originalIsError, originalError); }, function (newError) { return finalize(true, newError); });\n }\n }\n function shutdown(isError, error) {\n if (shuttingDown) {\n return;\n }\n shuttingDown = true;\n if (dest._state === 'writable' && !WritableStreamCloseQueuedOrInFlight(dest)) {\n uponFulfillment(waitForWritesToFinish(), function () { return finalize(isError, error); });\n }\n else {\n finalize(isError, error);\n }\n }\n function finalize(isError, error) {\n WritableStreamDefaultWriterRelease(writer);\n ReadableStreamReaderGenericRelease(reader);\n if (signal !== undefined) {\n signal.removeEventListener('abort', abortAlgorithm);\n }\n if (isError) {\n reject(error);\n }\n else {\n resolve(undefined);\n }\n }\n });\n }\n\n /**\n * Allows control of a {@link ReadableStream | readable stream}'s state and internal queue.\n *\n * @public\n */\n var ReadableStreamDefaultController = /** @class */ (function () {\n function ReadableStreamDefaultController() {\n throw new TypeError('Illegal constructor');\n }\n Object.defineProperty(ReadableStreamDefaultController.prototype, \"desiredSize\", {\n /**\n * Returns the desired size to fill the controlled stream's internal queue. It can be negative, if the queue is\n * over-full. An underlying source ought to use this information to determine when and how to apply backpressure.\n */\n get: function () {\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$1('desiredSize');\n }\n return ReadableStreamDefaultControllerGetDesiredSize(this);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Closes the controlled readable stream. Consumers will still be able to read any previously-enqueued chunks from\n * the stream, but once those are read, the stream will become closed.\n */\n ReadableStreamDefaultController.prototype.close = function () {\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$1('close');\n }\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)) {\n throw new TypeError('The stream is not in a state that permits close');\n }\n ReadableStreamDefaultControllerClose(this);\n };\n ReadableStreamDefaultController.prototype.enqueue = function (chunk) {\n if (chunk === void 0) { chunk = undefined; }\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$1('enqueue');\n }\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)) {\n throw new TypeError('The stream is not in a state that permits enqueue');\n }\n return ReadableStreamDefaultControllerEnqueue(this, chunk);\n };\n /**\n * Errors the controlled readable stream, making all future interactions with it fail with the given error `e`.\n */\n ReadableStreamDefaultController.prototype.error = function (e) {\n if (e === void 0) { e = undefined; }\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$1('error');\n }\n ReadableStreamDefaultControllerError(this, e);\n };\n /** @internal */\n ReadableStreamDefaultController.prototype[CancelSteps] = function (reason) {\n ResetQueue(this);\n var result = this._cancelAlgorithm(reason);\n ReadableStreamDefaultControllerClearAlgorithms(this);\n return result;\n };\n /** @internal */\n ReadableStreamDefaultController.prototype[PullSteps] = function (readRequest) {\n var stream = this._controlledReadableStream;\n if (this._queue.length > 0) {\n var chunk = DequeueValue(this);\n if (this._closeRequested && this._queue.length === 0) {\n ReadableStreamDefaultControllerClearAlgorithms(this);\n ReadableStreamClose(stream);\n }\n else {\n ReadableStreamDefaultControllerCallPullIfNeeded(this);\n }\n readRequest._chunkSteps(chunk);\n }\n else {\n ReadableStreamAddReadRequest(stream, readRequest);\n ReadableStreamDefaultControllerCallPullIfNeeded(this);\n }\n };\n return ReadableStreamDefaultController;\n }());\n Object.defineProperties(ReadableStreamDefaultController.prototype, {\n close: { enumerable: true },\n enqueue: { enumerable: true },\n error: { enumerable: true },\n desiredSize: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamDefaultController.prototype, SymbolPolyfill.toStringTag, {\n value: 'ReadableStreamDefaultController',\n configurable: true\n });\n }\n // Abstract operations for the ReadableStreamDefaultController.\n function IsReadableStreamDefaultController(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledReadableStream')) {\n return false;\n }\n return x instanceof ReadableStreamDefaultController;\n }\n function ReadableStreamDefaultControllerCallPullIfNeeded(controller) {\n var shouldPull = ReadableStreamDefaultControllerShouldCallPull(controller);\n if (!shouldPull) {\n return;\n }\n if (controller._pulling) {\n controller._pullAgain = true;\n return;\n }\n controller._pulling = true;\n var pullPromise = controller._pullAlgorithm();\n uponPromise(pullPromise, function () {\n controller._pulling = false;\n if (controller._pullAgain) {\n controller._pullAgain = false;\n ReadableStreamDefaultControllerCallPullIfNeeded(controller);\n }\n }, function (e) {\n ReadableStreamDefaultControllerError(controller, e);\n });\n }\n function ReadableStreamDefaultControllerShouldCallPull(controller) {\n var stream = controller._controlledReadableStream;\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {\n return false;\n }\n if (!controller._started) {\n return false;\n }\n if (IsReadableStreamLocked(stream) && ReadableStreamGetNumReadRequests(stream) > 0) {\n return true;\n }\n var desiredSize = ReadableStreamDefaultControllerGetDesiredSize(controller);\n if (desiredSize > 0) {\n return true;\n }\n return false;\n }\n function ReadableStreamDefaultControllerClearAlgorithms(controller) {\n controller._pullAlgorithm = undefined;\n controller._cancelAlgorithm = undefined;\n controller._strategySizeAlgorithm = undefined;\n }\n // A client of ReadableStreamDefaultController may use these functions directly to bypass state check.\n function ReadableStreamDefaultControllerClose(controller) {\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {\n return;\n }\n var stream = controller._controlledReadableStream;\n controller._closeRequested = true;\n if (controller._queue.length === 0) {\n ReadableStreamDefaultControllerClearAlgorithms(controller);\n ReadableStreamClose(stream);\n }\n }\n function ReadableStreamDefaultControllerEnqueue(controller, chunk) {\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {\n return;\n }\n var stream = controller._controlledReadableStream;\n if (IsReadableStreamLocked(stream) && ReadableStreamGetNumReadRequests(stream) > 0) {\n ReadableStreamFulfillReadRequest(stream, chunk, false);\n }\n else {\n var chunkSize = void 0;\n try {\n chunkSize = controller._strategySizeAlgorithm(chunk);\n }\n catch (chunkSizeE) {\n ReadableStreamDefaultControllerError(controller, chunkSizeE);\n throw chunkSizeE;\n }\n try {\n EnqueueValueWithSize(controller, chunk, chunkSize);\n }\n catch (enqueueE) {\n ReadableStreamDefaultControllerError(controller, enqueueE);\n throw enqueueE;\n }\n }\n ReadableStreamDefaultControllerCallPullIfNeeded(controller);\n }\n function ReadableStreamDefaultControllerError(controller, e) {\n var stream = controller._controlledReadableStream;\n if (stream._state !== 'readable') {\n return;\n }\n ResetQueue(controller);\n ReadableStreamDefaultControllerClearAlgorithms(controller);\n ReadableStreamError(stream, e);\n }\n function ReadableStreamDefaultControllerGetDesiredSize(controller) {\n var state = controller._controlledReadableStream._state;\n if (state === 'errored') {\n return null;\n }\n if (state === 'closed') {\n return 0;\n }\n return controller._strategyHWM - controller._queueTotalSize;\n }\n // This is used in the implementation of TransformStream.\n function ReadableStreamDefaultControllerHasBackpressure(controller) {\n if (ReadableStreamDefaultControllerShouldCallPull(controller)) {\n return false;\n }\n return true;\n }\n function ReadableStreamDefaultControllerCanCloseOrEnqueue(controller) {\n var state = controller._controlledReadableStream._state;\n if (!controller._closeRequested && state === 'readable') {\n return true;\n }\n return false;\n }\n function SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm) {\n controller._controlledReadableStream = stream;\n controller._queue = undefined;\n controller._queueTotalSize = undefined;\n ResetQueue(controller);\n controller._started = false;\n controller._closeRequested = false;\n controller._pullAgain = false;\n controller._pulling = false;\n controller._strategySizeAlgorithm = sizeAlgorithm;\n controller._strategyHWM = highWaterMark;\n controller._pullAlgorithm = pullAlgorithm;\n controller._cancelAlgorithm = cancelAlgorithm;\n stream._readableStreamController = controller;\n var startResult = startAlgorithm();\n uponPromise(promiseResolvedWith(startResult), function () {\n controller._started = true;\n ReadableStreamDefaultControllerCallPullIfNeeded(controller);\n }, function (r) {\n ReadableStreamDefaultControllerError(controller, r);\n });\n }\n function SetUpReadableStreamDefaultControllerFromUnderlyingSource(stream, underlyingSource, highWaterMark, sizeAlgorithm) {\n var controller = Object.create(ReadableStreamDefaultController.prototype);\n var startAlgorithm = function () { return undefined; };\n var pullAlgorithm = function () { return promiseResolvedWith(undefined); };\n var cancelAlgorithm = function () { return promiseResolvedWith(undefined); };\n if (underlyingSource.start !== undefined) {\n startAlgorithm = function () { return underlyingSource.start(controller); };\n }\n if (underlyingSource.pull !== undefined) {\n pullAlgorithm = function () { return underlyingSource.pull(controller); };\n }\n if (underlyingSource.cancel !== undefined) {\n cancelAlgorithm = function (reason) { return underlyingSource.cancel(reason); };\n }\n SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm);\n }\n // Helper functions for the ReadableStreamDefaultController.\n function defaultControllerBrandCheckException$1(name) {\n return new TypeError(\"ReadableStreamDefaultController.prototype.\" + name + \" can only be used on a ReadableStreamDefaultController\");\n }\n\n function ReadableStreamTee(stream, cloneForBranch2) {\n if (IsReadableByteStreamController(stream._readableStreamController)) {\n return ReadableByteStreamTee(stream);\n }\n return ReadableStreamDefaultTee(stream);\n }\n function ReadableStreamDefaultTee(stream, cloneForBranch2) {\n var reader = AcquireReadableStreamDefaultReader(stream);\n var reading = false;\n var readAgain = false;\n var canceled1 = false;\n var canceled2 = false;\n var reason1;\n var reason2;\n var branch1;\n var branch2;\n var resolveCancelPromise;\n var cancelPromise = newPromise(function (resolve) {\n resolveCancelPromise = resolve;\n });\n function pullAlgorithm() {\n if (reading) {\n readAgain = true;\n return promiseResolvedWith(undefined);\n }\n reading = true;\n var readRequest = {\n _chunkSteps: function (chunk) {\n // This needs to be delayed a microtask because it takes at least a microtask to detect errors (using\n // reader._closedPromise below), and we want errors in stream to error both branches immediately. We cannot let\n // successful synchronously-available reads get ahead of asynchronously-available errors.\n queueMicrotask(function () {\n readAgain = false;\n var chunk1 = chunk;\n var chunk2 = chunk;\n // There is no way to access the cloning code right now in the reference implementation.\n // If we add one then we'll need an implementation for serializable objects.\n // if (!canceled2 && cloneForBranch2) {\n // chunk2 = StructuredDeserialize(StructuredSerialize(chunk2));\n // }\n if (!canceled1) {\n ReadableStreamDefaultControllerEnqueue(branch1._readableStreamController, chunk1);\n }\n if (!canceled2) {\n ReadableStreamDefaultControllerEnqueue(branch2._readableStreamController, chunk2);\n }\n reading = false;\n if (readAgain) {\n pullAlgorithm();\n }\n });\n },\n _closeSteps: function () {\n reading = false;\n if (!canceled1) {\n ReadableStreamDefaultControllerClose(branch1._readableStreamController);\n }\n if (!canceled2) {\n ReadableStreamDefaultControllerClose(branch2._readableStreamController);\n }\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n },\n _errorSteps: function () {\n reading = false;\n }\n };\n ReadableStreamDefaultReaderRead(reader, readRequest);\n return promiseResolvedWith(undefined);\n }\n function cancel1Algorithm(reason) {\n canceled1 = true;\n reason1 = reason;\n if (canceled2) {\n var compositeReason = CreateArrayFromList([reason1, reason2]);\n var cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n function cancel2Algorithm(reason) {\n canceled2 = true;\n reason2 = reason;\n if (canceled1) {\n var compositeReason = CreateArrayFromList([reason1, reason2]);\n var cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n function startAlgorithm() {\n // do nothing\n }\n branch1 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel1Algorithm);\n branch2 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel2Algorithm);\n uponRejection(reader._closedPromise, function (r) {\n ReadableStreamDefaultControllerError(branch1._readableStreamController, r);\n ReadableStreamDefaultControllerError(branch2._readableStreamController, r);\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n });\n return [branch1, branch2];\n }\n function ReadableByteStreamTee(stream) {\n var reader = AcquireReadableStreamDefaultReader(stream);\n var reading = false;\n var readAgainForBranch1 = false;\n var readAgainForBranch2 = false;\n var canceled1 = false;\n var canceled2 = false;\n var reason1;\n var reason2;\n var branch1;\n var branch2;\n var resolveCancelPromise;\n var cancelPromise = newPromise(function (resolve) {\n resolveCancelPromise = resolve;\n });\n function forwardReaderError(thisReader) {\n uponRejection(thisReader._closedPromise, function (r) {\n if (thisReader !== reader) {\n return;\n }\n ReadableByteStreamControllerError(branch1._readableStreamController, r);\n ReadableByteStreamControllerError(branch2._readableStreamController, r);\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n });\n }\n function pullWithDefaultReader() {\n if (IsReadableStreamBYOBReader(reader)) {\n ReadableStreamReaderGenericRelease(reader);\n reader = AcquireReadableStreamDefaultReader(stream);\n forwardReaderError(reader);\n }\n var readRequest = {\n _chunkSteps: function (chunk) {\n // This needs to be delayed a microtask because it takes at least a microtask to detect errors (using\n // reader._closedPromise below), and we want errors in stream to error both branches immediately. We cannot let\n // successful synchronously-available reads get ahead of asynchronously-available errors.\n queueMicrotask(function () {\n readAgainForBranch1 = false;\n readAgainForBranch2 = false;\n var chunk1 = chunk;\n var chunk2 = chunk;\n if (!canceled1 && !canceled2) {\n try {\n chunk2 = CloneAsUint8Array(chunk);\n }\n catch (cloneE) {\n ReadableByteStreamControllerError(branch1._readableStreamController, cloneE);\n ReadableByteStreamControllerError(branch2._readableStreamController, cloneE);\n resolveCancelPromise(ReadableStreamCancel(stream, cloneE));\n return;\n }\n }\n if (!canceled1) {\n ReadableByteStreamControllerEnqueue(branch1._readableStreamController, chunk1);\n }\n if (!canceled2) {\n ReadableByteStreamControllerEnqueue(branch2._readableStreamController, chunk2);\n }\n reading = false;\n if (readAgainForBranch1) {\n pull1Algorithm();\n }\n else if (readAgainForBranch2) {\n pull2Algorithm();\n }\n });\n },\n _closeSteps: function () {\n reading = false;\n if (!canceled1) {\n ReadableByteStreamControllerClose(branch1._readableStreamController);\n }\n if (!canceled2) {\n ReadableByteStreamControllerClose(branch2._readableStreamController);\n }\n if (branch1._readableStreamController._pendingPullIntos.length > 0) {\n ReadableByteStreamControllerRespond(branch1._readableStreamController, 0);\n }\n if (branch2._readableStreamController._pendingPullIntos.length > 0) {\n ReadableByteStreamControllerRespond(branch2._readableStreamController, 0);\n }\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n },\n _errorSteps: function () {\n reading = false;\n }\n };\n ReadableStreamDefaultReaderRead(reader, readRequest);\n }\n function pullWithBYOBReader(view, forBranch2) {\n if (IsReadableStreamDefaultReader(reader)) {\n ReadableStreamReaderGenericRelease(reader);\n reader = AcquireReadableStreamBYOBReader(stream);\n forwardReaderError(reader);\n }\n var byobBranch = forBranch2 ? branch2 : branch1;\n var otherBranch = forBranch2 ? branch1 : branch2;\n var readIntoRequest = {\n _chunkSteps: function (chunk) {\n // This needs to be delayed a microtask because it takes at least a microtask to detect errors (using\n // reader._closedPromise below), and we want errors in stream to error both branches immediately. We cannot let\n // successful synchronously-available reads get ahead of asynchronously-available errors.\n queueMicrotask(function () {\n readAgainForBranch1 = false;\n readAgainForBranch2 = false;\n var byobCanceled = forBranch2 ? canceled2 : canceled1;\n var otherCanceled = forBranch2 ? canceled1 : canceled2;\n if (!otherCanceled) {\n var clonedChunk = void 0;\n try {\n clonedChunk = CloneAsUint8Array(chunk);\n }\n catch (cloneE) {\n ReadableByteStreamControllerError(byobBranch._readableStreamController, cloneE);\n ReadableByteStreamControllerError(otherBranch._readableStreamController, cloneE);\n resolveCancelPromise(ReadableStreamCancel(stream, cloneE));\n return;\n }\n if (!byobCanceled) {\n ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk);\n }\n ReadableByteStreamControllerEnqueue(otherBranch._readableStreamController, clonedChunk);\n }\n else if (!byobCanceled) {\n ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk);\n }\n reading = false;\n if (readAgainForBranch1) {\n pull1Algorithm();\n }\n else if (readAgainForBranch2) {\n pull2Algorithm();\n }\n });\n },\n _closeSteps: function (chunk) {\n reading = false;\n var byobCanceled = forBranch2 ? canceled2 : canceled1;\n var otherCanceled = forBranch2 ? canceled1 : canceled2;\n if (!byobCanceled) {\n ReadableByteStreamControllerClose(byobBranch._readableStreamController);\n }\n if (!otherCanceled) {\n ReadableByteStreamControllerClose(otherBranch._readableStreamController);\n }\n if (chunk !== undefined) {\n if (!byobCanceled) {\n ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk);\n }\n if (!otherCanceled && otherBranch._readableStreamController._pendingPullIntos.length > 0) {\n ReadableByteStreamControllerRespond(otherBranch._readableStreamController, 0);\n }\n }\n if (!byobCanceled || !otherCanceled) {\n resolveCancelPromise(undefined);\n }\n },\n _errorSteps: function () {\n reading = false;\n }\n };\n ReadableStreamBYOBReaderRead(reader, view, readIntoRequest);\n }\n function pull1Algorithm() {\n if (reading) {\n readAgainForBranch1 = true;\n return promiseResolvedWith(undefined);\n }\n reading = true;\n var byobRequest = ReadableByteStreamControllerGetBYOBRequest(branch1._readableStreamController);\n if (byobRequest === null) {\n pullWithDefaultReader();\n }\n else {\n pullWithBYOBReader(byobRequest._view, false);\n }\n return promiseResolvedWith(undefined);\n }\n function pull2Algorithm() {\n if (reading) {\n readAgainForBranch2 = true;\n return promiseResolvedWith(undefined);\n }\n reading = true;\n var byobRequest = ReadableByteStreamControllerGetBYOBRequest(branch2._readableStreamController);\n if (byobRequest === null) {\n pullWithDefaultReader();\n }\n else {\n pullWithBYOBReader(byobRequest._view, true);\n }\n return promiseResolvedWith(undefined);\n }\n function cancel1Algorithm(reason) {\n canceled1 = true;\n reason1 = reason;\n if (canceled2) {\n var compositeReason = CreateArrayFromList([reason1, reason2]);\n var cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n function cancel2Algorithm(reason) {\n canceled2 = true;\n reason2 = reason;\n if (canceled1) {\n var compositeReason = CreateArrayFromList([reason1, reason2]);\n var cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n function startAlgorithm() {\n return;\n }\n branch1 = CreateReadableByteStream(startAlgorithm, pull1Algorithm, cancel1Algorithm);\n branch2 = CreateReadableByteStream(startAlgorithm, pull2Algorithm, cancel2Algorithm);\n forwardReaderError(reader);\n return [branch1, branch2];\n }\n\n function convertUnderlyingDefaultOrByteSource(source, context) {\n assertDictionary(source, context);\n var original = source;\n var autoAllocateChunkSize = original === null || original === void 0 ? void 0 : original.autoAllocateChunkSize;\n var cancel = original === null || original === void 0 ? void 0 : original.cancel;\n var pull = original === null || original === void 0 ? void 0 : original.pull;\n var start = original === null || original === void 0 ? void 0 : original.start;\n var type = original === null || original === void 0 ? void 0 : original.type;\n return {\n autoAllocateChunkSize: autoAllocateChunkSize === undefined ?\n undefined :\n convertUnsignedLongLongWithEnforceRange(autoAllocateChunkSize, context + \" has member 'autoAllocateChunkSize' that\"),\n cancel: cancel === undefined ?\n undefined :\n convertUnderlyingSourceCancelCallback(cancel, original, context + \" has member 'cancel' that\"),\n pull: pull === undefined ?\n undefined :\n convertUnderlyingSourcePullCallback(pull, original, context + \" has member 'pull' that\"),\n start: start === undefined ?\n undefined :\n convertUnderlyingSourceStartCallback(start, original, context + \" has member 'start' that\"),\n type: type === undefined ? undefined : convertReadableStreamType(type, context + \" has member 'type' that\")\n };\n }\n function convertUnderlyingSourceCancelCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (reason) { return promiseCall(fn, original, [reason]); };\n }\n function convertUnderlyingSourcePullCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (controller) { return promiseCall(fn, original, [controller]); };\n }\n function convertUnderlyingSourceStartCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (controller) { return reflectCall(fn, original, [controller]); };\n }\n function convertReadableStreamType(type, context) {\n type = \"\" + type;\n if (type !== 'bytes') {\n throw new TypeError(context + \" '\" + type + \"' is not a valid enumeration value for ReadableStreamType\");\n }\n return type;\n }\n\n function convertReaderOptions(options, context) {\n assertDictionary(options, context);\n var mode = options === null || options === void 0 ? void 0 : options.mode;\n return {\n mode: mode === undefined ? undefined : convertReadableStreamReaderMode(mode, context + \" has member 'mode' that\")\n };\n }\n function convertReadableStreamReaderMode(mode, context) {\n mode = \"\" + mode;\n if (mode !== 'byob') {\n throw new TypeError(context + \" '\" + mode + \"' is not a valid enumeration value for ReadableStreamReaderMode\");\n }\n return mode;\n }\n\n function convertIteratorOptions(options, context) {\n assertDictionary(options, context);\n var preventCancel = options === null || options === void 0 ? void 0 : options.preventCancel;\n return { preventCancel: Boolean(preventCancel) };\n }\n\n function convertPipeOptions(options, context) {\n assertDictionary(options, context);\n var preventAbort = options === null || options === void 0 ? void 0 : options.preventAbort;\n var preventCancel = options === null || options === void 0 ? void 0 : options.preventCancel;\n var preventClose = options === null || options === void 0 ? void 0 : options.preventClose;\n var signal = options === null || options === void 0 ? void 0 : options.signal;\n if (signal !== undefined) {\n assertAbortSignal(signal, context + \" has member 'signal' that\");\n }\n return {\n preventAbort: Boolean(preventAbort),\n preventCancel: Boolean(preventCancel),\n preventClose: Boolean(preventClose),\n signal: signal\n };\n }\n function assertAbortSignal(signal, context) {\n if (!isAbortSignal(signal)) {\n throw new TypeError(context + \" is not an AbortSignal.\");\n }\n }\n\n function convertReadableWritablePair(pair, context) {\n assertDictionary(pair, context);\n var readable = pair === null || pair === void 0 ? void 0 : pair.readable;\n assertRequiredField(readable, 'readable', 'ReadableWritablePair');\n assertReadableStream(readable, context + \" has member 'readable' that\");\n var writable = pair === null || pair === void 0 ? void 0 : pair.writable;\n assertRequiredField(writable, 'writable', 'ReadableWritablePair');\n assertWritableStream(writable, context + \" has member 'writable' that\");\n return { readable: readable, writable: writable };\n }\n\n /**\n * A readable stream represents a source of data, from which you can read.\n *\n * @public\n */\n var ReadableStream = /** @class */ (function () {\n function ReadableStream(rawUnderlyingSource, rawStrategy) {\n if (rawUnderlyingSource === void 0) { rawUnderlyingSource = {}; }\n if (rawStrategy === void 0) { rawStrategy = {}; }\n if (rawUnderlyingSource === undefined) {\n rawUnderlyingSource = null;\n }\n else {\n assertObject(rawUnderlyingSource, 'First parameter');\n }\n var strategy = convertQueuingStrategy(rawStrategy, 'Second parameter');\n var underlyingSource = convertUnderlyingDefaultOrByteSource(rawUnderlyingSource, 'First parameter');\n InitializeReadableStream(this);\n if (underlyingSource.type === 'bytes') {\n if (strategy.size !== undefined) {\n throw new RangeError('The strategy for a byte stream cannot have a size function');\n }\n var highWaterMark = ExtractHighWaterMark(strategy, 0);\n SetUpReadableByteStreamControllerFromUnderlyingSource(this, underlyingSource, highWaterMark);\n }\n else {\n var sizeAlgorithm = ExtractSizeAlgorithm(strategy);\n var highWaterMark = ExtractHighWaterMark(strategy, 1);\n SetUpReadableStreamDefaultControllerFromUnderlyingSource(this, underlyingSource, highWaterMark, sizeAlgorithm);\n }\n }\n Object.defineProperty(ReadableStream.prototype, \"locked\", {\n /**\n * Whether or not the readable stream is locked to a {@link ReadableStreamDefaultReader | reader}.\n */\n get: function () {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('locked');\n }\n return IsReadableStreamLocked(this);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Cancels the stream, signaling a loss of interest in the stream by a consumer.\n *\n * The supplied `reason` argument will be given to the underlying source's {@link UnderlyingSource.cancel | cancel()}\n * method, which might or might not use it.\n */\n ReadableStream.prototype.cancel = function (reason) {\n if (reason === void 0) { reason = undefined; }\n if (!IsReadableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException$1('cancel'));\n }\n if (IsReadableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError('Cannot cancel a stream that already has a reader'));\n }\n return ReadableStreamCancel(this, reason);\n };\n ReadableStream.prototype.getReader = function (rawOptions) {\n if (rawOptions === void 0) { rawOptions = undefined; }\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('getReader');\n }\n var options = convertReaderOptions(rawOptions, 'First parameter');\n if (options.mode === undefined) {\n return AcquireReadableStreamDefaultReader(this);\n }\n return AcquireReadableStreamBYOBReader(this);\n };\n ReadableStream.prototype.pipeThrough = function (rawTransform, rawOptions) {\n if (rawOptions === void 0) { rawOptions = {}; }\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('pipeThrough');\n }\n assertRequiredArgument(rawTransform, 1, 'pipeThrough');\n var transform = convertReadableWritablePair(rawTransform, 'First parameter');\n var options = convertPipeOptions(rawOptions, 'Second parameter');\n if (IsReadableStreamLocked(this)) {\n throw new TypeError('ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream');\n }\n if (IsWritableStreamLocked(transform.writable)) {\n throw new TypeError('ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream');\n }\n var promise = ReadableStreamPipeTo(this, transform.writable, options.preventClose, options.preventAbort, options.preventCancel, options.signal);\n setPromiseIsHandledToTrue(promise);\n return transform.readable;\n };\n ReadableStream.prototype.pipeTo = function (destination, rawOptions) {\n if (rawOptions === void 0) { rawOptions = {}; }\n if (!IsReadableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException$1('pipeTo'));\n }\n if (destination === undefined) {\n return promiseRejectedWith(\"Parameter 1 is required in 'pipeTo'.\");\n }\n if (!IsWritableStream(destination)) {\n return promiseRejectedWith(new TypeError(\"ReadableStream.prototype.pipeTo's first argument must be a WritableStream\"));\n }\n var options;\n try {\n options = convertPipeOptions(rawOptions, 'Second parameter');\n }\n catch (e) {\n return promiseRejectedWith(e);\n }\n if (IsReadableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError('ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream'));\n }\n if (IsWritableStreamLocked(destination)) {\n return promiseRejectedWith(new TypeError('ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream'));\n }\n return ReadableStreamPipeTo(this, destination, options.preventClose, options.preventAbort, options.preventCancel, options.signal);\n };\n /**\n * Tees this readable stream, returning a two-element array containing the two resulting branches as\n * new {@link ReadableStream} instances.\n *\n * Teeing a stream will lock it, preventing any other consumer from acquiring a reader.\n * To cancel the stream, cancel both of the resulting branches; a composite cancellation reason will then be\n * propagated to the stream's underlying source.\n *\n * Note that the chunks seen in each branch will be the same object. If the chunks are not immutable,\n * this could allow interference between the two branches.\n */\n ReadableStream.prototype.tee = function () {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('tee');\n }\n var branches = ReadableStreamTee(this);\n return CreateArrayFromList(branches);\n };\n ReadableStream.prototype.values = function (rawOptions) {\n if (rawOptions === void 0) { rawOptions = undefined; }\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('values');\n }\n var options = convertIteratorOptions(rawOptions, 'First parameter');\n return AcquireReadableStreamAsyncIterator(this, options.preventCancel);\n };\n return ReadableStream;\n }());\n Object.defineProperties(ReadableStream.prototype, {\n cancel: { enumerable: true },\n getReader: { enumerable: true },\n pipeThrough: { enumerable: true },\n pipeTo: { enumerable: true },\n tee: { enumerable: true },\n values: { enumerable: true },\n locked: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStream.prototype, SymbolPolyfill.toStringTag, {\n value: 'ReadableStream',\n configurable: true\n });\n }\n if (typeof SymbolPolyfill.asyncIterator === 'symbol') {\n Object.defineProperty(ReadableStream.prototype, SymbolPolyfill.asyncIterator, {\n value: ReadableStream.prototype.values,\n writable: true,\n configurable: true\n });\n }\n // Abstract operations for the ReadableStream.\n // Throws if and only if startAlgorithm throws.\n function CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm) {\n if (highWaterMark === void 0) { highWaterMark = 1; }\n if (sizeAlgorithm === void 0) { sizeAlgorithm = function () { return 1; }; }\n var stream = Object.create(ReadableStream.prototype);\n InitializeReadableStream(stream);\n var controller = Object.create(ReadableStreamDefaultController.prototype);\n SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm);\n return stream;\n }\n // Throws if and only if startAlgorithm throws.\n function CreateReadableByteStream(startAlgorithm, pullAlgorithm, cancelAlgorithm) {\n var stream = Object.create(ReadableStream.prototype);\n InitializeReadableStream(stream);\n var controller = Object.create(ReadableByteStreamController.prototype);\n SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, 0, undefined);\n return stream;\n }\n function InitializeReadableStream(stream) {\n stream._state = 'readable';\n stream._reader = undefined;\n stream._storedError = undefined;\n stream._disturbed = false;\n }\n function IsReadableStream(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_readableStreamController')) {\n return false;\n }\n return x instanceof ReadableStream;\n }\n function IsReadableStreamLocked(stream) {\n if (stream._reader === undefined) {\n return false;\n }\n return true;\n }\n // ReadableStream API exposed for controllers.\n function ReadableStreamCancel(stream, reason) {\n stream._disturbed = true;\n if (stream._state === 'closed') {\n return promiseResolvedWith(undefined);\n }\n if (stream._state === 'errored') {\n return promiseRejectedWith(stream._storedError);\n }\n ReadableStreamClose(stream);\n var reader = stream._reader;\n if (reader !== undefined && IsReadableStreamBYOBReader(reader)) {\n reader._readIntoRequests.forEach(function (readIntoRequest) {\n readIntoRequest._closeSteps(undefined);\n });\n reader._readIntoRequests = new SimpleQueue();\n }\n var sourceCancelPromise = stream._readableStreamController[CancelSteps](reason);\n return transformPromiseWith(sourceCancelPromise, noop);\n }\n function ReadableStreamClose(stream) {\n stream._state = 'closed';\n var reader = stream._reader;\n if (reader === undefined) {\n return;\n }\n defaultReaderClosedPromiseResolve(reader);\n if (IsReadableStreamDefaultReader(reader)) {\n reader._readRequests.forEach(function (readRequest) {\n readRequest._closeSteps();\n });\n reader._readRequests = new SimpleQueue();\n }\n }\n function ReadableStreamError(stream, e) {\n stream._state = 'errored';\n stream._storedError = e;\n var reader = stream._reader;\n if (reader === undefined) {\n return;\n }\n defaultReaderClosedPromiseReject(reader, e);\n if (IsReadableStreamDefaultReader(reader)) {\n reader._readRequests.forEach(function (readRequest) {\n readRequest._errorSteps(e);\n });\n reader._readRequests = new SimpleQueue();\n }\n else {\n reader._readIntoRequests.forEach(function (readIntoRequest) {\n readIntoRequest._errorSteps(e);\n });\n reader._readIntoRequests = new SimpleQueue();\n }\n }\n // Helper functions for the ReadableStream.\n function streamBrandCheckException$1(name) {\n return new TypeError(\"ReadableStream.prototype.\" + name + \" can only be used on a ReadableStream\");\n }\n\n function convertQueuingStrategyInit(init, context) {\n assertDictionary(init, context);\n var highWaterMark = init === null || init === void 0 ? void 0 : init.highWaterMark;\n assertRequiredField(highWaterMark, 'highWaterMark', 'QueuingStrategyInit');\n return {\n highWaterMark: convertUnrestrictedDouble(highWaterMark)\n };\n }\n\n // The size function must not have a prototype property nor be a constructor\n var byteLengthSizeFunction = function (chunk) {\n return chunk.byteLength;\n };\n try {\n Object.defineProperty(byteLengthSizeFunction, 'name', {\n value: 'size',\n configurable: true\n });\n }\n catch (_a) {\n // This property is non-configurable in older browsers, so ignore if this throws.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name#browser_compatibility\n }\n /**\n * A queuing strategy that counts the number of bytes in each chunk.\n *\n * @public\n */\n var ByteLengthQueuingStrategy = /** @class */ (function () {\n function ByteLengthQueuingStrategy(options) {\n assertRequiredArgument(options, 1, 'ByteLengthQueuingStrategy');\n options = convertQueuingStrategyInit(options, 'First parameter');\n this._byteLengthQueuingStrategyHighWaterMark = options.highWaterMark;\n }\n Object.defineProperty(ByteLengthQueuingStrategy.prototype, \"highWaterMark\", {\n /**\n * Returns the high water mark provided to the constructor.\n */\n get: function () {\n if (!IsByteLengthQueuingStrategy(this)) {\n throw byteLengthBrandCheckException('highWaterMark');\n }\n return this._byteLengthQueuingStrategyHighWaterMark;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ByteLengthQueuingStrategy.prototype, \"size\", {\n /**\n * Measures the size of `chunk` by returning the value of its `byteLength` property.\n */\n get: function () {\n if (!IsByteLengthQueuingStrategy(this)) {\n throw byteLengthBrandCheckException('size');\n }\n return byteLengthSizeFunction;\n },\n enumerable: false,\n configurable: true\n });\n return ByteLengthQueuingStrategy;\n }());\n Object.defineProperties(ByteLengthQueuingStrategy.prototype, {\n highWaterMark: { enumerable: true },\n size: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ByteLengthQueuingStrategy.prototype, SymbolPolyfill.toStringTag, {\n value: 'ByteLengthQueuingStrategy',\n configurable: true\n });\n }\n // Helper functions for the ByteLengthQueuingStrategy.\n function byteLengthBrandCheckException(name) {\n return new TypeError(\"ByteLengthQueuingStrategy.prototype.\" + name + \" can only be used on a ByteLengthQueuingStrategy\");\n }\n function IsByteLengthQueuingStrategy(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_byteLengthQueuingStrategyHighWaterMark')) {\n return false;\n }\n return x instanceof ByteLengthQueuingStrategy;\n }\n\n // The size function must not have a prototype property nor be a constructor\n var countSizeFunction = function () {\n return 1;\n };\n try {\n Object.defineProperty(countSizeFunction, 'name', {\n value: 'size',\n configurable: true\n });\n }\n catch (_a) {\n // This property is non-configurable in older browsers, so ignore if this throws.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name#browser_compatibility\n }\n /**\n * A queuing strategy that counts the number of chunks.\n *\n * @public\n */\n var CountQueuingStrategy = /** @class */ (function () {\n function CountQueuingStrategy(options) {\n assertRequiredArgument(options, 1, 'CountQueuingStrategy');\n options = convertQueuingStrategyInit(options, 'First parameter');\n this._countQueuingStrategyHighWaterMark = options.highWaterMark;\n }\n Object.defineProperty(CountQueuingStrategy.prototype, \"highWaterMark\", {\n /**\n * Returns the high water mark provided to the constructor.\n */\n get: function () {\n if (!IsCountQueuingStrategy(this)) {\n throw countBrandCheckException('highWaterMark');\n }\n return this._countQueuingStrategyHighWaterMark;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CountQueuingStrategy.prototype, \"size\", {\n /**\n * Measures the size of `chunk` by always returning 1.\n * This ensures that the total queue size is a count of the number of chunks in the queue.\n */\n get: function () {\n if (!IsCountQueuingStrategy(this)) {\n throw countBrandCheckException('size');\n }\n return countSizeFunction;\n },\n enumerable: false,\n configurable: true\n });\n return CountQueuingStrategy;\n }());\n Object.defineProperties(CountQueuingStrategy.prototype, {\n highWaterMark: { enumerable: true },\n size: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(CountQueuingStrategy.prototype, SymbolPolyfill.toStringTag, {\n value: 'CountQueuingStrategy',\n configurable: true\n });\n }\n // Helper functions for the CountQueuingStrategy.\n function countBrandCheckException(name) {\n return new TypeError(\"CountQueuingStrategy.prototype.\" + name + \" can only be used on a CountQueuingStrategy\");\n }\n function IsCountQueuingStrategy(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_countQueuingStrategyHighWaterMark')) {\n return false;\n }\n return x instanceof CountQueuingStrategy;\n }\n\n function convertTransformer(original, context) {\n assertDictionary(original, context);\n var flush = original === null || original === void 0 ? void 0 : original.flush;\n var readableType = original === null || original === void 0 ? void 0 : original.readableType;\n var start = original === null || original === void 0 ? void 0 : original.start;\n var transform = original === null || original === void 0 ? void 0 : original.transform;\n var writableType = original === null || original === void 0 ? void 0 : original.writableType;\n return {\n flush: flush === undefined ?\n undefined :\n convertTransformerFlushCallback(flush, original, context + \" has member 'flush' that\"),\n readableType: readableType,\n start: start === undefined ?\n undefined :\n convertTransformerStartCallback(start, original, context + \" has member 'start' that\"),\n transform: transform === undefined ?\n undefined :\n convertTransformerTransformCallback(transform, original, context + \" has member 'transform' that\"),\n writableType: writableType\n };\n }\n function convertTransformerFlushCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (controller) { return promiseCall(fn, original, [controller]); };\n }\n function convertTransformerStartCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (controller) { return reflectCall(fn, original, [controller]); };\n }\n function convertTransformerTransformCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (chunk, controller) { return promiseCall(fn, original, [chunk, controller]); };\n }\n\n // Class TransformStream\n /**\n * A transform stream consists of a pair of streams: a {@link WritableStream | writable stream},\n * known as its writable side, and a {@link ReadableStream | readable stream}, known as its readable side.\n * In a manner specific to the transform stream in question, writes to the writable side result in new data being\n * made available for reading from the readable side.\n *\n * @public\n */\n var TransformStream = /** @class */ (function () {\n function TransformStream(rawTransformer, rawWritableStrategy, rawReadableStrategy) {\n if (rawTransformer === void 0) { rawTransformer = {}; }\n if (rawWritableStrategy === void 0) { rawWritableStrategy = {}; }\n if (rawReadableStrategy === void 0) { rawReadableStrategy = {}; }\n if (rawTransformer === undefined) {\n rawTransformer = null;\n }\n var writableStrategy = convertQueuingStrategy(rawWritableStrategy, 'Second parameter');\n var readableStrategy = convertQueuingStrategy(rawReadableStrategy, 'Third parameter');\n var transformer = convertTransformer(rawTransformer, 'First parameter');\n if (transformer.readableType !== undefined) {\n throw new RangeError('Invalid readableType specified');\n }\n if (transformer.writableType !== undefined) {\n throw new RangeError('Invalid writableType specified');\n }\n var readableHighWaterMark = ExtractHighWaterMark(readableStrategy, 0);\n var readableSizeAlgorithm = ExtractSizeAlgorithm(readableStrategy);\n var writableHighWaterMark = ExtractHighWaterMark(writableStrategy, 1);\n var writableSizeAlgorithm = ExtractSizeAlgorithm(writableStrategy);\n var startPromise_resolve;\n var startPromise = newPromise(function (resolve) {\n startPromise_resolve = resolve;\n });\n InitializeTransformStream(this, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm);\n SetUpTransformStreamDefaultControllerFromTransformer(this, transformer);\n if (transformer.start !== undefined) {\n startPromise_resolve(transformer.start(this._transformStreamController));\n }\n else {\n startPromise_resolve(undefined);\n }\n }\n Object.defineProperty(TransformStream.prototype, \"readable\", {\n /**\n * The readable side of the transform stream.\n */\n get: function () {\n if (!IsTransformStream(this)) {\n throw streamBrandCheckException('readable');\n }\n return this._readable;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TransformStream.prototype, \"writable\", {\n /**\n * The writable side of the transform stream.\n */\n get: function () {\n if (!IsTransformStream(this)) {\n throw streamBrandCheckException('writable');\n }\n return this._writable;\n },\n enumerable: false,\n configurable: true\n });\n return TransformStream;\n }());\n Object.defineProperties(TransformStream.prototype, {\n readable: { enumerable: true },\n writable: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(TransformStream.prototype, SymbolPolyfill.toStringTag, {\n value: 'TransformStream',\n configurable: true\n });\n }\n function InitializeTransformStream(stream, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm) {\n function startAlgorithm() {\n return startPromise;\n }\n function writeAlgorithm(chunk) {\n return TransformStreamDefaultSinkWriteAlgorithm(stream, chunk);\n }\n function abortAlgorithm(reason) {\n return TransformStreamDefaultSinkAbortAlgorithm(stream, reason);\n }\n function closeAlgorithm() {\n return TransformStreamDefaultSinkCloseAlgorithm(stream);\n }\n stream._writable = CreateWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, writableHighWaterMark, writableSizeAlgorithm);\n function pullAlgorithm() {\n return TransformStreamDefaultSourcePullAlgorithm(stream);\n }\n function cancelAlgorithm(reason) {\n TransformStreamErrorWritableAndUnblockWrite(stream, reason);\n return promiseResolvedWith(undefined);\n }\n stream._readable = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, readableHighWaterMark, readableSizeAlgorithm);\n // The [[backpressure]] slot is set to undefined so that it can be initialised by TransformStreamSetBackpressure.\n stream._backpressure = undefined;\n stream._backpressureChangePromise = undefined;\n stream._backpressureChangePromise_resolve = undefined;\n TransformStreamSetBackpressure(stream, true);\n stream._transformStreamController = undefined;\n }\n function IsTransformStream(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_transformStreamController')) {\n return false;\n }\n return x instanceof TransformStream;\n }\n // This is a no-op if both sides are already errored.\n function TransformStreamError(stream, e) {\n ReadableStreamDefaultControllerError(stream._readable._readableStreamController, e);\n TransformStreamErrorWritableAndUnblockWrite(stream, e);\n }\n function TransformStreamErrorWritableAndUnblockWrite(stream, e) {\n TransformStreamDefaultControllerClearAlgorithms(stream._transformStreamController);\n WritableStreamDefaultControllerErrorIfNeeded(stream._writable._writableStreamController, e);\n if (stream._backpressure) {\n // Pretend that pull() was called to permit any pending write() calls to complete. TransformStreamSetBackpressure()\n // cannot be called from enqueue() or pull() once the ReadableStream is errored, so this will will be the final time\n // _backpressure is set.\n TransformStreamSetBackpressure(stream, false);\n }\n }\n function TransformStreamSetBackpressure(stream, backpressure) {\n // Passes also when called during construction.\n if (stream._backpressureChangePromise !== undefined) {\n stream._backpressureChangePromise_resolve();\n }\n stream._backpressureChangePromise = newPromise(function (resolve) {\n stream._backpressureChangePromise_resolve = resolve;\n });\n stream._backpressure = backpressure;\n }\n // Class TransformStreamDefaultController\n /**\n * Allows control of the {@link ReadableStream} and {@link WritableStream} of the associated {@link TransformStream}.\n *\n * @public\n */\n var TransformStreamDefaultController = /** @class */ (function () {\n function TransformStreamDefaultController() {\n throw new TypeError('Illegal constructor');\n }\n Object.defineProperty(TransformStreamDefaultController.prototype, \"desiredSize\", {\n /**\n * Returns the desired size to fill the readable side’s internal queue. It can be negative, if the queue is over-full.\n */\n get: function () {\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('desiredSize');\n }\n var readableController = this._controlledTransformStream._readable._readableStreamController;\n return ReadableStreamDefaultControllerGetDesiredSize(readableController);\n },\n enumerable: false,\n configurable: true\n });\n TransformStreamDefaultController.prototype.enqueue = function (chunk) {\n if (chunk === void 0) { chunk = undefined; }\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('enqueue');\n }\n TransformStreamDefaultControllerEnqueue(this, chunk);\n };\n /**\n * Errors both the readable side and the writable side of the controlled transform stream, making all future\n * interactions with it fail with the given error `e`. Any chunks queued for transformation will be discarded.\n */\n TransformStreamDefaultController.prototype.error = function (reason) {\n if (reason === void 0) { reason = undefined; }\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('error');\n }\n TransformStreamDefaultControllerError(this, reason);\n };\n /**\n * Closes the readable side and errors the writable side of the controlled transform stream. This is useful when the\n * transformer only needs to consume a portion of the chunks written to the writable side.\n */\n TransformStreamDefaultController.prototype.terminate = function () {\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('terminate');\n }\n TransformStreamDefaultControllerTerminate(this);\n };\n return TransformStreamDefaultController;\n }());\n Object.defineProperties(TransformStreamDefaultController.prototype, {\n enqueue: { enumerable: true },\n error: { enumerable: true },\n terminate: { enumerable: true },\n desiredSize: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(TransformStreamDefaultController.prototype, SymbolPolyfill.toStringTag, {\n value: 'TransformStreamDefaultController',\n configurable: true\n });\n }\n // Transform Stream Default Controller Abstract Operations\n function IsTransformStreamDefaultController(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledTransformStream')) {\n return false;\n }\n return x instanceof TransformStreamDefaultController;\n }\n function SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm) {\n controller._controlledTransformStream = stream;\n stream._transformStreamController = controller;\n controller._transformAlgorithm = transformAlgorithm;\n controller._flushAlgorithm = flushAlgorithm;\n }\n function SetUpTransformStreamDefaultControllerFromTransformer(stream, transformer) {\n var controller = Object.create(TransformStreamDefaultController.prototype);\n var transformAlgorithm = function (chunk) {\n try {\n TransformStreamDefaultControllerEnqueue(controller, chunk);\n return promiseResolvedWith(undefined);\n }\n catch (transformResultE) {\n return promiseRejectedWith(transformResultE);\n }\n };\n var flushAlgorithm = function () { return promiseResolvedWith(undefined); };\n if (transformer.transform !== undefined) {\n transformAlgorithm = function (chunk) { return transformer.transform(chunk, controller); };\n }\n if (transformer.flush !== undefined) {\n flushAlgorithm = function () { return transformer.flush(controller); };\n }\n SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm);\n }\n function TransformStreamDefaultControllerClearAlgorithms(controller) {\n controller._transformAlgorithm = undefined;\n controller._flushAlgorithm = undefined;\n }\n function TransformStreamDefaultControllerEnqueue(controller, chunk) {\n var stream = controller._controlledTransformStream;\n var readableController = stream._readable._readableStreamController;\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(readableController)) {\n throw new TypeError('Readable side is not in a state that permits enqueue');\n }\n // We throttle transform invocations based on the backpressure of the ReadableStream, but we still\n // accept TransformStreamDefaultControllerEnqueue() calls.\n try {\n ReadableStreamDefaultControllerEnqueue(readableController, chunk);\n }\n catch (e) {\n // This happens when readableStrategy.size() throws.\n TransformStreamErrorWritableAndUnblockWrite(stream, e);\n throw stream._readable._storedError;\n }\n var backpressure = ReadableStreamDefaultControllerHasBackpressure(readableController);\n if (backpressure !== stream._backpressure) {\n TransformStreamSetBackpressure(stream, true);\n }\n }\n function TransformStreamDefaultControllerError(controller, e) {\n TransformStreamError(controller._controlledTransformStream, e);\n }\n function TransformStreamDefaultControllerPerformTransform(controller, chunk) {\n var transformPromise = controller._transformAlgorithm(chunk);\n return transformPromiseWith(transformPromise, undefined, function (r) {\n TransformStreamError(controller._controlledTransformStream, r);\n throw r;\n });\n }\n function TransformStreamDefaultControllerTerminate(controller) {\n var stream = controller._controlledTransformStream;\n var readableController = stream._readable._readableStreamController;\n ReadableStreamDefaultControllerClose(readableController);\n var error = new TypeError('TransformStream terminated');\n TransformStreamErrorWritableAndUnblockWrite(stream, error);\n }\n // TransformStreamDefaultSink Algorithms\n function TransformStreamDefaultSinkWriteAlgorithm(stream, chunk) {\n var controller = stream._transformStreamController;\n if (stream._backpressure) {\n var backpressureChangePromise = stream._backpressureChangePromise;\n return transformPromiseWith(backpressureChangePromise, function () {\n var writable = stream._writable;\n var state = writable._state;\n if (state === 'erroring') {\n throw writable._storedError;\n }\n return TransformStreamDefaultControllerPerformTransform(controller, chunk);\n });\n }\n return TransformStreamDefaultControllerPerformTransform(controller, chunk);\n }\n function TransformStreamDefaultSinkAbortAlgorithm(stream, reason) {\n // abort() is not called synchronously, so it is possible for abort() to be called when the stream is already\n // errored.\n TransformStreamError(stream, reason);\n return promiseResolvedWith(undefined);\n }\n function TransformStreamDefaultSinkCloseAlgorithm(stream) {\n // stream._readable cannot change after construction, so caching it across a call to user code is safe.\n var readable = stream._readable;\n var controller = stream._transformStreamController;\n var flushPromise = controller._flushAlgorithm();\n TransformStreamDefaultControllerClearAlgorithms(controller);\n // Return a promise that is fulfilled with undefined on success.\n return transformPromiseWith(flushPromise, function () {\n if (readable._state === 'errored') {\n throw readable._storedError;\n }\n ReadableStreamDefaultControllerClose(readable._readableStreamController);\n }, function (r) {\n TransformStreamError(stream, r);\n throw readable._storedError;\n });\n }\n // TransformStreamDefaultSource Algorithms\n function TransformStreamDefaultSourcePullAlgorithm(stream) {\n // Invariant. Enforced by the promises returned by start() and pull().\n TransformStreamSetBackpressure(stream, false);\n // Prevent the next pull() call until there is backpressure.\n return stream._backpressureChangePromise;\n }\n // Helper functions for the TransformStreamDefaultController.\n function defaultControllerBrandCheckException(name) {\n return new TypeError(\"TransformStreamDefaultController.prototype.\" + name + \" can only be used on a TransformStreamDefaultController\");\n }\n // Helper functions for the TransformStream.\n function streamBrandCheckException(name) {\n return new TypeError(\"TransformStream.prototype.\" + name + \" can only be used on a TransformStream\");\n }\n\n exports.ByteLengthQueuingStrategy = ByteLengthQueuingStrategy;\n exports.CountQueuingStrategy = CountQueuingStrategy;\n exports.ReadableByteStreamController = ReadableByteStreamController;\n exports.ReadableStream = ReadableStream;\n exports.ReadableStreamBYOBReader = ReadableStreamBYOBReader;\n exports.ReadableStreamBYOBRequest = ReadableStreamBYOBRequest;\n exports.ReadableStreamDefaultController = ReadableStreamDefaultController;\n exports.ReadableStreamDefaultReader = ReadableStreamDefaultReader;\n exports.TransformStream = TransformStream;\n exports.TransformStreamDefaultController = TransformStreamDefaultController;\n exports.WritableStream = WritableStream;\n exports.WritableStreamDefaultController = WritableStreamDefaultController;\n exports.WritableStreamDefaultWriter = WritableStreamDefaultWriter;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=ponyfill.js.map\n","const { getFilesFromPath } = require('files-from-path')\nconst { Web3Storage } = require('web3.storage')\n\nasync function addToWeb3 ({ endpoint, token, pathToAdd, name, wrapWithDirectory = false, includeHidden }) {\n const web3 = new Web3Storage({ endpoint, token })\n const files = await getFilesFromPath(pathToAdd, { hidden: includeHidden })\n const cid = await web3.put(files, { name, wrapWithDirectory })\n const url = `https://dweb.link/ipfs/${cid}`\n return { cid, url }\n}\n\nfunction pickName ({ repo, run, sha }) {\n return `${repo.replace('/', '-')}-${run}-${sha.substring(0, 8)}`\n}\n\nmodule.exports.addToWeb3 = addToWeb3\nmodule.exports.pickName = pickName\n",null,"'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar webEncoding = require('web-encoding');\nvar stream = require('@web-std/stream');\n\n/**\n * @implements {globalThis.Blob}\n */\nconst WebBlob = class Blob {\n /**\n * @param {BlobPart[]} [init]\n * @param {BlobPropertyBag} [options]\n */\n constructor(init = [], options = {}) {\n /** @type {Uint8Array[]} */\n const parts = [];\n\n let size = 0;\n for (const part of init) {\n if (typeof part === \"string\") {\n const bytes = new webEncoding.TextEncoder().encode(part);\n parts.push(bytes);\n size += bytes.byteLength;\n } else if (part instanceof WebBlob) {\n size += part.size;\n // @ts-ignore - `_parts` is marked private so TS will complain about\n // accessing it.\n parts.push(...part._parts);\n } else if (part instanceof ArrayBuffer) {\n parts.push(new Uint8Array(part));\n size += part.byteLength;\n } else if (part instanceof Uint8Array) {\n parts.push(part);\n size += part.byteLength;\n } else if (ArrayBuffer.isView(part)) {\n const { buffer, byteOffset, byteLength } = part;\n parts.push(new Uint8Array(buffer, byteOffset, byteLength));\n size += byteLength;\n } else {\n const bytes = new webEncoding.TextEncoder().encode(String(part));\n parts.push(bytes);\n size += bytes.byteLength;\n }\n }\n\n /** @private */\n this._size = size;\n /** @private */\n this._type = readType(options.type);\n /** @private */\n this._parts = parts;\n\n Object.defineProperties(this, {\n _size: { enumerable: false },\n _type: { enumerable: false },\n _parts: { enumerable: false },\n });\n }\n\n /**\n * A string indicating the MIME type of the data contained in the Blob.\n * If the type is unknown, this string is empty.\n * @type {string}\n */\n get type() {\n return this._type\n }\n /**\n * The size, in bytes, of the data contained in the Blob object.\n * @type {number}\n */\n get size() {\n return this._size\n }\n\n /**\n * Returns a new Blob object containing the data in the specified range of\n * bytes of the blob on which it's called.\n * @param {number} [start=0] - An index into the Blob indicating the first\n * byte to include in the new Blob. If you specify a negative value, it's\n * treated as an offset from the end of the Blob toward the beginning. For\n * example, `-10` would be the 10th from last byte in the Blob. The default\n * value is `0`. If you specify a value for start that is larger than the\n * size of the source Blob, the returned Blob has size 0 and contains no\n * data.\n * @param {number} [end] - An index into the `Blob` indicating the first byte\n * that will *not* be included in the new `Blob` (i.e. the byte exactly at\n * this index is not included). If you specify a negative value, it's treated\n * as an offset from the end of the Blob toward the beginning. For example,\n * `-10` would be the 10th from last byte in the `Blob`. The default value is\n * size.\n * @param {string} [type] - The content type to assign to the new Blob;\n * this will be the value of its type property. The default value is an empty\n * string.\n * @returns {Blob}\n */\n slice(start = 0, end = this.size, type = \"\") {\n const { size, _parts } = this;\n let offset = start < 0 ? Math.max(size + start, 0) : Math.min(start, size);\n\n let limit = end < 0 ? Math.max(size + end, 0) : Math.min(end, size);\n const span = Math.max(limit - offset, 0);\n const blob = new Blob([], { type });\n\n if (span === 0) {\n return blob\n }\n\n let blobSize = 0;\n const blobParts = [];\n for (const part of _parts) {\n const { byteLength } = part;\n if (offset > 0 && byteLength <= offset) {\n offset -= byteLength;\n limit -= byteLength;\n } else {\n const chunk = part.subarray(offset, Math.min(byteLength, limit));\n blobParts.push(chunk);\n blobSize += chunk.byteLength;\n // no longer need to take that into account\n offset = 0;\n\n // don't add the overflow to new blobParts\n if (blobSize >= span) {\n break\n }\n }\n }\n\n blob._parts = blobParts;\n blob._size = blobSize;\n\n return blob\n }\n\n /**\n * Returns a promise that resolves with an ArrayBuffer containing the entire\n * contents of the Blob as binary data.\n * @returns {Promise}\n */\n // eslint-disable-next-line require-await\n async arrayBuffer() {\n const buffer = new ArrayBuffer(this.size);\n const bytes = new Uint8Array(buffer);\n let offset = 0;\n for (const part of this._parts) {\n bytes.set(part, offset);\n offset += part.byteLength;\n }\n return buffer\n }\n\n /**\n * Returns a promise that resolves with a USVString containing the entire\n * contents of the Blob interpreted as UTF-8 text.\n * @returns {Promise}\n */\n // eslint-disable-next-line require-await\n async text() {\n const decoder = new webEncoding.TextDecoder();\n let text = \"\";\n for (const part of this._parts) {\n text += decoder.decode(part);\n }\n return text\n }\n\n /**\n * @returns {BlobStream}\n */\n stream() {\n return new BlobStream(this._parts)\n }\n\n /**\n * @returns {string}\n */\n toString() {\n return \"[object Blob]\"\n }\n\n get [Symbol.toStringTag]() {\n return \"Blob\"\n }\n};\n\n// Marking export as a DOM File object instead of custom class.\n/** @type {typeof globalThis.Blob} */\nconst Blob = WebBlob;\n\n/**\n * Blob stream is a `ReadableStream` extension optimized to have minimal\n * overhead when consumed as `AsyncIterable`.\n * @extends {ReadableStream}\n * @implements {AsyncIterable}\n */\nclass BlobStream extends stream.ReadableStream {\n /**\n * @param {Uint8Array[]} chunks\n */\n constructor(chunks) {\n // @ts-ignore\n super(new BlobStreamController(chunks.values()), { type: \"bytes\" });\n /** @private */\n this._chunks = chunks;\n }\n\n /**\n * @param {Object} [_options]\n * @property {boolean} [_options.preventCancel]\n * @returns {AsyncIterator}\n */\n async *[Symbol.asyncIterator](_options) {\n const reader = this.getReader();\n yield* this._chunks;\n reader.releaseLock();\n }\n}\n\nclass BlobStreamController {\n /**\n * @param {Iterator} chunks\n */\n constructor(chunks) {\n this.chunks = chunks;\n }\n\n /**\n * @param {ReadableStreamDefaultController} controller\n */\n start(controller) {\n this.work(controller);\n this.isWorking = false;\n this.isCancelled = false;\n }\n /**\n *\n * @param {ReadableStreamDefaultController} controller\n */\n async work(controller) {\n const { chunks } = this;\n\n this.isWorking = true;\n while (!this.isCancelled && (controller.desiredSize || 0) > 0) {\n let next = null;\n try {\n next = chunks.next();\n } catch (error) {\n controller.error(error);\n break\n }\n\n if (next) {\n if (!next.done && !this.isCancelled) {\n controller.enqueue(next.value);\n } else {\n controller.close();\n }\n }\n }\n\n this.isWorking = false;\n }\n\n /**\n * @param {ReadableStreamDefaultController} controller\n */\n pull(controller) {\n if (!this.isWorking) {\n this.work(controller);\n }\n }\n cancel() {\n this.isCancelled = true;\n }\n}\n\n/**\n * @param {string} [input]\n * @returns {string}\n */\nconst readType = (input = \"\") => {\n const type = String(input).toLowerCase();\n return /[^\\u0020-\\u007E]/.test(type) ? \"\" : type\n};\n\nObject.defineProperty(exports, 'TextDecoder', {\n enumerable: true,\n get: function () {\n return webEncoding.TextDecoder;\n }\n});\nObject.defineProperty(exports, 'TextEncoder', {\n enumerable: true,\n get: function () {\n return webEncoding.TextEncoder;\n }\n});\nObject.defineProperty(exports, 'ReadableStream', {\n enumerable: true,\n get: function () {\n return stream.ReadableStream;\n }\n});\nexports.Blob = Blob;\n//# sourceMappingURL=blob.cjs.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar webEncoding = require('web-encoding');\nvar stream = require('@web-std/stream');\nvar blob = require('./blob.cjs');\n\n/** @type {typeof globalThis.Blob} */\n// Our first choise is to use global `Blob` because it may be available e.g. in\n// electron renderrer process. If not available fall back to node native\n// implementation, if also not available use our implementation.\nconst Blob =\n globalThis.Blob || \n // Disable node native blob until impractical perf issue is fixed\n // @see https://github.com/nodejs/node/issues/42108\n // NodeBlob ||\n blob.Blob;\n\nObject.defineProperty(exports, 'TextDecoder', {\n enumerable: true,\n get: function () {\n return webEncoding.TextDecoder;\n }\n});\nObject.defineProperty(exports, 'TextEncoder', {\n enumerable: true,\n get: function () {\n return webEncoding.TextEncoder;\n }\n});\nObject.defineProperty(exports, 'ReadableStream', {\n enumerable: true,\n get: function () {\n return stream.ReadableStream;\n }\n});\nexports.Blob = Blob;\n//# sourceMappingURL=lib.node.cjs.map\n","'use strict';\n\nexports = module.exports = fetch;\n\nconst http = require('http');\nconst https = require('https');\nconst zlib = require('zlib');\nconst dataUriToBuffer = require('data-uri-to-buffer');\nconst Stream = require('stream');\nconst util = require('util');\nconst blob = require('@web-std/blob');\nconst formData = require('@web-std/form-data');\nconst crypto = require('crypto');\nconst multipartParser = require('@web3-storage/multipart-parser');\nconst url = require('url');\n\nclass FetchBaseError extends Error {\n\t/**\n\t * @param {string} message \n\t * @param {string} type \n\t */\n\tconstructor(message, type) {\n\t\tsuper(message);\n\t\t// Hide custom error implementation details from end-users\n\t\tError.captureStackTrace(this, this.constructor);\n\n\t\tthis.type = type;\n\t}\n\n\tget name() {\n\t\treturn this.constructor.name;\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn this.constructor.name;\n\t}\n}\n\n/**\n * @typedef {{\n * address?: string\n * code: string\n * dest?: string\n * errno: number\n * info?: object\n * message: string\n * path?: string\n * port?: number\n * syscall: string\n * }} SystemError\n*/\n\n/**\n * FetchError interface for operational errors\n */\nclass FetchError extends FetchBaseError {\n\t/**\n\t * @param {string} message - Error message for human\n\t * @param {string} type - Error type for machine\n\t * @param {SystemError} [systemError] - For Node.js system error\n\t */\n\tconstructor(message, type, systemError) {\n\t\tsuper(message, type);\n\t\t// When err.type is `system`, err.erroredSysCall contains system error and err.code contains system error code\n\t\tif (systemError) {\n\t\t\t// eslint-disable-next-line no-multi-assign\n\t\t\tthis.code = this.errno = systemError.code;\n\t\t\tthis.erroredSysCall = systemError.syscall;\n\t\t}\n\t}\n}\n\n/**\n * Is.js\n *\n * Object type checks.\n */\n\nconst NAME = Symbol.toStringTag;\n\n/**\n * Check if `obj` is a URLSearchParams object\n * ref: https://github.com/node-fetch/node-fetch/issues/296#issuecomment-307598143\n *\n * @param {any} object\n * @return {obj is URLSearchParams}\n */\nconst isURLSearchParameters = (object) => {\n\treturn (\n\t\ttypeof object === \"object\" &&\n\t\ttypeof object.append === \"function\" &&\n\t\ttypeof object.delete === \"function\" &&\n\t\ttypeof object.get === \"function\" &&\n\t\ttypeof object.getAll === \"function\" &&\n\t\ttypeof object.has === \"function\" &&\n\t\ttypeof object.set === \"function\" &&\n\t\ttypeof object.sort === \"function\" &&\n\t\tobject[NAME] === \"URLSearchParams\"\n\t);\n};\n\n/**\n * Check if `object` is a W3C `Blob` object (which `File` inherits from)\n *\n * @param {*} object\n * @return {object is Blob}\n */\nconst isBlob = (object) => {\n\treturn (\n\t\ttypeof object === \"object\" &&\n\t\ttypeof object.arrayBuffer === \"function\" &&\n\t\ttypeof object.type === \"string\" &&\n\t\ttypeof object.stream === \"function\" &&\n\t\ttypeof object.constructor === \"function\" &&\n\t\t/^(Blob|File)$/.test(object[NAME])\n\t);\n};\n\n/**\n * Check if `obj` is a spec-compliant `FormData` object\n *\n * @param {*} object\n * @return {object is FormData}\n */\nfunction isFormData(object) {\n\treturn (\n\t\ttypeof object === \"object\" &&\n\t\ttypeof object.append === \"function\" &&\n\t\ttypeof object.set === \"function\" &&\n\t\ttypeof object.get === \"function\" &&\n\t\ttypeof object.getAll === \"function\" &&\n\t\ttypeof object.delete === \"function\" &&\n\t\ttypeof object.keys === \"function\" &&\n\t\ttypeof object.values === \"function\" &&\n\t\ttypeof object.entries === \"function\" &&\n\t\ttypeof object.constructor === \"function\" &&\n\t\tobject[NAME] === \"FormData\"\n\t);\n}\n\n/**\n * Detect form data input from form-data module\n *\n * @param {any} value\n * @returns {value is Stream & {getBoundary():string, hasKnownLength():boolean, getLengthSync():number|null}}\n */\nconst isMultipartFormDataStream = (value) => {\n\treturn (\n\t\tvalue instanceof Stream === true &&\n\t\ttypeof value.getBoundary === \"function\" &&\n\t\ttypeof value.hasKnownLength === \"function\" &&\n\t\ttypeof value.getLengthSync === \"function\"\n\t);\n};\n\n/**\n * Check if `obj` is an instance of AbortSignal.\n *\n * @param {any} object\n * @return {obj is AbortSignal}\n */\nconst isAbortSignal = (object) => {\n\treturn (\n\t\ttypeof object === \"object\" &&\n\t\t(object[NAME] === \"AbortSignal\" || object[NAME] === \"EventTarget\")\n\t);\n};\n\n/**\n * Check if `value` is a ReadableStream.\n *\n * @param {*} value\n * @returns {value is ReadableStream}\n */\nconst isReadableStream = (value) => {\n\treturn (\n\t\ttypeof value === \"object\" &&\n\t\ttypeof value.getReader === \"function\" &&\n\t\ttypeof value.cancel === \"function\" &&\n\t\ttypeof value.tee === \"function\"\n\t);\n};\n\n/**\n *\n * @param {any} value\n * @returns {value is Iterable}\n */\nconst isIterable = (value) => value && Symbol.iterator in value;\n\nconst carriage = '\\r\\n';\nconst dashes = '-'.repeat(2);\nconst carriageLength = Buffer.byteLength(carriage);\n\n/**\n * @param {string} boundary\n */\nconst getFooter = boundary => `${dashes}${boundary}${dashes}${carriage.repeat(2)}`;\n\n/**\n * @param {string} boundary\n * @param {string} name\n * @param {*} field\n *\n * @return {string}\n */\nfunction getHeader(boundary, name, field) {\n\tlet header = '';\n\n\theader += `${dashes}${boundary}${carriage}`;\n\theader += `Content-Disposition: form-data; name=\"${name}\"`;\n\n\tif (isBlob(field)) {\n\t\tconst { name = 'blob', type } = /** @type {Blob & {name?:string}} */ (field);\n\t\theader += `; filename=\"${name}\"${carriage}`;\n\t\theader += `Content-Type: ${type || 'application/octet-stream'}`;\n\t}\n\n\treturn `${header}${carriage.repeat(2)}`;\n}\n\n/**\n * @return {string}\n */\nconst getBoundary = () => crypto.randomBytes(8).toString('hex');\n\n/**\n * @param {FormData} form\n * @param {string} boundary\n */\nasync function * formDataIterator(form, boundary) {\n\tfor (const [name, value] of form) {\n\t\tyield getHeader(boundary, name, value);\n\n\t\tif (isBlob(value)) {\n\t\t\t// @ts-ignore - we know our streams implement aysnc iteration\n\t\t\tyield * value.stream();\n\t\t} else {\n\t\t\tyield value;\n\t\t}\n\n\t\tyield carriage;\n\t}\n\n\tyield getFooter(boundary);\n}\n\n/**\n * @param {FormData} form\n * @param {string} boundary\n */\nfunction getFormDataLength(form, boundary) {\n\tlet length = 0;\n\n\tfor (const [name, value] of form) {\n\t\tlength += Buffer.byteLength(getHeader(boundary, name, value));\n\n\t\tif (isBlob(value)) {\n\t\t\tlength += value.size;\n\t\t} else {\n\t\t\tlength += Buffer.byteLength(String(value));\n\t\t}\n\n\t\tlength += carriageLength;\n\t}\n\n\tlength += Buffer.byteLength(getFooter(boundary));\n\n\treturn length;\n}\n\n/**\n * @param {Body & {headers?:Headers}} source\n */\nconst toFormData = async ({ body, headers }) => {\n const contentType = headers?.get('Content-Type') || '';\n const [type, boundary] = contentType.split(/\\s*;\\s*boundary=/);\n if (type === 'multipart/form-data' && boundary != null && body != null) {\n const form = new FormData();\n const parts = multipartParser.iterateMultipart(body, boundary);\n for await (const { name, data, filename, contentType } of parts) {\n if (filename) {\n form.append(name, new File([data], filename, { type: contentType }));\n } else {\n form.append(name, new TextDecoder().decode(data), filename);\n }\n }\n return form\n } else {\n throw new TypeError('Could not parse content as FormData.')\n }\n};\n\nconst encoder = new util.TextEncoder();\nconst decoder = new util.TextDecoder();\n\n/**\n * @param {string} text\n */\nconst encode = text => encoder.encode(text);\n\n/**\n * @param {Uint8Array} bytes\n */\nconst decode = bytes => decoder.decode(bytes);\n\n// @ts-check\nconst {readableHighWaterMark} = new Stream.Readable();\n\nconst INTERNALS$2 = Symbol('Body internals');\n\n/**\n * Body mixin\n *\n * Ref: https://fetch.spec.whatwg.org/#body\n * @implements {globalThis.Body}\n */\n\nclass Body {\n\t/**\n\t * @param {BodyInit|Stream|null} body\n\t * @param {{size?:number}} options\n\t */\n\tconstructor(body, {\n\t\tsize = 0\n\t} = {}) {\n\t\tconst state = {\n\t\t\t/** @type {null|ReadableStream} */\n\t\t\tbody: null,\n\t\t\t/** @type {string|null} */\n\t\t\ttype: null,\n\t\t\t/** @type {number|null} */\n\t\t\tsize: null,\n\t\t\t/** @type {null|string} */\n\t\t\tboundary: null,\n\t\t\tdisturbed: false,\n\t\t\t/** @type {null|Error} */\n\t\t\terror: null\n\t\t};\n\t\t/** @private */\n\t\tthis[INTERNALS$2] = state;\n\n\t\tif (body === null) {\n\t\t\t// Body is undefined or null\n\t\t\tstate.body = null;\n\t\t\tstate.size = 0;\n\t\t} else if (isURLSearchParameters(body)) {\n\t\t// Body is a URLSearchParams\n\t\t\tconst bytes = encode(body.toString());\n\t\t\tstate.body = fromBytes(bytes);\n\t\t\tstate.size = bytes.byteLength;\n\t\t\tstate.type = 'application/x-www-form-urlencoded;charset=UTF-8';\n\t\t} else if (isBlob(body)) {\n\t\t\t// Body is blob\n\t\t\tstate.size = body.size;\n\t\t\tstate.type = body.type || null;\n\t\t\tstate.body = body.stream();\n\t\t} else if (body instanceof Uint8Array) {\n\t\t\t// Body is Buffer\n\t\t\tstate.body = fromBytes(body);\n\t\t\tstate.size = body.byteLength;\n\t\t} else if (util.types.isAnyArrayBuffer(body)) {\n\t\t\t// Body is ArrayBuffer\n\t\t\tconst bytes = new Uint8Array(body);\n\t\t\tstate.body = fromBytes(bytes);\n\t\t\tstate.size = bytes.byteLength;\n\t\t} else if (ArrayBuffer.isView(body)) {\n\t\t\t// Body is ArrayBufferView\n\t\t\tconst bytes = new Uint8Array(body.buffer, body.byteOffset, body.byteLength);\n\t\t\tstate.body = fromBytes(bytes);\n\t\t\tstate.size = bytes.byteLength;\n\t\t} else if (isReadableStream(body)) {\n\t\t\t// Body is stream\n\t\t\tstate.body = body;\n\t\t} else if (isFormData(body)) {\n\t\t\t// Body is an instance of formdata-node\n\t\t\tconst boundary = `NodeFetchFormDataBoundary${getBoundary()}`;\n\t\t\tstate.type = `multipart/form-data; boundary=${boundary}`;\n\t\t\tstate.size = getFormDataLength(body, boundary);\n\t\t\tstate.body = fromAsyncIterable(formDataIterator(body, boundary));\n\t\t} else if (isMultipartFormDataStream(body)) {\n\t\t\tstate.type = `multipart/form-data; boundary=${body.getBoundary()}`;\n\t\t\tstate.size = body.hasKnownLength() ? body.getLengthSync() : null;\n\t\t\tstate.body = fromStream(body);\n\t\t} else if (body instanceof Stream) {\n\t\t\tstate.body = fromStream(body);\n\t\t} else {\n\t\t\t// None of the above\n\t\t\t// coerce to string then buffer\n\t\t\tconst bytes = encode(String(body));\n\t\t\tstate.type = 'text/plain;charset=UTF-8';\n\t\t\tstate.size = bytes.byteLength;\n\t\t\tstate.body = fromBytes(bytes);\n\t\t}\n\n\t\tthis.size = size;\n\n\t\t// if (body instanceof Stream) {\n\t\t// \tbody.on('error', err => {\n\t\t// \t\tconst error = err instanceof FetchBaseError ?\n\t\t// \t\t\terr :\n\t\t// \t\t\tnew FetchError(`Invalid response body while trying to fetch ${this.url}: ${err.message}`, 'system', err);\n\t\t// \t\tthis[INTERNALS].error = error;\n\t\t// \t});\n\t\t// }\n\t}\n\n\t/** @type {Headers} */\n\t/* c8 ignore next 3 */\n\tget headers() {\n\t\tthrow new TypeError(`'get headers' called on an object that does not implements interface.`)\n\t}\n\n\tget body() {\n\t\treturn this[INTERNALS$2].body;\n\t}\n\n\tget bodyUsed() {\n\t\treturn this[INTERNALS$2].disturbed;\n\t}\n\n\t/**\n\t * Decode response as ArrayBuffer\n\t *\n\t * @return {Promise}\n\t */\n\tasync arrayBuffer() {\n\t\tconst {buffer, byteOffset, byteLength} = await consumeBody(this);\n\t\treturn buffer.slice(byteOffset, byteOffset + byteLength);\n\t}\n\n\t/**\n\t * Return raw response as Blob\n\t *\n\t * @return Promise\n\t */\n\tasync blob() {\n\t\tconst ct = (this.headers && this.headers.get('content-type')) || (this[INTERNALS$2].body && this[INTERNALS$2].type) || '';\n\t\tconst buf = await consumeBody(this);\n\n\t\treturn new blob.Blob([buf], {\n\t\t\ttype: ct\n\t\t});\n\t}\n\n\t/**\n\t * Decode response as json\n\t *\n\t * @return Promise\n\t */\n\tasync json() {\n\t\treturn JSON.parse(await this.text());\n\t}\n\n\t/**\n\t * Decode response as text\n\t *\n\t * @return Promise\n\t */\n\tasync text() {\n\t\tconst buffer = await consumeBody(this);\n\t\treturn decode(buffer);\n\t}\n\n\t/**\n\t * @returns {Promise}\n\t */\n\n\tasync formData() {\n\t\treturn toFormData(this)\n\t}\n}\n\n// In browsers, all properties are enumerable.\nObject.defineProperties(Body.prototype, {\n\tbody: {enumerable: true},\n\tbodyUsed: {enumerable: true},\n\tarrayBuffer: {enumerable: true},\n\tblob: {enumerable: true},\n\tjson: {enumerable: true},\n\ttext: {enumerable: true},\n\tformData: {enumerable: true}\n});\n\n/**\n * Consume and convert an entire Body to a Buffer.\n *\n * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body\n *\n * @param {Body & {url?:string}} data\n * @return {Promise}\n */\nasync function consumeBody(data) {\n\tconst state = data[INTERNALS$2];\n\tif (state.disturbed) {\n\t\tthrow new TypeError(`body used already for: ${data.url}`);\n\t}\n\n\tstate.disturbed = true;\n\n\tif (state.error) {\n\t\tthrow state.error;\n\t}\n\n\tconst {body} = state;\n\n\t// Body is null\n\tif (body === null) {\n\t\treturn new Uint8Array(0);\n\t}\n\n\t// Body is stream\n\t// get ready to actually consume the body\n\t/** @type {[Uint8Array|null, Uint8Array[], number]} */\n\tconst [buffer, chunks, limit] = data.size > 0 ?\n\t\t[new Uint8Array(data.size), [], data.size] :\n\t\t[null, [], Infinity];\n\tlet offset = 0;\n\n\tconst source = streamIterator(body);\n\ttry {\n\t\tfor await (const chunk of source) {\n\t\t\tconst bytes = chunk instanceof Uint8Array ?\n\t\t\t\tchunk :\n\t\t\t\tBuffer.from(chunk);\n\n\t\t\tif (offset + bytes.byteLength > limit) {\n\t\t\t\tconst error = new FetchError(`content size at ${data.url} over limit: ${limit}`, 'max-size');\n\t\t\t\tsource.throw(error);\n\t\t\t\tthrow error;\n\t\t\t} else if (buffer) {\n\t\t\t\tbuffer.set(bytes, offset);\n\t\t\t} else {\n\t\t\t\tchunks.push(bytes);\n\t\t\t}\n\n\t\t\toffset += bytes.byteLength;\n\t\t}\n\n\t\tif (buffer) {\n\t\t\tif (offset < buffer.byteLength) {\n\t\t\t\tthrow new FetchError(`Premature close of server response while trying to fetch ${data.url}`, 'premature-close');\n\t\t\t} else {\n\t\t\t\treturn buffer;\n\t\t\t}\n\t\t} else {\n\t\t\treturn writeBytes(new Uint8Array(offset), chunks);\n\t\t}\n\t} catch (error) {\n\t\tif (error instanceof FetchBaseError) {\n\t\t\tthrow error;\n\t\t// @ts-expect-error - we know it will have a name\n\t\t} else if (error && error.name === 'AbortError') {\n\t\t\tthrow error;\n\t\t} else {\n\t\t\tconst e = /** @type {import('./errors/fetch-error').SystemError} */(error);\n\t\t\t// Other errors, such as incorrect content-encoding\n\t\t\tthrow new FetchError(`Invalid response body while trying to fetch ${data.url}: ${e.message}`, 'system', e);\n\t\t}\n\t}\n}\n\n/**\n * Clone body given Res/Req instance\n *\n * @param {Body} instance Response or Request instance\n * @return {ReadableStream}\n */\nconst clone = instance => {\n\tconst {body} = instance;\n\n\t// Don't allow cloning a used body\n\tif (instance.bodyUsed) {\n\t\tthrow new Error('cannot clone body after it is used');\n\t}\n\n\t// @ts-expect-error - could be null\n\tconst [left, right] = body.tee();\n\tinstance[INTERNALS$2].body = left;\n\treturn right;\n};\n\n/**\n * Performs the operation \"extract a `Content-Type` value from |object|\" as\n * specified in the specification:\n * https://fetch.spec.whatwg.org/#concept-bodyinit-extract\n *\n * This function assumes that instance.body is present.\n *\n * @param {Body} source Any options.body input\n * @returns {string | null}\n */\nconst extractContentType = source => source[INTERNALS$2].type;\n\n/**\n * The Fetch Standard treats this as if \"total bytes\" is a property on the body.\n * For us, we have to explicitly get it with a function.\n *\n * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes\n *\n * @param {Body} source - Body object from the Body instance.\n * @returns {number | null}\n */\nconst getTotalBytes = source => source[INTERNALS$2].size;\n\n/**\n * Write a Body to a Node.js WritableStream (e.g. http.Request) object.\n *\n * @param {Stream.Writable} dest - The stream to write to.\n * @param {Body} source - Body object from the Body instance.\n * @returns {void}\n */\nconst writeToStream = (dest, {body}) => {\n\tif (body === null) {\n\t\t// Body is null\n\t\tdest.end();\n\t} else {\n\t\tStream.Readable.from(streamIterator(body)).pipe(dest);\n\t}\n};\n\n/**\n * @template T\n * @implements {AsyncGenerator}\n */\nclass StreamIterableIterator {\n\t/**\n\t * @param {ReadableStream} stream\n\t */\n\tconstructor(stream) {\n\t\tthis.stream = stream;\n\t\tthis.reader = null;\n\t}\n\n\t/**\n\t * @returns {AsyncGenerator}\n\t */\n\t[Symbol.asyncIterator]() {\n\t\treturn this;\n\t}\n\n\tgetReader() {\n\t\tif (this.reader) {\n\t\t\treturn this.reader;\n\t\t}\n\n\t\tconst reader = this.stream.getReader();\n\t\tthis.reader = reader;\n\t\treturn reader;\n\t}\n\n\t/**\n\t * @returns {Promise>}\n\t */\n\tnext() {\n\t\treturn /** @type {Promise>} */ (this.getReader().read());\n\t}\n\n\t/**\n\t * @returns {Promise>}\n\t */\n\tasync return() {\n\t\tif (this.reader) {\n\t\t\tawait this.reader.cancel();\n\t\t}\n\n\t\treturn {done: true, value: undefined};\n\t}\n\n\t/**\n\t * \n\t * @param {any} error \n\t * @returns {Promise>}\n\t */\n\tasync throw(error) {\n\t\tawait this.getReader().cancel(error);\n\t\treturn {done: true, value: undefined};\n\t}\n}\n\n/**\n * @template T\n * @param {ReadableStream} stream\n */\nconst streamIterator = stream => new StreamIterableIterator(stream);\n\n/**\n * @param {Uint8Array} buffer\n * @param {Uint8Array[]} chunks\n */\nconst writeBytes = (buffer, chunks) => {\n\tlet offset = 0;\n\tfor (const chunk of chunks) {\n\t\tbuffer.set(chunk, offset);\n\t\toffset += chunk.byteLength;\n\t}\n\n\treturn buffer;\n};\n\n/**\n * @param {Uint8Array} bytes\n * @returns {ReadableStream}\n */\n// @ts-ignore\nconst fromBytes = bytes => new blob.ReadableStream({\n\tstart(controller) {\n\t\tcontroller.enqueue(bytes);\n\t\tcontroller.close();\n\t}\n});\n\n/**\n * @param {AsyncIterable} content\n * @returns {ReadableStream}\n */\nconst fromAsyncIterable = content =>\n\t// @ts-ignore\n\tnew blob.ReadableStream(new AsyncIterablePump(content));\n\n/**\n * @implements {UnderlyingSource}\n */\nclass AsyncIterablePump {\n\t/**\n\t * @param {AsyncIterable} source\n\t */\n\tconstructor(source) {\n\t\tthis.source = source[Symbol.asyncIterator]();\n\t}\n\n\t/**\n\t * @param {ReadableStreamController} controller\n\t */\n\tasync pull(controller) {\n\t\ttry {\n\t\t\twhile (controller.desiredSize || 0 > 0) {\n\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\tconst next = await this.source.next();\n\t\t\t\tif (next.done) {\n\t\t\t\t\tcontroller.close();\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tcontroller.enqueue(next.value);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tcontroller.error(error);\n\t\t}\n\t}\n\n\t/**\n\t * @param {any} [reason]\n\t */\n\tcancel(reason) {\n\t\tif (reason) {\n\t\t\tif (typeof this.source.throw === 'function') {\n\t\t\t\tthis.source.throw(reason);\n\t\t\t} else if (typeof this.source.return === 'function') {\n\t\t\t\tthis.source.return();\n\t\t\t}\n\t\t} else if (typeof this.source.return === 'function') {\n\t\t\tthis.source.return();\n\t\t}\n\t}\n}\n\n/**\n * @param {Stream & {readableHighWaterMark?:number}} source\n * @returns {ReadableStream}\n */\nconst fromStream = source => {\n\tconst pump = new StreamPump(source);\n\tconst stream = new blob.ReadableStream(pump, pump);\n\treturn stream;\n};\n\n/**\n * @implements {UnderlyingSource}\n * @implements {QueuingStrategy}\n */\nclass StreamPump {\n\t/**\n\t * @param {Stream & {\n\t * \treadableHighWaterMark?: number\n\t * \treadable?:boolean,\n\t * \tresume?: () => void,\n\t * \tpause?: () => void\n\t * \tdestroy?: (error?:Error) => void\n\t * }} stream\n\t */\n\tconstructor(stream) {\n\t\tthis.highWaterMark = stream.readableHighWaterMark || readableHighWaterMark;\n\t\tthis.accumalatedSize = 0;\n\t\tthis.stream = stream;\n\t\tthis.enqueue = this.enqueue.bind(this);\n\t\tthis.error = this.error.bind(this);\n\t\tthis.close = this.close.bind(this);\n\t}\n\n\t/**\n\t * @param {Uint8Array} [chunk]\n\t */\n\tsize(chunk) {\n\t\treturn chunk?.byteLength || 0;\n\t}\n\n\t/**\n\t * @param {ReadableStreamController} controller\n\t */\n\tstart(controller) {\n\t\tthis.controller = controller;\n\t\tthis.stream.on('data', this.enqueue);\n\t\tthis.stream.once('error', this.error);\n\t\tthis.stream.once('end', this.close);\n\t\tthis.stream.once('close', this.close);\n\t}\n\n\tpull() {\n\t\tthis.resume();\n\t}\n\n\t/**\n\t * @param {any} [reason]\n\t */\n\tcancel(reason) {\n\t\tif (this.stream.destroy) {\n\t\t\tthis.stream.destroy(reason);\n\t\t}\n\n\t\tthis.stream.off('data', this.enqueue);\n\t\tthis.stream.off('error', this.error);\n\t\tthis.stream.off('end', this.close);\n\t\tthis.stream.off('close', this.close);\n\t}\n\n\t/**\n\t * @param {Uint8Array|string} chunk\n\t */\n\tenqueue(chunk) {\n\t\tif (this.controller) {\n\t\t\ttry {\n\t\t\t\tconst bytes = chunk instanceof Uint8Array ?\n\t\t\t\t\tchunk :\n\t\t\t\t\tBuffer.from(chunk);\n\n\t\t\t\tconst available = (this.controller.desiredSize || 0) - bytes.byteLength;\n\t\t\t\tthis.controller.enqueue(bytes);\n\t\t\t\tif (available <= 0) {\n\t\t\t\t\tthis.pause();\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\tthis.controller.error(new Error('Could not create Buffer, chunk must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object'));\n\t\t\t\tthis.cancel();\n\t\t\t}\n\t\t}\n\t}\n\n\tpause() {\n\t\tif (this.stream.pause) {\n\t\t\tthis.stream.pause();\n\t\t}\n\t}\n\n\tresume() {\n\t\tif (this.stream.readable && this.stream.resume) {\n\t\t\tthis.stream.resume();\n\t\t}\n\t}\n\n\tclose() {\n\t\tif (this.controller) {\n\t\t\tthis.controller.close();\n\t\t\tdelete this.controller;\n\t\t}\n\t}\n\n\t/**\n\t * @param {Error} error \n\t */\n\terror(error) {\n\t\tif (this.controller) {\n\t\t\tthis.controller.error(error);\n\t\t\tdelete this.controller;\n\t\t}\n\t}\n}\n\n/**\n * Headers.js\n *\n * Headers class offers convenient helpers\n */\n\nconst validators = /** @type {{validateHeaderName?:(name:string) => any, validateHeaderValue?:(name:string, value:string) => any}} */\n(http);\n\nconst validateHeaderName = typeof validators.validateHeaderName === 'function' ?\n\tvalidators.validateHeaderName :\n\t/**\n\t * @param {string} name \n\t */\n\tname => {\n\t\tif (!/^[\\^`\\-\\w!#$%&'*+.|~]+$/.test(name)) {\n\t\t\tconst err = new TypeError(`Header name must be a valid HTTP token [${name}]`);\n\t\t\tObject.defineProperty(err, 'code', {value: 'ERR_INVALID_HTTP_TOKEN'});\n\t\t\tthrow err;\n\t\t}\n\t};\n\nconst validateHeaderValue = typeof validators.validateHeaderValue === 'function' ?\n\tvalidators.validateHeaderValue :\n\t/**\n\t * @param {string} name \n\t * @param {string} value \n\t */\n\t(name, value) => {\n\t\tif (/[^\\t\\u0020-\\u007E\\u0080-\\u00FF]/.test(value)) {\n\t\t\tconst err = new TypeError(`Invalid character in header content [\"${name}\"]`);\n\t\t\tObject.defineProperty(err, 'code', {value: 'ERR_INVALID_CHAR'});\n\t\t\tthrow err;\n\t\t}\n\t};\n\n/**\n * @typedef {Headers | Record | Iterable | Iterable>} HeadersInit\n */\n\n/**\n * This Fetch API interface allows you to perform various actions on HTTP request and response headers.\n * These actions include retrieving, setting, adding to, and removing.\n * A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs.\n * You can add to this using methods like append() (see Examples.)\n * In all methods of this interface, header names are matched by case-insensitive byte sequence.\n *\n * @implements {globalThis.Headers}\n */\nclass Headers extends URLSearchParams {\n\t/**\n\t * Headers class\n\t *\n\t * @constructor\n\t * @param {HeadersInit} [init] - Response headers\n\t */\n\tconstructor(init) {\n\t\t// Validate and normalize init object in [name, value(s)][]\n\t\t/** @type {string[][]} */\n\t\tlet result = [];\n\t\tif (init instanceof Headers) {\n\t\t\tconst raw = init.raw();\n\t\t\tfor (const [name, values] of Object.entries(raw)) {\n\t\t\t\tresult.push(...values.map(value => [name, value]));\n\t\t\t}\n\t\t} else if (init == null) ; else if (isIterable(init)) {\n\t\t\t// Sequence>\n\t\t\t// Note: per spec we have to first exhaust the lists then process them\n\t\t\tresult = [...init]\n\t\t\t\t.map(pair => {\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeof pair !== 'object' || util.types.isBoxedPrimitive(pair)\n\t\t\t\t\t) {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be an iterable object');\n\t\t\t\t\t}\n\n\t\t\t\t\treturn [...pair];\n\t\t\t\t}).map(pair => {\n\t\t\t\t\tif (pair.length !== 2) {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be a name/value tuple');\n\t\t\t\t\t}\n\n\t\t\t\t\treturn [...pair];\n\t\t\t\t});\n\t\t} else if (typeof init === \"object\" && init !== null) {\n\t\t\t// Record\n\t\t\tresult.push(...Object.entries(init));\n\t\t} else {\n\t\t\tthrow new TypeError('Failed to construct \\'Headers\\': The provided value is not of type \\'(sequence> or record)');\n\t\t}\n\n\t\t// Validate and lowercase\n\t\tresult =\n\t\t\tresult.length > 0 ?\n\t\t\t\tresult.map(([name, value]) => {\n\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\tvalidateHeaderValue(name, String(value));\n\t\t\t\t\treturn [String(name).toLowerCase(), String(value)];\n\t\t\t\t}) :\n\t\t\t\t[];\n\n\t\tsuper(result);\n\n\t\t// Returning a Proxy that will lowercase key names, validate parameters and sort keys\n\t\t// eslint-disable-next-line no-constructor-return\n\t\treturn new Proxy(this, {\n\t\t\tget(target, p, receiver) {\n\t\t\t\tswitch (p) {\n\t\t\t\t\tcase 'append':\n\t\t\t\t\tcase 'set':\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * @param {string} name\n\t\t\t\t\t\t * @param {string} value\n\t\t\t\t\t\t */\n\t\t\t\t\t\treturn (name, value) => {\n\t\t\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\t\t\tvalidateHeaderValue(name, String(value));\n\t\t\t\t\t\t\treturn URLSearchParams.prototype[p].call(\n\t\t\t\t\t\t\t\treceiver,\n\t\t\t\t\t\t\t\tString(name).toLowerCase(),\n\t\t\t\t\t\t\t\tString(value)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t};\n\n\t\t\t\t\tcase 'delete':\n\t\t\t\t\tcase 'has':\n\t\t\t\t\tcase 'getAll':\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * @param {string} name\n\t\t\t\t\t\t */\n\t\t\t\t\t\treturn name => {\n\t\t\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\treturn URLSearchParams.prototype[p].call(\n\t\t\t\t\t\t\t\treceiver,\n\t\t\t\t\t\t\t\tString(name).toLowerCase()\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t};\n\n\t\t\t\t\tcase 'keys':\n\t\t\t\t\t\treturn () => {\n\t\t\t\t\t\t\ttarget.sort();\n\t\t\t\t\t\t\treturn new Set(URLSearchParams.prototype.keys.call(target)).keys();\n\t\t\t\t\t\t};\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn Reflect.get(target, p, receiver);\n\t\t\t\t}\n\t\t\t}\n\t\t\t/* c8 ignore next */\n\t\t});\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn this.constructor.name;\n\t}\n\n\ttoString() {\n\t\treturn Object.prototype.toString.call(this);\n\t}\n\n\t/**\n\t * \n\t * @param {string} name \n\t */\n\tget(name) {\n\t\tconst values = this.getAll(name);\n\t\tif (values.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet value = values.join(', ');\n\t\tif (/^content-encoding$/i.test(name)) {\n\t\t\tvalue = value.toLowerCase();\n\t\t}\n\n\t\treturn value;\n\t}\n\n\t/**\n\t * @param {(value: string, key: string, parent: this) => void} callback \n\t * @param {any} thisArg \n\t * @returns {void}\n\t */\n\tforEach(callback, thisArg = undefined) {\n\t\tfor (const name of this.keys()) {\n\t\t\tReflect.apply(callback, thisArg, [this.get(name), name, this]);\n\t\t}\n\t}\n\n\t/**\n\t * @returns {IterableIterator}\n\t */\n\t* values() {\n\t\tfor (const name of this.keys()) {\n\t\t\tyield /** @type {string} */(this.get(name));\n\t\t}\n\t}\n\n\t/**\n\t * @returns {IterableIterator<[string, string]>}\n\t */\n\t* entries() {\n\t\tfor (const name of this.keys()) {\n\t\t\tyield [name, /** @type {string} */(this.get(name))];\n\t\t}\n\t}\n\n\t[Symbol.iterator]() {\n\t\treturn this.entries();\n\t}\n\n\t/**\n\t * Node-fetch non-spec method\n\t * returning all headers and their values as array\n\t * @returns {Record}\n\t */\n\traw() {\n\t\treturn [...this.keys()].reduce((result, key) => {\n\t\t\tresult[key] = this.getAll(key);\n\t\t\treturn result;\n\t\t}, /** @type {Record} */({}));\n\t}\n\n\t/**\n\t * For better console.log(headers) and also to convert Headers into Node.js Request compatible format\n\t */\n\t[Symbol.for('nodejs.util.inspect.custom')]() {\n\t\treturn [...this.keys()].reduce((result, key) => {\n\t\t\tconst values = this.getAll(key);\n\t\t\t// Http.request() only supports string as Host header.\n\t\t\t// This hack makes specifying custom Host header possible.\n\t\t\tif (key === 'host') {\n\t\t\t\tresult[key] = values[0];\n\t\t\t} else {\n\t\t\t\tresult[key] = values.length > 1 ? values : values[0];\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}, /** @type {Record} */({}));\n\t}\n}\n\n/**\n * Re-shaping object for Web IDL tests\n * Only need to do it for overridden methods\n */\nObject.defineProperties(\n\tHeaders.prototype,\n\t['get', 'entries', 'forEach', 'values'].reduce((result, property) => {\n\t\tresult[property] = {enumerable: true};\n\t\treturn result;\n\t}, /** @type {Record} */ ({}))\n);\n\n/**\n * Create a Headers object from an http.IncomingMessage.rawHeaders, ignoring those that do\n * not conform to HTTP grammar productions.\n * @param {import('http').IncomingMessage['rawHeaders']} headers\n */\nfunction fromRawHeaders(headers = []) {\n\treturn new Headers(\n\t\theaders\n\t\t\t// Split into pairs\n\t\t\t.reduce((result, value, index, array) => {\n\t\t\t\tif (index % 2 === 0) {\n\t\t\t\t\tresult.push(array.slice(index, index + 2));\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t}, /** @type {string[][]} */([]))\n\t\t\t.filter(([name, value]) => {\n\t\t\t\ttry {\n\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\tvalidateHeaderValue(name, String(value));\n\t\t\t\t\treturn true;\n\t\t\t\t} catch {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t})\n\n\t);\n}\n\nconst redirectStatus = new Set([301, 302, 303, 307, 308]);\n\n/**\n * Redirect code matching\n *\n * @param {number} code - Status code\n * @return {boolean}\n */\nconst isRedirect = code => {\n\treturn redirectStatus.has(code);\n};\n\n/**\n * Response.js\n *\n * Response class provides content decoding\n */\n\nconst INTERNALS$1 = Symbol('Response internals');\n\n/**\n * Response class\n * \n * @typedef {Object} Ext\n * @property {number} [size]\n * @property {string} [url]\n * @property {number} [counter]\n * @property {number} [highWaterMark]\n * \n * @implements {globalThis.Response}\n */\nclass Response extends Body {\n\t/**\n\t * @param {BodyInit|import('stream').Stream|null} [body] - Readable stream\n\t * @param {ResponseInit & Ext} [options] - Response options\n\t */\n\tconstructor(body = null, options = {}) {\n\t\tsuper(body, options);\n\n\t\tconst status = options.status || 200;\n\t\tconst headers = new Headers(options.headers);\n\n\t\tif (body !== null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(this);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t*/\n\t\tthis[INTERNALS$1] = {\n\t\t\turl: options.url,\n\t\t\tstatus,\n\t\t\tstatusText: options.statusText || '',\n\t\t\theaders,\n\t\t\tcounter: options.counter || 0,\n\t\t\thighWaterMark: options.highWaterMark\n\t\t};\n\t}\n\n\t/**\n\t * @type {ResponseType}\n\t */\n\tget type() {\n\t\treturn \"default\"\n\t}\n\n\tget url() {\n\t\treturn this[INTERNALS$1].url || '';\n\t}\n\n\tget status() {\n\t\treturn this[INTERNALS$1].status;\n\t}\n\n\t/**\n\t * Convenience property representing if the request ended normally\n\t */\n\tget ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}\n\n\tget redirected() {\n\t\treturn this[INTERNALS$1].counter > 0;\n\t}\n\n\tget statusText() {\n\t\treturn this[INTERNALS$1].statusText;\n\t}\n\n\t/**\n\t * @type {Headers}\n\t */\n\tget headers() {\n\t\treturn this[INTERNALS$1].headers;\n\t}\n\n\tget highWaterMark() {\n\t\treturn this[INTERNALS$1].highWaterMark;\n\t}\n\n\t/**\n\t * Clone this response\n\t *\n\t * @returns {Response}\n\t */\n\tclone() {\n\t\treturn new Response(clone(this), {\n\t\t\turl: this.url,\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t\theaders: this.headers,\n\t\t\tsize: this.size\n\t\t});\n\t}\n\n\t/**\n\t * @param {string} url The URL that the new response is to originate from.\n\t * @param {number} status An optional status code for the response (e.g., 302.)\n\t * @returns {Response} A Response object.\n\t */\n\tstatic redirect(url, status = 302) {\n\t\tif (!isRedirect(status)) {\n\t\t\tthrow new RangeError('Failed to execute \"redirect\" on \"response\": Invalid status code');\n\t\t}\n\n\t\treturn new Response(null, {\n\t\t\theaders: {\n\t\t\t\tlocation: new URL(url).toString()\n\t\t\t},\n\t\t\tstatus\n\t\t});\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn 'Response';\n\t}\n}\n\nObject.defineProperties(Response.prototype, {\n\turl: {enumerable: true},\n\tstatus: {enumerable: true},\n\tok: {enumerable: true},\n\tredirected: {enumerable: true},\n\tstatusText: {enumerable: true},\n\theaders: {enumerable: true},\n\tclone: {enumerable: true}\n});\n\n/**\n * @param {URL} parsedURL \n * @returns {string}\n */\nconst getSearch = parsedURL => {\n\tif (parsedURL.search) {\n\t\treturn parsedURL.search;\n\t}\n\n\tconst lastOffset = parsedURL.href.length - 1;\n\tconst hash = parsedURL.hash || (parsedURL.href[lastOffset] === '#' ? '#' : '');\n\treturn parsedURL.href[lastOffset - hash.length] === '?' ? '?' : '';\n};\n\nconst INTERNALS = Symbol('Request internals');\n\n/**\n * Check if `obj` is an instance of Request.\n *\n * @param {any} object\n * @return {object is Request}\n */\nconst isRequest = object => {\n\treturn (\n\t\ttypeof object === 'object' &&\n\t\ttypeof object[INTERNALS] === 'object'\n\t);\n};\n\n\n/**\n * Request class\n * @implements {globalThis.Request}\n * \n * @typedef {Object} RequestState\n * @property {string} method\n * @property {RequestRedirect} redirect\n * @property {globalThis.Headers} headers\n * @property {URL} parsedURL\n * @property {AbortSignal|null} signal\n * \n * @typedef {Object} RequestExtraOptions\n * @property {number} [follow]\n * @property {boolean} [compress]\n * @property {number} [size]\n * @property {number} [counter]\n * @property {Agent} [agent]\n * @property {number} [highWaterMark]\n * @property {boolean} [insecureHTTPParser]\n * \n * @typedef {((url:URL) => import('http').Agent) | import('http').Agent} Agent\n * \n * @typedef {Object} RequestOptions\n * @property {string} [method]\n * @property {ReadableStream|null} [body]\n * @property {globalThis.Headers} [headers]\n * @property {RequestRedirect} [redirect]\n * \n */\nclass Request extends Body {\n\t/**\n\t * @param {string|Request|URL} info Url or Request instance\n\t * @param {RequestInit & RequestExtraOptions} init Custom options\n\t */\n\tconstructor(info, init = {}) {\n\t\tlet parsedURL;\n\t\t/** @type {RequestOptions & RequestExtraOptions} */\n\t\tlet settings;\n\n\t\t// Normalize input and force URL to be encoded as UTF-8 (https://github.com/node-fetch/node-fetch/issues/245)\n\t\tif (isRequest(info)) {\n\t\t\tparsedURL = new URL(info.url);\n\t\t\tsettings = (info);\n\t\t} else {\n\t\t\tparsedURL = new URL(info);\n\t\t\tsettings = {};\n\t\t}\n\n\n\n\t\tlet method = init.method || settings.method || 'GET';\n\t\tmethod = method.toUpperCase();\n\n\t\tconst inputBody = init.body != null\n\t\t\t? init.body\n\t\t\t: (isRequest(info) && info.body !== null)\n\t\t\t? clone(info)\n\t\t\t: null;\n\n\t\t// eslint-disable-next-line no-eq-null, eqeqeq\n\t\tif (inputBody != null && (method === 'GET' || method === 'HEAD')) {\n\t\t\tthrow new TypeError('Request with GET/HEAD method cannot have body');\n\t\t}\n\n\t\tsuper(inputBody, {\n\t\t\tsize: init.size || settings.size || 0\n\t\t});\n\t\tconst input = settings;\n\n\t\t\n\t\tconst headers = /** @type {globalThis.Headers} */\n\t\t\t(new Headers(init.headers || input.headers || {}));\n\n\t\tif (inputBody !== null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(this);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tlet signal = 'signal' in init\n\t\t\t? init.signal\n\t\t\t: isRequest(input)\n\t\t\t? input.signal\n\t\t\t: null;\n\n\t\t// eslint-disable-next-line no-eq-null, eqeqeq\n\t\tif (signal != null && !isAbortSignal(signal)) {\n\t\t\tthrow new TypeError('Expected signal to be an instanceof AbortSignal or EventTarget');\n\t\t}\n\n\t\t/** @type {RequestState} */\n\t\tthis[INTERNALS] = {\n\t\t\tmethod,\n\t\t\tredirect: init.redirect || input.redirect || 'follow',\n\t\t\theaders,\n\t\t\tparsedURL,\n\t\t\tsignal: signal || null\n\t\t};\n\n\t\t/** @type {boolean} */\n\t\tthis.keepalive;\n\n\t\t// Node-fetch-only options\n\t\t/** @type {number} */\n\t\tthis.follow = init.follow === undefined ? (input.follow === undefined ? 20 : input.follow) : init.follow;\n\t\t/** @type {boolean} */\n\t\tthis.compress = init.compress === undefined ? (input.compress === undefined ? true : input.compress) : init.compress;\n\t\t/** @type {number} */\n\t\tthis.counter = init.counter || input.counter || 0;\n\t\t/** @type {Agent|undefined} */\n\t\tthis.agent = init.agent || input.agent;\n\t\t/** @type {number} */\n\t\tthis.highWaterMark = init.highWaterMark || input.highWaterMark || 16384;\n\t\t/** @type {boolean} */\n\t\tthis.insecureHTTPParser = init.insecureHTTPParser || input.insecureHTTPParser || false;\n\t}\n\n\t/**\n\t * @type {RequestCache}\n\t */\n\tget cache() {\n\t\treturn \"default\"\n\t}\n\n\t/**\n\t * @type {RequestCredentials}\n\t */\n\n\tget credentials() {\n\t\treturn \"same-origin\"\n\t}\n\n\t/**\n\t * @type {RequestDestination}\n\t */\n\tget destination() {\n\t\treturn \"\"\n\t}\n\t\n\tget integrity() {\n\t\treturn \"\"\n\t}\n\t\n\t/** @type {RequestMode} */\n\tget mode() {\n\t\treturn \"cors\"\n\t}\n\n\t/** @type {string} */\n\tget referrer() {\n\t\treturn \"\"\n\t}\n\t\n\t/** @type {ReferrerPolicy} */\n\tget referrerPolicy() {\n\t\treturn \"\"\n\t}\n\tget method() {\n\t\treturn this[INTERNALS].method;\n\t}\n\n\t/**\n\t * @type {string}\n\t */\n\tget url() {\n\t\treturn url.format(this[INTERNALS].parsedURL);\n\t}\n\n\t/**\n\t * @type {globalThis.Headers}\n\t */\n\tget headers() {\n\t\treturn this[INTERNALS].headers;\n\t}\n\n\tget redirect() {\n\t\treturn this[INTERNALS].redirect;\n\t}\n\n\t/**\n\t * @returns {AbortSignal}\n\t */\n\tget signal() {\n\t\t// @ts-ignore\n\t\treturn this[INTERNALS].signal;\n\t}\n\n\t/**\n\t * Clone this request\n\t *\n\t * @return {globalThis.Request}\n\t */\n\tclone() {\n\t\treturn new Request(this);\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn 'Request';\n\t}\n}\n\nObject.defineProperties(Request.prototype, {\n\tmethod: {enumerable: true},\n\turl: {enumerable: true},\n\theaders: {enumerable: true},\n\tredirect: {enumerable: true},\n\tclone: {enumerable: true},\n\tsignal: {enumerable: true}\n});\n\n/**\n * Convert a Request to Node.js http request options.\n * The options object to be passed to http.request\n *\n * @param {Request & Record} request - A Request instance\n */\nconst getNodeRequestOptions = request => {\n\tconst {parsedURL} = request[INTERNALS];\n\tconst headers = new Headers(request[INTERNALS].headers);\n\n\t// Fetch step 1.3\n\tif (!headers.has('Accept')) {\n\t\theaders.set('Accept', '*/*');\n\t}\n\n\t// HTTP-network-or-cache fetch steps 2.4-2.7\n\tlet contentLengthValue = null;\n\tif (request.body === null && /^(post|put)$/i.test(request.method)) {\n\t\tcontentLengthValue = '0';\n\t}\n\n\tif (request.body !== null) {\n\t\tconst totalBytes = getTotalBytes(request);\n\t\t// Set Content-Length if totalBytes is a number (that is not NaN)\n\t\tif (typeof totalBytes === 'number' && !Number.isNaN(totalBytes)) {\n\t\t\tcontentLengthValue = String(totalBytes);\n\t\t}\n\t}\n\n\tif (contentLengthValue) {\n\t\theaders.set('Content-Length', contentLengthValue);\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.11\n\tif (!headers.has('User-Agent')) {\n\t\theaders.set('User-Agent', 'node-fetch');\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.15\n\tif (request.compress && !headers.has('Accept-Encoding')) {\n\t\theaders.set('Accept-Encoding', 'gzip,deflate,br');\n\t}\n\n\tlet {agent} = request;\n\tif (typeof agent === 'function') {\n\t\tagent = agent(parsedURL);\n\t}\n\n\tif (!headers.has('Connection') && !agent) {\n\t\theaders.set('Connection', 'close');\n\t}\n\n\t// HTTP-network fetch step 4.2\n\t// chunked encoding is handled by Node.js\n\n\tconst search = getSearch(parsedURL);\n\n\t// Manually spread the URL object instead of spread syntax\n\tconst requestOptions = {\n\t\tpath: parsedURL.pathname + search,\n\t\tpathname: parsedURL.pathname,\n\t\thostname: parsedURL.hostname,\n\t\tprotocol: parsedURL.protocol,\n\t\tport: parsedURL.port,\n\t\thash: parsedURL.hash,\n\t\tsearch: parsedURL.search,\n\t\t// @ts-ignore - it does not has a query \n\t\tquery: parsedURL.query,\n\t\thref: parsedURL.href,\n\t\tmethod: request.method,\n\t\t// @ts-ignore - not sure what this supposed to do\n\t\theaders: headers[Symbol.for('nodejs.util.inspect.custom')](),\n\t\tinsecureHTTPParser: request.insecureHTTPParser,\n\t\tagent\n\t};\n\n\treturn requestOptions;\n};\n\n/**\n * AbortError interface for cancelled requests\n */\nclass AbortError extends FetchBaseError {\n\t/**\n\t * @param {string} message \n\t * @param {string} [type]\n\t */\n\tconstructor(message, type = 'aborted') {\n\t\tsuper(message, type);\n\t}\n}\n\n/**\n * Index.js\n *\n * a request API compatible with window.fetch\n *\n * All spec algorithm step numbers are based on https://fetch.spec.whatwg.org/commit-snapshots/ae716822cb3a61843226cd090eefc6589446c1d2/.\n */\n\nconst supportedSchemas = new Set(['data:', 'http:', 'https:']);\n\n/**\n * Fetch function\n *\n * @param {string | URL | import('./request').default} url - Absolute url or Request instance\n * @param {RequestInit} [options_] - Fetch options\n * @return {Promise}\n */\nasync function fetch(url, options_ = {}) {\n\treturn new Promise((resolve, reject) => {\n\t\t// Build request object\n\t\tconst request = new Request(url, options_);\n\t\tconst options = getNodeRequestOptions(request);\n\t\tif (!supportedSchemas.has(options.protocol)) {\n\t\t\tthrow new TypeError(`node-fetch cannot load ${url}. URL scheme \"${options.protocol.replace(/:$/, '')}\" is not supported.`);\n\t\t}\n\n\t\tif (options.protocol === 'data:') {\n\t\t\tconst data = dataUriToBuffer(request.url.toString());\n\t\t\tconst response = new Response(data, {headers: {'Content-Type': data.typeFull}});\n\t\t\tresolve(response);\n\t\t\treturn;\n\t\t}\n\n\t\t// Wrap http.request into fetch\n\t\tconst send = (options.protocol === 'https:' ? https : http).request;\n\t\tconst {signal} = request;\n\t\t/** @type {Response|null} */\n\t\tlet response = null;\n\t\t/** @type {import('http').IncomingMessage|null} */\n\t\tlet response_ = null;\n\n\t\tconst abort = () => {\n\t\t\tconst error = new AbortError('The operation was aborted.');\n\t\t\treject(error);\n\t\t\tif (request.body) {\n\t\t\t\trequest.body.cancel(error);\n\t\t\t}\n\n\t\t\tif (!response_) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresponse_.emit('error', error);\n\t\t};\n\n\t\tif (signal && signal.aborted) {\n\t\t\tabort();\n\t\t\treturn;\n\t\t}\n\n\t\tconst abortAndFinalize = () => {\n\t\t\tabort();\n\t\t\tfinalize();\n\t\t};\n\n\t\t// Send request\n\t\tconst request_ = send(options);\n\n\t\tif (signal) {\n\t\t\tsignal.addEventListener('abort', abortAndFinalize);\n\t\t}\n\n\t\tconst finalize = () => {\n\t\t\trequest_.abort();\n\t\t\tif (signal) {\n\t\t\t\tsignal.removeEventListener('abort', abortAndFinalize);\n\t\t\t}\n\t\t};\n\n\t\trequest_.on('error', err => {\n\t\t\t// @ts-expect-error - err may not be SystemError\n\t\t\treject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));\n\t\t\tfinalize();\n\t\t});\n\n\t\tfixResponseChunkedTransferBadEnding(request_, err => {\n\t\t\tif (signal && signal.aborted) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tresponse_?.emit(\"error\", err);\n\t\t});\n\n\t\t/* c8 ignore next 18 */\n\t\tif (parseInt(process.version.substring(1)) < 14) {\n\t\t\t// Before Node.js 14, pipeline() does not fully support async iterators and does not always\n\t\t\t// properly handle when the socket close/end events are out of order.\n\t\t\trequest_.on('socket', s => {\n\t\t\t\ts.prependListener('close', hadError => {\n\t\t\t\t\t// if a data listener is still present we didn't end cleanly\n\t\t\t\t\tconst hasDataListener = s.listenerCount('data') > 0;\n\n\t\t\t\t\t// if end happened before close but the socket didn't emit an error, do it now\n\t\t\t\t\tif (response && hasDataListener && !hadError && !(signal && signal.aborted)) {\n\t\t\t\t\t\tconst err = Object.assign(new Error('Premature close'), {\n\t\t\t\t\t\t\tcode: 'ERR_STREAM_PREMATURE_CLOSE'\n\t\t\t\t\t\t});\n\t\t\t\t\t\tresponse_?.emit('error', err);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\trequest_.on('response', incoming => {\n\t\t\tresponse_ = incoming;\n\t\t\trequest_.setTimeout(0);\n\t\t\tconst headers = fromRawHeaders(response_.rawHeaders);\n\n\t\t\t// HTTP fetch step 5\n\t\t\tif (isRedirect(Number(response_.statusCode))) {\n\t\t\t\t// HTTP fetch step 5.2\n\t\t\t\tconst location = headers.get('Location');\n\n\t\t\t\t// HTTP fetch step 5.3\n\t\t\t\tconst locationURL = location === null ? null : new URL(location, request.url);\n\n\t\t\t\t// HTTP fetch step 5.5\n\t\t\t\tswitch (request.redirect) {\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase 'manual':\n\t\t\t\t\t\t// Node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.\n\t\t\t\t\t\tif (locationURL !== null) {\n\t\t\t\t\t\t\theaders.set('Location', locationURL.toString());\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'follow': {\n\t\t\t\t\t\t// HTTP-redirect fetch step 2\n\t\t\t\t\t\tif (locationURL === null) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 5\n\t\t\t\t\t\tif (request.counter >= request.follow) {\n\t\t\t\t\t\t\treject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 6 (counter increment)\n\t\t\t\t\t\t// Create a new Request object.\n\t\t\t\t\t\tconst requestOptions = {\n\t\t\t\t\t\t\theaders: new Headers(request.headers),\n\t\t\t\t\t\t\tfollow: request.follow,\n\t\t\t\t\t\t\tcounter: request.counter + 1,\n\t\t\t\t\t\t\tagent: request.agent,\n\t\t\t\t\t\t\tcompress: request.compress,\n\t\t\t\t\t\t\tmethod: request.method,\n\t\t\t\t\t\t\t// Note: We can not use `request.body` because send would have\n\t\t\t\t\t\t\t// consumed it already.\n\t\t\t\t\t\t\tbody: options_.body,\n\t\t\t\t\t\t\tsignal: request.signal,\n\t\t\t\t\t\t\tsize: request.size\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 9\n\t\t\t\t\t\tconst isStreamBody =\n\t\t\t\t\t\t\trequestOptions.body instanceof blob.ReadableStream ||\n\t\t\t\t\t\t\trequestOptions.body instanceof Stream.Readable;\n\t\t\t\t\t\tif (response_.statusCode !== 303 && isStreamBody) {\n\t\t\t\t\t\t\treject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 11\n\t\t\t\t\t\tif (response_.statusCode === 303 || ((response_.statusCode === 301 || response_.statusCode === 302) && request.method === 'POST')) {\n\t\t\t\t\t\t\trequestOptions.method = 'GET';\n\t\t\t\t\t\t\trequestOptions.body = undefined;\n\t\t\t\t\t\t\trequestOptions.headers.delete('content-length');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 15\n\t\t\t\t\t\tfetch(new Request(locationURL.href, requestOptions)).then(resolve, reject);\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn reject(new TypeError(`Redirect option '${request.redirect}' is not a valid value of RequestRedirect`));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Prepare response\n\t\t\tif (signal) {\n\t\t\t\tresponse_.once('end', () => {\n\t\t\t\t\tsignal.removeEventListener('abort', abortAndFinalize);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tlet body = Stream.pipeline(response_, new Stream.PassThrough(), reject);\n\t\t\t// see https://github.com/nodejs/node/pull/29376\n\t\t\t/* c8 ignore next 3 */\n\t\t\tif (process.version < 'v12.10') {\n\t\t\t\tresponse_.on('aborted', abortAndFinalize);\n\t\t\t}\n\n\t\t\tconst responseOptions = {\n\t\t\t\turl: request.url,\n\t\t\t\tstatus: response_.statusCode,\n\t\t\t\tstatusText: response_.statusMessage,\n\t\t\t\theaders,\n\t\t\t\tsize: request.size,\n\t\t\t\tcounter: request.counter,\n\t\t\t\thighWaterMark: request.highWaterMark\n\t\t\t};\n\n\t\t\t// HTTP-network fetch step 12.1.1.3\n\t\t\tconst codings = headers.get('Content-Encoding');\n\n\t\t\t// HTTP-network fetch step 12.1.1.4: handle content codings\n\n\t\t\t// in following scenarios we ignore compression support\n\t\t\t// 1. compression support is disabled\n\t\t\t// 2. HEAD request\n\t\t\t// 3. no Content-Encoding header\n\t\t\t// 4. no content response (204)\n\t\t\t// 5. content not modified response (304)\n\t\t\tif (!request.compress || request.method === 'HEAD' || codings === null || response_.statusCode === 204 || response_.statusCode === 304) {\n\t\t\t\tresponse = new Response(body, responseOptions);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For Node v6+\n\t\t\t// Be less strict when decoding compressed responses, since sometimes\n\t\t\t// servers send slightly invalid responses that are still accepted\n\t\t\t// by common browsers.\n\t\t\t// Always using Z_SYNC_FLUSH is what cURL does.\n\t\t\tconst zlibOptions = {\n\t\t\t\tflush: zlib.Z_SYNC_FLUSH,\n\t\t\t\tfinishFlush: zlib.Z_SYNC_FLUSH\n\t\t\t};\n\n\t\t\t// For gzip\n\t\t\tif (codings === 'gzip' || codings === 'x-gzip') {\n\t\t\t\tbody = Stream.pipeline(body, zlib.createGunzip(zlibOptions), reject);\n\t\t\t\tresponse = new Response(fromAsyncIterable(body), responseOptions);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For deflate\n\t\t\tif (codings === 'deflate' || codings === 'x-deflate') {\n\t\t\t\t// Handle the infamous raw deflate response from old servers\n\t\t\t\t// a hack for old IIS and Apache servers\n\t\t\t\tconst raw = Stream.pipeline(response_, new Stream.PassThrough(), reject);\n\t\t\t\traw.once('data', chunk => {\n\t\t\t\t\t// See http://stackoverflow.com/questions/37519828\n\t\t\t\t\tif ((chunk[0] & 0x0F) === 0x08) {\n\t\t\t\t\t\tbody = Stream.pipeline(body, zlib.createInflate(), reject);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbody = Stream.pipeline(body, zlib.createInflateRaw(), reject);\n\t\t\t\t\t}\n\n\t\t\t\t\tresponse = new Response(fromAsyncIterable(body), responseOptions);\n\t\t\t\t\tresolve(response);\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For br\n\t\t\tif (codings === 'br') {\n\t\t\t\tbody = Stream.pipeline(body, zlib.createBrotliDecompress(), reject);\n\t\t\t\tresponse = new Response(fromAsyncIterable(body), responseOptions);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Otherwise, use response as-is\n\t\t\tresponse = new Response(fromAsyncIterable(body), responseOptions);\n\t\t\tresolve(response);\n\t\t});\n\n\t\twriteToStream(request_, request);\n\t});\n}\n\n/**\n * \n * @param {import('http').ClientRequest} request \n * @param {(error:Error) => void} errorCallback \n */\nfunction fixResponseChunkedTransferBadEnding(request, errorCallback) {\n\t/** @type {import('net').Socket} */\n\tlet socket;\n\n\trequest.on('socket', s => {\n\t\tsocket = s;\n\t});\n\n\trequest.on('response', response => {\n\n\t\tconst {headers} = response;\n\n\t\tif (headers['transfer-encoding'] === 'chunked' && !headers['content-length']) {\n\t\t\tsocket.prependListener('close', hadError => {\n\t\t\t\t// if a data listener is still present we didn't end cleanly\n\t\t\t\tconst hasDataListener = socket.listenerCount('data') > 0;\n\t\t\t\tif (hasDataListener && !hadError) {\n\t\t\t\t\tconst err = Object.assign(new Error('Premature close'), {\n\t\t\t\t\t\tcode: 'ERR_STREAM_PREMATURE_CLOSE'\n\t\t\t\t\t});\n\t\t\t\t\terrorCallback(err);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n}\n\nObject.defineProperty(exports, 'Blob', {\n\tenumerable: true,\n\tget: function () { return blob.Blob; }\n});\nObject.defineProperty(exports, 'ReadableStream', {\n\tenumerable: true,\n\tget: function () { return blob.ReadableStream; }\n});\nObject.defineProperty(exports, 'FormData', {\n\tenumerable: true,\n\tget: function () { return formData.FormData; }\n});\nexports.AbortError = AbortError;\nexports.FetchError = FetchError;\nexports.Headers = Headers;\nexports.Request = Request;\nexports.Response = Response;\nexports[\"default\"] = fetch;\nexports.isRedirect = isRedirect;\n//# sourceMappingURL=index.cjs.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar blob = require('@web-std/blob');\n\n/**\n * @implements {globalThis.File}\n */\nclass File extends blob.Blob {\n /**\n *\n * @param {BlobPart[]} init\n * @param {string} name - A USVString representing the file name or the path\n * to the file.\n * @param {FilePropertyBag} [options]\n */\n constructor(\n init,\n name = panic(new TypeError(\"File constructor requires name argument\")),\n options = {}\n ) {\n super(init, options);\n // Per File API spec https://w3c.github.io/FileAPI/#file-constructor\n // Every \"/\" character of file name must be replaced with a \":\".\n /** @private */\n this._name = name;\n // It appears that browser do not follow the spec here.\n // String(name).replace(/\\//g, \":\")\n /** @private */\n this._lastModified = options.lastModified || Date.now();\n }\n\n /**\n * The name of the file referenced by the File object.\n * @type {string}\n */\n get name() {\n return this._name\n }\n\n /**\n * The path the URL of the File is relative to.\n * @type {string}\n */\n get webkitRelativePath() {\n return \"\"\n }\n\n /**\n * Returns the last modified time of the file, in millisecond since the UNIX\n * epoch (January 1st, 1970 at Midnight).\n * @returns {number}\n */\n get lastModified() {\n return this._lastModified\n }\n\n get [Symbol.toStringTag]() {\n return \"File\"\n }\n}\n\n/**\n * @param {*} error\n * @returns {never}\n */\nconst panic = error => {\n throw error\n};\n\nexports.File = File;\n//# sourceMappingURL=file.cjs.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar blob = require('@web-std/blob');\nvar file = require('./file.cjs');\n\n// Electron-renderer should get the browser implementation instead of node\n// Browser configuration is not enough\n\n// Marking export as a DOM File object instead of custom class.\n/** @type {typeof globalThis.File} */\nconst File = typeof globalThis.File === \"function\" ? globalThis.File : file.File;\n\nObject.defineProperty(exports, 'Blob', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn blob.Blob;\n\t}\n});\nexports.File = File;\n//# sourceMappingURL=lib.node.cjs.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/**\n * @implements {globalThis.FormData}\n */\nclass FormData {\n /**\n * @param {HTMLFormElement} [form]\n */\n constructor(form) {\n if (form !== undefined) {\n const error = isHTMLFormElement(form)\n ? new TypeError(\n \"FormData constructor: HTMLFormElement parameter is not supported, if you need it submit an issue\"\n )\n : new TypeError(\n \"FormData constructor: Argument 1 does not implement interface HTMLFormElement.\"\n );\n\n throw error\n }\n\n /**\n * @private\n * @readonly\n * @type {Array<[string, FormDataEntryValue]>}\n */\n this._entries = [];\n\n Object.defineProperty(this, \"_entries\", { enumerable: false });\n }\n get [Symbol.toStringTag]() {\n return \"FormData\"\n }\n\n /**\n * Appends a new value onto an existing key inside a FormData object, or adds\n * the key if it does not already exist.\n *\n * The difference between `set` and `append` is that if the specified key\n * already exists, `set` will overwrite all existing values with the new one,\n * whereas `append` will append the new value onto the end of the existing\n * set of values.\n *\n * @param {string} name\n * @param {string|Blob|File} value - The name of the field whose data is\n * contained in value.\n * @param {string} [filename] - The filename reported to the server, when a\n * value is a `Blob` or a `File`. The default filename for a `Blob` objects is\n * `\"blob\"`. The default filename for a `File` is the it's name.\n */\n append(\n name,\n value = panic(\n new TypeError(\"FormData.append: requires at least 2 arguments\")\n ),\n filename\n ) {\n this._entries.push([name, toEntryValue(value, filename)]);\n }\n\n /**\n * Deletes a key and all its values from a FormData object.\n *\n * @param {string} name\n */\n delete(\n name = panic(new TypeError(\"FormData.delete: requires string argument\"))\n ) {\n const entries = this._entries;\n let index = 0;\n while (index < entries.length) {\n const [entryName] = /** @type {[string, FormDataEntryValue]}*/ (\n entries[index]\n );\n if (entryName === name) {\n entries.splice(index, 1);\n } else {\n index++;\n }\n }\n }\n\n /**\n * Returns the first value associated with a given key from within a\n * FormData object.\n *\n * @param {string} name\n * @returns {FormDataEntryValue|null}\n */\n\n get(name = panic(new TypeError(\"FormData.get: requires string argument\"))) {\n for (const [entryName, value] of this._entries) {\n if (entryName === name) {\n return value\n }\n }\n return null\n }\n\n /**\n * Returns an array of all the values associated with a given key from within\n * a FormData.\n *\n * @param {string} name\n * @returns {FormDataEntryValue[]}\n */\n getAll(\n name = panic(new TypeError(\"FormData.getAll: requires string argument\"))\n ) {\n const values = [];\n for (const [entryName, value] of this._entries) {\n if (entryName === name) {\n values.push(value);\n }\n }\n return values\n }\n\n /**\n * Returns a boolean stating whether a FormData object contains a certain key.\n *\n * @param {string} name\n */\n\n has(name = panic(new TypeError(\"FormData.has: requires string argument\"))) {\n for (const [entryName] of this._entries) {\n if (entryName === name) {\n return true\n }\n }\n return false\n }\n\n /**\n * Sets a new value for an existing key inside a FormData object, or adds the\n * key/value if it does not already exist.\n *\n * @param {string} name\n * @param {string|Blob|File} value\n * @param {string} [filename]\n */\n\n set(\n name,\n value = panic(new TypeError(\"FormData.set: requires at least 2 arguments\")),\n filename\n ) {\n let index = 0;\n const { _entries: entries } = this;\n const entryValue = toEntryValue(value, filename);\n let wasSet = false;\n while (index < entries.length) {\n const entry = /** @type {[string, FormDataEntryValue]}*/ (entries[index]);\n if (entry[0] === name) {\n if (wasSet) {\n entries.splice(index, 1);\n } else {\n wasSet = true;\n entry[1] = entryValue;\n index++;\n }\n } else {\n index++;\n }\n }\n\n if (!wasSet) {\n entries.push([name, entryValue]);\n }\n }\n\n /**\n * Method returns an iterator allowing to go through all key/value pairs\n * contained in this object.\n */\n entries() {\n return this._entries.values()\n }\n\n /**\n * Returns an iterator allowing to go through all keys of the key/value pairs\n * contained in this object.\n *\n * @returns {IterableIterator}\n */\n *keys() {\n for (const [name] of this._entries) {\n yield name;\n }\n }\n\n /**\n * Returns an iterator allowing to go through all values contained in this\n * object.\n *\n * @returns {IterableIterator}\n */\n *values() {\n for (const [_, value] of this._entries) {\n yield value;\n }\n }\n\n [Symbol.iterator]() {\n return this._entries.values()\n }\n\n /**\n * @param {(value: FormDataEntryValue, key: string, parent: globalThis.FormData) => void} fn\n * @param {any} [thisArg]\n * @returns {void}\n */\n forEach(fn, thisArg) {\n for (const [key, value] of this._entries) {\n fn.call(thisArg, value, key, this);\n }\n }\n}\n\n/**\n * @param {any} value\n * @returns {value is HTMLFormElement}\n */\nconst isHTMLFormElement = value =>\n Object.prototype.toString.call(value) === \"[object HTMLFormElement]\";\n\n/**\n * @param {string|Blob|File} value\n * @param {string} [filename]\n * @returns {FormDataEntryValue}\n */\nconst toEntryValue = (value, filename) => {\n if (isFile(value)) {\n return filename != null ? new BlobFile([value], filename, value) : value\n } else if (isBlob(value)) {\n return new BlobFile([value], filename != null ? filename : \"blob\")\n } else {\n if (filename != null) {\n throw new TypeError(\n \"filename is only supported when value is Blob or File\"\n )\n }\n return `${value}`\n }\n};\n\n/**\n * @param {any} value\n * @returns {value is File}\n */\nconst isFile = value =>\n Object.prototype.toString.call(value) === \"[object File]\" &&\n typeof value.name === \"string\";\n\n/**\n * @param {any} value\n * @returns {value is Blob}\n */\nconst isBlob = value =>\n Object.prototype.toString.call(value) === \"[object Blob]\";\n\n/**\n * Simple `File` implementation that just wraps a given blob.\n * @implements {globalThis.File}\n */\nconst BlobFile = class File {\n /**\n * @param {[Blob]} parts\n * @param {string} name\n * @param {FilePropertyBag} [options]\n */\n constructor([blob], name, { lastModified = Date.now() } = {}) {\n this.blob = blob;\n this.name = name;\n this.lastModified = lastModified;\n }\n get webkitRelativePath() {\n return \"\"\n }\n get size() {\n return this.blob.size\n }\n get type() {\n return this.blob.type\n }\n /**\n *\n * @param {number} [start]\n * @param {number} [end]\n * @param {string} [contentType]\n */\n slice(start, end, contentType) {\n return this.blob.slice(start, end, contentType)\n }\n stream() {\n return this.blob.stream()\n }\n text() {\n return this.blob.text()\n }\n arrayBuffer() {\n return this.blob.arrayBuffer()\n }\n get [Symbol.toStringTag]() {\n return \"File\"\n }\n};\n\n/**\n * @param {*} error\n * @returns {never}\n */\nconst panic = error => {\n throw error\n};\n\nexports.FormData = FormData;\n//# sourceMappingURL=form-data.cjs.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar formData = require('./form-data.cjs');\n\n// @ts-check\n\n// Electron-renderer should get the browser implementation instead of node\n// which is why we check global first.\nconst FormData =\n typeof globalThis.FormData === \"function\"\n ? globalThis.FormData\n : formData.FormData;\n\nexports.FormData = FormData;\n//# sourceMappingURL=lib.node.cjs.map\n","try {\n module.exports = require(\"stream/web\")\n} catch (error) {\n module.exports = require(\"web-streams-polyfill/ponyfill\")\n}\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst MAX_HEADER_LENGTH = 2000;\nconst THROW_ON_MAX_HEADER_LENGTH_EXCEEDED = false;\n\nfunction hasRel (x) {\n return x && x.rel\n}\n\nfunction intoRels (acc, x) {\n function splitRel (rel) {\n acc[rel] = Object.assign({}, x, { rel: rel });\n }\n\n x.rel.split(/\\s+/).forEach(splitRel);\n\n return acc\n}\n\nfunction createObjects (acc, p) {\n // rel=\"next\" => 1: rel 2: next\n const m = p.match(/\\s*(.+)\\s*=\\s*\"?([^\"]+)\"?/);\n if (m) acc[m[1]] = m[2];\n return acc\n}\n\nfunction parseLink (link) {\n try {\n const m = link.match(/]*)>(.*)/);\n const linkUrl = m[1];\n const parts = m[2].split(';');\n const qry = {};\n // The origin is unused but it's required to parse relative URLs\n const url = new URL(linkUrl, 'https://example.com');\n\n for (const [key, value] of url.searchParams) {\n qry[key] = value;\n }\n\n parts.shift();\n\n let info = parts.reduce(createObjects, {});\n info = Object.assign({}, qry, info);\n info.url = linkUrl;\n return info\n } catch {\n return null\n }\n}\n\nfunction checkHeader (linkHeader, options) {\n if (!linkHeader) return false\n\n options = options || {};\n const maxHeaderLength = options.maxHeaderLength || MAX_HEADER_LENGTH;\n const throwOnMaxHeaderLengthExceeded = options.throwOnMaxHeaderLengthExceeded || THROW_ON_MAX_HEADER_LENGTH_EXCEEDED;\n\n if (linkHeader.length > maxHeaderLength) {\n if (throwOnMaxHeaderLengthExceeded) {\n throw new Error('Input string too long, it should be under ' + maxHeaderLength + ' characters.')\n } else {\n return false\n }\n }\n return true\n}\n\nfunction parseLinkHeader (linkHeader, options) {\n if (!checkHeader(linkHeader, options)) return null\n\n return linkHeader.split(/,\\s* throttle(() => {})\n}\n\n/**\n * Rate limiter used by static API if no rate limiter is passed. Note that each\n * instance of the Web3Storage class gets it's own limiter if none is passed.\n * This is because rate limits are enforced per API token.\n */\nconst globalRateLimiter = createRateLimiter();\n\n/**\n * @implements Service\n */\nclass Web3Storage {\n /**\n * Constructs a client bound to the given `options.token` and\n * `options.endpoint`.\n *\n * @example\n * ```js\n * import { Web3Storage } from 'web3.storage'\n * const client = new Web3Storage({ token: API_TOKEN })\n * ```\n *\n * @param {{token: string, endpoint?:URL, rateLimiter?: RateLimiter}} options\n */\n constructor ({\n token,\n endpoint = new URL('https://api.web3.storage'),\n rateLimiter\n }) {\n /**\n * Authorization token.\n *\n * @readonly\n */\n this.token = token;\n /**\n * Service API endpoint `URL`.\n * @readonly\n */\n this.endpoint = endpoint;\n /**\n * @readonly\n */\n this.rateLimiter = rateLimiter || createRateLimiter();\n }\n\n /**\n * @hidden\n * @param {string} token\n * @returns {Record}\n */\n static headers (token) {\n if (!token) throw new Error('missing token')\n return {\n Authorization: `Bearer ${token}`,\n 'X-Client': 'web3.storage/js'\n }\n }\n\n /**\n * @param {Service} service\n * @param {Iterable} files\n * @param {PutOptions} [options]\n * @returns {Promise}\n */\n static async put ({ endpoint, token, rateLimiter = globalRateLimiter }, files, {\n onRootCidReady,\n onStoredChunk,\n maxRetries = MAX_PUT_RETRIES,\n maxChunkSize = DEFAULT_CHUNK_SIZE,\n wrapWithDirectory = true,\n name\n } = {}) {\n if (maxChunkSize >= MAX_CHUNK_SIZE || maxChunkSize < MAX_BLOCK_SIZE) {\n throw new Error('maximum chunk size must be less than 100MiB and greater than or equal to 1MB')\n }\n const blockstore = new fs.FsBlockStore();\n try {\n const { out, root } = await pack.pack({\n input: Array.from(files).map(toImportCandidate),\n blockstore,\n wrapWithDirectory,\n maxChunkSize: MAX_BLOCK_SIZE,\n maxChildrenPerNode: 1024\n });\n onRootCidReady && onRootCidReady(root.toString());\n const car$1 = await car.CarReader.fromIterable(out);\n return await Web3Storage.putCar({ endpoint, token, rateLimiter }, car$1, { onStoredChunk, maxRetries, maxChunkSize, name })\n } finally {\n await blockstore.close();\n }\n }\n\n /**\n * @param {Service} service\n * @param {import('@ipld/car/api').CarReader} car\n * @param {PutCarOptions} [options]\n * @returns {Promise}\n */\n static async putCar ({ endpoint, token, rateLimiter = globalRateLimiter }, car, {\n name,\n onStoredChunk,\n maxRetries = MAX_PUT_RETRIES,\n maxChunkSize = DEFAULT_CHUNK_SIZE,\n decoders\n } = {}) {\n if (maxChunkSize >= MAX_CHUNK_SIZE || maxChunkSize < MAX_BLOCK_SIZE) {\n throw new Error('maximum chunk size must be less than 100MiB and greater than or equal to 1MB')\n }\n const targetSize = maxChunkSize;\n const url = new URL('car', endpoint);\n let headers = Web3Storage.headers(token);\n\n if (name) {\n headers = { ...headers, 'X-Name': encodeURIComponent(name) };\n }\n\n const roots = await car.getRoots();\n if (roots[0] == null) {\n throw new Error('missing root CID')\n }\n if (roots.length > 1) {\n throw new Error('too many roots')\n }\n\n const carRoot = roots[0].toString();\n const splitter = new treewalk.TreewalkCarSplitter(car, targetSize, { decoders });\n\n /**\n * @param {AsyncIterable} car\n * @returns {Promise}\n */\n const onCarChunk = async car => {\n const carParts = [];\n for await (const part of car) {\n carParts.push(part);\n }\n\n const carFile = new blob.Blob(carParts, { type: 'application/vnd.ipld.car' });\n const res = await pRetry__default[\"default\"](\n async () => {\n await rateLimiter();\n const request = await fetch__default[\"default\"](url.toString(), {\n method: 'POST',\n headers,\n body: carFile\n });\n /* c8 ignore next 3 */\n if (request.status === 429) {\n throw new Error('rate limited')\n }\n const res = await request.json();\n if (!request.ok) {\n throw new Error(res.message)\n }\n\n if (res.cid !== carRoot) {\n throw new Error(`root CID mismatch, expected: ${carRoot}, received: ${res.cid}`)\n }\n return res.cid\n },\n { retries: maxRetries }\n );\n\n onStoredChunk && onStoredChunk(carFile.size);\n return res\n };\n\n const upload = streamingIterables.transform(MAX_CONCURRENT_UPLOADS, onCarChunk);\n for await (const _ of upload(splitter.cars())) {} // eslint-disable-line\n return carRoot\n }\n\n /**\n * @param {Service} service\n * @param {CIDString} cid\n * @returns {Promise}\n */\n static async get ({ endpoint, token, rateLimiter = globalRateLimiter }, cid) {\n const url = new URL(`car/${cid}`, endpoint);\n await rateLimiter();\n const res = await fetch__default[\"default\"](url.toString(), {\n method: 'GET',\n headers: Web3Storage.headers(token)\n });\n /* c8 ignore next 3 */\n if (res.status === 429) {\n throw new Error('rate limited')\n }\n return toWeb3Response(res)\n }\n\n /**\n * @param {Service} service\n * @param {CIDString} cid\n * @returns {Promise}\n */\n /* c8 ignore next 4 */\n static async delete ({ endpoint, token, rateLimiter = globalRateLimiter }, cid) {\n console.log('Not deleting', cid, endpoint, token, rateLimiter);\n throw Error('.delete not implemented yet')\n }\n\n /**\n * @param {Service} service\n * @param {CIDString} cid\n * @returns {Promise}\n */\n static async status ({ endpoint, token, rateLimiter = globalRateLimiter }, cid) {\n const url = new URL(`status/${cid}`, endpoint);\n await rateLimiter();\n const res = await fetch__default[\"default\"](url.toString(), {\n method: 'GET',\n headers: Web3Storage.headers(token)\n });\n /* c8 ignore next 3 */\n if (res.status === 429) {\n throw new Error('rate limited')\n }\n if (res.status === 404) {\n return undefined\n }\n if (!res.ok) {\n throw new Error(res.statusText)\n }\n return res.json()\n }\n\n /**\n * @param {Service} service\n * @param {object} [opts]\n * @param {string} [opts.before] list items uploaded before this ISO 8601 date string\n * @param {number} [opts.maxResults] maximum number of results to return\n * @returns {AsyncIterable}\n */\n static async * list (service, { before = new Date().toISOString(), maxResults = Infinity } = {}) {\n /**\n * @param {Service} service\n * @param {{before: string, size: number}} opts\n * @returns {Promise}\n */\n async function listPage ({ endpoint, token, rateLimiter = globalRateLimiter }, { before, size }) {\n const search = new URLSearchParams({ before, size: size.toString() });\n const url = new URL(`user/uploads?${search}`, endpoint);\n await rateLimiter();\n return fetch__default[\"default\"](url.toString(), {\n method: 'GET',\n headers: {\n ...Web3Storage.headers(token),\n 'Access-Control-Request-Headers': 'Link'\n }\n })\n }\n let count = 0;\n const size = maxResults > 100 ? 100 : maxResults;\n for await (const res of paginator(listPage, service, { before, size })) {\n if (!res.ok) {\n /* c8 ignore next 3 */\n if (res.status === 429) {\n throw new Error('rate limited')\n }\n\n /* c8 ignore next 2 */\n const errorMessage = await res.json();\n throw new Error(`${res.status} ${res.statusText} ${errorMessage ? '- ' + errorMessage.message : ''}`)\n }\n const page = await res.json();\n for (const upload of page) {\n if (++count > maxResults) {\n return\n }\n yield upload;\n }\n }\n }\n\n // Just a sugar so you don't have to pass around endpoint and token around.\n\n /**\n * Uploads files to web3.storage. Files are hashed in the client and uploaded as a single\n * [Content Addressed Archive(CAR)](https://github.com/ipld/specs/blob/master/block-layer/content-addressable-archives.md).\n * Takes a [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob)\n *\n * Returns the corresponding Content Identifier (CID).\n *\n * @example\n * ```js\n * const file = new File(['hello world'], 'hello.txt', { type: 'text/plain' })\n * const cid = await client.put([file])\n * ```\n * @param {Iterable} files\n * @param {PutOptions} [options]\n */\n put (files, options) {\n return Web3Storage.put(this, files, options)\n }\n\n /**\n * Uploads a CAR ([Content Addressed Archive](https://github.com/ipld/specs/blob/master/block-layer/content-addressable-archives.md)) file to web3.storage.\n * Takes a CarReader interface from @ipld/car\n *\n * Returns the corresponding Content Identifier (CID).\n *\n * @example\n * ```js\n * import fs from 'fs'\n * import { Readable } from 'stream'\n * import { CarReader, CarWriter } from '@ipld/car'\n * import * as raw from 'multiformats/codecs/raw'\n * import { CID } from 'multiformats/cid'\n * import { sha256 } from 'multiformats/hashes/sha2'\n *\n * async function getCar() {\n * const bytes = new TextEncoder().encode('random meaningless bytes')\n * const hash = await sha256.digest(raw.encode(bytes))\n * const cid = CID.create(1, raw.code, hash)\n *\n * // create the writer and set the header with a single root\n * const { writer, out } = await CarWriter.create([cid])\n * Readable.from(out).pipe(fs.createWriteStream('example.car'))\n\n * // store a new block, creates a new file entry in the CAR archive\n * await writer.put({ cid, bytes })\n * await writer.close()\n\n * const inStream = fs.createReadStream('example.car')\n * // read and parse the entire stream in one go, this will cache the contents of\n * // the car in memory so is not suitable for large files.\n * const reader = await CarReader.fromIterable(inStream)\n * return reader\n * }\n *\n * const car = await getCar()\n * const cid = await client.putCar(car)\n * ```\n * @param {import('@ipld/car/api').CarReader} car\n * @param {PutCarOptions} [options]\n */\n putCar (car, options) {\n return Web3Storage.putCar(this, car, options)\n }\n\n /**\n * Fetch the Content Addressed Archive by its root CID.\n * @param {CIDString} cid\n */\n get (cid) {\n return Web3Storage.get(this, cid)\n }\n\n /**\n * @param {CIDString} cid\n */\n /* c8 ignore next 3 */\n delete (cid) {\n return Web3Storage.delete(this, cid)\n }\n\n /**\n * Fetch info on Filecoin deals and IPFS pins that a given CID is replicated in.\n * @param {CIDString} cid\n */\n status (cid) {\n return Web3Storage.status(this, cid)\n }\n\n /**\n * Find all uploads for this account. Use a `for await...of` loop to fetch them all.\n * @example\n * Fetch all the uploads\n * ```js\n * const uploads = []\n * for await (const item of client.list()) {\n * uploads.push(item)\n * }\n * ```\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of\n * @param {object} [opts]\n * @param {string} [opts.before] list items uploaded before this ISO 8601 date string\n * @param {number} [opts.maxResults] maximum number of results to return\n * @returns {AsyncIterable}\n */\n list (opts) {\n return Web3Storage.list(this, opts)\n }\n}\n\n/**\n * Map a UnixFSEntry to a File with a cid property\n * @param {UnixFSEntry} entry\n * @returns {Promise}\n */\nasync function toWeb3File ({ content, path, cid }) {\n const chunks = [];\n for await (const chunk of content()) {\n chunks.push(chunk);\n }\n const file$1 = new file.File(chunks, toFilenameWithPath(path));\n return Object.assign(file$1, { cid: cid.toString() })\n}\n\n/**\n * Trim the root cid from the path if there is anyting after it.\n * bafy...ic2q/path/to/pinpie.jpg => path/to/pinpie.jpg\n * bafy...ic2q/pinpie.jpg => pinpie.jpg\n * bafk...52zy => bafk...52zy\n * @param {string} unixFsPath\n * @returns {string}\n */\nfunction toFilenameWithPath (unixFsPath) {\n const slashIndex = unixFsPath.indexOf('/');\n return slashIndex === -1 ? unixFsPath : unixFsPath.substring(slashIndex + 1)\n}\n\n/**\n * Add car unpacking smarts to the response object,\n * @param {Response} res\n * @returns {Web3Response}\n */\nfunction toWeb3Response (res) {\n const response = Object.assign(res, {\n unixFsIterator: async function * () {\n if (!res.ok) {\n throw new Error(`Response was not ok: ${res.status} ${res.statusText} - Check for { \"ok\": false } on the Response object before calling .unixFsIterator`)\n }\n /* c8 ignore next 3 */\n if (!res.body) {\n throw new Error('No body on response')\n }\n const blockstore = new fs.FsBlockStore();\n try {\n for await (const entry of unpack.unpackStream(res.body, { blockstore })) {\n yield entry;\n }\n } finally {\n await blockstore.close();\n }\n },\n files: async () => {\n if (!res.ok) {\n throw new Error(`Response was not ok: ${res.status} ${res.statusText} - Check for { \"ok\": false } on the Response object before calling .files`)\n }\n const files = [];\n // @ts-ignore we're using the enriched response here\n for await (const entry of response.unixFsIterator()) {\n if (entry.type === 'directory') {\n continue\n }\n const file = await toWeb3File(entry);\n files.push(file);\n }\n return files\n }\n });\n return response\n}\n\n/**\n * Convert the passed file to an \"import candidate\" - an object suitable for\n * passing to the ipfs-unixfs-importer. Note: content is an accessor so that\n * the stream is only created when needed.\n *\n * @param {Filelike} file\n */\nfunction toImportCandidate (file) {\n /** @type {ReadableStream} */\n let stream;\n return {\n path: file.name,\n get content () {\n stream = stream || file.stream();\n return stream\n }\n }\n}\n\n/**\n * Follow Link headers on a Response, to fetch all the things.\n *\n * @param {(service: Service, opts: any) => Promise} fn\n * @param {Service} service\n * @param {{}} opts\n */\nasync function * paginator (fn, service, opts) {\n let res = await fn(service, opts);\n yield res;\n let link = parseLinkHeader.parseLinkHeader(res.headers.get('Link') || '');\n // @ts-ignore\n while (link && link.next) {\n // @ts-ignore\n res = await fn(service, link.next);\n yield res;\n link = parseLinkHeader.parseLinkHeader(res.headers.get('Link') || '');\n }\n}\n\nObject.defineProperty(exports, 'filesFromPath', {\n enumerable: true,\n get: function () { return filesFromPath.filesFromPath; }\n});\nObject.defineProperty(exports, 'getFilesFromPath', {\n enumerable: true,\n get: function () { return filesFromPath.getFilesFromPath; }\n});\nObject.defineProperty(exports, 'Blob', {\n enumerable: true,\n get: function () { return blob.Blob; }\n});\nObject.defineProperty(exports, 'File', {\n enumerable: true,\n get: function () { return file.File; }\n});\nexports.Web3Storage = Web3Storage;\nexports.createRateLimiter = createRateLimiter;\n//# sourceMappingURL=lib.cjs.map\n","module.exports = require(\"assert\");","module.exports = require(\"buffer\");","module.exports = require(\"constants\");","module.exports = require(\"crypto\");","module.exports = require(\"events\");","module.exports = require(\"fs\");","module.exports = require(\"http\");","module.exports = require(\"https\");","module.exports = require(\"net\");","module.exports = require(\"os\");","module.exports = require(\"path\");","module.exports = require(\"stream\");","module.exports = require(\"tls\");","module.exports = require(\"url\");","module.exports = require(\"util\");","module.exports = require(\"zlib\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","\nif (typeof __webpack_require__ !== 'undefined') __webpack_require__.ab = __dirname + \"/\";","const core = require('@actions/core')\nconst { addToWeb3, pickName } = require('./web3')\n\nasync function run () {\n try {\n const name = pickName({\n repo: process.env.GITHUB_REPOSITORY,\n run: process.env.GITHUB_RUN_NUMBER,\n sha: process.env.GITHUB_SHA\n })\n const endpoint = new URL(core.getInput('web3_api'))\n const pathToAdd = core.getInput('path_to_add')\n const token = core.getInput('web3_token')\n const includeHidden = core.getInput('include_hidden')\n const wrapWithDirectory = core.getBooleanInput('wrap_with_directory')\n core.info(`Adding ${pathToAdd} to ${endpoint.origin}`)\n const { cid, url } = await addToWeb3({ endpoint, token, name, pathToAdd, wrapWithDirectory, includeHidden })\n core.info(url)\n core.setOutput('cid', cid)\n core.setOutput('url', url)\n } catch (error) {\n core.setFailed(error.message)\n }\n}\n\nrun()\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;A;;;;;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;A;;;;;;ACvTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;A;;;;;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;A;;;;;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;A;;;;;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACxhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AChaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACnPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AChGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACrHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACxFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACnJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC1XA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AChKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC1IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC9UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACzNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC5QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AClIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACxMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC1HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AClKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC3LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACpPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACtIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACvPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACtFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC7KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;A;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC7GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;AC/bA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;ACrHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AClWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AClXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACtEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AClGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACrFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACzGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC1JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC9GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC5HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC3YA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC1NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC1aA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;AC1KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC15BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACnKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC5LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC1TA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACvIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;ACxDA;;;A;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAqBA;AACA;;;A;;;;;;ACpkBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACpFA;AACA;AACA;AACA;;;A;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC1ZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC7IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACvMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACpaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AChdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;ACpFA;;;;;;;;;AASA;;;;;A;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;A;;;;;ACxDA;;A;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACjKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;A;;;;;ACzPA;AACA;AACA,KACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC77BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;A;;;;;ACjEA;;;A;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACvQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;AC7BA;AACA;AACA;AACA;AACA;;;A;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;ACNA;AACA;AACA;AACA;AACA;AACA,KACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;ACjwIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;AChBA;;;A;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACnTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC98DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AChUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;AChBA;AACA;AACA;AACA;AACA;;;A;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC/EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;;;;;AC1kBA;;A;;;;;;ACAA;;A;;;;;;ACAA;;A;;;;;;ACAA;;A;;;;;;ACAA;;A;;;;;;ACAA;;A;;;;;;ACAA;;A;;;;;;ACAA;;A;;;;;;ACAA;;A;;;;;;ACAA;;A;;;;;;ACAA;;A;;;;;;ACAA;;A;;;;;;ACAA;;A;;;;;;ACAA;;A;;;;;;ACAA;;A;;;;;;ACAA;;A;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC7BA;AACA;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;A","sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5lBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1XA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACzNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC7KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC7GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/bA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACzGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3YA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1aA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC15BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1TA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxDA;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAsBA;;;;;;;;;ACpkBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpFA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1ZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC7IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpFA;;;;;;;;;AASA;;;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACxDA;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACzPA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC77BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACjEA;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7BA;AACA;AACA;AACA;AACA;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjwIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChBA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC98DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChBA;AACA;AACA;AACA;AACA;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC/EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC1kBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC7BA;AACA;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":["../webpack://add-to-web3/./node_modules/@actions/core/lib/command.js","../webpack://add-to-web3/./node_modules/@actions/core/lib/core.js","../webpack://add-to-web3/./node_modules/@actions/core/lib/file-command.js","../webpack://add-to-web3/./node_modules/@actions/core/lib/oidc-utils.js","../webpack://add-to-web3/./node_modules/@actions/core/lib/path-utils.js","../webpack://add-to-web3/./node_modules/@actions/core/lib/summary.js","../webpack://add-to-web3/./node_modules/@actions/core/lib/utils.js","../webpack://add-to-web3/./node_modules/@actions/http-client/lib/auth.js","../webpack://add-to-web3/./node_modules/@actions/http-client/lib/index.js","../webpack://add-to-web3/./node_modules/@actions/http-client/lib/proxy.js","../webpack://add-to-web3/./node_modules/@assemblyscript/loader/index.js","../webpack://add-to-web3/./node_modules/@ipld/car/cjs/car.js","../webpack://add-to-web3/./node_modules/@ipld/car/cjs/lib/decoder.js","../webpack://add-to-web3/./node_modules/@ipld/car/cjs/lib/encoder.js","../webpack://add-to-web3/./node_modules/@ipld/car/cjs/lib/indexed-reader.js","../webpack://add-to-web3/./node_modules/@ipld/car/cjs/lib/indexer.js","../webpack://add-to-web3/./node_modules/@ipld/car/cjs/lib/iterator-channel.js","../webpack://add-to-web3/./node_modules/@ipld/car/cjs/lib/iterator.js","../webpack://add-to-web3/./node_modules/@ipld/car/cjs/lib/reader-browser.js","../webpack://add-to-web3/./node_modules/@ipld/car/cjs/lib/reader.js","../webpack://add-to-web3/./node_modules/@ipld/car/cjs/lib/writer-browser.js","../webpack://add-to-web3/./node_modules/@ipld/car/cjs/lib/writer.js","../webpack://add-to-web3/./node_modules/@ipld/car/node_modules/@ipld/dag-cbor/cjs/index.js","../webpack://add-to-web3/./node_modules/@ipld/dag-cbor/cjs/index.js","../webpack://add-to-web3/./node_modules/@ipld/dag-pb/cjs/src/index.js","../webpack://add-to-web3/./node_modules/@ipld/dag-pb/cjs/src/pb-decode.js","../webpack://add-to-web3/./node_modules/@ipld/dag-pb/cjs/src/pb-encode.js","../webpack://add-to-web3/./node_modules/@ipld/dag-pb/cjs/src/util.js","../webpack://add-to-web3/./node_modules/@multiformats/murmur3/cjs/index.js","../webpack://add-to-web3/./node_modules/@protobufjs/aspromise/index.js","../webpack://add-to-web3/./node_modules/@protobufjs/base64/index.js","../webpack://add-to-web3/./node_modules/@protobufjs/eventemitter/index.js","../webpack://add-to-web3/./node_modules/@protobufjs/float/index.js","../webpack://add-to-web3/./node_modules/@protobufjs/inquire/index.js","../webpack://add-to-web3/./node_modules/@protobufjs/pool/index.js","../webpack://add-to-web3/./node_modules/@protobufjs/utf8/index.js","../webpack://add-to-web3/./node_modules/@web3-storage/multipart-parser/cjs/src/index.js","../webpack://add-to-web3/./node_modules/@web3-storage/multipart-parser/cjs/src/search.js","../webpack://add-to-web3/./node_modules/@web3-storage/multipart-parser/cjs/src/utils.js","../webpack://add-to-web3/./node_modules/balanced-match/index.js","../webpack://add-to-web3/./node_modules/blob-to-it/index.js","../webpack://add-to-web3/./node_modules/blockstore-core/cjs/src/base.js","../webpack://add-to-web3/./node_modules/blockstore-core/cjs/src/errors.js","../webpack://add-to-web3/./node_modules/blockstore-core/cjs/src/index.js","../webpack://add-to-web3/./node_modules/blockstore-core/cjs/src/memory.js","../webpack://add-to-web3/./node_modules/brace-expansion/index.js","../webpack://add-to-web3/./node_modules/browser-readablestream-to-it/index.js","../webpack://add-to-web3/./node_modules/carbites/cjs/lib/treewalk/index.js","../webpack://add-to-web3/./node_modules/carbites/cjs/lib/treewalk/joiner.js","../webpack://add-to-web3/./node_modules/carbites/cjs/lib/treewalk/splitter.js","../webpack://add-to-web3/./node_modules/cborg/cjs/cborg.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/0uint.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/1negint.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/2bytes.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/3string.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/4array.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/5map.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/6tag.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/7float.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/bl.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/byte-utils.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/common.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/decode.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/encode.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/is.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/jump.js","../webpack://add-to-web3/./node_modules/cborg/cjs/lib/token.js","../webpack://add-to-web3/./node_modules/concat-map/index.js","../webpack://add-to-web3/./node_modules/data-uri-to-buffer/dist/src/index.js","../webpack://add-to-web3/./node_modules/err-code/index.js","../webpack://add-to-web3/./node_modules/files-from-path/cjs/src/index.js","../webpack://add-to-web3/./node_modules/graceful-fs/clone.js","../webpack://add-to-web3/./node_modules/graceful-fs/graceful-fs.js","../webpack://add-to-web3/./node_modules/graceful-fs/legacy-streams.js","../webpack://add-to-web3/./node_modules/graceful-fs/polyfills.js","../webpack://add-to-web3/./node_modules/hamt-sharding/src/bucket.js","../webpack://add-to-web3/./node_modules/hamt-sharding/src/consumable-buffer.js","../webpack://add-to-web3/./node_modules/hamt-sharding/src/consumable-hash.js","../webpack://add-to-web3/./node_modules/hamt-sharding/src/index.js","../webpack://add-to-web3/./node_modules/ipfs-car/dist/cjs/blockstore/fs.js","../webpack://add-to-web3/./node_modules/ipfs-car/dist/cjs/blockstore/memory.js","../webpack://add-to-web3/./node_modules/ipfs-car/dist/cjs/pack/constants.js","../webpack://add-to-web3/./node_modules/ipfs-car/dist/cjs/pack/index.js","../webpack://add-to-web3/./node_modules/ipfs-car/dist/cjs/pack/utils/normalise-input.js","../webpack://add-to-web3/./node_modules/ipfs-car/dist/cjs/unpack/index.js","../webpack://add-to-web3/./node_modules/ipfs-car/dist/cjs/unpack/utils/verifying-get-only-blockstore.js","../webpack://add-to-web3/./node_modules/ipfs-core-utils/cjs/src/files/normalise-candidate-multiple.js","../webpack://add-to-web3/./node_modules/ipfs-core-utils/cjs/src/files/normalise-candidate-single.js","../webpack://add-to-web3/./node_modules/ipfs-core-utils/cjs/src/files/normalise-content.js","../webpack://add-to-web3/./node_modules/ipfs-core-utils/cjs/src/files/normalise-input-multiple.js","../webpack://add-to-web3/./node_modules/ipfs-core-utils/cjs/src/files/normalise-input-single.js","../webpack://add-to-web3/./node_modules/ipfs-core-utils/cjs/src/files/utils.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-exporter/cjs/src/index.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-exporter/cjs/src/resolvers/dag-cbor.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-exporter/cjs/src/resolvers/identity.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-exporter/cjs/src/resolvers/index.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-exporter/cjs/src/resolvers/raw.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-exporter/cjs/src/resolvers/unixfs-v1/content/directory.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-exporter/cjs/src/resolvers/unixfs-v1/content/file.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-exporter/cjs/src/resolvers/unixfs-v1/content/hamt-sharded-directory.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-exporter/cjs/src/resolvers/unixfs-v1/index.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-exporter/cjs/src/utils/extract-data-from-block.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-exporter/cjs/src/utils/find-cid-in-shard.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-exporter/cjs/src/utils/validate-offset-and-length.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/chunker/fixed-size.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/chunker/rabin.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/dag-builder/dir.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/dag-builder/file/balanced.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/dag-builder/file/buffer-importer.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/dag-builder/file/flat.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/dag-builder/file/index.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/dag-builder/file/trickle.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/dag-builder/index.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/dag-builder/validate-chunks.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/dir-flat.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/dir-sharded.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/dir.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/flat-to-shard.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/index.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/options.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/tree-builder.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/utils/persist.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/cjs/src/utils/to-path-components.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs-importer/node_modules/bl/BufferList.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs/cjs/src/index.js","../webpack://add-to-web3/./node_modules/ipfs-unixfs/cjs/src/unixfs.js","../webpack://add-to-web3/./node_modules/is-plain-obj/index.js","../webpack://add-to-web3/./node_modules/it-all/index.js","../webpack://add-to-web3/./node_modules/it-batch/index.js","../webpack://add-to-web3/./node_modules/it-drain/index.js","../webpack://add-to-web3/./node_modules/it-filter/index.js","../webpack://add-to-web3/./node_modules/it-glob/index.js","../webpack://add-to-web3/./node_modules/it-last/index.js","../webpack://add-to-web3/./node_modules/it-map/index.js","../webpack://add-to-web3/./node_modules/it-parallel-batch/index.js","../webpack://add-to-web3/./node_modules/it-peekable/index.js","../webpack://add-to-web3/./node_modules/it-pipe/index.js","../webpack://add-to-web3/./node_modules/it-take/index.js","../webpack://add-to-web3/./node_modules/merge-options/index.js","../webpack://add-to-web3/./node_modules/minimatch/minimatch.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/bases/base.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/bases/base10.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/bases/base16.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/bases/base2.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/bases/base32.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/bases/base36.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/bases/base58.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/bases/base64.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/bases/base8.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/bases/identity.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/basics.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/block.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/bytes.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/cid.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/codecs/json.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/codecs/raw.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/hashes/digest.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/hashes/hasher.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/hashes/identity.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/hashes/sha2.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/index.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/src/varint.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/vendor/base-x.js","../webpack://add-to-web3/./node_modules/multiformats/cjs/vendor/varint.js","../webpack://add-to-web3/./node_modules/murmurhash3js-revisited/index.js","../webpack://add-to-web3/./node_modules/murmurhash3js-revisited/lib/murmurHash3js.js","../webpack://add-to-web3/./node_modules/p-retry/index.js","../webpack://add-to-web3/./node_modules/protobufjs/minimal.js","../webpack://add-to-web3/./node_modules/protobufjs/src/index-minimal.js","../webpack://add-to-web3/./node_modules/protobufjs/src/reader.js","../webpack://add-to-web3/./node_modules/protobufjs/src/reader_buffer.js","../webpack://add-to-web3/./node_modules/protobufjs/src/roots.js","../webpack://add-to-web3/./node_modules/protobufjs/src/rpc.js","../webpack://add-to-web3/./node_modules/protobufjs/src/rpc/service.js","../webpack://add-to-web3/./node_modules/protobufjs/src/util/longbits.js","../webpack://add-to-web3/./node_modules/protobufjs/src/util/minimal.js","../webpack://add-to-web3/./node_modules/protobufjs/src/writer.js","../webpack://add-to-web3/./node_modules/protobufjs/src/writer_buffer.js","../webpack://add-to-web3/./node_modules/rabin-wasm/dist/rabin-wasm.node.js","../webpack://add-to-web3/./node_modules/rabin-wasm/src/index.js","../webpack://add-to-web3/./node_modules/rabin-wasm/src/rabin.js","../webpack://add-to-web3/./node_modules/retry/index.js","../webpack://add-to-web3/./node_modules/retry/lib/retry.js","../webpack://add-to-web3/./node_modules/retry/lib/retry_operation.js","../webpack://add-to-web3/./node_modules/sparse-array/index.js","../webpack://add-to-web3/./node_modules/streaming-iterables/dist/index.js","../webpack://add-to-web3/./node_modules/throttled-queue/dist/throttledQueue.js","../webpack://add-to-web3/./node_modules/tunnel/index.js","../webpack://add-to-web3/./node_modules/tunnel/lib/tunnel.js","../webpack://add-to-web3/./node_modules/uint8arrays/cjs/src/concat.js","../webpack://add-to-web3/./node_modules/uint8arrays/cjs/src/equals.js","../webpack://add-to-web3/./node_modules/uint8arrays/cjs/src/from-string.js","../webpack://add-to-web3/./node_modules/uint8arrays/cjs/src/util/bases.js","../webpack://add-to-web3/./node_modules/uuid/dist/index.js","../webpack://add-to-web3/./node_modules/uuid/dist/md5.js","../webpack://add-to-web3/./node_modules/uuid/dist/nil.js","../webpack://add-to-web3/./node_modules/uuid/dist/parse.js","../webpack://add-to-web3/./node_modules/uuid/dist/regex.js","../webpack://add-to-web3/./node_modules/uuid/dist/rng.js","../webpack://add-to-web3/./node_modules/uuid/dist/sha1.js","../webpack://add-to-web3/./node_modules/uuid/dist/stringify.js","../webpack://add-to-web3/./node_modules/uuid/dist/v1.js","../webpack://add-to-web3/./node_modules/uuid/dist/v3.js","../webpack://add-to-web3/./node_modules/uuid/dist/v35.js","../webpack://add-to-web3/./node_modules/uuid/dist/v4.js","../webpack://add-to-web3/./node_modules/uuid/dist/v5.js","../webpack://add-to-web3/./node_modules/uuid/dist/validate.js","../webpack://add-to-web3/./node_modules/uuid/dist/version.js","../webpack://add-to-web3/./node_modules/varint/decode.js","../webpack://add-to-web3/./node_modules/varint/encode.js","../webpack://add-to-web3/./node_modules/varint/index.js","../webpack://add-to-web3/./node_modules/varint/length.js","../webpack://add-to-web3/./node_modules/web-encoding/src/lib.js","../webpack://add-to-web3/./node_modules/web-streams-polyfill/dist/ponyfill.js","../webpack://add-to-web3/./web3.js","../webpack://add-to-web3/external node-commonjs \"assert\"","../webpack://add-to-web3/external node-commonjs \"buffer\"","../webpack://add-to-web3/external node-commonjs \"constants\"","../webpack://add-to-web3/external node-commonjs \"crypto\"","../webpack://add-to-web3/external node-commonjs \"events\"","../webpack://add-to-web3/external node-commonjs \"fs\"","../webpack://add-to-web3/external node-commonjs \"http\"","../webpack://add-to-web3/external node-commonjs \"https\"","../webpack://add-to-web3/external node-commonjs \"net\"","../webpack://add-to-web3/external node-commonjs \"os\"","../webpack://add-to-web3/external node-commonjs \"path\"","../webpack://add-to-web3/external node-commonjs \"stream\"","../webpack://add-to-web3/external node-commonjs \"stream/web\"","../webpack://add-to-web3/external node-commonjs \"tls\"","../webpack://add-to-web3/external node-commonjs \"url\"","../webpack://add-to-web3/external node-commonjs \"util\"","../webpack://add-to-web3/external node-commonjs \"zlib\"","../webpack://add-to-web3/./node_modules/@web-std/blob/dist/src/blob.cjs","../webpack://add-to-web3/./node_modules/@web-std/blob/dist/src/lib.node.cjs","../webpack://add-to-web3/./node_modules/@web-std/fetch/dist/index.cjs","../webpack://add-to-web3/./node_modules/@web-std/file/dist/src/file.cjs","../webpack://add-to-web3/./node_modules/@web-std/file/dist/src/lib.node.cjs","../webpack://add-to-web3/./node_modules/@web-std/form-data/dist/src/form-data.cjs","../webpack://add-to-web3/./node_modules/@web-std/form-data/dist/src/lib.node.cjs","../webpack://add-to-web3/./node_modules/@web-std/stream/src/stream.cjs","../webpack://add-to-web3/./node_modules/@web3-storage/parse-link-header/dist/index.cjs","../webpack://add-to-web3/./node_modules/web3.storage/dist/src/lib.cjs","../webpack://add-to-web3/webpack/bootstrap","../webpack://add-to-web3/webpack/runtime/compat","../webpack://add-to-web3/./index.js"],"sourcesContent":["\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issue = exports.issueCommand = void 0;\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\n/**\n * Commands\n *\n * Command Format:\n * ::name key=value,key=value::message\n *\n * Examples:\n * ::warning::This is the message\n * ::set-env name=MY_VAR::some value\n */\nfunction issueCommand(command, properties, message) {\n const cmd = new Command(command, properties, message);\n process.stdout.write(cmd.toString() + os.EOL);\n}\nexports.issueCommand = issueCommand;\nfunction issue(name, message = '') {\n issueCommand(name, {}, message);\n}\nexports.issue = issue;\nconst CMD_STRING = '::';\nclass Command {\n constructor(command, properties, message) {\n if (!command) {\n command = 'missing.command';\n }\n this.command = command;\n this.properties = properties;\n this.message = message;\n }\n toString() {\n let cmdStr = CMD_STRING + this.command;\n if (this.properties && Object.keys(this.properties).length > 0) {\n cmdStr += ' ';\n let first = true;\n for (const key in this.properties) {\n if (this.properties.hasOwnProperty(key)) {\n const val = this.properties[key];\n if (val) {\n if (first) {\n first = false;\n }\n else {\n cmdStr += ',';\n }\n cmdStr += `${key}=${escapeProperty(val)}`;\n }\n }\n }\n }\n cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n return cmdStr;\n }\n}\nfunction escapeData(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A')\n .replace(/:/g, '%3A')\n .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;\nconst command_1 = require(\"./command\");\nconst file_command_1 = require(\"./file-command\");\nconst utils_1 = require(\"./utils\");\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\nconst oidc_utils_1 = require(\"./oidc-utils\");\n/**\n * The code to exit an action\n */\nvar ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction exportVariable(name, val) {\n const convertedVal = utils_1.toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));\n }\n command_1.issueCommand('set-env', { name }, convertedVal);\n}\nexports.exportVariable = exportVariable;\n/**\n * Registers a secret which will get masked from logs\n * @param secret value of the secret\n */\nfunction setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}\nexports.setSecret = setSecret;\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nfunction addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n file_command_1.issueFileCommand('PATH', inputPath);\n }\n else {\n command_1.issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\nexports.addPath = addPath;\n/**\n * Gets the value of an input.\n * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.\n * Returns an empty string if the value is not defined.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nfunction getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n if (options && options.trimWhitespace === false) {\n return val;\n }\n return val.trim();\n}\nexports.getInput = getInput;\n/**\n * Gets the values of an multiline input. Each value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string[]\n *\n */\nfunction getMultilineInput(name, options) {\n const inputs = getInput(name, options)\n .split('\\n')\n .filter(x => x !== '');\n if (options && options.trimWhitespace === false) {\n return inputs;\n }\n return inputs.map(input => input.trim());\n}\nexports.getMultilineInput = getMultilineInput;\n/**\n * Gets the input value of the boolean type in the YAML 1.2 \"core schema\" specification.\n * Support boolean input list: `true | True | TRUE | false | False | FALSE` .\n * The return value is also in boolean type.\n * ref: https://yaml.org/spec/1.2/spec.html#id2804923\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns boolean\n */\nfunction getBooleanInput(name, options) {\n const trueValue = ['true', 'True', 'TRUE'];\n const falseValue = ['false', 'False', 'FALSE'];\n const val = getInput(name, options);\n if (trueValue.includes(val))\n return true;\n if (falseValue.includes(val))\n return false;\n throw new TypeError(`Input does not meet YAML 1.2 \"Core Schema\" specification: ${name}\\n` +\n `Support boolean input list: \\`true | True | TRUE | false | False | FALSE\\``);\n}\nexports.getBooleanInput = getBooleanInput;\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setOutput(name, value) {\n const filePath = process.env['GITHUB_OUTPUT'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));\n }\n process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));\n}\nexports.setOutput = setOutput;\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nfunction setCommandEcho(enabled) {\n command_1.issue('echo', enabled ? 'on' : 'off');\n}\nexports.setCommandEcho = setCommandEcho;\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nfunction setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\nexports.setFailed = setFailed;\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nfunction isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\nexports.isDebug = isDebug;\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nfunction debug(message) {\n command_1.issueCommand('debug', {}, message);\n}\nexports.debug = debug;\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction error(message, properties = {}) {\n command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.error = error;\n/**\n * Adds a warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction warning(message, properties = {}) {\n command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.warning = warning;\n/**\n * Adds a notice issue\n * @param message notice issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction notice(message, properties = {}) {\n command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.notice = notice;\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nfunction info(message) {\n process.stdout.write(message + os.EOL);\n}\nexports.info = info;\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nfunction startGroup(name) {\n command_1.issue('group', name);\n}\nexports.startGroup = startGroup;\n/**\n * End an output group.\n */\nfunction endGroup() {\n command_1.issue('endgroup');\n}\nexports.endGroup = endGroup;\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nfunction group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\nexports.group = group;\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction saveState(name, value) {\n const filePath = process.env['GITHUB_STATE'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));\n }\n command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));\n}\nexports.saveState = saveState;\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nfunction getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexports.getState = getState;\nfunction getIDToken(aud) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield oidc_utils_1.OidcClient.getIDToken(aud);\n });\n}\nexports.getIDToken = getIDToken;\n/**\n * Summary exports\n */\nvar summary_1 = require(\"./summary\");\nObject.defineProperty(exports, \"summary\", { enumerable: true, get: function () { return summary_1.summary; } });\n/**\n * @deprecated use core.summary\n */\nvar summary_2 = require(\"./summary\");\nObject.defineProperty(exports, \"markdownSummary\", { enumerable: true, get: function () { return summary_2.markdownSummary; } });\n/**\n * Path exports\n */\nvar path_utils_1 = require(\"./path-utils\");\nObject.defineProperty(exports, \"toPosixPath\", { enumerable: true, get: function () { return path_utils_1.toPosixPath; } });\nObject.defineProperty(exports, \"toWin32Path\", { enumerable: true, get: function () { return path_utils_1.toWin32Path; } });\nObject.defineProperty(exports, \"toPlatformPath\", { enumerable: true, get: function () { return path_utils_1.toPlatformPath; } });\n//# sourceMappingURL=core.js.map","\"use strict\";\n// For internal use, subject to change.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.prepareKeyValueMessage = exports.issueFileCommand = void 0;\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst fs = __importStar(require(\"fs\"));\nconst os = __importStar(require(\"os\"));\nconst uuid_1 = require(\"uuid\");\nconst utils_1 = require(\"./utils\");\nfunction issueFileCommand(command, message) {\n const filePath = process.env[`GITHUB_${command}`];\n if (!filePath) {\n throw new Error(`Unable to find environment variable for file command ${command}`);\n }\n if (!fs.existsSync(filePath)) {\n throw new Error(`Missing file at path: ${filePath}`);\n }\n fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {\n encoding: 'utf8'\n });\n}\nexports.issueFileCommand = issueFileCommand;\nfunction prepareKeyValueMessage(key, value) {\n const delimiter = `ghadelimiter_${uuid_1.v4()}`;\n const convertedValue = utils_1.toCommandValue(value);\n // These should realistically never happen, but just in case someone finds a\n // way to exploit uuid generation let's not allow keys or values that contain\n // the delimiter.\n if (key.includes(delimiter)) {\n throw new Error(`Unexpected input: name should not contain the delimiter \"${delimiter}\"`);\n }\n if (convertedValue.includes(delimiter)) {\n throw new Error(`Unexpected input: value should not contain the delimiter \"${delimiter}\"`);\n }\n return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;\n}\nexports.prepareKeyValueMessage = prepareKeyValueMessage;\n//# sourceMappingURL=file-command.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OidcClient = void 0;\nconst http_client_1 = require(\"@actions/http-client\");\nconst auth_1 = require(\"@actions/http-client/lib/auth\");\nconst core_1 = require(\"./core\");\nclass OidcClient {\n static createHttpClient(allowRetry = true, maxRetry = 10) {\n const requestOptions = {\n allowRetries: allowRetry,\n maxRetries: maxRetry\n };\n return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);\n }\n static getRequestToken() {\n const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];\n if (!token) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');\n }\n return token;\n }\n static getIDTokenUrl() {\n const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];\n if (!runtimeUrl) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');\n }\n return runtimeUrl;\n }\n static getCall(id_token_url) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const httpclient = OidcClient.createHttpClient();\n const res = yield httpclient\n .getJson(id_token_url)\n .catch(error => {\n throw new Error(`Failed to get ID Token. \\n \n Error Code : ${error.statusCode}\\n \n Error Message: ${error.result.message}`);\n });\n const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;\n if (!id_token) {\n throw new Error('Response json body do not have ID Token field');\n }\n return id_token;\n });\n }\n static getIDToken(audience) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n // New ID Token is requested from action service\n let id_token_url = OidcClient.getIDTokenUrl();\n if (audience) {\n const encodedAudience = encodeURIComponent(audience);\n id_token_url = `${id_token_url}&audience=${encodedAudience}`;\n }\n core_1.debug(`ID token url is ${id_token_url}`);\n const id_token = yield OidcClient.getCall(id_token_url);\n core_1.setSecret(id_token);\n return id_token;\n }\n catch (error) {\n throw new Error(`Error message: ${error.message}`);\n }\n });\n }\n}\nexports.OidcClient = OidcClient;\n//# sourceMappingURL=oidc-utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;\nconst path = __importStar(require(\"path\"));\n/**\n * toPosixPath converts the given path to the posix form. On Windows, \\\\ will be\n * replaced with /.\n *\n * @param pth. Path to transform.\n * @return string Posix path.\n */\nfunction toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}\nexports.toPosixPath = toPosixPath;\n/**\n * toWin32Path converts the given path to the win32 form. On Linux, / will be\n * replaced with \\\\.\n *\n * @param pth. Path to transform.\n * @return string Win32 path.\n */\nfunction toWin32Path(pth) {\n return pth.replace(/[/]/g, '\\\\');\n}\nexports.toWin32Path = toWin32Path;\n/**\n * toPlatformPath converts the given path to a platform-specific path. It does\n * this by replacing instances of / and \\ with the platform-specific path\n * separator.\n *\n * @param pth The path to platformize.\n * @return string The platform-specific path.\n */\nfunction toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}\nexports.toPlatformPath = toPlatformPath;\n//# sourceMappingURL=path-utils.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;\nconst os_1 = require(\"os\");\nconst fs_1 = require(\"fs\");\nconst { access, appendFile, writeFile } = fs_1.promises;\nexports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';\nexports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';\nclass Summary {\n constructor() {\n this._buffer = '';\n }\n /**\n * Finds the summary file path from the environment, rejects if env var is not found or file does not exist\n * Also checks r/w permissions.\n *\n * @returns step summary file path\n */\n filePath() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._filePath) {\n return this._filePath;\n }\n const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];\n if (!pathFromEnv) {\n throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);\n }\n try {\n yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);\n }\n catch (_a) {\n throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);\n }\n this._filePath = pathFromEnv;\n return this._filePath;\n });\n }\n /**\n * Wraps content in an HTML tag, adding any HTML attributes\n *\n * @param {string} tag HTML tag to wrap\n * @param {string | null} content content within the tag\n * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add\n *\n * @returns {string} content wrapped in HTML element\n */\n wrap(tag, content, attrs = {}) {\n const htmlAttrs = Object.entries(attrs)\n .map(([key, value]) => ` ${key}=\"${value}\"`)\n .join('');\n if (!content) {\n return `<${tag}${htmlAttrs}>`;\n }\n return `<${tag}${htmlAttrs}>${content}`;\n }\n /**\n * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.\n *\n * @param {SummaryWriteOptions} [options] (optional) options for write operation\n *\n * @returns {Promise} summary instance\n */\n write(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);\n const filePath = yield this.filePath();\n const writeFunc = overwrite ? writeFile : appendFile;\n yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });\n return this.emptyBuffer();\n });\n }\n /**\n * Clears the summary buffer and wipes the summary file\n *\n * @returns {Summary} summary instance\n */\n clear() {\n return __awaiter(this, void 0, void 0, function* () {\n return this.emptyBuffer().write({ overwrite: true });\n });\n }\n /**\n * Returns the current summary buffer as a string\n *\n * @returns {string} string of summary buffer\n */\n stringify() {\n return this._buffer;\n }\n /**\n * If the summary buffer is empty\n *\n * @returns {boolen} true if the buffer is empty\n */\n isEmptyBuffer() {\n return this._buffer.length === 0;\n }\n /**\n * Resets the summary buffer without writing to summary file\n *\n * @returns {Summary} summary instance\n */\n emptyBuffer() {\n this._buffer = '';\n return this;\n }\n /**\n * Adds raw text to the summary buffer\n *\n * @param {string} text content to add\n * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)\n *\n * @returns {Summary} summary instance\n */\n addRaw(text, addEOL = false) {\n this._buffer += text;\n return addEOL ? this.addEOL() : this;\n }\n /**\n * Adds the operating system-specific end-of-line marker to the buffer\n *\n * @returns {Summary} summary instance\n */\n addEOL() {\n return this.addRaw(os_1.EOL);\n }\n /**\n * Adds an HTML codeblock to the summary buffer\n *\n * @param {string} code content to render within fenced code block\n * @param {string} lang (optional) language to syntax highlight code\n *\n * @returns {Summary} summary instance\n */\n addCodeBlock(code, lang) {\n const attrs = Object.assign({}, (lang && { lang }));\n const element = this.wrap('pre', this.wrap('code', code), attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML list to the summary buffer\n *\n * @param {string[]} items list of items to render\n * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)\n *\n * @returns {Summary} summary instance\n */\n addList(items, ordered = false) {\n const tag = ordered ? 'ol' : 'ul';\n const listItems = items.map(item => this.wrap('li', item)).join('');\n const element = this.wrap(tag, listItems);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML table to the summary buffer\n *\n * @param {SummaryTableCell[]} rows table rows\n *\n * @returns {Summary} summary instance\n */\n addTable(rows) {\n const tableBody = rows\n .map(row => {\n const cells = row\n .map(cell => {\n if (typeof cell === 'string') {\n return this.wrap('td', cell);\n }\n const { header, data, colspan, rowspan } = cell;\n const tag = header ? 'th' : 'td';\n const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));\n return this.wrap(tag, data, attrs);\n })\n .join('');\n return this.wrap('tr', cells);\n })\n .join('');\n const element = this.wrap('table', tableBody);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds a collapsable HTML details element to the summary buffer\n *\n * @param {string} label text for the closed state\n * @param {string} content collapsable content\n *\n * @returns {Summary} summary instance\n */\n addDetails(label, content) {\n const element = this.wrap('details', this.wrap('summary', label) + content);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML image tag to the summary buffer\n *\n * @param {string} src path to the image you to embed\n * @param {string} alt text description of the image\n * @param {SummaryImageOptions} options (optional) addition image attributes\n *\n * @returns {Summary} summary instance\n */\n addImage(src, alt, options) {\n const { width, height } = options || {};\n const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));\n const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML section heading element\n *\n * @param {string} text heading text\n * @param {number | string} [level=1] (optional) the heading level, default: 1\n *\n * @returns {Summary} summary instance\n */\n addHeading(text, level) {\n const tag = `h${level}`;\n const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)\n ? tag\n : 'h1';\n const element = this.wrap(allowedTag, text);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML thematic break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addSeparator() {\n const element = this.wrap('hr', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML line break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addBreak() {\n const element = this.wrap('br', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML blockquote to the summary buffer\n *\n * @param {string} text quote text\n * @param {string} cite (optional) citation url\n *\n * @returns {Summary} summary instance\n */\n addQuote(text, cite) {\n const attrs = Object.assign({}, (cite && { cite }));\n const element = this.wrap('blockquote', text, attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML anchor tag to the summary buffer\n *\n * @param {string} text link text/content\n * @param {string} href hyperlink\n *\n * @returns {Summary} summary instance\n */\n addLink(text, href) {\n const element = this.wrap('a', text, { href });\n return this.addRaw(element).addEOL();\n }\n}\nconst _summary = new Summary();\n/**\n * @deprecated use `core.summary`\n */\nexports.markdownSummary = _summary;\nexports.summary = _summary;\n//# sourceMappingURL=summary.js.map","\"use strict\";\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toCommandProperties = exports.toCommandValue = void 0;\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nfunction toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}\nexports.toCommandValue = toCommandValue;\n/**\n *\n * @param annotationProperties\n * @returns The command properties to send with the actual annotation command\n * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646\n */\nfunction toCommandProperties(annotationProperties) {\n if (!Object.keys(annotationProperties).length) {\n return {};\n }\n return {\n title: annotationProperties.title,\n file: annotationProperties.file,\n line: annotationProperties.startLine,\n endLine: annotationProperties.endLine,\n col: annotationProperties.startColumn,\n endColumn: annotationProperties.endColumn\n };\n}\nexports.toCommandProperties = toCommandProperties;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;\nclass BasicCredentialHandler {\n constructor(username, password) {\n this.username = username;\n this.password = password;\n }\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BasicCredentialHandler = BasicCredentialHandler;\nclass BearerCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Bearer ${this.token}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BearerCredentialHandler = BearerCredentialHandler;\nclass PersonalAccessTokenCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;\n//# sourceMappingURL=auth.js.map","\"use strict\";\n/* eslint-disable @typescript-eslint/no-explicit-any */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;\nconst http = __importStar(require(\"http\"));\nconst https = __importStar(require(\"https\"));\nconst pm = __importStar(require(\"./proxy\"));\nconst tunnel = __importStar(require(\"tunnel\"));\nvar HttpCodes;\n(function (HttpCodes) {\n HttpCodes[HttpCodes[\"OK\"] = 200] = \"OK\";\n HttpCodes[HttpCodes[\"MultipleChoices\"] = 300] = \"MultipleChoices\";\n HttpCodes[HttpCodes[\"MovedPermanently\"] = 301] = \"MovedPermanently\";\n HttpCodes[HttpCodes[\"ResourceMoved\"] = 302] = \"ResourceMoved\";\n HttpCodes[HttpCodes[\"SeeOther\"] = 303] = \"SeeOther\";\n HttpCodes[HttpCodes[\"NotModified\"] = 304] = \"NotModified\";\n HttpCodes[HttpCodes[\"UseProxy\"] = 305] = \"UseProxy\";\n HttpCodes[HttpCodes[\"SwitchProxy\"] = 306] = \"SwitchProxy\";\n HttpCodes[HttpCodes[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n HttpCodes[HttpCodes[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n HttpCodes[HttpCodes[\"BadRequest\"] = 400] = \"BadRequest\";\n HttpCodes[HttpCodes[\"Unauthorized\"] = 401] = \"Unauthorized\";\n HttpCodes[HttpCodes[\"PaymentRequired\"] = 402] = \"PaymentRequired\";\n HttpCodes[HttpCodes[\"Forbidden\"] = 403] = \"Forbidden\";\n HttpCodes[HttpCodes[\"NotFound\"] = 404] = \"NotFound\";\n HttpCodes[HttpCodes[\"MethodNotAllowed\"] = 405] = \"MethodNotAllowed\";\n HttpCodes[HttpCodes[\"NotAcceptable\"] = 406] = \"NotAcceptable\";\n HttpCodes[HttpCodes[\"ProxyAuthenticationRequired\"] = 407] = \"ProxyAuthenticationRequired\";\n HttpCodes[HttpCodes[\"RequestTimeout\"] = 408] = \"RequestTimeout\";\n HttpCodes[HttpCodes[\"Conflict\"] = 409] = \"Conflict\";\n HttpCodes[HttpCodes[\"Gone\"] = 410] = \"Gone\";\n HttpCodes[HttpCodes[\"TooManyRequests\"] = 429] = \"TooManyRequests\";\n HttpCodes[HttpCodes[\"InternalServerError\"] = 500] = \"InternalServerError\";\n HttpCodes[HttpCodes[\"NotImplemented\"] = 501] = \"NotImplemented\";\n HttpCodes[HttpCodes[\"BadGateway\"] = 502] = \"BadGateway\";\n HttpCodes[HttpCodes[\"ServiceUnavailable\"] = 503] = \"ServiceUnavailable\";\n HttpCodes[HttpCodes[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));\nvar Headers;\n(function (Headers) {\n Headers[\"Accept\"] = \"accept\";\n Headers[\"ContentType\"] = \"content-type\";\n})(Headers = exports.Headers || (exports.Headers = {}));\nvar MediaTypes;\n(function (MediaTypes) {\n MediaTypes[\"ApplicationJson\"] = \"application/json\";\n})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));\n/**\n * Returns the proxy URL, depending upon the supplied url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\nfunction getProxyUrl(serverUrl) {\n const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}\nexports.getProxyUrl = getProxyUrl;\nconst HttpRedirectCodes = [\n HttpCodes.MovedPermanently,\n HttpCodes.ResourceMoved,\n HttpCodes.SeeOther,\n HttpCodes.TemporaryRedirect,\n HttpCodes.PermanentRedirect\n];\nconst HttpResponseRetryCodes = [\n HttpCodes.BadGateway,\n HttpCodes.ServiceUnavailable,\n HttpCodes.GatewayTimeout\n];\nconst RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];\nconst ExponentialBackoffCeiling = 10;\nconst ExponentialBackoffTimeSlice = 5;\nclass HttpClientError extends Error {\n constructor(message, statusCode) {\n super(message);\n this.name = 'HttpClientError';\n this.statusCode = statusCode;\n Object.setPrototypeOf(this, HttpClientError.prototype);\n }\n}\nexports.HttpClientError = HttpClientError;\nclass HttpClientResponse {\n constructor(message) {\n this.message = message;\n }\n readBody() {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n let output = Buffer.alloc(0);\n this.message.on('data', (chunk) => {\n output = Buffer.concat([output, chunk]);\n });\n this.message.on('end', () => {\n resolve(output.toString());\n });\n }));\n });\n }\n}\nexports.HttpClientResponse = HttpClientResponse;\nfunction isHttps(requestUrl) {\n const parsedUrl = new URL(requestUrl);\n return parsedUrl.protocol === 'https:';\n}\nexports.isHttps = isHttps;\nclass HttpClient {\n constructor(userAgent, handlers, requestOptions) {\n this._ignoreSslError = false;\n this._allowRedirects = true;\n this._allowRedirectDowngrade = false;\n this._maxRedirects = 50;\n this._allowRetries = false;\n this._maxRetries = 1;\n this._keepAlive = false;\n this._disposed = false;\n this.userAgent = userAgent;\n this.handlers = handlers || [];\n this.requestOptions = requestOptions;\n if (requestOptions) {\n if (requestOptions.ignoreSslError != null) {\n this._ignoreSslError = requestOptions.ignoreSslError;\n }\n this._socketTimeout = requestOptions.socketTimeout;\n if (requestOptions.allowRedirects != null) {\n this._allowRedirects = requestOptions.allowRedirects;\n }\n if (requestOptions.allowRedirectDowngrade != null) {\n this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;\n }\n if (requestOptions.maxRedirects != null) {\n this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);\n }\n if (requestOptions.keepAlive != null) {\n this._keepAlive = requestOptions.keepAlive;\n }\n if (requestOptions.allowRetries != null) {\n this._allowRetries = requestOptions.allowRetries;\n }\n if (requestOptions.maxRetries != null) {\n this._maxRetries = requestOptions.maxRetries;\n }\n }\n }\n options(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});\n });\n }\n get(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('GET', requestUrl, null, additionalHeaders || {});\n });\n }\n del(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('DELETE', requestUrl, null, additionalHeaders || {});\n });\n }\n post(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('POST', requestUrl, data, additionalHeaders || {});\n });\n }\n patch(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PATCH', requestUrl, data, additionalHeaders || {});\n });\n }\n put(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PUT', requestUrl, data, additionalHeaders || {});\n });\n }\n head(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('HEAD', requestUrl, null, additionalHeaders || {});\n });\n }\n sendStream(verb, requestUrl, stream, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request(verb, requestUrl, stream, additionalHeaders);\n });\n }\n /**\n * Gets a typed object from an endpoint\n * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise\n */\n getJson(requestUrl, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n const res = yield this.get(requestUrl, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n postJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.post(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n putJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.put(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n patchJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.patch(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n /**\n * Makes a raw http request.\n * All other methods such as get, post, patch, and request ultimately call this.\n * Prefer get, del, post and patch\n */\n request(verb, requestUrl, data, headers) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._disposed) {\n throw new Error('Client has already been disposed.');\n }\n const parsedUrl = new URL(requestUrl);\n let info = this._prepareRequest(verb, parsedUrl, headers);\n // Only perform retries on reads since writes may not be idempotent.\n const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)\n ? this._maxRetries + 1\n : 1;\n let numTries = 0;\n let response;\n do {\n response = yield this.requestRaw(info, data);\n // Check if it's an authentication challenge\n if (response &&\n response.message &&\n response.message.statusCode === HttpCodes.Unauthorized) {\n let authenticationHandler;\n for (const handler of this.handlers) {\n if (handler.canHandleAuthentication(response)) {\n authenticationHandler = handler;\n break;\n }\n }\n if (authenticationHandler) {\n return authenticationHandler.handleAuthentication(this, info, data);\n }\n else {\n // We have received an unauthorized response but have no handlers to handle it.\n // Let the response return to the caller.\n return response;\n }\n }\n let redirectsRemaining = this._maxRedirects;\n while (response.message.statusCode &&\n HttpRedirectCodes.includes(response.message.statusCode) &&\n this._allowRedirects &&\n redirectsRemaining > 0) {\n const redirectUrl = response.message.headers['location'];\n if (!redirectUrl) {\n // if there's no location to redirect to, we won't\n break;\n }\n const parsedRedirectUrl = new URL(redirectUrl);\n if (parsedUrl.protocol === 'https:' &&\n parsedUrl.protocol !== parsedRedirectUrl.protocol &&\n !this._allowRedirectDowngrade) {\n throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');\n }\n // we need to finish reading the response before reassigning response\n // which will leak the open socket.\n yield response.readBody();\n // strip authorization header if redirected to a different hostname\n if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {\n for (const header in headers) {\n // header names are case insensitive\n if (header.toLowerCase() === 'authorization') {\n delete headers[header];\n }\n }\n }\n // let's make the request with the new redirectUrl\n info = this._prepareRequest(verb, parsedRedirectUrl, headers);\n response = yield this.requestRaw(info, data);\n redirectsRemaining--;\n }\n if (!response.message.statusCode ||\n !HttpResponseRetryCodes.includes(response.message.statusCode)) {\n // If not a retry code, return immediately instead of retrying\n return response;\n }\n numTries += 1;\n if (numTries < maxTries) {\n yield response.readBody();\n yield this._performExponentialBackoff(numTries);\n }\n } while (numTries < maxTries);\n return response;\n });\n }\n /**\n * Needs to be called if keepAlive is set to true in request options.\n */\n dispose() {\n if (this._agent) {\n this._agent.destroy();\n }\n this._disposed = true;\n }\n /**\n * Raw request.\n * @param info\n * @param data\n */\n requestRaw(info, data) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => {\n function callbackForResult(err, res) {\n if (err) {\n reject(err);\n }\n else if (!res) {\n // If `err` is not passed, then `res` must be passed.\n reject(new Error('Unknown error'));\n }\n else {\n resolve(res);\n }\n }\n this.requestRawWithCallback(info, data, callbackForResult);\n });\n });\n }\n /**\n * Raw request with callback.\n * @param info\n * @param data\n * @param onResult\n */\n requestRawWithCallback(info, data, onResult) {\n if (typeof data === 'string') {\n if (!info.options.headers) {\n info.options.headers = {};\n }\n info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n function handleResult(err, res) {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n }\n const req = info.httpModule.request(info.options, (msg) => {\n const res = new HttpClientResponse(msg);\n handleResult(undefined, res);\n });\n let socket;\n req.on('socket', sock => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error(`Request timeout: ${info.options.path}`));\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err);\n });\n if (data && typeof data === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof data !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }\n /**\n * Gets an http agent. This function is useful when you need an http agent that handles\n * routing through a proxy server - depending upon the url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\n getAgent(serverUrl) {\n const parsedUrl = new URL(serverUrl);\n return this._getAgent(parsedUrl);\n }\n _prepareRequest(method, requestUrl, headers) {\n const info = {};\n info.parsedUrl = requestUrl;\n const usingSsl = info.parsedUrl.protocol === 'https:';\n info.httpModule = usingSsl ? https : http;\n const defaultPort = usingSsl ? 443 : 80;\n info.options = {};\n info.options.host = info.parsedUrl.hostname;\n info.options.port = info.parsedUrl.port\n ? parseInt(info.parsedUrl.port)\n : defaultPort;\n info.options.path =\n (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');\n info.options.method = method;\n info.options.headers = this._mergeHeaders(headers);\n if (this.userAgent != null) {\n info.options.headers['user-agent'] = this.userAgent;\n }\n info.options.agent = this._getAgent(info.parsedUrl);\n // gives handlers an opportunity to participate\n if (this.handlers) {\n for (const handler of this.handlers) {\n handler.prepareRequest(info.options);\n }\n }\n return info;\n }\n _mergeHeaders(headers) {\n if (this.requestOptions && this.requestOptions.headers) {\n return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));\n }\n return lowercaseKeys(headers || {});\n }\n _getExistingOrDefaultHeader(additionalHeaders, header, _default) {\n let clientHeader;\n if (this.requestOptions && this.requestOptions.headers) {\n clientHeader = lowercaseKeys(this.requestOptions.headers)[header];\n }\n return additionalHeaders[header] || clientHeader || _default;\n }\n _getAgent(parsedUrl) {\n let agent;\n const proxyUrl = pm.getProxyUrl(parsedUrl);\n const useProxy = proxyUrl && proxyUrl.hostname;\n if (this._keepAlive && useProxy) {\n agent = this._proxyAgent;\n }\n if (this._keepAlive && !useProxy) {\n agent = this._agent;\n }\n // if agent is already assigned use that agent.\n if (agent) {\n return agent;\n }\n const usingSsl = parsedUrl.protocol === 'https:';\n let maxSockets = 100;\n if (this.requestOptions) {\n maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;\n }\n // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.\n if (proxyUrl && proxyUrl.hostname) {\n const agentOptions = {\n maxSockets,\n keepAlive: this._keepAlive,\n proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {\n proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`\n })), { host: proxyUrl.hostname, port: proxyUrl.port })\n };\n let tunnelAgent;\n const overHttps = proxyUrl.protocol === 'https:';\n if (usingSsl) {\n tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;\n }\n else {\n tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;\n }\n agent = tunnelAgent(agentOptions);\n this._proxyAgent = agent;\n }\n // if reusing agent across request and tunneling agent isn't assigned create a new agent\n if (this._keepAlive && !agent) {\n const options = { keepAlive: this._keepAlive, maxSockets };\n agent = usingSsl ? new https.Agent(options) : new http.Agent(options);\n this._agent = agent;\n }\n // if not using private agent and tunnel agent isn't setup then use global agent\n if (!agent) {\n agent = usingSsl ? https.globalAgent : http.globalAgent;\n }\n if (usingSsl && this._ignoreSslError) {\n // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n // we have to cast it to any and change it directly\n agent.options = Object.assign(agent.options || {}, {\n rejectUnauthorized: false\n });\n }\n return agent;\n }\n _performExponentialBackoff(retryNumber) {\n return __awaiter(this, void 0, void 0, function* () {\n retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);\n const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);\n return new Promise(resolve => setTimeout(() => resolve(), ms));\n });\n }\n _processResponse(res, options) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n const statusCode = res.message.statusCode || 0;\n const response = {\n statusCode,\n result: null,\n headers: {}\n };\n // not found leads to null obj returned\n if (statusCode === HttpCodes.NotFound) {\n resolve(response);\n }\n // get the result from the body\n function dateTimeDeserializer(key, value) {\n if (typeof value === 'string') {\n const a = new Date(value);\n if (!isNaN(a.valueOf())) {\n return a;\n }\n }\n return value;\n }\n let obj;\n let contents;\n try {\n contents = yield res.readBody();\n if (contents && contents.length > 0) {\n if (options && options.deserializeDates) {\n obj = JSON.parse(contents, dateTimeDeserializer);\n }\n else {\n obj = JSON.parse(contents);\n }\n response.result = obj;\n }\n response.headers = res.message.headers;\n }\n catch (err) {\n // Invalid resource (contents not json); leaving result obj null\n }\n // note that 3xx redirects are handled by the http layer.\n if (statusCode > 299) {\n let msg;\n // if exception/error in body, attempt to get better error\n if (obj && obj.message) {\n msg = obj.message;\n }\n else if (contents && contents.length > 0) {\n // it may be the case that the exception is in the body message as string\n msg = contents;\n }\n else {\n msg = `Failed request: (${statusCode})`;\n }\n const err = new HttpClientError(msg, statusCode);\n err.result = response.result;\n reject(err);\n }\n else {\n resolve(response);\n }\n }));\n });\n }\n}\nexports.HttpClient = HttpClient;\nconst lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.checkBypass = exports.getProxyUrl = void 0;\nfunction getProxyUrl(reqUrl) {\n const usingSsl = reqUrl.protocol === 'https:';\n if (checkBypass(reqUrl)) {\n return undefined;\n }\n const proxyVar = (() => {\n if (usingSsl) {\n return process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n }\n else {\n return process.env['http_proxy'] || process.env['HTTP_PROXY'];\n }\n })();\n if (proxyVar) {\n return new URL(proxyVar);\n }\n else {\n return undefined;\n }\n}\nexports.getProxyUrl = getProxyUrl;\nfunction checkBypass(reqUrl) {\n if (!reqUrl.hostname) {\n return false;\n }\n const reqHost = reqUrl.hostname;\n if (isLoopbackAddress(reqHost)) {\n return true;\n }\n const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';\n if (!noProxy) {\n return false;\n }\n // Determine the request port\n let reqPort;\n if (reqUrl.port) {\n reqPort = Number(reqUrl.port);\n }\n else if (reqUrl.protocol === 'http:') {\n reqPort = 80;\n }\n else if (reqUrl.protocol === 'https:') {\n reqPort = 443;\n }\n // Format the request hostname and hostname with port\n const upperReqHosts = [reqUrl.hostname.toUpperCase()];\n if (typeof reqPort === 'number') {\n upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);\n }\n // Compare request host against noproxy\n for (const upperNoProxyItem of noProxy\n .split(',')\n .map(x => x.trim().toUpperCase())\n .filter(x => x)) {\n if (upperNoProxyItem === '*' ||\n upperReqHosts.some(x => x === upperNoProxyItem ||\n x.endsWith(`.${upperNoProxyItem}`) ||\n (upperNoProxyItem.startsWith('.') &&\n x.endsWith(`${upperNoProxyItem}`)))) {\n return true;\n }\n }\n return false;\n}\nexports.checkBypass = checkBypass;\nfunction isLoopbackAddress(host) {\n const hostLower = host.toLowerCase();\n return (hostLower === 'localhost' ||\n hostLower.startsWith('127.') ||\n hostLower.startsWith('[::1]') ||\n hostLower.startsWith('[0:0:0:0:0:0:0:1]'));\n}\n//# sourceMappingURL=proxy.js.map","\"use strict\";\n\n// Runtime header offsets\nconst ID_OFFSET = -8;\nconst SIZE_OFFSET = -4;\n\n// Runtime ids\nconst ARRAYBUFFER_ID = 0;\nconst STRING_ID = 1;\nconst ARRAYBUFFERVIEW_ID = 2;\n\n// Runtime type information\nconst ARRAYBUFFERVIEW = 1 << 0;\nconst ARRAY = 1 << 1;\nconst SET = 1 << 2;\nconst MAP = 1 << 3;\nconst VAL_ALIGN_OFFSET = 5;\nconst VAL_ALIGN = 1 << VAL_ALIGN_OFFSET;\nconst VAL_SIGNED = 1 << 10;\nconst VAL_FLOAT = 1 << 11;\nconst VAL_NULLABLE = 1 << 12;\nconst VAL_MANAGED = 1 << 13;\nconst KEY_ALIGN_OFFSET = 14;\nconst KEY_ALIGN = 1 << KEY_ALIGN_OFFSET;\nconst KEY_SIGNED = 1 << 19;\nconst KEY_FLOAT = 1 << 20;\nconst KEY_NULLABLE = 1 << 21;\nconst KEY_MANAGED = 1 << 22;\n\n// Array(BufferView) layout\nconst ARRAYBUFFERVIEW_BUFFER_OFFSET = 0;\nconst ARRAYBUFFERVIEW_DATASTART_OFFSET = 4;\nconst ARRAYBUFFERVIEW_DATALENGTH_OFFSET = 8;\nconst ARRAYBUFFERVIEW_SIZE = 12;\nconst ARRAY_LENGTH_OFFSET = 12;\nconst ARRAY_SIZE = 16;\n\nconst BIGINT = typeof BigUint64Array !== \"undefined\";\nconst THIS = Symbol();\nconst CHUNKSIZE = 1024;\n\n/** Gets a string from an U32 and an U16 view on a memory. */\nfunction getStringImpl(buffer, ptr) {\n const U32 = new Uint32Array(buffer);\n const U16 = new Uint16Array(buffer);\n var length = U32[(ptr + SIZE_OFFSET) >>> 2] >>> 1;\n var offset = ptr >>> 1;\n if (length <= CHUNKSIZE) return String.fromCharCode.apply(String, U16.subarray(offset, offset + length));\n const parts = [];\n do {\n const last = U16[offset + CHUNKSIZE - 1];\n const size = last >= 0xD800 && last < 0xDC00 ? CHUNKSIZE - 1 : CHUNKSIZE;\n parts.push(String.fromCharCode.apply(String, U16.subarray(offset, offset += size)));\n length -= size;\n } while (length > CHUNKSIZE);\n return parts.join(\"\") + String.fromCharCode.apply(String, U16.subarray(offset, offset + length));\n}\n\n/** Prepares the base module prior to instantiation. */\nfunction preInstantiate(imports) {\n const baseModule = {};\n\n function getString(memory, ptr) {\n if (!memory) return \"\";\n return getStringImpl(memory.buffer, ptr);\n }\n\n // add common imports used by stdlib for convenience\n const env = (imports.env = imports.env || {});\n env.abort = env.abort || function abort(mesg, file, line, colm) {\n const memory = baseModule.memory || env.memory; // prefer exported, otherwise try imported\n throw Error(\"abort: \" + getString(memory, mesg) + \" at \" + getString(memory, file) + \":\" + line + \":\" + colm);\n }\n env.trace = env.trace || function trace(mesg, n) {\n const memory = baseModule.memory || env.memory;\n console.log(\"trace: \" + getString(memory, mesg) + (n ? \" \" : \"\") + Array.prototype.slice.call(arguments, 2, 2 + n).join(\", \"));\n }\n imports.Math = imports.Math || Math;\n imports.Date = imports.Date || Date;\n\n return baseModule;\n}\n\n/** Prepares the final module once instantiation is complete. */\nfunction postInstantiate(baseModule, instance) {\n const rawExports = instance.exports;\n const memory = rawExports.memory;\n const table = rawExports.table;\n const alloc = rawExports[\"__alloc\"];\n const retain = rawExports[\"__retain\"];\n const rttiBase = rawExports[\"__rtti_base\"] || ~0; // oob if not present\n\n /** Gets the runtime type info for the given id. */\n function getInfo(id) {\n const U32 = new Uint32Array(memory.buffer);\n const count = U32[rttiBase >>> 2];\n if ((id >>>= 0) >= count) throw Error(\"invalid id: \" + id);\n return U32[(rttiBase + 4 >>> 2) + id * 2];\n }\n\n /** Gets the runtime base id for the given id. */\n function getBase(id) {\n const U32 = new Uint32Array(memory.buffer);\n const count = U32[rttiBase >>> 2];\n if ((id >>>= 0) >= count) throw Error(\"invalid id: \" + id);\n return U32[(rttiBase + 4 >>> 2) + id * 2 + 1];\n }\n\n /** Gets the runtime alignment of a collection's values. */\n function getValueAlign(info) {\n return 31 - Math.clz32((info >>> VAL_ALIGN_OFFSET) & 31); // -1 if none\n }\n\n /** Gets the runtime alignment of a collection's keys. */\n function getKeyAlign(info) {\n return 31 - Math.clz32((info >>> KEY_ALIGN_OFFSET) & 31); // -1 if none\n }\n\n /** Allocates a new string in the module's memory and returns its retained pointer. */\n function __allocString(str) {\n const length = str.length;\n const ptr = alloc(length << 1, STRING_ID);\n const U16 = new Uint16Array(memory.buffer);\n for (var i = 0, p = ptr >>> 1; i < length; ++i) U16[p + i] = str.charCodeAt(i);\n return ptr;\n }\n\n baseModule.__allocString = __allocString;\n\n /** Reads a string from the module's memory by its pointer. */\n function __getString(ptr) {\n const buffer = memory.buffer;\n const id = new Uint32Array(buffer)[ptr + ID_OFFSET >>> 2];\n if (id !== STRING_ID) throw Error(\"not a string: \" + ptr);\n return getStringImpl(buffer, ptr);\n }\n\n baseModule.__getString = __getString;\n\n /** Gets the view matching the specified alignment, signedness and floatness. */\n function getView(alignLog2, signed, float) {\n const buffer = memory.buffer;\n if (float) {\n switch (alignLog2) {\n case 2: return new Float32Array(buffer);\n case 3: return new Float64Array(buffer);\n }\n } else {\n switch (alignLog2) {\n case 0: return new (signed ? Int8Array : Uint8Array)(buffer);\n case 1: return new (signed ? Int16Array : Uint16Array)(buffer);\n case 2: return new (signed ? Int32Array : Uint32Array)(buffer);\n case 3: return new (signed ? BigInt64Array : BigUint64Array)(buffer);\n }\n }\n throw Error(\"unsupported align: \" + alignLog2);\n }\n\n /** Allocates a new array in the module's memory and returns its retained pointer. */\n function __allocArray(id, values) {\n const info = getInfo(id);\n if (!(info & (ARRAYBUFFERVIEW | ARRAY))) throw Error(\"not an array: \" + id + \" @ \" + info);\n const align = getValueAlign(info);\n const length = values.length;\n const buf = alloc(length << align, ARRAYBUFFER_ID);\n const arr = alloc(info & ARRAY ? ARRAY_SIZE : ARRAYBUFFERVIEW_SIZE, id);\n const U32 = new Uint32Array(memory.buffer);\n U32[arr + ARRAYBUFFERVIEW_BUFFER_OFFSET >>> 2] = retain(buf);\n U32[arr + ARRAYBUFFERVIEW_DATASTART_OFFSET >>> 2] = buf;\n U32[arr + ARRAYBUFFERVIEW_DATALENGTH_OFFSET >>> 2] = length << align;\n if (info & ARRAY) U32[arr + ARRAY_LENGTH_OFFSET >>> 2] = length;\n const view = getView(align, info & VAL_SIGNED, info & VAL_FLOAT);\n if (info & VAL_MANAGED) {\n for (let i = 0; i < length; ++i) view[(buf >>> align) + i] = retain(values[i]);\n } else {\n view.set(values, buf >>> align);\n }\n return arr;\n }\n\n baseModule.__allocArray = __allocArray;\n\n /** Gets a live view on an array's values in the module's memory. Infers the array type from RTTI. */\n function __getArrayView(arr) {\n const U32 = new Uint32Array(memory.buffer);\n const id = U32[arr + ID_OFFSET >>> 2];\n const info = getInfo(id);\n if (!(info & ARRAYBUFFERVIEW)) throw Error(\"not an array: \" + id);\n const align = getValueAlign(info);\n var buf = U32[arr + ARRAYBUFFERVIEW_DATASTART_OFFSET >>> 2];\n const length = info & ARRAY\n ? U32[arr + ARRAY_LENGTH_OFFSET >>> 2]\n : U32[buf + SIZE_OFFSET >>> 2] >>> align;\n return getView(align, info & VAL_SIGNED, info & VAL_FLOAT)\n .subarray(buf >>>= align, buf + length);\n }\n\n baseModule.__getArrayView = __getArrayView;\n\n /** Copies an array's values from the module's memory. Infers the array type from RTTI. */\n function __getArray(arr) {\n const input = __getArrayView(arr);\n const len = input.length;\n const out = new Array(len);\n for (let i = 0; i < len; i++) out[i] = input[i];\n return out;\n }\n\n baseModule.__getArray = __getArray;\n\n /** Copies an ArrayBuffer's value from the module's memory. */\n function __getArrayBuffer(ptr) {\n const buffer = memory.buffer;\n const length = new Uint32Array(buffer)[ptr + SIZE_OFFSET >>> 2];\n return buffer.slice(ptr, ptr + length);\n }\n\n baseModule.__getArrayBuffer = __getArrayBuffer;\n\n /** Copies a typed array's values from the module's memory. */\n function getTypedArray(Type, alignLog2, ptr) {\n return new Type(getTypedArrayView(Type, alignLog2, ptr));\n }\n\n /** Gets a live view on a typed array's values in the module's memory. */\n function getTypedArrayView(Type, alignLog2, ptr) {\n const buffer = memory.buffer;\n const U32 = new Uint32Array(buffer);\n const bufPtr = U32[ptr + ARRAYBUFFERVIEW_DATASTART_OFFSET >>> 2];\n return new Type(buffer, bufPtr, U32[bufPtr + SIZE_OFFSET >>> 2] >>> alignLog2);\n }\n\n baseModule.__getInt8Array = getTypedArray.bind(null, Int8Array, 0);\n baseModule.__getInt8ArrayView = getTypedArrayView.bind(null, Int8Array, 0);\n baseModule.__getUint8Array = getTypedArray.bind(null, Uint8Array, 0);\n baseModule.__getUint8ArrayView = getTypedArrayView.bind(null, Uint8Array, 0);\n baseModule.__getUint8ClampedArray = getTypedArray.bind(null, Uint8ClampedArray, 0);\n baseModule.__getUint8ClampedArrayView = getTypedArrayView.bind(null, Uint8ClampedArray, 0);\n baseModule.__getInt16Array = getTypedArray.bind(null, Int16Array, 1);\n baseModule.__getInt16ArrayView = getTypedArrayView.bind(null, Int16Array, 1);\n baseModule.__getUint16Array = getTypedArray.bind(null, Uint16Array, 1);\n baseModule.__getUint16ArrayView = getTypedArrayView.bind(null, Uint16Array, 1);\n baseModule.__getInt32Array = getTypedArray.bind(null, Int32Array, 2);\n baseModule.__getInt32ArrayView = getTypedArrayView.bind(null, Int32Array, 2);\n baseModule.__getUint32Array = getTypedArray.bind(null, Uint32Array, 2);\n baseModule.__getUint32ArrayView = getTypedArrayView.bind(null, Uint32Array, 2);\n if (BIGINT) {\n baseModule.__getInt64Array = getTypedArray.bind(null, BigInt64Array, 3);\n baseModule.__getInt64ArrayView = getTypedArrayView.bind(null, BigInt64Array, 3);\n baseModule.__getUint64Array = getTypedArray.bind(null, BigUint64Array, 3);\n baseModule.__getUint64ArrayView = getTypedArrayView.bind(null, BigUint64Array, 3);\n }\n baseModule.__getFloat32Array = getTypedArray.bind(null, Float32Array, 2);\n baseModule.__getFloat32ArrayView = getTypedArrayView.bind(null, Float32Array, 2);\n baseModule.__getFloat64Array = getTypedArray.bind(null, Float64Array, 3);\n baseModule.__getFloat64ArrayView = getTypedArrayView.bind(null, Float64Array, 3);\n\n /** Tests whether an object is an instance of the class represented by the specified base id. */\n function __instanceof(ptr, baseId) {\n const U32 = new Uint32Array(memory.buffer);\n var id = U32[(ptr + ID_OFFSET) >>> 2];\n if (id <= U32[rttiBase >>> 2]) {\n do if (id == baseId) return true;\n while (id = getBase(id));\n }\n return false;\n }\n\n baseModule.__instanceof = __instanceof;\n\n // Pull basic exports to baseModule so code in preInstantiate can use them\n baseModule.memory = baseModule.memory || memory;\n baseModule.table = baseModule.table || table;\n\n // Demangle exports and provide the usual utility on the prototype\n return demangle(rawExports, baseModule);\n}\n\nfunction isResponse(o) {\n return typeof Response !== \"undefined\" && o instanceof Response;\n}\n\n/** Asynchronously instantiates an AssemblyScript module from anything that can be instantiated. */\nasync function instantiate(source, imports) {\n if (isResponse(source = await source)) return instantiateStreaming(source, imports);\n return postInstantiate(\n preInstantiate(imports || (imports = {})),\n await WebAssembly.instantiate(\n source instanceof WebAssembly.Module\n ? source\n : await WebAssembly.compile(source),\n imports\n )\n );\n}\n\nexports.instantiate = instantiate;\n\n/** Synchronously instantiates an AssemblyScript module from a WebAssembly.Module or binary buffer. */\nfunction instantiateSync(source, imports) {\n return postInstantiate(\n preInstantiate(imports || (imports = {})),\n new WebAssembly.Instance(\n source instanceof WebAssembly.Module\n ? source\n : new WebAssembly.Module(source),\n imports\n )\n )\n}\n\nexports.instantiateSync = instantiateSync;\n\n/** Asynchronously instantiates an AssemblyScript module from a response, i.e. as obtained by `fetch`. */\nasync function instantiateStreaming(source, imports) {\n if (!WebAssembly.instantiateStreaming) {\n return instantiate(\n isResponse(source = await source)\n ? source.arrayBuffer()\n : source,\n imports\n );\n }\n return postInstantiate(\n preInstantiate(imports || (imports = {})),\n (await WebAssembly.instantiateStreaming(source, imports)).instance\n );\n}\n\nexports.instantiateStreaming = instantiateStreaming;\n\n/** Demangles an AssemblyScript module's exports to a friendly object structure. */\nfunction demangle(exports, baseModule) {\n var module = baseModule ? Object.create(baseModule) : {};\n var setArgumentsLength = exports[\"__argumentsLength\"]\n ? function(length) { exports[\"__argumentsLength\"].value = length; }\n : exports[\"__setArgumentsLength\"] || exports[\"__setargc\"] || function() {};\n for (let internalName in exports) {\n if (!Object.prototype.hasOwnProperty.call(exports, internalName)) continue;\n const elem = exports[internalName];\n let parts = internalName.split(\".\");\n let curr = module;\n while (parts.length > 1) {\n let part = parts.shift();\n if (!Object.prototype.hasOwnProperty.call(curr, part)) curr[part] = {};\n curr = curr[part];\n }\n let name = parts[0];\n let hash = name.indexOf(\"#\");\n if (hash >= 0) {\n let className = name.substring(0, hash);\n let classElem = curr[className];\n if (typeof classElem === \"undefined\" || !classElem.prototype) {\n let ctor = function(...args) {\n return ctor.wrap(ctor.prototype.constructor(0, ...args));\n };\n ctor.prototype = {\n valueOf: function valueOf() {\n return this[THIS];\n }\n };\n ctor.wrap = function(thisValue) {\n return Object.create(ctor.prototype, { [THIS]: { value: thisValue, writable: false } });\n };\n if (classElem) Object.getOwnPropertyNames(classElem).forEach(name =>\n Object.defineProperty(ctor, name, Object.getOwnPropertyDescriptor(classElem, name))\n );\n curr[className] = ctor;\n }\n name = name.substring(hash + 1);\n curr = curr[className].prototype;\n if (/^(get|set):/.test(name)) {\n if (!Object.prototype.hasOwnProperty.call(curr, name = name.substring(4))) {\n let getter = exports[internalName.replace(\"set:\", \"get:\")];\n let setter = exports[internalName.replace(\"get:\", \"set:\")];\n Object.defineProperty(curr, name, {\n get: function() { return getter(this[THIS]); },\n set: function(value) { setter(this[THIS], value); },\n enumerable: true\n });\n }\n } else {\n if (name === 'constructor') {\n (curr[name] = (...args) => {\n setArgumentsLength(args.length);\n return elem(...args);\n }).original = elem;\n } else { // instance method\n (curr[name] = function(...args) { // !\n setArgumentsLength(args.length);\n return elem(this[THIS], ...args);\n }).original = elem;\n }\n }\n } else {\n if (/^(get|set):/.test(name)) {\n if (!Object.prototype.hasOwnProperty.call(curr, name = name.substring(4))) {\n Object.defineProperty(curr, name, {\n get: exports[internalName.replace(\"set:\", \"get:\")],\n set: exports[internalName.replace(\"get:\", \"set:\")],\n enumerable: true\n });\n }\n } else if (typeof elem === \"function\" && elem !== setArgumentsLength) {\n (curr[name] = (...args) => {\n setArgumentsLength(args.length);\n return elem(...args);\n }).original = elem;\n } else {\n curr[name] = elem;\n }\n }\n }\n return module;\n}\n\nexports.demangle = demangle;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar reader = require('./lib/reader.js');\nvar indexer = require('./lib/indexer.js');\nvar iterator = require('./lib/iterator.js');\nvar writer = require('./lib/writer.js');\nvar indexedReader = require('./lib/indexed-reader.js');\n\n\n\nexports.CarReader = reader.CarReader;\nexports.CarIndexer = indexer.CarIndexer;\nexports.CarBlockIterator = iterator.CarBlockIterator;\nexports.CarCIDIterator = iterator.CarCIDIterator;\nexports.CarWriter = writer.CarWriter;\nexports.CarIndexedReader = indexedReader.CarIndexedReader;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar varint = require('varint');\nvar cid = require('multiformats/cid');\nvar Digest = require('multiformats/hashes/digest');\nvar dagCbor = require('@ipld/dag-cbor');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () { return e[k]; }\n });\n }\n });\n }\n n[\"default\"] = e;\n return Object.freeze(n);\n}\n\nvar varint__default = /*#__PURE__*/_interopDefaultLegacy(varint);\nvar Digest__namespace = /*#__PURE__*/_interopNamespace(Digest);\n\nconst CIDV0_BYTES = {\n SHA2_256: 18,\n LENGTH: 32,\n DAG_PB: 112\n};\nasync function readVarint(reader) {\n const bytes = await reader.upTo(8);\n const i = varint__default[\"default\"].decode(bytes);\n reader.seek(varint__default[\"default\"].decode.bytes);\n return i;\n}\nasync function readHeader(reader) {\n const length = await readVarint(reader);\n if (length === 0) {\n throw new Error('Invalid CAR header (zero length)');\n }\n const header = await reader.exactly(length);\n reader.seek(length);\n const block = dagCbor.decode(header);\n if (block == null || Array.isArray(block) || typeof block !== 'object') {\n throw new Error('Invalid CAR header format');\n }\n if (block.version !== 1) {\n if (typeof block.version === 'string') {\n throw new Error(`Invalid CAR version: \"${ block.version }\"`);\n }\n throw new Error(`Invalid CAR version: ${ block.version }`);\n }\n if (!Array.isArray(block.roots)) {\n throw new Error('Invalid CAR header format');\n }\n if (Object.keys(block).filter(p => p !== 'roots' && p !== 'version').length) {\n throw new Error('Invalid CAR header format');\n }\n return block;\n}\nasync function readMultihash(reader) {\n const bytes = await reader.upTo(8);\n varint__default[\"default\"].decode(bytes);\n const codeLength = varint__default[\"default\"].decode.bytes;\n const length = varint__default[\"default\"].decode(bytes.subarray(varint__default[\"default\"].decode.bytes));\n const lengthLength = varint__default[\"default\"].decode.bytes;\n const mhLength = codeLength + lengthLength + length;\n const multihash = await reader.exactly(mhLength);\n reader.seek(mhLength);\n return multihash;\n}\nasync function readCid(reader) {\n const first = await reader.exactly(2);\n if (first[0] === CIDV0_BYTES.SHA2_256 && first[1] === CIDV0_BYTES.LENGTH) {\n const bytes = await reader.exactly(34);\n reader.seek(34);\n const multihash = Digest__namespace.decode(bytes);\n return cid.CID.create(0, CIDV0_BYTES.DAG_PB, multihash);\n }\n const version = await readVarint(reader);\n if (version !== 1) {\n throw new Error(`Unexpected CID version (${ version })`);\n }\n const codec = await readVarint(reader);\n const bytes = await readMultihash(reader);\n const multihash = Digest__namespace.decode(bytes);\n return cid.CID.create(version, codec, multihash);\n}\nasync function readBlockHead(reader) {\n const start = reader.pos;\n let length = await readVarint(reader);\n if (length === 0) {\n throw new Error('Invalid CAR section (zero length)');\n }\n length += reader.pos - start;\n const cid = await readCid(reader);\n const blockLength = length - (reader.pos - start);\n return {\n cid,\n length,\n blockLength\n };\n}\nasync function readBlock(reader) {\n const {cid, blockLength} = await readBlockHead(reader);\n const bytes = await reader.exactly(blockLength);\n reader.seek(blockLength);\n return {\n bytes,\n cid\n };\n}\nasync function readBlockIndex(reader) {\n const offset = reader.pos;\n const {cid, length, blockLength} = await readBlockHead(reader);\n const index = {\n cid,\n length,\n blockLength,\n offset,\n blockOffset: reader.pos\n };\n reader.seek(index.blockLength);\n return index;\n}\nfunction createDecoder(reader) {\n const headerPromise = readHeader(reader);\n return {\n header: () => headerPromise,\n async *blocks() {\n await headerPromise;\n while ((await reader.upTo(8)).length > 0) {\n yield await readBlock(reader);\n }\n },\n async *blocksIndex() {\n await headerPromise;\n while ((await reader.upTo(8)).length > 0) {\n yield await readBlockIndex(reader);\n }\n }\n };\n}\nfunction bytesReader(bytes) {\n let pos = 0;\n return {\n async upTo(length) {\n return bytes.subarray(pos, pos + Math.min(length, bytes.length - pos));\n },\n async exactly(length) {\n if (length > bytes.length - pos) {\n throw new Error('Unexpected end of data');\n }\n return bytes.subarray(pos, pos + length);\n },\n seek(length) {\n pos += length;\n },\n get pos() {\n return pos;\n }\n };\n}\nfunction chunkReader(readChunk) {\n let pos = 0;\n let have = 0;\n let offset = 0;\n let currentChunk = new Uint8Array(0);\n const read = async length => {\n have = currentChunk.length - offset;\n const bufa = [currentChunk.subarray(offset)];\n while (have < length) {\n const chunk = await readChunk();\n if (chunk == null) {\n break;\n }\n if (have < 0) {\n if (chunk.length > have) {\n bufa.push(chunk.subarray(-have));\n }\n } else {\n bufa.push(chunk);\n }\n have += chunk.length;\n }\n currentChunk = new Uint8Array(bufa.reduce((p, c) => p + c.length, 0));\n let off = 0;\n for (const b of bufa) {\n currentChunk.set(b, off);\n off += b.length;\n }\n offset = 0;\n };\n return {\n async upTo(length) {\n if (currentChunk.length - offset < length) {\n await read(length);\n }\n return currentChunk.subarray(offset, offset + Math.min(currentChunk.length - offset, length));\n },\n async exactly(length) {\n if (currentChunk.length - offset < length) {\n await read(length);\n }\n if (currentChunk.length - offset < length) {\n throw new Error('Unexpected end of data');\n }\n return currentChunk.subarray(offset, offset + length);\n },\n seek(length) {\n pos += length;\n offset += length;\n },\n get pos() {\n return pos;\n }\n };\n}\nfunction asyncIterableReader(asyncIterable) {\n const iterator = asyncIterable[Symbol.asyncIterator]();\n async function readChunk() {\n const next = await iterator.next();\n if (next.done) {\n return null;\n }\n return next.value;\n }\n return chunkReader(readChunk);\n}\n\nexports.asyncIterableReader = asyncIterableReader;\nexports.bytesReader = bytesReader;\nexports.chunkReader = chunkReader;\nexports.createDecoder = createDecoder;\nexports.readBlockHead = readBlockHead;\nexports.readHeader = readHeader;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar varint = require('varint');\nvar dagCbor = require('@ipld/dag-cbor');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar varint__default = /*#__PURE__*/_interopDefaultLegacy(varint);\n\nfunction createHeader(roots) {\n const headerBytes = dagCbor.encode({\n version: 1,\n roots\n });\n const varintBytes = varint__default[\"default\"].encode(headerBytes.length);\n const header = new Uint8Array(varintBytes.length + headerBytes.length);\n header.set(varintBytes, 0);\n header.set(headerBytes, varintBytes.length);\n return header;\n}\nfunction createEncoder(writer) {\n return {\n async setRoots(roots) {\n const bytes = createHeader(roots);\n await writer.write(bytes);\n },\n async writeBlock(block) {\n const {cid, bytes} = block;\n await writer.write(new Uint8Array(varint__default[\"default\"].encode(cid.bytes.length + bytes.length)));\n await writer.write(cid.bytes);\n if (bytes.length) {\n await writer.write(bytes);\n }\n },\n async close() {\n return writer.end();\n }\n };\n}\n\nexports.createEncoder = createEncoder;\nexports.createHeader = createHeader;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar fs = require('fs');\nvar stream = require('stream');\nvar cid = require('multiformats/cid');\nvar indexer = require('./indexer.js');\nvar reader = require('./reader.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);\n\nclass CarIndexedReader {\n constructor(version, path, roots, index, order) {\n this._version = version;\n this._path = path;\n this._roots = roots;\n this._index = index;\n this._order = order;\n this._fd = null;\n }\n get version() {\n return this._version;\n }\n async getRoots() {\n return this._roots;\n }\n async has(key) {\n return this._index.has(key.toString());\n }\n async get(key) {\n const blockIndex = this._index.get(key.toString());\n if (!blockIndex) {\n return undefined;\n }\n if (!this._fd) {\n this._fd = await fs__default[\"default\"].promises.open(this._path, 'r');\n }\n const readIndex = {\n cid: key,\n length: 0,\n offset: 0,\n blockLength: blockIndex.blockLength,\n blockOffset: blockIndex.blockOffset\n };\n return reader.CarReader.readRaw(this._fd, readIndex);\n }\n async *blocks() {\n for (const cidStr of this._order) {\n const block = await this.get(cid.CID.parse(cidStr));\n if (!block) {\n throw new Error('Unexpected internal error');\n }\n yield block;\n }\n }\n async *cids() {\n for (const cidStr of this._order) {\n yield cid.CID.parse(cidStr);\n }\n }\n async close() {\n if (this._fd) {\n return this._fd.close();\n }\n }\n static async fromFile(path) {\n if (typeof path !== 'string') {\n throw new TypeError('fromFile() requires a file path string');\n }\n const iterable = await indexer.CarIndexer.fromIterable(stream.Readable.from(fs__default[\"default\"].createReadStream(path)));\n const index = new Map();\n const order = [];\n for await (const {cid, blockLength, blockOffset} of iterable) {\n const cidStr = cid.toString();\n index.set(cidStr, {\n blockLength,\n blockOffset\n });\n order.push(cidStr);\n }\n return new CarIndexedReader(iterable.version, path, await iterable.getRoots(), index, order);\n }\n}\nconst __browser = false;\n\nexports.CarIndexedReader = CarIndexedReader;\nexports.__browser = __browser;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar decoder = require('./decoder.js');\n\nclass CarIndexer {\n constructor(version, roots, iterator) {\n this._version = version;\n this._roots = roots;\n this._iterator = iterator;\n }\n get version() {\n return this._version;\n }\n async getRoots() {\n return this._roots;\n }\n [Symbol.asyncIterator]() {\n return this._iterator;\n }\n static async fromBytes(bytes) {\n if (!(bytes instanceof Uint8Array)) {\n throw new TypeError('fromBytes() requires a Uint8Array');\n }\n return decodeIndexerComplete(decoder.bytesReader(bytes));\n }\n static async fromIterable(asyncIterable) {\n if (!asyncIterable || !(typeof asyncIterable[Symbol.asyncIterator] === 'function')) {\n throw new TypeError('fromIterable() requires an async iterable');\n }\n return decodeIndexerComplete(decoder.asyncIterableReader(asyncIterable));\n }\n}\nasync function decodeIndexerComplete(reader) {\n const decoder$1 = decoder.createDecoder(reader);\n const {version, roots} = await decoder$1.header();\n return new CarIndexer(version, roots, decoder$1.blocksIndex());\n}\n\nexports.CarIndexer = CarIndexer;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction noop() {\n}\nfunction create() {\n const chunkQueue = [];\n let drainer = null;\n let drainerResolver = noop;\n let ended = false;\n let outWait = null;\n let outWaitResolver = noop;\n const makeDrainer = () => {\n if (!drainer) {\n drainer = new Promise(resolve => {\n drainerResolver = () => {\n drainer = null;\n drainerResolver = noop;\n resolve();\n };\n });\n }\n return drainer;\n };\n const writer = {\n write(chunk) {\n chunkQueue.push(chunk);\n const drainer = makeDrainer();\n outWaitResolver();\n return drainer;\n },\n async end() {\n ended = true;\n const drainer = makeDrainer();\n outWaitResolver();\n return drainer;\n }\n };\n const iterator = {\n async next() {\n const chunk = chunkQueue.shift();\n if (chunk) {\n if (chunkQueue.length === 0) {\n drainerResolver();\n }\n return {\n done: false,\n value: chunk\n };\n }\n if (ended) {\n drainerResolver();\n return {\n done: true,\n value: undefined\n };\n }\n if (!outWait) {\n outWait = new Promise(resolve => {\n outWaitResolver = () => {\n outWait = null;\n outWaitResolver = noop;\n return resolve(iterator.next());\n };\n });\n }\n return outWait;\n }\n };\n return {\n writer,\n iterator\n };\n}\n\nexports.create = create;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar decoder = require('./decoder.js');\n\nclass CarIteratorBase {\n constructor(version, roots, iterable) {\n this._version = version;\n this._roots = roots;\n this._iterable = iterable;\n this._decoded = false;\n }\n get version() {\n return this._version;\n }\n async getRoots() {\n return this._roots;\n }\n}\nclass CarBlockIterator extends CarIteratorBase {\n [Symbol.asyncIterator]() {\n if (this._decoded) {\n throw new Error('Cannot decode more than once');\n }\n if (!this._iterable) {\n throw new Error('Block iterable not found');\n }\n this._decoded = true;\n return this._iterable[Symbol.asyncIterator]();\n }\n static async fromBytes(bytes) {\n const {version, roots, iterator} = await fromBytes(bytes);\n return new CarBlockIterator(version, roots, iterator);\n }\n static async fromIterable(asyncIterable) {\n const {version, roots, iterator} = await fromIterable(asyncIterable);\n return new CarBlockIterator(version, roots, iterator);\n }\n}\nclass CarCIDIterator extends CarIteratorBase {\n [Symbol.asyncIterator]() {\n if (this._decoded) {\n throw new Error('Cannot decode more than once');\n }\n if (!this._iterable) {\n throw new Error('Block iterable not found');\n }\n this._decoded = true;\n const iterable = this._iterable[Symbol.asyncIterator]();\n return {\n async next() {\n const next = await iterable.next();\n if (next.done) {\n return next;\n }\n return {\n done: false,\n value: next.value.cid\n };\n }\n };\n }\n static async fromBytes(bytes) {\n const {version, roots, iterator} = await fromBytes(bytes);\n return new CarCIDIterator(version, roots, iterator);\n }\n static async fromIterable(asyncIterable) {\n const {version, roots, iterator} = await fromIterable(asyncIterable);\n return new CarCIDIterator(version, roots, iterator);\n }\n}\nasync function fromBytes(bytes) {\n if (!(bytes instanceof Uint8Array)) {\n throw new TypeError('fromBytes() requires a Uint8Array');\n }\n return decodeIterator(decoder.bytesReader(bytes));\n}\nasync function fromIterable(asyncIterable) {\n if (!asyncIterable || !(typeof asyncIterable[Symbol.asyncIterator] === 'function')) {\n throw new TypeError('fromIterable() requires an async iterable');\n }\n return decodeIterator(decoder.asyncIterableReader(asyncIterable));\n}\nasync function decodeIterator(reader) {\n const decoder$1 = decoder.createDecoder(reader);\n const {version, roots} = await decoder$1.header();\n return {\n version,\n roots,\n iterator: decoder$1.blocks()\n };\n}\n\nexports.CarBlockIterator = CarBlockIterator;\nexports.CarCIDIterator = CarCIDIterator;\nexports.CarIteratorBase = CarIteratorBase;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar decoder = require('./decoder.js');\n\nclass CarReader {\n constructor(version, roots, blocks) {\n this._version = version;\n this._roots = roots;\n this._blocks = blocks;\n this._keys = blocks.map(b => b.cid.toString());\n }\n get version() {\n return this._version;\n }\n async getRoots() {\n return this._roots;\n }\n async has(key) {\n return this._keys.indexOf(key.toString()) > -1;\n }\n async get(key) {\n const index = this._keys.indexOf(key.toString());\n return index > -1 ? this._blocks[index] : undefined;\n }\n async *blocks() {\n for (const block of this._blocks) {\n yield block;\n }\n }\n async *cids() {\n for (const block of this._blocks) {\n yield block.cid;\n }\n }\n static async fromBytes(bytes) {\n if (!(bytes instanceof Uint8Array)) {\n throw new TypeError('fromBytes() requires a Uint8Array');\n }\n return decodeReaderComplete(decoder.bytesReader(bytes));\n }\n static async fromIterable(asyncIterable) {\n if (!asyncIterable || !(typeof asyncIterable[Symbol.asyncIterator] === 'function')) {\n throw new TypeError('fromIterable() requires an async iterable');\n }\n return decodeReaderComplete(decoder.asyncIterableReader(asyncIterable));\n }\n}\nasync function decodeReaderComplete(reader) {\n const decoder$1 = decoder.createDecoder(reader);\n const {version, roots} = await decoder$1.header();\n const blocks = [];\n for await (const block of decoder$1.blocks()) {\n blocks.push(block);\n }\n return new CarReader(version, roots, blocks);\n}\nconst __browser = true;\n\nexports.CarReader = CarReader;\nexports.__browser = __browser;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar fs = require('fs');\nvar util = require('util');\nvar readerBrowser = require('./reader-browser.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);\n\nconst fsread = util.promisify(fs__default[\"default\"].read);\nclass CarReader extends readerBrowser.CarReader {\n static async readRaw(fd, blockIndex) {\n const {cid, blockLength, blockOffset} = blockIndex;\n const bytes = new Uint8Array(blockLength);\n let read;\n if (typeof fd === 'number') {\n read = (await fsread(fd, bytes, 0, blockLength, blockOffset)).bytesRead;\n } else if (typeof fd === 'object' && typeof fd.read === 'function') {\n read = (await fd.read(bytes, 0, blockLength, blockOffset)).bytesRead;\n } else {\n throw new TypeError('Bad fd');\n }\n if (read !== blockLength) {\n throw new Error(`Failed to read entire block (${ read } instead of ${ blockLength })`);\n }\n return {\n cid,\n bytes\n };\n }\n}\nconst __browser = false;\n\nexports.CarReader = CarReader;\nexports.__browser = __browser;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar cid = require('multiformats/cid');\nvar encoder = require('./encoder.js');\nvar iteratorChannel = require('./iterator-channel.js');\nvar decoder = require('./decoder.js');\n\nclass CarWriter {\n constructor(roots, encoder) {\n this._encoder = encoder;\n this._mutex = encoder.setRoots(roots);\n this._ended = false;\n }\n async put(block) {\n if (!(block.bytes instanceof Uint8Array) || !block.cid) {\n throw new TypeError('Can only write {cid, bytes} objects');\n }\n if (this._ended) {\n throw new Error('Already closed');\n }\n const cid$1 = cid.CID.asCID(block.cid);\n if (!cid$1) {\n throw new TypeError('Can only write {cid, bytes} objects');\n }\n this._mutex = this._mutex.then(() => this._encoder.writeBlock({\n cid: cid$1,\n bytes: block.bytes\n }));\n return this._mutex;\n }\n async close() {\n if (this._ended) {\n throw new Error('Already closed');\n }\n await this._mutex;\n this._ended = true;\n return this._encoder.close();\n }\n static create(roots) {\n roots = toRoots(roots);\n const {encoder, iterator} = encodeWriter();\n const writer = new CarWriter(roots, encoder);\n const out = new CarWriterOut(iterator);\n return {\n writer,\n out\n };\n }\n static createAppender() {\n const {encoder, iterator} = encodeWriter();\n encoder.setRoots = () => Promise.resolve();\n const writer = new CarWriter([], encoder);\n const out = new CarWriterOut(iterator);\n return {\n writer,\n out\n };\n }\n static async updateRootsInBytes(bytes, roots) {\n const reader = decoder.bytesReader(bytes);\n await decoder.readHeader(reader);\n const newHeader = encoder.createHeader(roots);\n if (reader.pos !== newHeader.length) {\n throw new Error(`updateRoots() can only overwrite a header of the same length (old header is ${ reader.pos } bytes, new header is ${ newHeader.length } bytes)`);\n }\n bytes.set(newHeader, 0);\n return bytes;\n }\n}\nclass CarWriterOut {\n constructor(iterator) {\n this._iterator = iterator;\n }\n [Symbol.asyncIterator]() {\n if (this._iterating) {\n throw new Error('Multiple iterator not supported');\n }\n this._iterating = true;\n return this._iterator;\n }\n}\nfunction encodeWriter() {\n const iw = iteratorChannel.create();\n const {writer, iterator} = iw;\n const encoder$1 = encoder.createEncoder(writer);\n return {\n encoder: encoder$1,\n iterator\n };\n}\nfunction toRoots(roots) {\n if (roots === undefined) {\n return [];\n }\n if (!Array.isArray(roots)) {\n const cid$1 = cid.CID.asCID(roots);\n if (!cid$1) {\n throw new TypeError('roots must be a single CID or an array of CIDs');\n }\n return [cid$1];\n }\n const _roots = [];\n for (const root of roots) {\n const _root = cid.CID.asCID(root);\n if (!_root) {\n throw new TypeError('roots must be a single CID or an array of CIDs');\n }\n _roots.push(_root);\n }\n return _roots;\n}\nconst __browser = true;\n\nexports.CarWriter = CarWriter;\nexports.CarWriterOut = CarWriterOut;\nexports.__browser = __browser;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar fs = require('fs');\nvar util = require('util');\nvar writerBrowser = require('./writer-browser.js');\nvar decoder = require('./decoder.js');\nvar encoder = require('./encoder.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);\n\nconst fsread = util.promisify(fs__default[\"default\"].read);\nconst fswrite = util.promisify(fs__default[\"default\"].write);\nclass CarWriter extends writerBrowser.CarWriter {\n static async updateRootsInFile(fd, roots) {\n const chunkSize = 256;\n let bytes;\n let offset = 0;\n let readChunk;\n if (typeof fd === 'number') {\n readChunk = async () => (await fsread(fd, bytes, 0, chunkSize, offset)).bytesRead;\n } else if (typeof fd === 'object' && typeof fd.read === 'function') {\n readChunk = async () => (await fd.read(bytes, 0, chunkSize, offset)).bytesRead;\n } else {\n throw new TypeError('Bad fd');\n }\n const fdReader = decoder.chunkReader(async () => {\n bytes = new Uint8Array(chunkSize);\n const read = await readChunk();\n offset += read;\n return read < chunkSize ? bytes.subarray(0, read) : bytes;\n });\n await decoder.readHeader(fdReader);\n const newHeader = encoder.createHeader(roots);\n if (fdReader.pos !== newHeader.length) {\n throw new Error(`updateRoots() can only overwrite a header of the same length (old header is ${ fdReader.pos } bytes, new header is ${ newHeader.length } bytes)`);\n }\n if (typeof fd === 'number') {\n await fswrite(fd, newHeader, 0, newHeader.length, 0);\n } else if (typeof fd === 'object' && typeof fd.read === 'function') {\n await fd.write(newHeader, 0, newHeader.length, 0);\n }\n }\n}\nconst __browser = false;\n\nexports.CarWriter = CarWriter;\nexports.__browser = __browser;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar cborg = require('cborg');\nvar cid = require('multiformats/cid');\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () { return e[k]; }\n });\n }\n });\n }\n n[\"default\"] = e;\n return Object.freeze(n);\n}\n\nvar cborg__namespace = /*#__PURE__*/_interopNamespace(cborg);\n\nconst CID_CBOR_TAG = 42;\nfunction cidEncoder(obj) {\n if (obj.asCID !== obj) {\n return null;\n }\n const cid$1 = cid.CID.asCID(obj);\n if (!cid$1) {\n return null;\n }\n const bytes = new Uint8Array(cid$1.bytes.byteLength + 1);\n bytes.set(cid$1.bytes, 1);\n return [\n new cborg__namespace.Token(cborg__namespace.Type.tag, CID_CBOR_TAG),\n new cborg__namespace.Token(cborg__namespace.Type.bytes, bytes)\n ];\n}\nfunction undefinedEncoder() {\n throw new Error('`undefined` is not supported by the IPLD Data Model and cannot be encoded');\n}\nfunction numberEncoder(num) {\n if (Number.isNaN(num)) {\n throw new Error('`NaN` is not supported by the IPLD Data Model and cannot be encoded');\n }\n if (num === Infinity || num === -Infinity) {\n throw new Error('`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded');\n }\n return null;\n}\nconst encodeOptions = {\n float64: true,\n typeEncoders: {\n Object: cidEncoder,\n undefined: undefinedEncoder,\n number: numberEncoder\n }\n};\nfunction cidDecoder(bytes) {\n if (bytes[0] !== 0) {\n throw new Error('Invalid CID for CBOR tag 42; expected leading 0x00');\n }\n return cid.CID.decode(bytes.subarray(1));\n}\nconst decodeOptions = {\n allowIndefinite: false,\n coerceUndefinedToNull: true,\n allowNaN: false,\n allowInfinity: false,\n allowBigInt: true,\n strict: true,\n useMaps: false,\n tags: []\n};\ndecodeOptions.tags[CID_CBOR_TAG] = cidDecoder;\nconst name = 'dag-cbor';\nconst code = 113;\nconst encode = node => cborg__namespace.encode(node, encodeOptions);\nconst decode = data => cborg__namespace.decode(data, decodeOptions);\n\nexports.code = code;\nexports.decode = decode;\nexports.encode = encode;\nexports.name = name;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar cborg = require('cborg');\nvar cid = require('multiformats/cid');\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () {\n return e[k];\n }\n });\n }\n });\n }\n n['default'] = e;\n return Object.freeze(n);\n}\n\nvar cborg__namespace = /*#__PURE__*/_interopNamespace(cborg);\n\nconst CID_CBOR_TAG = 42;\nfunction cidEncoder(obj) {\n if (obj.asCID !== obj) {\n return null;\n }\n const cid$1 = cid.CID.asCID(obj);\n if (!cid$1) {\n return null;\n }\n const bytes = new Uint8Array(cid$1.bytes.byteLength + 1);\n bytes.set(cid$1.bytes, 1);\n return [\n new cborg__namespace.Token(cborg__namespace.Type.tag, CID_CBOR_TAG),\n new cborg__namespace.Token(cborg__namespace.Type.bytes, bytes)\n ];\n}\nfunction undefinedEncoder() {\n throw new Error('`undefined` is not supported by the IPLD Data Model and cannot be encoded');\n}\nfunction numberEncoder(num) {\n if (Number.isNaN(num)) {\n throw new Error('`NaN` is not supported by the IPLD Data Model and cannot be encoded');\n }\n if (num === Infinity || num === -Infinity) {\n throw new Error('`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded');\n }\n return null;\n}\nconst encodeOptions = {\n float64: true,\n typeEncoders: {\n Object: cidEncoder,\n undefined: undefinedEncoder,\n number: numberEncoder\n }\n};\nfunction cidDecoder(bytes) {\n if (bytes[0] !== 0) {\n throw new Error('Invalid CID for CBOR tag 42; expected leading 0x00');\n }\n return cid.CID.decode(bytes.subarray(1));\n}\nconst decodeOptions = {\n allowIndefinite: false,\n allowUndefined: false,\n allowNaN: false,\n allowInfinity: false,\n allowBigInt: true,\n strict: true,\n useMaps: false,\n tags: []\n};\ndecodeOptions.tags[CID_CBOR_TAG] = cidDecoder;\nconst name = 'dag-cbor';\nconst code = 113;\nconst encode = node => cborg__namespace.encode(node, encodeOptions);\nconst decode = data => cborg__namespace.decode(data, decodeOptions);\n\nexports.code = code;\nexports.decode = decode;\nexports.encode = encode;\nexports.name = name;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar cid = require('multiformats/cid');\nvar pbDecode = require('./pb-decode.js');\nvar pbEncode = require('./pb-encode.js');\nvar util = require('./util.js');\n\nconst name = 'dag-pb';\nconst code = 112;\nfunction encode(node) {\n util.validate(node);\n const pbn = {};\n if (node.Links) {\n pbn.Links = node.Links.map(l => {\n const link = {};\n if (l.Hash) {\n link.Hash = l.Hash.bytes;\n }\n if (l.Name !== undefined) {\n link.Name = l.Name;\n }\n if (l.Tsize !== undefined) {\n link.Tsize = l.Tsize;\n }\n return link;\n });\n }\n if (node.Data) {\n pbn.Data = node.Data;\n }\n return pbEncode.encodeNode(pbn);\n}\nfunction decode(bytes) {\n const pbn = pbDecode.decodeNode(bytes);\n const node = {};\n if (pbn.Data) {\n node.Data = pbn.Data;\n }\n if (pbn.Links) {\n node.Links = pbn.Links.map(l => {\n const link = {};\n try {\n link.Hash = cid.CID.decode(l.Hash);\n } catch (e) {\n }\n if (!link.Hash) {\n throw new Error('Invalid Hash field found in link, expected CID');\n }\n if (l.Name !== undefined) {\n link.Name = l.Name;\n }\n if (l.Tsize !== undefined) {\n link.Tsize = l.Tsize;\n }\n return link;\n });\n }\n return node;\n}\n\nexports.createLink = util.createLink;\nexports.createNode = util.createNode;\nexports.prepare = util.prepare;\nexports.validate = util.validate;\nexports.code = code;\nexports.decode = decode;\nexports.encode = encode;\nexports.name = name;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst textDecoder = new TextDecoder();\nfunction decodeVarint(bytes, offset) {\n let v = 0;\n for (let shift = 0;; shift += 7) {\n if (shift >= 64) {\n throw new Error('protobuf: varint overflow');\n }\n if (offset >= bytes.length) {\n throw new Error('protobuf: unexpected end of data');\n }\n const b = bytes[offset++];\n v += shift < 28 ? (b & 127) << shift : (b & 127) * 2 ** shift;\n if (b < 128) {\n break;\n }\n }\n return [\n v,\n offset\n ];\n}\nfunction decodeBytes(bytes, offset) {\n let byteLen;\n [byteLen, offset] = decodeVarint(bytes, offset);\n const postOffset = offset + byteLen;\n if (byteLen < 0 || postOffset < 0) {\n throw new Error('protobuf: invalid length');\n }\n if (postOffset > bytes.length) {\n throw new Error('protobuf: unexpected end of data');\n }\n return [\n bytes.subarray(offset, postOffset),\n postOffset\n ];\n}\nfunction decodeKey(bytes, index) {\n let wire;\n [wire, index] = decodeVarint(bytes, index);\n return [\n wire & 7,\n wire >> 3,\n index\n ];\n}\nfunction decodeLink(bytes) {\n const link = {};\n const l = bytes.length;\n let index = 0;\n while (index < l) {\n let wireType, fieldNum;\n [wireType, fieldNum, index] = decodeKey(bytes, index);\n if (fieldNum === 1) {\n if (link.Hash) {\n throw new Error('protobuf: (PBLink) duplicate Hash section');\n }\n if (wireType !== 2) {\n throw new Error(`protobuf: (PBLink) wrong wireType (${ wireType }) for Hash`);\n }\n if (link.Name !== undefined) {\n throw new Error('protobuf: (PBLink) invalid order, found Name before Hash');\n }\n if (link.Tsize !== undefined) {\n throw new Error('protobuf: (PBLink) invalid order, found Tsize before Hash');\n }\n ;\n [link.Hash, index] = decodeBytes(bytes, index);\n } else if (fieldNum === 2) {\n if (link.Name !== undefined) {\n throw new Error('protobuf: (PBLink) duplicate Name section');\n }\n if (wireType !== 2) {\n throw new Error(`protobuf: (PBLink) wrong wireType (${ wireType }) for Name`);\n }\n if (link.Tsize !== undefined) {\n throw new Error('protobuf: (PBLink) invalid order, found Tsize before Name');\n }\n let byts;\n [byts, index] = decodeBytes(bytes, index);\n link.Name = textDecoder.decode(byts);\n } else if (fieldNum === 3) {\n if (link.Tsize !== undefined) {\n throw new Error('protobuf: (PBLink) duplicate Tsize section');\n }\n if (wireType !== 0) {\n throw new Error(`protobuf: (PBLink) wrong wireType (${ wireType }) for Tsize`);\n }\n ;\n [link.Tsize, index] = decodeVarint(bytes, index);\n } else {\n throw new Error(`protobuf: (PBLink) invalid fieldNumber, expected 1, 2 or 3, got ${ fieldNum }`);\n }\n }\n if (index > l) {\n throw new Error('protobuf: (PBLink) unexpected end of data');\n }\n return link;\n}\nfunction decodeNode(bytes) {\n const l = bytes.length;\n let index = 0;\n let links;\n let linksBeforeData = false;\n let data;\n while (index < l) {\n let wireType, fieldNum;\n [wireType, fieldNum, index] = decodeKey(bytes, index);\n if (wireType !== 2) {\n throw new Error(`protobuf: (PBNode) invalid wireType, expected 2, got ${ wireType }`);\n }\n if (fieldNum === 1) {\n if (data) {\n throw new Error('protobuf: (PBNode) duplicate Data section');\n }\n ;\n [data, index] = decodeBytes(bytes, index);\n if (links) {\n linksBeforeData = true;\n }\n } else if (fieldNum === 2) {\n if (linksBeforeData) {\n throw new Error('protobuf: (PBNode) duplicate Links section');\n } else if (!links) {\n links = [];\n }\n let byts;\n [byts, index] = decodeBytes(bytes, index);\n links.push(decodeLink(byts));\n } else {\n throw new Error(`protobuf: (PBNode) invalid fieldNumber, expected 1 or 2, got ${ fieldNum }`);\n }\n }\n if (index > l) {\n throw new Error('protobuf: (PBNode) unexpected end of data');\n }\n const node = {};\n if (data) {\n node.Data = data;\n }\n node.Links = links || [];\n return node;\n}\n\nexports.decodeNode = decodeNode;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst textEncoder = new TextEncoder();\nconst maxInt32 = 2 ** 32;\nconst maxUInt32 = 2 ** 31;\nfunction encodeLink(link, bytes) {\n let i = bytes.length;\n if (typeof link.Tsize === 'number') {\n if (link.Tsize < 0) {\n throw new Error('Tsize cannot be negative');\n }\n if (!Number.isSafeInteger(link.Tsize)) {\n throw new Error('Tsize too large for encoding');\n }\n i = encodeVarint(bytes, i, link.Tsize) - 1;\n bytes[i] = 24;\n }\n if (typeof link.Name === 'string') {\n const nameBytes = textEncoder.encode(link.Name);\n i -= nameBytes.length;\n bytes.set(nameBytes, i);\n i = encodeVarint(bytes, i, nameBytes.length) - 1;\n bytes[i] = 18;\n }\n if (link.Hash) {\n i -= link.Hash.length;\n bytes.set(link.Hash, i);\n i = encodeVarint(bytes, i, link.Hash.length) - 1;\n bytes[i] = 10;\n }\n return bytes.length - i;\n}\nfunction encodeNode(node) {\n const size = sizeNode(node);\n const bytes = new Uint8Array(size);\n let i = size;\n if (node.Data) {\n i -= node.Data.length;\n bytes.set(node.Data, i);\n i = encodeVarint(bytes, i, node.Data.length) - 1;\n bytes[i] = 10;\n }\n if (node.Links) {\n for (let index = node.Links.length - 1; index >= 0; index--) {\n const size = encodeLink(node.Links[index], bytes.subarray(0, i));\n i -= size;\n i = encodeVarint(bytes, i, size) - 1;\n bytes[i] = 18;\n }\n }\n return bytes;\n}\nfunction sizeLink(link) {\n let n = 0;\n if (link.Hash) {\n const l = link.Hash.length;\n n += 1 + l + sov(l);\n }\n if (typeof link.Name === 'string') {\n const l = textEncoder.encode(link.Name).length;\n n += 1 + l + sov(l);\n }\n if (typeof link.Tsize === 'number') {\n n += 1 + sov(link.Tsize);\n }\n return n;\n}\nfunction sizeNode(node) {\n let n = 0;\n if (node.Data) {\n const l = node.Data.length;\n n += 1 + l + sov(l);\n }\n if (node.Links) {\n for (const link of node.Links) {\n const l = sizeLink(link);\n n += 1 + l + sov(l);\n }\n }\n return n;\n}\nfunction encodeVarint(bytes, offset, v) {\n offset -= sov(v);\n const base = offset;\n while (v >= maxUInt32) {\n bytes[offset++] = v & 127 | 128;\n v /= 128;\n }\n while (v >= 128) {\n bytes[offset++] = v & 127 | 128;\n v >>>= 7;\n }\n bytes[offset] = v;\n return base;\n}\nfunction sov(x) {\n if (x % 2 === 0) {\n x++;\n }\n return Math.floor((len64(x) + 6) / 7);\n}\nfunction len64(x) {\n let n = 0;\n if (x >= maxInt32) {\n x = Math.floor(x / maxInt32);\n n = 32;\n }\n if (x >= 1 << 16) {\n x >>>= 16;\n n += 16;\n }\n if (x >= 1 << 8) {\n x >>>= 8;\n n += 8;\n }\n return n + len8tab[x];\n}\nconst len8tab = [\n 0,\n 1,\n 2,\n 2,\n 3,\n 3,\n 3,\n 3,\n 4,\n 4,\n 4,\n 4,\n 4,\n 4,\n 4,\n 4,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 5,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 6,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 7,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8,\n 8\n];\n\nexports.encodeNode = encodeNode;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar cid = require('multiformats/cid');\n\nconst pbNodeProperties = [\n 'Data',\n 'Links'\n];\nconst pbLinkProperties = [\n 'Hash',\n 'Name',\n 'Tsize'\n];\nconst textEncoder = new TextEncoder();\nfunction linkComparator(a, b) {\n if (a === b) {\n return 0;\n }\n const abuf = a.Name ? textEncoder.encode(a.Name) : [];\n const bbuf = b.Name ? textEncoder.encode(b.Name) : [];\n let x = abuf.length;\n let y = bbuf.length;\n for (let i = 0, len = Math.min(x, y); i < len; ++i) {\n if (abuf[i] !== bbuf[i]) {\n x = abuf[i];\n y = bbuf[i];\n break;\n }\n }\n return x < y ? -1 : y < x ? 1 : 0;\n}\nfunction hasOnlyProperties(node, properties) {\n return !Object.keys(node).some(p => !properties.includes(p));\n}\nfunction asLink(link) {\n if (typeof link.asCID === 'object') {\n const Hash = cid.CID.asCID(link);\n if (!Hash) {\n throw new TypeError('Invalid DAG-PB form');\n }\n return { Hash };\n }\n if (typeof link !== 'object' || Array.isArray(link)) {\n throw new TypeError('Invalid DAG-PB form');\n }\n const pbl = {};\n if (link.Hash) {\n let cid$1 = cid.CID.asCID(link.Hash);\n try {\n if (!cid$1) {\n if (typeof link.Hash === 'string') {\n cid$1 = cid.CID.parse(link.Hash);\n } else if (link.Hash instanceof Uint8Array) {\n cid$1 = cid.CID.decode(link.Hash);\n }\n }\n } catch (e) {\n throw new TypeError(`Invalid DAG-PB form: ${ e.message }`);\n }\n if (cid$1) {\n pbl.Hash = cid$1;\n }\n }\n if (!pbl.Hash) {\n throw new TypeError('Invalid DAG-PB form');\n }\n if (typeof link.Name === 'string') {\n pbl.Name = link.Name;\n }\n if (typeof link.Tsize === 'number') {\n pbl.Tsize = link.Tsize;\n }\n return pbl;\n}\nfunction prepare(node) {\n if (node instanceof Uint8Array || typeof node === 'string') {\n node = { Data: node };\n }\n if (typeof node !== 'object' || Array.isArray(node)) {\n throw new TypeError('Invalid DAG-PB form');\n }\n const pbn = {};\n if (node.Data !== undefined) {\n if (typeof node.Data === 'string') {\n pbn.Data = textEncoder.encode(node.Data);\n } else if (node.Data instanceof Uint8Array) {\n pbn.Data = node.Data;\n } else {\n throw new TypeError('Invalid DAG-PB form');\n }\n }\n if (node.Links !== undefined) {\n if (Array.isArray(node.Links)) {\n pbn.Links = node.Links.map(asLink);\n pbn.Links.sort(linkComparator);\n } else {\n throw new TypeError('Invalid DAG-PB form');\n }\n } else {\n pbn.Links = [];\n }\n return pbn;\n}\nfunction validate(node) {\n if (!node || typeof node !== 'object' || Array.isArray(node)) {\n throw new TypeError('Invalid DAG-PB form');\n }\n if (!hasOnlyProperties(node, pbNodeProperties)) {\n throw new TypeError('Invalid DAG-PB form (extraneous properties)');\n }\n if (node.Data !== undefined && !(node.Data instanceof Uint8Array)) {\n throw new TypeError('Invalid DAG-PB form (Data must be a Uint8Array)');\n }\n if (!Array.isArray(node.Links)) {\n throw new TypeError('Invalid DAG-PB form (Links must be an array)');\n }\n for (let i = 0; i < node.Links.length; i++) {\n const link = node.Links[i];\n if (!link || typeof link !== 'object' || Array.isArray(link)) {\n throw new TypeError('Invalid DAG-PB form (bad link object)');\n }\n if (!hasOnlyProperties(link, pbLinkProperties)) {\n throw new TypeError('Invalid DAG-PB form (extraneous properties on link object)');\n }\n if (!link.Hash) {\n throw new TypeError('Invalid DAG-PB form (link must have a Hash)');\n }\n if (link.Hash.asCID !== link.Hash) {\n throw new TypeError('Invalid DAG-PB form (link Hash must be a CID)');\n }\n if (link.Name !== undefined && typeof link.Name !== 'string') {\n throw new TypeError('Invalid DAG-PB form (link Name must be a string)');\n }\n if (link.Tsize !== undefined && (typeof link.Tsize !== 'number' || link.Tsize % 1 !== 0)) {\n throw new TypeError('Invalid DAG-PB form (link Tsize must be an integer)');\n }\n if (i > 0 && linkComparator(link, node.Links[i - 1]) === -1) {\n throw new TypeError('Invalid DAG-PB form (links must be sorted by Name bytes)');\n }\n }\n}\nfunction createNode(data, links = []) {\n return prepare({\n Data: data,\n Links: links\n });\n}\nfunction createLink(name, size, cid) {\n return asLink({\n Hash: cid,\n Name: name,\n Tsize: size\n });\n}\n\nexports.createLink = createLink;\nexports.createNode = createNode;\nexports.prepare = prepare;\nexports.validate = validate;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar hasher = require('multiformats/hashes/hasher');\nvar multiformats = require('multiformats');\nvar mur = require('murmurhash3js-revisited');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar mur__default = /*#__PURE__*/_interopDefaultLegacy(mur);\n\nfunction fromNumberTo32BitBuf(number) {\n const bytes = new Array(4);\n for (let i = 0; i < 4; i++) {\n bytes[i] = number & 255;\n number = number >> 8;\n }\n return new Uint8Array(bytes);\n}\nconst murmur332 = hasher.from({\n name: 'murmur3-32',\n code: 35,\n encode: input => fromNumberTo32BitBuf(mur__default[\"default\"].x86.hash32(input))\n});\nconst murmur3128 = hasher.from({\n name: 'murmur3-128',\n code: 34,\n encode: input => multiformats.bytes.fromHex(mur__default[\"default\"].x64.hash128(input))\n});\n\nexports.murmur3128 = murmur3128;\nexports.murmur332 = murmur332;\n","\"use strict\";\r\nmodule.exports = asPromise;\r\n\r\n/**\r\n * Callback as used by {@link util.asPromise}.\r\n * @typedef asPromiseCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {...*} params Additional arguments\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Returns a promise from a node-style callback function.\r\n * @memberof util\r\n * @param {asPromiseCallback} fn Function to call\r\n * @param {*} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0,\r\n index = 2,\r\n pending = true;\r\n while (index < arguments.length)\r\n params[offset++] = arguments[index++];\r\n return new Promise(function executor(resolve, reject) {\r\n params[offset] = function callback(err/*, varargs */) {\r\n if (pending) {\r\n pending = false;\r\n if (err)\r\n reject(err);\r\n else {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0;\r\n while (offset < params.length)\r\n params[offset++] = arguments[offset];\r\n resolve.apply(null, params);\r\n }\r\n }\r\n };\r\n try {\r\n fn.apply(ctx || null, params);\r\n } catch (err) {\r\n if (pending) {\r\n pending = false;\r\n reject(err);\r\n }\r\n }\r\n });\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} string Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(string) {\r\n var p = string.length;\r\n if (!p)\r\n return 0;\r\n var n = 0;\r\n while (--p % 4 > 1 && string.charAt(p) === \"=\")\r\n ++n;\r\n return Math.ceil(string.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = new Array(64);\r\n\r\n// Base64 decoding table\r\nvar s64 = new Array(123);\r\n\r\n// 65..90, 97..122, 48..57, 43, 47\r\nfor (var i = 0; i < 64;)\r\n s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n var parts = null,\r\n chunk = [];\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n chunk[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n chunk[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n chunk[i++] = b64[t | b >> 6];\r\n chunk[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (j) {\r\n chunk[i++] = b64[t];\r\n chunk[i++] = 61;\r\n if (j === 1)\r\n chunk[i++] = 61;\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(string, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < string.length;) {\r\n var c = string.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n\r\n/**\r\n * Tests if the specified string appears to be base64 encoded.\r\n * @param {string} string String to test\r\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\r\n */\r\nbase64.test = function test(string) {\r\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r\n};\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {*} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener or any matching listeners if arguments are omitted.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = [],\r\n i = 1;\r\n for (; i < arguments.length;)\r\n args.push(arguments[i++]);\r\n for (i = 0; i < listeners.length;)\r\n listeners[i].fn.apply(listeners[i++].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = factory(factory);\r\n\r\n/**\r\n * Reads / writes floats / doubles from / to buffers.\r\n * @name util.float\r\n * @namespace\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using little endian byte order.\r\n * @name util.float.writeFloatLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using big endian byte order.\r\n * @name util.float.writeFloatBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using little endian byte order.\r\n * @name util.float.readFloatLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using big endian byte order.\r\n * @name util.float.readFloatBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using little endian byte order.\r\n * @name util.float.writeDoubleLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using big endian byte order.\r\n * @name util.float.writeDoubleBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using little endian byte order.\r\n * @name util.float.readDoubleLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using big endian byte order.\r\n * @name util.float.readDoubleBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n// Factory function for the purpose of node-based testing in modified global environments\r\nfunction factory(exports) {\r\n\r\n // float: typed array\r\n if (typeof Float32Array !== \"undefined\") (function() {\r\n\r\n var f32 = new Float32Array([ -0 ]),\r\n f8b = new Uint8Array(f32.buffer),\r\n le = f8b[3] === 128;\r\n\r\n function writeFloat_f32_cpy(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n }\r\n\r\n function writeFloat_f32_rev(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[3];\r\n buf[pos + 1] = f8b[2];\r\n buf[pos + 2] = f8b[1];\r\n buf[pos + 3] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r\n\r\n function readFloat_f32_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n function readFloat_f32_rev(buf, pos) {\r\n f8b[3] = buf[pos ];\r\n f8b[2] = buf[pos + 1];\r\n f8b[1] = buf[pos + 2];\r\n f8b[0] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r\n\r\n // float: ieee754\r\n })(); else (function() {\r\n\r\n function writeFloat_ieee754(writeUint, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0)\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r\n else if (isNaN(val))\r\n writeUint(2143289344, buf, pos);\r\n else if (val > 3.4028234663852886e+38) // +-Infinity\r\n writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r\n else if (val < 1.1754943508222875e-38) // denormal\r\n writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r\n else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2),\r\n mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r\n writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r\n }\r\n }\r\n\r\n exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r\n exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r\n\r\n function readFloat_ieee754(readUint, buf, pos) {\r\n var uint = readUint(buf, pos),\r\n sign = (uint >> 31) * 2 + 1,\r\n exponent = uint >>> 23 & 255,\r\n mantissa = uint & 8388607;\r\n return exponent === 255\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 1.401298464324817e-45 * mantissa\r\n : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r\n }\r\n\r\n exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r\n exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r\n\r\n })();\r\n\r\n // double: typed array\r\n if (typeof Float64Array !== \"undefined\") (function() {\r\n\r\n var f64 = new Float64Array([-0]),\r\n f8b = new Uint8Array(f64.buffer),\r\n le = f8b[7] === 128;\r\n\r\n function writeDouble_f64_cpy(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n buf[pos + 4] = f8b[4];\r\n buf[pos + 5] = f8b[5];\r\n buf[pos + 6] = f8b[6];\r\n buf[pos + 7] = f8b[7];\r\n }\r\n\r\n function writeDouble_f64_rev(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[7];\r\n buf[pos + 1] = f8b[6];\r\n buf[pos + 2] = f8b[5];\r\n buf[pos + 3] = f8b[4];\r\n buf[pos + 4] = f8b[3];\r\n buf[pos + 5] = f8b[2];\r\n buf[pos + 6] = f8b[1];\r\n buf[pos + 7] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r\n\r\n function readDouble_f64_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n f8b[4] = buf[pos + 4];\r\n f8b[5] = buf[pos + 5];\r\n f8b[6] = buf[pos + 6];\r\n f8b[7] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n function readDouble_f64_rev(buf, pos) {\r\n f8b[7] = buf[pos ];\r\n f8b[6] = buf[pos + 1];\r\n f8b[5] = buf[pos + 2];\r\n f8b[4] = buf[pos + 3];\r\n f8b[3] = buf[pos + 4];\r\n f8b[2] = buf[pos + 5];\r\n f8b[1] = buf[pos + 6];\r\n f8b[0] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r\n\r\n // double: ieee754\r\n })(); else (function() {\r\n\r\n function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r\n } else if (isNaN(val)) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(2146959360, buf, pos + off1);\r\n } else if (val > 1.7976931348623157e+308) { // +-Infinity\r\n writeUint(0, buf, pos + off0);\r\n writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r\n } else {\r\n var mantissa;\r\n if (val < 2.2250738585072014e-308) { // denormal\r\n mantissa = val / 5e-324;\r\n writeUint(mantissa >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r\n } else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2);\r\n if (exponent === 1024)\r\n exponent = 1023;\r\n mantissa = val * Math.pow(2, -exponent);\r\n writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r\n }\r\n }\r\n }\r\n\r\n exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r\n exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r\n\r\n function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r\n var lo = readUint(buf, pos + off0),\r\n hi = readUint(buf, pos + off1);\r\n var sign = (hi >> 31) * 2 + 1,\r\n exponent = hi >>> 20 & 2047,\r\n mantissa = 4294967296 * (hi & 1048575) + lo;\r\n return exponent === 2047\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 5e-324 * mantissa\r\n : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r\n }\r\n\r\n exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r\n exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r\n\r\n })();\r\n\r\n return exports;\r\n}\r\n\r\n// uint helpers\r\n\r\nfunction writeUintLE(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\nfunction writeUintBE(val, buf, pos) {\r\n buf[pos ] = val >>> 24;\r\n buf[pos + 1] = val >>> 16 & 255;\r\n buf[pos + 2] = val >>> 8 & 255;\r\n buf[pos + 3] = val & 255;\r\n}\r\n\r\nfunction readUintLE(buf, pos) {\r\n return (buf[pos ]\r\n | buf[pos + 1] << 8\r\n | buf[pos + 2] << 16\r\n | buf[pos + 3] << 24) >>> 0;\r\n}\r\n\r\nfunction readUintBE(buf, pos) {\r\n return (buf[pos ] << 24\r\n | buf[pos + 1] << 16\r\n | buf[pos + 2] << 8\r\n | buf[pos + 3]) >>> 0;\r\n}\r\n","\"use strict\";\r\nmodule.exports = inquire;\r\n\r\n/**\r\n * Requires a module only if available.\r\n * @memberof util\r\n * @param {string} moduleName Module to require\r\n * @returns {?Object} Required module if available and not empty, otherwise `null`\r\n */\r\nfunction inquire(moduleName) {\r\n try {\r\n var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval\r\n if (mod && (mod.length || Object.keys(mod).length))\r\n return mod;\r\n } catch (e) {} // eslint-disable-line no-empty\r\n return null;\r\n}\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size < 1 || size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < string.length; ++i) {\r\n c = string.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null,\r\n chunk = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128)\r\n chunk[i++] = t;\r\n else if (t > 191 && t < 224)\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n var start = offset,\r\n c1, // character 1\r\n c2; // character 2\r\n for (var i = 0; i < string.length; ++i) {\r\n c1 = string.charCodeAt(i);\r\n if (c1 < 128) {\r\n buffer[offset++] = c1;\r\n } else if (c1 < 2048) {\r\n buffer[offset++] = c1 >> 6 | 192;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buffer[offset++] = c1 >> 18 | 240;\r\n buffer[offset++] = c1 >> 12 & 63 | 128;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else {\r\n buffer[offset++] = c1 >> 12 | 224;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n }\r\n }\r\n return offset - start;\r\n};\r\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar search = require('./search.js');\nvar utils = require('./utils.js');\n\nconst mergeArrays2 = Function.prototype.apply.bind(utils.mergeArrays, undefined);\nconst dash = utils.stringToArray('--');\nconst CRLF = utils.stringToArray('\\r\\n');\nfunction parseContentDisposition(header) {\n const parts = header.split(';').map(part => part.trim());\n if (parts.shift() !== 'form-data') {\n throw new Error('malformed content-disposition header: missing \"form-data\" in `' + JSON.stringify(parts) + '`');\n }\n const out = {};\n for (const part of parts) {\n const kv = part.split('=', 2);\n if (kv.length !== 2) {\n throw new Error('malformed content-disposition header: key-value pair not found - ' + part + ' in `' + header + '`');\n }\n const [name, value] = kv;\n if (value[0] === '\"' && value[value.length - 1] === '\"') {\n out[name] = value.slice(1, -1).replace(/\\\\\"/g, '\"');\n } else if (value[0] !== '\"' && value[value.length - 1] !== '\"') {\n out[name] = value;\n } else if (value[0] === '\"' && value[value.length - 1] !== '\"' || value[0] !== '\"' && value[value.length - 1] === '\"') {\n throw new Error('malformed content-disposition header: mismatched quotations in `' + header + '`');\n }\n }\n if (!out.name) {\n throw new Error('malformed content-disposition header: missing field name in `' + header + '`');\n }\n return out;\n}\nfunction parsePartHeaders(lines) {\n const entries = [];\n let disposition = false;\n let line;\n while (typeof (line = lines.shift()) !== 'undefined') {\n const colon = line.indexOf(':');\n if (colon === -1) {\n throw new Error('malformed multipart-form header: missing colon');\n }\n const header = line.slice(0, colon).trim().toLowerCase();\n const value = line.slice(colon + 1).trim();\n switch (header) {\n case 'content-disposition':\n disposition = true;\n entries.push(...Object.entries(parseContentDisposition(value)));\n break;\n case 'content-type':\n entries.push([\n 'contentType',\n value\n ]);\n }\n }\n if (!disposition) {\n throw new Error('malformed multipart-form header: missing content-disposition');\n }\n return Object.fromEntries(entries);\n}\nasync function readHeaderLines(it, needle) {\n let firstChunk = true;\n let lastTokenWasMatch = false;\n const headerLines = [[]];\n const crlfSearch = new search.StreamSearch(CRLF);\n for (;;) {\n const result = await it.next();\n if (result.done) {\n throw new Error('malformed multipart-form data: unexpected end of stream');\n }\n if (firstChunk && result.value !== search.MATCH && utils.arraysEqual(result.value.slice(0, 2), dash)) {\n return [\n undefined,\n new Uint8Array()\n ];\n }\n let chunk;\n if (result.value !== search.MATCH) {\n chunk = result.value;\n } else if (!lastTokenWasMatch) {\n chunk = needle;\n } else {\n throw new Error('malformed multipart-form data: unexpected boundary');\n }\n if (!chunk.length) {\n continue;\n }\n if (firstChunk) {\n firstChunk = false;\n }\n const tokens = crlfSearch.feed(chunk);\n for (const [i, token] of tokens.entries()) {\n const isMatch = token === search.MATCH;\n if (!isMatch && !token.length) {\n continue;\n }\n if (lastTokenWasMatch && isMatch) {\n tokens.push(crlfSearch.end());\n return [\n headerLines.filter(chunks => chunks.length).map(mergeArrays2).map(utils.arrayToString),\n utils.mergeArrays(...tokens.slice(i + 1).map(token => token === search.MATCH ? CRLF : token))\n ];\n }\n if (lastTokenWasMatch = isMatch) {\n headerLines.push([]);\n } else {\n headerLines[headerLines.length - 1].push(token);\n }\n }\n }\n}\nasync function* streamMultipart(body, boundary) {\n const needle = utils.mergeArrays(dash, utils.stringToArray(boundary));\n const it = new search.ReadableStreamSearch(needle, body)[Symbol.asyncIterator]();\n for (;;) {\n const result = await it.next();\n if (result.done) {\n return;\n }\n if (result.value === search.MATCH) {\n break;\n }\n }\n const crlfSearch = new search.StreamSearch(CRLF);\n for (;;) {\n const [headerLines, tail] = await readHeaderLines(it, needle);\n if (!headerLines) {\n return;\n }\n async function nextToken() {\n const result = await it.next();\n if (result.done) {\n throw new Error('malformed multipart-form data: unexpected end of stream');\n }\n return result;\n }\n let trailingCRLF = false;\n function feedChunk(chunk) {\n const chunks = [];\n for (const token of crlfSearch.feed(chunk)) {\n if (trailingCRLF) {\n chunks.push(CRLF);\n }\n if (!(trailingCRLF = token === search.MATCH)) {\n chunks.push(token);\n }\n }\n return utils.mergeArrays(...chunks);\n }\n let done = false;\n async function nextChunk() {\n const result = await nextToken();\n let chunk;\n if (result.value !== search.MATCH) {\n chunk = result.value;\n } else if (!trailingCRLF) {\n chunk = CRLF;\n } else {\n done = true;\n return { value: crlfSearch.end() };\n }\n return { value: feedChunk(chunk) };\n }\n const bufferedChunks = [{ value: feedChunk(tail) }];\n yield {\n ...parsePartHeaders(headerLines),\n data: {\n [Symbol.asyncIterator]() {\n return this;\n },\n async next() {\n for (;;) {\n const result = bufferedChunks.shift();\n if (!result) {\n break;\n }\n if (result.value.length > 0) {\n return result;\n }\n }\n for (;;) {\n if (done) {\n return {\n done,\n value: undefined\n };\n }\n const result = await nextChunk();\n if (result.value.length > 0) {\n return result;\n }\n }\n }\n }\n };\n while (!done) {\n bufferedChunks.push(await nextChunk());\n }\n }\n}\nasync function* iterateMultipart(body, boundary) {\n for await (const part of streamMultipart(body, boundary)) {\n const chunks = [];\n for await (const chunk of part.data) {\n chunks.push(chunk);\n }\n yield {\n ...part,\n data: utils.mergeArrays(...chunks)\n };\n }\n}\n\nexports.iterateMultipart = iterateMultipart;\nexports.streamMultipart = streamMultipart;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar utils = require('./utils.js');\n\nfunction coerce(a) {\n if (a instanceof Uint8Array) {\n return index => a[index];\n }\n return a;\n}\nfunction jsmemcmp(buf1, pos1, buf2, pos2, len) {\n const fn1 = coerce(buf1);\n const fn2 = coerce(buf2);\n for (let i = 0; i < len; ++i) {\n if (fn1(pos1 + i) !== fn2(pos2 + i)) {\n return false;\n }\n }\n return true;\n}\nfunction createOccurenceTable(s) {\n const table = new Array(256).fill(s.length);\n if (s.length > 1) {\n for (let i = 0; i < s.length - 1; i++) {\n table[s[i]] = s.length - 1 - i;\n }\n }\n return table;\n}\nconst MATCH = Symbol('Match');\nclass StreamSearch {\n constructor(needle) {\n this._lookbehind = new Uint8Array();\n if (typeof needle === 'string') {\n this._needle = needle = utils.stringToArray(needle);\n } else {\n this._needle = needle;\n }\n this._lastChar = needle[needle.length - 1];\n this._occ = createOccurenceTable(needle);\n }\n feed(chunk) {\n let pos = 0;\n let tokens;\n const allTokens = [];\n while (pos !== chunk.length) {\n ;\n [pos, ...tokens] = this._feed(chunk, pos);\n allTokens.push(...tokens);\n }\n return allTokens;\n }\n end() {\n const tail = this._lookbehind;\n this._lookbehind = new Uint8Array();\n return tail;\n }\n _feed(data, bufPos) {\n const tokens = [];\n let pos = -this._lookbehind.length;\n if (pos < 0) {\n while (pos < 0 && pos <= data.length - this._needle.length) {\n const ch = this._charAt(data, pos + this._needle.length - 1);\n if (ch === this._lastChar && this._memcmp(data, pos, this._needle.length - 1)) {\n if (pos > -this._lookbehind.length) {\n tokens.push(this._lookbehind.slice(0, this._lookbehind.length + pos));\n }\n tokens.push(MATCH);\n this._lookbehind = new Uint8Array();\n return [\n pos + this._needle.length,\n ...tokens\n ];\n } else {\n pos += this._occ[ch];\n }\n }\n if (pos < 0) {\n while (pos < 0 && !this._memcmp(data, pos, data.length - pos)) {\n pos++;\n }\n }\n if (pos >= 0) {\n tokens.push(this._lookbehind);\n this._lookbehind = new Uint8Array();\n } else {\n const bytesToCutOff = this._lookbehind.length + pos;\n if (bytesToCutOff > 0) {\n tokens.push(this._lookbehind.slice(0, bytesToCutOff));\n this._lookbehind = this._lookbehind.slice(bytesToCutOff);\n }\n this._lookbehind = Uint8Array.from(new Array(this._lookbehind.length + data.length), (_, i) => this._charAt(data, i - this._lookbehind.length));\n return [\n data.length,\n ...tokens\n ];\n }\n }\n pos += bufPos;\n while (pos <= data.length - this._needle.length) {\n const ch = data[pos + this._needle.length - 1];\n if (ch === this._lastChar && data[pos] === this._needle[0] && jsmemcmp(this._needle, 0, data, pos, this._needle.length - 1)) {\n if (pos > bufPos) {\n tokens.push(data.slice(bufPos, pos));\n }\n tokens.push(MATCH);\n return [\n pos + this._needle.length,\n ...tokens\n ];\n } else {\n pos += this._occ[ch];\n }\n }\n if (pos < data.length) {\n while (pos < data.length && (data[pos] !== this._needle[0] || !jsmemcmp(data, pos, this._needle, 0, data.length - pos))) {\n ++pos;\n }\n if (pos < data.length) {\n this._lookbehind = data.slice(pos);\n }\n }\n if (pos > 0) {\n tokens.push(data.slice(bufPos, pos < data.length ? pos : data.length));\n }\n return [\n data.length,\n ...tokens\n ];\n }\n _charAt(data, pos) {\n if (pos < 0) {\n return this._lookbehind[this._lookbehind.length + pos];\n }\n return data[pos];\n }\n _memcmp(data, pos, len) {\n return jsmemcmp(this._charAt.bind(this, data), pos, this._needle, 0, len);\n }\n}\nclass ReadableStreamSearch {\n constructor(needle, _readableStream) {\n this._readableStream = _readableStream;\n this._search = new StreamSearch(needle);\n }\n async *[Symbol.asyncIterator]() {\n const reader = this._readableStream.getReader();\n try {\n while (true) {\n const result = await reader.read();\n if (result.done) {\n break;\n }\n yield* this._search.feed(result.value);\n }\n const tail = this._search.end();\n if (tail.length) {\n yield tail;\n }\n } finally {\n reader.releaseLock();\n }\n }\n}\nconst EOQ = Symbol('End of Queue');\nclass QueueableStreamSearch {\n constructor(needle) {\n this._chunksQueue = [];\n this._closed = false;\n this._search = new StreamSearch(needle);\n }\n push(...chunks) {\n if (this._closed) {\n throw new Error('cannot call push after close');\n }\n this._chunksQueue.push(...chunks);\n if (this._notify) {\n this._notify();\n }\n }\n close() {\n if (this._closed) {\n throw new Error('close was already called');\n }\n this._closed = true;\n this._chunksQueue.push(EOQ);\n if (this._notify) {\n this._notify();\n }\n }\n async *[Symbol.asyncIterator]() {\n while (true) {\n let chunk;\n while (!(chunk = this._chunksQueue.shift())) {\n await new Promise(resolve => this._notify = resolve);\n this._notify = undefined;\n }\n if (chunk === EOQ) {\n break;\n }\n yield* this._search.feed(chunk);\n }\n const tail = this._search.end();\n if (tail.length) {\n yield tail;\n }\n }\n}\nfunction splitChunks(chunks, needle) {\n const search = new StreamSearch(needle);\n const outchunks = [[]];\n for (const chunk of chunks) {\n for (const token of search.feed(chunk)) {\n if (token === MATCH) {\n outchunks.push([]);\n } else {\n outchunks[outchunks.length - 1].push(token);\n }\n }\n }\n const end = search.end();\n outchunks[outchunks.length - 1].push(end);\n return outchunks.map(chunks => utils.mergeArrays(...chunks));\n}\nfunction split(buf, needle) {\n return splitChunks([buf], needle);\n}\nasync function* chunksIterator(iter) {\n let chunks = [];\n for await (const value of iter) {\n if (value === MATCH) {\n yield chunks;\n chunks = [];\n } else {\n chunks.push(value);\n }\n }\n yield chunks;\n}\nasync function* stringIterator(iter) {\n for await (const chunk of chunksIterator(iter)) {\n yield chunk.map(utils.arrayToString).join('');\n }\n}\nasync function allStrings(iter) {\n const segments = [];\n for await (const value of stringIterator(iter)) {\n segments.push(value);\n }\n return segments;\n}\nasync function* arrayIterator(iter) {\n for await (const chunk of chunksIterator(iter)) {\n yield utils.mergeArrays(...chunk);\n }\n}\n\nexports.MATCH = MATCH;\nexports.QueueableStreamSearch = QueueableStreamSearch;\nexports.ReadableStreamSearch = ReadableStreamSearch;\nexports.StreamSearch = StreamSearch;\nexports.allStrings = allStrings;\nexports.arrayIterator = arrayIterator;\nexports.chunksIterator = chunksIterator;\nexports.split = split;\nexports.splitChunks = splitChunks;\nexports.stringIterator = stringIterator;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction stringToArray(s) {\n const utf8 = unescape(encodeURIComponent(s));\n return Uint8Array.from(utf8, (_, i) => utf8.charCodeAt(i));\n}\nfunction arrayToString(a) {\n const utf8 = String.fromCharCode.apply(null, a);\n return decodeURIComponent(escape(utf8));\n}\nfunction mergeArrays(...arrays) {\n const out = new Uint8Array(arrays.reduce((total, arr) => total + arr.length, 0));\n let offset = 0;\n for (const arr of arrays) {\n out.set(arr, offset);\n offset += arr.length;\n }\n return out;\n}\nfunction arraysEqual(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\n\nexports.arrayToString = arrayToString;\nexports.arraysEqual = arraysEqual;\nexports.mergeArrays = mergeArrays;\nexports.stringToArray = stringToArray;\n","'use strict';\nmodule.exports = balanced;\nfunction balanced(a, b, str) {\n if (a instanceof RegExp) a = maybeMatch(a, str);\n if (b instanceof RegExp) b = maybeMatch(b, str);\n\n var r = range(a, b, str);\n\n return r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + a.length, r[1]),\n post: str.slice(r[1] + b.length)\n };\n}\n\nfunction maybeMatch(reg, str) {\n var m = str.match(reg);\n return m ? m[0] : null;\n}\n\nbalanced.range = range;\nfunction range(a, b, str) {\n var begs, beg, left, right, result;\n var ai = str.indexOf(a);\n var bi = str.indexOf(b, ai + 1);\n var i = ai;\n\n if (ai >= 0 && bi > 0) {\n if(a===b) {\n return [ai, bi];\n }\n begs = [];\n left = str.length;\n\n while (i >= 0 && !result) {\n if (i == ai) {\n begs.push(i);\n ai = str.indexOf(a, i + 1);\n } else if (begs.length == 1) {\n result = [ begs.pop(), bi ];\n } else {\n beg = begs.pop();\n if (beg < left) {\n left = beg;\n right = bi;\n }\n\n bi = str.indexOf(b, i + 1);\n }\n\n i = ai < bi && ai >= 0 ? ai : bi;\n }\n\n if (begs.length) {\n result = [ left, right ];\n }\n }\n\n return result;\n}\n","/* eslint-env browser */\n\n'use strict'\n\nconst browserReadableStreamToIt = require('browser-readablestream-to-it')\n\n/**\n * @param {Blob} blob\n * @returns {AsyncIterable}\n */\nfunction blobToIt (blob) {\n if (typeof blob.stream === 'function') {\n // @ts-ignore missing some properties\n return browserReadableStreamToIt(blob.stream())\n }\n\n // firefox < 69 does not support blob.stream()\n // @ts-ignore - response.body is optional, but in practice it's a stream.\n return browserReadableStreamToIt(new Response(blob).body)\n}\n\nmodule.exports = blobToIt\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar drain = require('it-drain');\nvar filter = require('it-filter');\nvar take = require('it-take');\nvar all = require('it-all');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar drain__default = /*#__PURE__*/_interopDefaultLegacy(drain);\nvar filter__default = /*#__PURE__*/_interopDefaultLegacy(filter);\nvar take__default = /*#__PURE__*/_interopDefaultLegacy(take);\nvar all__default = /*#__PURE__*/_interopDefaultLegacy(all);\n\nconst sortAll = (iterable, sorter) => {\n return async function* () {\n const values = await all__default[\"default\"](iterable);\n yield* values.sort(sorter);\n }();\n};\nclass BaseBlockstore {\n open() {\n return Promise.reject(new Error('.open is not implemented'));\n }\n close() {\n return Promise.reject(new Error('.close is not implemented'));\n }\n put(key, val, options) {\n return Promise.reject(new Error('.put is not implemented'));\n }\n get(key, options) {\n return Promise.reject(new Error('.get is not implemented'));\n }\n has(key, options) {\n return Promise.reject(new Error('.has is not implemented'));\n }\n delete(key, options) {\n return Promise.reject(new Error('.delete is not implemented'));\n }\n async *putMany(source, options = {}) {\n for await (const {key, value} of source) {\n await this.put(key, value, options);\n yield {\n key,\n value\n };\n }\n }\n async *getMany(source, options = {}) {\n for await (const key of source) {\n yield this.get(key, options);\n }\n }\n async *deleteMany(source, options = {}) {\n for await (const key of source) {\n await this.delete(key, options);\n yield key;\n }\n }\n batch() {\n let puts = [];\n let dels = [];\n return {\n put(key, value) {\n puts.push({\n key,\n value\n });\n },\n delete(key) {\n dels.push(key);\n },\n commit: async options => {\n await drain__default[\"default\"](this.putMany(puts, options));\n puts = [];\n await drain__default[\"default\"](this.deleteMany(dels, options));\n dels = [];\n }\n };\n }\n async *_all(q, options) {\n throw new Error('._all is not implemented');\n }\n async *_allKeys(q, options) {\n throw new Error('._allKeys is not implemented');\n }\n query(q, options) {\n let it = this._all(q, options);\n if (q.prefix != null) {\n it = filter__default[\"default\"](it, e => e.key.toString().startsWith(q.prefix || ''));\n }\n if (Array.isArray(q.filters)) {\n it = q.filters.reduce((it, f) => filter__default[\"default\"](it, f), it);\n }\n if (Array.isArray(q.orders)) {\n it = q.orders.reduce((it, f) => sortAll(it, f), it);\n }\n if (q.offset != null) {\n let i = 0;\n it = filter__default[\"default\"](it, () => i++ >= (q.offset || 0));\n }\n if (q.limit != null) {\n it = take__default[\"default\"](it, q.limit);\n }\n return it;\n }\n queryKeys(q, options) {\n let it = this._allKeys(q, options);\n if (q.prefix != null) {\n it = filter__default[\"default\"](it, cid => cid.toString().startsWith(q.prefix || ''));\n }\n if (Array.isArray(q.filters)) {\n it = q.filters.reduce((it, f) => filter__default[\"default\"](it, f), it);\n }\n if (Array.isArray(q.orders)) {\n it = q.orders.reduce((it, f) => sortAll(it, f), it);\n }\n if (q.offset != null) {\n let i = 0;\n it = filter__default[\"default\"](it, () => i++ >= q.offset);\n }\n if (q.limit != null) {\n it = take__default[\"default\"](it, q.limit);\n }\n return it;\n }\n}\n\nexports.BaseBlockstore = BaseBlockstore;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar errCode = require('err-code');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\n\nfunction notFoundError(err) {\n err = err || new Error('Not Found');\n return errCode__default[\"default\"](err, 'ERR_NOT_FOUND');\n}\nfunction abortedError(err) {\n err = err || new Error('Aborted');\n return errCode__default[\"default\"](err, 'ERR_ABORTED');\n}\n\nexports.abortedError = abortedError;\nexports.notFoundError = notFoundError;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar errors = require('./errors.js');\nvar base = require('./base.js');\nvar memory = require('./memory.js');\n\nconst Errors = { ...errors };\n\nexports.BaseBlockstore = base.BaseBlockstore;\nexports.MemoryBlockstore = memory.MemoryBlockstore;\nexports.Errors = Errors;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar base = require('./base.js');\nvar base32 = require('multiformats/bases/base32');\nvar raw = require('multiformats/codecs/raw');\nvar cid = require('multiformats/cid');\nvar Digest = require('multiformats/hashes/digest');\nvar errors = require('./errors.js');\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () { return e[k]; }\n });\n }\n });\n }\n n[\"default\"] = e;\n return Object.freeze(n);\n}\n\nvar raw__namespace = /*#__PURE__*/_interopNamespace(raw);\nvar Digest__namespace = /*#__PURE__*/_interopNamespace(Digest);\n\nclass MemoryBlockstore extends base.BaseBlockstore {\n constructor() {\n super();\n this.data = {};\n }\n open() {\n return Promise.resolve();\n }\n close() {\n return Promise.resolve();\n }\n async put(key, val) {\n this.data[base32.base32.encode(key.multihash.bytes)] = val;\n }\n async get(key) {\n const exists = await this.has(key);\n if (!exists)\n throw errors.notFoundError();\n return this.data[base32.base32.encode(key.multihash.bytes)];\n }\n async has(key) {\n return this.data[base32.base32.encode(key.multihash.bytes)] !== undefined;\n }\n async delete(key) {\n delete this.data[base32.base32.encode(key.multihash.bytes)];\n }\n async *_all() {\n yield* Object.entries(this.data).map(([key, value]) => ({\n key: cid.CID.createV1(raw__namespace.code, Digest__namespace.decode(base32.base32.decode(key))),\n value\n }));\n }\n async *_allKeys() {\n yield* Object.entries(this.data).map(([key]) => cid.CID.createV1(raw__namespace.code, Digest__namespace.decode(base32.base32.decode(key))));\n }\n}\n\nexports.MemoryBlockstore = MemoryBlockstore;\n","var concatMap = require('concat-map');\nvar balanced = require('balanced-match');\n\nmodule.exports = expandTop;\n\nvar escSlash = '\\0SLASH'+Math.random()+'\\0';\nvar escOpen = '\\0OPEN'+Math.random()+'\\0';\nvar escClose = '\\0CLOSE'+Math.random()+'\\0';\nvar escComma = '\\0COMMA'+Math.random()+'\\0';\nvar escPeriod = '\\0PERIOD'+Math.random()+'\\0';\n\nfunction numeric(str) {\n return parseInt(str, 10) == str\n ? parseInt(str, 10)\n : str.charCodeAt(0);\n}\n\nfunction escapeBraces(str) {\n return str.split('\\\\\\\\').join(escSlash)\n .split('\\\\{').join(escOpen)\n .split('\\\\}').join(escClose)\n .split('\\\\,').join(escComma)\n .split('\\\\.').join(escPeriod);\n}\n\nfunction unescapeBraces(str) {\n return str.split(escSlash).join('\\\\')\n .split(escOpen).join('{')\n .split(escClose).join('}')\n .split(escComma).join(',')\n .split(escPeriod).join('.');\n}\n\n\n// Basically just str.split(\",\"), but handling cases\n// where we have nested braced sections, which should be\n// treated as individual members, like {a,{b,c},d}\nfunction parseCommaParts(str) {\n if (!str)\n return [''];\n\n var parts = [];\n var m = balanced('{', '}', str);\n\n if (!m)\n return str.split(',');\n\n var pre = m.pre;\n var body = m.body;\n var post = m.post;\n var p = pre.split(',');\n\n p[p.length-1] += '{' + body + '}';\n var postParts = parseCommaParts(post);\n if (post.length) {\n p[p.length-1] += postParts.shift();\n p.push.apply(p, postParts);\n }\n\n parts.push.apply(parts, p);\n\n return parts;\n}\n\nfunction expandTop(str) {\n if (!str)\n return [];\n\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.substr(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.substr(2);\n }\n\n return expand(escapeBraces(str), true).map(unescapeBraces);\n}\n\nfunction identity(e) {\n return e;\n}\n\nfunction embrace(str) {\n return '{' + str + '}';\n}\nfunction isPadded(el) {\n return /^-?0\\d/.test(el);\n}\n\nfunction lte(i, y) {\n return i <= y;\n}\nfunction gte(i, y) {\n return i >= y;\n}\n\nfunction expand(str, isTop) {\n var expansions = [];\n\n var m = balanced('{', '}', str);\n if (!m || /\\$$/.test(m.pre)) return [str];\n\n var isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body);\n var isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(m.body);\n var isSequence = isNumericSequence || isAlphaSequence;\n var isOptions = m.body.indexOf(',') >= 0;\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,.*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post;\n return expand(str);\n }\n return [str];\n }\n\n var n;\n if (isSequence) {\n n = m.body.split(/\\.\\./);\n } else {\n n = parseCommaParts(m.body);\n if (n.length === 1) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand(n[0], false).map(embrace);\n if (n.length === 1) {\n var post = m.post.length\n ? expand(m.post, false)\n : [''];\n return post.map(function(p) {\n return m.pre + n[0] + p;\n });\n }\n }\n }\n\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n var pre = m.pre;\n var post = m.post.length\n ? expand(m.post, false)\n : [''];\n\n var N;\n\n if (isSequence) {\n var x = numeric(n[0]);\n var y = numeric(n[1]);\n var width = Math.max(n[0].length, n[1].length)\n var incr = n.length == 3\n ? Math.abs(numeric(n[2]))\n : 1;\n var test = lte;\n var reverse = y < x;\n if (reverse) {\n incr *= -1;\n test = gte;\n }\n var pad = n.some(isPadded);\n\n N = [];\n\n for (var i = x; test(i, y); i += incr) {\n var c;\n if (isAlphaSequence) {\n c = String.fromCharCode(i);\n if (c === '\\\\')\n c = '';\n } else {\n c = String(i);\n if (pad) {\n var need = width - c.length;\n if (need > 0) {\n var z = new Array(need + 1).join('0');\n if (i < 0)\n c = '-' + z + c.slice(1);\n else\n c = z + c;\n }\n }\n }\n N.push(c);\n }\n } else {\n N = concatMap(n, function(el) { return expand(el, false) });\n }\n\n for (var j = 0; j < N.length; j++) {\n for (var k = 0; k < post.length; k++) {\n var expansion = pre + N[j] + post[k];\n if (!isTop || isSequence || expansion)\n expansions.push(expansion);\n }\n }\n\n return expansions;\n}\n\n","'use strict'\n\n/**\n * Turns a browser readable stream into an async iterable. Async iteration over\n * returned iterable will lock give stream, preventing any other consumer from\n * acquiring a reader. The lock will be released if iteration loop is broken. To\n * prevent stream cancelling optional `{ preventCancel: true }` could be passed\n * as a second argument.\n * @template T\n * @param {ReadableStream} stream\n * @param {Object} [options]\n * @param {boolean} [options.preventCancel=boolean]\n * @returns {AsyncIterable}\n */\nasync function * browserReadableStreamToIt (stream, options = {}) {\n const reader = stream.getReader()\n\n try {\n while (true) {\n const result = await reader.read()\n\n if (result.done) {\n return\n }\n\n yield result.value\n }\n } finally {\n if (options.preventCancel !== true) {\n reader.cancel()\n }\n\n reader.releaseLock()\n }\n}\n\nmodule.exports = browserReadableStreamToIt\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar splitter = require('./splitter.js');\nvar joiner = require('./joiner.js');\n\n\n\nexports.TreewalkCarSplitter = splitter.TreewalkCarSplitter;\nexports.TreewalkCarJoiner = joiner.TreewalkCarJoiner;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar car = require('@ipld/car');\n\nclass TreewalkCarJoiner {\n constructor(cars) {\n this._cars = Array.from(cars);\n if (!this._cars.length)\n throw new Error('missing CARs');\n }\n async *car() {\n const reader = this._cars[0];\n const roots = await reader.getRoots();\n const {writer, out} = car.CarWriter.create(roots);\n const writeCar = async () => {\n const written = new Set();\n const writeBlocks = async reader => {\n for await (const b of reader.blocks()) {\n if (written.has(b.cid.toString()))\n continue;\n await writer.put(b);\n written.add(b.cid.toString());\n }\n };\n try {\n await writeBlocks(reader);\n for (const reader of this._cars.slice(1)) {\n await writeBlocks(reader);\n }\n } catch (err) {\n console.error(err);\n } finally {\n await writer.close();\n }\n };\n writeCar();\n yield* out;\n }\n}\n\nexports.TreewalkCarJoiner = TreewalkCarJoiner;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar car = require('@ipld/car');\nvar block = require('multiformats/block');\nvar raw = require('multiformats/codecs/raw');\nvar dagCbor = require('@ipld/dag-cbor');\nvar pb = require('@ipld/dag-pb');\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () {\n return e[k];\n }\n });\n }\n });\n }\n n['default'] = e;\n return Object.freeze(n);\n}\n\nvar raw__namespace = /*#__PURE__*/_interopNamespace(raw);\nvar dagCbor__namespace = /*#__PURE__*/_interopNamespace(dagCbor);\nvar pb__namespace = /*#__PURE__*/_interopNamespace(pb);\n\nclass TreewalkCarSplitter {\n constructor(reader, targetSize, options = {}) {\n if (typeof targetSize !== 'number' || targetSize <= 0) {\n throw new Error('invalid target chunk size');\n }\n this._reader = reader;\n this._targetSize = targetSize;\n this._decoders = [\n pb__namespace,\n raw__namespace,\n dagCbor__namespace,\n ...options.decoders || []\n ];\n }\n async *cars() {\n const roots = await this._reader.getRoots();\n if (roots.length !== 1)\n throw new Error(`unexpected number of roots: ${ roots.length }`);\n let channel;\n for await (const val of this._cars(roots[0])) {\n channel = val.channel;\n if (val.out)\n yield val.out;\n }\n if (!channel) {\n throw new Error('missing CAR writer channel');\n }\n channel.writer.close();\n yield channel.out;\n }\n async _get(cid) {\n const rawBlock = await this._reader.get(cid);\n if (!rawBlock)\n throw new Error(`missing block for ${ cid }`);\n const {bytes} = rawBlock;\n const decoder = this._decoders.find(d => d.code === cid.code);\n if (!decoder)\n throw new Error(`missing decoder for ${ cid.code }`);\n return new block.Block({\n cid,\n bytes,\n value: decoder.decode(bytes)\n });\n }\n async *_cars(cid, parents = [], channel = undefined) {\n const block = await this._get(cid);\n channel = channel || Object.assign(car.CarWriter.create(cid), { size: 0 });\n if (channel.size > 0 && channel.size + block.bytes.byteLength >= this._targetSize) {\n channel.writer.close();\n const {out} = channel;\n channel = newCar(parents);\n yield {\n channel,\n out\n };\n }\n parents = parents.concat(block);\n channel.size += block.bytes.byteLength;\n channel.writer.put(block);\n for (const [, cid] of block.links()) {\n for await (const val of this._cars(cid, parents, channel)) {\n channel = val.channel;\n yield val;\n }\n }\n if (!channel) {\n throw new Error('missing CAR writer channel');\n }\n yield { channel };\n }\n static async fromIterable(iterable, targetSize, options) {\n const reader = await car.CarReader.fromIterable(iterable);\n return new TreewalkCarSplitter(reader, targetSize, options);\n }\n static async fromBlob(blob, targetSize, options) {\n const buffer = await blob.arrayBuffer();\n const reader = await car.CarReader.fromBytes(new Uint8Array(buffer));\n return new TreewalkCarSplitter(reader, targetSize, options);\n }\n}\nfunction newCar(parents) {\n const ch = Object.assign(car.CarWriter.create(parents[0].cid), { size: parents.reduce((size, b) => size + b.bytes.byteLength, 0) });\n for (const b of parents) {\n ch.writer.put(b);\n }\n return ch;\n}\n\nexports.TreewalkCarSplitter = TreewalkCarSplitter;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar encode = require('./lib/encode.js');\nvar decode = require('./lib/decode.js');\nvar token = require('./lib/token.js');\n\n\n\nexports.encode = encode.encode;\nexports.decode = decode.decode;\nexports.Token = token.Token;\nexports.Type = token.Type;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar token = require('./token.js');\nvar common = require('./common.js');\n\nconst uintBoundaries = [\n 24,\n 256,\n 65536,\n 4294967296,\n BigInt('18446744073709551616')\n];\nfunction readUint8(data, offset, options) {\n common.assertEnoughData(data, offset, 1);\n const value = data[offset];\n if (options.strict === true && value < uintBoundaries[0]) {\n throw new Error(`${ common.decodeErrPrefix } integer encoded in more bytes than necessary (strict decode)`);\n }\n return value;\n}\nfunction readUint16(data, offset, options) {\n common.assertEnoughData(data, offset, 2);\n const value = data[offset] << 8 | data[offset + 1];\n if (options.strict === true && value < uintBoundaries[1]) {\n throw new Error(`${ common.decodeErrPrefix } integer encoded in more bytes than necessary (strict decode)`);\n }\n return value;\n}\nfunction readUint32(data, offset, options) {\n common.assertEnoughData(data, offset, 4);\n const value = data[offset] * 16777216 + (data[offset + 1] << 16) + (data[offset + 2] << 8) + data[offset + 3];\n if (options.strict === true && value < uintBoundaries[2]) {\n throw new Error(`${ common.decodeErrPrefix } integer encoded in more bytes than necessary (strict decode)`);\n }\n return value;\n}\nfunction readUint64(data, offset, options) {\n common.assertEnoughData(data, offset, 8);\n const hi = data[offset] * 16777216 + (data[offset + 1] << 16) + (data[offset + 2] << 8) + data[offset + 3];\n const lo = data[offset + 4] * 16777216 + (data[offset + 5] << 16) + (data[offset + 6] << 8) + data[offset + 7];\n const value = (BigInt(hi) << BigInt(32)) + BigInt(lo);\n if (options.strict === true && value < uintBoundaries[3]) {\n throw new Error(`${ common.decodeErrPrefix } integer encoded in more bytes than necessary (strict decode)`);\n }\n if (value <= Number.MAX_SAFE_INTEGER) {\n return Number(value);\n }\n if (options.allowBigInt === true) {\n return value;\n }\n throw new Error(`${ common.decodeErrPrefix } integers outside of the safe integer range are not supported`);\n}\nfunction decodeUint8(data, pos, _minor, options) {\n return new token.Token(token.Type.uint, readUint8(data, pos + 1, options), 2);\n}\nfunction decodeUint16(data, pos, _minor, options) {\n return new token.Token(token.Type.uint, readUint16(data, pos + 1, options), 3);\n}\nfunction decodeUint32(data, pos, _minor, options) {\n return new token.Token(token.Type.uint, readUint32(data, pos + 1, options), 5);\n}\nfunction decodeUint64(data, pos, _minor, options) {\n return new token.Token(token.Type.uint, readUint64(data, pos + 1, options), 9);\n}\nfunction encodeUint(buf, token) {\n return encodeUintValue(buf, 0, token.value);\n}\nfunction encodeUintValue(buf, major, uint) {\n if (uint < uintBoundaries[0]) {\n const nuint = Number(uint);\n buf.push([major | nuint]);\n } else if (uint < uintBoundaries[1]) {\n const nuint = Number(uint);\n buf.push([\n major | 24,\n nuint\n ]);\n } else if (uint < uintBoundaries[2]) {\n const nuint = Number(uint);\n buf.push([\n major | 25,\n nuint >>> 8,\n nuint & 255\n ]);\n } else if (uint < uintBoundaries[3]) {\n const nuint = Number(uint);\n buf.push([\n major | 26,\n nuint >>> 24 & 255,\n nuint >>> 16 & 255,\n nuint >>> 8 & 255,\n nuint & 255\n ]);\n } else {\n const buint = BigInt(uint);\n if (buint < uintBoundaries[4]) {\n const set = [\n major | 27,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n 0\n ];\n let lo = Number(buint & BigInt(4294967295));\n let hi = Number(buint >> BigInt(32) & BigInt(4294967295));\n set[8] = lo & 255;\n lo = lo >> 8;\n set[7] = lo & 255;\n lo = lo >> 8;\n set[6] = lo & 255;\n lo = lo >> 8;\n set[5] = lo & 255;\n set[4] = hi & 255;\n hi = hi >> 8;\n set[3] = hi & 255;\n hi = hi >> 8;\n set[2] = hi & 255;\n hi = hi >> 8;\n set[1] = hi & 255;\n buf.push(set);\n } else {\n throw new Error(`${ common.decodeErrPrefix } encountered BigInt larger than allowable range`);\n }\n }\n}\nencodeUint.encodedSize = function encodedSize(token) {\n return encodeUintValue.encodedSize(token.value);\n};\nencodeUintValue.encodedSize = function encodedSize(uint) {\n if (uint < uintBoundaries[0]) {\n return 1;\n }\n if (uint < uintBoundaries[1]) {\n return 2;\n }\n if (uint < uintBoundaries[2]) {\n return 3;\n }\n if (uint < uintBoundaries[3]) {\n return 5;\n }\n return 9;\n};\nencodeUint.compareTokens = function compareTokens(tok1, tok2) {\n return tok1.value < tok2.value ? -1 : tok1.value > tok2.value ? 1 : 0;\n};\n\nexports.decodeUint16 = decodeUint16;\nexports.decodeUint32 = decodeUint32;\nexports.decodeUint64 = decodeUint64;\nexports.decodeUint8 = decodeUint8;\nexports.encodeUint = encodeUint;\nexports.encodeUintValue = encodeUintValue;\nexports.readUint16 = readUint16;\nexports.readUint32 = readUint32;\nexports.readUint64 = readUint64;\nexports.readUint8 = readUint8;\nexports.uintBoundaries = uintBoundaries;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar token = require('./token.js');\nvar _0uint = require('./0uint.js');\nvar common = require('./common.js');\n\nfunction decodeNegint8(data, pos, _minor, options) {\n return new token.Token(token.Type.negint, -1 - _0uint.readUint8(data, pos + 1, options), 2);\n}\nfunction decodeNegint16(data, pos, _minor, options) {\n return new token.Token(token.Type.negint, -1 - _0uint.readUint16(data, pos + 1, options), 3);\n}\nfunction decodeNegint32(data, pos, _minor, options) {\n return new token.Token(token.Type.negint, -1 - _0uint.readUint32(data, pos + 1, options), 5);\n}\nconst neg1b = BigInt(-1);\nconst pos1b = BigInt(1);\nfunction decodeNegint64(data, pos, _minor, options) {\n const int = _0uint.readUint64(data, pos + 1, options);\n if (typeof int !== 'bigint') {\n const value = -1 - int;\n if (value >= Number.MIN_SAFE_INTEGER) {\n return new token.Token(token.Type.negint, value, 9);\n }\n }\n if (options.allowBigInt !== true) {\n throw new Error(`${ common.decodeErrPrefix } integers outside of the safe integer range are not supported`);\n }\n return new token.Token(token.Type.negint, neg1b - BigInt(int), 9);\n}\nfunction encodeNegint(buf, token) {\n const negint = token.value;\n const unsigned = typeof negint === 'bigint' ? negint * neg1b - pos1b : negint * -1 - 1;\n _0uint.encodeUintValue(buf, token.type.majorEncoded, unsigned);\n}\nencodeNegint.encodedSize = function encodedSize(token) {\n const negint = token.value;\n const unsigned = typeof negint === 'bigint' ? negint * neg1b - pos1b : negint * -1 - 1;\n if (unsigned < _0uint.uintBoundaries[0]) {\n return 1;\n }\n if (unsigned < _0uint.uintBoundaries[1]) {\n return 2;\n }\n if (unsigned < _0uint.uintBoundaries[2]) {\n return 3;\n }\n if (unsigned < _0uint.uintBoundaries[3]) {\n return 5;\n }\n return 9;\n};\nencodeNegint.compareTokens = function compareTokens(tok1, tok2) {\n return tok1.value < tok2.value ? 1 : tok1.value > tok2.value ? -1 : 0;\n};\n\nexports.decodeNegint16 = decodeNegint16;\nexports.decodeNegint32 = decodeNegint32;\nexports.decodeNegint64 = decodeNegint64;\nexports.decodeNegint8 = decodeNegint8;\nexports.encodeNegint = encodeNegint;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar token = require('./token.js');\nvar common = require('./common.js');\nvar _0uint = require('./0uint.js');\nvar byteUtils = require('./byte-utils.js');\n\nfunction toToken(data, pos, prefix, length) {\n common.assertEnoughData(data, pos, prefix + length);\n const buf = byteUtils.slice(data, pos + prefix, pos + prefix + length);\n return new token.Token(token.Type.bytes, buf, prefix + length);\n}\nfunction decodeBytesCompact(data, pos, minor, _options) {\n return toToken(data, pos, 1, minor);\n}\nfunction decodeBytes8(data, pos, _minor, options) {\n return toToken(data, pos, 2, _0uint.readUint8(data, pos + 1, options));\n}\nfunction decodeBytes16(data, pos, _minor, options) {\n return toToken(data, pos, 3, _0uint.readUint16(data, pos + 1, options));\n}\nfunction decodeBytes32(data, pos, _minor, options) {\n return toToken(data, pos, 5, _0uint.readUint32(data, pos + 1, options));\n}\nfunction decodeBytes64(data, pos, _minor, options) {\n const l = _0uint.readUint64(data, pos + 1, options);\n if (typeof l === 'bigint') {\n throw new Error(`${ common.decodeErrPrefix } 64-bit integer bytes lengths not supported`);\n }\n return toToken(data, pos, 9, l);\n}\nfunction tokenBytes(token$1) {\n if (token$1.encodedBytes === undefined) {\n token$1.encodedBytes = token$1.type === token.Type.string ? byteUtils.fromString(token$1.value) : token$1.value;\n }\n return token$1.encodedBytes;\n}\nfunction encodeBytes(buf, token) {\n const bytes = tokenBytes(token);\n _0uint.encodeUintValue(buf, token.type.majorEncoded, bytes.length);\n buf.push(bytes);\n}\nencodeBytes.encodedSize = function encodedSize(token) {\n const bytes = tokenBytes(token);\n return _0uint.encodeUintValue.encodedSize(bytes.length) + bytes.length;\n};\nencodeBytes.compareTokens = function compareTokens(tok1, tok2) {\n return compareBytes(tokenBytes(tok1), tokenBytes(tok2));\n};\nfunction compareBytes(b1, b2) {\n return b1.length < b2.length ? -1 : b1.length > b2.length ? 1 : byteUtils.compare(b1, b2);\n}\n\nexports.compareBytes = compareBytes;\nexports.decodeBytes16 = decodeBytes16;\nexports.decodeBytes32 = decodeBytes32;\nexports.decodeBytes64 = decodeBytes64;\nexports.decodeBytes8 = decodeBytes8;\nexports.decodeBytesCompact = decodeBytesCompact;\nexports.encodeBytes = encodeBytes;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar token = require('./token.js');\nvar common = require('./common.js');\nvar _0uint = require('./0uint.js');\nvar _2bytes = require('./2bytes.js');\nvar byteUtils = require('./byte-utils.js');\n\nfunction toToken(data, pos, prefix, length, options) {\n const totLength = prefix + length;\n common.assertEnoughData(data, pos, totLength);\n const tok = new token.Token(token.Type.string, byteUtils.toString(data, pos + prefix, pos + totLength), totLength);\n if (options.retainStringBytes === true) {\n tok.byteValue = byteUtils.slice(data, pos + prefix, pos + totLength);\n }\n return tok;\n}\nfunction decodeStringCompact(data, pos, minor, options) {\n return toToken(data, pos, 1, minor, options);\n}\nfunction decodeString8(data, pos, _minor, options) {\n return toToken(data, pos, 2, _0uint.readUint8(data, pos + 1, options), options);\n}\nfunction decodeString16(data, pos, _minor, options) {\n return toToken(data, pos, 3, _0uint.readUint16(data, pos + 1, options), options);\n}\nfunction decodeString32(data, pos, _minor, options) {\n return toToken(data, pos, 5, _0uint.readUint32(data, pos + 1, options), options);\n}\nfunction decodeString64(data, pos, _minor, options) {\n const l = _0uint.readUint64(data, pos + 1, options);\n if (typeof l === 'bigint') {\n throw new Error(`${ common.decodeErrPrefix } 64-bit integer string lengths not supported`);\n }\n return toToken(data, pos, 9, l, options);\n}\nconst encodeString = _2bytes.encodeBytes;\n\nexports.decodeString16 = decodeString16;\nexports.decodeString32 = decodeString32;\nexports.decodeString64 = decodeString64;\nexports.decodeString8 = decodeString8;\nexports.decodeStringCompact = decodeStringCompact;\nexports.encodeString = encodeString;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar token = require('./token.js');\nvar _0uint = require('./0uint.js');\nvar common = require('./common.js');\n\nfunction toToken(_data, _pos, prefix, length) {\n return new token.Token(token.Type.array, length, prefix);\n}\nfunction decodeArrayCompact(data, pos, minor, _options) {\n return toToken(data, pos, 1, minor);\n}\nfunction decodeArray8(data, pos, _minor, options) {\n return toToken(data, pos, 2, _0uint.readUint8(data, pos + 1, options));\n}\nfunction decodeArray16(data, pos, _minor, options) {\n return toToken(data, pos, 3, _0uint.readUint16(data, pos + 1, options));\n}\nfunction decodeArray32(data, pos, _minor, options) {\n return toToken(data, pos, 5, _0uint.readUint32(data, pos + 1, options));\n}\nfunction decodeArray64(data, pos, _minor, options) {\n const l = _0uint.readUint64(data, pos + 1, options);\n if (typeof l === 'bigint') {\n throw new Error(`${ common.decodeErrPrefix } 64-bit integer array lengths not supported`);\n }\n return toToken(data, pos, 9, l);\n}\nfunction decodeArrayIndefinite(data, pos, _minor, options) {\n if (options.allowIndefinite === false) {\n throw new Error(`${ common.decodeErrPrefix } indefinite length items not allowed`);\n }\n return toToken(data, pos, 1, Infinity);\n}\nfunction encodeArray(buf, token$1) {\n _0uint.encodeUintValue(buf, token.Type.array.majorEncoded, token$1.value);\n}\nencodeArray.compareTokens = _0uint.encodeUint.compareTokens;\nencodeArray.encodedSize = function encodedSize(token) {\n return _0uint.encodeUintValue.encodedSize(token.value);\n};\n\nexports.decodeArray16 = decodeArray16;\nexports.decodeArray32 = decodeArray32;\nexports.decodeArray64 = decodeArray64;\nexports.decodeArray8 = decodeArray8;\nexports.decodeArrayCompact = decodeArrayCompact;\nexports.decodeArrayIndefinite = decodeArrayIndefinite;\nexports.encodeArray = encodeArray;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar token = require('./token.js');\nvar _0uint = require('./0uint.js');\nvar common = require('./common.js');\n\nfunction toToken(_data, _pos, prefix, length) {\n return new token.Token(token.Type.map, length, prefix);\n}\nfunction decodeMapCompact(data, pos, minor, _options) {\n return toToken(data, pos, 1, minor);\n}\nfunction decodeMap8(data, pos, _minor, options) {\n return toToken(data, pos, 2, _0uint.readUint8(data, pos + 1, options));\n}\nfunction decodeMap16(data, pos, _minor, options) {\n return toToken(data, pos, 3, _0uint.readUint16(data, pos + 1, options));\n}\nfunction decodeMap32(data, pos, _minor, options) {\n return toToken(data, pos, 5, _0uint.readUint32(data, pos + 1, options));\n}\nfunction decodeMap64(data, pos, _minor, options) {\n const l = _0uint.readUint64(data, pos + 1, options);\n if (typeof l === 'bigint') {\n throw new Error(`${ common.decodeErrPrefix } 64-bit integer map lengths not supported`);\n }\n return toToken(data, pos, 9, l);\n}\nfunction decodeMapIndefinite(data, pos, _minor, options) {\n if (options.allowIndefinite === false) {\n throw new Error(`${ common.decodeErrPrefix } indefinite length items not allowed`);\n }\n return toToken(data, pos, 1, Infinity);\n}\nfunction encodeMap(buf, token$1) {\n _0uint.encodeUintValue(buf, token.Type.map.majorEncoded, token$1.value);\n}\nencodeMap.compareTokens = _0uint.encodeUint.compareTokens;\nencodeMap.encodedSize = function encodedSize(token) {\n return _0uint.encodeUintValue.encodedSize(token.value);\n};\n\nexports.decodeMap16 = decodeMap16;\nexports.decodeMap32 = decodeMap32;\nexports.decodeMap64 = decodeMap64;\nexports.decodeMap8 = decodeMap8;\nexports.decodeMapCompact = decodeMapCompact;\nexports.decodeMapIndefinite = decodeMapIndefinite;\nexports.encodeMap = encodeMap;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar token = require('./token.js');\nvar _0uint = require('./0uint.js');\n\nfunction decodeTagCompact(_data, _pos, minor, _options) {\n return new token.Token(token.Type.tag, minor, 1);\n}\nfunction decodeTag8(data, pos, _minor, options) {\n return new token.Token(token.Type.tag, _0uint.readUint8(data, pos + 1, options), 2);\n}\nfunction decodeTag16(data, pos, _minor, options) {\n return new token.Token(token.Type.tag, _0uint.readUint16(data, pos + 1, options), 3);\n}\nfunction decodeTag32(data, pos, _minor, options) {\n return new token.Token(token.Type.tag, _0uint.readUint32(data, pos + 1, options), 5);\n}\nfunction decodeTag64(data, pos, _minor, options) {\n return new token.Token(token.Type.tag, _0uint.readUint64(data, pos + 1, options), 9);\n}\nfunction encodeTag(buf, token$1) {\n _0uint.encodeUintValue(buf, token.Type.tag.majorEncoded, token$1.value);\n}\nencodeTag.compareTokens = _0uint.encodeUint.compareTokens;\nencodeTag.encodedSize = function encodedSize(token) {\n return _0uint.encodeUintValue.encodedSize(token.value);\n};\n\nexports.decodeTag16 = decodeTag16;\nexports.decodeTag32 = decodeTag32;\nexports.decodeTag64 = decodeTag64;\nexports.decodeTag8 = decodeTag8;\nexports.decodeTagCompact = decodeTagCompact;\nexports.encodeTag = encodeTag;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar token = require('./token.js');\nvar common = require('./common.js');\nvar _0uint = require('./0uint.js');\n\nconst MINOR_FALSE = 20;\nconst MINOR_TRUE = 21;\nconst MINOR_NULL = 22;\nconst MINOR_UNDEFINED = 23;\nfunction decodeUndefined(_data, _pos, _minor, options) {\n if (options.allowUndefined === false) {\n throw new Error(`${ common.decodeErrPrefix } undefined values are not supported`);\n } else if (options.coerceUndefinedToNull === true) {\n return new token.Token(token.Type.null, null, 1);\n }\n return new token.Token(token.Type.undefined, undefined, 1);\n}\nfunction decodeBreak(_data, _pos, _minor, options) {\n if (options.allowIndefinite === false) {\n throw new Error(`${ common.decodeErrPrefix } indefinite length items not allowed`);\n }\n return new token.Token(token.Type.break, undefined, 1);\n}\nfunction createToken(value, bytes, options) {\n if (options) {\n if (options.allowNaN === false && Number.isNaN(value)) {\n throw new Error(`${ common.decodeErrPrefix } NaN values are not supported`);\n }\n if (options.allowInfinity === false && (value === Infinity || value === -Infinity)) {\n throw new Error(`${ common.decodeErrPrefix } Infinity values are not supported`);\n }\n }\n return new token.Token(token.Type.float, value, bytes);\n}\nfunction decodeFloat16(data, pos, _minor, options) {\n return createToken(readFloat16(data, pos + 1), 3, options);\n}\nfunction decodeFloat32(data, pos, _minor, options) {\n return createToken(readFloat32(data, pos + 1), 5, options);\n}\nfunction decodeFloat64(data, pos, _minor, options) {\n return createToken(readFloat64(data, pos + 1), 9, options);\n}\nfunction encodeFloat(buf, token$1, options) {\n const float = token$1.value;\n if (float === false) {\n buf.push([token.Type.float.majorEncoded | MINOR_FALSE]);\n } else if (float === true) {\n buf.push([token.Type.float.majorEncoded | MINOR_TRUE]);\n } else if (float === null) {\n buf.push([token.Type.float.majorEncoded | MINOR_NULL]);\n } else if (float === undefined) {\n buf.push([token.Type.float.majorEncoded | MINOR_UNDEFINED]);\n } else {\n let decoded;\n let success = false;\n if (!options || options.float64 !== true) {\n encodeFloat16(float);\n decoded = readFloat16(ui8a, 1);\n if (float === decoded || Number.isNaN(float)) {\n ui8a[0] = 249;\n buf.push(ui8a.slice(0, 3));\n success = true;\n } else {\n encodeFloat32(float);\n decoded = readFloat32(ui8a, 1);\n if (float === decoded) {\n ui8a[0] = 250;\n buf.push(ui8a.slice(0, 5));\n success = true;\n }\n }\n }\n if (!success) {\n encodeFloat64(float);\n decoded = readFloat64(ui8a, 1);\n ui8a[0] = 251;\n buf.push(ui8a.slice(0, 9));\n }\n }\n}\nencodeFloat.encodedSize = function encodedSize(token, options) {\n const float = token.value;\n if (float === false || float === true || float === null || float === undefined) {\n return 1;\n }\n if (!options || options.float64 !== true) {\n encodeFloat16(float);\n let decoded = readFloat16(ui8a, 1);\n if (float === decoded || Number.isNaN(float)) {\n return 3;\n }\n encodeFloat32(float);\n decoded = readFloat32(ui8a, 1);\n if (float === decoded) {\n return 5;\n }\n }\n return 9;\n};\nconst buffer = new ArrayBuffer(9);\nconst dataView = new DataView(buffer, 1);\nconst ui8a = new Uint8Array(buffer, 0);\nfunction encodeFloat16(inp) {\n if (inp === Infinity) {\n dataView.setUint16(0, 31744, false);\n } else if (inp === -Infinity) {\n dataView.setUint16(0, 64512, false);\n } else if (Number.isNaN(inp)) {\n dataView.setUint16(0, 32256, false);\n } else {\n dataView.setFloat32(0, inp);\n const valu32 = dataView.getUint32(0);\n const exponent = (valu32 & 2139095040) >> 23;\n const mantissa = valu32 & 8388607;\n if (exponent === 255) {\n dataView.setUint16(0, 31744, false);\n } else if (exponent === 0) {\n dataView.setUint16(0, (inp & 2147483648) >> 16 | mantissa >> 13, false);\n } else {\n const logicalExponent = exponent - 127;\n if (logicalExponent < -24) {\n dataView.setUint16(0, 0);\n } else if (logicalExponent < -14) {\n dataView.setUint16(0, (valu32 & 2147483648) >> 16 | 1 << 24 + logicalExponent, false);\n } else {\n dataView.setUint16(0, (valu32 & 2147483648) >> 16 | logicalExponent + 15 << 10 | mantissa >> 13, false);\n }\n }\n }\n}\nfunction readFloat16(ui8a, pos) {\n if (ui8a.length - pos < 2) {\n throw new Error(`${ common.decodeErrPrefix } not enough data for float16`);\n }\n const half = (ui8a[pos] << 8) + ui8a[pos + 1];\n if (half === 31744) {\n return Infinity;\n }\n if (half === 64512) {\n return -Infinity;\n }\n if (half === 32256) {\n return NaN;\n }\n const exp = half >> 10 & 31;\n const mant = half & 1023;\n let val;\n if (exp === 0) {\n val = mant * 2 ** -24;\n } else if (exp !== 31) {\n val = (mant + 1024) * 2 ** (exp - 25);\n } else {\n val = mant === 0 ? Infinity : NaN;\n }\n return half & 32768 ? -val : val;\n}\nfunction encodeFloat32(inp) {\n dataView.setFloat32(0, inp, false);\n}\nfunction readFloat32(ui8a, pos) {\n if (ui8a.length - pos < 4) {\n throw new Error(`${ common.decodeErrPrefix } not enough data for float32`);\n }\n const offset = (ui8a.byteOffset || 0) + pos;\n return new DataView(ui8a.buffer, offset, 4).getFloat32(0, false);\n}\nfunction encodeFloat64(inp) {\n dataView.setFloat64(0, inp, false);\n}\nfunction readFloat64(ui8a, pos) {\n if (ui8a.length - pos < 8) {\n throw new Error(`${ common.decodeErrPrefix } not enough data for float64`);\n }\n const offset = (ui8a.byteOffset || 0) + pos;\n return new DataView(ui8a.buffer, offset, 8).getFloat64(0, false);\n}\nencodeFloat.compareTokens = _0uint.encodeUint.compareTokens;\n\nexports.decodeBreak = decodeBreak;\nexports.decodeFloat16 = decodeFloat16;\nexports.decodeFloat32 = decodeFloat32;\nexports.decodeFloat64 = decodeFloat64;\nexports.decodeUndefined = decodeUndefined;\nexports.encodeFloat = encodeFloat;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar byteUtils = require('./byte-utils.js');\n\nconst defaultChunkSize = 256;\nclass Bl {\n constructor(chunkSize = defaultChunkSize) {\n this.chunkSize = chunkSize;\n this.cursor = 0;\n this.maxCursor = -1;\n this.chunks = [];\n this._initReuseChunk = null;\n }\n reset() {\n this.cursor = 0;\n this.maxCursor = -1;\n if (this.chunks.length) {\n this.chunks = [];\n }\n if (this._initReuseChunk !== null) {\n this.chunks.push(this._initReuseChunk);\n this.maxCursor = this._initReuseChunk.length - 1;\n }\n }\n push(bytes) {\n let topChunk = this.chunks[this.chunks.length - 1];\n const newMax = this.cursor + bytes.length;\n if (newMax <= this.maxCursor + 1) {\n const chunkPos = topChunk.length - (this.maxCursor - this.cursor) - 1;\n topChunk.set(bytes, chunkPos);\n } else {\n if (topChunk) {\n const chunkPos = topChunk.length - (this.maxCursor - this.cursor) - 1;\n if (chunkPos < topChunk.length) {\n this.chunks[this.chunks.length - 1] = topChunk.subarray(0, chunkPos);\n this.maxCursor = this.cursor - 1;\n }\n }\n if (bytes.length < 64 && bytes.length < this.chunkSize) {\n topChunk = byteUtils.alloc(this.chunkSize);\n this.chunks.push(topChunk);\n this.maxCursor += topChunk.length;\n if (this._initReuseChunk === null) {\n this._initReuseChunk = topChunk;\n }\n topChunk.set(bytes, 0);\n } else {\n this.chunks.push(bytes);\n this.maxCursor += bytes.length;\n }\n }\n this.cursor += bytes.length;\n }\n toBytes(reset = false) {\n let byts;\n if (this.chunks.length === 1) {\n const chunk = this.chunks[0];\n if (reset && this.cursor > chunk.length / 2) {\n byts = this.cursor === chunk.length ? chunk : chunk.subarray(0, this.cursor);\n this._initReuseChunk = null;\n this.chunks = [];\n } else {\n byts = byteUtils.slice(chunk, 0, this.cursor);\n }\n } else {\n byts = byteUtils.concat(this.chunks, this.cursor);\n }\n if (reset) {\n this.reset();\n }\n return byts;\n }\n}\n\nexports.Bl = Bl;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst useBuffer = globalThis.process && !globalThis.process.browser && globalThis.Buffer && typeof globalThis.Buffer.isBuffer === 'function';\nconst textDecoder = new TextDecoder();\nconst textEncoder = new TextEncoder();\nfunction isBuffer(buf) {\n return useBuffer && globalThis.Buffer.isBuffer(buf);\n}\nfunction asU8A(buf) {\n if (!(buf instanceof Uint8Array)) {\n return Uint8Array.from(buf);\n }\n return isBuffer(buf) ? new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength) : buf;\n}\nconst toString = useBuffer ? (bytes, start, end) => {\n return end - start > 64 ? globalThis.Buffer.from(bytes.subarray(start, end)).toString('utf8') : utf8Slice(bytes, start, end);\n} : (bytes, start, end) => {\n return end - start > 64 ? textDecoder.decode(bytes.subarray(start, end)) : utf8Slice(bytes, start, end);\n};\nconst fromString = useBuffer ? string => {\n return string.length > 64 ? globalThis.Buffer.from(string) : utf8ToBytes(string);\n} : string => {\n return string.length > 64 ? textEncoder.encode(string) : utf8ToBytes(string);\n};\nconst fromArray = arr => {\n return Uint8Array.from(arr);\n};\nconst slice = useBuffer ? (bytes, start, end) => {\n if (isBuffer(bytes)) {\n return new Uint8Array(bytes.subarray(start, end));\n }\n return bytes.slice(start, end);\n} : (bytes, start, end) => {\n return bytes.slice(start, end);\n};\nconst concat = useBuffer ? (chunks, length) => {\n chunks = chunks.map(c => c instanceof Uint8Array ? c : globalThis.Buffer.from(c));\n return asU8A(globalThis.Buffer.concat(chunks, length));\n} : (chunks, length) => {\n const out = new Uint8Array(length);\n let off = 0;\n for (let b of chunks) {\n if (off + b.length > out.length) {\n b = b.subarray(0, out.length - off);\n }\n out.set(b, off);\n off += b.length;\n }\n return out;\n};\nconst alloc = useBuffer ? size => {\n return globalThis.Buffer.allocUnsafe(size);\n} : size => {\n return new Uint8Array(size);\n};\nconst toHex = useBuffer ? d => {\n if (typeof d === 'string') {\n return d;\n }\n return globalThis.Buffer.from(toBytes(d)).toString('hex');\n} : d => {\n if (typeof d === 'string') {\n return d;\n }\n return Array.prototype.reduce.call(toBytes(d), (p, c) => `${ p }${ c.toString(16).padStart(2, '0') }`, '');\n};\nconst fromHex = useBuffer ? hex => {\n if (hex instanceof Uint8Array) {\n return hex;\n }\n return globalThis.Buffer.from(hex, 'hex');\n} : hex => {\n if (hex instanceof Uint8Array) {\n return hex;\n }\n if (!hex.length) {\n return new Uint8Array(0);\n }\n return new Uint8Array(hex.split('').map((c, i, d) => i % 2 === 0 ? `0x${ c }${ d[i + 1] }` : '').filter(Boolean).map(e => parseInt(e, 16)));\n};\nfunction toBytes(obj) {\n if (obj instanceof Uint8Array && obj.constructor.name === 'Uint8Array') {\n return obj;\n }\n if (obj instanceof ArrayBuffer) {\n return new Uint8Array(obj);\n }\n if (ArrayBuffer.isView(obj)) {\n return new Uint8Array(obj.buffer, obj.byteOffset, obj.byteLength);\n }\n throw new Error('Unknown type, must be binary type');\n}\nfunction compare(b1, b2) {\n if (isBuffer(b1) && isBuffer(b2)) {\n return b1.compare(b2);\n }\n for (let i = 0; i < b1.length; i++) {\n if (b1[i] === b2[i]) {\n continue;\n }\n return b1[i] < b2[i] ? -1 : 1;\n }\n return 0;\n}\nfunction utf8ToBytes(string, units = Infinity) {\n let codePoint;\n const length = string.length;\n let leadSurrogate = null;\n const bytes = [];\n for (let i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i);\n if (codePoint > 55295 && codePoint < 57344) {\n if (!leadSurrogate) {\n if (codePoint > 56319) {\n if ((units -= 3) > -1)\n bytes.push(239, 191, 189);\n continue;\n } else if (i + 1 === length) {\n if ((units -= 3) > -1)\n bytes.push(239, 191, 189);\n continue;\n }\n leadSurrogate = codePoint;\n continue;\n }\n if (codePoint < 56320) {\n if ((units -= 3) > -1)\n bytes.push(239, 191, 189);\n leadSurrogate = codePoint;\n continue;\n }\n codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536;\n } else if (leadSurrogate) {\n if ((units -= 3) > -1)\n bytes.push(239, 191, 189);\n }\n leadSurrogate = null;\n if (codePoint < 128) {\n if ((units -= 1) < 0)\n break;\n bytes.push(codePoint);\n } else if (codePoint < 2048) {\n if ((units -= 2) < 0)\n break;\n bytes.push(codePoint >> 6 | 192, codePoint & 63 | 128);\n } else if (codePoint < 65536) {\n if ((units -= 3) < 0)\n break;\n bytes.push(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128);\n } else if (codePoint < 1114112) {\n if ((units -= 4) < 0)\n break;\n bytes.push(codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128);\n } else {\n throw new Error('Invalid code point');\n }\n }\n return bytes;\n}\nfunction utf8Slice(buf, offset, end) {\n const res = [];\n while (offset < end) {\n const firstByte = buf[offset];\n let codePoint = null;\n let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1;\n if (offset + bytesPerSequence <= end) {\n let secondByte, thirdByte, fourthByte, tempCodePoint;\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 128) {\n codePoint = firstByte;\n }\n break;\n case 2:\n secondByte = buf[offset + 1];\n if ((secondByte & 192) === 128) {\n tempCodePoint = (firstByte & 31) << 6 | secondByte & 63;\n if (tempCodePoint > 127) {\n codePoint = tempCodePoint;\n }\n }\n break;\n case 3:\n secondByte = buf[offset + 1];\n thirdByte = buf[offset + 2];\n if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) {\n tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63;\n if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) {\n codePoint = tempCodePoint;\n }\n }\n break;\n case 4:\n secondByte = buf[offset + 1];\n thirdByte = buf[offset + 2];\n fourthByte = buf[offset + 3];\n if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) {\n tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63;\n if (tempCodePoint > 65535 && tempCodePoint < 1114112) {\n codePoint = tempCodePoint;\n }\n }\n }\n }\n if (codePoint === null) {\n codePoint = 65533;\n bytesPerSequence = 1;\n } else if (codePoint > 65535) {\n codePoint -= 65536;\n res.push(codePoint >>> 10 & 1023 | 55296);\n codePoint = 56320 | codePoint & 1023;\n }\n res.push(codePoint);\n offset += bytesPerSequence;\n }\n return decodeCodePointsArray(res);\n}\nconst MAX_ARGUMENTS_LENGTH = 4096;\nfunction decodeCodePointsArray(codePoints) {\n const len = codePoints.length;\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints);\n }\n let res = '';\n let i = 0;\n while (i < len) {\n res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH));\n }\n return res;\n}\n\nexports.alloc = alloc;\nexports.asU8A = asU8A;\nexports.compare = compare;\nexports.concat = concat;\nexports.decodeCodePointsArray = decodeCodePointsArray;\nexports.fromArray = fromArray;\nexports.fromHex = fromHex;\nexports.fromString = fromString;\nexports.slice = slice;\nexports.toHex = toHex;\nexports.toString = toString;\nexports.useBuffer = useBuffer;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst decodeErrPrefix = 'CBOR decode error:';\nconst encodeErrPrefix = 'CBOR encode error:';\nconst uintMinorPrefixBytes = [];\nuintMinorPrefixBytes[23] = 1;\nuintMinorPrefixBytes[24] = 2;\nuintMinorPrefixBytes[25] = 3;\nuintMinorPrefixBytes[26] = 5;\nuintMinorPrefixBytes[27] = 9;\nfunction assertEnoughData(data, pos, need) {\n if (data.length - pos < need) {\n throw new Error(`${ decodeErrPrefix } not enough data for type`);\n }\n}\n\nexports.assertEnoughData = assertEnoughData;\nexports.decodeErrPrefix = decodeErrPrefix;\nexports.encodeErrPrefix = encodeErrPrefix;\nexports.uintMinorPrefixBytes = uintMinorPrefixBytes;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar common = require('./common.js');\nvar token = require('./token.js');\nvar jump = require('./jump.js');\n\nconst defaultDecodeOptions = {\n strict: false,\n allowIndefinite: true,\n allowUndefined: true,\n allowBigInt: true\n};\nclass Tokeniser {\n constructor(data, options = {}) {\n this.pos = 0;\n this.data = data;\n this.options = options;\n }\n done() {\n return this.pos >= this.data.length;\n }\n next() {\n const byt = this.data[this.pos];\n let token = jump.quick[byt];\n if (token === undefined) {\n const decoder = jump.jump[byt];\n if (!decoder) {\n throw new Error(`${ common.decodeErrPrefix } no decoder for major type ${ byt >>> 5 } (byte 0x${ byt.toString(16).padStart(2, '0') })`);\n }\n const minor = byt & 31;\n token = decoder(this.data, this.pos, minor, this.options);\n }\n this.pos += token.encodedLength;\n return token;\n }\n}\nconst DONE = Symbol.for('DONE');\nconst BREAK = Symbol.for('BREAK');\nfunction tokenToArray(token, tokeniser, options) {\n const arr = [];\n for (let i = 0; i < token.value; i++) {\n const value = tokensToObject(tokeniser, options);\n if (value === BREAK) {\n if (token.value === Infinity) {\n break;\n }\n throw new Error(`${ common.decodeErrPrefix } got unexpected break to lengthed array`);\n }\n if (value === DONE) {\n throw new Error(`${ common.decodeErrPrefix } found array but not enough entries (got ${ i }, expected ${ token.value })`);\n }\n arr[i] = value;\n }\n return arr;\n}\nfunction tokenToMap(token, tokeniser, options) {\n const useMaps = options.useMaps === true;\n const obj = useMaps ? undefined : {};\n const m = useMaps ? new Map() : undefined;\n for (let i = 0; i < token.value; i++) {\n const key = tokensToObject(tokeniser, options);\n if (key === BREAK) {\n if (token.value === Infinity) {\n break;\n }\n throw new Error(`${ common.decodeErrPrefix } got unexpected break to lengthed map`);\n }\n if (key === DONE) {\n throw new Error(`${ common.decodeErrPrefix } found map but not enough entries (got ${ i } [no key], expected ${ token.value })`);\n }\n if (useMaps !== true && typeof key !== 'string') {\n throw new Error(`${ common.decodeErrPrefix } non-string keys not supported (got ${ typeof key })`);\n }\n const value = tokensToObject(tokeniser, options);\n if (value === DONE) {\n throw new Error(`${ common.decodeErrPrefix } found map but not enough entries (got ${ i } [no value], expected ${ token.value })`);\n }\n if (useMaps) {\n m.set(key, value);\n } else {\n obj[key] = value;\n }\n }\n return useMaps ? m : obj;\n}\nfunction tokensToObject(tokeniser, options) {\n if (tokeniser.done()) {\n return DONE;\n }\n const token$1 = tokeniser.next();\n if (token$1.type === token.Type.break) {\n return BREAK;\n }\n if (token$1.type.terminal) {\n return token$1.value;\n }\n if (token$1.type === token.Type.array) {\n return tokenToArray(token$1, tokeniser, options);\n }\n if (token$1.type === token.Type.map) {\n return tokenToMap(token$1, tokeniser, options);\n }\n if (token$1.type === token.Type.tag) {\n if (options.tags && typeof options.tags[token$1.value] === 'function') {\n const tagged = tokensToObject(tokeniser, options);\n return options.tags[token$1.value](tagged);\n }\n throw new Error(`${ common.decodeErrPrefix } tag not supported (${ token$1.value })`);\n }\n throw new Error('unsupported');\n}\nfunction decode(data, options) {\n if (!(data instanceof Uint8Array)) {\n throw new Error(`${ common.decodeErrPrefix } data to decode must be a Uint8Array`);\n }\n options = Object.assign({}, defaultDecodeOptions, options);\n const tokeniser = options.tokenizer || new Tokeniser(data, options);\n const decoded = tokensToObject(tokeniser, options);\n if (decoded === DONE) {\n throw new Error(`${ common.decodeErrPrefix } did not find any content to decode`);\n }\n if (decoded === BREAK) {\n throw new Error(`${ common.decodeErrPrefix } got unexpected break`);\n }\n if (!tokeniser.done()) {\n throw new Error(`${ common.decodeErrPrefix } too many terminals, data makes no sense`);\n }\n return decoded;\n}\n\nexports.Tokeniser = Tokeniser;\nexports.decode = decode;\nexports.tokensToObject = tokensToObject;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar is = require('./is.js');\nvar token = require('./token.js');\nvar bl = require('./bl.js');\nvar common = require('./common.js');\nvar jump = require('./jump.js');\nvar byteUtils = require('./byte-utils.js');\nvar _0uint = require('./0uint.js');\nvar _1negint = require('./1negint.js');\nvar _2bytes = require('./2bytes.js');\nvar _3string = require('./3string.js');\nvar _4array = require('./4array.js');\nvar _5map = require('./5map.js');\nvar _6tag = require('./6tag.js');\nvar _7float = require('./7float.js');\n\nconst defaultEncodeOptions = {\n float64: false,\n mapSorter,\n quickEncodeToken: jump.quickEncodeToken\n};\nfunction makeCborEncoders() {\n const encoders = [];\n encoders[token.Type.uint.major] = _0uint.encodeUint;\n encoders[token.Type.negint.major] = _1negint.encodeNegint;\n encoders[token.Type.bytes.major] = _2bytes.encodeBytes;\n encoders[token.Type.string.major] = _3string.encodeString;\n encoders[token.Type.array.major] = _4array.encodeArray;\n encoders[token.Type.map.major] = _5map.encodeMap;\n encoders[token.Type.tag.major] = _6tag.encodeTag;\n encoders[token.Type.float.major] = _7float.encodeFloat;\n return encoders;\n}\nconst cborEncoders = makeCborEncoders();\nconst buf = new bl.Bl();\nclass Ref {\n constructor(obj, parent) {\n this.obj = obj;\n this.parent = parent;\n }\n includes(obj) {\n let p = this;\n do {\n if (p.obj === obj) {\n return true;\n }\n } while (p = p.parent);\n return false;\n }\n static createCheck(stack, obj) {\n if (stack && stack.includes(obj)) {\n throw new Error(`${ common.encodeErrPrefix } object contains circular references`);\n }\n return new Ref(obj, stack);\n }\n}\nconst simpleTokens = {\n null: new token.Token(token.Type.null, null),\n undefined: new token.Token(token.Type.undefined, undefined),\n true: new token.Token(token.Type.true, true),\n false: new token.Token(token.Type.false, false),\n emptyArray: new token.Token(token.Type.array, 0),\n emptyMap: new token.Token(token.Type.map, 0)\n};\nconst typeEncoders = {\n number(obj, _typ, _options, _refStack) {\n if (!Number.isInteger(obj) || !Number.isSafeInteger(obj)) {\n return new token.Token(token.Type.float, obj);\n } else if (obj >= 0) {\n return new token.Token(token.Type.uint, obj);\n } else {\n return new token.Token(token.Type.negint, obj);\n }\n },\n bigint(obj, _typ, _options, _refStack) {\n if (obj >= BigInt(0)) {\n return new token.Token(token.Type.uint, obj);\n } else {\n return new token.Token(token.Type.negint, obj);\n }\n },\n Uint8Array(obj, _typ, _options, _refStack) {\n return new token.Token(token.Type.bytes, obj);\n },\n string(obj, _typ, _options, _refStack) {\n return new token.Token(token.Type.string, obj);\n },\n boolean(obj, _typ, _options, _refStack) {\n return obj ? simpleTokens.true : simpleTokens.false;\n },\n null(_obj, _typ, _options, _refStack) {\n return simpleTokens.null;\n },\n undefined(_obj, _typ, _options, _refStack) {\n return simpleTokens.undefined;\n },\n ArrayBuffer(obj, _typ, _options, _refStack) {\n return new token.Token(token.Type.bytes, new Uint8Array(obj));\n },\n DataView(obj, _typ, _options, _refStack) {\n return new token.Token(token.Type.bytes, new Uint8Array(obj.buffer, obj.byteOffset, obj.byteLength));\n },\n Array(obj, _typ, options, refStack) {\n if (!obj.length) {\n if (options.addBreakTokens === true) {\n return [\n simpleTokens.emptyArray,\n new token.Token(token.Type.break)\n ];\n }\n return simpleTokens.emptyArray;\n }\n refStack = Ref.createCheck(refStack, obj);\n const entries = [];\n let i = 0;\n for (const e of obj) {\n entries[i++] = objectToTokens(e, options, refStack);\n }\n if (options.addBreakTokens) {\n return [\n new token.Token(token.Type.array, obj.length),\n entries,\n new token.Token(token.Type.break)\n ];\n }\n return [\n new token.Token(token.Type.array, obj.length),\n entries\n ];\n },\n Object(obj, typ, options, refStack) {\n const isMap = typ !== 'Object';\n const keys = isMap ? obj.keys() : Object.keys(obj);\n const length = isMap ? obj.size : keys.length;\n if (!length) {\n if (options.addBreakTokens === true) {\n return [\n simpleTokens.emptyMap,\n new token.Token(token.Type.break)\n ];\n }\n return simpleTokens.emptyMap;\n }\n refStack = Ref.createCheck(refStack, obj);\n const entries = [];\n let i = 0;\n for (const key of keys) {\n entries[i++] = [\n objectToTokens(key, options, refStack),\n objectToTokens(isMap ? obj.get(key) : obj[key], options, refStack)\n ];\n }\n sortMapEntries(entries, options);\n if (options.addBreakTokens) {\n return [\n new token.Token(token.Type.map, length),\n entries,\n new token.Token(token.Type.break)\n ];\n }\n return [\n new token.Token(token.Type.map, length),\n entries\n ];\n }\n};\ntypeEncoders.Map = typeEncoders.Object;\ntypeEncoders.Buffer = typeEncoders.Uint8Array;\nfor (const typ of 'Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64'.split(' ')) {\n typeEncoders[`${ typ }Array`] = typeEncoders.DataView;\n}\nfunction objectToTokens(obj, options = {}, refStack) {\n const typ = is.is(obj);\n const customTypeEncoder = options && options.typeEncoders && options.typeEncoders[typ] || typeEncoders[typ];\n if (typeof customTypeEncoder === 'function') {\n const tokens = customTypeEncoder(obj, typ, options, refStack);\n if (tokens != null) {\n return tokens;\n }\n }\n const typeEncoder = typeEncoders[typ];\n if (!typeEncoder) {\n throw new Error(`${ common.encodeErrPrefix } unsupported type: ${ typ }`);\n }\n return typeEncoder(obj, typ, options, refStack);\n}\nfunction sortMapEntries(entries, options) {\n if (options.mapSorter) {\n entries.sort(options.mapSorter);\n }\n}\nfunction mapSorter(e1, e2) {\n const keyToken1 = Array.isArray(e1[0]) ? e1[0][0] : e1[0];\n const keyToken2 = Array.isArray(e2[0]) ? e2[0][0] : e2[0];\n if (keyToken1.type !== keyToken2.type) {\n return keyToken1.type.compare(keyToken2.type);\n }\n const major = keyToken1.type.major;\n const tcmp = cborEncoders[major].compareTokens(keyToken1, keyToken2);\n if (tcmp === 0) {\n console.warn('WARNING: complex key types used, CBOR key sorting guarantees are gone');\n }\n return tcmp;\n}\nfunction tokensToEncoded(buf, tokens, encoders, options) {\n if (Array.isArray(tokens)) {\n for (const token of tokens) {\n tokensToEncoded(buf, token, encoders, options);\n }\n } else {\n encoders[tokens.type.major](buf, tokens, options);\n }\n}\nfunction encodeCustom(data, encoders, options) {\n const tokens = objectToTokens(data, options);\n if (!Array.isArray(tokens) && options.quickEncodeToken) {\n const quickBytes = options.quickEncodeToken(tokens);\n if (quickBytes) {\n return quickBytes;\n }\n const encoder = encoders[tokens.type.major];\n if (encoder.encodedSize) {\n const size = encoder.encodedSize(tokens, options);\n const buf = new bl.Bl(size);\n encoder(buf, tokens, options);\n if (buf.chunks.length !== 1) {\n throw new Error(`Unexpected error: pre-calculated length for ${ tokens } was wrong`);\n }\n return byteUtils.asU8A(buf.chunks[0]);\n }\n }\n buf.reset();\n tokensToEncoded(buf, tokens, encoders, options);\n return buf.toBytes(true);\n}\nfunction encode(data, options) {\n options = Object.assign({}, defaultEncodeOptions, options);\n return encodeCustom(data, cborEncoders, options);\n}\n\nexports.Ref = Ref;\nexports.encode = encode;\nexports.encodeCustom = encodeCustom;\nexports.makeCborEncoders = makeCborEncoders;\nexports.objectToTokens = objectToTokens;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst typeofs = [\n 'string',\n 'number',\n 'bigint',\n 'symbol'\n];\nconst objectTypeNames = [\n 'Function',\n 'Generator',\n 'AsyncGenerator',\n 'GeneratorFunction',\n 'AsyncGeneratorFunction',\n 'AsyncFunction',\n 'Observable',\n 'Array',\n 'Buffer',\n 'Object',\n 'RegExp',\n 'Date',\n 'Error',\n 'Map',\n 'Set',\n 'WeakMap',\n 'WeakSet',\n 'ArrayBuffer',\n 'SharedArrayBuffer',\n 'DataView',\n 'Promise',\n 'URL',\n 'HTMLElement',\n 'Int8Array',\n 'Uint8Array',\n 'Uint8ClampedArray',\n 'Int16Array',\n 'Uint16Array',\n 'Int32Array',\n 'Uint32Array',\n 'Float32Array',\n 'Float64Array',\n 'BigInt64Array',\n 'BigUint64Array'\n];\nfunction is(value) {\n if (value === null) {\n return 'null';\n }\n if (value === undefined) {\n return 'undefined';\n }\n if (value === true || value === false) {\n return 'boolean';\n }\n const typeOf = typeof value;\n if (typeofs.includes(typeOf)) {\n return typeOf;\n }\n if (typeOf === 'function') {\n return 'Function';\n }\n if (Array.isArray(value)) {\n return 'Array';\n }\n if (isBuffer(value)) {\n return 'Buffer';\n }\n const objectType = getObjectType(value);\n if (objectType) {\n return objectType;\n }\n return 'Object';\n}\nfunction isBuffer(value) {\n return value && value.constructor && value.constructor.isBuffer && value.constructor.isBuffer.call(null, value);\n}\nfunction getObjectType(value) {\n const objectTypeName = Object.prototype.toString.call(value).slice(8, -1);\n if (objectTypeNames.includes(objectTypeName)) {\n return objectTypeName;\n }\n return undefined;\n}\n\nexports.is = is;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar token = require('./token.js');\nvar _0uint = require('./0uint.js');\nvar _1negint = require('./1negint.js');\nvar _2bytes = require('./2bytes.js');\nvar _3string = require('./3string.js');\nvar _4array = require('./4array.js');\nvar _5map = require('./5map.js');\nvar _6tag = require('./6tag.js');\nvar _7float = require('./7float.js');\nvar common = require('./common.js');\nvar byteUtils = require('./byte-utils.js');\n\nfunction invalidMinor(data, pos, minor) {\n throw new Error(`${ common.decodeErrPrefix } encountered invalid minor (${ minor }) for major ${ data[pos] >>> 5 }`);\n}\nfunction errorer(msg) {\n return () => {\n throw new Error(`${ common.decodeErrPrefix } ${ msg }`);\n };\n}\nconst jump = [];\nfor (let i = 0; i <= 23; i++) {\n jump[i] = invalidMinor;\n}\njump[24] = _0uint.decodeUint8;\njump[25] = _0uint.decodeUint16;\njump[26] = _0uint.decodeUint32;\njump[27] = _0uint.decodeUint64;\njump[28] = invalidMinor;\njump[29] = invalidMinor;\njump[30] = invalidMinor;\njump[31] = invalidMinor;\nfor (let i = 32; i <= 55; i++) {\n jump[i] = invalidMinor;\n}\njump[56] = _1negint.decodeNegint8;\njump[57] = _1negint.decodeNegint16;\njump[58] = _1negint.decodeNegint32;\njump[59] = _1negint.decodeNegint64;\njump[60] = invalidMinor;\njump[61] = invalidMinor;\njump[62] = invalidMinor;\njump[63] = invalidMinor;\nfor (let i = 64; i <= 87; i++) {\n jump[i] = _2bytes.decodeBytesCompact;\n}\njump[88] = _2bytes.decodeBytes8;\njump[89] = _2bytes.decodeBytes16;\njump[90] = _2bytes.decodeBytes32;\njump[91] = _2bytes.decodeBytes64;\njump[92] = invalidMinor;\njump[93] = invalidMinor;\njump[94] = invalidMinor;\njump[95] = errorer('indefinite length bytes/strings are not supported');\nfor (let i = 96; i <= 119; i++) {\n jump[i] = _3string.decodeStringCompact;\n}\njump[120] = _3string.decodeString8;\njump[121] = _3string.decodeString16;\njump[122] = _3string.decodeString32;\njump[123] = _3string.decodeString64;\njump[124] = invalidMinor;\njump[125] = invalidMinor;\njump[126] = invalidMinor;\njump[127] = errorer('indefinite length bytes/strings are not supported');\nfor (let i = 128; i <= 151; i++) {\n jump[i] = _4array.decodeArrayCompact;\n}\njump[152] = _4array.decodeArray8;\njump[153] = _4array.decodeArray16;\njump[154] = _4array.decodeArray32;\njump[155] = _4array.decodeArray64;\njump[156] = invalidMinor;\njump[157] = invalidMinor;\njump[158] = invalidMinor;\njump[159] = _4array.decodeArrayIndefinite;\nfor (let i = 160; i <= 183; i++) {\n jump[i] = _5map.decodeMapCompact;\n}\njump[184] = _5map.decodeMap8;\njump[185] = _5map.decodeMap16;\njump[186] = _5map.decodeMap32;\njump[187] = _5map.decodeMap64;\njump[188] = invalidMinor;\njump[189] = invalidMinor;\njump[190] = invalidMinor;\njump[191] = _5map.decodeMapIndefinite;\nfor (let i = 192; i <= 215; i++) {\n jump[i] = _6tag.decodeTagCompact;\n}\njump[216] = _6tag.decodeTag8;\njump[217] = _6tag.decodeTag16;\njump[218] = _6tag.decodeTag32;\njump[219] = _6tag.decodeTag64;\njump[220] = invalidMinor;\njump[221] = invalidMinor;\njump[222] = invalidMinor;\njump[223] = invalidMinor;\nfor (let i = 224; i <= 243; i++) {\n jump[i] = errorer('simple values are not supported');\n}\njump[244] = invalidMinor;\njump[245] = invalidMinor;\njump[246] = invalidMinor;\njump[247] = _7float.decodeUndefined;\njump[248] = errorer('simple values are not supported');\njump[249] = _7float.decodeFloat16;\njump[250] = _7float.decodeFloat32;\njump[251] = _7float.decodeFloat64;\njump[252] = invalidMinor;\njump[253] = invalidMinor;\njump[254] = invalidMinor;\njump[255] = _7float.decodeBreak;\nconst quick = [];\nfor (let i = 0; i < 24; i++) {\n quick[i] = new token.Token(token.Type.uint, i, 1);\n}\nfor (let i = -1; i >= -24; i--) {\n quick[31 - i] = new token.Token(token.Type.negint, i, 1);\n}\nquick[64] = new token.Token(token.Type.bytes, new Uint8Array(0), 1);\nquick[96] = new token.Token(token.Type.string, '', 1);\nquick[128] = new token.Token(token.Type.array, 0, 1);\nquick[160] = new token.Token(token.Type.map, 0, 1);\nquick[244] = new token.Token(token.Type.false, false, 1);\nquick[245] = new token.Token(token.Type.true, true, 1);\nquick[246] = new token.Token(token.Type.null, null, 1);\nfunction quickEncodeToken(token$1) {\n switch (token$1.type) {\n case token.Type.false:\n return byteUtils.fromArray([244]);\n case token.Type.true:\n return byteUtils.fromArray([245]);\n case token.Type.null:\n return byteUtils.fromArray([246]);\n case token.Type.bytes:\n if (!token$1.value.length) {\n return byteUtils.fromArray([64]);\n }\n return;\n case token.Type.string:\n if (token$1.value === '') {\n return byteUtils.fromArray([96]);\n }\n return;\n case token.Type.array:\n if (token$1.value === 0) {\n return byteUtils.fromArray([128]);\n }\n return;\n case token.Type.map:\n if (token$1.value === 0) {\n return byteUtils.fromArray([160]);\n }\n return;\n case token.Type.uint:\n if (token$1.value < 24) {\n return byteUtils.fromArray([Number(token$1.value)]);\n }\n return;\n case token.Type.negint:\n if (token$1.value >= -24) {\n return byteUtils.fromArray([31 - Number(token$1.value)]);\n }\n }\n}\n\nexports.jump = jump;\nexports.quick = quick;\nexports.quickEncodeToken = quickEncodeToken;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nclass Type {\n constructor(major, name, terminal) {\n this.major = major;\n this.majorEncoded = major << 5;\n this.name = name;\n this.terminal = terminal;\n }\n toString() {\n return `Type[${ this.major }].${ this.name }`;\n }\n compare(typ) {\n return this.major < typ.major ? -1 : this.major > typ.major ? 1 : 0;\n }\n}\nType.uint = new Type(0, 'uint', true);\nType.negint = new Type(1, 'negint', true);\nType.bytes = new Type(2, 'bytes', true);\nType.string = new Type(3, 'string', true);\nType.array = new Type(4, 'array', false);\nType.map = new Type(5, 'map', false);\nType.tag = new Type(6, 'tag', false);\nType.float = new Type(7, 'float', true);\nType.false = new Type(7, 'false', true);\nType.true = new Type(7, 'true', true);\nType.null = new Type(7, 'null', true);\nType.undefined = new Type(7, 'undefined', true);\nType.break = new Type(7, 'break', true);\nclass Token {\n constructor(type, value, encodedLength) {\n this.type = type;\n this.value = value;\n this.encodedLength = encodedLength;\n this.encodedBytes = undefined;\n this.byteValue = undefined;\n }\n toString() {\n return `Token[${ this.type }].${ this.value }`;\n }\n}\n\nexports.Token = Token;\nexports.Type = Type;\n","module.exports = function (xs, fn) {\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n var x = fn(xs[i], i);\n if (isArray(x)) res.push.apply(res, x);\n else res.push(x);\n }\n return res;\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n","\"use strict\";\n/**\n * Returns a `Buffer` instance from the given data URI `uri`.\n *\n * @param {String} uri Data URI to turn into a Buffer instance\n * @return {Buffer} Buffer instance from Data URI\n * @api public\n */\nfunction dataUriToBuffer(uri) {\n if (!/^data:/i.test(uri)) {\n throw new TypeError('`uri` does not appear to be a Data URI (must begin with \"data:\")');\n }\n // strip newlines\n uri = uri.replace(/\\r?\\n/g, '');\n // split the URI up into the \"metadata\" and the \"data\" portions\n const firstComma = uri.indexOf(',');\n if (firstComma === -1 || firstComma <= 4) {\n throw new TypeError('malformed data: URI');\n }\n // remove the \"data:\" scheme and parse the metadata\n const meta = uri.substring(5, firstComma).split(';');\n let charset = '';\n let base64 = false;\n const type = meta[0] || 'text/plain';\n let typeFull = type;\n for (let i = 1; i < meta.length; i++) {\n if (meta[i] === 'base64') {\n base64 = true;\n }\n else {\n typeFull += `;${meta[i]}`;\n if (meta[i].indexOf('charset=') === 0) {\n charset = meta[i].substring(8);\n }\n }\n }\n // defaults to US-ASCII only if type is not provided\n if (!meta[0] && !charset.length) {\n typeFull += ';charset=US-ASCII';\n charset = 'US-ASCII';\n }\n // get the encoded data portion and decode URI-encoded chars\n const encoding = base64 ? 'base64' : 'ascii';\n const data = unescape(uri.substring(firstComma + 1));\n const buffer = Buffer.from(data, encoding);\n // set `.type` and `.typeFull` properties to MIME type\n buffer.type = type;\n buffer.typeFull = typeFull;\n // set the `.charset` property\n buffer.charset = charset;\n return buffer;\n}\nmodule.exports = dataUriToBuffer;\n//# sourceMappingURL=index.js.map","'use strict';\n\n/**\n * @typedef {{ [key: string]: any }} Extensions\n * @typedef {Error} Err\n * @property {string} message\n */\n\n/**\n *\n * @param {Error} obj\n * @param {Extensions} props\n * @returns {Error & Extensions}\n */\nfunction assign(obj, props) {\n for (const key in props) {\n Object.defineProperty(obj, key, {\n value: props[key],\n enumerable: true,\n configurable: true,\n });\n }\n\n return obj;\n}\n\n/**\n *\n * @param {any} err - An Error\n * @param {string|Extensions} code - A string code or props to set on the error\n * @param {Extensions} [props] - Props to set on the error\n * @returns {Error & Extensions}\n */\nfunction createError(err, code, props) {\n if (!err || typeof err === 'string') {\n throw new TypeError('Please pass an Error to err-code');\n }\n\n if (!props) {\n props = {};\n }\n\n if (typeof code === 'object') {\n props = code;\n code = '';\n }\n\n if (code) {\n props.code = code;\n }\n\n try {\n return assign(err, props);\n } catch (_) {\n props.message = err.message;\n props.stack = err.stack;\n\n const ErrClass = function () {};\n\n ErrClass.prototype = Object.create(Object.getPrototypeOf(err));\n\n // @ts-ignore\n const output = assign(new ErrClass(), props);\n\n return output;\n }\n}\n\nmodule.exports = createError;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar Path = require('path');\nvar fs = require('graceful-fs');\nvar util = require('util');\nvar glob = require('it-glob');\nvar errCode = require('err-code');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar Path__default = /*#__PURE__*/_interopDefaultLegacy(Path);\nvar fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);\nvar glob__default = /*#__PURE__*/_interopDefaultLegacy(glob);\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\n\nconst fsStat = util.promisify(fs__default[\"default\"].stat);\nasync function getFilesFromPath(paths, options) {\n const files = [];\n for await (const file of filesFromPath(paths, options)) {\n files.push(file);\n }\n return files;\n}\nasync function* filesFromPath(paths, options) {\n options = options || {};\n if (typeof paths === 'string') {\n paths = [paths];\n }\n const globSourceOptions = {\n recursive: true,\n glob: {\n dot: Boolean(options.hidden),\n ignore: Array.isArray(options.ignore) ? options.ignore : [],\n follow: options.followSymlinks != null ? options.followSymlinks : true\n }\n };\n for await (const path of paths) {\n if (typeof path !== 'string') {\n throw errCode__default[\"default\"](new Error('Path must be a string'), 'ERR_INVALID_PATH', { path });\n }\n const absolutePath = Path__default[\"default\"].resolve(process.cwd(), path);\n const stat = await fsStat(absolutePath);\n const prefix = options.pathPrefix || Path__default[\"default\"].dirname(absolutePath);\n let mode = options.mode;\n if (options.preserveMode) {\n mode = stat.mode;\n }\n let mtime = options.mtime;\n if (options.preserveMtime) {\n mtime = stat.mtime;\n }\n yield* toGlobSource({\n path,\n type: stat.isDirectory() ? 'dir' : 'file',\n prefix,\n mode,\n mtime,\n size: stat.size,\n preserveMode: options.preserveMode,\n preserveMtime: options.preserveMtime\n }, globSourceOptions);\n }\n}\nasync function* toGlobSource({path, type, prefix, mode, mtime, size, preserveMode, preserveMtime}, options) {\n options = options || {};\n const baseName = Path__default[\"default\"].basename(path);\n if (type === 'file') {\n yield {\n name: `/${ baseName.replace(prefix, '') }`,\n stream: () => fs__default[\"default\"].createReadStream(Path__default[\"default\"].isAbsolute(path) ? path : Path__default[\"default\"].join(process.cwd(), path)),\n mode,\n mtime,\n size\n };\n return;\n }\n const globOptions = Object.assign({}, options.glob, {\n cwd: path,\n nodir: false,\n realpath: false,\n absolute: true\n });\n for await (const p of glob__default[\"default\"](path, '**/*', globOptions)) {\n const stat = await fsStat(p);\n if (!stat.isFile()) {\n continue;\n }\n if (preserveMode || preserveMtime) {\n if (preserveMode) {\n mode = stat.mode;\n }\n if (preserveMtime) {\n mtime = stat.mtime;\n }\n }\n yield {\n name: toPosix(p.replace(prefix, '')),\n stream: () => fs__default[\"default\"].createReadStream(p),\n mode,\n mtime,\n size: stat.size\n };\n }\n}\nconst toPosix = path => path.replace(/\\\\/g, '/');\n\nexports.filesFromPath = filesFromPath;\nexports.getFilesFromPath = getFilesFromPath;\n","'use strict'\n\nmodule.exports = clone\n\nvar getPrototypeOf = Object.getPrototypeOf || function (obj) {\n return obj.__proto__\n}\n\nfunction clone (obj) {\n if (obj === null || typeof obj !== 'object')\n return obj\n\n if (obj instanceof Object)\n var copy = { __proto__: getPrototypeOf(obj) }\n else\n var copy = Object.create(null)\n\n Object.getOwnPropertyNames(obj).forEach(function (key) {\n Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))\n })\n\n return copy\n}\n","var fs = require('fs')\nvar polyfills = require('./polyfills.js')\nvar legacy = require('./legacy-streams.js')\nvar clone = require('./clone.js')\n\nvar util = require('util')\n\n/* istanbul ignore next - node 0.x polyfill */\nvar gracefulQueue\nvar previousSymbol\n\n/* istanbul ignore else - node 0.x polyfill */\nif (typeof Symbol === 'function' && typeof Symbol.for === 'function') {\n gracefulQueue = Symbol.for('graceful-fs.queue')\n // This is used in testing by future versions\n previousSymbol = Symbol.for('graceful-fs.previous')\n} else {\n gracefulQueue = '___graceful-fs.queue'\n previousSymbol = '___graceful-fs.previous'\n}\n\nfunction noop () {}\n\nfunction publishQueue(context, queue) {\n Object.defineProperty(context, gracefulQueue, {\n get: function() {\n return queue\n }\n })\n}\n\nvar debug = noop\nif (util.debuglog)\n debug = util.debuglog('gfs4')\nelse if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || ''))\n debug = function() {\n var m = util.format.apply(util, arguments)\n m = 'GFS4: ' + m.split(/\\n/).join('\\nGFS4: ')\n console.error(m)\n }\n\n// Once time initialization\nif (!fs[gracefulQueue]) {\n // This queue can be shared by multiple loaded instances\n var queue = global[gracefulQueue] || []\n publishQueue(fs, queue)\n\n // Patch fs.close/closeSync to shared queue version, because we need\n // to retry() whenever a close happens *anywhere* in the program.\n // This is essential when multiple graceful-fs instances are\n // in play at the same time.\n fs.close = (function (fs$close) {\n function close (fd, cb) {\n return fs$close.call(fs, fd, function (err) {\n // This function uses the graceful-fs shared queue\n if (!err) {\n resetQueue()\n }\n\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n })\n }\n\n Object.defineProperty(close, previousSymbol, {\n value: fs$close\n })\n return close\n })(fs.close)\n\n fs.closeSync = (function (fs$closeSync) {\n function closeSync (fd) {\n // This function uses the graceful-fs shared queue\n fs$closeSync.apply(fs, arguments)\n resetQueue()\n }\n\n Object.defineProperty(closeSync, previousSymbol, {\n value: fs$closeSync\n })\n return closeSync\n })(fs.closeSync)\n\n if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || '')) {\n process.on('exit', function() {\n debug(fs[gracefulQueue])\n require('assert').equal(fs[gracefulQueue].length, 0)\n })\n }\n}\n\nif (!global[gracefulQueue]) {\n publishQueue(global, fs[gracefulQueue]);\n}\n\nmodule.exports = patch(clone(fs))\nif (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {\n module.exports = patch(fs)\n fs.__patched = true;\n}\n\nfunction patch (fs) {\n // Everything that references the open() function needs to be in here\n polyfills(fs)\n fs.gracefulify = patch\n\n fs.createReadStream = createReadStream\n fs.createWriteStream = createWriteStream\n var fs$readFile = fs.readFile\n fs.readFile = readFile\n function readFile (path, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$readFile(path, options, cb)\n\n function go$readFile (path, options, cb, startTime) {\n return fs$readFile(path, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$writeFile = fs.writeFile\n fs.writeFile = writeFile\n function writeFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$writeFile(path, data, options, cb)\n\n function go$writeFile (path, data, options, cb, startTime) {\n return fs$writeFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$appendFile = fs.appendFile\n if (fs$appendFile)\n fs.appendFile = appendFile\n function appendFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$appendFile(path, data, options, cb)\n\n function go$appendFile (path, data, options, cb, startTime) {\n return fs$appendFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$copyFile = fs.copyFile\n if (fs$copyFile)\n fs.copyFile = copyFile\n function copyFile (src, dest, flags, cb) {\n if (typeof flags === 'function') {\n cb = flags\n flags = 0\n }\n return go$copyFile(src, dest, flags, cb)\n\n function go$copyFile (src, dest, flags, cb, startTime) {\n return fs$copyFile(src, dest, flags, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$readdir = fs.readdir\n fs.readdir = readdir\n var noReaddirOptionVersions = /^v[0-5]\\./\n function readdir (path, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n var go$readdir = noReaddirOptionVersions.test(process.version)\n ? function go$readdir (path, options, cb, startTime) {\n return fs$readdir(path, fs$readdirCallback(\n path, options, cb, startTime\n ))\n }\n : function go$readdir (path, options, cb, startTime) {\n return fs$readdir(path, options, fs$readdirCallback(\n path, options, cb, startTime\n ))\n }\n\n return go$readdir(path, options, cb)\n\n function fs$readdirCallback (path, options, cb, startTime) {\n return function (err, files) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([\n go$readdir,\n [path, options, cb],\n err,\n startTime || Date.now(),\n Date.now()\n ])\n else {\n if (files && files.sort)\n files.sort()\n\n if (typeof cb === 'function')\n cb.call(this, err, files)\n }\n }\n }\n }\n\n if (process.version.substr(0, 4) === 'v0.8') {\n var legStreams = legacy(fs)\n ReadStream = legStreams.ReadStream\n WriteStream = legStreams.WriteStream\n }\n\n var fs$ReadStream = fs.ReadStream\n if (fs$ReadStream) {\n ReadStream.prototype = Object.create(fs$ReadStream.prototype)\n ReadStream.prototype.open = ReadStream$open\n }\n\n var fs$WriteStream = fs.WriteStream\n if (fs$WriteStream) {\n WriteStream.prototype = Object.create(fs$WriteStream.prototype)\n WriteStream.prototype.open = WriteStream$open\n }\n\n Object.defineProperty(fs, 'ReadStream', {\n get: function () {\n return ReadStream\n },\n set: function (val) {\n ReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n Object.defineProperty(fs, 'WriteStream', {\n get: function () {\n return WriteStream\n },\n set: function (val) {\n WriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n // legacy names\n var FileReadStream = ReadStream\n Object.defineProperty(fs, 'FileReadStream', {\n get: function () {\n return FileReadStream\n },\n set: function (val) {\n FileReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n var FileWriteStream = WriteStream\n Object.defineProperty(fs, 'FileWriteStream', {\n get: function () {\n return FileWriteStream\n },\n set: function (val) {\n FileWriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n function ReadStream (path, options) {\n if (this instanceof ReadStream)\n return fs$ReadStream.apply(this, arguments), this\n else\n return ReadStream.apply(Object.create(ReadStream.prototype), arguments)\n }\n\n function ReadStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n if (that.autoClose)\n that.destroy()\n\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n that.read()\n }\n })\n }\n\n function WriteStream (path, options) {\n if (this instanceof WriteStream)\n return fs$WriteStream.apply(this, arguments), this\n else\n return WriteStream.apply(Object.create(WriteStream.prototype), arguments)\n }\n\n function WriteStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n that.destroy()\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n }\n })\n }\n\n function createReadStream (path, options) {\n return new fs.ReadStream(path, options)\n }\n\n function createWriteStream (path, options) {\n return new fs.WriteStream(path, options)\n }\n\n var fs$open = fs.open\n fs.open = open\n function open (path, flags, mode, cb) {\n if (typeof mode === 'function')\n cb = mode, mode = null\n\n return go$open(path, flags, mode, cb)\n\n function go$open (path, flags, mode, cb, startTime) {\n return fs$open(path, flags, mode, function (err, fd) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n return fs\n}\n\nfunction enqueue (elem) {\n debug('ENQUEUE', elem[0].name, elem[1])\n fs[gracefulQueue].push(elem)\n retry()\n}\n\n// keep track of the timeout between retry() calls\nvar retryTimer\n\n// reset the startTime and lastTime to now\n// this resets the start of the 60 second overall timeout as well as the\n// delay between attempts so that we'll retry these jobs sooner\nfunction resetQueue () {\n var now = Date.now()\n for (var i = 0; i < fs[gracefulQueue].length; ++i) {\n // entries that are only a length of 2 are from an older version, don't\n // bother modifying those since they'll be retried anyway.\n if (fs[gracefulQueue][i].length > 2) {\n fs[gracefulQueue][i][3] = now // startTime\n fs[gracefulQueue][i][4] = now // lastTime\n }\n }\n // call retry to make sure we're actively processing the queue\n retry()\n}\n\nfunction retry () {\n // clear the timer and remove it to help prevent unintended concurrency\n clearTimeout(retryTimer)\n retryTimer = undefined\n\n if (fs[gracefulQueue].length === 0)\n return\n\n var elem = fs[gracefulQueue].shift()\n var fn = elem[0]\n var args = elem[1]\n // these items may be unset if they were added by an older graceful-fs\n var err = elem[2]\n var startTime = elem[3]\n var lastTime = elem[4]\n\n // if we don't have a startTime we have no way of knowing if we've waited\n // long enough, so go ahead and retry this item now\n if (startTime === undefined) {\n debug('RETRY', fn.name, args)\n fn.apply(null, args)\n } else if (Date.now() - startTime >= 60000) {\n // it's been more than 60 seconds total, bail now\n debug('TIMEOUT', fn.name, args)\n var cb = args.pop()\n if (typeof cb === 'function')\n cb.call(null, err)\n } else {\n // the amount of time between the last attempt and right now\n var sinceAttempt = Date.now() - lastTime\n // the amount of time between when we first tried, and when we last tried\n // rounded up to at least 1\n var sinceStart = Math.max(lastTime - startTime, 1)\n // backoff. wait longer than the total time we've been retrying, but only\n // up to a maximum of 100ms\n var desiredDelay = Math.min(sinceStart * 1.2, 100)\n // it's been long enough since the last retry, do it again\n if (sinceAttempt >= desiredDelay) {\n debug('RETRY', fn.name, args)\n fn.apply(null, args.concat([startTime]))\n } else {\n // if we can't do this job yet, push it to the end of the queue\n // and let the next iteration check again\n fs[gracefulQueue].push(elem)\n }\n }\n\n // schedule our next run if one isn't already scheduled\n if (retryTimer === undefined) {\n retryTimer = setTimeout(retry, 0)\n }\n}\n","var Stream = require('stream').Stream\n\nmodule.exports = legacy\n\nfunction legacy (fs) {\n return {\n ReadStream: ReadStream,\n WriteStream: WriteStream\n }\n\n function ReadStream (path, options) {\n if (!(this instanceof ReadStream)) return new ReadStream(path, options);\n\n Stream.call(this);\n\n var self = this;\n\n this.path = path;\n this.fd = null;\n this.readable = true;\n this.paused = false;\n\n this.flags = 'r';\n this.mode = 438; /*=0666*/\n this.bufferSize = 64 * 1024;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.encoding) this.setEncoding(this.encoding);\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.end === undefined) {\n this.end = Infinity;\n } else if ('number' !== typeof this.end) {\n throw TypeError('end must be a Number');\n }\n\n if (this.start > this.end) {\n throw new Error('start must be <= end');\n }\n\n this.pos = this.start;\n }\n\n if (this.fd !== null) {\n process.nextTick(function() {\n self._read();\n });\n return;\n }\n\n fs.open(this.path, this.flags, this.mode, function (err, fd) {\n if (err) {\n self.emit('error', err);\n self.readable = false;\n return;\n }\n\n self.fd = fd;\n self.emit('open', fd);\n self._read();\n })\n }\n\n function WriteStream (path, options) {\n if (!(this instanceof WriteStream)) return new WriteStream(path, options);\n\n Stream.call(this);\n\n this.path = path;\n this.fd = null;\n this.writable = true;\n\n this.flags = 'w';\n this.encoding = 'binary';\n this.mode = 438; /*=0666*/\n this.bytesWritten = 0;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.start < 0) {\n throw new Error('start must be >= zero');\n }\n\n this.pos = this.start;\n }\n\n this.busy = false;\n this._queue = [];\n\n if (this.fd === null) {\n this._open = fs.open;\n this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);\n this.flush();\n }\n }\n}\n","var constants = require('constants')\n\nvar origCwd = process.cwd\nvar cwd = null\n\nvar platform = process.env.GRACEFUL_FS_PLATFORM || process.platform\n\nprocess.cwd = function() {\n if (!cwd)\n cwd = origCwd.call(process)\n return cwd\n}\ntry {\n process.cwd()\n} catch (er) {}\n\n// This check is needed until node.js 12 is required\nif (typeof process.chdir === 'function') {\n var chdir = process.chdir\n process.chdir = function (d) {\n cwd = null\n chdir.call(process, d)\n }\n if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir)\n}\n\nmodule.exports = patch\n\nfunction patch (fs) {\n // (re-)implement some things that are known busted or missing.\n\n // lchmod, broken prior to 0.6.2\n // back-port the fix here.\n if (constants.hasOwnProperty('O_SYMLINK') &&\n process.version.match(/^v0\\.6\\.[0-2]|^v0\\.5\\./)) {\n patchLchmod(fs)\n }\n\n // lutimes implementation, or no-op\n if (!fs.lutimes) {\n patchLutimes(fs)\n }\n\n // https://github.com/isaacs/node-graceful-fs/issues/4\n // Chown should not fail on einval or eperm if non-root.\n // It should not fail on enosys ever, as this just indicates\n // that a fs doesn't support the intended operation.\n\n fs.chown = chownFix(fs.chown)\n fs.fchown = chownFix(fs.fchown)\n fs.lchown = chownFix(fs.lchown)\n\n fs.chmod = chmodFix(fs.chmod)\n fs.fchmod = chmodFix(fs.fchmod)\n fs.lchmod = chmodFix(fs.lchmod)\n\n fs.chownSync = chownFixSync(fs.chownSync)\n fs.fchownSync = chownFixSync(fs.fchownSync)\n fs.lchownSync = chownFixSync(fs.lchownSync)\n\n fs.chmodSync = chmodFixSync(fs.chmodSync)\n fs.fchmodSync = chmodFixSync(fs.fchmodSync)\n fs.lchmodSync = chmodFixSync(fs.lchmodSync)\n\n fs.stat = statFix(fs.stat)\n fs.fstat = statFix(fs.fstat)\n fs.lstat = statFix(fs.lstat)\n\n fs.statSync = statFixSync(fs.statSync)\n fs.fstatSync = statFixSync(fs.fstatSync)\n fs.lstatSync = statFixSync(fs.lstatSync)\n\n // if lchmod/lchown do not exist, then make them no-ops\n if (fs.chmod && !fs.lchmod) {\n fs.lchmod = function (path, mode, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchmodSync = function () {}\n }\n if (fs.chown && !fs.lchown) {\n fs.lchown = function (path, uid, gid, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchownSync = function () {}\n }\n\n // on Windows, A/V software can lock the directory, causing this\n // to fail with an EACCES or EPERM if the directory contains newly\n // created files. Try again on failure, for up to 60 seconds.\n\n // Set the timeout this long because some Windows Anti-Virus, such as Parity\n // bit9, may lock files for up to a minute, causing npm package install\n // failures. Also, take care to yield the scheduler. Windows scheduling gives\n // CPU to a busy looping process, which can cause the program causing the lock\n // contention to be starved of CPU by node, so the contention doesn't resolve.\n if (platform === \"win32\") {\n fs.rename = typeof fs.rename !== 'function' ? fs.rename\n : (function (fs$rename) {\n function rename (from, to, cb) {\n var start = Date.now()\n var backoff = 0;\n fs$rename(from, to, function CB (er) {\n if (er\n && (er.code === \"EACCES\" || er.code === \"EPERM\")\n && Date.now() - start < 60000) {\n setTimeout(function() {\n fs.stat(to, function (stater, st) {\n if (stater && stater.code === \"ENOENT\")\n fs$rename(from, to, CB);\n else\n cb(er)\n })\n }, backoff)\n if (backoff < 100)\n backoff += 10;\n return;\n }\n if (cb) cb(er)\n })\n }\n if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename)\n return rename\n })(fs.rename)\n }\n\n // if read() returns EAGAIN, then just try it again.\n fs.read = typeof fs.read !== 'function' ? fs.read\n : (function (fs$read) {\n function read (fd, buffer, offset, length, position, callback_) {\n var callback\n if (callback_ && typeof callback_ === 'function') {\n var eagCounter = 0\n callback = function (er, _, __) {\n if (er && er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n callback_.apply(this, arguments)\n }\n }\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n\n // This ensures `util.promisify` works as it does for native `fs.read`.\n if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read)\n return read\n })(fs.read)\n\n fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync\n : (function (fs$readSync) { return function (fd, buffer, offset, length, position) {\n var eagCounter = 0\n while (true) {\n try {\n return fs$readSync.call(fs, fd, buffer, offset, length, position)\n } catch (er) {\n if (er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n continue\n }\n throw er\n }\n }\n }})(fs.readSync)\n\n function patchLchmod (fs) {\n fs.lchmod = function (path, mode, callback) {\n fs.open( path\n , constants.O_WRONLY | constants.O_SYMLINK\n , mode\n , function (err, fd) {\n if (err) {\n if (callback) callback(err)\n return\n }\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n fs.fchmod(fd, mode, function (err) {\n fs.close(fd, function(err2) {\n if (callback) callback(err || err2)\n })\n })\n })\n }\n\n fs.lchmodSync = function (path, mode) {\n var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)\n\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n var threw = true\n var ret\n try {\n ret = fs.fchmodSync(fd, mode)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n }\n\n function patchLutimes (fs) {\n if (constants.hasOwnProperty(\"O_SYMLINK\") && fs.futimes) {\n fs.lutimes = function (path, at, mt, cb) {\n fs.open(path, constants.O_SYMLINK, function (er, fd) {\n if (er) {\n if (cb) cb(er)\n return\n }\n fs.futimes(fd, at, mt, function (er) {\n fs.close(fd, function (er2) {\n if (cb) cb(er || er2)\n })\n })\n })\n }\n\n fs.lutimesSync = function (path, at, mt) {\n var fd = fs.openSync(path, constants.O_SYMLINK)\n var ret\n var threw = true\n try {\n ret = fs.futimesSync(fd, at, mt)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n\n } else if (fs.futimes) {\n fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }\n fs.lutimesSync = function () {}\n }\n }\n\n function chmodFix (orig) {\n if (!orig) return orig\n return function (target, mode, cb) {\n return orig.call(fs, target, mode, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chmodFixSync (orig) {\n if (!orig) return orig\n return function (target, mode) {\n try {\n return orig.call(fs, target, mode)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n\n function chownFix (orig) {\n if (!orig) return orig\n return function (target, uid, gid, cb) {\n return orig.call(fs, target, uid, gid, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chownFixSync (orig) {\n if (!orig) return orig\n return function (target, uid, gid) {\n try {\n return orig.call(fs, target, uid, gid)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n function statFix (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = null\n }\n function callback (er, stats) {\n if (stats) {\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n }\n if (cb) cb.apply(this, arguments)\n }\n return options ? orig.call(fs, target, options, callback)\n : orig.call(fs, target, callback)\n }\n }\n\n function statFixSync (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options) {\n var stats = options ? orig.call(fs, target, options)\n : orig.call(fs, target)\n if (stats) {\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n }\n return stats;\n }\n }\n\n // ENOSYS means that the fs doesn't support the op. Just ignore\n // that, because it doesn't matter.\n //\n // if there's no getuid, or if getuid() is something other\n // than 0, and the error is EINVAL or EPERM, then just ignore\n // it.\n //\n // This specific case is a silent failure in cp, install, tar,\n // and most other unix tools that manage permissions.\n //\n // When running as root, or if other types of errors are\n // encountered, then it's strict.\n function chownErOk (er) {\n if (!er)\n return true\n\n if (er.code === \"ENOSYS\")\n return true\n\n var nonroot = !process.getuid || process.getuid() !== 0\n if (nonroot) {\n if (er.code === \"EINVAL\" || er.code === \"EPERM\")\n return true\n }\n\n return false\n }\n}\n","'use strict'\n\n// @ts-ignore\nconst SparseArray = require('sparse-array')\nconst { fromString: uint8ArrayFromString } = require('uint8arrays/from-string')\n\n/**\n * @typedef {import('./consumable-hash').InfiniteHash} InfiniteHash\n * @typedef {import('../').UserBucketOptions} UserBucketOptions\n */\n\n/**\n * @template V\n * @typedef {object} BucketChild\n * @property {string} key\n * @property {V} value\n * @property {InfiniteHash} hash\n */\n\n/**\n * @template B\n *\n * @typedef {object} SA\n * @property {number} length\n * @property {() => B[]} compactArray\n * @property {(i: number) => B} get\n * @property {(i: number, value: B) => void} set\n * @property {
(fn: (acc: A, curr: B, index: number) => A, initial: A) => B} reduce\n * @property {(fn: (item: B) => boolean) => B | undefined} find\n * @property {() => number[]} bitField\n * @property {(i: number) => void} unset\n */\n\n/**\n * @template T\n *\n * @typedef {object} BucketPosition\n * @property {Bucket} bucket\n * @property {number} pos\n * @property {InfiniteHash} hash\n * @property {BucketChild} [existingChild]\n */\n\n/**\n * @typedef {object} BucketOptions\n * @property {number} bits\n * @property {(value: Uint8Array | InfiniteHash) => InfiniteHash} hash\n */\n\n/**\n * @template T\n */\nclass Bucket {\n /**\n * @param {BucketOptions} options\n * @param {Bucket} [parent]\n * @param {number} [posAtParent=0]\n */\n constructor (options, parent, posAtParent = 0) {\n this._options = options\n this._popCount = 0\n this._parent = parent\n this._posAtParent = posAtParent\n\n /** @type {SA | BucketChild>} */\n this._children = new SparseArray()\n\n /** @type {string | null} */\n this.key = null\n }\n\n /**\n * @param {string} key\n * @param {T} value\n */\n async put (key, value) {\n const place = await this._findNewBucketAndPos(key)\n\n await place.bucket._putAt(place, key, value)\n }\n\n /**\n * @param {string} key\n */\n async get (key) {\n const child = await this._findChild(key)\n\n if (child) {\n return child.value\n }\n }\n\n /**\n * @param {string} key\n */\n async del (key) {\n const place = await this._findPlace(key)\n const child = place.bucket._at(place.pos)\n\n if (child && child.key === key) {\n place.bucket._delAt(place.pos)\n }\n }\n\n /**\n * @returns {number}\n */\n leafCount () {\n const children = this._children.compactArray()\n\n return children.reduce((acc, child) => {\n if (child instanceof Bucket) {\n return acc + child.leafCount()\n }\n\n return acc + 1\n }, 0)\n }\n\n childrenCount () {\n return this._children.length\n }\n\n onlyChild () {\n return this._children.get(0)\n }\n\n /**\n * @returns {Iterable>}\n */\n * eachLeafSeries () {\n const children = this._children.compactArray()\n\n for (const child of children) {\n if (child instanceof Bucket) {\n yield * child.eachLeafSeries()\n } else {\n yield child\n }\n }\n\n // this is necessary because tsc requires a @return annotation as it\n // can't derive a return type due to the recursion, and eslint requires\n // a return statement when there is a @return annotation\n return []\n }\n\n /**\n * @param {(value: BucketChild, index: number) => T} map\n * @param {(reduced: any) => any} reduce\n */\n serialize (map, reduce) {\n /** @type {T[]} */\n const acc = []\n // serialize to a custom non-sparse representation\n return reduce(this._children.reduce((acc, child, index) => {\n if (child) {\n if (child instanceof Bucket) {\n acc.push(child.serialize(map, reduce))\n } else {\n acc.push(map(child, index))\n }\n }\n return acc\n }, acc))\n }\n\n /**\n * @param {(value: BucketChild) => Promise} asyncMap\n * @param {(reduced: any) => Promise} asyncReduce\n */\n asyncTransform (asyncMap, asyncReduce) {\n return asyncTransformBucket(this, asyncMap, asyncReduce)\n }\n\n toJSON () {\n return this.serialize(mapNode, reduceNodes)\n }\n\n prettyPrint () {\n return JSON.stringify(this.toJSON(), null, ' ')\n }\n\n tableSize () {\n return Math.pow(2, this._options.bits)\n }\n\n /**\n * @param {string} key\n * @returns {Promise | undefined>}\n */\n async _findChild (key) {\n const result = await this._findPlace(key)\n const child = result.bucket._at(result.pos)\n\n if (child instanceof Bucket) {\n // should not be possible, this._findPlace should always\n // return a location for a child, not a bucket\n return undefined\n }\n\n if (child && child.key === key) {\n return child\n }\n }\n\n /**\n * @param {string | InfiniteHash} key\n * @returns {Promise>}\n */\n async _findPlace (key) {\n const hashValue = this._options.hash(typeof key === 'string' ? uint8ArrayFromString(key) : key)\n const index = await hashValue.take(this._options.bits)\n\n const child = this._children.get(index)\n\n if (child instanceof Bucket) {\n return child._findPlace(hashValue)\n }\n\n return {\n bucket: this,\n pos: index,\n hash: hashValue,\n existingChild: child\n }\n }\n\n /**\n * @param {string | InfiniteHash} key\n * @returns {Promise>}\n */\n async _findNewBucketAndPos (key) {\n const place = await this._findPlace(key)\n\n if (place.existingChild && place.existingChild.key !== key) {\n // conflict\n const bucket = new Bucket(this._options, place.bucket, place.pos)\n place.bucket._putObjectAt(place.pos, bucket)\n\n // put the previous value\n const newPlace = await bucket._findPlace(place.existingChild.hash)\n newPlace.bucket._putAt(newPlace, place.existingChild.key, place.existingChild.value)\n\n return bucket._findNewBucketAndPos(place.hash)\n }\n\n // no conflict, we found the place\n return place\n }\n\n /**\n * @param {BucketPosition} place\n * @param {string} key\n * @param {T} value\n */\n _putAt (place, key, value) {\n this._putObjectAt(place.pos, {\n key: key,\n value: value,\n hash: place.hash\n })\n }\n\n /**\n * @param {number} pos\n * @param {Bucket | BucketChild} object\n */\n _putObjectAt (pos, object) {\n if (!this._children.get(pos)) {\n this._popCount++\n }\n this._children.set(pos, object)\n }\n\n /**\n * @param {number} pos\n */\n _delAt (pos) {\n if (pos === -1) {\n throw new Error('Invalid position')\n }\n\n if (this._children.get(pos)) {\n this._popCount--\n }\n this._children.unset(pos)\n this._level()\n }\n\n _level () {\n if (this._parent && this._popCount <= 1) {\n if (this._popCount === 1) {\n // remove myself from parent, replacing me with my only child\n const onlyChild = this._children.find(exists)\n\n if (onlyChild && !(onlyChild instanceof Bucket)) {\n const hash = onlyChild.hash\n hash.untake(this._options.bits)\n const place = {\n pos: this._posAtParent,\n hash: hash,\n bucket: this._parent\n }\n this._parent._putAt(place, onlyChild.key, onlyChild.value)\n }\n } else {\n this._parent._delAt(this._posAtParent)\n }\n }\n }\n\n /**\n * @param {number} index\n * @returns {BucketChild | Bucket | undefined}\n */\n _at (index) {\n return this._children.get(index)\n }\n}\n\n/**\n * @param {any} o\n */\nfunction exists (o) {\n return Boolean(o)\n}\n\n/**\n *\n * @param {*} node\n * @param {number} index\n */\nfunction mapNode (node, index) {\n return node.key\n}\n\n/**\n * @param {*} nodes\n */\nfunction reduceNodes (nodes) {\n return nodes\n}\n\n/**\n * @template T\n *\n * @param {Bucket} bucket\n * @param {(value: BucketChild) => Promise} asyncMap\n * @param {(reduced: any) => Promise} asyncReduce\n */\nasync function asyncTransformBucket (bucket, asyncMap, asyncReduce) {\n const output = []\n\n for (const child of bucket._children.compactArray()) {\n if (child instanceof Bucket) {\n await asyncTransformBucket(child, asyncMap, asyncReduce)\n } else {\n const mappedChildren = await asyncMap(child)\n\n output.push({\n bitField: bucket._children.bitField(),\n children: mappedChildren\n })\n }\n }\n\n return asyncReduce(output)\n}\n\nmodule.exports = Bucket\n","'use strict'\n\nconst START_MASKS = [\n 0b11111111,\n 0b11111110,\n 0b11111100,\n 0b11111000,\n 0b11110000,\n 0b11100000,\n 0b11000000,\n 0b10000000\n]\n\nconst STOP_MASKS = [\n 0b00000001,\n 0b00000011,\n 0b00000111,\n 0b00001111,\n 0b00011111,\n 0b00111111,\n 0b01111111,\n 0b11111111\n]\n\nmodule.exports = class ConsumableBuffer {\n /**\n * @param {Uint8Array} value\n */\n constructor (value) {\n this._value = value\n this._currentBytePos = value.length - 1\n this._currentBitPos = 7\n }\n\n availableBits () {\n return this._currentBitPos + 1 + this._currentBytePos * 8\n }\n\n totalBits () {\n return this._value.length * 8\n }\n\n /**\n * @param {number} bits\n */\n take (bits) {\n let pendingBits = bits\n let result = 0\n while (pendingBits && this._haveBits()) {\n const byte = this._value[this._currentBytePos]\n const availableBits = this._currentBitPos + 1\n const taking = Math.min(availableBits, pendingBits)\n const value = byteBitsToInt(byte, availableBits - taking, taking)\n result = (result << taking) + value\n\n pendingBits -= taking\n\n this._currentBitPos -= taking\n if (this._currentBitPos < 0) {\n this._currentBitPos = 7\n this._currentBytePos--\n }\n }\n\n return result\n }\n\n /**\n * @param {number} bits\n */\n untake (bits) {\n this._currentBitPos += bits\n while (this._currentBitPos > 7) {\n this._currentBitPos -= 8\n this._currentBytePos += 1\n }\n }\n\n _haveBits () {\n return this._currentBytePos >= 0\n }\n}\n\n/**\n * @param {number} byte\n * @param {number} start\n * @param {number} length\n */\nfunction byteBitsToInt (byte, start, length) {\n const mask = maskFor(start, length)\n return (byte & mask) >>> start\n}\n\n/**\n * @param {number} start\n * @param {number} length\n */\nfunction maskFor (start, length) {\n return START_MASKS[start] & STOP_MASKS[Math.min(length + start - 1, 7)]\n}\n","'use strict'\n\nconst ConsumableBuffer = require('./consumable-buffer')\nconst { concat: uint8ArrayConcat } = require('uint8arrays/concat')\n\n/**\n * @param {(value: Uint8Array) => Promise} hashFn\n */\nfunction wrapHash (hashFn) {\n /**\n * @param {InfiniteHash | Uint8Array} value\n */\n function hashing (value) {\n if (value instanceof InfiniteHash) {\n // already a hash. return it\n return value\n } else {\n return new InfiniteHash(value, hashFn)\n }\n }\n\n return hashing\n}\n\nclass InfiniteHash {\n /**\n *\n * @param {Uint8Array} value\n * @param {(value: Uint8Array) => Promise} hashFn\n */\n constructor (value, hashFn) {\n if (!(value instanceof Uint8Array)) {\n throw new Error('can only hash Uint8Arrays')\n }\n\n this._value = value\n this._hashFn = hashFn\n this._depth = -1\n this._availableBits = 0\n this._currentBufferIndex = 0\n\n /** @type {ConsumableBuffer[]} */\n this._buffers = []\n }\n\n /**\n * @param {number} bits\n */\n async take (bits) {\n let pendingBits = bits\n\n while (this._availableBits < pendingBits) {\n await this._produceMoreBits()\n }\n\n let result = 0\n\n while (pendingBits > 0) {\n const hash = this._buffers[this._currentBufferIndex]\n const available = Math.min(hash.availableBits(), pendingBits)\n const took = hash.take(available)\n result = (result << available) + took\n pendingBits -= available\n this._availableBits -= available\n\n if (hash.availableBits() === 0) {\n this._currentBufferIndex++\n }\n }\n\n return result\n }\n\n /**\n * @param {number} bits\n */\n untake (bits) {\n let pendingBits = bits\n\n while (pendingBits > 0) {\n const hash = this._buffers[this._currentBufferIndex]\n const availableForUntake = Math.min(hash.totalBits() - hash.availableBits(), pendingBits)\n hash.untake(availableForUntake)\n pendingBits -= availableForUntake\n this._availableBits += availableForUntake\n\n if (this._currentBufferIndex > 0 && hash.totalBits() === hash.availableBits()) {\n this._depth--\n this._currentBufferIndex--\n }\n }\n }\n\n async _produceMoreBits () {\n this._depth++\n\n const value = this._depth ? uint8ArrayConcat([this._value, Uint8Array.from([this._depth])]) : this._value\n const hashValue = await this._hashFn(value)\n const buffer = new ConsumableBuffer(hashValue)\n\n this._buffers.push(buffer)\n this._availableBits += buffer.availableBits()\n }\n}\n\nmodule.exports = wrapHash\nmodule.exports.InfiniteHash = InfiniteHash\n","'use strict'\n\nconst Bucket = require('./bucket')\nconst wrapHash = require('./consumable-hash')\n\n/**\n * @typedef {object} UserBucketOptions\n * @property {(value: Uint8Array) => Promise} hashFn\n * @property {number} [bits=8]\n */\n\n/**\n * @param {UserBucketOptions} options\n */\nfunction createHAMT (options) {\n if (!options || !options.hashFn) {\n throw new Error('please define an options.hashFn')\n }\n\n const bucketOptions = {\n bits: options.bits || 8,\n hash: wrapHash(options.hashFn)\n }\n\n return new Bucket(bucketOptions)\n}\n\nmodule.exports = {\n createHAMT,\n Bucket\n}\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FsBlockStore = void 0;\nconst fs_1 = __importDefault(require(\"fs\"));\nconst os_1 = __importDefault(require(\"os\"));\nconst multiformats_1 = require(\"multiformats\");\nconst blockstore_core_1 = require(\"blockstore-core\");\nclass FsBlockStore extends blockstore_core_1.BaseBlockstore {\n constructor() {\n super();\n this.path = `${os_1.default.tmpdir()}/${(parseInt(String(Math.random() * 1e9), 10)).toString() + Date.now()}`;\n this._opened = false;\n }\n async _open() {\n if (this._opening) {\n await this._opening;\n }\n else {\n this._opening = fs_1.default.promises.mkdir(this.path);\n await this._opening;\n this._opened = true;\n }\n }\n async put(cid, bytes) {\n if (!this._opened) {\n await this._open();\n }\n const cidStr = cid.toString();\n const location = `${this.path}/${cidStr}`;\n await fs_1.default.promises.writeFile(location, bytes);\n }\n async get(cid) {\n if (!this._opened) {\n await this._open();\n }\n const cidStr = cid.toString();\n const location = `${this.path}/${cidStr}`;\n const bytes = await fs_1.default.promises.readFile(location);\n return bytes;\n }\n async has(cid) {\n if (!this._opened) {\n await this._open();\n }\n const cidStr = cid.toString();\n const location = `${this.path}/${cidStr}`;\n try {\n await fs_1.default.promises.access(location);\n return true;\n }\n catch (err) {\n return false;\n }\n }\n async *blocks() {\n if (!this._opened) {\n await this._open();\n }\n const cids = await fs_1.default.promises.readdir(this.path);\n for (const cidStr of cids) {\n const location = `${this.path}/${cidStr}`;\n const bytes = await fs_1.default.promises.readFile(location);\n yield { cid: multiformats_1.CID.parse(cidStr), bytes };\n }\n }\n async close() {\n if (this._opened) {\n await fs_1.default.promises.rm(this.path, { recursive: true });\n }\n this._opened = false;\n }\n}\nexports.FsBlockStore = FsBlockStore;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MemoryBlockStore = void 0;\nconst multiformats_1 = require(\"multiformats\");\nconst blockstore_core_1 = require(\"blockstore-core\");\nclass MemoryBlockStore extends blockstore_core_1.BaseBlockstore {\n constructor() {\n super();\n this.store = new Map();\n }\n async *blocks() {\n for (const [cidStr, bytes] of this.store.entries()) {\n yield { cid: multiformats_1.CID.parse(cidStr), bytes };\n }\n }\n put(cid, bytes) {\n this.store.set(cid.toString(), bytes);\n return Promise.resolve();\n }\n get(cid) {\n const bytes = this.store.get(cid.toString());\n if (!bytes) {\n throw new Error(`block with cid ${cid.toString()} no found`);\n }\n return Promise.resolve(bytes);\n }\n has(cid) {\n return Promise.resolve(this.store.has(cid.toString()));\n }\n close() {\n this.store.clear();\n return Promise.resolve();\n }\n}\nexports.MemoryBlockStore = MemoryBlockStore;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unixfsImporterOptionsDefault = void 0;\nconst sha2_1 = require(\"multiformats/hashes/sha2\");\nexports.unixfsImporterOptionsDefault = {\n cidVersion: 1,\n chunker: 'fixed',\n maxChunkSize: 262144,\n hasher: sha2_1.sha256,\n rawLeaves: true,\n wrapWithDirectory: true,\n maxChildrenPerNode: 174\n};\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.pack = void 0;\nconst it_last_1 = __importDefault(require(\"it-last\"));\nconst it_pipe_1 = __importDefault(require(\"it-pipe\"));\nconst car_1 = require(\"@ipld/car\");\nconst ipfs_unixfs_importer_1 = require(\"ipfs-unixfs-importer\");\nconst normalise_input_1 = require(\"./utils/normalise-input\");\nconst memory_1 = require(\"../blockstore/memory\");\nconst constants_1 = require(\"./constants\");\nasync function pack({ input, blockstore: userBlockstore, hasher, maxChunkSize, maxChildrenPerNode, wrapWithDirectory, rawLeaves }) {\n if (!input || (Array.isArray(input) && !input.length)) {\n throw new Error('missing input file(s)');\n }\n const blockstore = userBlockstore ? userBlockstore : new memory_1.MemoryBlockStore();\n // Consume the source\n const rootEntry = await (0, it_last_1.default)((0, it_pipe_1.default)((0, normalise_input_1.getNormaliser)(input), (source) => (0, ipfs_unixfs_importer_1.importer)(source, blockstore, {\n ...constants_1.unixfsImporterOptionsDefault,\n hasher: hasher || constants_1.unixfsImporterOptionsDefault.hasher,\n maxChunkSize: maxChunkSize || constants_1.unixfsImporterOptionsDefault.maxChunkSize,\n maxChildrenPerNode: maxChildrenPerNode || constants_1.unixfsImporterOptionsDefault.maxChildrenPerNode,\n wrapWithDirectory: wrapWithDirectory === false ? false : constants_1.unixfsImporterOptionsDefault.wrapWithDirectory,\n rawLeaves: rawLeaves == null ? constants_1.unixfsImporterOptionsDefault.rawLeaves : rawLeaves\n })));\n if (!rootEntry || !rootEntry.cid) {\n throw new Error('given input could not be parsed correctly');\n }\n const root = rootEntry.cid;\n const { writer, out: carOut } = await car_1.CarWriter.create([root]);\n const carOutIter = carOut[Symbol.asyncIterator]();\n let writingPromise;\n const writeAll = async () => {\n for await (const block of blockstore.blocks()) {\n // `await` will block until all bytes in `carOut` are consumed by the user\n // so we have backpressure here\n await writer.put(block);\n }\n await writer.close();\n if (!userBlockstore) {\n await blockstore.close();\n }\n };\n const out = {\n [Symbol.asyncIterator]() {\n if (writingPromise != null) {\n throw new Error('Multiple iterator not supported');\n }\n // don't start writing until the user starts consuming the iterator\n writingPromise = writeAll();\n return {\n async next() {\n const result = await carOutIter.next();\n if (result.done) {\n await writingPromise; // any errors will propagate from here\n }\n return result;\n }\n };\n }\n };\n return { root, out };\n}\nexports.pack = pack;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getNormaliser = void 0;\nconst normalise_input_single_1 = require(\"ipfs-core-utils/files/normalise-input-single\");\nconst normalise_input_multiple_1 = require(\"ipfs-core-utils/files/normalise-input-multiple\");\nfunction isBytes(obj) {\n return ArrayBuffer.isView(obj) || obj instanceof ArrayBuffer;\n}\nfunction isBlob(obj) {\n return Boolean(obj.constructor) &&\n (obj.constructor.name === 'Blob' || obj.constructor.name === 'File') &&\n typeof obj.stream === 'function';\n}\nfunction isSingle(input) {\n return typeof input === 'string' || input instanceof String || isBytes(input) || isBlob(input) || '_readableState' in input;\n}\n/**\n * Get a single or multiple normaliser depending on the input.\n */\nfunction getNormaliser(input) {\n if (isSingle(input)) {\n return (0, normalise_input_single_1.normaliseInput)(input);\n }\n else {\n return (0, normalise_input_multiple_1.normaliseInput)(input);\n }\n}\nexports.getNormaliser = getNormaliser;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unpackStream = exports.unpack = void 0;\nconst browser_readablestream_to_it_1 = __importDefault(require(\"browser-readablestream-to-it\"));\nconst iterator_1 = require(\"@ipld/car/iterator\");\nconst ipfs_unixfs_exporter_1 = require(\"ipfs-unixfs-exporter\");\nconst verifying_get_only_blockstore_1 = require(\"./utils/verifying-get-only-blockstore\");\nconst memory_1 = require(\"../blockstore/memory\");\n// Export unixfs entries from car file\nasync function* unpack(carReader, roots) {\n const verifyingBlockService = verifying_get_only_blockstore_1.VerifyingGetOnlyBlockStore.fromCarReader(carReader);\n if (!roots || roots.length === 0) {\n roots = await carReader.getRoots();\n }\n for (const root of roots) {\n yield* (0, ipfs_unixfs_exporter_1.recursive)(root, verifyingBlockService, { /* options */});\n }\n}\nexports.unpack = unpack;\nasync function* unpackStream(readable, { roots, blockstore: userBlockstore } = {}) {\n const carIterator = await iterator_1.CarBlockIterator.fromIterable(asAsyncIterable(readable));\n const blockstore = userBlockstore || new memory_1.MemoryBlockStore();\n for await (const block of carIterator) {\n await blockstore.put(block.cid, block.bytes);\n }\n const verifyingBlockStore = verifying_get_only_blockstore_1.VerifyingGetOnlyBlockStore.fromBlockstore(blockstore);\n if (!roots || roots.length === 0) {\n roots = await carIterator.getRoots();\n }\n for (const root of roots) {\n yield* (0, ipfs_unixfs_exporter_1.recursive)(root, verifyingBlockStore);\n }\n}\nexports.unpackStream = unpackStream;\n/**\n * Upgrade a ReadableStream to an AsyncIterable if it isn't already\n *\n * ReadableStream (e.g res.body) is asyncIterable in node, but not in chrome, yet.\n * see: https://bugs.chromium.org/p/chromium/issues/detail?id=929585\n */\nfunction asAsyncIterable(readable) {\n // @ts-ignore how to convince tsc that we are checking the type here?\n return Symbol.asyncIterator in readable ? readable : (0, browser_readablestream_to_it_1.default)(readable);\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VerifyingGetOnlyBlockStore = void 0;\nconst equals_1 = require(\"uint8arrays/equals\");\nconst sha2_1 = require(\"multiformats/hashes/sha2\");\nconst blockstore_core_1 = require(\"blockstore-core\");\nclass VerifyingGetOnlyBlockStore extends blockstore_core_1.BaseBlockstore {\n constructor(blockstore) {\n super();\n this.store = blockstore;\n }\n async get(cid) {\n const res = await this.store.get(cid);\n if (!res) {\n throw new Error(`Incomplete CAR. Block missing for CID ${cid}`);\n }\n if (!isValid({ cid, bytes: res })) {\n throw new Error(`Invalid CAR. Hash of block data does not match CID ${cid}`);\n }\n return res;\n }\n static fromBlockstore(b) {\n return new VerifyingGetOnlyBlockStore(b);\n }\n static fromCarReader(cr) {\n return new VerifyingGetOnlyBlockStore({\n // Return bytes in the same fashion as a Blockstore implementation\n get: async (cid) => {\n const block = await cr.get(cid);\n return block === null || block === void 0 ? void 0 : block.bytes;\n }\n });\n }\n}\nexports.VerifyingGetOnlyBlockStore = VerifyingGetOnlyBlockStore;\nasync function isValid({ cid, bytes }) {\n const hash = await sha2_1.sha256.digest(bytes);\n return (0, equals_1.equals)(hash.digest, cid.multihash.digest);\n}\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar errCode = require('err-code');\nvar browserStreamToIt = require('browser-readablestream-to-it');\nvar itPeekable = require('it-peekable');\nvar map = require('it-map');\nvar utils = require('./utils.js');\nvar ipfsUnixfs = require('ipfs-unixfs');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\nvar browserStreamToIt__default = /*#__PURE__*/_interopDefaultLegacy(browserStreamToIt);\nvar itPeekable__default = /*#__PURE__*/_interopDefaultLegacy(itPeekable);\nvar map__default = /*#__PURE__*/_interopDefaultLegacy(map);\n\nasync function* normaliseCandidateMultiple(input, normaliseContent) {\n if (typeof input === 'string' || input instanceof String || utils.isBytes(input) || utils.isBlob(input) || input._readableState) {\n throw errCode__default[\"default\"](new Error('Unexpected input: single item passed - if you are using ipfs.addAll, please use ipfs.add instead'), 'ERR_UNEXPECTED_INPUT');\n }\n if (utils.isReadableStream(input)) {\n input = browserStreamToIt__default[\"default\"](input);\n }\n if (Symbol.iterator in input || Symbol.asyncIterator in input) {\n const peekable = itPeekable__default[\"default\"](input);\n const {value, done} = await peekable.peek();\n if (done) {\n yield* [];\n return;\n }\n peekable.push(value);\n if (Number.isInteger(value)) {\n throw errCode__default[\"default\"](new Error('Unexpected input: single item passed - if you are using ipfs.addAll, please use ipfs.add instead'), 'ERR_UNEXPECTED_INPUT');\n }\n if (value._readableState) {\n yield* map__default[\"default\"](peekable, value => toFileObject({ content: value }, normaliseContent));\n return;\n }\n if (utils.isBytes(value)) {\n yield toFileObject({ content: peekable }, normaliseContent);\n return;\n }\n if (utils.isFileObject(value) || value[Symbol.iterator] || value[Symbol.asyncIterator] || utils.isReadableStream(value) || utils.isBlob(value)) {\n yield* map__default[\"default\"](peekable, value => toFileObject(value, normaliseContent));\n return;\n }\n }\n if (utils.isFileObject(input)) {\n throw errCode__default[\"default\"](new Error('Unexpected input: single item passed - if you are using ipfs.addAll, please use ipfs.add instead'), 'ERR_UNEXPECTED_INPUT');\n }\n throw errCode__default[\"default\"](new Error('Unexpected input: ' + typeof input), 'ERR_UNEXPECTED_INPUT');\n}\nasync function toFileObject(input, normaliseContent) {\n const {path, mode, mtime, content} = input;\n const file = {\n path: path || '',\n mode: ipfsUnixfs.parseMode(mode),\n mtime: ipfsUnixfs.parseMtime(mtime)\n };\n if (content) {\n file.content = await normaliseContent(content);\n } else if (!path) {\n file.content = await normaliseContent(input);\n }\n return file;\n}\n\nexports.normaliseCandidateMultiple = normaliseCandidateMultiple;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar errCode = require('err-code');\nvar browserStreamToIt = require('browser-readablestream-to-it');\nvar itPeekable = require('it-peekable');\nvar utils = require('./utils.js');\nvar ipfsUnixfs = require('ipfs-unixfs');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\nvar browserStreamToIt__default = /*#__PURE__*/_interopDefaultLegacy(browserStreamToIt);\nvar itPeekable__default = /*#__PURE__*/_interopDefaultLegacy(itPeekable);\n\nasync function* normaliseCandidateSingle(input, normaliseContent) {\n if (input === null || input === undefined) {\n throw errCode__default[\"default\"](new Error(`Unexpected input: ${ input }`), 'ERR_UNEXPECTED_INPUT');\n }\n if (typeof input === 'string' || input instanceof String) {\n yield toFileObject(input.toString(), normaliseContent);\n return;\n }\n if (utils.isBytes(input) || utils.isBlob(input)) {\n yield toFileObject(input, normaliseContent);\n return;\n }\n if (utils.isReadableStream(input)) {\n input = browserStreamToIt__default[\"default\"](input);\n }\n if (Symbol.iterator in input || Symbol.asyncIterator in input) {\n const peekable = itPeekable__default[\"default\"](input);\n const {value, done} = await peekable.peek();\n if (done) {\n yield { content: [] };\n return;\n }\n peekable.push(value);\n if (Number.isInteger(value) || utils.isBytes(value) || typeof value === 'string' || value instanceof String) {\n yield toFileObject(peekable, normaliseContent);\n return;\n }\n throw errCode__default[\"default\"](new Error('Unexpected input: multiple items passed - if you are using ipfs.add, please use ipfs.addAll instead'), 'ERR_UNEXPECTED_INPUT');\n }\n if (utils.isFileObject(input)) {\n yield toFileObject(input, normaliseContent);\n return;\n }\n throw errCode__default[\"default\"](new Error('Unexpected input: cannot convert \"' + typeof input + '\" into ImportCandidate'), 'ERR_UNEXPECTED_INPUT');\n}\nasync function toFileObject(input, normaliseContent) {\n const {path, mode, mtime, content} = input;\n const file = {\n path: path || '',\n mode: ipfsUnixfs.parseMode(mode),\n mtime: ipfsUnixfs.parseMtime(mtime)\n };\n if (content) {\n file.content = await normaliseContent(content);\n } else if (!path) {\n file.content = await normaliseContent(input);\n }\n return file;\n}\n\nexports.normaliseCandidateSingle = normaliseCandidateSingle;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar errCode = require('err-code');\nvar fromString = require('uint8arrays/from-string');\nvar browserStreamToIt = require('browser-readablestream-to-it');\nvar blobToIt = require('blob-to-it');\nvar itPeekable = require('it-peekable');\nvar all = require('it-all');\nvar map = require('it-map');\nvar utils = require('./utils.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\nvar browserStreamToIt__default = /*#__PURE__*/_interopDefaultLegacy(browserStreamToIt);\nvar blobToIt__default = /*#__PURE__*/_interopDefaultLegacy(blobToIt);\nvar itPeekable__default = /*#__PURE__*/_interopDefaultLegacy(itPeekable);\nvar all__default = /*#__PURE__*/_interopDefaultLegacy(all);\nvar map__default = /*#__PURE__*/_interopDefaultLegacy(map);\n\nasync function* toAsyncIterable(thing) {\n yield thing;\n}\nasync function normaliseContent(input) {\n if (utils.isBytes(input)) {\n return toAsyncIterable(toBytes(input));\n }\n if (typeof input === 'string' || input instanceof String) {\n return toAsyncIterable(toBytes(input.toString()));\n }\n if (utils.isBlob(input)) {\n return blobToIt__default[\"default\"](input);\n }\n if (utils.isReadableStream(input)) {\n input = browserStreamToIt__default[\"default\"](input);\n }\n if (Symbol.iterator in input || Symbol.asyncIterator in input) {\n const peekable = itPeekable__default[\"default\"](input);\n const {value, done} = await peekable.peek();\n if (done) {\n return toAsyncIterable(new Uint8Array(0));\n }\n peekable.push(value);\n if (Number.isInteger(value)) {\n return toAsyncIterable(Uint8Array.from(await all__default[\"default\"](peekable)));\n }\n if (utils.isBytes(value) || typeof value === 'string' || value instanceof String) {\n return map__default[\"default\"](peekable, toBytes);\n }\n }\n throw errCode__default[\"default\"](new Error(`Unexpected input: ${ input }`), 'ERR_UNEXPECTED_INPUT');\n}\nfunction toBytes(chunk) {\n if (chunk instanceof Uint8Array) {\n return chunk;\n }\n if (ArrayBuffer.isView(chunk)) {\n return new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength);\n }\n if (chunk instanceof ArrayBuffer) {\n return new Uint8Array(chunk);\n }\n if (Array.isArray(chunk)) {\n return Uint8Array.from(chunk);\n }\n return fromString.fromString(chunk.toString());\n}\n\nexports.normaliseContent = normaliseContent;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar normaliseContent = require('./normalise-content.js');\nvar normaliseCandidateMultiple = require('./normalise-candidate-multiple.js');\n\nfunction normaliseInput(input) {\n return normaliseCandidateMultiple.normaliseCandidateMultiple(input, normaliseContent.normaliseContent);\n}\n\nexports.normaliseInput = normaliseInput;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar normaliseContent = require('./normalise-content.js');\nvar normaliseCandidateSingle = require('./normalise-candidate-single.js');\n\nfunction normaliseInput(input) {\n return normaliseCandidateSingle.normaliseCandidateSingle(input, normaliseContent.normaliseContent);\n}\n\nexports.normaliseInput = normaliseInput;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction isBytes(obj) {\n return ArrayBuffer.isView(obj) || obj instanceof ArrayBuffer;\n}\nfunction isBlob(obj) {\n return obj.constructor && (obj.constructor.name === 'Blob' || obj.constructor.name === 'File') && typeof obj.stream === 'function';\n}\nfunction isFileObject(obj) {\n return typeof obj === 'object' && (obj.path || obj.content);\n}\nconst isReadableStream = value => value && typeof value.getReader === 'function';\n\nexports.isBlob = isBlob;\nexports.isBytes = isBytes;\nexports.isFileObject = isFileObject;\nexports.isReadableStream = isReadableStream;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar errCode = require('err-code');\nvar cid = require('multiformats/cid');\nvar index = require('./resolvers/index.js');\nvar last = require('it-last');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\nvar last__default = /*#__PURE__*/_interopDefaultLegacy(last);\n\nconst toPathComponents = (path = '') => {\n return (path.trim().match(/([^\\\\^/]|\\\\\\/)+/g) || []).filter(Boolean);\n};\nconst cidAndRest = path => {\n if (path instanceof Uint8Array) {\n return {\n cid: cid.CID.decode(path),\n toResolve: []\n };\n }\n const cid$1 = cid.CID.asCID(path);\n if (cid$1) {\n return {\n cid: cid$1,\n toResolve: []\n };\n }\n if (typeof path === 'string') {\n if (path.indexOf('/ipfs/') === 0) {\n path = path.substring(6);\n }\n const output = toPathComponents(path);\n return {\n cid: cid.CID.parse(output[0]),\n toResolve: output.slice(1)\n };\n }\n throw errCode__default['default'](new Error(`Unknown path type ${ path }`), 'ERR_BAD_PATH');\n};\nasync function* walkPath(path, blockstore, options = {}) {\n let {cid, toResolve} = cidAndRest(path);\n let name = cid.toString();\n let entryPath = name;\n const startingDepth = toResolve.length;\n while (true) {\n const result = await index(cid, name, entryPath, toResolve, startingDepth, blockstore, options);\n if (!result.entry && !result.next) {\n throw errCode__default['default'](new Error(`Could not resolve ${ path }`), 'ERR_NOT_FOUND');\n }\n if (result.entry) {\n yield result.entry;\n }\n if (!result.next) {\n return;\n }\n toResolve = result.next.toResolve;\n cid = result.next.cid;\n name = result.next.name;\n entryPath = result.next.path;\n }\n}\nasync function exporter(path, blockstore, options = {}) {\n const result = await last__default['default'](walkPath(path, blockstore, options));\n if (!result) {\n throw errCode__default['default'](new Error(`Could not resolve ${ path }`), 'ERR_NOT_FOUND');\n }\n return result;\n}\nasync function* recursive(path, blockstore, options = {}) {\n const node = await exporter(path, blockstore, options);\n if (!node) {\n return;\n }\n yield node;\n if (node.type === 'directory') {\n for await (const child of recurse(node, options)) {\n yield child;\n }\n }\n async function* recurse(node, options) {\n for await (const file of node.content(options)) {\n yield file;\n if (file instanceof Uint8Array) {\n continue;\n }\n if (file.type === 'directory') {\n yield* recurse(file, options);\n }\n }\n }\n}\n\nexports.exporter = exporter;\nexports.recursive = recursive;\nexports.walkPath = walkPath;\n","'use strict';\n\nvar cid = require('multiformats/cid');\nvar errCode = require('err-code');\nvar dagCbor = require('@ipld/dag-cbor');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () {\n return e[k];\n }\n });\n }\n });\n }\n n['default'] = e;\n return Object.freeze(n);\n}\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\nvar dagCbor__namespace = /*#__PURE__*/_interopNamespace(dagCbor);\n\nconst resolve = async (cid$1, name, path, toResolve, resolve, depth, blockstore, options) => {\n const block = await blockstore.get(cid$1);\n const object = dagCbor__namespace.decode(block);\n let subObject = object;\n let subPath = path;\n while (toResolve.length) {\n const prop = toResolve[0];\n if (prop in subObject) {\n toResolve.shift();\n subPath = `${ subPath }/${ prop }`;\n const subObjectCid = cid.CID.asCID(subObject[prop]);\n if (subObjectCid) {\n return {\n entry: {\n type: 'object',\n name,\n path,\n cid: cid$1,\n node: block,\n depth,\n size: block.length,\n content: async function* () {\n yield object;\n }\n },\n next: {\n cid: subObjectCid,\n name: prop,\n path: subPath,\n toResolve\n }\n };\n }\n subObject = subObject[prop];\n } else {\n throw errCode__default['default'](new Error(`No property named ${ prop } found in cbor node ${ cid$1 }`), 'ERR_NO_PROP');\n }\n }\n return {\n entry: {\n type: 'object',\n name,\n path,\n cid: cid$1,\n node: block,\n depth,\n size: block.length,\n content: async function* () {\n yield object;\n }\n }\n };\n};\n\nmodule.exports = resolve;\n","'use strict';\n\nvar errCode = require('err-code');\nvar extractDataFromBlock = require('../utils/extract-data-from-block.js');\nvar validateOffsetAndLength = require('../utils/validate-offset-and-length.js');\nvar mh = require('multiformats/hashes/digest');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () {\n return e[k];\n }\n });\n }\n });\n }\n n['default'] = e;\n return Object.freeze(n);\n}\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\nvar mh__namespace = /*#__PURE__*/_interopNamespace(mh);\n\nconst rawContent = node => {\n async function* contentGenerator(options = {}) {\n const {offset, length} = validateOffsetAndLength(node.length, options.offset, options.length);\n yield extractDataFromBlock(node, 0, offset, offset + length);\n }\n return contentGenerator;\n};\nconst resolve = async (cid, name, path, toResolve, resolve, depth, blockstore, options) => {\n if (toResolve.length) {\n throw errCode__default['default'](new Error(`No link named ${ path } found in raw node ${ cid }`), 'ERR_NOT_FOUND');\n }\n const buf = await mh__namespace.decode(cid.multihash.bytes);\n return {\n entry: {\n type: 'identity',\n name,\n path,\n cid,\n content: rawContent(buf.digest),\n depth,\n size: buf.digest.length,\n node: buf.digest\n }\n };\n};\n\nmodule.exports = resolve;\n","'use strict';\n\nvar errCode = require('err-code');\nvar dagPb = require('@ipld/dag-pb');\nvar dagCbor = require('@ipld/dag-cbor');\nvar raw = require('multiformats/codecs/raw');\nvar identity = require('multiformats/hashes/identity');\nvar index = require('./unixfs-v1/index.js');\nvar raw$1 = require('./raw.js');\nvar dagCbor$1 = require('./dag-cbor.js');\nvar identity$1 = require('./identity.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () {\n return e[k];\n }\n });\n }\n });\n }\n n['default'] = e;\n return Object.freeze(n);\n}\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\nvar dagPb__namespace = /*#__PURE__*/_interopNamespace(dagPb);\nvar dagCbor__namespace = /*#__PURE__*/_interopNamespace(dagCbor);\nvar raw__namespace = /*#__PURE__*/_interopNamespace(raw);\n\nconst resolvers = {\n [dagPb__namespace.code]: index,\n [raw__namespace.code]: raw$1,\n [dagCbor__namespace.code]: dagCbor$1,\n [identity.identity.code]: identity$1\n};\nfunction resolve(cid, name, path, toResolve, depth, blockstore, options) {\n const resolver = resolvers[cid.code];\n if (!resolver) {\n throw errCode__default['default'](new Error(`No resolver for code ${ cid.code }`), 'ERR_NO_RESOLVER');\n }\n return resolver(cid, name, path, toResolve, resolve, depth, blockstore, options);\n}\n\nmodule.exports = resolve;\n","'use strict';\n\nvar errCode = require('err-code');\nvar extractDataFromBlock = require('../utils/extract-data-from-block.js');\nvar validateOffsetAndLength = require('../utils/validate-offset-and-length.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\n\nconst rawContent = node => {\n async function* contentGenerator(options = {}) {\n const {offset, length} = validateOffsetAndLength(node.length, options.offset, options.length);\n yield extractDataFromBlock(node, 0, offset, offset + length);\n }\n return contentGenerator;\n};\nconst resolve = async (cid, name, path, toResolve, resolve, depth, blockstore, options) => {\n if (toResolve.length) {\n throw errCode__default['default'](new Error(`No link named ${ path } found in raw node ${ cid }`), 'ERR_NOT_FOUND');\n }\n const block = await blockstore.get(cid, options);\n return {\n entry: {\n type: 'raw',\n name,\n path,\n cid,\n content: rawContent(block),\n depth,\n size: block.length,\n node: block\n }\n };\n};\n\nmodule.exports = resolve;\n","'use strict';\n\nconst directoryContent = (cid, node, unixfs, path, resolve, depth, blockstore) => {\n async function* yieldDirectoryContent(options = {}) {\n const offset = options.offset || 0;\n const length = options.length || node.Links.length;\n const links = node.Links.slice(offset, length);\n for (const link of links) {\n const result = await resolve(link.Hash, link.Name || '', `${ path }/${ link.Name || '' }`, [], depth + 1, blockstore, options);\n if (result.entry) {\n yield result.entry;\n }\n }\n }\n return yieldDirectoryContent;\n};\n\nmodule.exports = directoryContent;\n","'use strict';\n\nvar extractDataFromBlock = require('../../../utils/extract-data-from-block.js');\nvar validateOffsetAndLength = require('../../../utils/validate-offset-and-length.js');\nvar ipfsUnixfs = require('ipfs-unixfs');\nvar errCode = require('err-code');\nvar dagPb = require('@ipld/dag-pb');\nvar dagCbor = require('@ipld/dag-cbor');\nvar raw = require('multiformats/codecs/raw');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () {\n return e[k];\n }\n });\n }\n });\n }\n n['default'] = e;\n return Object.freeze(n);\n}\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\nvar dagPb__namespace = /*#__PURE__*/_interopNamespace(dagPb);\nvar dagCbor__namespace = /*#__PURE__*/_interopNamespace(dagCbor);\nvar raw__namespace = /*#__PURE__*/_interopNamespace(raw);\n\nasync function* emitBytes(blockstore, node, start, end, streamPosition = 0, options) {\n if (node instanceof Uint8Array) {\n const buf = extractDataFromBlock(node, streamPosition, start, end);\n if (buf.length) {\n yield buf;\n }\n streamPosition += buf.length;\n return streamPosition;\n }\n if (node.Data == null) {\n throw errCode__default['default'](new Error('no data in PBNode'), 'ERR_NOT_UNIXFS');\n }\n let file;\n try {\n file = ipfsUnixfs.UnixFS.unmarshal(node.Data);\n } catch (err) {\n throw errCode__default['default'](err, 'ERR_NOT_UNIXFS');\n }\n if (file.data && file.data.length) {\n const buf = extractDataFromBlock(file.data, streamPosition, start, end);\n if (buf.length) {\n yield buf;\n }\n streamPosition += file.data.length;\n }\n let childStart = streamPosition;\n for (let i = 0; i < node.Links.length; i++) {\n const childLink = node.Links[i];\n const childEnd = streamPosition + file.blockSizes[i];\n if (start >= childStart && start < childEnd || end > childStart && end <= childEnd || start < childStart && end > childEnd) {\n const block = await blockstore.get(childLink.Hash, { signal: options.signal });\n let child;\n switch (childLink.Hash.code) {\n case dagPb__namespace.code:\n child = await dagPb__namespace.decode(block);\n break;\n case raw__namespace.code:\n child = block;\n break;\n case dagCbor__namespace.code:\n child = await dagCbor__namespace.decode(block);\n break;\n default:\n throw Error(`Unsupported codec: ${ childLink.Hash.code }`);\n }\n for await (const buf of emitBytes(blockstore, child, start, end, streamPosition, options)) {\n streamPosition += buf.length;\n yield buf;\n }\n }\n streamPosition = childEnd;\n childStart = childEnd + 1;\n }\n}\nconst fileContent = (cid, node, unixfs, path, resolve, depth, blockstore) => {\n function yieldFileContent(options = {}) {\n const fileSize = unixfs.fileSize();\n if (fileSize === undefined) {\n throw new Error('File was a directory');\n }\n const {offset, length} = validateOffsetAndLength(fileSize, options.offset, options.length);\n const start = offset;\n const end = offset + length;\n return emitBytes(blockstore, node, start, end, 0, options);\n }\n return yieldFileContent;\n};\n\nmodule.exports = fileContent;\n","'use strict';\n\nvar dagPb = require('@ipld/dag-pb');\n\nconst hamtShardedDirectoryContent = (cid, node, unixfs, path, resolve, depth, blockstore) => {\n function yieldHamtDirectoryContent(options = {}) {\n return listDirectory(node, path, resolve, depth, blockstore, options);\n }\n return yieldHamtDirectoryContent;\n};\nasync function* listDirectory(node, path, resolve, depth, blockstore, options) {\n const links = node.Links;\n for (const link of links) {\n const name = link.Name != null ? link.Name.substring(2) : null;\n if (name) {\n const result = await resolve(link.Hash, name, `${ path }/${ name }`, [], depth + 1, blockstore, options);\n yield result.entry;\n } else {\n const block = await blockstore.get(link.Hash);\n node = dagPb.decode(block);\n for await (const file of listDirectory(node, path, resolve, depth, blockstore, options)) {\n yield file;\n }\n }\n }\n}\n\nmodule.exports = hamtShardedDirectoryContent;\n","'use strict';\n\nvar errCode = require('err-code');\nvar ipfsUnixfs = require('ipfs-unixfs');\nvar findCidInShard = require('../../utils/find-cid-in-shard.js');\nvar dagPb = require('@ipld/dag-pb');\nvar file = require('./content/file.js');\nvar directory = require('./content/directory.js');\nvar hamtShardedDirectory = require('./content/hamt-sharded-directory.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\n\nconst findLinkCid = (node, name) => {\n const link = node.Links.find(link => link.Name === name);\n return link && link.Hash;\n};\nconst contentExporters = {\n raw: file,\n file: file,\n directory: directory,\n 'hamt-sharded-directory': hamtShardedDirectory,\n metadata: (cid, node, unixfs, path, resolve, depth, blockstore) => {\n return () => [];\n },\n symlink: (cid, node, unixfs, path, resolve, depth, blockstore) => {\n return () => [];\n }\n};\nconst unixFsResolver = async (cid, name, path, toResolve, resolve, depth, blockstore, options) => {\n const block = await blockstore.get(cid, options);\n const node = dagPb.decode(block);\n let unixfs;\n let next;\n if (!name) {\n name = cid.toString();\n }\n if (node.Data == null) {\n throw errCode__default['default'](new Error('no data in PBNode'), 'ERR_NOT_UNIXFS');\n }\n try {\n unixfs = ipfsUnixfs.UnixFS.unmarshal(node.Data);\n } catch (err) {\n throw errCode__default['default'](err, 'ERR_NOT_UNIXFS');\n }\n if (!path) {\n path = name;\n }\n if (toResolve.length) {\n let linkCid;\n if (unixfs && unixfs.type === 'hamt-sharded-directory') {\n linkCid = await findCidInShard(node, toResolve[0], blockstore);\n } else {\n linkCid = findLinkCid(node, toResolve[0]);\n }\n if (!linkCid) {\n throw errCode__default['default'](new Error('file does not exist'), 'ERR_NOT_FOUND');\n }\n const nextName = toResolve.shift();\n const nextPath = `${ path }/${ nextName }`;\n next = {\n cid: linkCid,\n toResolve,\n name: nextName || '',\n path: nextPath\n };\n }\n return {\n entry: {\n type: unixfs.isDirectory() ? 'directory' : 'file',\n name,\n path,\n cid,\n content: contentExporters[unixfs.type](cid, node, unixfs, path, resolve, depth, blockstore),\n unixfs,\n depth,\n node,\n size: unixfs.fileSize()\n },\n next\n };\n};\n\nmodule.exports = unixFsResolver;\n","'use strict';\n\nfunction extractDataFromBlock(block, blockStart, requestedStart, requestedEnd) {\n const blockLength = block.length;\n const blockEnd = blockStart + blockLength;\n if (requestedStart >= blockEnd || requestedEnd < blockStart) {\n return new Uint8Array(0);\n }\n if (requestedEnd >= blockStart && requestedEnd < blockEnd) {\n block = block.slice(0, requestedEnd - blockStart);\n }\n if (requestedStart >= blockStart && requestedStart < blockEnd) {\n block = block.slice(requestedStart - blockStart);\n }\n return block;\n}\n\nmodule.exports = extractDataFromBlock;\n","'use strict';\n\nvar hamtSharding = require('hamt-sharding');\nvar dagPb = require('@ipld/dag-pb');\nvar murmur3 = require('@multiformats/murmur3');\n\nconst hashFn = async function (buf) {\n return (await murmur3.murmur3128.encode(buf)).slice(0, 8).reverse();\n};\nconst addLinksToHamtBucket = (links, bucket, rootBucket) => {\n return Promise.all(links.map(link => {\n if (link.Name == null) {\n throw new Error('Unexpected Link without a Name');\n }\n if (link.Name.length === 2) {\n const pos = parseInt(link.Name, 16);\n return bucket._putObjectAt(pos, new hamtSharding.Bucket({\n hash: rootBucket._options.hash,\n bits: rootBucket._options.bits\n }, bucket, pos));\n }\n return rootBucket.put(link.Name.substring(2), true);\n }));\n};\nconst toPrefix = position => {\n return position.toString(16).toUpperCase().padStart(2, '0').substring(0, 2);\n};\nconst toBucketPath = position => {\n let bucket = position.bucket;\n const path = [];\n while (bucket._parent) {\n path.push(bucket);\n bucket = bucket._parent;\n }\n path.push(bucket);\n return path.reverse();\n};\nconst findShardCid = async (node, name, blockstore, context, options) => {\n if (!context) {\n const rootBucket = hamtSharding.createHAMT({ hashFn });\n context = {\n rootBucket,\n hamtDepth: 1,\n lastBucket: rootBucket\n };\n }\n await addLinksToHamtBucket(node.Links, context.lastBucket, context.rootBucket);\n const position = await context.rootBucket._findNewBucketAndPos(name);\n let prefix = toPrefix(position.pos);\n const bucketPath = toBucketPath(position);\n if (bucketPath.length > context.hamtDepth) {\n context.lastBucket = bucketPath[context.hamtDepth];\n prefix = toPrefix(context.lastBucket._posAtParent);\n }\n const link = node.Links.find(link => {\n if (link.Name == null) {\n return false;\n }\n const entryPrefix = link.Name.substring(0, 2);\n const entryName = link.Name.substring(2);\n if (entryPrefix !== prefix) {\n return false;\n }\n if (entryName && entryName !== name) {\n return false;\n }\n return true;\n });\n if (!link) {\n return null;\n }\n if (link.Name != null && link.Name.substring(2) === name) {\n return link.Hash;\n }\n context.hamtDepth++;\n const block = await blockstore.get(link.Hash, options);\n node = dagPb.decode(block);\n return findShardCid(node, name, blockstore, context, options);\n};\n\nmodule.exports = findShardCid;\n","'use strict';\n\nvar errCode = require('err-code');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\n\nconst validateOffsetAndLength = (size, offset, length) => {\n if (!offset) {\n offset = 0;\n }\n if (offset < 0) {\n throw errCode__default['default'](new Error('Offset must be greater than or equal to 0'), 'ERR_INVALID_PARAMS');\n }\n if (offset > size) {\n throw errCode__default['default'](new Error('Offset must be less than the file size'), 'ERR_INVALID_PARAMS');\n }\n if (!length && length !== 0) {\n length = size - offset;\n }\n if (length < 0) {\n throw errCode__default['default'](new Error('Length must be greater than or equal to 0'), 'ERR_INVALID_PARAMS');\n }\n if (offset + length > size) {\n length = size - offset;\n }\n return {\n offset,\n length\n };\n};\n\nmodule.exports = validateOffsetAndLength;\n","'use strict';\n\nvar BufferList = require('bl/BufferList.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar BufferList__default = /*#__PURE__*/_interopDefaultLegacy(BufferList);\n\nasync function* fixedSizeChunker(source, options) {\n let bl = new BufferList__default['default']();\n let currentLength = 0;\n let emitted = false;\n const maxChunkSize = options.maxChunkSize;\n for await (const buffer of source) {\n bl.append(buffer);\n currentLength += buffer.length;\n while (currentLength >= maxChunkSize) {\n yield bl.slice(0, maxChunkSize);\n emitted = true;\n if (maxChunkSize === bl.length) {\n bl = new BufferList__default['default']();\n currentLength = 0;\n } else {\n const newBl = new BufferList__default['default']();\n newBl.append(bl.shallowSlice(maxChunkSize));\n bl = newBl;\n currentLength -= maxChunkSize;\n }\n }\n }\n if (!emitted || currentLength) {\n yield bl.slice(0, currentLength);\n }\n}\n\nmodule.exports = fixedSizeChunker;\n","'use strict';\n\nvar BufferList = require('bl/BufferList.js');\nvar rabinWasm = require('rabin-wasm');\nvar errCode = require('err-code');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar BufferList__default = /*#__PURE__*/_interopDefaultLegacy(BufferList);\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\n\nasync function* rabinChunker(source, options) {\n let min, max, avg;\n if (options.minChunkSize && options.maxChunkSize && options.avgChunkSize) {\n avg = options.avgChunkSize;\n min = options.minChunkSize;\n max = options.maxChunkSize;\n } else if (!options.avgChunkSize) {\n throw errCode__default['default'](new Error('please specify an average chunk size'), 'ERR_INVALID_AVG_CHUNK_SIZE');\n } else {\n avg = options.avgChunkSize;\n min = avg / 3;\n max = avg + avg / 2;\n }\n if (min < 16) {\n throw errCode__default['default'](new Error('rabin min must be greater than 16'), 'ERR_INVALID_MIN_CHUNK_SIZE');\n }\n if (max < min) {\n max = min;\n }\n if (avg < min) {\n avg = min;\n }\n const sizepow = Math.floor(Math.log2(avg));\n for await (const chunk of rabin(source, {\n min: min,\n max: max,\n bits: sizepow,\n window: options.window,\n polynomial: options.polynomial\n })) {\n yield chunk;\n }\n}\nasync function* rabin(source, options) {\n const r = await rabinWasm.create(options.bits, options.min, options.max, options.window);\n const buffers = new BufferList__default['default']();\n for await (const chunk of source) {\n buffers.append(chunk);\n const sizes = r.fingerprint(chunk);\n for (let i = 0; i < sizes.length; i++) {\n const size = sizes[i];\n const buf = buffers.slice(0, size);\n buffers.consume(size);\n yield buf;\n }\n }\n if (buffers.length) {\n yield buffers.slice(0);\n }\n}\n\nmodule.exports = rabinChunker;\n","'use strict';\n\nvar ipfsUnixfs = require('ipfs-unixfs');\nvar persist = require('../utils/persist.js');\nvar dagPb = require('@ipld/dag-pb');\n\nconst dirBuilder = async (item, blockstore, options) => {\n const unixfs = new ipfsUnixfs.UnixFS({\n type: 'directory',\n mtime: item.mtime,\n mode: item.mode\n });\n const buffer = dagPb.encode(dagPb.prepare({ Data: unixfs.marshal() }));\n const cid = await persist(buffer, blockstore, options);\n const path = item.path;\n return {\n cid,\n path,\n unixfs,\n size: buffer.length\n };\n};\n\nmodule.exports = dirBuilder;\n","'use strict';\n\nvar batch = require('it-batch');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar batch__default = /*#__PURE__*/_interopDefaultLegacy(batch);\n\nfunction balanced(source, reduce, options) {\n return reduceToParents(source, reduce, options);\n}\nasync function reduceToParents(source, reduce, options) {\n const roots = [];\n for await (const chunked of batch__default['default'](source, options.maxChildrenPerNode)) {\n roots.push(await reduce(chunked));\n }\n if (roots.length > 1) {\n return reduceToParents(roots, reduce, options);\n }\n return roots[0];\n}\n\nmodule.exports = balanced;\n","'use strict';\n\nvar ipfsUnixfs = require('ipfs-unixfs');\nvar persist = require('../../utils/persist.js');\nvar dagPb = require('@ipld/dag-pb');\nvar rawCodec = require('multiformats/codecs/raw');\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () {\n return e[k];\n }\n });\n }\n });\n }\n n['default'] = e;\n return Object.freeze(n);\n}\n\nvar dagPb__namespace = /*#__PURE__*/_interopNamespace(dagPb);\nvar rawCodec__namespace = /*#__PURE__*/_interopNamespace(rawCodec);\n\nasync function* bufferImporter(file, block, options) {\n for await (let buffer of file.content) {\n yield async () => {\n options.progress(buffer.length, file.path);\n let unixfs;\n const opts = {\n codec: dagPb__namespace,\n cidVersion: options.cidVersion,\n hasher: options.hasher,\n onlyHash: options.onlyHash\n };\n if (options.rawLeaves) {\n opts.codec = rawCodec__namespace;\n opts.cidVersion = 1;\n } else {\n unixfs = new ipfsUnixfs.UnixFS({\n type: options.leafType,\n data: buffer,\n mtime: file.mtime,\n mode: file.mode\n });\n buffer = dagPb__namespace.encode({\n Data: unixfs.marshal(),\n Links: []\n });\n }\n return {\n cid: await persist(buffer, block, opts),\n unixfs,\n size: buffer.length\n };\n };\n }\n}\n\nmodule.exports = bufferImporter;\n","'use strict';\n\nvar all = require('it-all');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar all__default = /*#__PURE__*/_interopDefaultLegacy(all);\n\nasync function flat(source, reduce) {\n return reduce(await all__default['default'](source));\n}\n\nmodule.exports = flat;\n","'use strict';\n\nvar errCode = require('err-code');\nvar ipfsUnixfs = require('ipfs-unixfs');\nvar persist = require('../../utils/persist.js');\nvar dagPb = require('@ipld/dag-pb');\nvar parallelBatch = require('it-parallel-batch');\nvar rawCodec = require('multiformats/codecs/raw');\nvar flat = require('./flat.js');\nvar balanced = require('./balanced.js');\nvar trickle = require('./trickle.js');\nvar bufferImporter = require('./buffer-importer.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () {\n return e[k];\n }\n });\n }\n });\n }\n n['default'] = e;\n return Object.freeze(n);\n}\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\nvar dagPb__namespace = /*#__PURE__*/_interopNamespace(dagPb);\nvar parallelBatch__default = /*#__PURE__*/_interopDefaultLegacy(parallelBatch);\nvar rawCodec__namespace = /*#__PURE__*/_interopNamespace(rawCodec);\n\nconst dagBuilders = {\n flat: flat,\n balanced: balanced,\n trickle: trickle\n};\nasync function* buildFileBatch(file, blockstore, options) {\n let count = -1;\n let previous;\n let bufferImporter$1;\n if (typeof options.bufferImporter === 'function') {\n bufferImporter$1 = options.bufferImporter;\n } else {\n bufferImporter$1 = bufferImporter;\n }\n for await (const entry of parallelBatch__default['default'](bufferImporter$1(file, blockstore, options), options.blockWriteConcurrency)) {\n count++;\n if (count === 0) {\n previous = entry;\n continue;\n } else if (count === 1 && previous) {\n yield previous;\n previous = null;\n }\n yield entry;\n }\n if (previous) {\n previous.single = true;\n yield previous;\n }\n}\nconst reduce = (file, blockstore, options) => {\n async function reducer(leaves) {\n if (leaves.length === 1 && leaves[0].single && options.reduceSingleLeafToSelf) {\n const leaf = leaves[0];\n if (leaf.cid.code === rawCodec__namespace.code && (file.mtime !== undefined || file.mode !== undefined)) {\n let buffer = await blockstore.get(leaf.cid);\n leaf.unixfs = new ipfsUnixfs.UnixFS({\n type: 'file',\n mtime: file.mtime,\n mode: file.mode,\n data: buffer\n });\n buffer = dagPb.encode(dagPb.prepare({ Data: leaf.unixfs.marshal() }));\n leaf.cid = await persist(buffer, blockstore, {\n ...options,\n codec: dagPb__namespace,\n hasher: options.hasher,\n cidVersion: options.cidVersion\n });\n leaf.size = buffer.length;\n }\n return {\n cid: leaf.cid,\n path: file.path,\n unixfs: leaf.unixfs,\n size: leaf.size\n };\n }\n const f = new ipfsUnixfs.UnixFS({\n type: 'file',\n mtime: file.mtime,\n mode: file.mode\n });\n const links = leaves.filter(leaf => {\n if (leaf.cid.code === rawCodec__namespace.code && leaf.size) {\n return true;\n }\n if (leaf.unixfs && !leaf.unixfs.data && leaf.unixfs.fileSize()) {\n return true;\n }\n return Boolean(leaf.unixfs && leaf.unixfs.data && leaf.unixfs.data.length);\n }).map(leaf => {\n if (leaf.cid.code === rawCodec__namespace.code) {\n f.addBlockSize(leaf.size);\n return {\n Name: '',\n Tsize: leaf.size,\n Hash: leaf.cid\n };\n }\n if (!leaf.unixfs || !leaf.unixfs.data) {\n f.addBlockSize(leaf.unixfs && leaf.unixfs.fileSize() || 0);\n } else {\n f.addBlockSize(leaf.unixfs.data.length);\n }\n return {\n Name: '',\n Tsize: leaf.size,\n Hash: leaf.cid\n };\n });\n const node = {\n Data: f.marshal(),\n Links: links\n };\n const buffer = dagPb.encode(dagPb.prepare(node));\n const cid = await persist(buffer, blockstore, options);\n return {\n cid,\n path: file.path,\n unixfs: f,\n size: buffer.length + node.Links.reduce((acc, curr) => acc + curr.Tsize, 0)\n };\n }\n return reducer;\n};\nfunction fileBuilder(file, block, options) {\n const dagBuilder = dagBuilders[options.strategy];\n if (!dagBuilder) {\n throw errCode__default['default'](new Error(`Unknown importer build strategy name: ${ options.strategy }`), 'ERR_BAD_STRATEGY');\n }\n return dagBuilder(buildFileBatch(file, block, options), reduce(file, block, options), options);\n}\n\nmodule.exports = fileBuilder;\n","'use strict';\n\nvar batch = require('it-batch');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar batch__default = /*#__PURE__*/_interopDefaultLegacy(batch);\n\nasync function trickleStream(source, reduce, options) {\n const root = new Root(options.layerRepeat);\n let iteration = 0;\n let maxDepth = 1;\n let subTree = root;\n for await (const layer of batch__default['default'](source, options.maxChildrenPerNode)) {\n if (subTree.isFull()) {\n if (subTree !== root) {\n root.addChild(await subTree.reduce(reduce));\n }\n if (iteration && iteration % options.layerRepeat === 0) {\n maxDepth++;\n }\n subTree = new SubTree(maxDepth, options.layerRepeat, iteration);\n iteration++;\n }\n subTree.append(layer);\n }\n if (subTree && subTree !== root) {\n root.addChild(await subTree.reduce(reduce));\n }\n return root.reduce(reduce);\n}\nclass SubTree {\n constructor(maxDepth, layerRepeat, iteration = 0) {\n this.maxDepth = maxDepth;\n this.layerRepeat = layerRepeat;\n this.currentDepth = 1;\n this.iteration = iteration;\n this.root = this.node = this.parent = {\n children: [],\n depth: this.currentDepth,\n maxDepth,\n maxChildren: (this.maxDepth - this.currentDepth) * this.layerRepeat\n };\n }\n isFull() {\n if (!this.root.data) {\n return false;\n }\n if (this.currentDepth < this.maxDepth && this.node.maxChildren) {\n this._addNextNodeToParent(this.node);\n return false;\n }\n const distantRelative = this._findParent(this.node, this.currentDepth);\n if (distantRelative) {\n this._addNextNodeToParent(distantRelative);\n return false;\n }\n return true;\n }\n _addNextNodeToParent(parent) {\n this.parent = parent;\n const nextNode = {\n children: [],\n depth: parent.depth + 1,\n parent,\n maxDepth: this.maxDepth,\n maxChildren: Math.floor(parent.children.length / this.layerRepeat) * this.layerRepeat\n };\n parent.children.push(nextNode);\n this.currentDepth = nextNode.depth;\n this.node = nextNode;\n }\n append(layer) {\n this.node.data = layer;\n }\n reduce(reduce) {\n return this._reduce(this.root, reduce);\n }\n async _reduce(node, reduce) {\n let children = [];\n if (node.children.length) {\n children = await Promise.all(node.children.filter(child => child.data).map(child => this._reduce(child, reduce)));\n }\n return reduce((node.data || []).concat(children));\n }\n _findParent(node, depth) {\n const parent = node.parent;\n if (!parent || parent.depth === 0) {\n return;\n }\n if (parent.children.length === parent.maxChildren || !parent.maxChildren) {\n return this._findParent(parent, depth);\n }\n return parent;\n }\n}\nclass Root extends SubTree {\n constructor(layerRepeat) {\n super(0, layerRepeat);\n this.root.depth = 0;\n this.currentDepth = 1;\n }\n addChild(child) {\n this.root.children.push(child);\n }\n reduce(reduce) {\n return reduce((this.root.data || []).concat(this.root.children));\n }\n}\n\nmodule.exports = trickleStream;\n","'use strict';\n\nvar dir = require('./dir.js');\nvar index = require('./file/index.js');\nvar errCode = require('err-code');\nvar rabin = require('../chunker/rabin.js');\nvar fixedSize = require('../chunker/fixed-size.js');\nvar validateChunks = require('./validate-chunks.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\n\nfunction isIterable(thing) {\n return Symbol.iterator in thing;\n}\nfunction isAsyncIterable(thing) {\n return Symbol.asyncIterator in thing;\n}\nfunction contentAsAsyncIterable(content) {\n try {\n if (content instanceof Uint8Array) {\n return async function* () {\n yield content;\n }();\n } else if (isIterable(content)) {\n return async function* () {\n yield* content;\n }();\n } else if (isAsyncIterable(content)) {\n return content;\n }\n } catch {\n throw errCode__default['default'](new Error('Content was invalid'), 'ERR_INVALID_CONTENT');\n }\n throw errCode__default['default'](new Error('Content was invalid'), 'ERR_INVALID_CONTENT');\n}\nasync function* dagBuilder(source, blockstore, options) {\n for await (const entry of source) {\n if (entry.path) {\n if (entry.path.substring(0, 2) === './') {\n options.wrapWithDirectory = true;\n }\n entry.path = entry.path.split('/').filter(path => path && path !== '.').join('/');\n }\n if (entry.content) {\n let chunker;\n if (typeof options.chunker === 'function') {\n chunker = options.chunker;\n } else if (options.chunker === 'rabin') {\n chunker = rabin;\n } else {\n chunker = fixedSize;\n }\n let chunkValidator;\n if (typeof options.chunkValidator === 'function') {\n chunkValidator = options.chunkValidator;\n } else {\n chunkValidator = validateChunks;\n }\n const file = {\n path: entry.path,\n mtime: entry.mtime,\n mode: entry.mode,\n content: chunker(chunkValidator(contentAsAsyncIterable(entry.content), options), options)\n };\n yield () => index(file, blockstore, options);\n } else if (entry.path) {\n const dir$1 = {\n path: entry.path,\n mtime: entry.mtime,\n mode: entry.mode\n };\n yield () => dir(dir$1, blockstore, options);\n } else {\n throw new Error('Import candidate must have content or path or both');\n }\n }\n}\n\nmodule.exports = dagBuilder;\n","'use strict';\n\nvar errCode = require('err-code');\nvar fromString = require('uint8arrays/from-string');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar errCode__default = /*#__PURE__*/_interopDefaultLegacy(errCode);\n\nasync function* validateChunks(source) {\n for await (const content of source) {\n if (content.length === undefined) {\n throw errCode__default['default'](new Error('Content was invalid'), 'ERR_INVALID_CONTENT');\n }\n if (typeof content === 'string' || content instanceof String) {\n yield fromString.fromString(content.toString());\n } else if (Array.isArray(content)) {\n yield Uint8Array.from(content);\n } else if (content instanceof Uint8Array) {\n yield content;\n } else {\n throw errCode__default['default'](new Error('Content was invalid'), 'ERR_INVALID_CONTENT');\n }\n }\n}\n\nmodule.exports = validateChunks;\n","'use strict';\n\nvar dagPb = require('@ipld/dag-pb');\nvar ipfsUnixfs = require('ipfs-unixfs');\nvar dir = require('./dir.js');\nvar persist = require('./utils/persist.js');\n\nclass DirFlat extends dir {\n constructor(props, options) {\n super(props, options);\n this._children = {};\n }\n async put(name, value) {\n this.cid = undefined;\n this.size = undefined;\n this._children[name] = value;\n }\n get(name) {\n return Promise.resolve(this._children[name]);\n }\n childCount() {\n return Object.keys(this._children).length;\n }\n directChildrenCount() {\n return this.childCount();\n }\n onlyChild() {\n return this._children[Object.keys(this._children)[0]];\n }\n async *eachChildSeries() {\n const keys = Object.keys(this._children);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n yield {\n key: key,\n child: this._children[key]\n };\n }\n }\n async *flush(block) {\n const children = Object.keys(this._children);\n const links = [];\n for (let i = 0; i < children.length; i++) {\n let child = this._children[children[i]];\n if (child instanceof dir) {\n for await (const entry of child.flush(block)) {\n child = entry;\n yield child;\n }\n }\n if (child.size != null && child.cid) {\n links.push({\n Name: children[i],\n Tsize: child.size,\n Hash: child.cid\n });\n }\n }\n const unixfs = new ipfsUnixfs.UnixFS({\n type: 'directory',\n mtime: this.mtime,\n mode: this.mode\n });\n const node = {\n Data: unixfs.marshal(),\n Links: links\n };\n const buffer = dagPb.encode(dagPb.prepare(node));\n const cid = await persist(buffer, block, this.options);\n const size = buffer.length + node.Links.reduce((acc, curr) => acc + (curr.Tsize == null ? 0 : curr.Tsize), 0);\n this.cid = cid;\n this.size = size;\n yield {\n cid,\n unixfs,\n path: this.path,\n size\n };\n }\n}\n\nmodule.exports = DirFlat;\n","'use strict';\n\nvar dagPb = require('@ipld/dag-pb');\nvar ipfsUnixfs = require('ipfs-unixfs');\nvar dir = require('./dir.js');\nvar persist = require('./utils/persist.js');\nvar hamtSharding = require('hamt-sharding');\n\nclass DirSharded extends dir {\n constructor(props, options) {\n super(props, options);\n this._bucket = hamtSharding.createHAMT({\n hashFn: options.hamtHashFn,\n bits: options.hamtBucketBits\n });\n }\n async put(name, value) {\n await this._bucket.put(name, value);\n }\n get(name) {\n return this._bucket.get(name);\n }\n childCount() {\n return this._bucket.leafCount();\n }\n directChildrenCount() {\n return this._bucket.childrenCount();\n }\n onlyChild() {\n return this._bucket.onlyChild();\n }\n async *eachChildSeries() {\n for await (const {key, value} of this._bucket.eachLeafSeries()) {\n yield {\n key,\n child: value\n };\n }\n }\n async *flush(blockstore) {\n for await (const entry of flush(this._bucket, blockstore, this, this.options)) {\n yield {\n ...entry,\n path: this.path\n };\n }\n }\n}\nasync function* flush(bucket, blockstore, shardRoot, options) {\n const children = bucket._children;\n const links = [];\n let childrenSize = 0;\n for (let i = 0; i < children.length; i++) {\n const child = children.get(i);\n if (!child) {\n continue;\n }\n const labelPrefix = i.toString(16).toUpperCase().padStart(2, '0');\n if (child instanceof hamtSharding.Bucket) {\n let shard;\n for await (const subShard of await flush(child, blockstore, null, options)) {\n shard = subShard;\n }\n if (!shard) {\n throw new Error('Could not flush sharded directory, no subshard found');\n }\n links.push({\n Name: labelPrefix,\n Tsize: shard.size,\n Hash: shard.cid\n });\n childrenSize += shard.size;\n } else if (typeof child.value.flush === 'function') {\n const dir = child.value;\n let flushedDir;\n for await (const entry of dir.flush(blockstore)) {\n flushedDir = entry;\n yield flushedDir;\n }\n const label = labelPrefix + child.key;\n links.push({\n Name: label,\n Tsize: flushedDir.size,\n Hash: flushedDir.cid\n });\n childrenSize += flushedDir.size;\n } else {\n const value = child.value;\n if (!value.cid) {\n continue;\n }\n const label = labelPrefix + child.key;\n const size = value.size;\n links.push({\n Name: label,\n Tsize: size,\n Hash: value.cid\n });\n childrenSize += size;\n }\n }\n const data = Uint8Array.from(children.bitField().reverse());\n const dir = new ipfsUnixfs.UnixFS({\n type: 'hamt-sharded-directory',\n data,\n fanout: bucket.tableSize(),\n hashType: options.hamtHashCode,\n mtime: shardRoot && shardRoot.mtime,\n mode: shardRoot && shardRoot.mode\n });\n const node = {\n Data: dir.marshal(),\n Links: links\n };\n const buffer = dagPb.encode(dagPb.prepare(node));\n const cid = await persist(buffer, blockstore, options);\n const size = buffer.length + childrenSize;\n yield {\n cid,\n unixfs: dir,\n size\n };\n}\n\nmodule.exports = DirSharded;\n","'use strict';\n\nclass Dir {\n constructor(props, options) {\n this.options = options || {};\n this.root = props.root;\n this.dir = props.dir;\n this.path = props.path;\n this.dirty = props.dirty;\n this.flat = props.flat;\n this.parent = props.parent;\n this.parentKey = props.parentKey;\n this.unixfs = props.unixfs;\n this.mode = props.mode;\n this.mtime = props.mtime;\n this.cid = undefined;\n this.size = undefined;\n }\n async put(name, value) {\n }\n get(name) {\n return Promise.resolve(this);\n }\n async *eachChildSeries() {\n }\n async *flush(blockstore) {\n }\n}\n\nmodule.exports = Dir;\n","'use strict';\n\nvar dirSharded = require('./dir-sharded.js');\nvar dirFlat = require('./dir-flat.js');\n\nasync function flatToShard(child, dir, threshold, options) {\n let newDir = dir;\n if (dir instanceof dirFlat && dir.directChildrenCount() >= threshold) {\n newDir = await convertToShard(dir, options);\n }\n const parent = newDir.parent;\n if (parent) {\n if (newDir !== dir) {\n if (child) {\n child.parent = newDir;\n }\n if (!newDir.parentKey) {\n throw new Error('No parent key found');\n }\n await parent.put(newDir.parentKey, newDir);\n }\n return flatToShard(newDir, parent, threshold, options);\n }\n return newDir;\n}\nasync function convertToShard(oldDir, options) {\n const newDir = new dirSharded({\n root: oldDir.root,\n dir: true,\n parent: oldDir.parent,\n parentKey: oldDir.parentKey,\n path: oldDir.path,\n dirty: oldDir.dirty,\n flat: false,\n mtime: oldDir.mtime,\n mode: oldDir.mode\n }, options);\n for await (const {key, child} of oldDir.eachChildSeries()) {\n await newDir.put(key, child);\n }\n return newDir;\n}\n\nmodule.exports = flatToShard;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar parallelBatch = require('it-parallel-batch');\nvar options = require('./options.js');\nvar index = require('./dag-builder/index.js');\nvar treeBuilder = require('./tree-builder.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar parallelBatch__default = /*#__PURE__*/_interopDefaultLegacy(parallelBatch);\n\nasync function* importer(source, blockstore, options$1 = {}) {\n const opts = options(options$1);\n let dagBuilder;\n if (typeof options$1.dagBuilder === 'function') {\n dagBuilder = options$1.dagBuilder;\n } else {\n dagBuilder = index;\n }\n let treeBuilder$1;\n if (typeof options$1.treeBuilder === 'function') {\n treeBuilder$1 = options$1.treeBuilder;\n } else {\n treeBuilder$1 = treeBuilder;\n }\n let candidates;\n if (Symbol.asyncIterator in source || Symbol.iterator in source) {\n candidates = source;\n } else {\n candidates = [source];\n }\n for await (const entry of treeBuilder$1(parallelBatch__default['default'](dagBuilder(candidates, blockstore, opts), opts.fileImportConcurrency), blockstore, opts)) {\n yield {\n cid: entry.cid,\n path: entry.path,\n unixfs: entry.unixfs,\n size: entry.size\n };\n }\n}\n\nexports.importer = importer;\n","'use strict';\n\nvar mergeOptions = require('merge-options');\nvar sha2 = require('multiformats/hashes/sha2');\nvar murmur3 = require('@multiformats/murmur3');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar mergeOptions__default = /*#__PURE__*/_interopDefaultLegacy(mergeOptions);\n\nasync function hamtHashFn(buf) {\n return (await murmur3.murmur3128.encode(buf)).slice(0, 8).reverse();\n}\nconst defaultOptions = {\n chunker: 'fixed',\n strategy: 'balanced',\n rawLeaves: false,\n onlyHash: false,\n reduceSingleLeafToSelf: true,\n hasher: sha2.sha256,\n leafType: 'file',\n cidVersion: 0,\n progress: () => () => {\n },\n shardSplitThreshold: 1000,\n fileImportConcurrency: 50,\n blockWriteConcurrency: 10,\n minChunkSize: 262144,\n maxChunkSize: 262144,\n avgChunkSize: 262144,\n window: 16,\n polynomial: 17437180132763652,\n maxChildrenPerNode: 174,\n layerRepeat: 4,\n wrapWithDirectory: false,\n recursive: false,\n hidden: false,\n timeout: undefined,\n hamtHashFn,\n hamtHashCode: 34,\n hamtBucketBits: 8\n};\nvar defaultOptions$1 = (options = {}) => {\n const defaults = mergeOptions__default['default'].bind({ ignoreUndefined: true });\n return defaults(defaultOptions, options);\n};\n\nmodule.exports = defaultOptions$1;\n","'use strict';\n\nvar dirFlat = require('./dir-flat.js');\nvar flatToShard = require('./flat-to-shard.js');\nvar dir = require('./dir.js');\nvar toPathComponents = require('./utils/to-path-components.js');\n\nasync function addToTree(elem, tree, options) {\n const pathElems = toPathComponents(elem.path || '');\n const lastIndex = pathElems.length - 1;\n let parent = tree;\n let currentPath = '';\n for (let i = 0; i < pathElems.length; i++) {\n const pathElem = pathElems[i];\n currentPath += `${ currentPath ? '/' : '' }${ pathElem }`;\n const last = i === lastIndex;\n parent.dirty = true;\n parent.cid = undefined;\n parent.size = undefined;\n if (last) {\n await parent.put(pathElem, elem);\n tree = await flatToShard(null, parent, options.shardSplitThreshold, options);\n } else {\n let dir$1 = await parent.get(pathElem);\n if (!dir$1 || !(dir$1 instanceof dir)) {\n dir$1 = new dirFlat({\n root: false,\n dir: true,\n parent: parent,\n parentKey: pathElem,\n path: currentPath,\n dirty: true,\n flat: true,\n mtime: dir$1 && dir$1.unixfs && dir$1.unixfs.mtime,\n mode: dir$1 && dir$1.unixfs && dir$1.unixfs.mode\n }, options);\n }\n await parent.put(pathElem, dir$1);\n parent = dir$1;\n }\n }\n return tree;\n}\nasync function* flushAndYield(tree, blockstore) {\n if (!(tree instanceof dir)) {\n if (tree && tree.unixfs && tree.unixfs.isDirectory()) {\n yield tree;\n }\n return;\n }\n yield* tree.flush(blockstore);\n}\nasync function* treeBuilder(source, block, options) {\n let tree = new dirFlat({\n root: true,\n dir: true,\n path: '',\n dirty: true,\n flat: true\n }, options);\n for await (const entry of source) {\n if (!entry) {\n continue;\n }\n tree = await addToTree(entry, tree, options);\n if (!entry.unixfs || !entry.unixfs.isDirectory()) {\n yield entry;\n }\n }\n if (options.wrapWithDirectory) {\n yield* flushAndYield(tree, block);\n } else {\n for await (const unwrapped of tree.eachChildSeries()) {\n if (!unwrapped) {\n continue;\n }\n yield* flushAndYield(unwrapped.child, block);\n }\n }\n}\n\nmodule.exports = treeBuilder;\n","'use strict';\n\nvar cid = require('multiformats/cid');\nvar dagPb = require('@ipld/dag-pb');\nvar sha2 = require('multiformats/hashes/sha2');\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () {\n return e[k];\n }\n });\n }\n });\n }\n n['default'] = e;\n return Object.freeze(n);\n}\n\nvar dagPb__namespace = /*#__PURE__*/_interopNamespace(dagPb);\n\nconst persist = async (buffer, blockstore, options) => {\n if (!options.codec) {\n options.codec = dagPb__namespace;\n }\n if (!options.hasher) {\n options.hasher = sha2.sha256;\n }\n if (options.cidVersion === undefined) {\n options.cidVersion = 1;\n }\n if (options.codec === dagPb__namespace && options.hasher !== sha2.sha256) {\n options.cidVersion = 1;\n }\n const multihash = await options.hasher.digest(buffer);\n const cid$1 = cid.CID.create(options.cidVersion, options.codec.code, multihash);\n if (!options.onlyHash) {\n await blockstore.put(cid$1, buffer, { signal: options.signal });\n }\n return cid$1;\n};\n\nmodule.exports = persist;\n","'use strict';\n\nconst toPathComponents = (path = '') => {\n return (path.trim().match(/([^\\\\^/]|\\\\\\/)+/g) || []).filter(Boolean);\n};\n\nmodule.exports = toPathComponents;\n","'use strict'\n\nconst { Buffer } = require('buffer')\nconst symbol = Symbol.for('BufferList')\n\nfunction BufferList (buf) {\n if (!(this instanceof BufferList)) {\n return new BufferList(buf)\n }\n\n BufferList._init.call(this, buf)\n}\n\nBufferList._init = function _init (buf) {\n Object.defineProperty(this, symbol, { value: true })\n\n this._bufs = []\n this.length = 0\n\n if (buf) {\n this.append(buf)\n }\n}\n\nBufferList.prototype._new = function _new (buf) {\n return new BufferList(buf)\n}\n\nBufferList.prototype._offset = function _offset (offset) {\n if (offset === 0) {\n return [0, 0]\n }\n\n let tot = 0\n\n for (let i = 0; i < this._bufs.length; i++) {\n const _t = tot + this._bufs[i].length\n if (offset < _t || i === this._bufs.length - 1) {\n return [i, offset - tot]\n }\n tot = _t\n }\n}\n\nBufferList.prototype._reverseOffset = function (blOffset) {\n const bufferId = blOffset[0]\n let offset = blOffset[1]\n\n for (let i = 0; i < bufferId; i++) {\n offset += this._bufs[i].length\n }\n\n return offset\n}\n\nBufferList.prototype.get = function get (index) {\n if (index > this.length || index < 0) {\n return undefined\n }\n\n const offset = this._offset(index)\n\n return this._bufs[offset[0]][offset[1]]\n}\n\nBufferList.prototype.slice = function slice (start, end) {\n if (typeof start === 'number' && start < 0) {\n start += this.length\n }\n\n if (typeof end === 'number' && end < 0) {\n end += this.length\n }\n\n return this.copy(null, 0, start, end)\n}\n\nBufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) {\n if (typeof srcStart !== 'number' || srcStart < 0) {\n srcStart = 0\n }\n\n if (typeof srcEnd !== 'number' || srcEnd > this.length) {\n srcEnd = this.length\n }\n\n if (srcStart >= this.length) {\n return dst || Buffer.alloc(0)\n }\n\n if (srcEnd <= 0) {\n return dst || Buffer.alloc(0)\n }\n\n const copy = !!dst\n const off = this._offset(srcStart)\n const len = srcEnd - srcStart\n let bytes = len\n let bufoff = (copy && dstStart) || 0\n let start = off[1]\n\n // copy/slice everything\n if (srcStart === 0 && srcEnd === this.length) {\n if (!copy) {\n // slice, but full concat if multiple buffers\n return this._bufs.length === 1\n ? this._bufs[0]\n : Buffer.concat(this._bufs, this.length)\n }\n\n // copy, need to copy individual buffers\n for (let i = 0; i < this._bufs.length; i++) {\n this._bufs[i].copy(dst, bufoff)\n bufoff += this._bufs[i].length\n }\n\n return dst\n }\n\n // easy, cheap case where it's a subset of one of the buffers\n if (bytes <= this._bufs[off[0]].length - start) {\n return copy\n ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes)\n : this._bufs[off[0]].slice(start, start + bytes)\n }\n\n if (!copy) {\n // a slice, we need something to copy in to\n dst = Buffer.allocUnsafe(len)\n }\n\n for (let i = off[0]; i < this._bufs.length; i++) {\n const l = this._bufs[i].length - start\n\n if (bytes > l) {\n this._bufs[i].copy(dst, bufoff, start)\n bufoff += l\n } else {\n this._bufs[i].copy(dst, bufoff, start, start + bytes)\n bufoff += l\n break\n }\n\n bytes -= l\n\n if (start) {\n start = 0\n }\n }\n\n // safeguard so that we don't return uninitialized memory\n if (dst.length > bufoff) return dst.slice(0, bufoff)\n\n return dst\n}\n\nBufferList.prototype.shallowSlice = function shallowSlice (start, end) {\n start = start || 0\n end = typeof end !== 'number' ? this.length : end\n\n if (start < 0) {\n start += this.length\n }\n\n if (end < 0) {\n end += this.length\n }\n\n if (start === end) {\n return this._new()\n }\n\n const startOffset = this._offset(start)\n const endOffset = this._offset(end)\n const buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1)\n\n if (endOffset[1] === 0) {\n buffers.pop()\n } else {\n buffers[buffers.length - 1] = buffers[buffers.length - 1].slice(0, endOffset[1])\n }\n\n if (startOffset[1] !== 0) {\n buffers[0] = buffers[0].slice(startOffset[1])\n }\n\n return this._new(buffers)\n}\n\nBufferList.prototype.toString = function toString (encoding, start, end) {\n return this.slice(start, end).toString(encoding)\n}\n\nBufferList.prototype.consume = function consume (bytes) {\n // first, normalize the argument, in accordance with how Buffer does it\n bytes = Math.trunc(bytes)\n // do nothing if not a positive number\n if (Number.isNaN(bytes) || bytes <= 0) return this\n\n while (this._bufs.length) {\n if (bytes >= this._bufs[0].length) {\n bytes -= this._bufs[0].length\n this.length -= this._bufs[0].length\n this._bufs.shift()\n } else {\n this._bufs[0] = this._bufs[0].slice(bytes)\n this.length -= bytes\n break\n }\n }\n\n return this\n}\n\nBufferList.prototype.duplicate = function duplicate () {\n const copy = this._new()\n\n for (let i = 0; i < this._bufs.length; i++) {\n copy.append(this._bufs[i])\n }\n\n return copy\n}\n\nBufferList.prototype.append = function append (buf) {\n if (buf == null) {\n return this\n }\n\n if (buf.buffer) {\n // append a view of the underlying ArrayBuffer\n this._appendBuffer(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength))\n } else if (Array.isArray(buf)) {\n for (let i = 0; i < buf.length; i++) {\n this.append(buf[i])\n }\n } else if (this._isBufferList(buf)) {\n // unwrap argument into individual BufferLists\n for (let i = 0; i < buf._bufs.length; i++) {\n this.append(buf._bufs[i])\n }\n } else {\n // coerce number arguments to strings, since Buffer(number) does\n // uninitialized memory allocation\n if (typeof buf === 'number') {\n buf = buf.toString()\n }\n\n this._appendBuffer(Buffer.from(buf))\n }\n\n return this\n}\n\nBufferList.prototype._appendBuffer = function appendBuffer (buf) {\n this._bufs.push(buf)\n this.length += buf.length\n}\n\nBufferList.prototype.indexOf = function (search, offset, encoding) {\n if (encoding === undefined && typeof offset === 'string') {\n encoding = offset\n offset = undefined\n }\n\n if (typeof search === 'function' || Array.isArray(search)) {\n throw new TypeError('The \"value\" argument must be one of type string, Buffer, BufferList, or Uint8Array.')\n } else if (typeof search === 'number') {\n search = Buffer.from([search])\n } else if (typeof search === 'string') {\n search = Buffer.from(search, encoding)\n } else if (this._isBufferList(search)) {\n search = search.slice()\n } else if (Array.isArray(search.buffer)) {\n search = Buffer.from(search.buffer, search.byteOffset, search.byteLength)\n } else if (!Buffer.isBuffer(search)) {\n search = Buffer.from(search)\n }\n\n offset = Number(offset || 0)\n\n if (isNaN(offset)) {\n offset = 0\n }\n\n if (offset < 0) {\n offset = this.length + offset\n }\n\n if (offset < 0) {\n offset = 0\n }\n\n if (search.length === 0) {\n return offset > this.length ? this.length : offset\n }\n\n const blOffset = this._offset(offset)\n let blIndex = blOffset[0] // index of which internal buffer we're working on\n let buffOffset = blOffset[1] // offset of the internal buffer we're working on\n\n // scan over each buffer\n for (; blIndex < this._bufs.length; blIndex++) {\n const buff = this._bufs[blIndex]\n\n while (buffOffset < buff.length) {\n const availableWindow = buff.length - buffOffset\n\n if (availableWindow >= search.length) {\n const nativeSearchResult = buff.indexOf(search, buffOffset)\n\n if (nativeSearchResult !== -1) {\n return this._reverseOffset([blIndex, nativeSearchResult])\n }\n\n buffOffset = buff.length - search.length + 1 // end of native search window\n } else {\n const revOffset = this._reverseOffset([blIndex, buffOffset])\n\n if (this._match(revOffset, search)) {\n return revOffset\n }\n\n buffOffset++\n }\n }\n\n buffOffset = 0\n }\n\n return -1\n}\n\nBufferList.prototype._match = function (offset, search) {\n if (this.length - offset < search.length) {\n return false\n }\n\n for (let searchOffset = 0; searchOffset < search.length; searchOffset++) {\n if (this.get(offset + searchOffset) !== search[searchOffset]) {\n return false\n }\n }\n return true\n}\n\n;(function () {\n const methods = {\n readDoubleBE: 8,\n readDoubleLE: 8,\n readFloatBE: 4,\n readFloatLE: 4,\n readInt32BE: 4,\n readInt32LE: 4,\n readUInt32BE: 4,\n readUInt32LE: 4,\n readInt16BE: 2,\n readInt16LE: 2,\n readUInt16BE: 2,\n readUInt16LE: 2,\n readInt8: 1,\n readUInt8: 1,\n readIntBE: null,\n readIntLE: null,\n readUIntBE: null,\n readUIntLE: null\n }\n\n for (const m in methods) {\n (function (m) {\n if (methods[m] === null) {\n BufferList.prototype[m] = function (offset, byteLength) {\n return this.slice(offset, offset + byteLength)[m](0, byteLength)\n }\n } else {\n BufferList.prototype[m] = function (offset = 0) {\n return this.slice(offset, offset + methods[m])[m](0)\n }\n }\n }(m))\n }\n}())\n\n// Used internally by the class and also as an indicator of this object being\n// a `BufferList`. It's not possible to use `instanceof BufferList` in a browser\n// environment because there could be multiple different copies of the\n// BufferList class and some `BufferList`s might be `BufferList`s.\nBufferList.prototype._isBufferList = function _isBufferList (b) {\n return b instanceof BufferList || BufferList.isBufferList(b)\n}\n\nBufferList.isBufferList = function isBufferList (b) {\n return b != null && b[symbol]\n}\n\nmodule.exports = BufferList\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar errcode = require('err-code');\nvar unixfs = require('./unixfs.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar errcode__default = /*#__PURE__*/_interopDefaultLegacy(errcode);\n\nconst PBData = unixfs.Data;\nconst types = [\n 'raw',\n 'directory',\n 'file',\n 'metadata',\n 'symlink',\n 'hamt-sharded-directory'\n];\nconst dirTypes = [\n 'directory',\n 'hamt-sharded-directory'\n];\nconst DEFAULT_FILE_MODE = parseInt('0644', 8);\nconst DEFAULT_DIRECTORY_MODE = parseInt('0755', 8);\nfunction parseMode(mode) {\n if (mode == null) {\n return undefined;\n }\n if (typeof mode === 'number') {\n return mode & 4095;\n }\n mode = mode.toString();\n if (mode.substring(0, 1) === '0') {\n return parseInt(mode, 8) & 4095;\n }\n return parseInt(mode, 10) & 4095;\n}\nfunction parseMtime(input) {\n if (input == null) {\n return undefined;\n }\n let mtime;\n if (input.secs != null) {\n mtime = {\n secs: input.secs,\n nsecs: input.nsecs\n };\n }\n if (input.Seconds != null) {\n mtime = {\n secs: input.Seconds,\n nsecs: input.FractionalNanoseconds\n };\n }\n if (Array.isArray(input)) {\n mtime = {\n secs: input[0],\n nsecs: input[1]\n };\n }\n if (input instanceof Date) {\n const ms = input.getTime();\n const secs = Math.floor(ms / 1000);\n mtime = {\n secs: secs,\n nsecs: (ms - secs * 1000) * 1000\n };\n }\n if (!Object.prototype.hasOwnProperty.call(mtime, 'secs')) {\n return undefined;\n }\n if (mtime != null && mtime.nsecs != null && (mtime.nsecs < 0 || mtime.nsecs > 999999999)) {\n throw errcode__default['default'](new Error('mtime-nsecs must be within the range [0,999999999]'), 'ERR_INVALID_MTIME_NSECS');\n }\n return mtime;\n}\nclass UnixFS {\n static unmarshal(marshaled) {\n const message = PBData.decode(marshaled);\n const decoded = PBData.toObject(message, {\n defaults: false,\n arrays: true,\n longs: Number,\n objects: false\n });\n const data = new UnixFS({\n type: types[decoded.Type],\n data: decoded.Data,\n blockSizes: decoded.blocksizes,\n mode: decoded.mode,\n mtime: decoded.mtime ? {\n secs: decoded.mtime.Seconds,\n nsecs: decoded.mtime.FractionalNanoseconds\n } : undefined\n });\n data._originalMode = decoded.mode || 0;\n return data;\n }\n constructor(options = { type: 'file' }) {\n const {type, data, blockSizes, hashType, fanout, mtime, mode} = options;\n if (type && !types.includes(type)) {\n throw errcode__default['default'](new Error('Type: ' + type + ' is not valid'), 'ERR_INVALID_TYPE');\n }\n this.type = type || 'file';\n this.data = data;\n this.hashType = hashType;\n this.fanout = fanout;\n this.blockSizes = blockSizes || [];\n this._originalMode = 0;\n this.mode = parseMode(mode);\n if (mtime) {\n this.mtime = parseMtime(mtime);\n if (this.mtime && !this.mtime.nsecs) {\n this.mtime.nsecs = 0;\n }\n }\n }\n set mode(mode) {\n this._mode = this.isDirectory() ? DEFAULT_DIRECTORY_MODE : DEFAULT_FILE_MODE;\n const parsedMode = parseMode(mode);\n if (parsedMode !== undefined) {\n this._mode = parsedMode;\n }\n }\n get mode() {\n return this._mode;\n }\n isDirectory() {\n return Boolean(this.type && dirTypes.includes(this.type));\n }\n addBlockSize(size) {\n this.blockSizes.push(size);\n }\n removeBlockSize(index) {\n this.blockSizes.splice(index, 1);\n }\n fileSize() {\n if (this.isDirectory()) {\n return 0;\n }\n let sum = 0;\n this.blockSizes.forEach(size => {\n sum += size;\n });\n if (this.data) {\n sum += this.data.length;\n }\n return sum;\n }\n marshal() {\n let type;\n switch (this.type) {\n case 'raw':\n type = PBData.DataType.Raw;\n break;\n case 'directory':\n type = PBData.DataType.Directory;\n break;\n case 'file':\n type = PBData.DataType.File;\n break;\n case 'metadata':\n type = PBData.DataType.Metadata;\n break;\n case 'symlink':\n type = PBData.DataType.Symlink;\n break;\n case 'hamt-sharded-directory':\n type = PBData.DataType.HAMTShard;\n break;\n default:\n throw errcode__default['default'](new Error('Type: ' + type + ' is not valid'), 'ERR_INVALID_TYPE');\n }\n let data = this.data;\n if (!this.data || !this.data.length) {\n data = undefined;\n }\n let mode;\n if (this.mode != null) {\n mode = this._originalMode & 4294963200 | (parseMode(this.mode) || 0);\n if (mode === DEFAULT_FILE_MODE && !this.isDirectory()) {\n mode = undefined;\n }\n if (mode === DEFAULT_DIRECTORY_MODE && this.isDirectory()) {\n mode = undefined;\n }\n }\n let mtime;\n if (this.mtime != null) {\n const parsed = parseMtime(this.mtime);\n if (parsed) {\n mtime = {\n Seconds: parsed.secs,\n FractionalNanoseconds: parsed.nsecs\n };\n if (mtime.FractionalNanoseconds === 0) {\n delete mtime.FractionalNanoseconds;\n }\n }\n }\n const pbData = {\n Type: type,\n Data: data,\n filesize: this.isDirectory() ? undefined : this.fileSize(),\n blocksizes: this.blockSizes,\n hashType: this.hashType,\n fanout: this.fanout,\n mode,\n mtime\n };\n return PBData.encode(pbData).finish();\n }\n}\n\nexports.UnixFS = UnixFS;\nexports.parseMode = parseMode;\nexports.parseMtime = parseMtime;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar $protobuf = require('protobufjs/minimal.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar $protobuf__default = /*#__PURE__*/_interopDefaultLegacy($protobuf);\n\nconst $Reader = $protobuf__default['default'].Reader, $Writer = $protobuf__default['default'].Writer, $util = $protobuf__default['default'].util;\nconst $root = $protobuf__default['default'].roots['ipfs-unixfs'] || ($protobuf__default['default'].roots['ipfs-unixfs'] = {});\nconst Data = $root.Data = (() => {\n function Data(p) {\n this.blocksizes = [];\n if (p)\n for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)\n if (p[ks[i]] != null)\n this[ks[i]] = p[ks[i]];\n }\n Data.prototype.Type = 0;\n Data.prototype.Data = $util.newBuffer([]);\n Data.prototype.filesize = $util.Long ? $util.Long.fromBits(0, 0, true) : 0;\n Data.prototype.blocksizes = $util.emptyArray;\n Data.prototype.hashType = $util.Long ? $util.Long.fromBits(0, 0, true) : 0;\n Data.prototype.fanout = $util.Long ? $util.Long.fromBits(0, 0, true) : 0;\n Data.prototype.mode = 0;\n Data.prototype.mtime = null;\n Data.encode = function encode(m, w) {\n if (!w)\n w = $Writer.create();\n w.uint32(8).int32(m.Type);\n if (m.Data != null && Object.hasOwnProperty.call(m, 'Data'))\n w.uint32(18).bytes(m.Data);\n if (m.filesize != null && Object.hasOwnProperty.call(m, 'filesize'))\n w.uint32(24).uint64(m.filesize);\n if (m.blocksizes != null && m.blocksizes.length) {\n for (var i = 0; i < m.blocksizes.length; ++i)\n w.uint32(32).uint64(m.blocksizes[i]);\n }\n if (m.hashType != null && Object.hasOwnProperty.call(m, 'hashType'))\n w.uint32(40).uint64(m.hashType);\n if (m.fanout != null && Object.hasOwnProperty.call(m, 'fanout'))\n w.uint32(48).uint64(m.fanout);\n if (m.mode != null && Object.hasOwnProperty.call(m, 'mode'))\n w.uint32(56).uint32(m.mode);\n if (m.mtime != null && Object.hasOwnProperty.call(m, 'mtime'))\n $root.UnixTime.encode(m.mtime, w.uint32(66).fork()).ldelim();\n return w;\n };\n Data.decode = function decode(r, l) {\n if (!(r instanceof $Reader))\n r = $Reader.create(r);\n var c = l === undefined ? r.len : r.pos + l, m = new $root.Data();\n while (r.pos < c) {\n var t = r.uint32();\n switch (t >>> 3) {\n case 1:\n m.Type = r.int32();\n break;\n case 2:\n m.Data = r.bytes();\n break;\n case 3:\n m.filesize = r.uint64();\n break;\n case 4:\n if (!(m.blocksizes && m.blocksizes.length))\n m.blocksizes = [];\n if ((t & 7) === 2) {\n var c2 = r.uint32() + r.pos;\n while (r.pos < c2)\n m.blocksizes.push(r.uint64());\n } else\n m.blocksizes.push(r.uint64());\n break;\n case 5:\n m.hashType = r.uint64();\n break;\n case 6:\n m.fanout = r.uint64();\n break;\n case 7:\n m.mode = r.uint32();\n break;\n case 8:\n m.mtime = $root.UnixTime.decode(r, r.uint32());\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n if (!m.hasOwnProperty('Type'))\n throw $util.ProtocolError('missing required \\'Type\\'', { instance: m });\n return m;\n };\n Data.fromObject = function fromObject(d) {\n if (d instanceof $root.Data)\n return d;\n var m = new $root.Data();\n switch (d.Type) {\n case 'Raw':\n case 0:\n m.Type = 0;\n break;\n case 'Directory':\n case 1:\n m.Type = 1;\n break;\n case 'File':\n case 2:\n m.Type = 2;\n break;\n case 'Metadata':\n case 3:\n m.Type = 3;\n break;\n case 'Symlink':\n case 4:\n m.Type = 4;\n break;\n case 'HAMTShard':\n case 5:\n m.Type = 5;\n break;\n }\n if (d.Data != null) {\n if (typeof d.Data === 'string')\n $util.base64.decode(d.Data, m.Data = $util.newBuffer($util.base64.length(d.Data)), 0);\n else if (d.Data.length)\n m.Data = d.Data;\n }\n if (d.filesize != null) {\n if ($util.Long)\n (m.filesize = $util.Long.fromValue(d.filesize)).unsigned = true;\n else if (typeof d.filesize === 'string')\n m.filesize = parseInt(d.filesize, 10);\n else if (typeof d.filesize === 'number')\n m.filesize = d.filesize;\n else if (typeof d.filesize === 'object')\n m.filesize = new $util.LongBits(d.filesize.low >>> 0, d.filesize.high >>> 0).toNumber(true);\n }\n if (d.blocksizes) {\n if (!Array.isArray(d.blocksizes))\n throw TypeError('.Data.blocksizes: array expected');\n m.blocksizes = [];\n for (var i = 0; i < d.blocksizes.length; ++i) {\n if ($util.Long)\n (m.blocksizes[i] = $util.Long.fromValue(d.blocksizes[i])).unsigned = true;\n else if (typeof d.blocksizes[i] === 'string')\n m.blocksizes[i] = parseInt(d.blocksizes[i], 10);\n else if (typeof d.blocksizes[i] === 'number')\n m.blocksizes[i] = d.blocksizes[i];\n else if (typeof d.blocksizes[i] === 'object')\n m.blocksizes[i] = new $util.LongBits(d.blocksizes[i].low >>> 0, d.blocksizes[i].high >>> 0).toNumber(true);\n }\n }\n if (d.hashType != null) {\n if ($util.Long)\n (m.hashType = $util.Long.fromValue(d.hashType)).unsigned = true;\n else if (typeof d.hashType === 'string')\n m.hashType = parseInt(d.hashType, 10);\n else if (typeof d.hashType === 'number')\n m.hashType = d.hashType;\n else if (typeof d.hashType === 'object')\n m.hashType = new $util.LongBits(d.hashType.low >>> 0, d.hashType.high >>> 0).toNumber(true);\n }\n if (d.fanout != null) {\n if ($util.Long)\n (m.fanout = $util.Long.fromValue(d.fanout)).unsigned = true;\n else if (typeof d.fanout === 'string')\n m.fanout = parseInt(d.fanout, 10);\n else if (typeof d.fanout === 'number')\n m.fanout = d.fanout;\n else if (typeof d.fanout === 'object')\n m.fanout = new $util.LongBits(d.fanout.low >>> 0, d.fanout.high >>> 0).toNumber(true);\n }\n if (d.mode != null) {\n m.mode = d.mode >>> 0;\n }\n if (d.mtime != null) {\n if (typeof d.mtime !== 'object')\n throw TypeError('.Data.mtime: object expected');\n m.mtime = $root.UnixTime.fromObject(d.mtime);\n }\n return m;\n };\n Data.toObject = function toObject(m, o) {\n if (!o)\n o = {};\n var d = {};\n if (o.arrays || o.defaults) {\n d.blocksizes = [];\n }\n if (o.defaults) {\n d.Type = o.enums === String ? 'Raw' : 0;\n if (o.bytes === String)\n d.Data = '';\n else {\n d.Data = [];\n if (o.bytes !== Array)\n d.Data = $util.newBuffer(d.Data);\n }\n if ($util.Long) {\n var n = new $util.Long(0, 0, true);\n d.filesize = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n;\n } else\n d.filesize = o.longs === String ? '0' : 0;\n if ($util.Long) {\n var n = new $util.Long(0, 0, true);\n d.hashType = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n;\n } else\n d.hashType = o.longs === String ? '0' : 0;\n if ($util.Long) {\n var n = new $util.Long(0, 0, true);\n d.fanout = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n;\n } else\n d.fanout = o.longs === String ? '0' : 0;\n d.mode = 0;\n d.mtime = null;\n }\n if (m.Type != null && m.hasOwnProperty('Type')) {\n d.Type = o.enums === String ? $root.Data.DataType[m.Type] : m.Type;\n }\n if (m.Data != null && m.hasOwnProperty('Data')) {\n d.Data = o.bytes === String ? $util.base64.encode(m.Data, 0, m.Data.length) : o.bytes === Array ? Array.prototype.slice.call(m.Data) : m.Data;\n }\n if (m.filesize != null && m.hasOwnProperty('filesize')) {\n if (typeof m.filesize === 'number')\n d.filesize = o.longs === String ? String(m.filesize) : m.filesize;\n else\n d.filesize = o.longs === String ? $util.Long.prototype.toString.call(m.filesize) : o.longs === Number ? new $util.LongBits(m.filesize.low >>> 0, m.filesize.high >>> 0).toNumber(true) : m.filesize;\n }\n if (m.blocksizes && m.blocksizes.length) {\n d.blocksizes = [];\n for (var j = 0; j < m.blocksizes.length; ++j) {\n if (typeof m.blocksizes[j] === 'number')\n d.blocksizes[j] = o.longs === String ? String(m.blocksizes[j]) : m.blocksizes[j];\n else\n d.blocksizes[j] = o.longs === String ? $util.Long.prototype.toString.call(m.blocksizes[j]) : o.longs === Number ? new $util.LongBits(m.blocksizes[j].low >>> 0, m.blocksizes[j].high >>> 0).toNumber(true) : m.blocksizes[j];\n }\n }\n if (m.hashType != null && m.hasOwnProperty('hashType')) {\n if (typeof m.hashType === 'number')\n d.hashType = o.longs === String ? String(m.hashType) : m.hashType;\n else\n d.hashType = o.longs === String ? $util.Long.prototype.toString.call(m.hashType) : o.longs === Number ? new $util.LongBits(m.hashType.low >>> 0, m.hashType.high >>> 0).toNumber(true) : m.hashType;\n }\n if (m.fanout != null && m.hasOwnProperty('fanout')) {\n if (typeof m.fanout === 'number')\n d.fanout = o.longs === String ? String(m.fanout) : m.fanout;\n else\n d.fanout = o.longs === String ? $util.Long.prototype.toString.call(m.fanout) : o.longs === Number ? new $util.LongBits(m.fanout.low >>> 0, m.fanout.high >>> 0).toNumber(true) : m.fanout;\n }\n if (m.mode != null && m.hasOwnProperty('mode')) {\n d.mode = m.mode;\n }\n if (m.mtime != null && m.hasOwnProperty('mtime')) {\n d.mtime = $root.UnixTime.toObject(m.mtime, o);\n }\n return d;\n };\n Data.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf__default['default'].util.toJSONOptions);\n };\n Data.DataType = function () {\n const valuesById = {}, values = Object.create(valuesById);\n values[valuesById[0] = 'Raw'] = 0;\n values[valuesById[1] = 'Directory'] = 1;\n values[valuesById[2] = 'File'] = 2;\n values[valuesById[3] = 'Metadata'] = 3;\n values[valuesById[4] = 'Symlink'] = 4;\n values[valuesById[5] = 'HAMTShard'] = 5;\n return values;\n }();\n return Data;\n})();\nconst UnixTime = $root.UnixTime = (() => {\n function UnixTime(p) {\n if (p)\n for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)\n if (p[ks[i]] != null)\n this[ks[i]] = p[ks[i]];\n }\n UnixTime.prototype.Seconds = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;\n UnixTime.prototype.FractionalNanoseconds = 0;\n UnixTime.encode = function encode(m, w) {\n if (!w)\n w = $Writer.create();\n w.uint32(8).int64(m.Seconds);\n if (m.FractionalNanoseconds != null && Object.hasOwnProperty.call(m, 'FractionalNanoseconds'))\n w.uint32(21).fixed32(m.FractionalNanoseconds);\n return w;\n };\n UnixTime.decode = function decode(r, l) {\n if (!(r instanceof $Reader))\n r = $Reader.create(r);\n var c = l === undefined ? r.len : r.pos + l, m = new $root.UnixTime();\n while (r.pos < c) {\n var t = r.uint32();\n switch (t >>> 3) {\n case 1:\n m.Seconds = r.int64();\n break;\n case 2:\n m.FractionalNanoseconds = r.fixed32();\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n if (!m.hasOwnProperty('Seconds'))\n throw $util.ProtocolError('missing required \\'Seconds\\'', { instance: m });\n return m;\n };\n UnixTime.fromObject = function fromObject(d) {\n if (d instanceof $root.UnixTime)\n return d;\n var m = new $root.UnixTime();\n if (d.Seconds != null) {\n if ($util.Long)\n (m.Seconds = $util.Long.fromValue(d.Seconds)).unsigned = false;\n else if (typeof d.Seconds === 'string')\n m.Seconds = parseInt(d.Seconds, 10);\n else if (typeof d.Seconds === 'number')\n m.Seconds = d.Seconds;\n else if (typeof d.Seconds === 'object')\n m.Seconds = new $util.LongBits(d.Seconds.low >>> 0, d.Seconds.high >>> 0).toNumber();\n }\n if (d.FractionalNanoseconds != null) {\n m.FractionalNanoseconds = d.FractionalNanoseconds >>> 0;\n }\n return m;\n };\n UnixTime.toObject = function toObject(m, o) {\n if (!o)\n o = {};\n var d = {};\n if (o.defaults) {\n if ($util.Long) {\n var n = new $util.Long(0, 0, false);\n d.Seconds = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n;\n } else\n d.Seconds = o.longs === String ? '0' : 0;\n d.FractionalNanoseconds = 0;\n }\n if (m.Seconds != null && m.hasOwnProperty('Seconds')) {\n if (typeof m.Seconds === 'number')\n d.Seconds = o.longs === String ? String(m.Seconds) : m.Seconds;\n else\n d.Seconds = o.longs === String ? $util.Long.prototype.toString.call(m.Seconds) : o.longs === Number ? new $util.LongBits(m.Seconds.low >>> 0, m.Seconds.high >>> 0).toNumber() : m.Seconds;\n }\n if (m.FractionalNanoseconds != null && m.hasOwnProperty('FractionalNanoseconds')) {\n d.FractionalNanoseconds = m.FractionalNanoseconds;\n }\n return d;\n };\n UnixTime.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf__default['default'].util.toJSONOptions);\n };\n return UnixTime;\n})();\nconst Metadata = $root.Metadata = (() => {\n function Metadata(p) {\n if (p)\n for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)\n if (p[ks[i]] != null)\n this[ks[i]] = p[ks[i]];\n }\n Metadata.prototype.MimeType = '';\n Metadata.encode = function encode(m, w) {\n if (!w)\n w = $Writer.create();\n if (m.MimeType != null && Object.hasOwnProperty.call(m, 'MimeType'))\n w.uint32(10).string(m.MimeType);\n return w;\n };\n Metadata.decode = function decode(r, l) {\n if (!(r instanceof $Reader))\n r = $Reader.create(r);\n var c = l === undefined ? r.len : r.pos + l, m = new $root.Metadata();\n while (r.pos < c) {\n var t = r.uint32();\n switch (t >>> 3) {\n case 1:\n m.MimeType = r.string();\n break;\n default:\n r.skipType(t & 7);\n break;\n }\n }\n return m;\n };\n Metadata.fromObject = function fromObject(d) {\n if (d instanceof $root.Metadata)\n return d;\n var m = new $root.Metadata();\n if (d.MimeType != null) {\n m.MimeType = String(d.MimeType);\n }\n return m;\n };\n Metadata.toObject = function toObject(m, o) {\n if (!o)\n o = {};\n var d = {};\n if (o.defaults) {\n d.MimeType = '';\n }\n if (m.MimeType != null && m.hasOwnProperty('MimeType')) {\n d.MimeType = m.MimeType;\n }\n return d;\n };\n Metadata.prototype.toJSON = function toJSON() {\n return this.constructor.toObject(this, $protobuf__default['default'].util.toJSONOptions);\n };\n return Metadata;\n})();\n\nexports.Data = Data;\nexports.Metadata = Metadata;\nexports.UnixTime = UnixTime;\nexports['default'] = $root;\n","'use strict';\n\nmodule.exports = value => {\n\tif (Object.prototype.toString.call(value) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn prototype === null || prototype === Object.prototype;\n};\n","'use strict'\n\n/**\n * Collects all values from an (async) iterable into an array and returns it.\n *\n * @template T\n * @param {AsyncIterable|Iterable} source\n */\nconst all = async (source) => {\n const arr = []\n\n for await (const entry of source) {\n arr.push(entry)\n }\n\n return arr\n}\n\nmodule.exports = all\n","'use strict'\n\n/**\n * Takes an (async) iterable that emits things and returns an async iterable that\n * emits those things in fixed-sized batches.\n *\n * @template T\n * @param {AsyncIterable|Iterable} source\n * @param {number} [size=1]\n * @returns {AsyncIterable}\n */\nasync function * batch (source, size = 1) {\n /** @type {T[]} */\n let things = []\n\n if (size < 1) {\n size = 1\n }\n\n for await (const thing of source) {\n things.push(thing)\n\n while (things.length >= size) {\n yield things.slice(0, size)\n\n things = things.slice(size)\n }\n }\n\n while (things.length) {\n yield things.slice(0, size)\n\n things = things.slice(size)\n }\n}\n\nmodule.exports = batch\n","'use strict'\n\n/**\n * Drains an (async) iterable discarding its' content and does not return\n * anything.\n *\n * @template T\n * @param {AsyncIterable|Iterable} source\n * @returns {Promise}\n */\nconst drain = async (source) => {\n for await (const _ of source) { } // eslint-disable-line no-unused-vars,no-empty\n}\n\nmodule.exports = drain\n","'use strict'\n\n/**\n * Filters the passed (async) iterable by using the filter function\n *\n * @template T\n * @param {AsyncIterable|Iterable} source\n * @param {function(T):boolean|Promise} fn\n */\nconst filter = async function * (source, fn) {\n for await (const entry of source) {\n if (await fn(entry)) {\n yield entry\n }\n }\n}\n\nmodule.exports = filter\n","'use strict'\n\nconst fs = require('fs').promises\nconst path = require('path')\nconst minimatch = require('minimatch')\n\n/**\n * @typedef {string} Glob\n * @typedef {Object} OptionsExt\n * @property {Glob[]} [ignore] - Glob patterns to ignore\n * @property {string} [cwd=process.cwd()]\n * @property {boolean} [absolute=false] - If true produces absolute paths\n * @property {boolean} [nodir] - If true yields file paths and skip directories\n *\n * @typedef {OptionsExt & minimatch.IOptions} Options\n */\n\n/**\n * Async iterable filename pattern matcher\n *\n * @param {string} dir\n * @param {string} pattern\n * @param {Options} [options]\n * @returns {AsyncIterable}\n */\nasync function * glob (dir, pattern, options = {}) {\n const absoluteDir = path.resolve(dir)\n const relativeDir = path.relative(options.cwd || process.cwd(), dir)\n\n const stats = await fs.stat(absoluteDir)\n\n if (stats.isDirectory()) {\n for await (const entry of _glob(absoluteDir, '', pattern, options)) {\n yield entry\n }\n\n return\n }\n\n if (minimatch(relativeDir, pattern, options)) {\n yield options.absolute ? absoluteDir : relativeDir\n }\n}\n\n/**\n * @param {string} base\n * @param {string} dir\n * @param {Glob} pattern\n * @param {Options} options\n * @returns {AsyncIterable}\n */\nasync function * _glob (base, dir, pattern, options) {\n for await (const entry of await fs.readdir(path.join(base, dir))) {\n const relativeEntryPath = path.join(dir, entry)\n const absoluteEntryPath = path.join(base, dir, entry)\n const stats = await fs.stat(absoluteEntryPath)\n let match = minimatch(relativeEntryPath, pattern, options)\n\n if (options.ignore && match && options.ignore.reduce((acc, curr) => {\n return acc || minimatch(relativeEntryPath, curr, options)\n }, false)) {\n match = false\n }\n\n if (match && !(stats.isDirectory() && options.nodir)) {\n yield options.absolute ? absoluteEntryPath : relativeEntryPath\n }\n\n if (stats.isDirectory()) {\n yield * _glob(base, relativeEntryPath, pattern, options)\n }\n }\n}\n\nmodule.exports = glob\n","'use strict'\n\n/**\n * Returns the last item of an (async) iterable, unless empty, in which case\n * return `undefined`.\n *\n * @template T\n * @param {AsyncIterable|Iterable} source\n */\nconst last = async (source) => {\n let res\n\n for await (const entry of source) {\n res = entry\n }\n\n return res\n}\n\nmodule.exports = last\n","'use strict'\n\n/**\n * Takes an (async) iterable and returns one with each item mapped by the passed\n * function.\n *\n * @template I,O\n * @param {AsyncIterable|Iterable} source\n * @param {function(I):O|Promise} func\n * @returns {AsyncIterable}\n */\nconst map = async function * (source, func) {\n for await (const val of source) {\n yield func(val)\n }\n}\n\nmodule.exports = map\n","'use strict'\n\nconst batch = require('it-batch')\n\n/**\n * @template T\n * @typedef {{ok:true, value:T}} Success\n */\n\n/**\n * @typedef {{ok:false, err:Error}} Failure\n */\n\n/**\n * Takes an (async) iterator that emits promise-returning functions,\n * invokes them in parallel and emits the results as they become available but\n * in the same order as the input\n *\n * @template T\n * @param {AsyncIterable<() => Promise>} source\n * @param {number} [size=1]\n * @returns {AsyncIterable}\n */\nasync function * parallelBatch (source, size = 1) {\n for await (const tasks of batch(source, size)) {\n /** @type {Promise|Failure>[]} */\n const things = tasks.map(\n /**\n * @param {() => Promise} p\n */\n p => {\n return p().then(value => ({ ok: true, value }), err => ({ ok: false, err }))\n })\n\n for (let i = 0; i < things.length; i++) {\n const result = await things[i]\n\n if (result.ok) {\n yield result.value\n } else {\n throw result.err\n }\n }\n }\n}\n\nmodule.exports = parallelBatch\n","'use strict'\n\n/**\n * @template T\n * @typedef {Object} Peek\n * @property {() => IteratorResult} peek\n */\n\n/**\n * @template T\n * @typedef {Object} AsyncPeek\n * @property {() => Promise>} peek\n */\n\n/**\n * @template T\n * @typedef {Object} Push\n * @property {(value:T) => void} push\n */\n\n/**\n * @template T\n * @typedef {Iterable & Peek & Push & Iterator} Peekable\n */\n\n/**\n * @template T\n * @typedef {AsyncIterable & AsyncPeek & Push & AsyncIterator} AsyncPeekable\n */\n\n/**\n * @template {Iterable | AsyncIterable} I\n * @param {I} iterable\n * @returns {I extends Iterable\n * ? Peekable\n * : I extends AsyncIterable\n * ? AsyncPeekable\n * : never\n * }\n */\nfunction peekableIterator (iterable) {\n // @ts-ignore\n const [iterator, symbol] = iterable[Symbol.asyncIterator]\n // @ts-ignore\n ? [iterable[Symbol.asyncIterator](), Symbol.asyncIterator]\n // @ts-ignore\n : [iterable[Symbol.iterator](), Symbol.iterator]\n\n /** @type {any[]} */\n const queue = []\n\n // @ts-ignore\n return {\n peek: () => {\n return iterator.next()\n },\n push: (value) => {\n queue.push(value)\n },\n next: () => {\n if (queue.length) {\n return {\n done: false,\n value: queue.shift()\n }\n }\n\n return iterator.next()\n },\n [symbol] () {\n return this\n }\n }\n}\n\nmodule.exports = peekableIterator\n","const rawPipe = (...fns) => {\n let res\n while (fns.length) {\n res = fns.shift()(res)\n }\n return res\n}\n\nconst isIterable = obj => obj && (\n typeof obj[Symbol.asyncIterator] === 'function' ||\n typeof obj[Symbol.iterator] === 'function' ||\n typeof obj.next === 'function' // Probably, right?\n)\n\nconst isDuplex = obj => obj && typeof obj.sink === 'function' && isIterable(obj.source)\n\nconst duplexPipelineFn = duplex => source => {\n duplex.sink(source) // TODO: error on sink side is unhandled rejection - this is the same as pull streams\n return duplex.source\n}\n\nconst pipe = (...fns) => {\n // Duplex at start: wrap in function and return duplex source\n if (isDuplex(fns[0])) {\n const duplex = fns[0]\n fns[0] = () => duplex.source\n // Iterable at start: wrap in function\n } else if (isIterable(fns[0])) {\n const source = fns[0]\n fns[0] = () => source\n }\n\n if (fns.length > 1) {\n // Duplex at end: use duplex sink\n if (isDuplex(fns[fns.length - 1])) {\n fns[fns.length - 1] = fns[fns.length - 1].sink\n }\n }\n\n if (fns.length > 2) {\n // Duplex in the middle, consume source with duplex sink and return duplex source\n for (let i = 1; i < fns.length - 1; i++) {\n if (isDuplex(fns[i])) {\n fns[i] = duplexPipelineFn(fns[i])\n }\n }\n }\n\n return rawPipe(...fns)\n}\n\nmodule.exports = pipe\nmodule.exports.pipe = pipe\nmodule.exports.rawPipe = rawPipe\nmodule.exports.isIterable = isIterable\nmodule.exports.isDuplex = isDuplex\n","'use strict'\n\n/**\n * Stop iteration after n items have been received.\n *\n * @template T\n * @param {AsyncIterable|Iterable} source\n * @param {number} limit\n * @returns {AsyncIterable}\n */\nconst take = async function * (source, limit) {\n let items = 0\n\n if (limit < 1) {\n return\n }\n\n for await (const entry of source) {\n yield entry\n\n items++\n\n if (items === limit) {\n return\n }\n }\n}\n\nmodule.exports = take\n","'use strict';\nconst isOptionObject = require('is-plain-obj');\n\nconst {hasOwnProperty} = Object.prototype;\nconst {propertyIsEnumerable} = Object;\nconst defineProperty = (object, name, value) => Object.defineProperty(object, name, {\n\tvalue,\n\twritable: true,\n\tenumerable: true,\n\tconfigurable: true\n});\n\nconst globalThis = this;\nconst defaultMergeOptions = {\n\tconcatArrays: false,\n\tignoreUndefined: false\n};\n\nconst getEnumerableOwnPropertyKeys = value => {\n\tconst keys = [];\n\n\tfor (const key in value) {\n\t\tif (hasOwnProperty.call(value, key)) {\n\t\t\tkeys.push(key);\n\t\t}\n\t}\n\n\t/* istanbul ignore else */\n\tif (Object.getOwnPropertySymbols) {\n\t\tconst symbols = Object.getOwnPropertySymbols(value);\n\n\t\tfor (const symbol of symbols) {\n\t\t\tif (propertyIsEnumerable.call(value, symbol)) {\n\t\t\t\tkeys.push(symbol);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn keys;\n};\n\nfunction clone(value) {\n\tif (Array.isArray(value)) {\n\t\treturn cloneArray(value);\n\t}\n\n\tif (isOptionObject(value)) {\n\t\treturn cloneOptionObject(value);\n\t}\n\n\treturn value;\n}\n\nfunction cloneArray(array) {\n\tconst result = array.slice(0, 0);\n\n\tgetEnumerableOwnPropertyKeys(array).forEach(key => {\n\t\tdefineProperty(result, key, clone(array[key]));\n\t});\n\n\treturn result;\n}\n\nfunction cloneOptionObject(object) {\n\tconst result = Object.getPrototypeOf(object) === null ? Object.create(null) : {};\n\n\tgetEnumerableOwnPropertyKeys(object).forEach(key => {\n\t\tdefineProperty(result, key, clone(object[key]));\n\t});\n\n\treturn result;\n}\n\n/**\n * @param {*} merged already cloned\n * @param {*} source something to merge\n * @param {string[]} keys keys to merge\n * @param {Object} config Config Object\n * @returns {*} cloned Object\n */\nconst mergeKeys = (merged, source, keys, config) => {\n\tkeys.forEach(key => {\n\t\tif (typeof source[key] === 'undefined' && config.ignoreUndefined) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Do not recurse into prototype chain of merged\n\t\tif (key in merged && merged[key] !== Object.getPrototypeOf(merged)) {\n\t\t\tdefineProperty(merged, key, merge(merged[key], source[key], config));\n\t\t} else {\n\t\t\tdefineProperty(merged, key, clone(source[key]));\n\t\t}\n\t});\n\n\treturn merged;\n};\n\n/**\n * @param {*} merged already cloned\n * @param {*} source something to merge\n * @param {Object} config Config Object\n * @returns {*} cloned Object\n *\n * see [Array.prototype.concat ( ...arguments )](http://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.concat)\n */\nconst concatArrays = (merged, source, config) => {\n\tlet result = merged.slice(0, 0);\n\tlet resultIndex = 0;\n\n\t[merged, source].forEach(array => {\n\t\tconst indices = [];\n\n\t\t// `result.concat(array)` with cloning\n\t\tfor (let k = 0; k < array.length; k++) {\n\t\t\tif (!hasOwnProperty.call(array, k)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tindices.push(String(k));\n\n\t\t\tif (array === merged) {\n\t\t\t\t// Already cloned\n\t\t\t\tdefineProperty(result, resultIndex++, array[k]);\n\t\t\t} else {\n\t\t\t\tdefineProperty(result, resultIndex++, clone(array[k]));\n\t\t\t}\n\t\t}\n\n\t\t// Merge non-index keys\n\t\tresult = mergeKeys(result, array, getEnumerableOwnPropertyKeys(array).filter(key => !indices.includes(key)), config);\n\t});\n\n\treturn result;\n};\n\n/**\n * @param {*} merged already cloned\n * @param {*} source something to merge\n * @param {Object} config Config Object\n * @returns {*} cloned Object\n */\nfunction merge(merged, source, config) {\n\tif (config.concatArrays && Array.isArray(merged) && Array.isArray(source)) {\n\t\treturn concatArrays(merged, source, config);\n\t}\n\n\tif (!isOptionObject(source) || !isOptionObject(merged)) {\n\t\treturn clone(source);\n\t}\n\n\treturn mergeKeys(merged, source, getEnumerableOwnPropertyKeys(source), config);\n}\n\nmodule.exports = function (...options) {\n\tconst config = merge(clone(defaultMergeOptions), (this !== globalThis && this) || {}, defaultMergeOptions);\n\tlet merged = {_: {}};\n\n\tfor (const option of options) {\n\t\tif (option === undefined) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!isOptionObject(option)) {\n\t\t\tthrow new TypeError('`' + option + '` is not an Option Object');\n\t\t}\n\n\t\tmerged = merge(merged, {_: option}, config);\n\t}\n\n\treturn merged._;\n};\n","module.exports = minimatch\nminimatch.Minimatch = Minimatch\n\nvar path = { sep: '/' }\ntry {\n path = require('path')\n} catch (er) {}\n\nvar GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}\nvar expand = require('brace-expansion')\n\nvar plTypes = {\n '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},\n '?': { open: '(?:', close: ')?' },\n '+': { open: '(?:', close: ')+' },\n '*': { open: '(?:', close: ')*' },\n '@': { open: '(?:', close: ')' }\n}\n\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nvar qmark = '[^/]'\n\n// * => any number of characters\nvar star = qmark + '*?'\n\n// ** when dots are allowed. Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nvar twoStarDot = '(?:(?!(?:\\\\\\/|^)(?:\\\\.{1,2})($|\\\\\\/)).)*?'\n\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nvar twoStarNoDot = '(?:(?!(?:\\\\\\/|^)\\\\.).)*?'\n\n// characters that need to be escaped in RegExp.\nvar reSpecials = charSet('().*{}+?[]^$\\\\!')\n\n// \"abc\" -> { a:true, b:true, c:true }\nfunction charSet (s) {\n return s.split('').reduce(function (set, c) {\n set[c] = true\n return set\n }, {})\n}\n\n// normalizes slashes.\nvar slashSplit = /\\/+/\n\nminimatch.filter = filter\nfunction filter (pattern, options) {\n options = options || {}\n return function (p, i, list) {\n return minimatch(p, pattern, options)\n }\n}\n\nfunction ext (a, b) {\n a = a || {}\n b = b || {}\n var t = {}\n Object.keys(b).forEach(function (k) {\n t[k] = b[k]\n })\n Object.keys(a).forEach(function (k) {\n t[k] = a[k]\n })\n return t\n}\n\nminimatch.defaults = function (def) {\n if (!def || !Object.keys(def).length) return minimatch\n\n var orig = minimatch\n\n var m = function minimatch (p, pattern, options) {\n return orig.minimatch(p, pattern, ext(def, options))\n }\n\n m.Minimatch = function Minimatch (pattern, options) {\n return new orig.Minimatch(pattern, ext(def, options))\n }\n\n return m\n}\n\nMinimatch.defaults = function (def) {\n if (!def || !Object.keys(def).length) return Minimatch\n return minimatch.defaults(def).Minimatch\n}\n\nfunction minimatch (p, pattern, options) {\n if (typeof pattern !== 'string') {\n throw new TypeError('glob pattern string required')\n }\n\n if (!options) options = {}\n\n // shortcut: comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n return false\n }\n\n // \"\" only matches \"\"\n if (pattern.trim() === '') return p === ''\n\n return new Minimatch(pattern, options).match(p)\n}\n\nfunction Minimatch (pattern, options) {\n if (!(this instanceof Minimatch)) {\n return new Minimatch(pattern, options)\n }\n\n if (typeof pattern !== 'string') {\n throw new TypeError('glob pattern string required')\n }\n\n if (!options) options = {}\n pattern = pattern.trim()\n\n // windows support: need to use /, not \\\n if (path.sep !== '/') {\n pattern = pattern.split(path.sep).join('/')\n }\n\n this.options = options\n this.set = []\n this.pattern = pattern\n this.regexp = null\n this.negate = false\n this.comment = false\n this.empty = false\n\n // make the set of regexps etc.\n this.make()\n}\n\nMinimatch.prototype.debug = function () {}\n\nMinimatch.prototype.make = make\nfunction make () {\n // don't do it more than once.\n if (this._made) return\n\n var pattern = this.pattern\n var options = this.options\n\n // empty patterns and comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n this.comment = true\n return\n }\n if (!pattern) {\n this.empty = true\n return\n }\n\n // step 1: figure out negation, etc.\n this.parseNegate()\n\n // step 2: expand braces\n var set = this.globSet = this.braceExpand()\n\n if (options.debug) this.debug = console.error\n\n this.debug(this.pattern, set)\n\n // step 3: now we have a set, so turn each one into a series of path-portion\n // matching patterns.\n // These will be regexps, except in the case of \"**\", which is\n // set to the GLOBSTAR object for globstar behavior,\n // and will not contain any / characters\n set = this.globParts = set.map(function (s) {\n return s.split(slashSplit)\n })\n\n this.debug(this.pattern, set)\n\n // glob --> regexps\n set = set.map(function (s, si, set) {\n return s.map(this.parse, this)\n }, this)\n\n this.debug(this.pattern, set)\n\n // filter out everything that didn't compile properly.\n set = set.filter(function (s) {\n return s.indexOf(false) === -1\n })\n\n this.debug(this.pattern, set)\n\n this.set = set\n}\n\nMinimatch.prototype.parseNegate = parseNegate\nfunction parseNegate () {\n var pattern = this.pattern\n var negate = false\n var options = this.options\n var negateOffset = 0\n\n if (options.nonegate) return\n\n for (var i = 0, l = pattern.length\n ; i < l && pattern.charAt(i) === '!'\n ; i++) {\n negate = !negate\n negateOffset++\n }\n\n if (negateOffset) this.pattern = pattern.substr(negateOffset)\n this.negate = negate\n}\n\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nminimatch.braceExpand = function (pattern, options) {\n return braceExpand(pattern, options)\n}\n\nMinimatch.prototype.braceExpand = braceExpand\n\nfunction braceExpand (pattern, options) {\n if (!options) {\n if (this instanceof Minimatch) {\n options = this.options\n } else {\n options = {}\n }\n }\n\n pattern = typeof pattern === 'undefined'\n ? this.pattern : pattern\n\n if (typeof pattern === 'undefined') {\n throw new TypeError('undefined pattern')\n }\n\n if (options.nobrace ||\n !pattern.match(/\\{.*\\}/)) {\n // shortcut. no need to expand.\n return [pattern]\n }\n\n return expand(pattern)\n}\n\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion. Otherwise, any series\n// of * is equivalent to a single *. Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\nMinimatch.prototype.parse = parse\nvar SUBPARSE = {}\nfunction parse (pattern, isSub) {\n if (pattern.length > 1024 * 64) {\n throw new TypeError('pattern is too long')\n }\n\n var options = this.options\n\n // shortcuts\n if (!options.noglobstar && pattern === '**') return GLOBSTAR\n if (pattern === '') return ''\n\n var re = ''\n var hasMagic = !!options.nocase\n var escaping = false\n // ? => one single character\n var patternListStack = []\n var negativeLists = []\n var stateChar\n var inClass = false\n var reClassStart = -1\n var classStart = -1\n // . and .. never match anything that doesn't start with .,\n // even when options.dot is set.\n var patternStart = pattern.charAt(0) === '.' ? '' // anything\n // not (start or / followed by . or .. followed by / or end)\n : options.dot ? '(?!(?:^|\\\\\\/)\\\\.{1,2}(?:$|\\\\\\/))'\n : '(?!\\\\.)'\n var self = this\n\n function clearStateChar () {\n if (stateChar) {\n // we had some state-tracking character\n // that wasn't consumed by this pass.\n switch (stateChar) {\n case '*':\n re += star\n hasMagic = true\n break\n case '?':\n re += qmark\n hasMagic = true\n break\n default:\n re += '\\\\' + stateChar\n break\n }\n self.debug('clearStateChar %j %j', stateChar, re)\n stateChar = false\n }\n }\n\n for (var i = 0, len = pattern.length, c\n ; (i < len) && (c = pattern.charAt(i))\n ; i++) {\n this.debug('%s\\t%s %s %j', pattern, i, re, c)\n\n // skip over any that are escaped.\n if (escaping && reSpecials[c]) {\n re += '\\\\' + c\n escaping = false\n continue\n }\n\n switch (c) {\n case '/':\n // completely not allowed, even escaped.\n // Should already be path-split by now.\n return false\n\n case '\\\\':\n clearStateChar()\n escaping = true\n continue\n\n // the various stateChar values\n // for the \"extglob\" stuff.\n case '?':\n case '*':\n case '+':\n case '@':\n case '!':\n this.debug('%s\\t%s %s %j <-- stateChar', pattern, i, re, c)\n\n // all of those are literals inside a class, except that\n // the glob [!a] means [^a] in regexp\n if (inClass) {\n this.debug(' in class')\n if (c === '!' && i === classStart + 1) c = '^'\n re += c\n continue\n }\n\n // if we already have a stateChar, then it means\n // that there was something like ** or +? in there.\n // Handle the stateChar, then proceed with this one.\n self.debug('call clearStateChar %j', stateChar)\n clearStateChar()\n stateChar = c\n // if extglob is disabled, then +(asdf|foo) isn't a thing.\n // just clear the statechar *now*, rather than even diving into\n // the patternList stuff.\n if (options.noext) clearStateChar()\n continue\n\n case '(':\n if (inClass) {\n re += '('\n continue\n }\n\n if (!stateChar) {\n re += '\\\\('\n continue\n }\n\n patternListStack.push({\n type: stateChar,\n start: i - 1,\n reStart: re.length,\n open: plTypes[stateChar].open,\n close: plTypes[stateChar].close\n })\n // negation is (?:(?!js)[^/]*)\n re += stateChar === '!' ? '(?:(?!(?:' : '(?:'\n this.debug('plType %j %j', stateChar, re)\n stateChar = false\n continue\n\n case ')':\n if (inClass || !patternListStack.length) {\n re += '\\\\)'\n continue\n }\n\n clearStateChar()\n hasMagic = true\n var pl = patternListStack.pop()\n // negation is (?:(?!js)[^/]*)\n // The others are (?:)\n re += pl.close\n if (pl.type === '!') {\n negativeLists.push(pl)\n }\n pl.reEnd = re.length\n continue\n\n case '|':\n if (inClass || !patternListStack.length || escaping) {\n re += '\\\\|'\n escaping = false\n continue\n }\n\n clearStateChar()\n re += '|'\n continue\n\n // these are mostly the same in regexp and glob\n case '[':\n // swallow any state-tracking char before the [\n clearStateChar()\n\n if (inClass) {\n re += '\\\\' + c\n continue\n }\n\n inClass = true\n classStart = i\n reClassStart = re.length\n re += c\n continue\n\n case ']':\n // a right bracket shall lose its special\n // meaning and represent itself in\n // a bracket expression if it occurs\n // first in the list. -- POSIX.2 2.8.3.2\n if (i === classStart + 1 || !inClass) {\n re += '\\\\' + c\n escaping = false\n continue\n }\n\n // handle the case where we left a class open.\n // \"[z-a]\" is valid, equivalent to \"\\[z-a\\]\"\n if (inClass) {\n // split where the last [ was, make sure we don't have\n // an invalid re. if so, re-walk the contents of the\n // would-be class to re-translate any characters that\n // were passed through as-is\n // TODO: It would probably be faster to determine this\n // without a try/catch and a new RegExp, but it's tricky\n // to do safely. For now, this is safe and works.\n var cs = pattern.substring(classStart + 1, i)\n try {\n RegExp('[' + cs + ']')\n } catch (er) {\n // not a valid class!\n var sp = this.parse(cs, SUBPARSE)\n re = re.substr(0, reClassStart) + '\\\\[' + sp[0] + '\\\\]'\n hasMagic = hasMagic || sp[1]\n inClass = false\n continue\n }\n }\n\n // finish up the class.\n hasMagic = true\n inClass = false\n re += c\n continue\n\n default:\n // swallow any state char that wasn't consumed\n clearStateChar()\n\n if (escaping) {\n // no need\n escaping = false\n } else if (reSpecials[c]\n && !(c === '^' && inClass)) {\n re += '\\\\'\n }\n\n re += c\n\n } // switch\n } // for\n\n // handle the case where we left a class open.\n // \"[abc\" is valid, equivalent to \"\\[abc\"\n if (inClass) {\n // split where the last [ was, and escape it\n // this is a huge pita. We now have to re-walk\n // the contents of the would-be class to re-translate\n // any characters that were passed through as-is\n cs = pattern.substr(classStart + 1)\n sp = this.parse(cs, SUBPARSE)\n re = re.substr(0, reClassStart) + '\\\\[' + sp[0]\n hasMagic = hasMagic || sp[1]\n }\n\n // handle the case where we had a +( thing at the *end*\n // of the pattern.\n // each pattern list stack adds 3 chars, and we need to go through\n // and escape any | chars that were passed through as-is for the regexp.\n // Go through and escape them, taking care not to double-escape any\n // | chars that were already escaped.\n for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {\n var tail = re.slice(pl.reStart + pl.open.length)\n this.debug('setting tail', re, pl)\n // maybe some even number of \\, then maybe 1 \\, followed by a |\n tail = tail.replace(/((?:\\\\{2}){0,64})(\\\\?)\\|/g, function (_, $1, $2) {\n if (!$2) {\n // the | isn't already escaped, so escape it.\n $2 = '\\\\'\n }\n\n // need to escape all those slashes *again*, without escaping the\n // one that we need for escaping the | character. As it works out,\n // escaping an even number of slashes can be done by simply repeating\n // it exactly after itself. That's why this trick works.\n //\n // I am sorry that you have to see this.\n return $1 + $1 + $2 + '|'\n })\n\n this.debug('tail=%j\\n %s', tail, tail, pl, re)\n var t = pl.type === '*' ? star\n : pl.type === '?' ? qmark\n : '\\\\' + pl.type\n\n hasMagic = true\n re = re.slice(0, pl.reStart) + t + '\\\\(' + tail\n }\n\n // handle trailing things that only matter at the very end.\n clearStateChar()\n if (escaping) {\n // trailing \\\\\n re += '\\\\\\\\'\n }\n\n // only need to apply the nodot start if the re starts with\n // something that could conceivably capture a dot\n var addPatternStart = false\n switch (re.charAt(0)) {\n case '.':\n case '[':\n case '(': addPatternStart = true\n }\n\n // Hack to work around lack of negative lookbehind in JS\n // A pattern like: *.!(x).!(y|z) needs to ensure that a name\n // like 'a.xyz.yz' doesn't match. So, the first negative\n // lookahead, has to look ALL the way ahead, to the end of\n // the pattern.\n for (var n = negativeLists.length - 1; n > -1; n--) {\n var nl = negativeLists[n]\n\n var nlBefore = re.slice(0, nl.reStart)\n var nlFirst = re.slice(nl.reStart, nl.reEnd - 8)\n var nlLast = re.slice(nl.reEnd - 8, nl.reEnd)\n var nlAfter = re.slice(nl.reEnd)\n\n nlLast += nlAfter\n\n // Handle nested stuff like *(*.js|!(*.json)), where open parens\n // mean that we should *not* include the ) in the bit that is considered\n // \"after\" the negated section.\n var openParensBefore = nlBefore.split('(').length - 1\n var cleanAfter = nlAfter\n for (i = 0; i < openParensBefore; i++) {\n cleanAfter = cleanAfter.replace(/\\)[+*?]?/, '')\n }\n nlAfter = cleanAfter\n\n var dollar = ''\n if (nlAfter === '' && isSub !== SUBPARSE) {\n dollar = '$'\n }\n var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast\n re = newRe\n }\n\n // if the re is not \"\" at this point, then we need to make sure\n // it doesn't match against an empty path part.\n // Otherwise a/* will match a/, which it should not.\n if (re !== '' && hasMagic) {\n re = '(?=.)' + re\n }\n\n if (addPatternStart) {\n re = patternStart + re\n }\n\n // parsing just a piece of a larger pattern.\n if (isSub === SUBPARSE) {\n return [re, hasMagic]\n }\n\n // skip the regexp for non-magical patterns\n // unescape anything in it, though, so that it'll be\n // an exact match against a file etc.\n if (!hasMagic) {\n return globUnescape(pattern)\n }\n\n var flags = options.nocase ? 'i' : ''\n try {\n var regExp = new RegExp('^' + re + '$', flags)\n } catch (er) {\n // If it was an invalid regular expression, then it can't match\n // anything. This trick looks for a character after the end of\n // the string, which is of course impossible, except in multi-line\n // mode, but it's not a /m regex.\n return new RegExp('$.')\n }\n\n regExp._glob = pattern\n regExp._src = re\n\n return regExp\n}\n\nminimatch.makeRe = function (pattern, options) {\n return new Minimatch(pattern, options || {}).makeRe()\n}\n\nMinimatch.prototype.makeRe = makeRe\nfunction makeRe () {\n if (this.regexp || this.regexp === false) return this.regexp\n\n // at this point, this.set is a 2d array of partial\n // pattern strings, or \"**\".\n //\n // It's better to use .match(). This function shouldn't\n // be used, really, but it's pretty convenient sometimes,\n // when you just want to work with a regex.\n var set = this.set\n\n if (!set.length) {\n this.regexp = false\n return this.regexp\n }\n var options = this.options\n\n var twoStar = options.noglobstar ? star\n : options.dot ? twoStarDot\n : twoStarNoDot\n var flags = options.nocase ? 'i' : ''\n\n var re = set.map(function (pattern) {\n return pattern.map(function (p) {\n return (p === GLOBSTAR) ? twoStar\n : (typeof p === 'string') ? regExpEscape(p)\n : p._src\n }).join('\\\\\\/')\n }).join('|')\n\n // must match entire pattern\n // ending in a * or ** will make it less strict.\n re = '^(?:' + re + ')$'\n\n // can match anything, as long as it's not this.\n if (this.negate) re = '^(?!' + re + ').*$'\n\n try {\n this.regexp = new RegExp(re, flags)\n } catch (ex) {\n this.regexp = false\n }\n return this.regexp\n}\n\nminimatch.match = function (list, pattern, options) {\n options = options || {}\n var mm = new Minimatch(pattern, options)\n list = list.filter(function (f) {\n return mm.match(f)\n })\n if (mm.options.nonull && !list.length) {\n list.push(pattern)\n }\n return list\n}\n\nMinimatch.prototype.match = match\nfunction match (f, partial) {\n this.debug('match', f, this.pattern)\n // short-circuit in the case of busted things.\n // comments, etc.\n if (this.comment) return false\n if (this.empty) return f === ''\n\n if (f === '/' && partial) return true\n\n var options = this.options\n\n // windows: need to use /, not \\\n if (path.sep !== '/') {\n f = f.split(path.sep).join('/')\n }\n\n // treat the test path as a set of pathparts.\n f = f.split(slashSplit)\n this.debug(this.pattern, 'split', f)\n\n // just ONE of the pattern sets in this.set needs to match\n // in order for it to be valid. If negating, then just one\n // match means that we have failed.\n // Either way, return on the first hit.\n\n var set = this.set\n this.debug(this.pattern, 'set', set)\n\n // Find the basename of the path by looking for the last non-empty segment\n var filename\n var i\n for (i = f.length - 1; i >= 0; i--) {\n filename = f[i]\n if (filename) break\n }\n\n for (i = 0; i < set.length; i++) {\n var pattern = set[i]\n var file = f\n if (options.matchBase && pattern.length === 1) {\n file = [filename]\n }\n var hit = this.matchOne(file, pattern, partial)\n if (hit) {\n if (options.flipNegate) return true\n return !this.negate\n }\n }\n\n // didn't get any hits. this is success if it's a negative\n // pattern, failure otherwise.\n if (options.flipNegate) return false\n return this.negate\n}\n\n// set partial to true to test if, for example,\n// \"/a/b\" matches the start of \"/*/b/*/d\"\n// Partial means, if you run out of file before you run\n// out of pattern, then that's fine, as long as all\n// the parts match.\nMinimatch.prototype.matchOne = function (file, pattern, partial) {\n var options = this.options\n\n this.debug('matchOne',\n { 'this': this, file: file, pattern: pattern })\n\n this.debug('matchOne', file.length, pattern.length)\n\n for (var fi = 0,\n pi = 0,\n fl = file.length,\n pl = pattern.length\n ; (fi < fl) && (pi < pl)\n ; fi++, pi++) {\n this.debug('matchOne loop')\n var p = pattern[pi]\n var f = file[fi]\n\n this.debug(pattern, p, f)\n\n // should be impossible.\n // some invalid regexp stuff in the set.\n if (p === false) return false\n\n if (p === GLOBSTAR) {\n this.debug('GLOBSTAR', [pattern, p, f])\n\n // \"**\"\n // a/**/b/**/c would match the following:\n // a/b/x/y/z/c\n // a/x/y/z/b/c\n // a/b/x/b/x/c\n // a/b/c\n // To do this, take the rest of the pattern after\n // the **, and see if it would match the file remainder.\n // If so, return success.\n // If not, the ** \"swallows\" a segment, and try again.\n // This is recursively awful.\n //\n // a/**/b/**/c matching a/b/x/y/z/c\n // - a matches a\n // - doublestar\n // - matchOne(b/x/y/z/c, b/**/c)\n // - b matches b\n // - doublestar\n // - matchOne(x/y/z/c, c) -> no\n // - matchOne(y/z/c, c) -> no\n // - matchOne(z/c, c) -> no\n // - matchOne(c, c) yes, hit\n var fr = fi\n var pr = pi + 1\n if (pr === pl) {\n this.debug('** at the end')\n // a ** at the end will just swallow the rest.\n // We have found a match.\n // however, it will not swallow /.x, unless\n // options.dot is set.\n // . and .. are *never* matched by **, for explosively\n // exponential reasons.\n for (; fi < fl; fi++) {\n if (file[fi] === '.' || file[fi] === '..' ||\n (!options.dot && file[fi].charAt(0) === '.')) return false\n }\n return true\n }\n\n // ok, let's see if we can swallow whatever we can.\n while (fr < fl) {\n var swallowee = file[fr]\n\n this.debug('\\nglobstar while', file, fr, pattern, pr, swallowee)\n\n // XXX remove this slice. Just pass the start index.\n if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {\n this.debug('globstar found match!', fr, fl, swallowee)\n // found a match.\n return true\n } else {\n // can't swallow \".\" or \"..\" ever.\n // can only swallow \".foo\" when explicitly asked.\n if (swallowee === '.' || swallowee === '..' ||\n (!options.dot && swallowee.charAt(0) === '.')) {\n this.debug('dot detected!', file, fr, pattern, pr)\n break\n }\n\n // ** swallows a segment, and continue.\n this.debug('globstar swallow a segment, and continue')\n fr++\n }\n }\n\n // no match was found.\n // However, in partial mode, we can't say this is necessarily over.\n // If there's more *pattern* left, then\n if (partial) {\n // ran out of file\n this.debug('\\n>>> no match, partial?', file, fr, pattern, pr)\n if (fr === fl) return true\n }\n return false\n }\n\n // something other than **\n // non-magic patterns just have to match exactly\n // patterns with magic have been turned into regexps.\n var hit\n if (typeof p === 'string') {\n if (options.nocase) {\n hit = f.toLowerCase() === p.toLowerCase()\n } else {\n hit = f === p\n }\n this.debug('string match', p, f, hit)\n } else {\n hit = f.match(p)\n this.debug('pattern match', p, f, hit)\n }\n\n if (!hit) return false\n }\n\n // Note: ending in / means that we'll get a final \"\"\n // at the end of the pattern. This can only match a\n // corresponding \"\" at the end of the file.\n // If the file ends in /, then it can only match a\n // a pattern that ends in /, unless the pattern just\n // doesn't have any more for it. But, a/b/ should *not*\n // match \"a/b/*\", even though \"\" matches against the\n // [^/]*? pattern, except in partial mode, where it might\n // simply not be reached yet.\n // However, a/b/ should still satisfy a/*\n\n // now either we fell off the end of the pattern, or we're done.\n if (fi === fl && pi === pl) {\n // ran out of pattern and filename at the same time.\n // an exact hit!\n return true\n } else if (fi === fl) {\n // ran out of file, but still had pattern left.\n // this is ok if we're doing the match as part of\n // a glob fs traversal.\n return partial\n } else if (pi === pl) {\n // ran out of pattern, still have file left.\n // this is only acceptable if we're on the very last\n // empty segment of a file with a trailing slash.\n // a/* should match a/b/\n var emptyFileEnd = (fi === fl - 1) && (file[fi] === '')\n return emptyFileEnd\n }\n\n // should be unreachable.\n throw new Error('wtf?')\n}\n\n// replace stuff like \\* with *\nfunction globUnescape (s) {\n return s.replace(/\\\\(.)/g, '$1')\n}\n\nfunction regExpEscape (s) {\n return s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n}\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar baseX$1 = require('../../vendor/base-x.js');\nvar bytes = require('../bytes.js');\n\nclass Encoder {\n constructor(name, prefix, baseEncode) {\n this.name = name;\n this.prefix = prefix;\n this.baseEncode = baseEncode;\n }\n encode(bytes) {\n if (bytes instanceof Uint8Array) {\n return `${ this.prefix }${ this.baseEncode(bytes) }`;\n } else {\n throw Error('Unknown type, must be binary type');\n }\n }\n}\nclass Decoder {\n constructor(name, prefix, baseDecode) {\n this.name = name;\n this.prefix = prefix;\n this.baseDecode = baseDecode;\n }\n decode(text) {\n if (typeof text === 'string') {\n switch (text[0]) {\n case this.prefix: {\n return this.baseDecode(text.slice(1));\n }\n default: {\n throw Error(`Unable to decode multibase string ${ JSON.stringify(text) }, ${ this.name } decoder only supports inputs prefixed with ${ this.prefix }`);\n }\n }\n } else {\n throw Error('Can only multibase decode strings');\n }\n }\n or(decoder) {\n return or(this, decoder);\n }\n}\nclass ComposedDecoder {\n constructor(decoders) {\n this.decoders = decoders;\n }\n or(decoder) {\n return or(this, decoder);\n }\n decode(input) {\n const prefix = input[0];\n const decoder = this.decoders[prefix];\n if (decoder) {\n return decoder.decode(input);\n } else {\n throw RangeError(`Unable to decode multibase string ${ JSON.stringify(input) }, only inputs prefixed with ${ Object.keys(this.decoders) } are supported`);\n }\n }\n}\nconst or = (left, right) => new ComposedDecoder({\n ...left.decoders || { [left.prefix]: left },\n ...right.decoders || { [right.prefix]: right }\n});\nclass Codec {\n constructor(name, prefix, baseEncode, baseDecode) {\n this.name = name;\n this.prefix = prefix;\n this.baseEncode = baseEncode;\n this.baseDecode = baseDecode;\n this.encoder = new Encoder(name, prefix, baseEncode);\n this.decoder = new Decoder(name, prefix, baseDecode);\n }\n encode(input) {\n return this.encoder.encode(input);\n }\n decode(input) {\n return this.decoder.decode(input);\n }\n}\nconst from = ({name, prefix, encode, decode}) => new Codec(name, prefix, encode, decode);\nconst baseX = ({prefix, name, alphabet}) => {\n const {encode, decode} = baseX$1(alphabet, name);\n return from({\n prefix,\n name,\n encode,\n decode: text => bytes.coerce(decode(text))\n });\n};\nconst decode = (string, alphabet, bitsPerChar, name) => {\n const codes = {};\n for (let i = 0; i < alphabet.length; ++i) {\n codes[alphabet[i]] = i;\n }\n let end = string.length;\n while (string[end - 1] === '=') {\n --end;\n }\n const out = new Uint8Array(end * bitsPerChar / 8 | 0);\n let bits = 0;\n let buffer = 0;\n let written = 0;\n for (let i = 0; i < end; ++i) {\n const value = codes[string[i]];\n if (value === undefined) {\n throw new SyntaxError(`Non-${ name } character`);\n }\n buffer = buffer << bitsPerChar | value;\n bits += bitsPerChar;\n if (bits >= 8) {\n bits -= 8;\n out[written++] = 255 & buffer >> bits;\n }\n }\n if (bits >= bitsPerChar || 255 & buffer << 8 - bits) {\n throw new SyntaxError('Unexpected end of data');\n }\n return out;\n};\nconst encode = (data, alphabet, bitsPerChar) => {\n const pad = alphabet[alphabet.length - 1] === '=';\n const mask = (1 << bitsPerChar) - 1;\n let out = '';\n let bits = 0;\n let buffer = 0;\n for (let i = 0; i < data.length; ++i) {\n buffer = buffer << 8 | data[i];\n bits += 8;\n while (bits > bitsPerChar) {\n bits -= bitsPerChar;\n out += alphabet[mask & buffer >> bits];\n }\n }\n if (bits) {\n out += alphabet[mask & buffer << bitsPerChar - bits];\n }\n if (pad) {\n while (out.length * bitsPerChar & 7) {\n out += '=';\n }\n }\n return out;\n};\nconst rfc4648 = ({name, prefix, bitsPerChar, alphabet}) => {\n return from({\n prefix,\n name,\n encode(input) {\n return encode(input, alphabet, bitsPerChar);\n },\n decode(input) {\n return decode(input, alphabet, bitsPerChar, name);\n }\n });\n};\n\nexports.Codec = Codec;\nexports.baseX = baseX;\nexports.from = from;\nexports.or = or;\nexports.rfc4648 = rfc4648;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar base = require('./base.js');\n\nconst base10 = base.baseX({\n prefix: '9',\n name: 'base10',\n alphabet: '0123456789'\n});\n\nexports.base10 = base10;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar base = require('./base.js');\n\nconst base16 = base.rfc4648({\n prefix: 'f',\n name: 'base16',\n alphabet: '0123456789abcdef',\n bitsPerChar: 4\n});\nconst base16upper = base.rfc4648({\n prefix: 'F',\n name: 'base16upper',\n alphabet: '0123456789ABCDEF',\n bitsPerChar: 4\n});\n\nexports.base16 = base16;\nexports.base16upper = base16upper;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar base = require('./base.js');\n\nconst base2 = base.rfc4648({\n prefix: '0',\n name: 'base2',\n alphabet: '01',\n bitsPerChar: 1\n});\n\nexports.base2 = base2;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar base = require('./base.js');\n\nconst base32 = base.rfc4648({\n prefix: 'b',\n name: 'base32',\n alphabet: 'abcdefghijklmnopqrstuvwxyz234567',\n bitsPerChar: 5\n});\nconst base32upper = base.rfc4648({\n prefix: 'B',\n name: 'base32upper',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567',\n bitsPerChar: 5\n});\nconst base32pad = base.rfc4648({\n prefix: 'c',\n name: 'base32pad',\n alphabet: 'abcdefghijklmnopqrstuvwxyz234567=',\n bitsPerChar: 5\n});\nconst base32padupper = base.rfc4648({\n prefix: 'C',\n name: 'base32padupper',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=',\n bitsPerChar: 5\n});\nconst base32hex = base.rfc4648({\n prefix: 'v',\n name: 'base32hex',\n alphabet: '0123456789abcdefghijklmnopqrstuv',\n bitsPerChar: 5\n});\nconst base32hexupper = base.rfc4648({\n prefix: 'V',\n name: 'base32hexupper',\n alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV',\n bitsPerChar: 5\n});\nconst base32hexpad = base.rfc4648({\n prefix: 't',\n name: 'base32hexpad',\n alphabet: '0123456789abcdefghijklmnopqrstuv=',\n bitsPerChar: 5\n});\nconst base32hexpadupper = base.rfc4648({\n prefix: 'T',\n name: 'base32hexpadupper',\n alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=',\n bitsPerChar: 5\n});\nconst base32z = base.rfc4648({\n prefix: 'h',\n name: 'base32z',\n alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769',\n bitsPerChar: 5\n});\n\nexports.base32 = base32;\nexports.base32hex = base32hex;\nexports.base32hexpad = base32hexpad;\nexports.base32hexpadupper = base32hexpadupper;\nexports.base32hexupper = base32hexupper;\nexports.base32pad = base32pad;\nexports.base32padupper = base32padupper;\nexports.base32upper = base32upper;\nexports.base32z = base32z;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar base = require('./base.js');\n\nconst base36 = base.baseX({\n prefix: 'k',\n name: 'base36',\n alphabet: '0123456789abcdefghijklmnopqrstuvwxyz'\n});\nconst base36upper = base.baseX({\n prefix: 'K',\n name: 'base36upper',\n alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'\n});\n\nexports.base36 = base36;\nexports.base36upper = base36upper;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar base = require('./base.js');\n\nconst base58btc = base.baseX({\n name: 'base58btc',\n prefix: 'z',\n alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'\n});\nconst base58flickr = base.baseX({\n name: 'base58flickr',\n prefix: 'Z',\n alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'\n});\n\nexports.base58btc = base58btc;\nexports.base58flickr = base58flickr;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar base = require('./base.js');\n\nconst base64 = base.rfc4648({\n prefix: 'm',\n name: 'base64',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n bitsPerChar: 6\n});\nconst base64pad = base.rfc4648({\n prefix: 'M',\n name: 'base64pad',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',\n bitsPerChar: 6\n});\nconst base64url = base.rfc4648({\n prefix: 'u',\n name: 'base64url',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_',\n bitsPerChar: 6\n});\nconst base64urlpad = base.rfc4648({\n prefix: 'U',\n name: 'base64urlpad',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=',\n bitsPerChar: 6\n});\n\nexports.base64 = base64;\nexports.base64pad = base64pad;\nexports.base64url = base64url;\nexports.base64urlpad = base64urlpad;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar base = require('./base.js');\n\nconst base8 = base.rfc4648({\n prefix: '7',\n name: 'base8',\n alphabet: '01234567',\n bitsPerChar: 3\n});\n\nexports.base8 = base8;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar base = require('./base.js');\nvar bytes = require('../bytes.js');\n\nconst identity = base.from({\n prefix: '\\0',\n name: 'identity',\n encode: buf => bytes.toString(buf),\n decode: str => bytes.fromString(str)\n});\n\nexports.identity = identity;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar identity = require('./bases/identity.js');\nvar base2 = require('./bases/base2.js');\nvar base8 = require('./bases/base8.js');\nvar base10 = require('./bases/base10.js');\nvar base16 = require('./bases/base16.js');\nvar base32 = require('./bases/base32.js');\nvar base36 = require('./bases/base36.js');\nvar base58 = require('./bases/base58.js');\nvar base64 = require('./bases/base64.js');\nvar sha2 = require('./hashes/sha2.js');\nvar identity$1 = require('./hashes/identity.js');\nvar raw = require('./codecs/raw.js');\nvar json = require('./codecs/json.js');\nrequire('./index.js');\nvar cid = require('./cid.js');\nvar hasher = require('./hashes/hasher.js');\nvar digest = require('./hashes/digest.js');\nvar varint = require('./varint.js');\nvar bytes = require('./bytes.js');\n\nconst bases = {\n ...identity,\n ...base2,\n ...base8,\n ...base10,\n ...base16,\n ...base32,\n ...base36,\n ...base58,\n ...base64\n};\nconst hashes = {\n ...sha2,\n ...identity$1\n};\nconst codecs = {\n raw,\n json\n};\n\nexports.CID = cid.CID;\nexports.hasher = hasher;\nexports.digest = digest;\nexports.varint = varint;\nexports.bytes = bytes;\nexports.bases = bases;\nexports.codecs = codecs;\nexports.hashes = hashes;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nrequire('./index.js');\nvar cid = require('./cid.js');\nvar bytes = require('./bytes.js');\n\nconst readonly = ({enumerable = true, configurable = false} = {}) => ({\n enumerable,\n configurable,\n writable: false\n});\nconst links = function* (source, base) {\n if (source == null)\n return;\n if (source instanceof Uint8Array)\n return;\n for (const [key, value] of Object.entries(source)) {\n const path = [\n ...base,\n key\n ];\n if (value != null && typeof value === 'object') {\n if (Array.isArray(value)) {\n for (const [index, element] of value.entries()) {\n const elementPath = [\n ...path,\n index\n ];\n const cid$1 = cid.CID.asCID(element);\n if (cid$1) {\n yield [\n elementPath.join('/'),\n cid$1\n ];\n } else if (typeof element === 'object') {\n yield* links(element, elementPath);\n }\n }\n } else {\n const cid$1 = cid.CID.asCID(value);\n if (cid$1) {\n yield [\n path.join('/'),\n cid$1\n ];\n } else {\n yield* links(value, path);\n }\n }\n }\n }\n};\nconst tree = function* (source, base) {\n if (source == null)\n return;\n for (const [key, value] of Object.entries(source)) {\n const path = [\n ...base,\n key\n ];\n yield path.join('/');\n if (value != null && !(value instanceof Uint8Array) && typeof value === 'object' && !cid.CID.asCID(value)) {\n if (Array.isArray(value)) {\n for (const [index, element] of value.entries()) {\n const elementPath = [\n ...path,\n index\n ];\n yield elementPath.join('/');\n if (typeof element === 'object' && !cid.CID.asCID(element)) {\n yield* tree(element, elementPath);\n }\n }\n } else {\n yield* tree(value, path);\n }\n }\n }\n};\nconst get = (source, path) => {\n let node = source;\n for (const [index, key] of path.entries()) {\n node = node[key];\n if (node == null) {\n throw new Error(`Object has no property at ${ path.slice(0, index + 1).map(part => `[${ JSON.stringify(part) }]`).join('') }`);\n }\n const cid$1 = cid.CID.asCID(node);\n if (cid$1) {\n return {\n value: cid$1,\n remaining: path.slice(index + 1).join('/')\n };\n }\n }\n return { value: node };\n};\nclass Block {\n constructor({cid, bytes, value}) {\n if (!cid || !bytes || typeof value === 'undefined')\n throw new Error('Missing required argument');\n this.cid = cid;\n this.bytes = bytes;\n this.value = value;\n this.asBlock = this;\n Object.defineProperties(this, {\n cid: readonly(),\n bytes: readonly(),\n value: readonly(),\n asBlock: readonly()\n });\n }\n links() {\n return links(this.value, []);\n }\n tree() {\n return tree(this.value, []);\n }\n get(path = '/') {\n return get(this.value, path.split('/').filter(Boolean));\n }\n}\nconst encode = async ({value, codec, hasher}) => {\n if (typeof value === 'undefined')\n throw new Error('Missing required argument \"value\"');\n if (!codec || !hasher)\n throw new Error('Missing required argument: codec or hasher');\n const bytes = codec.encode(value);\n const hash = await hasher.digest(bytes);\n const cid$1 = cid.CID.create(1, codec.code, hash);\n return new Block({\n value,\n bytes,\n cid: cid$1\n });\n};\nconst decode = async ({bytes, codec, hasher}) => {\n if (!bytes)\n throw new Error('Missing required argument \"bytes\"');\n if (!codec || !hasher)\n throw new Error('Missing required argument: codec or hasher');\n const value = codec.decode(bytes);\n const hash = await hasher.digest(bytes);\n const cid$1 = cid.CID.create(1, codec.code, hash);\n return new Block({\n value,\n bytes,\n cid: cid$1\n });\n};\nconst createUnsafe = ({\n bytes,\n cid,\n value: maybeValue,\n codec\n}) => {\n const value = maybeValue !== undefined ? maybeValue : codec && codec.decode(bytes);\n if (value === undefined)\n throw new Error('Missing required argument, must either provide \"value\" or \"codec\"');\n return new Block({\n cid,\n bytes,\n value\n });\n};\nconst create = async ({bytes: bytes$1, cid, hasher, codec}) => {\n if (!bytes$1)\n throw new Error('Missing required argument \"bytes\"');\n if (!hasher)\n throw new Error('Missing required argument \"hasher\"');\n const value = codec.decode(bytes$1);\n const hash = await hasher.digest(bytes$1);\n if (!bytes.equals(cid.multihash.bytes, hash.bytes)) {\n throw new Error('CID hash does not match bytes');\n }\n return createUnsafe({\n bytes: bytes$1,\n cid,\n value,\n codec\n });\n};\n\nexports.Block = Block;\nexports.create = create;\nexports.createUnsafe = createUnsafe;\nexports.decode = decode;\nexports.encode = encode;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst empty = new Uint8Array(0);\nconst toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '');\nconst fromHex = hex => {\n const hexes = hex.match(/../g);\n return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : empty;\n};\nconst equals = (aa, bb) => {\n if (aa === bb)\n return true;\n if (aa.byteLength !== bb.byteLength) {\n return false;\n }\n for (let ii = 0; ii < aa.byteLength; ii++) {\n if (aa[ii] !== bb[ii]) {\n return false;\n }\n }\n return true;\n};\nconst coerce = o => {\n if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array')\n return o;\n if (o instanceof ArrayBuffer)\n return new Uint8Array(o);\n if (ArrayBuffer.isView(o)) {\n return new Uint8Array(o.buffer, o.byteOffset, o.byteLength);\n }\n throw new Error('Unknown type, must be binary type');\n};\nconst isBinary = o => o instanceof ArrayBuffer || ArrayBuffer.isView(o);\nconst fromString = str => new TextEncoder().encode(str);\nconst toString = b => new TextDecoder().decode(b);\n\nexports.coerce = coerce;\nexports.empty = empty;\nexports.equals = equals;\nexports.fromHex = fromHex;\nexports.fromString = fromString;\nexports.isBinary = isBinary;\nexports.toHex = toHex;\nexports.toString = toString;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar varint = require('./varint.js');\nvar digest = require('./hashes/digest.js');\nvar base58 = require('./bases/base58.js');\nvar base32 = require('./bases/base32.js');\nvar bytes = require('./bytes.js');\n\nclass CID {\n constructor(version, code, multihash, bytes) {\n this.code = code;\n this.version = version;\n this.multihash = multihash;\n this.bytes = bytes;\n this.byteOffset = bytes.byteOffset;\n this.byteLength = bytes.byteLength;\n this.asCID = this;\n this._baseCache = new Map();\n Object.defineProperties(this, {\n byteOffset: hidden,\n byteLength: hidden,\n code: readonly,\n version: readonly,\n multihash: readonly,\n bytes: readonly,\n _baseCache: hidden,\n asCID: hidden\n });\n }\n toV0() {\n switch (this.version) {\n case 0: {\n return this;\n }\n default: {\n const {code, multihash} = this;\n if (code !== DAG_PB_CODE) {\n throw new Error('Cannot convert a non dag-pb CID to CIDv0');\n }\n if (multihash.code !== SHA_256_CODE) {\n throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0');\n }\n return CID.createV0(multihash);\n }\n }\n }\n toV1() {\n switch (this.version) {\n case 0: {\n const {code, digest: digest$1} = this.multihash;\n const multihash = digest.create(code, digest$1);\n return CID.createV1(this.code, multihash);\n }\n case 1: {\n return this;\n }\n default: {\n throw Error(`Can not convert CID version ${ this.version } to version 0. This is a bug please report`);\n }\n }\n }\n equals(other) {\n return other && this.code === other.code && this.version === other.version && digest.equals(this.multihash, other.multihash);\n }\n toString(base) {\n const {bytes, version, _baseCache} = this;\n switch (version) {\n case 0:\n return toStringV0(bytes, _baseCache, base || base58.base58btc.encoder);\n default:\n return toStringV1(bytes, _baseCache, base || base32.base32.encoder);\n }\n }\n toJSON() {\n return {\n code: this.code,\n version: this.version,\n hash: this.multihash.bytes\n };\n }\n get [Symbol.toStringTag]() {\n return 'CID';\n }\n [Symbol.for('nodejs.util.inspect.custom')]() {\n return 'CID(' + this.toString() + ')';\n }\n static isCID(value) {\n deprecate(/^0\\.0/, IS_CID_DEPRECATION);\n return !!(value && (value[cidSymbol] || value.asCID === value));\n }\n get toBaseEncodedString() {\n throw new Error('Deprecated, use .toString()');\n }\n get codec() {\n throw new Error('\"codec\" property is deprecated, use integer \"code\" property instead');\n }\n get buffer() {\n throw new Error('Deprecated .buffer property, use .bytes to get Uint8Array instead');\n }\n get multibaseName() {\n throw new Error('\"multibaseName\" property is deprecated');\n }\n get prefix() {\n throw new Error('\"prefix\" property is deprecated');\n }\n static asCID(value) {\n if (value instanceof CID) {\n return value;\n } else if (value != null && value.asCID === value) {\n const {version, code, multihash, bytes} = value;\n return new CID(version, code, multihash, bytes || encodeCID(version, code, multihash.bytes));\n } else if (value != null && value[cidSymbol] === true) {\n const {version, multihash, code} = value;\n const digest$1 = digest.decode(multihash);\n return CID.create(version, code, digest$1);\n } else {\n return null;\n }\n }\n static create(version, code, digest) {\n if (typeof code !== 'number') {\n throw new Error('String codecs are no longer supported');\n }\n switch (version) {\n case 0: {\n if (code !== DAG_PB_CODE) {\n throw new Error(`Version 0 CID must use dag-pb (code: ${ DAG_PB_CODE }) block encoding`);\n } else {\n return new CID(version, code, digest, digest.bytes);\n }\n }\n case 1: {\n const bytes = encodeCID(version, code, digest.bytes);\n return new CID(version, code, digest, bytes);\n }\n default: {\n throw new Error('Invalid version');\n }\n }\n }\n static createV0(digest) {\n return CID.create(0, DAG_PB_CODE, digest);\n }\n static createV1(code, digest) {\n return CID.create(1, code, digest);\n }\n static decode(bytes) {\n const [cid, remainder] = CID.decodeFirst(bytes);\n if (remainder.length) {\n throw new Error('Incorrect length');\n }\n return cid;\n }\n static decodeFirst(bytes$1) {\n const specs = CID.inspectBytes(bytes$1);\n const prefixSize = specs.size - specs.multihashSize;\n const multihashBytes = bytes.coerce(bytes$1.subarray(prefixSize, prefixSize + specs.multihashSize));\n if (multihashBytes.byteLength !== specs.multihashSize) {\n throw new Error('Incorrect length');\n }\n const digestBytes = multihashBytes.subarray(specs.multihashSize - specs.digestSize);\n const digest$1 = new digest.Digest(specs.multihashCode, specs.digestSize, digestBytes, multihashBytes);\n const cid = specs.version === 0 ? CID.createV0(digest$1) : CID.createV1(specs.codec, digest$1);\n return [\n cid,\n bytes$1.subarray(specs.size)\n ];\n }\n static inspectBytes(initialBytes) {\n let offset = 0;\n const next = () => {\n const [i, length] = varint.decode(initialBytes.subarray(offset));\n offset += length;\n return i;\n };\n let version = next();\n let codec = DAG_PB_CODE;\n if (version === 18) {\n version = 0;\n offset = 0;\n } else if (version === 1) {\n codec = next();\n }\n if (version !== 0 && version !== 1) {\n throw new RangeError(`Invalid CID version ${ version }`);\n }\n const prefixSize = offset;\n const multihashCode = next();\n const digestSize = next();\n const size = offset + digestSize;\n const multihashSize = size - prefixSize;\n return {\n version,\n codec,\n multihashCode,\n digestSize,\n multihashSize,\n size\n };\n }\n static parse(source, base) {\n const [prefix, bytes] = parseCIDtoBytes(source, base);\n const cid = CID.decode(bytes);\n cid._baseCache.set(prefix, source);\n return cid;\n }\n}\nconst parseCIDtoBytes = (source, base) => {\n switch (source[0]) {\n case 'Q': {\n const decoder = base || base58.base58btc;\n return [\n base58.base58btc.prefix,\n decoder.decode(`${ base58.base58btc.prefix }${ source }`)\n ];\n }\n case base58.base58btc.prefix: {\n const decoder = base || base58.base58btc;\n return [\n base58.base58btc.prefix,\n decoder.decode(source)\n ];\n }\n case base32.base32.prefix: {\n const decoder = base || base32.base32;\n return [\n base32.base32.prefix,\n decoder.decode(source)\n ];\n }\n default: {\n if (base == null) {\n throw Error('To parse non base32 or base58btc encoded CID multibase decoder must be provided');\n }\n return [\n source[0],\n base.decode(source)\n ];\n }\n }\n};\nconst toStringV0 = (bytes, cache, base) => {\n const {prefix} = base;\n if (prefix !== base58.base58btc.prefix) {\n throw Error(`Cannot string encode V0 in ${ base.name } encoding`);\n }\n const cid = cache.get(prefix);\n if (cid == null) {\n const cid = base.encode(bytes).slice(1);\n cache.set(prefix, cid);\n return cid;\n } else {\n return cid;\n }\n};\nconst toStringV1 = (bytes, cache, base) => {\n const {prefix} = base;\n const cid = cache.get(prefix);\n if (cid == null) {\n const cid = base.encode(bytes);\n cache.set(prefix, cid);\n return cid;\n } else {\n return cid;\n }\n};\nconst DAG_PB_CODE = 112;\nconst SHA_256_CODE = 18;\nconst encodeCID = (version, code, multihash) => {\n const codeOffset = varint.encodingLength(version);\n const hashOffset = codeOffset + varint.encodingLength(code);\n const bytes = new Uint8Array(hashOffset + multihash.byteLength);\n varint.encodeTo(version, bytes, 0);\n varint.encodeTo(code, bytes, codeOffset);\n bytes.set(multihash, hashOffset);\n return bytes;\n};\nconst cidSymbol = Symbol.for('@ipld/js-cid/CID');\nconst readonly = {\n writable: false,\n configurable: false,\n enumerable: true\n};\nconst hidden = {\n writable: false,\n enumerable: false,\n configurable: false\n};\nconst version = '0.0.0-dev';\nconst deprecate = (range, message) => {\n if (range.test(version)) {\n console.warn(message);\n } else {\n throw new Error(message);\n }\n};\nconst IS_CID_DEPRECATION = `CID.isCID(v) is deprecated and will be removed in the next major release.\nFollowing code pattern:\n\nif (CID.isCID(value)) {\n doSomethingWithCID(value)\n}\n\nIs replaced with:\n\nconst cid = CID.asCID(value)\nif (cid) {\n // Make sure to use cid instead of value\n doSomethingWithCID(cid)\n}\n`;\n\nexports.CID = CID;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst textEncoder = new TextEncoder();\nconst textDecoder = new TextDecoder();\nconst name = 'json';\nconst code = 512;\nconst encode = node => textEncoder.encode(JSON.stringify(node));\nconst decode = data => JSON.parse(textDecoder.decode(data));\n\nexports.code = code;\nexports.decode = decode;\nexports.encode = encode;\nexports.name = name;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar bytes = require('../bytes.js');\n\nconst name = 'raw';\nconst code = 85;\nconst encode = node => bytes.coerce(node);\nconst decode = data => bytes.coerce(data);\n\nexports.code = code;\nexports.decode = decode;\nexports.encode = encode;\nexports.name = name;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar bytes = require('../bytes.js');\nvar varint = require('../varint.js');\n\nconst create = (code, digest) => {\n const size = digest.byteLength;\n const sizeOffset = varint.encodingLength(code);\n const digestOffset = sizeOffset + varint.encodingLength(size);\n const bytes = new Uint8Array(digestOffset + size);\n varint.encodeTo(code, bytes, 0);\n varint.encodeTo(size, bytes, sizeOffset);\n bytes.set(digest, digestOffset);\n return new Digest(code, size, digest, bytes);\n};\nconst decode = multihash => {\n const bytes$1 = bytes.coerce(multihash);\n const [code, sizeOffset] = varint.decode(bytes$1);\n const [size, digestOffset] = varint.decode(bytes$1.subarray(sizeOffset));\n const digest = bytes$1.subarray(sizeOffset + digestOffset);\n if (digest.byteLength !== size) {\n throw new Error('Incorrect length');\n }\n return new Digest(code, size, digest, bytes$1);\n};\nconst equals = (a, b) => {\n if (a === b) {\n return true;\n } else {\n return a.code === b.code && a.size === b.size && bytes.equals(a.bytes, b.bytes);\n }\n};\nclass Digest {\n constructor(code, size, digest, bytes) {\n this.code = code;\n this.size = size;\n this.digest = digest;\n this.bytes = bytes;\n }\n}\n\nexports.Digest = Digest;\nexports.create = create;\nexports.decode = decode;\nexports.equals = equals;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar digest = require('./digest.js');\n\nconst from = ({name, code, encode}) => new Hasher(name, code, encode);\nclass Hasher {\n constructor(name, code, encode) {\n this.name = name;\n this.code = code;\n this.encode = encode;\n }\n digest(input) {\n if (input instanceof Uint8Array) {\n const result = this.encode(input);\n return result instanceof Uint8Array ? digest.create(this.code, result) : result.then(digest$1 => digest.create(this.code, digest$1));\n } else {\n throw Error('Unknown type, must be binary type');\n }\n }\n}\n\nexports.Hasher = Hasher;\nexports.from = from;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar bytes = require('../bytes.js');\nvar digest$1 = require('./digest.js');\n\nconst code = 0;\nconst name = 'identity';\nconst encode = bytes.coerce;\nconst digest = input => digest$1.create(code, encode(input));\nconst identity = {\n code,\n name,\n encode,\n digest\n};\n\nexports.identity = identity;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar crypto = require('crypto');\nvar hasher = require('./hasher.js');\nvar bytes = require('../bytes.js');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar crypto__default = /*#__PURE__*/_interopDefaultLegacy(crypto);\n\nconst sha256 = hasher.from({\n name: 'sha2-256',\n code: 18,\n encode: input => bytes.coerce(crypto__default[\"default\"].createHash('sha256').update(input).digest())\n});\nconst sha512 = hasher.from({\n name: 'sha2-512',\n code: 19,\n encode: input => bytes.coerce(crypto__default[\"default\"].createHash('sha512').update(input).digest())\n});\n\nexports.sha256 = sha256;\nexports.sha512 = sha512;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar cid = require('./cid.js');\nvar varint = require('./varint.js');\nvar bytes = require('./bytes.js');\nvar hasher = require('./hashes/hasher.js');\nvar digest = require('./hashes/digest.js');\n\n\n\nexports.CID = cid.CID;\nexports.varint = varint;\nexports.bytes = bytes;\nexports.hasher = hasher;\nexports.digest = digest;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar varint$1 = require('../vendor/varint.js');\n\nconst decode = data => {\n const code = varint$1.decode(data);\n return [\n code,\n varint$1.decode.bytes\n ];\n};\nconst encodeTo = (int, target, offset = 0) => {\n varint$1.encode(int, target, offset);\n return target;\n};\nconst encodingLength = int => {\n return varint$1.encodingLength(int);\n};\n\nexports.decode = decode;\nexports.encodeTo = encodeTo;\nexports.encodingLength = encodingLength;\n","'use strict';\n\nfunction base(ALPHABET, name) {\n if (ALPHABET.length >= 255) {\n throw new TypeError('Alphabet too long');\n }\n var BASE_MAP = new Uint8Array(256);\n for (var j = 0; j < BASE_MAP.length; j++) {\n BASE_MAP[j] = 255;\n }\n for (var i = 0; i < ALPHABET.length; i++) {\n var x = ALPHABET.charAt(i);\n var xc = x.charCodeAt(0);\n if (BASE_MAP[xc] !== 255) {\n throw new TypeError(x + ' is ambiguous');\n }\n BASE_MAP[xc] = i;\n }\n var BASE = ALPHABET.length;\n var LEADER = ALPHABET.charAt(0);\n var FACTOR = Math.log(BASE) / Math.log(256);\n var iFACTOR = Math.log(256) / Math.log(BASE);\n function encode(source) {\n if (source instanceof Uint8Array);\n else if (ArrayBuffer.isView(source)) {\n source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);\n } else if (Array.isArray(source)) {\n source = Uint8Array.from(source);\n }\n if (!(source instanceof Uint8Array)) {\n throw new TypeError('Expected Uint8Array');\n }\n if (source.length === 0) {\n return '';\n }\n var zeroes = 0;\n var length = 0;\n var pbegin = 0;\n var pend = source.length;\n while (pbegin !== pend && source[pbegin] === 0) {\n pbegin++;\n zeroes++;\n }\n var size = (pend - pbegin) * iFACTOR + 1 >>> 0;\n var b58 = new Uint8Array(size);\n while (pbegin !== pend) {\n var carry = source[pbegin];\n var i = 0;\n for (var it1 = size - 1; (carry !== 0 || i < length) && it1 !== -1; it1--, i++) {\n carry += 256 * b58[it1] >>> 0;\n b58[it1] = carry % BASE >>> 0;\n carry = carry / BASE >>> 0;\n }\n if (carry !== 0) {\n throw new Error('Non-zero carry');\n }\n length = i;\n pbegin++;\n }\n var it2 = size - length;\n while (it2 !== size && b58[it2] === 0) {\n it2++;\n }\n var str = LEADER.repeat(zeroes);\n for (; it2 < size; ++it2) {\n str += ALPHABET.charAt(b58[it2]);\n }\n return str;\n }\n function decodeUnsafe(source) {\n if (typeof source !== 'string') {\n throw new TypeError('Expected String');\n }\n if (source.length === 0) {\n return new Uint8Array();\n }\n var psz = 0;\n if (source[psz] === ' ') {\n return;\n }\n var zeroes = 0;\n var length = 0;\n while (source[psz] === LEADER) {\n zeroes++;\n psz++;\n }\n var size = (source.length - psz) * FACTOR + 1 >>> 0;\n var b256 = new Uint8Array(size);\n while (source[psz]) {\n var carry = BASE_MAP[source.charCodeAt(psz)];\n if (carry === 255) {\n return;\n }\n var i = 0;\n for (var it3 = size - 1; (carry !== 0 || i < length) && it3 !== -1; it3--, i++) {\n carry += BASE * b256[it3] >>> 0;\n b256[it3] = carry % 256 >>> 0;\n carry = carry / 256 >>> 0;\n }\n if (carry !== 0) {\n throw new Error('Non-zero carry');\n }\n length = i;\n psz++;\n }\n if (source[psz] === ' ') {\n return;\n }\n var it4 = size - length;\n while (it4 !== size && b256[it4] === 0) {\n it4++;\n }\n var vch = new Uint8Array(zeroes + (size - it4));\n var j = zeroes;\n while (it4 !== size) {\n vch[j++] = b256[it4++];\n }\n return vch;\n }\n function decode(string) {\n var buffer = decodeUnsafe(string);\n if (buffer) {\n return buffer;\n }\n throw new Error(`Non-${ name } character`);\n }\n return {\n encode: encode,\n decodeUnsafe: decodeUnsafe,\n decode: decode\n };\n}\nvar src = base;\nvar _brrp__multiformats_scope_baseX = src;\n\nmodule.exports = _brrp__multiformats_scope_baseX;\n","'use strict';\n\nvar encode_1 = encode;\nvar MSB = 128, REST = 127, MSBALL = ~REST, INT = Math.pow(2, 31);\nfunction encode(num, out, offset) {\n out = out || [];\n offset = offset || 0;\n var oldOffset = offset;\n while (num >= INT) {\n out[offset++] = num & 255 | MSB;\n num /= 128;\n }\n while (num & MSBALL) {\n out[offset++] = num & 255 | MSB;\n num >>>= 7;\n }\n out[offset] = num | 0;\n encode.bytes = offset - oldOffset + 1;\n return out;\n}\nvar decode = read;\nvar MSB$1 = 128, REST$1 = 127;\nfunction read(buf, offset) {\n var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf.length;\n do {\n if (counter >= l) {\n read.bytes = 0;\n throw new RangeError('Could not decode varint');\n }\n b = buf[counter++];\n res += shift < 28 ? (b & REST$1) << shift : (b & REST$1) * Math.pow(2, shift);\n shift += 7;\n } while (b >= MSB$1);\n read.bytes = counter - offset;\n return res;\n}\nvar N1 = Math.pow(2, 7);\nvar N2 = Math.pow(2, 14);\nvar N3 = Math.pow(2, 21);\nvar N4 = Math.pow(2, 28);\nvar N5 = Math.pow(2, 35);\nvar N6 = Math.pow(2, 42);\nvar N7 = Math.pow(2, 49);\nvar N8 = Math.pow(2, 56);\nvar N9 = Math.pow(2, 63);\nvar length = function (value) {\n return value < N1 ? 1 : value < N2 ? 2 : value < N3 ? 3 : value < N4 ? 4 : value < N5 ? 5 : value < N6 ? 6 : value < N7 ? 7 : value < N8 ? 8 : value < N9 ? 9 : 10;\n};\nvar varint = {\n encode: encode_1,\n decode: decode,\n encodingLength: length\n};\nvar _brrp_varint = varint;\nvar varint$1 = _brrp_varint;\n\nmodule.exports = varint$1;\n","module.exports = require('./lib/murmurHash3js');\n","/* jshint -W086: true */\n// +----------------------------------------------------------------------+\n// | murmurHash3js.js v3.0.1 // https://github.com/pid/murmurHash3js\n// | A javascript implementation of MurmurHash3's x86 hashing algorithms. |\n// |----------------------------------------------------------------------|\n// | Copyright (c) 2012-2015 Karan Lyons |\n// | https://github.com/karanlyons/murmurHash3.js/blob/c1778f75792abef7bdd74bc85d2d4e1a3d25cfe9/murmurHash3.js |\n// | Freely distributable under the MIT license. |\n// +----------------------------------------------------------------------+\n\n;(function (root, undefined) {\n 'use strict';\n\n // Create a local object that'll be exported or referenced globally.\n var library = {\n 'version': '3.0.0',\n 'x86': {},\n 'x64': {},\n 'inputValidation': true\n };\n\n // PRIVATE FUNCTIONS\n // -----------------\n\n function _validBytes(bytes) {\n // check the input is an array or a typed array\n if (!Array.isArray(bytes) && !ArrayBuffer.isView(bytes)) {\n return false;\n }\n\n // check all bytes are actually bytes\n for (var i = 0; i < bytes.length; i++) {\n if (!Number.isInteger(bytes[i]) || bytes[i] < 0 || bytes[i] > 255) {\n return false;\n }\n }\n return true;\n }\n\n function _x86Multiply(m, n) {\n //\n // Given two 32bit ints, returns the two multiplied together as a\n // 32bit int.\n //\n\n return ((m & 0xffff) * n) + ((((m >>> 16) * n) & 0xffff) << 16);\n }\n\n function _x86Rotl(m, n) {\n //\n // Given a 32bit int and an int representing a number of bit positions,\n // returns the 32bit int rotated left by that number of positions.\n //\n\n return (m << n) | (m >>> (32 - n));\n }\n\n function _x86Fmix(h) {\n //\n // Given a block, returns murmurHash3's final x86 mix of that block.\n //\n\n h ^= h >>> 16;\n h = _x86Multiply(h, 0x85ebca6b);\n h ^= h >>> 13;\n h = _x86Multiply(h, 0xc2b2ae35);\n h ^= h >>> 16;\n\n return h;\n }\n\n function _x64Add(m, n) {\n //\n // Given two 64bit ints (as an array of two 32bit ints) returns the two\n // added together as a 64bit int (as an array of two 32bit ints).\n //\n\n m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];\n n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];\n var o = [0, 0, 0, 0];\n\n o[3] += m[3] + n[3];\n o[2] += o[3] >>> 16;\n o[3] &= 0xffff;\n\n o[2] += m[2] + n[2];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n\n o[1] += m[1] + n[1];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n\n o[0] += m[0] + n[0];\n o[0] &= 0xffff;\n\n return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];\n }\n\n function _x64Multiply(m, n) {\n //\n // Given two 64bit ints (as an array of two 32bit ints) returns the two\n // multiplied together as a 64bit int (as an array of two 32bit ints).\n //\n\n m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];\n n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];\n var o = [0, 0, 0, 0];\n\n o[3] += m[3] * n[3];\n o[2] += o[3] >>> 16;\n o[3] &= 0xffff;\n\n o[2] += m[2] * n[3];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n\n o[2] += m[3] * n[2];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n\n o[1] += m[1] * n[3];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n\n o[1] += m[2] * n[2];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n\n o[1] += m[3] * n[1];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n\n o[0] += (m[0] * n[3]) + (m[1] * n[2]) + (m[2] * n[1]) + (m[3] * n[0]);\n o[0] &= 0xffff;\n\n return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];\n }\n\n function _x64Rotl(m, n) {\n //\n // Given a 64bit int (as an array of two 32bit ints) and an int\n // representing a number of bit positions, returns the 64bit int (as an\n // array of two 32bit ints) rotated left by that number of positions.\n //\n\n n %= 64;\n\n if (n === 32) {\n return [m[1], m[0]];\n } else if (n < 32) {\n return [(m[0] << n) | (m[1] >>> (32 - n)), (m[1] << n) | (m[0] >>> (32 - n))];\n } else {\n n -= 32;\n return [(m[1] << n) | (m[0] >>> (32 - n)), (m[0] << n) | (m[1] >>> (32 - n))];\n }\n }\n\n function _x64LeftShift(m, n) {\n //\n // Given a 64bit int (as an array of two 32bit ints) and an int\n // representing a number of bit positions, returns the 64bit int (as an\n // array of two 32bit ints) shifted left by that number of positions.\n //\n\n n %= 64;\n\n if (n === 0) {\n return m;\n } else if (n < 32) {\n return [(m[0] << n) | (m[1] >>> (32 - n)), m[1] << n];\n } else {\n return [m[1] << (n - 32), 0];\n }\n }\n\n function _x64Xor(m, n) {\n //\n // Given two 64bit ints (as an array of two 32bit ints) returns the two\n // xored together as a 64bit int (as an array of two 32bit ints).\n //\n\n return [m[0] ^ n[0], m[1] ^ n[1]];\n }\n\n function _x64Fmix(h) {\n //\n // Given a block, returns murmurHash3's final x64 mix of that block.\n // (`[0, h[0] >>> 1]` is a 33 bit unsigned right shift. This is the\n // only place where we need to right shift 64bit ints.)\n //\n\n h = _x64Xor(h, [0, h[0] >>> 1]);\n h = _x64Multiply(h, [0xff51afd7, 0xed558ccd]);\n h = _x64Xor(h, [0, h[0] >>> 1]);\n h = _x64Multiply(h, [0xc4ceb9fe, 0x1a85ec53]);\n h = _x64Xor(h, [0, h[0] >>> 1]);\n\n return h;\n }\n\n // PUBLIC FUNCTIONS\n // ----------------\n\n library.x86.hash32 = function (bytes, seed) {\n //\n // Given a string and an optional seed as an int, returns a 32 bit hash\n // using the x86 flavor of MurmurHash3, as an unsigned int.\n //\n if (library.inputValidation && !_validBytes(bytes)) {\n return undefined;\n }\n seed = seed || 0;\n\n var remainder = bytes.length % 4;\n var blocks = bytes.length - remainder;\n\n var h1 = seed;\n\n var k1 = 0;\n\n var c1 = 0xcc9e2d51;\n var c2 = 0x1b873593;\n\n for (var i = 0; i < blocks; i = i + 4) {\n k1 = (bytes[i]) | (bytes[i + 1] << 8) | (bytes[i + 2] << 16) | (bytes[i + 3] << 24);\n\n k1 = _x86Multiply(k1, c1);\n k1 = _x86Rotl(k1, 15);\n k1 = _x86Multiply(k1, c2);\n\n h1 ^= k1;\n h1 = _x86Rotl(h1, 13);\n h1 = _x86Multiply(h1, 5) + 0xe6546b64;\n }\n\n k1 = 0;\n\n switch (remainder) {\n case 3:\n k1 ^= bytes[i + 2] << 16;\n\n case 2:\n k1 ^= bytes[i + 1] << 8;\n\n case 1:\n k1 ^= bytes[i];\n k1 = _x86Multiply(k1, c1);\n k1 = _x86Rotl(k1, 15);\n k1 = _x86Multiply(k1, c2);\n h1 ^= k1;\n }\n\n h1 ^= bytes.length;\n h1 = _x86Fmix(h1);\n\n return h1 >>> 0;\n };\n\n library.x86.hash128 = function (bytes, seed) {\n //\n // Given a string and an optional seed as an int, returns a 128 bit\n // hash using the x86 flavor of MurmurHash3, as an unsigned hex.\n //\n if (library.inputValidation && !_validBytes(bytes)) {\n return undefined;\n }\n\n seed = seed || 0;\n var remainder = bytes.length % 16;\n var blocks = bytes.length - remainder;\n\n var h1 = seed;\n var h2 = seed;\n var h3 = seed;\n var h4 = seed;\n\n var k1 = 0;\n var k2 = 0;\n var k3 = 0;\n var k4 = 0;\n\n var c1 = 0x239b961b;\n var c2 = 0xab0e9789;\n var c3 = 0x38b34ae5;\n var c4 = 0xa1e38b93;\n\n for (var i = 0; i < blocks; i = i + 16) {\n k1 = (bytes[i]) | (bytes[i + 1] << 8) | (bytes[i + 2] << 16) | (bytes[i + 3] << 24);\n k2 = (bytes[i + 4]) | (bytes[i + 5] << 8) | (bytes[i + 6] << 16) | (bytes[i + 7] << 24);\n k3 = (bytes[i + 8]) | (bytes[i + 9] << 8) | (bytes[i + 10] << 16) | (bytes[i + 11] << 24);\n k4 = (bytes[i + 12]) | (bytes[i + 13] << 8) | (bytes[i + 14] << 16) | (bytes[i + 15] << 24);\n\n k1 = _x86Multiply(k1, c1);\n k1 = _x86Rotl(k1, 15);\n k1 = _x86Multiply(k1, c2);\n h1 ^= k1;\n\n h1 = _x86Rotl(h1, 19);\n h1 += h2;\n h1 = _x86Multiply(h1, 5) + 0x561ccd1b;\n\n k2 = _x86Multiply(k2, c2);\n k2 = _x86Rotl(k2, 16);\n k2 = _x86Multiply(k2, c3);\n h2 ^= k2;\n\n h2 = _x86Rotl(h2, 17);\n h2 += h3;\n h2 = _x86Multiply(h2, 5) + 0x0bcaa747;\n\n k3 = _x86Multiply(k3, c3);\n k3 = _x86Rotl(k3, 17);\n k3 = _x86Multiply(k3, c4);\n h3 ^= k3;\n\n h3 = _x86Rotl(h3, 15);\n h3 += h4;\n h3 = _x86Multiply(h3, 5) + 0x96cd1c35;\n\n k4 = _x86Multiply(k4, c4);\n k4 = _x86Rotl(k4, 18);\n k4 = _x86Multiply(k4, c1);\n h4 ^= k4;\n\n h4 = _x86Rotl(h4, 13);\n h4 += h1;\n h4 = _x86Multiply(h4, 5) + 0x32ac3b17;\n }\n\n k1 = 0;\n k2 = 0;\n k3 = 0;\n k4 = 0;\n\n switch (remainder) {\n case 15:\n k4 ^= bytes[i + 14] << 16;\n\n case 14:\n k4 ^= bytes[i + 13] << 8;\n\n case 13:\n k4 ^= bytes[i + 12];\n k4 = _x86Multiply(k4, c4);\n k4 = _x86Rotl(k4, 18);\n k4 = _x86Multiply(k4, c1);\n h4 ^= k4;\n\n case 12:\n k3 ^= bytes[i + 11] << 24;\n\n case 11:\n k3 ^= bytes[i + 10] << 16;\n\n case 10:\n k3 ^= bytes[i + 9] << 8;\n\n case 9:\n k3 ^= bytes[i + 8];\n k3 = _x86Multiply(k3, c3);\n k3 = _x86Rotl(k3, 17);\n k3 = _x86Multiply(k3, c4);\n h3 ^= k3;\n\n case 8:\n k2 ^= bytes[i + 7] << 24;\n\n case 7:\n k2 ^= bytes[i + 6] << 16;\n\n case 6:\n k2 ^= bytes[i + 5] << 8;\n\n case 5:\n k2 ^= bytes[i + 4];\n k2 = _x86Multiply(k2, c2);\n k2 = _x86Rotl(k2, 16);\n k2 = _x86Multiply(k2, c3);\n h2 ^= k2;\n\n case 4:\n k1 ^= bytes[i + 3] << 24;\n\n case 3:\n k1 ^= bytes[i + 2] << 16;\n\n case 2:\n k1 ^= bytes[i + 1] << 8;\n\n case 1:\n k1 ^= bytes[i];\n k1 = _x86Multiply(k1, c1);\n k1 = _x86Rotl(k1, 15);\n k1 = _x86Multiply(k1, c2);\n h1 ^= k1;\n }\n\n h1 ^= bytes.length;\n h2 ^= bytes.length;\n h3 ^= bytes.length;\n h4 ^= bytes.length;\n\n h1 += h2;\n h1 += h3;\n h1 += h4;\n h2 += h1;\n h3 += h1;\n h4 += h1;\n\n h1 = _x86Fmix(h1);\n h2 = _x86Fmix(h2);\n h3 = _x86Fmix(h3);\n h4 = _x86Fmix(h4);\n\n h1 += h2;\n h1 += h3;\n h1 += h4;\n h2 += h1;\n h3 += h1;\n h4 += h1;\n\n return (\"00000000\" + (h1 >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h2 >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h3 >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h4 >>> 0).toString(16)).slice(-8);\n };\n\n library.x64.hash128 = function (bytes, seed) {\n //\n // Given a string and an optional seed as an int, returns a 128 bit\n // hash using the x64 flavor of MurmurHash3, as an unsigned hex.\n //\n if (library.inputValidation && !_validBytes(bytes)) {\n return undefined;\n }\n seed = seed || 0;\n\n var remainder = bytes.length % 16;\n var blocks = bytes.length - remainder;\n\n var h1 = [0, seed];\n var h2 = [0, seed];\n\n var k1 = [0, 0];\n var k2 = [0, 0];\n\n var c1 = [0x87c37b91, 0x114253d5];\n var c2 = [0x4cf5ad43, 0x2745937f];\n\n for (var i = 0; i < blocks; i = i + 16) {\n k1 = [(bytes[i + 4]) | (bytes[i + 5] << 8) | (bytes[i + 6] << 16) | (bytes[i + 7] << 24), (bytes[i]) |\n (bytes[i + 1] << 8) | (bytes[i + 2] << 16) | (bytes[i + 3] << 24)];\n k2 = [(bytes[i + 12]) | (bytes[i + 13] << 8) | (bytes[i + 14] << 16) | (bytes[i + 15] << 24), (bytes[i + 8]) |\n (bytes[i + 9] << 8) | (bytes[i + 10] << 16) | (bytes[i + 11] << 24)];\n\n k1 = _x64Multiply(k1, c1);\n k1 = _x64Rotl(k1, 31);\n k1 = _x64Multiply(k1, c2);\n h1 = _x64Xor(h1, k1);\n\n h1 = _x64Rotl(h1, 27);\n h1 = _x64Add(h1, h2);\n h1 = _x64Add(_x64Multiply(h1, [0, 5]), [0, 0x52dce729]);\n\n k2 = _x64Multiply(k2, c2);\n k2 = _x64Rotl(k2, 33);\n k2 = _x64Multiply(k2, c1);\n h2 = _x64Xor(h2, k2);\n\n h2 = _x64Rotl(h2, 31);\n h2 = _x64Add(h2, h1);\n h2 = _x64Add(_x64Multiply(h2, [0, 5]), [0, 0x38495ab5]);\n }\n\n k1 = [0, 0];\n k2 = [0, 0];\n\n switch (remainder) {\n case 15:\n k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 14]], 48));\n\n case 14:\n k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 13]], 40));\n\n case 13:\n k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 12]], 32));\n\n case 12:\n k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 11]], 24));\n\n case 11:\n k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 10]], 16));\n\n case 10:\n k2 = _x64Xor(k2, _x64LeftShift([0, bytes[i + 9]], 8));\n\n case 9:\n k2 = _x64Xor(k2, [0, bytes[i + 8]]);\n k2 = _x64Multiply(k2, c2);\n k2 = _x64Rotl(k2, 33);\n k2 = _x64Multiply(k2, c1);\n h2 = _x64Xor(h2, k2);\n\n case 8:\n k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 7]], 56));\n\n case 7:\n k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 6]], 48));\n\n case 6:\n k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 5]], 40));\n\n case 5:\n k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 4]], 32));\n\n case 4:\n k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 3]], 24));\n\n case 3:\n k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 2]], 16));\n\n case 2:\n k1 = _x64Xor(k1, _x64LeftShift([0, bytes[i + 1]], 8));\n\n case 1:\n k1 = _x64Xor(k1, [0, bytes[i]]);\n k1 = _x64Multiply(k1, c1);\n k1 = _x64Rotl(k1, 31);\n k1 = _x64Multiply(k1, c2);\n h1 = _x64Xor(h1, k1);\n }\n\n h1 = _x64Xor(h1, [0, bytes.length]);\n h2 = _x64Xor(h2, [0, bytes.length]);\n\n h1 = _x64Add(h1, h2);\n h2 = _x64Add(h2, h1);\n\n h1 = _x64Fmix(h1);\n h2 = _x64Fmix(h2);\n\n h1 = _x64Add(h1, h2);\n h2 = _x64Add(h2, h1);\n\n return (\"00000000\" + (h1[0] >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h1[1] >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h2[0] >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h2[1] >>> 0).toString(16)).slice(-8);\n };\n\n // INITIALIZATION\n // --------------\n\n // Export murmurHash3 for CommonJS, either as an AMD module or just as part\n // of the global object.\n if (typeof exports !== 'undefined') {\n\n if (typeof module !== 'undefined' && module.exports) {\n exports = module.exports = library;\n }\n\n exports.murmurHash3 = library;\n\n } else if (typeof define === 'function' && define.amd) {\n\n define([], function () {\n return library;\n });\n } else {\n\n // Use murmurHash3.noConflict to restore `murmurHash3` back to its\n // original value. Returns a reference to the library object, to allow\n // it to be used under a different name.\n library._murmurHash3 = root.murmurHash3;\n\n library.noConflict = function () {\n root.murmurHash3 = library._murmurHash3;\n library._murmurHash3 = undefined;\n library.noConflict = undefined;\n\n return library;\n };\n\n root.murmurHash3 = library;\n }\n})(this);\n","'use strict';\nconst retry = require('retry');\n\nconst networkErrorMsgs = [\n\t'Failed to fetch', // Chrome\n\t'NetworkError when attempting to fetch resource.', // Firefox\n\t'The Internet connection appears to be offline.', // Safari\n\t'Network request failed' // `cross-fetch`\n];\n\nclass AbortError extends Error {\n\tconstructor(message) {\n\t\tsuper();\n\n\t\tif (message instanceof Error) {\n\t\t\tthis.originalError = message;\n\t\t\t({message} = message);\n\t\t} else {\n\t\t\tthis.originalError = new Error(message);\n\t\t\tthis.originalError.stack = this.stack;\n\t\t}\n\n\t\tthis.name = 'AbortError';\n\t\tthis.message = message;\n\t}\n}\n\nconst decorateErrorWithCounts = (error, attemptNumber, options) => {\n\t// Minus 1 from attemptNumber because the first attempt does not count as a retry\n\tconst retriesLeft = options.retries - (attemptNumber - 1);\n\n\terror.attemptNumber = attemptNumber;\n\terror.retriesLeft = retriesLeft;\n\treturn error;\n};\n\nconst isNetworkError = errorMessage => networkErrorMsgs.includes(errorMessage);\n\nconst pRetry = (input, options) => new Promise((resolve, reject) => {\n\toptions = {\n\t\tonFailedAttempt: () => {},\n\t\tretries: 10,\n\t\t...options\n\t};\n\n\tconst operation = retry.operation(options);\n\n\toperation.attempt(async attemptNumber => {\n\t\ttry {\n\t\t\tresolve(await input(attemptNumber));\n\t\t} catch (error) {\n\t\t\tif (!(error instanceof Error)) {\n\t\t\t\treject(new TypeError(`Non-error was thrown: \"${error}\". You should only throw errors.`));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (error instanceof AbortError) {\n\t\t\t\toperation.stop();\n\t\t\t\treject(error.originalError);\n\t\t\t} else if (error instanceof TypeError && !isNetworkError(error.message)) {\n\t\t\t\toperation.stop();\n\t\t\t\treject(error);\n\t\t\t} else {\n\t\t\t\tdecorateErrorWithCounts(error, attemptNumber, options);\n\n\t\t\t\ttry {\n\t\t\t\t\tawait options.onFailedAttempt(error);\n\t\t\t\t} catch (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (!operation.retry(error)) {\n\t\t\t\t\treject(operation.mainError());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n});\n\nmodule.exports = pRetry;\n// TODO: remove this in the next major version\nmodule.exports.default = pRetry;\n\nmodule.exports.AbortError = AbortError;\n","// minimal library entry point.\n\n\"use strict\";\nmodule.exports = require(\"./src/index-minimal\");\n","\"use strict\";\nvar protobuf = exports;\n\n/**\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\n * @name build\n * @type {string}\n * @const\n */\nprotobuf.build = \"minimal\";\n\n// Serialization\nprotobuf.Writer = require(\"./writer\");\nprotobuf.BufferWriter = require(\"./writer_buffer\");\nprotobuf.Reader = require(\"./reader\");\nprotobuf.BufferReader = require(\"./reader_buffer\");\n\n// Utility\nprotobuf.util = require(\"./util/minimal\");\nprotobuf.rpc = require(\"./rpc\");\nprotobuf.roots = require(\"./roots\");\nprotobuf.configure = configure;\n\n/* istanbul ignore next */\n/**\n * Reconfigures the library according to the environment.\n * @returns {undefined}\n */\nfunction configure() {\n protobuf.util._configure();\n protobuf.Writer._configure(protobuf.BufferWriter);\n protobuf.Reader._configure(protobuf.BufferReader);\n}\n\n// Set up buffer utility according to the environment\nconfigure();\n","\"use strict\";\nmodule.exports = Reader;\n\nvar util = require(\"./util/minimal\");\n\nvar BufferReader; // cyclic\n\nvar LongBits = util.LongBits,\n utf8 = util.utf8;\n\n/* istanbul ignore next */\nfunction indexOutOfRange(reader, writeLength) {\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\n}\n\n/**\n * Constructs a new reader instance using the specified buffer.\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n * @param {Uint8Array} buffer Buffer to read from\n */\nfunction Reader(buffer) {\n\n /**\n * Read buffer.\n * @type {Uint8Array}\n */\n this.buf = buffer;\n\n /**\n * Read buffer position.\n * @type {number}\n */\n this.pos = 0;\n\n /**\n * Read buffer length.\n * @type {number}\n */\n this.len = buffer.length;\n}\n\nvar create_array = typeof Uint8Array !== \"undefined\"\n ? function create_typed_array(buffer) {\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n }\n /* istanbul ignore next */\n : function create_array(buffer) {\n if (Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n };\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup(buffer) {\n return (Reader.create = function create_buffer(buffer) {\n return util.Buffer.isBuffer(buffer)\n ? new BufferReader(buffer)\n /* istanbul ignore next */\n : create_array(buffer);\n })(buffer);\n }\n /* istanbul ignore next */\n : create_array;\n};\n\n/**\n * Creates a new reader using the specified buffer.\n * @function\n * @param {Uint8Array|Buffer} buffer Buffer to read from\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\n * @throws {Error} If `buffer` is not a valid buffer\n */\nReader.create = create();\n\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\n\n/**\n * Reads a varint as an unsigned 32 bit value.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.uint32 = (function read_uint32_setup() {\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\n return function read_uint32() {\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\n\n /* istanbul ignore if */\n if ((this.pos += 5) > this.len) {\n this.pos = this.len;\n throw indexOutOfRange(this, 10);\n }\n return value;\n };\n})();\n\n/**\n * Reads a varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.int32 = function read_int32() {\n return this.uint32() | 0;\n};\n\n/**\n * Reads a zig-zag encoded varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.sint32 = function read_sint32() {\n var value = this.uint32();\n return value >>> 1 ^ -(value & 1) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readLongVarint() {\n // tends to deopt with local vars for octet etc.\n var bits = new LongBits(0, 0);\n var i = 0;\n if (this.len - this.pos > 4) { // fast route (lo)\n for (; i < 4; ++i) {\n // 1st..4th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 5th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n i = 0;\n } else {\n for (; i < 3; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 1st..3th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 4th\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\n return bits;\n }\n if (this.len - this.pos > 4) { // fast route (hi)\n for (; i < 5; ++i) {\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n } else {\n for (; i < 5; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n }\n /* istanbul ignore next */\n throw Error(\"invalid varint encoding\");\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads a varint as a signed 64 bit value.\n * @name Reader#int64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as an unsigned 64 bit value.\n * @name Reader#uint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a zig-zag encoded varint as a signed 64 bit value.\n * @name Reader#sint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as a boolean.\n * @returns {boolean} Value read\n */\nReader.prototype.bool = function read_bool() {\n return this.uint32() !== 0;\n};\n\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\n return (buf[end - 4]\n | buf[end - 3] << 8\n | buf[end - 2] << 16\n | buf[end - 1] << 24) >>> 0;\n}\n\n/**\n * Reads fixed 32 bits as an unsigned 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.fixed32 = function read_fixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4);\n};\n\n/**\n * Reads fixed 32 bits as a signed 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.sfixed32 = function read_sfixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readFixed64(/* this: Reader */) {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 8);\n\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads fixed 64 bits.\n * @name Reader#fixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads zig-zag encoded fixed 64 bits.\n * @name Reader#sfixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a float (32 bit) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.float = function read_float() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readFloatLE(this.buf, this.pos);\n this.pos += 4;\n return value;\n};\n\n/**\n * Reads a double (64 bit float) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.double = function read_double() {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readDoubleLE(this.buf, this.pos);\n this.pos += 8;\n return value;\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @returns {Uint8Array} Value read\n */\nReader.prototype.bytes = function read_bytes() {\n var length = this.uint32(),\n start = this.pos,\n end = this.pos + length;\n\n /* istanbul ignore if */\n if (end > this.len)\n throw indexOutOfRange(this, length);\n\n this.pos += length;\n if (Array.isArray(this.buf)) // plain array\n return this.buf.slice(start, end);\n return start === end // fix for IE 10/Win8 and others' subarray returning array of size 1\n ? new this.buf.constructor(0)\n : this._slice.call(this.buf, start, end);\n};\n\n/**\n * Reads a string preceeded by its byte length as a varint.\n * @returns {string} Value read\n */\nReader.prototype.string = function read_string() {\n var bytes = this.bytes();\n return utf8.read(bytes, 0, bytes.length);\n};\n\n/**\n * Skips the specified number of bytes if specified, otherwise skips a varint.\n * @param {number} [length] Length if known, otherwise a varint is assumed\n * @returns {Reader} `this`\n */\nReader.prototype.skip = function skip(length) {\n if (typeof length === \"number\") {\n /* istanbul ignore if */\n if (this.pos + length > this.len)\n throw indexOutOfRange(this, length);\n this.pos += length;\n } else {\n do {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n } while (this.buf[this.pos++] & 128);\n }\n return this;\n};\n\n/**\n * Skips the next element of the specified wire type.\n * @param {number} wireType Wire type received\n * @returns {Reader} `this`\n */\nReader.prototype.skipType = function(wireType) {\n switch (wireType) {\n case 0:\n this.skip();\n break;\n case 1:\n this.skip(8);\n break;\n case 2:\n this.skip(this.uint32());\n break;\n case 3:\n while ((wireType = this.uint32() & 7) !== 4) {\n this.skipType(wireType);\n }\n break;\n case 5:\n this.skip(4);\n break;\n\n /* istanbul ignore next */\n default:\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n }\n return this;\n};\n\nReader._configure = function(BufferReader_) {\n BufferReader = BufferReader_;\n Reader.create = create();\n BufferReader._configure();\n\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\n util.merge(Reader.prototype, {\n\n int64: function read_int64() {\n return readLongVarint.call(this)[fn](false);\n },\n\n uint64: function read_uint64() {\n return readLongVarint.call(this)[fn](true);\n },\n\n sint64: function read_sint64() {\n return readLongVarint.call(this).zzDecode()[fn](false);\n },\n\n fixed64: function read_fixed64() {\n return readFixed64.call(this)[fn](true);\n },\n\n sfixed64: function read_sfixed64() {\n return readFixed64.call(this)[fn](false);\n }\n\n });\n};\n","\"use strict\";\nmodule.exports = BufferReader;\n\n// extends Reader\nvar Reader = require(\"./reader\");\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\n\nvar util = require(\"./util/minimal\");\n\n/**\n * Constructs a new buffer reader instance.\n * @classdesc Wire format reader using node buffers.\n * @extends Reader\n * @constructor\n * @param {Buffer} buffer Buffer to read from\n */\nfunction BufferReader(buffer) {\n Reader.call(this, buffer);\n\n /**\n * Read buffer.\n * @name BufferReader#buf\n * @type {Buffer}\n */\n}\n\nBufferReader._configure = function () {\n /* istanbul ignore else */\n if (util.Buffer)\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\n};\n\n\n/**\n * @override\n */\nBufferReader.prototype.string = function read_string_buffer() {\n var len = this.uint32(); // modifies pos\n return this.buf.utf8Slice\n ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len))\n : this.buf.toString(\"utf-8\", this.pos, this.pos = Math.min(this.pos + len, this.len));\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @name BufferReader#bytes\n * @function\n * @returns {Buffer} Value read\n */\n\nBufferReader._configure();\n","\"use strict\";\nmodule.exports = {};\n\n/**\n * Named roots.\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\n * Can also be used manually to make roots available accross modules.\n * @name roots\n * @type {Object.}\n * @example\n * // pbjs -r myroot -o compiled.js ...\n *\n * // in another module:\n * require(\"./compiled.js\");\n *\n * // in any subsequent module:\n * var root = protobuf.roots[\"myroot\"];\n */\n","\"use strict\";\n\n/**\n * Streaming RPC helpers.\n * @namespace\n */\nvar rpc = exports;\n\n/**\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\n * @typedef RPCImpl\n * @type {function}\n * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called\n * @param {Uint8Array} requestData Request data\n * @param {RPCImplCallback} callback Callback function\n * @returns {undefined}\n * @example\n * function rpcImpl(method, requestData, callback) {\n * if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\n * throw Error(\"no such method\");\n * asynchronouslyObtainAResponse(requestData, function(err, responseData) {\n * callback(err, responseData);\n * });\n * }\n */\n\n/**\n * Node-style callback as used by {@link RPCImpl}.\n * @typedef RPCImplCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\n * @returns {undefined}\n */\n\nrpc.Service = require(\"./rpc/service\");\n","\"use strict\";\nmodule.exports = Service;\n\nvar util = require(\"../util/minimal\");\n\n// Extends EventEmitter\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\n\n/**\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\n *\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\n * @typedef rpc.ServiceMethodCallback\n * @template TRes extends Message\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {TRes} [response] Response message\n * @returns {undefined}\n */\n\n/**\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\n * @typedef rpc.ServiceMethod\n * @template TReq extends Message\n * @template TRes extends Message\n * @type {function}\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message\n * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined`\n */\n\n/**\n * Constructs a new RPC service instance.\n * @classdesc An RPC service as returned by {@link Service#create}.\n * @exports rpc.Service\n * @extends util.EventEmitter\n * @constructor\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\n\n if (typeof rpcImpl !== \"function\")\n throw TypeError(\"rpcImpl must be a function\");\n\n util.EventEmitter.call(this);\n\n /**\n * RPC implementation. Becomes `null` once the service is ended.\n * @type {RPCImpl|null}\n */\n this.rpcImpl = rpcImpl;\n\n /**\n * Whether requests are length-delimited.\n * @type {boolean}\n */\n this.requestDelimited = Boolean(requestDelimited);\n\n /**\n * Whether responses are length-delimited.\n * @type {boolean}\n */\n this.responseDelimited = Boolean(responseDelimited);\n}\n\n/**\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\n * @param {Method|rpc.ServiceMethod} method Reflected or static method\n * @param {Constructor} requestCtor Request constructor\n * @param {Constructor} responseCtor Response constructor\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} callback Service callback\n * @returns {undefined}\n * @template TReq extends Message\n * @template TRes extends Message\n */\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\n\n if (!request)\n throw TypeError(\"request must be specified\");\n\n var self = this;\n if (!callback)\n return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\n\n if (!self.rpcImpl) {\n setTimeout(function() { callback(Error(\"already ended\")); }, 0);\n return undefined;\n }\n\n try {\n return self.rpcImpl(\n method,\n requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\n function rpcCallback(err, response) {\n\n if (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n\n if (response === null) {\n self.end(/* endedByRPC */ true);\n return undefined;\n }\n\n if (!(response instanceof responseCtor)) {\n try {\n response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\n } catch (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n }\n\n self.emit(\"data\", response, method);\n return callback(null, response);\n }\n );\n } catch (err) {\n self.emit(\"error\", err, method);\n setTimeout(function() { callback(err); }, 0);\n return undefined;\n }\n};\n\n/**\n * Ends this service and emits the `end` event.\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\n * @returns {rpc.Service} `this`\n */\nService.prototype.end = function end(endedByRPC) {\n if (this.rpcImpl) {\n if (!endedByRPC) // signal end to rpcImpl\n this.rpcImpl(null, null, null);\n this.rpcImpl = null;\n this.emit(\"end\").off();\n }\n return this;\n};\n","\"use strict\";\nmodule.exports = LongBits;\n\nvar util = require(\"../util/minimal\");\n\n/**\n * Constructs new long bits.\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\n * @memberof util\n * @constructor\n * @param {number} lo Low 32 bits, unsigned\n * @param {number} hi High 32 bits, unsigned\n */\nfunction LongBits(lo, hi) {\n\n // note that the casts below are theoretically unnecessary as of today, but older statically\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\n\n /**\n * Low bits.\n * @type {number}\n */\n this.lo = lo >>> 0;\n\n /**\n * High bits.\n * @type {number}\n */\n this.hi = hi >>> 0;\n}\n\n/**\n * Zero bits.\n * @memberof util.LongBits\n * @type {util.LongBits}\n */\nvar zero = LongBits.zero = new LongBits(0, 0);\n\nzero.toNumber = function() { return 0; };\nzero.zzEncode = zero.zzDecode = function() { return this; };\nzero.length = function() { return 1; };\n\n/**\n * Zero hash.\n * @memberof util.LongBits\n * @type {string}\n */\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\n\n/**\n * Constructs new long bits from the specified number.\n * @param {number} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.fromNumber = function fromNumber(value) {\n if (value === 0)\n return zero;\n var sign = value < 0;\n if (sign)\n value = -value;\n var lo = value >>> 0,\n hi = (value - lo) / 4294967296 >>> 0;\n if (sign) {\n hi = ~hi >>> 0;\n lo = ~lo >>> 0;\n if (++lo > 4294967295) {\n lo = 0;\n if (++hi > 4294967295)\n hi = 0;\n }\n }\n return new LongBits(lo, hi);\n};\n\n/**\n * Constructs new long bits from a number, long or string.\n * @param {Long|number|string} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.from = function from(value) {\n if (typeof value === \"number\")\n return LongBits.fromNumber(value);\n if (util.isString(value)) {\n /* istanbul ignore else */\n if (util.Long)\n value = util.Long.fromString(value);\n else\n return LongBits.fromNumber(parseInt(value, 10));\n }\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\n};\n\n/**\n * Converts this long bits to a possibly unsafe JavaScript number.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {number} Possibly unsafe number\n */\nLongBits.prototype.toNumber = function toNumber(unsigned) {\n if (!unsigned && this.hi >>> 31) {\n var lo = ~this.lo + 1 >>> 0,\n hi = ~this.hi >>> 0;\n if (!lo)\n hi = hi + 1 >>> 0;\n return -(lo + hi * 4294967296);\n }\n return this.lo + this.hi * 4294967296;\n};\n\n/**\n * Converts this long bits to a long.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long} Long\n */\nLongBits.prototype.toLong = function toLong(unsigned) {\n return util.Long\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\n /* istanbul ignore next */\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\n};\n\nvar charCodeAt = String.prototype.charCodeAt;\n\n/**\n * Constructs new long bits from the specified 8 characters long hash.\n * @param {string} hash Hash\n * @returns {util.LongBits} Bits\n */\nLongBits.fromHash = function fromHash(hash) {\n if (hash === zeroHash)\n return zero;\n return new LongBits(\n ( charCodeAt.call(hash, 0)\n | charCodeAt.call(hash, 1) << 8\n | charCodeAt.call(hash, 2) << 16\n | charCodeAt.call(hash, 3) << 24) >>> 0\n ,\n ( charCodeAt.call(hash, 4)\n | charCodeAt.call(hash, 5) << 8\n | charCodeAt.call(hash, 6) << 16\n | charCodeAt.call(hash, 7) << 24) >>> 0\n );\n};\n\n/**\n * Converts this long bits to a 8 characters long hash.\n * @returns {string} Hash\n */\nLongBits.prototype.toHash = function toHash() {\n return String.fromCharCode(\n this.lo & 255,\n this.lo >>> 8 & 255,\n this.lo >>> 16 & 255,\n this.lo >>> 24 ,\n this.hi & 255,\n this.hi >>> 8 & 255,\n this.hi >>> 16 & 255,\n this.hi >>> 24\n );\n};\n\n/**\n * Zig-zag encodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzEncode = function zzEncode() {\n var mask = this.hi >> 31;\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Zig-zag decodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzDecode = function zzDecode() {\n var mask = -(this.lo & 1);\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Calculates the length of this longbits when encoded as a varint.\n * @returns {number} Length\n */\nLongBits.prototype.length = function length() {\n var part0 = this.lo,\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\n part2 = this.hi >>> 24;\n return part2 === 0\n ? part1 === 0\n ? part0 < 16384\n ? part0 < 128 ? 1 : 2\n : part0 < 2097152 ? 3 : 4\n : part1 < 16384\n ? part1 < 128 ? 5 : 6\n : part1 < 2097152 ? 7 : 8\n : part2 < 128 ? 9 : 10;\n};\n","\"use strict\";\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = require(\"@protobufjs/aspromise\");\n\n// converts to / from base64 encoded strings\nutil.base64 = require(\"@protobufjs/base64\");\n\n// base class of rpc.Service\nutil.EventEmitter = require(\"@protobufjs/eventemitter\");\n\n// float handling accross browsers\nutil.float = require(\"@protobufjs/float\");\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = require(\"@protobufjs/inquire\");\n\n// converts to / from utf8 encoded strings\nutil.utf8 = require(\"@protobufjs/utf8\");\n\n// provides a node-like buffer pool in the browser\nutil.pool = require(\"@protobufjs/pool\");\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = require(\"./longbits\");\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n */\nutil.isNode = Boolean(typeof global !== \"undefined\"\n && global\n && global.process\n && global.process.versions\n && global.process.versions.node);\n\n/**\n * Global object reference.\n * @memberof util\n * @type {Object}\n */\nutil.global = util.isNode && global\n || typeof window !== \"undefined\" && window\n || typeof self !== \"undefined\" && self\n || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n var value = obj[prop];\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor}\n */\nutil.Buffer = (function() {\n try {\n var Buffer = util.inquire(\"buffer\").Buffer;\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n } catch (e) {\n /* istanbul ignore next */\n return null;\n }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n /* istanbul ignore next */\n return typeof sizeOrArray === \"number\"\n ? util.Buffer\n ? util._Buffer_allocUnsafe(sizeOrArray)\n : new util.Array(sizeOrArray)\n : util.Buffer\n ? util._Buffer_from(sizeOrArray)\n : typeof Uint8Array === \"undefined\"\n ? sizeOrArray\n : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/**\n * Any compatible Long instance.\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\n * @interface Long\n * @property {number} low Low bits\n * @property {number} high High bits\n * @property {boolean} unsigned Whether unsigned or not\n */\n\n/**\n * Long.js's Long class if available.\n * @type {Constructor}\n */\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n || /* istanbul ignore next */ util.global.Long\n || util.inquire(\"long\");\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/**\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n return value\n ? util.LongBits.from(value).toHash()\n : util.LongBits.zeroHash;\n};\n\n/**\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n var bits = util.LongBits.fromHash(hash);\n if (util.Long)\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.} dst Destination object\n * @param {Object.} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n if (dst[keys[i]] === undefined || !ifNotSet)\n dst[keys[i]] = src[keys[i]];\n return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor} Custom error constructor\n */\nfunction newError(name) {\n\n function CustomError(message, properties) {\n\n if (!(this instanceof CustomError))\n return new CustomError(message, properties);\n\n // Error.call(this, message);\n // ^ just returns a new error instance because the ctor can be called as a function\n\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) // node\n Error.captureStackTrace(this, CustomError);\n else\n Object.defineProperty(this, \"stack\", { value: new Error().stack || \"\" });\n\n if (properties)\n merge(this, properties);\n }\n\n (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError;\n\n Object.defineProperty(CustomError.prototype, \"name\", { get: function() { return name; } });\n\n CustomError.prototype.toString = function toString() {\n return this.name + \": \" + this.message;\n };\n\n return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message\n * @constructor\n * @param {string} message Error message\n * @param {Object.} [properties] Additional properties\n * @example\n * try {\n * MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n * if (e instanceof ProtocolError && e.instance)\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n var fieldMap = {};\n for (var i = 0; i < fieldNames.length; ++i)\n fieldMap[fieldNames[i]] = 1;\n\n /**\n * @returns {string|undefined} Set field name, if any\n * @this Object\n * @ignore\n */\n return function() { // eslint-disable-line consistent-return\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n return keys[i];\n };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n /**\n * @param {string} name Field name\n * @returns {undefined}\n * @this Object\n * @ignore\n */\n return function(name) {\n for (var i = 0; i < fieldNames.length; ++i)\n if (fieldNames[i] !== name)\n delete this[fieldNames[i]];\n };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n longs: String,\n enums: String,\n bytes: String,\n json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n var Buffer = util.Buffer;\n /* istanbul ignore if */\n if (!Buffer) {\n util._Buffer_from = util._Buffer_allocUnsafe = null;\n return;\n }\n // because node 4.x buffers are incompatible & immutable\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n /* istanbul ignore next */\n function Buffer_from(value, encoding) {\n return new Buffer(value, encoding);\n };\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n /* istanbul ignore next */\n function Buffer_allocUnsafe(size) {\n return new Buffer(size);\n };\n};\n","\"use strict\";\nmodule.exports = Writer;\n\nvar util = require(\"./util/minimal\");\n\nvar BufferWriter; // cyclic\n\nvar LongBits = util.LongBits,\n base64 = util.base64,\n utf8 = util.utf8;\n\n/**\n * Constructs a new writer operation instance.\n * @classdesc Scheduled writer operation.\n * @constructor\n * @param {function(*, Uint8Array, number)} fn Function to call\n * @param {number} len Value byte length\n * @param {*} val Value to write\n * @ignore\n */\nfunction Op(fn, len, val) {\n\n /**\n * Function to call.\n * @type {function(Uint8Array, number, *)}\n */\n this.fn = fn;\n\n /**\n * Value byte length.\n * @type {number}\n */\n this.len = len;\n\n /**\n * Next operation.\n * @type {Writer.Op|undefined}\n */\n this.next = undefined;\n\n /**\n * Value to write.\n * @type {*}\n */\n this.val = val; // type varies\n}\n\n/* istanbul ignore next */\nfunction noop() {} // eslint-disable-line no-empty-function\n\n/**\n * Constructs a new writer state instance.\n * @classdesc Copied writer state.\n * @memberof Writer\n * @constructor\n * @param {Writer} writer Writer to copy state from\n * @ignore\n */\nfunction State(writer) {\n\n /**\n * Current head.\n * @type {Writer.Op}\n */\n this.head = writer.head;\n\n /**\n * Current tail.\n * @type {Writer.Op}\n */\n this.tail = writer.tail;\n\n /**\n * Current buffer length.\n * @type {number}\n */\n this.len = writer.len;\n\n /**\n * Next state.\n * @type {State|null}\n */\n this.next = writer.states;\n}\n\n/**\n * Constructs a new writer instance.\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n */\nfunction Writer() {\n\n /**\n * Current length.\n * @type {number}\n */\n this.len = 0;\n\n /**\n * Operations head.\n * @type {Object}\n */\n this.head = new Op(noop, 0, 0);\n\n /**\n * Operations tail\n * @type {Object}\n */\n this.tail = this.head;\n\n /**\n * Linked forked states.\n * @type {Object|null}\n */\n this.states = null;\n\n // When a value is written, the writer calculates its byte length and puts it into a linked\n // list of operations to perform when finish() is called. This both allows us to allocate\n // buffers of the exact required size and reduces the amount of work we have to do compared\n // to first calculating over objects and then encoding over objects. In our case, the encoding\n // part is just a linked list walk calling operations with already prepared values.\n}\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup() {\n return (Writer.create = function create_buffer() {\n return new BufferWriter();\n })();\n }\n /* istanbul ignore next */\n : function create_array() {\n return new Writer();\n };\n};\n\n/**\n * Creates a new writer.\n * @function\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\n */\nWriter.create = create();\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\nWriter.alloc = function alloc(size) {\n return new util.Array(size);\n};\n\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\n/* istanbul ignore else */\nif (util.Array !== Array)\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\n\n/**\n * Pushes a new operation to the queue.\n * @param {function(Uint8Array, number, *)} fn Function to call\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @returns {Writer} `this`\n * @private\n */\nWriter.prototype._push = function push(fn, len, val) {\n this.tail = this.tail.next = new Op(fn, len, val);\n this.len += len;\n return this;\n};\n\nfunction writeByte(val, buf, pos) {\n buf[pos] = val & 255;\n}\n\nfunction writeVarint32(val, buf, pos) {\n while (val > 127) {\n buf[pos++] = val & 127 | 128;\n val >>>= 7;\n }\n buf[pos] = val;\n}\n\n/**\n * Constructs a new varint writer operation instance.\n * @classdesc Scheduled varint writer operation.\n * @extends Op\n * @constructor\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @ignore\n */\nfunction VarintOp(len, val) {\n this.len = len;\n this.next = undefined;\n this.val = val;\n}\n\nVarintOp.prototype = Object.create(Op.prototype);\nVarintOp.prototype.fn = writeVarint32;\n\n/**\n * Writes an unsigned 32 bit value as a varint.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.uint32 = function write_uint32(value) {\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\n // uint32 is by far the most frequently used operation and benefits significantly from this.\n this.len += (this.tail = this.tail.next = new VarintOp(\n (value = value >>> 0)\n < 128 ? 1\n : value < 16384 ? 2\n : value < 2097152 ? 3\n : value < 268435456 ? 4\n : 5,\n value)).len;\n return this;\n};\n\n/**\n * Writes a signed 32 bit value as a varint.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.int32 = function write_int32(value) {\n return value < 0\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\n : this.uint32(value);\n};\n\n/**\n * Writes a 32 bit value as a varint, zig-zag encoded.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sint32 = function write_sint32(value) {\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\n};\n\nfunction writeVarint64(val, buf, pos) {\n while (val.hi) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\n val.hi >>>= 7;\n }\n while (val.lo > 127) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = val.lo >>> 7;\n }\n buf[pos++] = val.lo;\n}\n\n/**\n * Writes an unsigned 64 bit value as a varint.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.uint64 = function write_uint64(value) {\n var bits = LongBits.from(value);\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a signed 64 bit value as a varint.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.int64 = Writer.prototype.uint64;\n\n/**\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sint64 = function write_sint64(value) {\n var bits = LongBits.from(value).zzEncode();\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a boolish value as a varint.\n * @param {boolean} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bool = function write_bool(value) {\n return this._push(writeByte, 1, value ? 1 : 0);\n};\n\nfunction writeFixed32(val, buf, pos) {\n buf[pos ] = val & 255;\n buf[pos + 1] = val >>> 8 & 255;\n buf[pos + 2] = val >>> 16 & 255;\n buf[pos + 3] = val >>> 24;\n}\n\n/**\n * Writes an unsigned 32 bit value as fixed 32 bits.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.fixed32 = function write_fixed32(value) {\n return this._push(writeFixed32, 4, value >>> 0);\n};\n\n/**\n * Writes a signed 32 bit value as fixed 32 bits.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\n\n/**\n * Writes an unsigned 64 bit value as fixed 64 bits.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.fixed64 = function write_fixed64(value) {\n var bits = LongBits.from(value);\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\n};\n\n/**\n * Writes a signed 64 bit value as fixed 64 bits.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\n\n/**\n * Writes a float (32 bit).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.float = function write_float(value) {\n return this._push(util.float.writeFloatLE, 4, value);\n};\n\n/**\n * Writes a double (64 bit float).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.double = function write_double(value) {\n return this._push(util.float.writeDoubleLE, 8, value);\n};\n\nvar writeBytes = util.Array.prototype.set\n ? function writeBytes_set(val, buf, pos) {\n buf.set(val, pos); // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytes_for(val, buf, pos) {\n for (var i = 0; i < val.length; ++i)\n buf[pos + i] = val[i];\n };\n\n/**\n * Writes a sequence of bytes.\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bytes = function write_bytes(value) {\n var len = value.length >>> 0;\n if (!len)\n return this._push(writeByte, 1, 0);\n if (util.isString(value)) {\n var buf = Writer.alloc(len = base64.length(value));\n base64.decode(value, buf, 0);\n value = buf;\n }\n return this.uint32(len)._push(writeBytes, len, value);\n};\n\n/**\n * Writes a string.\n * @param {string} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.string = function write_string(value) {\n var len = utf8.length(value);\n return len\n ? this.uint32(len)._push(utf8.write, len, value)\n : this._push(writeByte, 1, 0);\n};\n\n/**\n * Forks this writer's state by pushing it to a stack.\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\n * @returns {Writer} `this`\n */\nWriter.prototype.fork = function fork() {\n this.states = new State(this);\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n return this;\n};\n\n/**\n * Resets this instance to the last state.\n * @returns {Writer} `this`\n */\nWriter.prototype.reset = function reset() {\n if (this.states) {\n this.head = this.states.head;\n this.tail = this.states.tail;\n this.len = this.states.len;\n this.states = this.states.next;\n } else {\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n }\n return this;\n};\n\n/**\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\n * @returns {Writer} `this`\n */\nWriter.prototype.ldelim = function ldelim() {\n var head = this.head,\n tail = this.tail,\n len = this.len;\n this.reset().uint32(len);\n if (len) {\n this.tail.next = head.next; // skip noop\n this.tail = tail;\n this.len += len;\n }\n return this;\n};\n\n/**\n * Finishes the write operation.\n * @returns {Uint8Array} Finished buffer\n */\nWriter.prototype.finish = function finish() {\n var head = this.head.next, // skip noop\n buf = this.constructor.alloc(this.len),\n pos = 0;\n while (head) {\n head.fn(head.val, buf, pos);\n pos += head.len;\n head = head.next;\n }\n // this.head = this.tail = null;\n return buf;\n};\n\nWriter._configure = function(BufferWriter_) {\n BufferWriter = BufferWriter_;\n Writer.create = create();\n BufferWriter._configure();\n};\n","\"use strict\";\nmodule.exports = BufferWriter;\n\n// extends Writer\nvar Writer = require(\"./writer\");\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\n\nvar util = require(\"./util/minimal\");\n\n/**\n * Constructs a new buffer writer instance.\n * @classdesc Wire format writer using node buffers.\n * @extends Writer\n * @constructor\n */\nfunction BufferWriter() {\n Writer.call(this);\n}\n\nBufferWriter._configure = function () {\n /**\n * Allocates a buffer of the specified size.\n * @function\n * @param {number} size Buffer size\n * @returns {Buffer} Buffer\n */\n BufferWriter.alloc = util._Buffer_allocUnsafe;\n\n BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === \"set\"\n ? function writeBytesBuffer_set(val, buf, pos) {\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\n // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytesBuffer_copy(val, buf, pos) {\n if (val.copy) // Buffer values\n val.copy(buf, pos, 0, val.length);\n else for (var i = 0; i < val.length;) // plain array values\n buf[pos++] = val[i++];\n };\n};\n\n\n/**\n * @override\n */\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\n if (util.isString(value))\n value = util._Buffer_from(value, \"base64\");\n var len = value.length >>> 0;\n this.uint32(len);\n if (len)\n this._push(BufferWriter.writeBytesBuffer, len, value);\n return this;\n};\n\nfunction writeStringBuffer(val, buf, pos) {\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\n util.utf8.write(val, buf, pos);\n else if (buf.utf8Write)\n buf.utf8Write(val, pos);\n else\n buf.write(val, pos);\n}\n\n/**\n * @override\n */\nBufferWriter.prototype.string = function write_string_buffer(value) {\n var len = util.Buffer.byteLength(value);\n this.uint32(len);\n if (len)\n this._push(writeStringBuffer, len, value);\n return this;\n};\n\n\n/**\n * Finishes the write operation.\n * @name BufferWriter#finish\n * @function\n * @returns {Buffer} Finished buffer\n */\n\nBufferWriter._configure();\n",null,"const Rabin = require('./rabin')\nconst getRabin = require('../dist/rabin-wasm.node.js')\n\nconst create = async (avg, min, max, windowSize, polynomial) => {\n const compiled = await getRabin()\n return new Rabin(compiled, avg, min, max, windowSize, polynomial)\n}\n\nmodule.exports = {\n Rabin,\n create\n}\n","/**\n * Rabin fingerprinting\n *\n * @class Rabin\n */\nclass Rabin {\n /**\n * Creates an instance of Rabin.\n * @param { import(\"./../dist/rabin-wasm\") } asModule\n * @param {number} [bits=12]\n * @param {number} [min=8 * 1024]\n * @param {number} [max=32 * 1024]\n * @param {number} polynomial\n * @memberof Rabin\n */\n constructor(asModule, bits = 12, min = 8 * 1024, max = 32 * 1024, windowSize = 64, polynomial) {\n this.bits = bits\n this.min = min\n this.max = max\n this.asModule = asModule\n this.rabin = new asModule.Rabin(bits, min, max, windowSize, polynomial)\n this.polynomial = polynomial\n }\n\n /**\n * Fingerprints the buffer\n *\n * @param {Uint8Array} buf\n * @returns {Array}\n * @memberof Rabin\n */\n fingerprint(buf) {\n const {\n __retain,\n __release,\n __allocArray,\n __getInt32Array,\n Int32Array_ID,\n Uint8Array_ID\n } = this.asModule\n\n const lengths = new Int32Array(Math.ceil(buf.length/this.min))\n const lengthsPtr = __retain(__allocArray(Int32Array_ID, lengths))\n const pointer = __retain(__allocArray(Uint8Array_ID, buf))\n\n const out = this.rabin.fingerprint(pointer, lengthsPtr)\n const processed = __getInt32Array(out)\n\n __release(pointer)\n __release(lengthsPtr)\n\n const end = processed.indexOf(0);\n return end >= 0 ? processed.subarray(0, end) : processed;\n }\n}\n\nmodule.exports = Rabin","module.exports = require('./lib/retry');","var RetryOperation = require('./retry_operation');\n\nexports.operation = function(options) {\n var timeouts = exports.timeouts(options);\n return new RetryOperation(timeouts, {\n forever: options && (options.forever || options.retries === Infinity),\n unref: options && options.unref,\n maxRetryTime: options && options.maxRetryTime\n });\n};\n\nexports.timeouts = function(options) {\n if (options instanceof Array) {\n return [].concat(options);\n }\n\n var opts = {\n retries: 10,\n factor: 2,\n minTimeout: 1 * 1000,\n maxTimeout: Infinity,\n randomize: false\n };\n for (var key in options) {\n opts[key] = options[key];\n }\n\n if (opts.minTimeout > opts.maxTimeout) {\n throw new Error('minTimeout is greater than maxTimeout');\n }\n\n var timeouts = [];\n for (var i = 0; i < opts.retries; i++) {\n timeouts.push(this.createTimeout(i, opts));\n }\n\n if (options && options.forever && !timeouts.length) {\n timeouts.push(this.createTimeout(i, opts));\n }\n\n // sort the array numerically ascending\n timeouts.sort(function(a,b) {\n return a - b;\n });\n\n return timeouts;\n};\n\nexports.createTimeout = function(attempt, opts) {\n var random = (opts.randomize)\n ? (Math.random() + 1)\n : 1;\n\n var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));\n timeout = Math.min(timeout, opts.maxTimeout);\n\n return timeout;\n};\n\nexports.wrap = function(obj, options, methods) {\n if (options instanceof Array) {\n methods = options;\n options = null;\n }\n\n if (!methods) {\n methods = [];\n for (var key in obj) {\n if (typeof obj[key] === 'function') {\n methods.push(key);\n }\n }\n }\n\n for (var i = 0; i < methods.length; i++) {\n var method = methods[i];\n var original = obj[method];\n\n obj[method] = function retryWrapper(original) {\n var op = exports.operation(options);\n var args = Array.prototype.slice.call(arguments, 1);\n var callback = args.pop();\n\n args.push(function(err) {\n if (op.retry(err)) {\n return;\n }\n if (err) {\n arguments[0] = op.mainError();\n }\n callback.apply(this, arguments);\n });\n\n op.attempt(function() {\n original.apply(obj, args);\n });\n }.bind(obj, original);\n obj[method].options = options;\n }\n};\n","function RetryOperation(timeouts, options) {\n // Compatibility for the old (timeouts, retryForever) signature\n if (typeof options === 'boolean') {\n options = { forever: options };\n }\n\n this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));\n this._timeouts = timeouts;\n this._options = options || {};\n this._maxRetryTime = options && options.maxRetryTime || Infinity;\n this._fn = null;\n this._errors = [];\n this._attempts = 1;\n this._operationTimeout = null;\n this._operationTimeoutCb = null;\n this._timeout = null;\n this._operationStart = null;\n this._timer = null;\n\n if (this._options.forever) {\n this._cachedTimeouts = this._timeouts.slice(0);\n }\n}\nmodule.exports = RetryOperation;\n\nRetryOperation.prototype.reset = function() {\n this._attempts = 1;\n this._timeouts = this._originalTimeouts.slice(0);\n}\n\nRetryOperation.prototype.stop = function() {\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n if (this._timer) {\n clearTimeout(this._timer);\n }\n\n this._timeouts = [];\n this._cachedTimeouts = null;\n};\n\nRetryOperation.prototype.retry = function(err) {\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n\n if (!err) {\n return false;\n }\n var currentTime = new Date().getTime();\n if (err && currentTime - this._operationStart >= this._maxRetryTime) {\n this._errors.push(err);\n this._errors.unshift(new Error('RetryOperation timeout occurred'));\n return false;\n }\n\n this._errors.push(err);\n\n var timeout = this._timeouts.shift();\n if (timeout === undefined) {\n if (this._cachedTimeouts) {\n // retry forever, only keep last error\n this._errors.splice(0, this._errors.length - 1);\n timeout = this._cachedTimeouts.slice(-1);\n } else {\n return false;\n }\n }\n\n var self = this;\n this._timer = setTimeout(function() {\n self._attempts++;\n\n if (self._operationTimeoutCb) {\n self._timeout = setTimeout(function() {\n self._operationTimeoutCb(self._attempts);\n }, self._operationTimeout);\n\n if (self._options.unref) {\n self._timeout.unref();\n }\n }\n\n self._fn(self._attempts);\n }, timeout);\n\n if (this._options.unref) {\n this._timer.unref();\n }\n\n return true;\n};\n\nRetryOperation.prototype.attempt = function(fn, timeoutOps) {\n this._fn = fn;\n\n if (timeoutOps) {\n if (timeoutOps.timeout) {\n this._operationTimeout = timeoutOps.timeout;\n }\n if (timeoutOps.cb) {\n this._operationTimeoutCb = timeoutOps.cb;\n }\n }\n\n var self = this;\n if (this._operationTimeoutCb) {\n this._timeout = setTimeout(function() {\n self._operationTimeoutCb();\n }, self._operationTimeout);\n }\n\n this._operationStart = new Date().getTime();\n\n this._fn(this._attempts);\n};\n\nRetryOperation.prototype.try = function(fn) {\n console.log('Using RetryOperation.try() is deprecated');\n this.attempt(fn);\n};\n\nRetryOperation.prototype.start = function(fn) {\n console.log('Using RetryOperation.start() is deprecated');\n this.attempt(fn);\n};\n\nRetryOperation.prototype.start = RetryOperation.prototype.try;\n\nRetryOperation.prototype.errors = function() {\n return this._errors;\n};\n\nRetryOperation.prototype.attempts = function() {\n return this._attempts;\n};\n\nRetryOperation.prototype.mainError = function() {\n if (this._errors.length === 0) {\n return null;\n }\n\n var counts = {};\n var mainError = null;\n var mainErrorCount = 0;\n\n for (var i = 0; i < this._errors.length; i++) {\n var error = this._errors[i];\n var message = error.message;\n var count = (counts[message] || 0) + 1;\n\n counts[message] = count;\n\n if (count >= mainErrorCount) {\n mainError = error;\n mainErrorCount = count;\n }\n }\n\n return mainError;\n};\n","'use strict'\n\n// JS treats subjects of bitwise operators as SIGNED 32 bit numbers,\n// which means the maximum amount of bits we can store inside each byte\n// is 7..\nconst BITS_PER_BYTE = 7\n\nmodule.exports = class SparseArray {\n constructor () {\n this._bitArrays = []\n this._data = []\n this._length = 0\n this._changedLength = false\n this._changedData = false\n }\n\n set (index, value) {\n let pos = this._internalPositionFor(index, false)\n if (value === undefined) {\n // unsetting\n if (pos !== -1) {\n // remove item from bit array and array itself\n this._unsetInternalPos(pos)\n this._unsetBit(index)\n this._changedLength = true\n this._changedData = true\n }\n } else {\n let needsSort = false\n if (pos === -1) {\n pos = this._data.length\n this._setBit(index)\n this._changedData = true\n } else {\n needsSort = true\n }\n this._setInternalPos(pos, index, value, needsSort)\n this._changedLength = true\n }\n }\n\n unset (index) {\n this.set(index, undefined)\n }\n\n get (index) {\n this._sortData()\n const pos = this._internalPositionFor(index, true)\n if (pos === -1) {\n return undefined\n }\n return this._data[pos][1]\n }\n\n push (value) {\n this.set(this.length, value)\n return this.length\n }\n\n get length () {\n this._sortData()\n if (this._changedLength) {\n const last = this._data[this._data.length - 1]\n this._length = last ? last[0] + 1 : 0\n this._changedLength = false\n }\n return this._length\n }\n\n forEach (iterator) {\n let i = 0\n while(i < this.length) {\n iterator(this.get(i), i, this)\n i++\n }\n }\n\n map (iterator) {\n let i = 0\n let mapped = new Array(this.length)\n while(i < this.length) {\n mapped[i] = iterator(this.get(i), i, this)\n i++\n }\n return mapped\n }\n\n reduce (reducer, initialValue) {\n let i = 0\n let acc = initialValue\n while(i < this.length) {\n const value = this.get(i)\n acc = reducer(acc, value, i)\n i++\n }\n return acc\n }\n\n find (finder) {\n let i = 0, found, last\n while ((i < this.length) && !found) {\n last = this.get(i)\n found = finder(last)\n i++\n }\n return found ? last : undefined\n }\n\n _internalPositionFor (index, noCreate) {\n const bytePos = this._bytePosFor(index, noCreate)\n if (bytePos >= this._bitArrays.length) {\n return -1\n }\n const byte = this._bitArrays[bytePos]\n const bitPos = index - bytePos * BITS_PER_BYTE\n const exists = (byte & (1 << bitPos)) > 0\n if (!exists) {\n return -1\n }\n const previousPopCount = this._bitArrays.slice(0, bytePos).reduce(popCountReduce, 0)\n\n const mask = ~(0xffffffff << (bitPos + 1))\n const bytePopCount = popCount(byte & mask)\n const arrayPos = previousPopCount + bytePopCount - 1\n return arrayPos\n }\n\n _bytePosFor (index, noCreate) {\n const bytePos = Math.floor(index / BITS_PER_BYTE)\n const targetLength = bytePos + 1\n while (!noCreate && this._bitArrays.length < targetLength) {\n this._bitArrays.push(0)\n }\n return bytePos\n }\n\n _setBit (index) {\n const bytePos = this._bytePosFor(index, false)\n this._bitArrays[bytePos] |= (1 << (index - (bytePos * BITS_PER_BYTE)))\n }\n\n _unsetBit(index) {\n const bytePos = this._bytePosFor(index, false)\n this._bitArrays[bytePos] &= ~(1 << (index - (bytePos * BITS_PER_BYTE)))\n }\n\n _setInternalPos(pos, index, value, needsSort) {\n const data =this._data\n const elem = [index, value]\n if (needsSort) {\n this._sortData()\n data[pos] = elem\n } else {\n // new element. just shove it into the array\n // but be nice about where we shove it\n // in order to make sorting it later easier\n if (data.length) {\n if (data[data.length - 1][0] >= index) {\n data.push(elem)\n } else if (data[0][0] <= index) {\n data.unshift(elem)\n } else {\n const randomIndex = Math.round(data.length / 2)\n this._data = data.slice(0, randomIndex).concat(elem).concat(data.slice(randomIndex))\n }\n } else {\n this._data.push(elem)\n }\n this._changedData = true\n this._changedLength = true\n }\n }\n\n _unsetInternalPos (pos) {\n this._data.splice(pos, 1)\n }\n\n _sortData () {\n if (this._changedData) {\n this._data.sort(sortInternal)\n }\n\n this._changedData = false\n }\n\n bitField () {\n const bytes = []\n let pendingBitsForResultingByte = 8\n let pendingBitsForNewByte = 0\n let resultingByte = 0\n let newByte\n const pending = this._bitArrays.slice()\n while (pending.length || pendingBitsForNewByte) {\n if (pendingBitsForNewByte === 0) {\n newByte = pending.shift()\n pendingBitsForNewByte = 7\n }\n\n const usingBits = Math.min(pendingBitsForNewByte, pendingBitsForResultingByte)\n const mask = ~(0b11111111 << usingBits)\n const masked = newByte & mask\n resultingByte |= masked << (8 - pendingBitsForResultingByte)\n newByte = newByte >>> usingBits\n pendingBitsForNewByte -= usingBits\n pendingBitsForResultingByte -= usingBits\n\n if (!pendingBitsForResultingByte || (!pendingBitsForNewByte && !pending.length)) {\n bytes.push(resultingByte)\n resultingByte = 0\n pendingBitsForResultingByte = 8\n }\n }\n\n // remove trailing zeroes\n for(var i = bytes.length - 1; i > 0; i--) {\n const value = bytes[i]\n if (value === 0) {\n bytes.pop()\n } else {\n break\n }\n }\n\n return bytes\n }\n\n compactArray () {\n this._sortData()\n return this._data.map(valueOnly)\n }\n}\n\nfunction popCountReduce (count, byte) {\n return count + popCount(byte)\n}\n\nfunction popCount(_v) {\n let v = _v\n v = v - ((v >> 1) & 0x55555555) // reuse input as temporary\n v = (v & 0x33333333) + ((v >> 2) & 0x33333333) // temp\n return ((v + (v >> 4) & 0xF0F0F0F) * 0x1010101) >> 24\n}\n\nfunction sortInternal (a, b) {\n return a[0] - b[0]\n}\n\nfunction valueOnly (elem) {\n return elem[1]\n}","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.streamingIterables = {}));\n})(this, (function (exports) { 'use strict';\n\n async function* _batch(size, iterable) {\n let dataBatch = [];\n for await (const data of iterable) {\n dataBatch.push(data);\n if (dataBatch.length === size) {\n yield dataBatch;\n dataBatch = [];\n }\n }\n if (dataBatch.length > 0) {\n yield dataBatch;\n }\n }\n function* _syncBatch(size, iterable) {\n let dataBatch = [];\n for (const data of iterable) {\n dataBatch.push(data);\n if (dataBatch.length === size) {\n yield dataBatch;\n dataBatch = [];\n }\n }\n if (dataBatch.length > 0) {\n yield dataBatch;\n }\n }\n function batch(size, iterable) {\n if (iterable === undefined) {\n return curriedIterable => batch(size, curriedIterable);\n }\n if (iterable[Symbol.asyncIterator]) {\n return _batch(size, iterable);\n }\n return _syncBatch(size, iterable);\n }\n\n const TIMEOUT = Symbol('TIMEOUT');\n const createTimer = (duration) => {\n let timeoutId;\n return [\n new Promise(resolve => {\n timeoutId = setTimeout(() => resolve(TIMEOUT), duration);\n }),\n () => {\n clearTimeout(timeoutId);\n },\n ];\n };\n // Like `batch` but flushes early if the `timeout` is reached\n // NOTE: The strategy is to only hold onto a single item for a maximum of `timeout` ms.\n async function* _batchWithTimeout(size, timeout, iterable) {\n const iterator = iterable[Symbol.asyncIterator]();\n let pendingData;\n let batchData = [];\n let timer;\n let clearTimer;\n const startTimer = () => {\n deleteTimer();\n [timer, clearTimer] = createTimer(timeout);\n };\n const deleteTimer = () => {\n if (clearTimer) {\n clearTimer();\n }\n timer = undefined;\n };\n pendingData = iterator.next();\n while (true) {\n const res = await (timer ? Promise.race([pendingData, timer]) : pendingData);\n if (res === TIMEOUT || res.done) {\n // Flush early (before we reach the batch size)\n if (batchData.length) {\n yield batchData;\n batchData = [];\n }\n deleteTimer();\n // And exit appropriately\n if (res !== TIMEOUT) {\n // done\n break;\n }\n continue;\n }\n // Fetch next item early doors (before we potentially yield)\n pendingData = iterator.next();\n // Then handle the value\n batchData.push(res.value);\n if (batchData.length === 1) {\n // Start timer once we have at least 1 item ready to go\n startTimer();\n }\n if (batchData.length === size) {\n yield batchData;\n batchData = [];\n deleteTimer();\n continue;\n }\n }\n }\n function batchWithTimeout(size, timeout, iterable) {\n if (iterable === undefined) {\n return curriedIterable => batchWithTimeout(size, timeout, curriedIterable);\n }\n if (iterable[Symbol.asyncIterator] && timeout !== Infinity) {\n return _batchWithTimeout(size, timeout, iterable);\n }\n // For sync iterables or an infinite timeout, the timeout is irrelevant so just fallback to regular `batch`.\n return batch(size, iterable);\n }\n\n function getIterator(iterable) {\n if (typeof iterable.next === 'function') {\n return iterable;\n }\n if (typeof iterable[Symbol.iterator] === 'function') {\n return iterable[Symbol.iterator]();\n }\n if (typeof iterable[Symbol.asyncIterator] === 'function') {\n return iterable[Symbol.asyncIterator]();\n }\n throw new TypeError('\"values\" does not to conform to any of the iterator or iterable protocols');\n }\n\n function defer() {\n let reject;\n let resolve;\n const promise = new Promise((resolveFunc, rejectFunc) => {\n resolve = resolveFunc;\n reject = rejectFunc;\n });\n return {\n promise,\n reject,\n resolve,\n };\n }\n\n function _buffer(size, iterable) {\n const iterator = getIterator(iterable);\n const resultQueue = [];\n const readQueue = [];\n let reading = false;\n let ended = false;\n function fulfillReadQueue() {\n while (readQueue.length > 0 && resultQueue.length > 0) {\n const readDeferred = readQueue.shift();\n const { error, value } = resultQueue.shift();\n if (error) {\n readDeferred.reject(error);\n }\n else {\n readDeferred.resolve({ done: false, value });\n }\n }\n while (readQueue.length > 0 && ended) {\n const { resolve } = readQueue.shift();\n resolve({ done: true, value: undefined });\n }\n }\n async function fillQueue() {\n if (ended) {\n return;\n }\n if (reading) {\n return;\n }\n if (resultQueue.length >= size) {\n return;\n }\n reading = true;\n try {\n const { done, value } = await iterator.next();\n if (done) {\n ended = true;\n }\n else {\n resultQueue.push({ value });\n }\n }\n catch (error) {\n ended = true;\n resultQueue.push({ error });\n }\n fulfillReadQueue();\n reading = false;\n fillQueue();\n }\n async function next() {\n if (resultQueue.length > 0) {\n const { error, value } = resultQueue.shift();\n if (error) {\n throw error;\n }\n fillQueue();\n return { done: false, value };\n }\n if (ended) {\n return { done: true, value: undefined }; // stupid ts\n }\n const deferred = defer();\n readQueue.push(deferred);\n fillQueue();\n return deferred.promise;\n }\n const asyncIterableIterator = {\n next,\n [Symbol.asyncIterator]: () => asyncIterableIterator,\n };\n return asyncIterableIterator;\n }\n function* syncBuffer(size, iterable) {\n const valueQueue = [];\n let e;\n try {\n for (const value of iterable) {\n valueQueue.push(value);\n if (valueQueue.length <= size) {\n continue;\n }\n yield valueQueue.shift();\n }\n }\n catch (error) {\n e = error;\n }\n for (const value of valueQueue) {\n yield value;\n }\n if (e) {\n throw e;\n }\n }\n function buffer(size, iterable) {\n if (iterable === undefined) {\n return curriedIterable => buffer(size, curriedIterable);\n }\n if (size === 0) {\n return iterable;\n }\n if (iterable[Symbol.asyncIterator]) {\n return _buffer(size, iterable);\n }\n return syncBuffer(size, iterable);\n }\n\n async function _collect(iterable) {\n const values = [];\n for await (const value of iterable) {\n values.push(value);\n }\n return values;\n }\n function collect(iterable) {\n if (iterable[Symbol.asyncIterator]) {\n return _collect(iterable);\n }\n return Array.from(iterable);\n }\n\n async function* _concat(iterables) {\n for await (const iterable of iterables) {\n yield* iterable;\n }\n }\n function* _syncConcat(iterables) {\n for (const iterable of iterables) {\n yield* iterable;\n }\n }\n function concat(...iterables) {\n const hasAnyAsync = iterables.find(itr => itr[Symbol.asyncIterator] !== undefined);\n if (hasAnyAsync) {\n return _concat(iterables);\n }\n else {\n return _syncConcat(iterables);\n }\n }\n\n async function _consume(iterable) {\n for await (const val of iterable) {\n // do nothing\n }\n }\n function consume(iterable) {\n if (iterable[Symbol.asyncIterator]) {\n return _consume(iterable);\n }\n for (const val of iterable) {\n // do nothing\n }\n }\n\n async function* _filter(filterFunc, iterable) {\n for await (const data of iterable) {\n if (await filterFunc(data)) {\n yield data;\n }\n }\n }\n function filter(filterFunc, iterable) {\n if (iterable === undefined) {\n return (curriedIterable) => _filter(filterFunc, curriedIterable);\n }\n return _filter(filterFunc, iterable);\n }\n\n async function* flatten(iterable) {\n for await (const maybeItr of iterable) {\n if (maybeItr && typeof maybeItr !== 'string' && (maybeItr[Symbol.iterator] || maybeItr[Symbol.asyncIterator])) {\n yield* flatten(maybeItr);\n }\n else {\n yield maybeItr;\n }\n }\n }\n\n async function* _map(func, iterable) {\n for await (const val of iterable) {\n yield await func(val);\n }\n }\n function map(func, iterable) {\n if (iterable === undefined) {\n return curriedIterable => _map(func, curriedIterable);\n }\n return _map(func, iterable);\n }\n\n function flatMap(func, iterable) {\n if (iterable === undefined) {\n return curriedIterable => flatMap(func, curriedIterable);\n }\n return filter(i => i !== undefined && i !== null, flatten(map(func, iterable)));\n }\n\n function _flatTransform(concurrency, func, iterable) {\n const iterator = getIterator(iterable);\n const resultQueue = [];\n const readQueue = [];\n let ended = false;\n let reading = false;\n let inflightCount = 0;\n let lastError = null;\n function fulfillReadQueue() {\n while (readQueue.length > 0 && resultQueue.length > 0) {\n const { resolve } = readQueue.shift();\n const value = resultQueue.shift();\n resolve({ done: false, value });\n }\n while (readQueue.length > 0 && inflightCount === 0 && ended) {\n const { resolve, reject } = readQueue.shift();\n if (lastError) {\n reject(lastError);\n lastError = null;\n }\n else {\n resolve({ done: true, value: undefined });\n }\n }\n }\n async function fillQueue() {\n if (ended) {\n fulfillReadQueue();\n return;\n }\n if (reading) {\n return;\n }\n if (inflightCount + resultQueue.length >= concurrency) {\n return;\n }\n reading = true;\n inflightCount++;\n try {\n const { done, value } = await iterator.next();\n if (done) {\n ended = true;\n inflightCount--;\n fulfillReadQueue();\n }\n else {\n mapAndQueue(value);\n }\n }\n catch (error) {\n ended = true;\n inflightCount--;\n lastError = error;\n fulfillReadQueue();\n }\n reading = false;\n fillQueue();\n }\n async function mapAndQueue(itrValue) {\n try {\n const value = await func(itrValue);\n if (value && value[Symbol.asyncIterator]) {\n for await (const asyncVal of value) {\n resultQueue.push(asyncVal);\n }\n }\n else {\n resultQueue.push(value);\n }\n }\n catch (error) {\n ended = true;\n lastError = error;\n }\n inflightCount--;\n fulfillReadQueue();\n fillQueue();\n }\n async function next() {\n if (resultQueue.length === 0) {\n const deferred = defer();\n readQueue.push(deferred);\n fillQueue();\n return deferred.promise;\n }\n const value = resultQueue.shift();\n fillQueue();\n return { done: false, value };\n }\n const asyncIterableIterator = {\n next,\n [Symbol.asyncIterator]: () => asyncIterableIterator,\n };\n return asyncIterableIterator;\n }\n function flatTransform(concurrency, func, iterable) {\n if (func === undefined) {\n return (curriedFunc, curriedIterable) => curriedIterable\n ? flatTransform(concurrency, curriedFunc, curriedIterable)\n : flatTransform(concurrency, curriedFunc);\n }\n if (iterable === undefined) {\n return (curriedIterable) => flatTransform(concurrency, func, curriedIterable);\n }\n return filter(i => i !== undefined && i !== null, flatten(_flatTransform(concurrency, func, iterable)));\n }\n\n async function onceReadable(stream) {\n return new Promise(resolve => {\n stream.once('readable', () => {\n resolve();\n });\n });\n }\n async function* _fromStream(stream) {\n while (true) {\n const data = stream.read();\n if (data !== null) {\n yield data;\n continue;\n }\n if (stream._readableState.ended) {\n break;\n }\n await onceReadable(stream);\n }\n }\n function fromStream(stream) {\n if (typeof stream[Symbol.asyncIterator] === 'function') {\n return stream;\n }\n return _fromStream(stream);\n }\n\n async function* merge(...iterables) {\n const sources = new Set(iterables.map(getIterator));\n while (sources.size > 0) {\n for (const iterator of sources) {\n const nextVal = await iterator.next();\n if (nextVal.done) {\n sources.delete(iterator);\n }\n else {\n yield nextVal.value;\n }\n }\n }\n }\n\n function pipeline(firstFn, ...fns) {\n let previousFn = firstFn();\n for (const func of fns) {\n previousFn = func(previousFn);\n }\n return previousFn;\n }\n\n async function* _parallelMap(concurrency, func, iterable) {\n let transformError = null;\n const wrapFunc = value => ({\n value: func(value),\n });\n const stopOnError = async function* (source) {\n for await (const value of source) {\n if (transformError) {\n return;\n }\n yield value;\n }\n };\n const output = pipeline(() => iterable, buffer(1), stopOnError, map(wrapFunc), buffer(concurrency - 1));\n const itr = getIterator(output);\n while (true) {\n const { value, done } = await itr.next();\n if (done) {\n break;\n }\n try {\n const val = await value.value;\n if (!transformError) {\n yield val;\n }\n }\n catch (error) {\n transformError = error;\n }\n }\n if (transformError) {\n throw transformError;\n }\n }\n function parallelMap(concurrency, func, iterable) {\n if (func === undefined) {\n return (curriedFunc, curriedIterable) => parallelMap(concurrency, curriedFunc, curriedIterable);\n }\n if (iterable === undefined) {\n return curriedIterable => parallelMap(concurrency, func, curriedIterable);\n }\n if (concurrency === 1) {\n return map(func, iterable);\n }\n return _parallelMap(concurrency, func, iterable);\n }\n\n function parallelFlatMap(concurrency, func, iterable) {\n if (func === undefined) {\n return (curriedFunc, curriedIterable) => curriedIterable\n ? parallelFlatMap(concurrency, curriedFunc, curriedIterable)\n : parallelFlatMap(concurrency, curriedFunc);\n }\n if (iterable === undefined) {\n return (curriedIterable) => parallelFlatMap(concurrency, func, curriedIterable);\n }\n return filter(i => i !== undefined && i !== null, flatten(parallelMap(concurrency, func, iterable)));\n }\n\n async function* parallelMerge(...iterables) {\n const inputs = iterables.map(getIterator);\n const concurrentWork = new Set();\n const values = new Map();\n let lastError = null;\n let errCb = null;\n let valueCb = null;\n const notifyError = err => {\n lastError = err;\n if (errCb) {\n errCb(err);\n }\n };\n const notifyDone = value => {\n if (valueCb) {\n valueCb(value);\n }\n };\n const waitForQueue = () => new Promise((resolve, reject) => {\n if (lastError) {\n reject(lastError);\n }\n if (values.size > 0) {\n return resolve();\n }\n valueCb = resolve;\n errCb = reject;\n });\n const queueNext = input => {\n const nextVal = Promise.resolve(input.next()).then(async ({ done, value }) => {\n if (!done) {\n values.set(input, value);\n }\n concurrentWork.delete(nextVal);\n });\n concurrentWork.add(nextVal);\n nextVal.then(notifyDone, notifyError);\n };\n for (const input of inputs) {\n queueNext(input);\n }\n while (true) {\n // We technically don't have to check `values.size` as the for loop should have emptied it\n // However I haven't yet found specs verifying that behavior, only tests\n // the guard in waitForQueue() checking for values is in place for the same reason\n if (concurrentWork.size === 0 && values.size === 0) {\n return;\n }\n await waitForQueue();\n for (const [input, value] of values) {\n values.delete(input);\n yield value;\n queueNext(input);\n }\n }\n }\n\n async function _reduce(func, start, iterable) {\n let value = start;\n for await (const nextItem of iterable) {\n value = await func(value, nextItem);\n }\n return value;\n }\n function reduce(func, start, iterable) {\n if (start === undefined) {\n return (curriedStart, curriedIterable) => curriedIterable ? _reduce(func, curriedStart, curriedIterable) : reduce(func, curriedStart);\n }\n if (iterable === undefined) {\n return (curriedIterable) => reduce(func, start, curriedIterable);\n }\n return _reduce(func, start, iterable);\n }\n\n async function* _take(count, iterable) {\n let taken = 0;\n for await (const val of iterable) {\n yield await val;\n taken++;\n if (taken >= count) {\n break;\n }\n }\n }\n function* _syncTake(count, iterable) {\n let taken = 0;\n for (const val of iterable) {\n yield val;\n taken++;\n if (taken >= count) {\n break;\n }\n }\n }\n function take(count, iterable) {\n if (iterable === undefined) {\n return curriedIterable => take(count, curriedIterable);\n }\n if (iterable[Symbol.asyncIterator]) {\n return _take(count, iterable);\n }\n return _syncTake(count, iterable);\n }\n\n async function* _asyncTap(func, iterable) {\n for await (const val of iterable) {\n await func(val);\n yield val;\n }\n }\n function tap(func, iterable) {\n if (iterable === undefined) {\n return (curriedIterable) => _asyncTap(func, curriedIterable);\n }\n return _asyncTap(func, iterable);\n }\n\n const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));\n function _throttle(limit, interval, iterable) {\n if (!Number.isFinite(limit)) {\n throw new TypeError('Expected `limit` to be a finite number');\n }\n if (limit <= 0) {\n throw new TypeError('Expected `limit` to be greater than 0');\n }\n if (!Number.isFinite(interval)) {\n throw new TypeError('Expected `interval` to be a finite number');\n }\n return (async function* __throttle() {\n let sent = 0;\n let time;\n for await (const val of iterable) {\n if (sent < limit) {\n if (typeof time === 'undefined') {\n time = Date.now();\n }\n sent++;\n yield val;\n continue;\n }\n // Only wait if the interval hasn't already passed while we were\n // yielding the previous values.\n const elapsedMs = Date.now() - time;\n const waitFor = interval - elapsedMs;\n if (waitFor > 0) {\n await sleep(waitFor);\n }\n time = Date.now();\n sent = 1;\n yield val;\n }\n })();\n }\n function throttle(limit, interval, iterable) {\n if (iterable === undefined) {\n return (curriedIterable) => _throttle(limit, interval, curriedIterable);\n }\n return _throttle(limit, interval, iterable);\n }\n\n function addTime(a, b) {\n let seconds = a[0] + b[0];\n let nanoseconds = a[1] + b[1];\n if (nanoseconds >= 1000000000) {\n const remainder = nanoseconds % 1000000000;\n seconds += (nanoseconds - remainder) / 1000000000;\n nanoseconds = remainder;\n }\n return [seconds, nanoseconds];\n }\n async function* _asyncTime(config, iterable) {\n const itr = iterable[Symbol.asyncIterator]();\n let total = [0, 0];\n while (true) {\n const start = process.hrtime();\n const { value, done } = await itr.next();\n const delta = process.hrtime(start);\n total = addTime(total, delta);\n if (config.progress) {\n config.progress(delta, total);\n }\n if (done) {\n if (config.total) {\n config.total(total);\n }\n return value;\n }\n yield value;\n }\n }\n function* _syncTime(config, iterable) {\n const itr = iterable[Symbol.iterator]();\n let total = [0, 0];\n while (true) {\n const start = process.hrtime();\n const { value, done } = itr.next();\n const delta = process.hrtime(start);\n total = addTime(total, delta);\n if (config.progress) {\n config.progress(delta, total);\n }\n if (done) {\n if (config.total) {\n config.total(total);\n }\n return value;\n }\n yield value;\n }\n }\n function time(config = {}, iterable) {\n if (iterable === undefined) {\n return curriedIterable => time(config, curriedIterable);\n }\n if (iterable[Symbol.asyncIterator] !== undefined) {\n return _asyncTime(config, iterable);\n }\n else {\n return _syncTime(config, iterable);\n }\n }\n\n function _transform(concurrency, func, iterable) {\n const iterator = getIterator(iterable);\n const resultQueue = [];\n const readQueue = [];\n let ended = false;\n let reading = false;\n let inflightCount = 0;\n let lastError = null;\n function fulfillReadQueue() {\n while (readQueue.length > 0 && resultQueue.length > 0) {\n const { resolve } = readQueue.shift();\n const value = resultQueue.shift();\n resolve({ done: false, value });\n }\n while (readQueue.length > 0 && inflightCount === 0 && ended) {\n const { resolve, reject } = readQueue.shift();\n if (lastError) {\n reject(lastError);\n lastError = null;\n }\n else {\n resolve({ done: true, value: undefined });\n }\n }\n }\n async function fillQueue() {\n if (ended) {\n fulfillReadQueue();\n return;\n }\n if (reading) {\n return;\n }\n if (inflightCount + resultQueue.length >= concurrency) {\n return;\n }\n reading = true;\n inflightCount++;\n try {\n const { done, value } = await iterator.next();\n if (done) {\n ended = true;\n inflightCount--;\n fulfillReadQueue();\n }\n else {\n mapAndQueue(value);\n }\n }\n catch (error) {\n ended = true;\n inflightCount--;\n lastError = error;\n fulfillReadQueue();\n }\n reading = false;\n fillQueue();\n }\n async function mapAndQueue(itrValue) {\n try {\n const value = await func(itrValue);\n resultQueue.push(value);\n }\n catch (error) {\n ended = true;\n lastError = error;\n }\n inflightCount--;\n fulfillReadQueue();\n fillQueue();\n }\n async function next() {\n if (resultQueue.length === 0) {\n const deferred = defer();\n readQueue.push(deferred);\n fillQueue();\n return deferred.promise;\n }\n const value = resultQueue.shift();\n fillQueue();\n return { done: false, value };\n }\n const asyncIterableIterator = {\n next,\n [Symbol.asyncIterator]: () => asyncIterableIterator,\n };\n return asyncIterableIterator;\n }\n function transform(concurrency, func, iterable) {\n if (func === undefined) {\n return (curriedFunc, curriedIterable) => curriedIterable\n ? transform(concurrency, curriedFunc, curriedIterable)\n : transform(concurrency, curriedFunc);\n }\n if (iterable === undefined) {\n return (curriedIterable) => transform(concurrency, func, curriedIterable);\n }\n return _transform(concurrency, func, iterable);\n }\n\n async function _writeToStream(stream, iterable) {\n let lastError = null;\n let errCb = null;\n let drainCb = null;\n const notifyError = err => {\n lastError = err;\n if (errCb) {\n errCb(err);\n }\n };\n const notifyDrain = () => {\n if (drainCb) {\n drainCb();\n }\n };\n const cleanup = () => {\n stream.removeListener('error', notifyError);\n stream.removeListener('drain', notifyDrain);\n };\n stream.once('error', notifyError);\n const waitForDrain = () => new Promise((resolve, reject) => {\n if (lastError) {\n return reject(lastError);\n }\n stream.once('drain', notifyDrain);\n drainCb = resolve;\n errCb = reject;\n });\n for await (const value of iterable) {\n if (stream.write(value) === false) {\n await waitForDrain();\n }\n if (lastError) {\n break;\n }\n }\n cleanup();\n if (lastError) {\n throw lastError;\n }\n }\n function writeToStream(stream, iterable) {\n if (iterable === undefined) {\n return (curriedIterable) => _writeToStream(stream, curriedIterable);\n }\n return _writeToStream(stream, iterable);\n }\n\n exports.batch = batch;\n exports.batchWithTimeout = batchWithTimeout;\n exports.buffer = buffer;\n exports.collect = collect;\n exports.concat = concat;\n exports.consume = consume;\n exports.filter = filter;\n exports.flatMap = flatMap;\n exports.flatTransform = flatTransform;\n exports.flatten = flatten;\n exports.fromStream = fromStream;\n exports.getIterator = getIterator;\n exports.map = map;\n exports.merge = merge;\n exports.parallelFlatMap = parallelFlatMap;\n exports.parallelMap = parallelMap;\n exports.parallelMerge = parallelMerge;\n exports.pipeline = pipeline;\n exports.reduce = reduce;\n exports.take = take;\n exports.tap = tap;\n exports.throttle = throttle;\n exports.time = time;\n exports.transform = transform;\n exports.writeToStream = writeToStream;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction throttledQueue(maxRequestsPerInterval, interval, evenlySpaced) {\n if (evenlySpaced === void 0) { evenlySpaced = false; }\n /**\n * If all requests should be evenly spaced, adjust to suit.\n */\n if (evenlySpaced) {\n interval = interval / maxRequestsPerInterval;\n maxRequestsPerInterval = 1;\n }\n var queue = [];\n var lastIntervalStart = 0;\n var numRequestsPerInterval = 0;\n var timeout;\n /**\n * Gets called at a set interval to remove items from the queue.\n * This is a self-adjusting timer, since the browser's setTimeout is highly inaccurate.\n */\n var dequeue = function () {\n var intervalEnd = lastIntervalStart + interval;\n var now = Date.now();\n /**\n * Adjust the timer if it was called too early.\n */\n if (now < intervalEnd) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n timeout !== undefined && clearTimeout(timeout);\n timeout = setTimeout(dequeue, intervalEnd - now);\n return;\n }\n lastIntervalStart = now;\n numRequestsPerInterval = 0;\n for (var _i = 0, _a = queue.splice(0, maxRequestsPerInterval); _i < _a.length; _i++) {\n var callback = _a[_i];\n numRequestsPerInterval++;\n void callback();\n }\n if (queue.length) {\n timeout = setTimeout(dequeue, interval);\n }\n else {\n timeout = undefined;\n }\n };\n return function (fn) { return new Promise(function (resolve, reject) {\n var callback = function () { return Promise.resolve().then(fn).then(resolve).catch(reject); };\n var now = Date.now();\n if (timeout === undefined && (now - lastIntervalStart) > interval) {\n lastIntervalStart = now;\n numRequestsPerInterval = 0;\n }\n if (numRequestsPerInterval++ < maxRequestsPerInterval) {\n void callback();\n }\n else {\n queue.push(callback);\n if (timeout === undefined) {\n timeout = setTimeout(dequeue, lastIntervalStart + interval - now);\n }\n }\n }); };\n}\nmodule.exports = throttledQueue;\nexports.default = throttledQueue;\n//# sourceMappingURL=throttledQueue.js.map","module.exports = require('./lib/tunnel');\n","'use strict';\n\nvar net = require('net');\nvar tls = require('tls');\nvar http = require('http');\nvar https = require('https');\nvar events = require('events');\nvar assert = require('assert');\nvar util = require('util');\n\n\nexports.httpOverHttp = httpOverHttp;\nexports.httpsOverHttp = httpsOverHttp;\nexports.httpOverHttps = httpOverHttps;\nexports.httpsOverHttps = httpsOverHttps;\n\n\nfunction httpOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n return agent;\n}\n\nfunction httpsOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\nfunction httpOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n return agent;\n}\n\nfunction httpsOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\n\nfunction TunnelingAgent(options) {\n var self = this;\n self.options = options || {};\n self.proxyOptions = self.options.proxy || {};\n self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;\n self.requests = [];\n self.sockets = [];\n\n self.on('free', function onFree(socket, host, port, localAddress) {\n var options = toOptions(host, port, localAddress);\n for (var i = 0, len = self.requests.length; i < len; ++i) {\n var pending = self.requests[i];\n if (pending.host === options.host && pending.port === options.port) {\n // Detect the request to connect same origin server,\n // reuse the connection.\n self.requests.splice(i, 1);\n pending.request.onSocket(socket);\n return;\n }\n }\n socket.destroy();\n self.removeSocket(socket);\n });\n}\nutil.inherits(TunnelingAgent, events.EventEmitter);\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {\n var self = this;\n var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));\n\n if (self.sockets.length >= this.maxSockets) {\n // We are over limit so we'll add it to the queue.\n self.requests.push(options);\n return;\n }\n\n // If we are under maxSockets create a new one.\n self.createSocket(options, function(socket) {\n socket.on('free', onFree);\n socket.on('close', onCloseOrRemove);\n socket.on('agentRemove', onCloseOrRemove);\n req.onSocket(socket);\n\n function onFree() {\n self.emit('free', socket, options);\n }\n\n function onCloseOrRemove(err) {\n self.removeSocket(socket);\n socket.removeListener('free', onFree);\n socket.removeListener('close', onCloseOrRemove);\n socket.removeListener('agentRemove', onCloseOrRemove);\n }\n });\n};\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n var self = this;\n var placeholder = {};\n self.sockets.push(placeholder);\n\n var connectOptions = mergeOptions({}, self.proxyOptions, {\n method: 'CONNECT',\n path: options.host + ':' + options.port,\n agent: false,\n headers: {\n host: options.host + ':' + options.port\n }\n });\n if (options.localAddress) {\n connectOptions.localAddress = options.localAddress;\n }\n if (connectOptions.proxyAuth) {\n connectOptions.headers = connectOptions.headers || {};\n connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n new Buffer(connectOptions.proxyAuth).toString('base64');\n }\n\n debug('making CONNECT request');\n var connectReq = self.request(connectOptions);\n connectReq.useChunkedEncodingByDefault = false; // for v0.6\n connectReq.once('response', onResponse); // for v0.6\n connectReq.once('upgrade', onUpgrade); // for v0.6\n connectReq.once('connect', onConnect); // for v0.7 or later\n connectReq.once('error', onError);\n connectReq.end();\n\n function onResponse(res) {\n // Very hacky. This is necessary to avoid http-parser leaks.\n res.upgrade = true;\n }\n\n function onUpgrade(res, socket, head) {\n // Hacky.\n process.nextTick(function() {\n onConnect(res, socket, head);\n });\n }\n\n function onConnect(res, socket, head) {\n connectReq.removeAllListeners();\n socket.removeAllListeners();\n\n if (res.statusCode !== 200) {\n debug('tunneling socket could not be established, statusCode=%d',\n res.statusCode);\n socket.destroy();\n var error = new Error('tunneling socket could not be established, ' +\n 'statusCode=' + res.statusCode);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n if (head.length > 0) {\n debug('got illegal response body from proxy');\n socket.destroy();\n var error = new Error('got illegal response body from proxy');\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n debug('tunneling connection has established');\n self.sockets[self.sockets.indexOf(placeholder)] = socket;\n return cb(socket);\n }\n\n function onError(cause) {\n connectReq.removeAllListeners();\n\n debug('tunneling socket could not be established, cause=%s\\n',\n cause.message, cause.stack);\n var error = new Error('tunneling socket could not be established, ' +\n 'cause=' + cause.message);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n }\n};\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n var pos = this.sockets.indexOf(socket)\n if (pos === -1) {\n return;\n }\n this.sockets.splice(pos, 1);\n\n var pending = this.requests.shift();\n if (pending) {\n // If we have pending requests and a socket gets closed a new one\n // needs to be created to take over in the pool for the one that closed.\n this.createSocket(pending, function(socket) {\n pending.request.onSocket(socket);\n });\n }\n};\n\nfunction createSecureSocket(options, cb) {\n var self = this;\n TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n var hostHeader = options.request.getHeader('host');\n var tlsOptions = mergeOptions({}, self.options, {\n socket: socket,\n servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host\n });\n\n // 0 is dummy port for v0.6\n var secureSocket = tls.connect(0, tlsOptions);\n self.sockets[self.sockets.indexOf(socket)] = secureSocket;\n cb(secureSocket);\n });\n}\n\n\nfunction toOptions(host, port, localAddress) {\n if (typeof host === 'string') { // since v0.10\n return {\n host: host,\n port: port,\n localAddress: localAddress\n };\n }\n return host; // for v0.11 or later\n}\n\nfunction mergeOptions(target) {\n for (var i = 1, len = arguments.length; i < len; ++i) {\n var overrides = arguments[i];\n if (typeof overrides === 'object') {\n var keys = Object.keys(overrides);\n for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n var k = keys[j];\n if (overrides[k] !== undefined) {\n target[k] = overrides[k];\n }\n }\n }\n }\n return target;\n}\n\n\nvar debug;\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n debug = function() {\n var args = Array.prototype.slice.call(arguments);\n if (typeof args[0] === 'string') {\n args[0] = 'TUNNEL: ' + args[0];\n } else {\n args.unshift('TUNNEL:');\n }\n console.error.apply(console, args);\n }\n} else {\n debug = function() {};\n}\nexports.debug = debug; // for test\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction concat(arrays, length) {\n if (!length) {\n length = arrays.reduce((acc, curr) => acc + curr.length, 0);\n }\n const output = new Uint8Array(length);\n let offset = 0;\n for (const arr of arrays) {\n output.set(arr, offset);\n offset += arr.length;\n }\n return output;\n}\n\nexports.concat = concat;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction equals(a, b) {\n if (a === b) {\n return true;\n }\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n for (let i = 0; i < a.byteLength; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}\n\nexports.equals = equals;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar bases = require('./util/bases.js');\n\nfunction fromString(string, encoding = 'utf8') {\n const base = bases[encoding];\n if (!base) {\n throw new Error(`Unsupported encoding \"${ encoding }\"`);\n }\n return base.decoder.decode(`${ base.prefix }${ string }`);\n}\n\nexports.fromString = fromString;\n","'use strict';\n\nvar basics = require('multiformats/basics');\n\nfunction createCodec(name, prefix, encode, decode) {\n return {\n name,\n prefix,\n encoder: {\n name,\n prefix,\n encode\n },\n decoder: { decode }\n };\n}\nconst string = createCodec('utf8', 'u', buf => {\n const decoder = new TextDecoder('utf8');\n return 'u' + decoder.decode(buf);\n}, str => {\n const encoder = new TextEncoder();\n return encoder.encode(str.substring(1));\n});\nconst ascii = createCodec('ascii', 'a', buf => {\n let string = 'a';\n for (let i = 0; i < buf.length; i++) {\n string += String.fromCharCode(buf[i]);\n }\n return string;\n}, str => {\n str = str.substring(1);\n const buf = new Uint8Array(str.length);\n for (let i = 0; i < str.length; i++) {\n buf[i] = str.charCodeAt(i);\n }\n return buf;\n});\nconst BASES = {\n utf8: string,\n 'utf-8': string,\n hex: basics.bases.base16,\n latin1: ascii,\n ascii: ascii,\n binary: ascii,\n ...basics.bases\n};\n\nmodule.exports = BASES;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"v1\", {\n enumerable: true,\n get: function () {\n return _v.default;\n }\n});\nObject.defineProperty(exports, \"v3\", {\n enumerable: true,\n get: function () {\n return _v2.default;\n }\n});\nObject.defineProperty(exports, \"v4\", {\n enumerable: true,\n get: function () {\n return _v3.default;\n }\n});\nObject.defineProperty(exports, \"v5\", {\n enumerable: true,\n get: function () {\n return _v4.default;\n }\n});\nObject.defineProperty(exports, \"NIL\", {\n enumerable: true,\n get: function () {\n return _nil.default;\n }\n});\nObject.defineProperty(exports, \"version\", {\n enumerable: true,\n get: function () {\n return _version.default;\n }\n});\nObject.defineProperty(exports, \"validate\", {\n enumerable: true,\n get: function () {\n return _validate.default;\n }\n});\nObject.defineProperty(exports, \"stringify\", {\n enumerable: true,\n get: function () {\n return _stringify.default;\n }\n});\nObject.defineProperty(exports, \"parse\", {\n enumerable: true,\n get: function () {\n return _parse.default;\n }\n});\n\nvar _v = _interopRequireDefault(require(\"./v1.js\"));\n\nvar _v2 = _interopRequireDefault(require(\"./v3.js\"));\n\nvar _v3 = _interopRequireDefault(require(\"./v4.js\"));\n\nvar _v4 = _interopRequireDefault(require(\"./v5.js\"));\n\nvar _nil = _interopRequireDefault(require(\"./nil.js\"));\n\nvar _version = _interopRequireDefault(require(\"./version.js\"));\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nvar _parse = _interopRequireDefault(require(\"./parse.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction md5(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return _crypto.default.createHash('md5').update(bytes).digest();\n}\n\nvar _default = md5;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = '00000000-0000-0000-0000-000000000000';\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction parse(uuid) {\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n let v;\n const arr = new Uint8Array(16); // Parse ########-....-....-....-............\n\n arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;\n arr[1] = v >>> 16 & 0xff;\n arr[2] = v >>> 8 & 0xff;\n arr[3] = v & 0xff; // Parse ........-####-....-....-............\n\n arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;\n arr[5] = v & 0xff; // Parse ........-....-####-....-............\n\n arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;\n arr[7] = v & 0xff; // Parse ........-....-....-####-............\n\n arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;\n arr[9] = v & 0xff; // Parse ........-....-....-....-############\n // (Use \"/\" to avoid 32-bit truncation when bit-shifting high-order bytes)\n\n arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;\n arr[11] = v / 0x100000000 & 0xff;\n arr[12] = v >>> 24 & 0xff;\n arr[13] = v >>> 16 & 0xff;\n arr[14] = v >>> 8 & 0xff;\n arr[15] = v & 0xff;\n return arr;\n}\n\nvar _default = parse;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = rng;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate\n\nlet poolPtr = rnds8Pool.length;\n\nfunction rng() {\n if (poolPtr > rnds8Pool.length - 16) {\n _crypto.default.randomFillSync(rnds8Pool);\n\n poolPtr = 0;\n }\n\n return rnds8Pool.slice(poolPtr, poolPtr += 16);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction sha1(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return _crypto.default.createHash('sha1').update(bytes).digest();\n}\n\nvar _default = sha1;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nvar _default = stringify;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _rng = _interopRequireDefault(require(\"./rng.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\nlet _nodeId;\n\nlet _clockseq; // Previous uuid creation time\n\n\nlet _lastMSecs = 0;\nlet _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details\n\nfunction v1(options, buf, offset) {\n let i = buf && offset || 0;\n const b = buf || new Array(16);\n options = options || {};\n let node = options.node || _nodeId;\n let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n\n if (node == null || clockseq == null) {\n const seedBytes = options.random || (options.rng || _rng.default)();\n\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];\n }\n\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n } // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n\n\n let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n\n let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)\n\n const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression\n\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n\n\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n } // Per 4.2.1.2 Throw error if too many uuids are requested\n\n\n if (nsecs >= 10000) {\n throw new Error(\"uuid.v1(): Can't create more than 10M uuids/sec\");\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n\n msecs += 12219292800000; // `time_low`\n\n const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff; // `time_mid`\n\n const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff; // `time_high_and_version`\n\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n\n b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n\n b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`\n\n b[i++] = clockseq & 0xff; // `node`\n\n for (let n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf || (0, _stringify.default)(b);\n}\n\nvar _default = v1;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _v = _interopRequireDefault(require(\"./v35.js\"));\n\nvar _md = _interopRequireDefault(require(\"./md5.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst v3 = (0, _v.default)('v3', 0x30, _md.default);\nvar _default = v3;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nexports.URL = exports.DNS = void 0;\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nvar _parse = _interopRequireDefault(require(\"./parse.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction stringToBytes(str) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n\n const bytes = [];\n\n for (let i = 0; i < str.length; ++i) {\n bytes.push(str.charCodeAt(i));\n }\n\n return bytes;\n}\n\nconst DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nexports.DNS = DNS;\nconst URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\nexports.URL = URL;\n\nfunction _default(name, version, hashfunc) {\n function generateUUID(value, namespace, buf, offset) {\n if (typeof value === 'string') {\n value = stringToBytes(value);\n }\n\n if (typeof namespace === 'string') {\n namespace = (0, _parse.default)(namespace);\n }\n\n if (namespace.length !== 16) {\n throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');\n } // Compute hash of namespace and value, Per 4.3\n // Future: Use spread syntax when supported on all platforms, e.g. `bytes =\n // hashfunc([...namespace, ... value])`\n\n\n let bytes = new Uint8Array(16 + value.length);\n bytes.set(namespace);\n bytes.set(value, namespace.length);\n bytes = hashfunc(bytes);\n bytes[6] = bytes[6] & 0x0f | version;\n bytes[8] = bytes[8] & 0x3f | 0x80;\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = bytes[i];\n }\n\n return buf;\n }\n\n return (0, _stringify.default)(bytes);\n } // Function#name is not settable on some platforms (#270)\n\n\n try {\n generateUUID.name = name; // eslint-disable-next-line no-empty\n } catch (err) {} // For CommonJS default export support\n\n\n generateUUID.DNS = DNS;\n generateUUID.URL = URL;\n return generateUUID;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _rng = _interopRequireDefault(require(\"./rng.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction v4(options, buf, offset) {\n options = options || {};\n\n const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return (0, _stringify.default)(rnds);\n}\n\nvar _default = v4;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _v = _interopRequireDefault(require(\"./v35.js\"));\n\nvar _sha = _interopRequireDefault(require(\"./sha1.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst v5 = (0, _v.default)('v5', 0x50, _sha.default);\nvar _default = v5;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _regex = _interopRequireDefault(require(\"./regex.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && _regex.default.test(uuid);\n}\n\nvar _default = validate;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction version(uuid) {\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n return parseInt(uuid.substr(14, 1), 16);\n}\n\nvar _default = version;\nexports.default = _default;","module.exports = read\n\nvar MSB = 0x80\n , REST = 0x7F\n\nfunction read(buf, offset) {\n var res = 0\n , offset = offset || 0\n , shift = 0\n , counter = offset\n , b\n , l = buf.length\n\n do {\n if (counter >= l || shift > 49) {\n read.bytes = 0\n throw new RangeError('Could not decode varint')\n }\n b = buf[counter++]\n res += shift < 28\n ? (b & REST) << shift\n : (b & REST) * Math.pow(2, shift)\n shift += 7\n } while (b >= MSB)\n\n read.bytes = counter - offset\n\n return res\n}\n","module.exports = encode\n\nvar MSB = 0x80\n , REST = 0x7F\n , MSBALL = ~REST\n , INT = Math.pow(2, 31)\n\nfunction encode(num, out, offset) {\n if (Number.MAX_SAFE_INTEGER && num > Number.MAX_SAFE_INTEGER) {\n encode.bytes = 0\n throw new RangeError('Could not encode varint')\n }\n out = out || []\n offset = offset || 0\n var oldOffset = offset\n\n while(num >= INT) {\n out[offset++] = (num & 0xFF) | MSB\n num /= 128\n }\n while(num & MSBALL) {\n out[offset++] = (num & 0xFF) | MSB\n num >>>= 7\n }\n out[offset] = num | 0\n \n encode.bytes = offset - oldOffset + 1\n \n return out\n}\n","module.exports = {\n encode: require('./encode.js')\n , decode: require('./decode.js')\n , encodingLength: require('./length.js')\n}\n","\nvar N1 = Math.pow(2, 7)\nvar N2 = Math.pow(2, 14)\nvar N3 = Math.pow(2, 21)\nvar N4 = Math.pow(2, 28)\nvar N5 = Math.pow(2, 35)\nvar N6 = Math.pow(2, 42)\nvar N7 = Math.pow(2, 49)\nvar N8 = Math.pow(2, 56)\nvar N9 = Math.pow(2, 63)\n\nmodule.exports = function (value) {\n return (\n value < N1 ? 1\n : value < N2 ? 2\n : value < N3 ? 3\n : value < N4 ? 4\n : value < N5 ? 5\n : value < N6 ? 6\n : value < N7 ? 7\n : value < N8 ? 8\n : value < N9 ? 9\n : 10\n )\n}\n","\"use strict\"\n\nexports.TextEncoder =\n typeof TextEncoder !== \"undefined\" ? TextEncoder : require(\"util\").TextEncoder\n\nexports.TextDecoder =\n typeof TextDecoder !== \"undefined\" ? TextDecoder : require(\"util\").TextDecoder\n","/**\n * web-streams-polyfill v3.2.1\n */\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.WebStreamsPolyfill = {}));\n}(this, (function (exports) { 'use strict';\n\n /// \n var SymbolPolyfill = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ?\n Symbol :\n function (description) { return \"Symbol(\" + description + \")\"; };\n\n /// \n function noop() {\n return undefined;\n }\n function getGlobals() {\n if (typeof self !== 'undefined') {\n return self;\n }\n else if (typeof window !== 'undefined') {\n return window;\n }\n else if (typeof global !== 'undefined') {\n return global;\n }\n return undefined;\n }\n var globals = getGlobals();\n\n function typeIsObject(x) {\n return (typeof x === 'object' && x !== null) || typeof x === 'function';\n }\n var rethrowAssertionErrorRejection = noop;\n\n var originalPromise = Promise;\n var originalPromiseThen = Promise.prototype.then;\n var originalPromiseResolve = Promise.resolve.bind(originalPromise);\n var originalPromiseReject = Promise.reject.bind(originalPromise);\n function newPromise(executor) {\n return new originalPromise(executor);\n }\n function promiseResolvedWith(value) {\n return originalPromiseResolve(value);\n }\n function promiseRejectedWith(reason) {\n return originalPromiseReject(reason);\n }\n function PerformPromiseThen(promise, onFulfilled, onRejected) {\n // There doesn't appear to be any way to correctly emulate the behaviour from JavaScript, so this is just an\n // approximation.\n return originalPromiseThen.call(promise, onFulfilled, onRejected);\n }\n function uponPromise(promise, onFulfilled, onRejected) {\n PerformPromiseThen(PerformPromiseThen(promise, onFulfilled, onRejected), undefined, rethrowAssertionErrorRejection);\n }\n function uponFulfillment(promise, onFulfilled) {\n uponPromise(promise, onFulfilled);\n }\n function uponRejection(promise, onRejected) {\n uponPromise(promise, undefined, onRejected);\n }\n function transformPromiseWith(promise, fulfillmentHandler, rejectionHandler) {\n return PerformPromiseThen(promise, fulfillmentHandler, rejectionHandler);\n }\n function setPromiseIsHandledToTrue(promise) {\n PerformPromiseThen(promise, undefined, rethrowAssertionErrorRejection);\n }\n var queueMicrotask = (function () {\n var globalQueueMicrotask = globals && globals.queueMicrotask;\n if (typeof globalQueueMicrotask === 'function') {\n return globalQueueMicrotask;\n }\n var resolvedPromise = promiseResolvedWith(undefined);\n return function (fn) { return PerformPromiseThen(resolvedPromise, fn); };\n })();\n function reflectCall(F, V, args) {\n if (typeof F !== 'function') {\n throw new TypeError('Argument is not a function');\n }\n return Function.prototype.apply.call(F, V, args);\n }\n function promiseCall(F, V, args) {\n try {\n return promiseResolvedWith(reflectCall(F, V, args));\n }\n catch (value) {\n return promiseRejectedWith(value);\n }\n }\n\n // Original from Chromium\n // https://chromium.googlesource.com/chromium/src/+/0aee4434a4dba42a42abaea9bfbc0cd196a63bc1/third_party/blink/renderer/core/streams/SimpleQueue.js\n var QUEUE_MAX_ARRAY_SIZE = 16384;\n /**\n * Simple queue structure.\n *\n * Avoids scalability issues with using a packed array directly by using\n * multiple arrays in a linked list and keeping the array size bounded.\n */\n var SimpleQueue = /** @class */ (function () {\n function SimpleQueue() {\n this._cursor = 0;\n this._size = 0;\n // _front and _back are always defined.\n this._front = {\n _elements: [],\n _next: undefined\n };\n this._back = this._front;\n // The cursor is used to avoid calling Array.shift().\n // It contains the index of the front element of the array inside the\n // front-most node. It is always in the range [0, QUEUE_MAX_ARRAY_SIZE).\n this._cursor = 0;\n // When there is only one node, size === elements.length - cursor.\n this._size = 0;\n }\n Object.defineProperty(SimpleQueue.prototype, \"length\", {\n get: function () {\n return this._size;\n },\n enumerable: false,\n configurable: true\n });\n // For exception safety, this method is structured in order:\n // 1. Read state\n // 2. Calculate required state mutations\n // 3. Perform state mutations\n SimpleQueue.prototype.push = function (element) {\n var oldBack = this._back;\n var newBack = oldBack;\n if (oldBack._elements.length === QUEUE_MAX_ARRAY_SIZE - 1) {\n newBack = {\n _elements: [],\n _next: undefined\n };\n }\n // push() is the mutation most likely to throw an exception, so it\n // goes first.\n oldBack._elements.push(element);\n if (newBack !== oldBack) {\n this._back = newBack;\n oldBack._next = newBack;\n }\n ++this._size;\n };\n // Like push(), shift() follows the read -> calculate -> mutate pattern for\n // exception safety.\n SimpleQueue.prototype.shift = function () { // must not be called on an empty queue\n var oldFront = this._front;\n var newFront = oldFront;\n var oldCursor = this._cursor;\n var newCursor = oldCursor + 1;\n var elements = oldFront._elements;\n var element = elements[oldCursor];\n if (newCursor === QUEUE_MAX_ARRAY_SIZE) {\n newFront = oldFront._next;\n newCursor = 0;\n }\n // No mutations before this point.\n --this._size;\n this._cursor = newCursor;\n if (oldFront !== newFront) {\n this._front = newFront;\n }\n // Permit shifted element to be garbage collected.\n elements[oldCursor] = undefined;\n return element;\n };\n // The tricky thing about forEach() is that it can be called\n // re-entrantly. The queue may be mutated inside the callback. It is easy to\n // see that push() within the callback has no negative effects since the end\n // of the queue is checked for on every iteration. If shift() is called\n // repeatedly within the callback then the next iteration may return an\n // element that has been removed. In this case the callback will be called\n // with undefined values until we either \"catch up\" with elements that still\n // exist or reach the back of the queue.\n SimpleQueue.prototype.forEach = function (callback) {\n var i = this._cursor;\n var node = this._front;\n var elements = node._elements;\n while (i !== elements.length || node._next !== undefined) {\n if (i === elements.length) {\n node = node._next;\n elements = node._elements;\n i = 0;\n if (elements.length === 0) {\n break;\n }\n }\n callback(elements[i]);\n ++i;\n }\n };\n // Return the element that would be returned if shift() was called now,\n // without modifying the queue.\n SimpleQueue.prototype.peek = function () { // must not be called on an empty queue\n var front = this._front;\n var cursor = this._cursor;\n return front._elements[cursor];\n };\n return SimpleQueue;\n }());\n\n function ReadableStreamReaderGenericInitialize(reader, stream) {\n reader._ownerReadableStream = stream;\n stream._reader = reader;\n if (stream._state === 'readable') {\n defaultReaderClosedPromiseInitialize(reader);\n }\n else if (stream._state === 'closed') {\n defaultReaderClosedPromiseInitializeAsResolved(reader);\n }\n else {\n defaultReaderClosedPromiseInitializeAsRejected(reader, stream._storedError);\n }\n }\n // A client of ReadableStreamDefaultReader and ReadableStreamBYOBReader may use these functions directly to bypass state\n // check.\n function ReadableStreamReaderGenericCancel(reader, reason) {\n var stream = reader._ownerReadableStream;\n return ReadableStreamCancel(stream, reason);\n }\n function ReadableStreamReaderGenericRelease(reader) {\n if (reader._ownerReadableStream._state === 'readable') {\n defaultReaderClosedPromiseReject(reader, new TypeError(\"Reader was released and can no longer be used to monitor the stream's closedness\"));\n }\n else {\n defaultReaderClosedPromiseResetToRejected(reader, new TypeError(\"Reader was released and can no longer be used to monitor the stream's closedness\"));\n }\n reader._ownerReadableStream._reader = undefined;\n reader._ownerReadableStream = undefined;\n }\n // Helper functions for the readers.\n function readerLockException(name) {\n return new TypeError('Cannot ' + name + ' a stream using a released reader');\n }\n // Helper functions for the ReadableStreamDefaultReader.\n function defaultReaderClosedPromiseInitialize(reader) {\n reader._closedPromise = newPromise(function (resolve, reject) {\n reader._closedPromise_resolve = resolve;\n reader._closedPromise_reject = reject;\n });\n }\n function defaultReaderClosedPromiseInitializeAsRejected(reader, reason) {\n defaultReaderClosedPromiseInitialize(reader);\n defaultReaderClosedPromiseReject(reader, reason);\n }\n function defaultReaderClosedPromiseInitializeAsResolved(reader) {\n defaultReaderClosedPromiseInitialize(reader);\n defaultReaderClosedPromiseResolve(reader);\n }\n function defaultReaderClosedPromiseReject(reader, reason) {\n if (reader._closedPromise_reject === undefined) {\n return;\n }\n setPromiseIsHandledToTrue(reader._closedPromise);\n reader._closedPromise_reject(reason);\n reader._closedPromise_resolve = undefined;\n reader._closedPromise_reject = undefined;\n }\n function defaultReaderClosedPromiseResetToRejected(reader, reason) {\n defaultReaderClosedPromiseInitializeAsRejected(reader, reason);\n }\n function defaultReaderClosedPromiseResolve(reader) {\n if (reader._closedPromise_resolve === undefined) {\n return;\n }\n reader._closedPromise_resolve(undefined);\n reader._closedPromise_resolve = undefined;\n reader._closedPromise_reject = undefined;\n }\n\n var AbortSteps = SymbolPolyfill('[[AbortSteps]]');\n var ErrorSteps = SymbolPolyfill('[[ErrorSteps]]');\n var CancelSteps = SymbolPolyfill('[[CancelSteps]]');\n var PullSteps = SymbolPolyfill('[[PullSteps]]');\n\n /// \n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite#Polyfill\n var NumberIsFinite = Number.isFinite || function (x) {\n return typeof x === 'number' && isFinite(x);\n };\n\n /// \n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc#Polyfill\n var MathTrunc = Math.trunc || function (v) {\n return v < 0 ? Math.ceil(v) : Math.floor(v);\n };\n\n // https://heycam.github.io/webidl/#idl-dictionaries\n function isDictionary(x) {\n return typeof x === 'object' || typeof x === 'function';\n }\n function assertDictionary(obj, context) {\n if (obj !== undefined && !isDictionary(obj)) {\n throw new TypeError(context + \" is not an object.\");\n }\n }\n // https://heycam.github.io/webidl/#idl-callback-functions\n function assertFunction(x, context) {\n if (typeof x !== 'function') {\n throw new TypeError(context + \" is not a function.\");\n }\n }\n // https://heycam.github.io/webidl/#idl-object\n function isObject(x) {\n return (typeof x === 'object' && x !== null) || typeof x === 'function';\n }\n function assertObject(x, context) {\n if (!isObject(x)) {\n throw new TypeError(context + \" is not an object.\");\n }\n }\n function assertRequiredArgument(x, position, context) {\n if (x === undefined) {\n throw new TypeError(\"Parameter \" + position + \" is required in '\" + context + \"'.\");\n }\n }\n function assertRequiredField(x, field, context) {\n if (x === undefined) {\n throw new TypeError(field + \" is required in '\" + context + \"'.\");\n }\n }\n // https://heycam.github.io/webidl/#idl-unrestricted-double\n function convertUnrestrictedDouble(value) {\n return Number(value);\n }\n function censorNegativeZero(x) {\n return x === 0 ? 0 : x;\n }\n function integerPart(x) {\n return censorNegativeZero(MathTrunc(x));\n }\n // https://heycam.github.io/webidl/#idl-unsigned-long-long\n function convertUnsignedLongLongWithEnforceRange(value, context) {\n var lowerBound = 0;\n var upperBound = Number.MAX_SAFE_INTEGER;\n var x = Number(value);\n x = censorNegativeZero(x);\n if (!NumberIsFinite(x)) {\n throw new TypeError(context + \" is not a finite number\");\n }\n x = integerPart(x);\n if (x < lowerBound || x > upperBound) {\n throw new TypeError(context + \" is outside the accepted range of \" + lowerBound + \" to \" + upperBound + \", inclusive\");\n }\n if (!NumberIsFinite(x) || x === 0) {\n return 0;\n }\n // TODO Use BigInt if supported?\n // let xBigInt = BigInt(integerPart(x));\n // xBigInt = BigInt.asUintN(64, xBigInt);\n // return Number(xBigInt);\n return x;\n }\n\n function assertReadableStream(x, context) {\n if (!IsReadableStream(x)) {\n throw new TypeError(context + \" is not a ReadableStream.\");\n }\n }\n\n // Abstract operations for the ReadableStream.\n function AcquireReadableStreamDefaultReader(stream) {\n return new ReadableStreamDefaultReader(stream);\n }\n // ReadableStream API exposed for controllers.\n function ReadableStreamAddReadRequest(stream, readRequest) {\n stream._reader._readRequests.push(readRequest);\n }\n function ReadableStreamFulfillReadRequest(stream, chunk, done) {\n var reader = stream._reader;\n var readRequest = reader._readRequests.shift();\n if (done) {\n readRequest._closeSteps();\n }\n else {\n readRequest._chunkSteps(chunk);\n }\n }\n function ReadableStreamGetNumReadRequests(stream) {\n return stream._reader._readRequests.length;\n }\n function ReadableStreamHasDefaultReader(stream) {\n var reader = stream._reader;\n if (reader === undefined) {\n return false;\n }\n if (!IsReadableStreamDefaultReader(reader)) {\n return false;\n }\n return true;\n }\n /**\n * A default reader vended by a {@link ReadableStream}.\n *\n * @public\n */\n var ReadableStreamDefaultReader = /** @class */ (function () {\n function ReadableStreamDefaultReader(stream) {\n assertRequiredArgument(stream, 1, 'ReadableStreamDefaultReader');\n assertReadableStream(stream, 'First parameter');\n if (IsReadableStreamLocked(stream)) {\n throw new TypeError('This stream has already been locked for exclusive reading by another reader');\n }\n ReadableStreamReaderGenericInitialize(this, stream);\n this._readRequests = new SimpleQueue();\n }\n Object.defineProperty(ReadableStreamDefaultReader.prototype, \"closed\", {\n /**\n * Returns a promise that will be fulfilled when the stream becomes closed,\n * or rejected if the stream ever errors or the reader's lock is released before the stream finishes closing.\n */\n get: function () {\n if (!IsReadableStreamDefaultReader(this)) {\n return promiseRejectedWith(defaultReaderBrandCheckException('closed'));\n }\n return this._closedPromise;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}.\n */\n ReadableStreamDefaultReader.prototype.cancel = function (reason) {\n if (reason === void 0) { reason = undefined; }\n if (!IsReadableStreamDefaultReader(this)) {\n return promiseRejectedWith(defaultReaderBrandCheckException('cancel'));\n }\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('cancel'));\n }\n return ReadableStreamReaderGenericCancel(this, reason);\n };\n /**\n * Returns a promise that allows access to the next chunk from the stream's internal queue, if available.\n *\n * If reading a chunk causes the queue to become empty, more data will be pulled from the underlying source.\n */\n ReadableStreamDefaultReader.prototype.read = function () {\n if (!IsReadableStreamDefaultReader(this)) {\n return promiseRejectedWith(defaultReaderBrandCheckException('read'));\n }\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('read from'));\n }\n var resolvePromise;\n var rejectPromise;\n var promise = newPromise(function (resolve, reject) {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n var readRequest = {\n _chunkSteps: function (chunk) { return resolvePromise({ value: chunk, done: false }); },\n _closeSteps: function () { return resolvePromise({ value: undefined, done: true }); },\n _errorSteps: function (e) { return rejectPromise(e); }\n };\n ReadableStreamDefaultReaderRead(this, readRequest);\n return promise;\n };\n /**\n * Releases the reader's lock on the corresponding stream. After the lock is released, the reader is no longer active.\n * If the associated stream is errored when the lock is released, the reader will appear errored in the same way\n * from now on; otherwise, the reader will appear closed.\n *\n * A reader's lock cannot be released while it still has a pending read request, i.e., if a promise returned by\n * the reader's {@link ReadableStreamDefaultReader.read | read()} method has not yet been settled. Attempting to\n * do so will throw a `TypeError` and leave the reader locked to the stream.\n */\n ReadableStreamDefaultReader.prototype.releaseLock = function () {\n if (!IsReadableStreamDefaultReader(this)) {\n throw defaultReaderBrandCheckException('releaseLock');\n }\n if (this._ownerReadableStream === undefined) {\n return;\n }\n if (this._readRequests.length > 0) {\n throw new TypeError('Tried to release a reader lock when that reader has pending read() calls un-settled');\n }\n ReadableStreamReaderGenericRelease(this);\n };\n return ReadableStreamDefaultReader;\n }());\n Object.defineProperties(ReadableStreamDefaultReader.prototype, {\n cancel: { enumerable: true },\n read: { enumerable: true },\n releaseLock: { enumerable: true },\n closed: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamDefaultReader.prototype, SymbolPolyfill.toStringTag, {\n value: 'ReadableStreamDefaultReader',\n configurable: true\n });\n }\n // Abstract operations for the readers.\n function IsReadableStreamDefaultReader(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_readRequests')) {\n return false;\n }\n return x instanceof ReadableStreamDefaultReader;\n }\n function ReadableStreamDefaultReaderRead(reader, readRequest) {\n var stream = reader._ownerReadableStream;\n stream._disturbed = true;\n if (stream._state === 'closed') {\n readRequest._closeSteps();\n }\n else if (stream._state === 'errored') {\n readRequest._errorSteps(stream._storedError);\n }\n else {\n stream._readableStreamController[PullSteps](readRequest);\n }\n }\n // Helper functions for the ReadableStreamDefaultReader.\n function defaultReaderBrandCheckException(name) {\n return new TypeError(\"ReadableStreamDefaultReader.prototype.\" + name + \" can only be used on a ReadableStreamDefaultReader\");\n }\n\n /// \n var _a;\n var AsyncIteratorPrototype;\n if (typeof SymbolPolyfill.asyncIterator === 'symbol') {\n // We're running inside a ES2018+ environment, but we're compiling to an older syntax.\n // We cannot access %AsyncIteratorPrototype% without non-ES2018 syntax, but we can re-create it.\n AsyncIteratorPrototype = (_a = {},\n // 25.1.3.1 %AsyncIteratorPrototype% [ @@asyncIterator ] ( )\n // https://tc39.github.io/ecma262/#sec-asynciteratorprototype-asynciterator\n _a[SymbolPolyfill.asyncIterator] = function () {\n return this;\n },\n _a);\n Object.defineProperty(AsyncIteratorPrototype, SymbolPolyfill.asyncIterator, { enumerable: false });\n }\n\n /// \n var ReadableStreamAsyncIteratorImpl = /** @class */ (function () {\n function ReadableStreamAsyncIteratorImpl(reader, preventCancel) {\n this._ongoingPromise = undefined;\n this._isFinished = false;\n this._reader = reader;\n this._preventCancel = preventCancel;\n }\n ReadableStreamAsyncIteratorImpl.prototype.next = function () {\n var _this = this;\n var nextSteps = function () { return _this._nextSteps(); };\n this._ongoingPromise = this._ongoingPromise ?\n transformPromiseWith(this._ongoingPromise, nextSteps, nextSteps) :\n nextSteps();\n return this._ongoingPromise;\n };\n ReadableStreamAsyncIteratorImpl.prototype.return = function (value) {\n var _this = this;\n var returnSteps = function () { return _this._returnSteps(value); };\n return this._ongoingPromise ?\n transformPromiseWith(this._ongoingPromise, returnSteps, returnSteps) :\n returnSteps();\n };\n ReadableStreamAsyncIteratorImpl.prototype._nextSteps = function () {\n var _this = this;\n if (this._isFinished) {\n return Promise.resolve({ value: undefined, done: true });\n }\n var reader = this._reader;\n if (reader._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('iterate'));\n }\n var resolvePromise;\n var rejectPromise;\n var promise = newPromise(function (resolve, reject) {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n var readRequest = {\n _chunkSteps: function (chunk) {\n _this._ongoingPromise = undefined;\n // This needs to be delayed by one microtask, otherwise we stop pulling too early which breaks a test.\n // FIXME Is this a bug in the specification, or in the test?\n queueMicrotask(function () { return resolvePromise({ value: chunk, done: false }); });\n },\n _closeSteps: function () {\n _this._ongoingPromise = undefined;\n _this._isFinished = true;\n ReadableStreamReaderGenericRelease(reader);\n resolvePromise({ value: undefined, done: true });\n },\n _errorSteps: function (reason) {\n _this._ongoingPromise = undefined;\n _this._isFinished = true;\n ReadableStreamReaderGenericRelease(reader);\n rejectPromise(reason);\n }\n };\n ReadableStreamDefaultReaderRead(reader, readRequest);\n return promise;\n };\n ReadableStreamAsyncIteratorImpl.prototype._returnSteps = function (value) {\n if (this._isFinished) {\n return Promise.resolve({ value: value, done: true });\n }\n this._isFinished = true;\n var reader = this._reader;\n if (reader._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('finish iterating'));\n }\n if (!this._preventCancel) {\n var result = ReadableStreamReaderGenericCancel(reader, value);\n ReadableStreamReaderGenericRelease(reader);\n return transformPromiseWith(result, function () { return ({ value: value, done: true }); });\n }\n ReadableStreamReaderGenericRelease(reader);\n return promiseResolvedWith({ value: value, done: true });\n };\n return ReadableStreamAsyncIteratorImpl;\n }());\n var ReadableStreamAsyncIteratorPrototype = {\n next: function () {\n if (!IsReadableStreamAsyncIterator(this)) {\n return promiseRejectedWith(streamAsyncIteratorBrandCheckException('next'));\n }\n return this._asyncIteratorImpl.next();\n },\n return: function (value) {\n if (!IsReadableStreamAsyncIterator(this)) {\n return promiseRejectedWith(streamAsyncIteratorBrandCheckException('return'));\n }\n return this._asyncIteratorImpl.return(value);\n }\n };\n if (AsyncIteratorPrototype !== undefined) {\n Object.setPrototypeOf(ReadableStreamAsyncIteratorPrototype, AsyncIteratorPrototype);\n }\n // Abstract operations for the ReadableStream.\n function AcquireReadableStreamAsyncIterator(stream, preventCancel) {\n var reader = AcquireReadableStreamDefaultReader(stream);\n var impl = new ReadableStreamAsyncIteratorImpl(reader, preventCancel);\n var iterator = Object.create(ReadableStreamAsyncIteratorPrototype);\n iterator._asyncIteratorImpl = impl;\n return iterator;\n }\n function IsReadableStreamAsyncIterator(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_asyncIteratorImpl')) {\n return false;\n }\n try {\n // noinspection SuspiciousTypeOfGuard\n return x._asyncIteratorImpl instanceof\n ReadableStreamAsyncIteratorImpl;\n }\n catch (_a) {\n return false;\n }\n }\n // Helper functions for the ReadableStream.\n function streamAsyncIteratorBrandCheckException(name) {\n return new TypeError(\"ReadableStreamAsyncIterator.\" + name + \" can only be used on a ReadableSteamAsyncIterator\");\n }\n\n /// \n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN#Polyfill\n var NumberIsNaN = Number.isNaN || function (x) {\n // eslint-disable-next-line no-self-compare\n return x !== x;\n };\n\n function CreateArrayFromList(elements) {\n // We use arrays to represent lists, so this is basically a no-op.\n // Do a slice though just in case we happen to depend on the unique-ness.\n return elements.slice();\n }\n function CopyDataBlockBytes(dest, destOffset, src, srcOffset, n) {\n new Uint8Array(dest).set(new Uint8Array(src, srcOffset, n), destOffset);\n }\n // Not implemented correctly\n function TransferArrayBuffer(O) {\n return O;\n }\n // Not implemented correctly\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n function IsDetachedBuffer(O) {\n return false;\n }\n function ArrayBufferSlice(buffer, begin, end) {\n // ArrayBuffer.prototype.slice is not available on IE10\n // https://www.caniuse.com/mdn-javascript_builtins_arraybuffer_slice\n if (buffer.slice) {\n return buffer.slice(begin, end);\n }\n var length = end - begin;\n var slice = new ArrayBuffer(length);\n CopyDataBlockBytes(slice, 0, buffer, begin, length);\n return slice;\n }\n\n function IsNonNegativeNumber(v) {\n if (typeof v !== 'number') {\n return false;\n }\n if (NumberIsNaN(v)) {\n return false;\n }\n if (v < 0) {\n return false;\n }\n return true;\n }\n function CloneAsUint8Array(O) {\n var buffer = ArrayBufferSlice(O.buffer, O.byteOffset, O.byteOffset + O.byteLength);\n return new Uint8Array(buffer);\n }\n\n function DequeueValue(container) {\n var pair = container._queue.shift();\n container._queueTotalSize -= pair.size;\n if (container._queueTotalSize < 0) {\n container._queueTotalSize = 0;\n }\n return pair.value;\n }\n function EnqueueValueWithSize(container, value, size) {\n if (!IsNonNegativeNumber(size) || size === Infinity) {\n throw new RangeError('Size must be a finite, non-NaN, non-negative number.');\n }\n container._queue.push({ value: value, size: size });\n container._queueTotalSize += size;\n }\n function PeekQueueValue(container) {\n var pair = container._queue.peek();\n return pair.value;\n }\n function ResetQueue(container) {\n container._queue = new SimpleQueue();\n container._queueTotalSize = 0;\n }\n\n /**\n * A pull-into request in a {@link ReadableByteStreamController}.\n *\n * @public\n */\n var ReadableStreamBYOBRequest = /** @class */ (function () {\n function ReadableStreamBYOBRequest() {\n throw new TypeError('Illegal constructor');\n }\n Object.defineProperty(ReadableStreamBYOBRequest.prototype, \"view\", {\n /**\n * Returns the view for writing in to, or `null` if the BYOB request has already been responded to.\n */\n get: function () {\n if (!IsReadableStreamBYOBRequest(this)) {\n throw byobRequestBrandCheckException('view');\n }\n return this._view;\n },\n enumerable: false,\n configurable: true\n });\n ReadableStreamBYOBRequest.prototype.respond = function (bytesWritten) {\n if (!IsReadableStreamBYOBRequest(this)) {\n throw byobRequestBrandCheckException('respond');\n }\n assertRequiredArgument(bytesWritten, 1, 'respond');\n bytesWritten = convertUnsignedLongLongWithEnforceRange(bytesWritten, 'First parameter');\n if (this._associatedReadableByteStreamController === undefined) {\n throw new TypeError('This BYOB request has been invalidated');\n }\n if (IsDetachedBuffer(this._view.buffer)) ;\n ReadableByteStreamControllerRespond(this._associatedReadableByteStreamController, bytesWritten);\n };\n ReadableStreamBYOBRequest.prototype.respondWithNewView = function (view) {\n if (!IsReadableStreamBYOBRequest(this)) {\n throw byobRequestBrandCheckException('respondWithNewView');\n }\n assertRequiredArgument(view, 1, 'respondWithNewView');\n if (!ArrayBuffer.isView(view)) {\n throw new TypeError('You can only respond with array buffer views');\n }\n if (this._associatedReadableByteStreamController === undefined) {\n throw new TypeError('This BYOB request has been invalidated');\n }\n if (IsDetachedBuffer(view.buffer)) ;\n ReadableByteStreamControllerRespondWithNewView(this._associatedReadableByteStreamController, view);\n };\n return ReadableStreamBYOBRequest;\n }());\n Object.defineProperties(ReadableStreamBYOBRequest.prototype, {\n respond: { enumerable: true },\n respondWithNewView: { enumerable: true },\n view: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamBYOBRequest.prototype, SymbolPolyfill.toStringTag, {\n value: 'ReadableStreamBYOBRequest',\n configurable: true\n });\n }\n /**\n * Allows control of a {@link ReadableStream | readable byte stream}'s state and internal queue.\n *\n * @public\n */\n var ReadableByteStreamController = /** @class */ (function () {\n function ReadableByteStreamController() {\n throw new TypeError('Illegal constructor');\n }\n Object.defineProperty(ReadableByteStreamController.prototype, \"byobRequest\", {\n /**\n * Returns the current BYOB pull request, or `null` if there isn't one.\n */\n get: function () {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('byobRequest');\n }\n return ReadableByteStreamControllerGetBYOBRequest(this);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ReadableByteStreamController.prototype, \"desiredSize\", {\n /**\n * Returns the desired size to fill the controlled stream's internal queue. It can be negative, if the queue is\n * over-full. An underlying byte source ought to use this information to determine when and how to apply backpressure.\n */\n get: function () {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('desiredSize');\n }\n return ReadableByteStreamControllerGetDesiredSize(this);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Closes the controlled readable stream. Consumers will still be able to read any previously-enqueued chunks from\n * the stream, but once those are read, the stream will become closed.\n */\n ReadableByteStreamController.prototype.close = function () {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('close');\n }\n if (this._closeRequested) {\n throw new TypeError('The stream has already been closed; do not close it again!');\n }\n var state = this._controlledReadableByteStream._state;\n if (state !== 'readable') {\n throw new TypeError(\"The stream (in \" + state + \" state) is not in the readable state and cannot be closed\");\n }\n ReadableByteStreamControllerClose(this);\n };\n ReadableByteStreamController.prototype.enqueue = function (chunk) {\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('enqueue');\n }\n assertRequiredArgument(chunk, 1, 'enqueue');\n if (!ArrayBuffer.isView(chunk)) {\n throw new TypeError('chunk must be an array buffer view');\n }\n if (chunk.byteLength === 0) {\n throw new TypeError('chunk must have non-zero byteLength');\n }\n if (chunk.buffer.byteLength === 0) {\n throw new TypeError(\"chunk's buffer must have non-zero byteLength\");\n }\n if (this._closeRequested) {\n throw new TypeError('stream is closed or draining');\n }\n var state = this._controlledReadableByteStream._state;\n if (state !== 'readable') {\n throw new TypeError(\"The stream (in \" + state + \" state) is not in the readable state and cannot be enqueued to\");\n }\n ReadableByteStreamControllerEnqueue(this, chunk);\n };\n /**\n * Errors the controlled readable stream, making all future interactions with it fail with the given error `e`.\n */\n ReadableByteStreamController.prototype.error = function (e) {\n if (e === void 0) { e = undefined; }\n if (!IsReadableByteStreamController(this)) {\n throw byteStreamControllerBrandCheckException('error');\n }\n ReadableByteStreamControllerError(this, e);\n };\n /** @internal */\n ReadableByteStreamController.prototype[CancelSteps] = function (reason) {\n ReadableByteStreamControllerClearPendingPullIntos(this);\n ResetQueue(this);\n var result = this._cancelAlgorithm(reason);\n ReadableByteStreamControllerClearAlgorithms(this);\n return result;\n };\n /** @internal */\n ReadableByteStreamController.prototype[PullSteps] = function (readRequest) {\n var stream = this._controlledReadableByteStream;\n if (this._queueTotalSize > 0) {\n var entry = this._queue.shift();\n this._queueTotalSize -= entry.byteLength;\n ReadableByteStreamControllerHandleQueueDrain(this);\n var view = new Uint8Array(entry.buffer, entry.byteOffset, entry.byteLength);\n readRequest._chunkSteps(view);\n return;\n }\n var autoAllocateChunkSize = this._autoAllocateChunkSize;\n if (autoAllocateChunkSize !== undefined) {\n var buffer = void 0;\n try {\n buffer = new ArrayBuffer(autoAllocateChunkSize);\n }\n catch (bufferE) {\n readRequest._errorSteps(bufferE);\n return;\n }\n var pullIntoDescriptor = {\n buffer: buffer,\n bufferByteLength: autoAllocateChunkSize,\n byteOffset: 0,\n byteLength: autoAllocateChunkSize,\n bytesFilled: 0,\n elementSize: 1,\n viewConstructor: Uint8Array,\n readerType: 'default'\n };\n this._pendingPullIntos.push(pullIntoDescriptor);\n }\n ReadableStreamAddReadRequest(stream, readRequest);\n ReadableByteStreamControllerCallPullIfNeeded(this);\n };\n return ReadableByteStreamController;\n }());\n Object.defineProperties(ReadableByteStreamController.prototype, {\n close: { enumerable: true },\n enqueue: { enumerable: true },\n error: { enumerable: true },\n byobRequest: { enumerable: true },\n desiredSize: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ReadableByteStreamController.prototype, SymbolPolyfill.toStringTag, {\n value: 'ReadableByteStreamController',\n configurable: true\n });\n }\n // Abstract operations for the ReadableByteStreamController.\n function IsReadableByteStreamController(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledReadableByteStream')) {\n return false;\n }\n return x instanceof ReadableByteStreamController;\n }\n function IsReadableStreamBYOBRequest(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_associatedReadableByteStreamController')) {\n return false;\n }\n return x instanceof ReadableStreamBYOBRequest;\n }\n function ReadableByteStreamControllerCallPullIfNeeded(controller) {\n var shouldPull = ReadableByteStreamControllerShouldCallPull(controller);\n if (!shouldPull) {\n return;\n }\n if (controller._pulling) {\n controller._pullAgain = true;\n return;\n }\n controller._pulling = true;\n // TODO: Test controller argument\n var pullPromise = controller._pullAlgorithm();\n uponPromise(pullPromise, function () {\n controller._pulling = false;\n if (controller._pullAgain) {\n controller._pullAgain = false;\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n }, function (e) {\n ReadableByteStreamControllerError(controller, e);\n });\n }\n function ReadableByteStreamControllerClearPendingPullIntos(controller) {\n ReadableByteStreamControllerInvalidateBYOBRequest(controller);\n controller._pendingPullIntos = new SimpleQueue();\n }\n function ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor) {\n var done = false;\n if (stream._state === 'closed') {\n done = true;\n }\n var filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor);\n if (pullIntoDescriptor.readerType === 'default') {\n ReadableStreamFulfillReadRequest(stream, filledView, done);\n }\n else {\n ReadableStreamFulfillReadIntoRequest(stream, filledView, done);\n }\n }\n function ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor) {\n var bytesFilled = pullIntoDescriptor.bytesFilled;\n var elementSize = pullIntoDescriptor.elementSize;\n return new pullIntoDescriptor.viewConstructor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, bytesFilled / elementSize);\n }\n function ReadableByteStreamControllerEnqueueChunkToQueue(controller, buffer, byteOffset, byteLength) {\n controller._queue.push({ buffer: buffer, byteOffset: byteOffset, byteLength: byteLength });\n controller._queueTotalSize += byteLength;\n }\n function ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor) {\n var elementSize = pullIntoDescriptor.elementSize;\n var currentAlignedBytes = pullIntoDescriptor.bytesFilled - pullIntoDescriptor.bytesFilled % elementSize;\n var maxBytesToCopy = Math.min(controller._queueTotalSize, pullIntoDescriptor.byteLength - pullIntoDescriptor.bytesFilled);\n var maxBytesFilled = pullIntoDescriptor.bytesFilled + maxBytesToCopy;\n var maxAlignedBytes = maxBytesFilled - maxBytesFilled % elementSize;\n var totalBytesToCopyRemaining = maxBytesToCopy;\n var ready = false;\n if (maxAlignedBytes > currentAlignedBytes) {\n totalBytesToCopyRemaining = maxAlignedBytes - pullIntoDescriptor.bytesFilled;\n ready = true;\n }\n var queue = controller._queue;\n while (totalBytesToCopyRemaining > 0) {\n var headOfQueue = queue.peek();\n var bytesToCopy = Math.min(totalBytesToCopyRemaining, headOfQueue.byteLength);\n var destStart = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled;\n CopyDataBlockBytes(pullIntoDescriptor.buffer, destStart, headOfQueue.buffer, headOfQueue.byteOffset, bytesToCopy);\n if (headOfQueue.byteLength === bytesToCopy) {\n queue.shift();\n }\n else {\n headOfQueue.byteOffset += bytesToCopy;\n headOfQueue.byteLength -= bytesToCopy;\n }\n controller._queueTotalSize -= bytesToCopy;\n ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesToCopy, pullIntoDescriptor);\n totalBytesToCopyRemaining -= bytesToCopy;\n }\n return ready;\n }\n function ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, size, pullIntoDescriptor) {\n pullIntoDescriptor.bytesFilled += size;\n }\n function ReadableByteStreamControllerHandleQueueDrain(controller) {\n if (controller._queueTotalSize === 0 && controller._closeRequested) {\n ReadableByteStreamControllerClearAlgorithms(controller);\n ReadableStreamClose(controller._controlledReadableByteStream);\n }\n else {\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n }\n function ReadableByteStreamControllerInvalidateBYOBRequest(controller) {\n if (controller._byobRequest === null) {\n return;\n }\n controller._byobRequest._associatedReadableByteStreamController = undefined;\n controller._byobRequest._view = null;\n controller._byobRequest = null;\n }\n function ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller) {\n while (controller._pendingPullIntos.length > 0) {\n if (controller._queueTotalSize === 0) {\n return;\n }\n var pullIntoDescriptor = controller._pendingPullIntos.peek();\n if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor)) {\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor);\n }\n }\n }\n function ReadableByteStreamControllerPullInto(controller, view, readIntoRequest) {\n var stream = controller._controlledReadableByteStream;\n var elementSize = 1;\n if (view.constructor !== DataView) {\n elementSize = view.constructor.BYTES_PER_ELEMENT;\n }\n var ctor = view.constructor;\n // try {\n var buffer = TransferArrayBuffer(view.buffer);\n // } catch (e) {\n // readIntoRequest._errorSteps(e);\n // return;\n // }\n var pullIntoDescriptor = {\n buffer: buffer,\n bufferByteLength: buffer.byteLength,\n byteOffset: view.byteOffset,\n byteLength: view.byteLength,\n bytesFilled: 0,\n elementSize: elementSize,\n viewConstructor: ctor,\n readerType: 'byob'\n };\n if (controller._pendingPullIntos.length > 0) {\n controller._pendingPullIntos.push(pullIntoDescriptor);\n // No ReadableByteStreamControllerCallPullIfNeeded() call since:\n // - No change happens on desiredSize\n // - The source has already been notified of that there's at least 1 pending read(view)\n ReadableStreamAddReadIntoRequest(stream, readIntoRequest);\n return;\n }\n if (stream._state === 'closed') {\n var emptyView = new ctor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, 0);\n readIntoRequest._closeSteps(emptyView);\n return;\n }\n if (controller._queueTotalSize > 0) {\n if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor)) {\n var filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor);\n ReadableByteStreamControllerHandleQueueDrain(controller);\n readIntoRequest._chunkSteps(filledView);\n return;\n }\n if (controller._closeRequested) {\n var e = new TypeError('Insufficient bytes to fill elements in the given buffer');\n ReadableByteStreamControllerError(controller, e);\n readIntoRequest._errorSteps(e);\n return;\n }\n }\n controller._pendingPullIntos.push(pullIntoDescriptor);\n ReadableStreamAddReadIntoRequest(stream, readIntoRequest);\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n function ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor) {\n var stream = controller._controlledReadableByteStream;\n if (ReadableStreamHasBYOBReader(stream)) {\n while (ReadableStreamGetNumReadIntoRequests(stream) > 0) {\n var pullIntoDescriptor = ReadableByteStreamControllerShiftPendingPullInto(controller);\n ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor);\n }\n }\n }\n function ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, pullIntoDescriptor) {\n ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesWritten, pullIntoDescriptor);\n if (pullIntoDescriptor.bytesFilled < pullIntoDescriptor.elementSize) {\n return;\n }\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n var remainderSize = pullIntoDescriptor.bytesFilled % pullIntoDescriptor.elementSize;\n if (remainderSize > 0) {\n var end = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled;\n var remainder = ArrayBufferSlice(pullIntoDescriptor.buffer, end - remainderSize, end);\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, remainder, 0, remainder.byteLength);\n }\n pullIntoDescriptor.bytesFilled -= remainderSize;\n ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor);\n ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);\n }\n function ReadableByteStreamControllerRespondInternal(controller, bytesWritten) {\n var firstDescriptor = controller._pendingPullIntos.peek();\n ReadableByteStreamControllerInvalidateBYOBRequest(controller);\n var state = controller._controlledReadableByteStream._state;\n if (state === 'closed') {\n ReadableByteStreamControllerRespondInClosedState(controller);\n }\n else {\n ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, firstDescriptor);\n }\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n function ReadableByteStreamControllerShiftPendingPullInto(controller) {\n var descriptor = controller._pendingPullIntos.shift();\n return descriptor;\n }\n function ReadableByteStreamControllerShouldCallPull(controller) {\n var stream = controller._controlledReadableByteStream;\n if (stream._state !== 'readable') {\n return false;\n }\n if (controller._closeRequested) {\n return false;\n }\n if (!controller._started) {\n return false;\n }\n if (ReadableStreamHasDefaultReader(stream) && ReadableStreamGetNumReadRequests(stream) > 0) {\n return true;\n }\n if (ReadableStreamHasBYOBReader(stream) && ReadableStreamGetNumReadIntoRequests(stream) > 0) {\n return true;\n }\n var desiredSize = ReadableByteStreamControllerGetDesiredSize(controller);\n if (desiredSize > 0) {\n return true;\n }\n return false;\n }\n function ReadableByteStreamControllerClearAlgorithms(controller) {\n controller._pullAlgorithm = undefined;\n controller._cancelAlgorithm = undefined;\n }\n // A client of ReadableByteStreamController may use these functions directly to bypass state check.\n function ReadableByteStreamControllerClose(controller) {\n var stream = controller._controlledReadableByteStream;\n if (controller._closeRequested || stream._state !== 'readable') {\n return;\n }\n if (controller._queueTotalSize > 0) {\n controller._closeRequested = true;\n return;\n }\n if (controller._pendingPullIntos.length > 0) {\n var firstPendingPullInto = controller._pendingPullIntos.peek();\n if (firstPendingPullInto.bytesFilled > 0) {\n var e = new TypeError('Insufficient bytes to fill elements in the given buffer');\n ReadableByteStreamControllerError(controller, e);\n throw e;\n }\n }\n ReadableByteStreamControllerClearAlgorithms(controller);\n ReadableStreamClose(stream);\n }\n function ReadableByteStreamControllerEnqueue(controller, chunk) {\n var stream = controller._controlledReadableByteStream;\n if (controller._closeRequested || stream._state !== 'readable') {\n return;\n }\n var buffer = chunk.buffer;\n var byteOffset = chunk.byteOffset;\n var byteLength = chunk.byteLength;\n var transferredBuffer = TransferArrayBuffer(buffer);\n if (controller._pendingPullIntos.length > 0) {\n var firstPendingPullInto = controller._pendingPullIntos.peek();\n if (IsDetachedBuffer(firstPendingPullInto.buffer)) ;\n firstPendingPullInto.buffer = TransferArrayBuffer(firstPendingPullInto.buffer);\n }\n ReadableByteStreamControllerInvalidateBYOBRequest(controller);\n if (ReadableStreamHasDefaultReader(stream)) {\n if (ReadableStreamGetNumReadRequests(stream) === 0) {\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);\n }\n else {\n if (controller._pendingPullIntos.length > 0) {\n ReadableByteStreamControllerShiftPendingPullInto(controller);\n }\n var transferredView = new Uint8Array(transferredBuffer, byteOffset, byteLength);\n ReadableStreamFulfillReadRequest(stream, transferredView, false);\n }\n }\n else if (ReadableStreamHasBYOBReader(stream)) {\n // TODO: Ideally in this branch detaching should happen only if the buffer is not consumed fully.\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);\n ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);\n }\n else {\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);\n }\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }\n function ReadableByteStreamControllerError(controller, e) {\n var stream = controller._controlledReadableByteStream;\n if (stream._state !== 'readable') {\n return;\n }\n ReadableByteStreamControllerClearPendingPullIntos(controller);\n ResetQueue(controller);\n ReadableByteStreamControllerClearAlgorithms(controller);\n ReadableStreamError(stream, e);\n }\n function ReadableByteStreamControllerGetBYOBRequest(controller) {\n if (controller._byobRequest === null && controller._pendingPullIntos.length > 0) {\n var firstDescriptor = controller._pendingPullIntos.peek();\n var view = new Uint8Array(firstDescriptor.buffer, firstDescriptor.byteOffset + firstDescriptor.bytesFilled, firstDescriptor.byteLength - firstDescriptor.bytesFilled);\n var byobRequest = Object.create(ReadableStreamBYOBRequest.prototype);\n SetUpReadableStreamBYOBRequest(byobRequest, controller, view);\n controller._byobRequest = byobRequest;\n }\n return controller._byobRequest;\n }\n function ReadableByteStreamControllerGetDesiredSize(controller) {\n var state = controller._controlledReadableByteStream._state;\n if (state === 'errored') {\n return null;\n }\n if (state === 'closed') {\n return 0;\n }\n return controller._strategyHWM - controller._queueTotalSize;\n }\n function ReadableByteStreamControllerRespond(controller, bytesWritten) {\n var firstDescriptor = controller._pendingPullIntos.peek();\n var state = controller._controlledReadableByteStream._state;\n if (state === 'closed') {\n if (bytesWritten !== 0) {\n throw new TypeError('bytesWritten must be 0 when calling respond() on a closed stream');\n }\n }\n else {\n if (bytesWritten === 0) {\n throw new TypeError('bytesWritten must be greater than 0 when calling respond() on a readable stream');\n }\n if (firstDescriptor.bytesFilled + bytesWritten > firstDescriptor.byteLength) {\n throw new RangeError('bytesWritten out of range');\n }\n }\n firstDescriptor.buffer = TransferArrayBuffer(firstDescriptor.buffer);\n ReadableByteStreamControllerRespondInternal(controller, bytesWritten);\n }\n function ReadableByteStreamControllerRespondWithNewView(controller, view) {\n var firstDescriptor = controller._pendingPullIntos.peek();\n var state = controller._controlledReadableByteStream._state;\n if (state === 'closed') {\n if (view.byteLength !== 0) {\n throw new TypeError('The view\\'s length must be 0 when calling respondWithNewView() on a closed stream');\n }\n }\n else {\n if (view.byteLength === 0) {\n throw new TypeError('The view\\'s length must be greater than 0 when calling respondWithNewView() on a readable stream');\n }\n }\n if (firstDescriptor.byteOffset + firstDescriptor.bytesFilled !== view.byteOffset) {\n throw new RangeError('The region specified by view does not match byobRequest');\n }\n if (firstDescriptor.bufferByteLength !== view.buffer.byteLength) {\n throw new RangeError('The buffer of view has different capacity than byobRequest');\n }\n if (firstDescriptor.bytesFilled + view.byteLength > firstDescriptor.byteLength) {\n throw new RangeError('The region specified by view is larger than byobRequest');\n }\n var viewByteLength = view.byteLength;\n firstDescriptor.buffer = TransferArrayBuffer(view.buffer);\n ReadableByteStreamControllerRespondInternal(controller, viewByteLength);\n }\n function SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize) {\n controller._controlledReadableByteStream = stream;\n controller._pullAgain = false;\n controller._pulling = false;\n controller._byobRequest = null;\n // Need to set the slots so that the assert doesn't fire. In the spec the slots already exist implicitly.\n controller._queue = controller._queueTotalSize = undefined;\n ResetQueue(controller);\n controller._closeRequested = false;\n controller._started = false;\n controller._strategyHWM = highWaterMark;\n controller._pullAlgorithm = pullAlgorithm;\n controller._cancelAlgorithm = cancelAlgorithm;\n controller._autoAllocateChunkSize = autoAllocateChunkSize;\n controller._pendingPullIntos = new SimpleQueue();\n stream._readableStreamController = controller;\n var startResult = startAlgorithm();\n uponPromise(promiseResolvedWith(startResult), function () {\n controller._started = true;\n ReadableByteStreamControllerCallPullIfNeeded(controller);\n }, function (r) {\n ReadableByteStreamControllerError(controller, r);\n });\n }\n function SetUpReadableByteStreamControllerFromUnderlyingSource(stream, underlyingByteSource, highWaterMark) {\n var controller = Object.create(ReadableByteStreamController.prototype);\n var startAlgorithm = function () { return undefined; };\n var pullAlgorithm = function () { return promiseResolvedWith(undefined); };\n var cancelAlgorithm = function () { return promiseResolvedWith(undefined); };\n if (underlyingByteSource.start !== undefined) {\n startAlgorithm = function () { return underlyingByteSource.start(controller); };\n }\n if (underlyingByteSource.pull !== undefined) {\n pullAlgorithm = function () { return underlyingByteSource.pull(controller); };\n }\n if (underlyingByteSource.cancel !== undefined) {\n cancelAlgorithm = function (reason) { return underlyingByteSource.cancel(reason); };\n }\n var autoAllocateChunkSize = underlyingByteSource.autoAllocateChunkSize;\n if (autoAllocateChunkSize === 0) {\n throw new TypeError('autoAllocateChunkSize must be greater than 0');\n }\n SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize);\n }\n function SetUpReadableStreamBYOBRequest(request, controller, view) {\n request._associatedReadableByteStreamController = controller;\n request._view = view;\n }\n // Helper functions for the ReadableStreamBYOBRequest.\n function byobRequestBrandCheckException(name) {\n return new TypeError(\"ReadableStreamBYOBRequest.prototype.\" + name + \" can only be used on a ReadableStreamBYOBRequest\");\n }\n // Helper functions for the ReadableByteStreamController.\n function byteStreamControllerBrandCheckException(name) {\n return new TypeError(\"ReadableByteStreamController.prototype.\" + name + \" can only be used on a ReadableByteStreamController\");\n }\n\n // Abstract operations for the ReadableStream.\n function AcquireReadableStreamBYOBReader(stream) {\n return new ReadableStreamBYOBReader(stream);\n }\n // ReadableStream API exposed for controllers.\n function ReadableStreamAddReadIntoRequest(stream, readIntoRequest) {\n stream._reader._readIntoRequests.push(readIntoRequest);\n }\n function ReadableStreamFulfillReadIntoRequest(stream, chunk, done) {\n var reader = stream._reader;\n var readIntoRequest = reader._readIntoRequests.shift();\n if (done) {\n readIntoRequest._closeSteps(chunk);\n }\n else {\n readIntoRequest._chunkSteps(chunk);\n }\n }\n function ReadableStreamGetNumReadIntoRequests(stream) {\n return stream._reader._readIntoRequests.length;\n }\n function ReadableStreamHasBYOBReader(stream) {\n var reader = stream._reader;\n if (reader === undefined) {\n return false;\n }\n if (!IsReadableStreamBYOBReader(reader)) {\n return false;\n }\n return true;\n }\n /**\n * A BYOB reader vended by a {@link ReadableStream}.\n *\n * @public\n */\n var ReadableStreamBYOBReader = /** @class */ (function () {\n function ReadableStreamBYOBReader(stream) {\n assertRequiredArgument(stream, 1, 'ReadableStreamBYOBReader');\n assertReadableStream(stream, 'First parameter');\n if (IsReadableStreamLocked(stream)) {\n throw new TypeError('This stream has already been locked for exclusive reading by another reader');\n }\n if (!IsReadableByteStreamController(stream._readableStreamController)) {\n throw new TypeError('Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte ' +\n 'source');\n }\n ReadableStreamReaderGenericInitialize(this, stream);\n this._readIntoRequests = new SimpleQueue();\n }\n Object.defineProperty(ReadableStreamBYOBReader.prototype, \"closed\", {\n /**\n * Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or\n * the reader's lock is released before the stream finishes closing.\n */\n get: function () {\n if (!IsReadableStreamBYOBReader(this)) {\n return promiseRejectedWith(byobReaderBrandCheckException('closed'));\n }\n return this._closedPromise;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * If the reader is active, behaves the same as {@link ReadableStream.cancel | stream.cancel(reason)}.\n */\n ReadableStreamBYOBReader.prototype.cancel = function (reason) {\n if (reason === void 0) { reason = undefined; }\n if (!IsReadableStreamBYOBReader(this)) {\n return promiseRejectedWith(byobReaderBrandCheckException('cancel'));\n }\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('cancel'));\n }\n return ReadableStreamReaderGenericCancel(this, reason);\n };\n /**\n * Attempts to reads bytes into view, and returns a promise resolved with the result.\n *\n * If reading a chunk causes the queue to become empty, more data will be pulled from the underlying source.\n */\n ReadableStreamBYOBReader.prototype.read = function (view) {\n if (!IsReadableStreamBYOBReader(this)) {\n return promiseRejectedWith(byobReaderBrandCheckException('read'));\n }\n if (!ArrayBuffer.isView(view)) {\n return promiseRejectedWith(new TypeError('view must be an array buffer view'));\n }\n if (view.byteLength === 0) {\n return promiseRejectedWith(new TypeError('view must have non-zero byteLength'));\n }\n if (view.buffer.byteLength === 0) {\n return promiseRejectedWith(new TypeError(\"view's buffer must have non-zero byteLength\"));\n }\n if (IsDetachedBuffer(view.buffer)) ;\n if (this._ownerReadableStream === undefined) {\n return promiseRejectedWith(readerLockException('read from'));\n }\n var resolvePromise;\n var rejectPromise;\n var promise = newPromise(function (resolve, reject) {\n resolvePromise = resolve;\n rejectPromise = reject;\n });\n var readIntoRequest = {\n _chunkSteps: function (chunk) { return resolvePromise({ value: chunk, done: false }); },\n _closeSteps: function (chunk) { return resolvePromise({ value: chunk, done: true }); },\n _errorSteps: function (e) { return rejectPromise(e); }\n };\n ReadableStreamBYOBReaderRead(this, view, readIntoRequest);\n return promise;\n };\n /**\n * Releases the reader's lock on the corresponding stream. After the lock is released, the reader is no longer active.\n * If the associated stream is errored when the lock is released, the reader will appear errored in the same way\n * from now on; otherwise, the reader will appear closed.\n *\n * A reader's lock cannot be released while it still has a pending read request, i.e., if a promise returned by\n * the reader's {@link ReadableStreamBYOBReader.read | read()} method has not yet been settled. Attempting to\n * do so will throw a `TypeError` and leave the reader locked to the stream.\n */\n ReadableStreamBYOBReader.prototype.releaseLock = function () {\n if (!IsReadableStreamBYOBReader(this)) {\n throw byobReaderBrandCheckException('releaseLock');\n }\n if (this._ownerReadableStream === undefined) {\n return;\n }\n if (this._readIntoRequests.length > 0) {\n throw new TypeError('Tried to release a reader lock when that reader has pending read() calls un-settled');\n }\n ReadableStreamReaderGenericRelease(this);\n };\n return ReadableStreamBYOBReader;\n }());\n Object.defineProperties(ReadableStreamBYOBReader.prototype, {\n cancel: { enumerable: true },\n read: { enumerable: true },\n releaseLock: { enumerable: true },\n closed: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamBYOBReader.prototype, SymbolPolyfill.toStringTag, {\n value: 'ReadableStreamBYOBReader',\n configurable: true\n });\n }\n // Abstract operations for the readers.\n function IsReadableStreamBYOBReader(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_readIntoRequests')) {\n return false;\n }\n return x instanceof ReadableStreamBYOBReader;\n }\n function ReadableStreamBYOBReaderRead(reader, view, readIntoRequest) {\n var stream = reader._ownerReadableStream;\n stream._disturbed = true;\n if (stream._state === 'errored') {\n readIntoRequest._errorSteps(stream._storedError);\n }\n else {\n ReadableByteStreamControllerPullInto(stream._readableStreamController, view, readIntoRequest);\n }\n }\n // Helper functions for the ReadableStreamBYOBReader.\n function byobReaderBrandCheckException(name) {\n return new TypeError(\"ReadableStreamBYOBReader.prototype.\" + name + \" can only be used on a ReadableStreamBYOBReader\");\n }\n\n function ExtractHighWaterMark(strategy, defaultHWM) {\n var highWaterMark = strategy.highWaterMark;\n if (highWaterMark === undefined) {\n return defaultHWM;\n }\n if (NumberIsNaN(highWaterMark) || highWaterMark < 0) {\n throw new RangeError('Invalid highWaterMark');\n }\n return highWaterMark;\n }\n function ExtractSizeAlgorithm(strategy) {\n var size = strategy.size;\n if (!size) {\n return function () { return 1; };\n }\n return size;\n }\n\n function convertQueuingStrategy(init, context) {\n assertDictionary(init, context);\n var highWaterMark = init === null || init === void 0 ? void 0 : init.highWaterMark;\n var size = init === null || init === void 0 ? void 0 : init.size;\n return {\n highWaterMark: highWaterMark === undefined ? undefined : convertUnrestrictedDouble(highWaterMark),\n size: size === undefined ? undefined : convertQueuingStrategySize(size, context + \" has member 'size' that\")\n };\n }\n function convertQueuingStrategySize(fn, context) {\n assertFunction(fn, context);\n return function (chunk) { return convertUnrestrictedDouble(fn(chunk)); };\n }\n\n function convertUnderlyingSink(original, context) {\n assertDictionary(original, context);\n var abort = original === null || original === void 0 ? void 0 : original.abort;\n var close = original === null || original === void 0 ? void 0 : original.close;\n var start = original === null || original === void 0 ? void 0 : original.start;\n var type = original === null || original === void 0 ? void 0 : original.type;\n var write = original === null || original === void 0 ? void 0 : original.write;\n return {\n abort: abort === undefined ?\n undefined :\n convertUnderlyingSinkAbortCallback(abort, original, context + \" has member 'abort' that\"),\n close: close === undefined ?\n undefined :\n convertUnderlyingSinkCloseCallback(close, original, context + \" has member 'close' that\"),\n start: start === undefined ?\n undefined :\n convertUnderlyingSinkStartCallback(start, original, context + \" has member 'start' that\"),\n write: write === undefined ?\n undefined :\n convertUnderlyingSinkWriteCallback(write, original, context + \" has member 'write' that\"),\n type: type\n };\n }\n function convertUnderlyingSinkAbortCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (reason) { return promiseCall(fn, original, [reason]); };\n }\n function convertUnderlyingSinkCloseCallback(fn, original, context) {\n assertFunction(fn, context);\n return function () { return promiseCall(fn, original, []); };\n }\n function convertUnderlyingSinkStartCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (controller) { return reflectCall(fn, original, [controller]); };\n }\n function convertUnderlyingSinkWriteCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (chunk, controller) { return promiseCall(fn, original, [chunk, controller]); };\n }\n\n function assertWritableStream(x, context) {\n if (!IsWritableStream(x)) {\n throw new TypeError(context + \" is not a WritableStream.\");\n }\n }\n\n function isAbortSignal(value) {\n if (typeof value !== 'object' || value === null) {\n return false;\n }\n try {\n return typeof value.aborted === 'boolean';\n }\n catch (_a) {\n // AbortSignal.prototype.aborted throws if its brand check fails\n return false;\n }\n }\n var supportsAbortController = typeof AbortController === 'function';\n /**\n * Construct a new AbortController, if supported by the platform.\n *\n * @internal\n */\n function createAbortController() {\n if (supportsAbortController) {\n return new AbortController();\n }\n return undefined;\n }\n\n /**\n * A writable stream represents a destination for data, into which you can write.\n *\n * @public\n */\n var WritableStream = /** @class */ (function () {\n function WritableStream(rawUnderlyingSink, rawStrategy) {\n if (rawUnderlyingSink === void 0) { rawUnderlyingSink = {}; }\n if (rawStrategy === void 0) { rawStrategy = {}; }\n if (rawUnderlyingSink === undefined) {\n rawUnderlyingSink = null;\n }\n else {\n assertObject(rawUnderlyingSink, 'First parameter');\n }\n var strategy = convertQueuingStrategy(rawStrategy, 'Second parameter');\n var underlyingSink = convertUnderlyingSink(rawUnderlyingSink, 'First parameter');\n InitializeWritableStream(this);\n var type = underlyingSink.type;\n if (type !== undefined) {\n throw new RangeError('Invalid type is specified');\n }\n var sizeAlgorithm = ExtractSizeAlgorithm(strategy);\n var highWaterMark = ExtractHighWaterMark(strategy, 1);\n SetUpWritableStreamDefaultControllerFromUnderlyingSink(this, underlyingSink, highWaterMark, sizeAlgorithm);\n }\n Object.defineProperty(WritableStream.prototype, \"locked\", {\n /**\n * Returns whether or not the writable stream is locked to a writer.\n */\n get: function () {\n if (!IsWritableStream(this)) {\n throw streamBrandCheckException$2('locked');\n }\n return IsWritableStreamLocked(this);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be\n * immediately moved to an errored state, with any queued-up writes discarded. This will also execute any abort\n * mechanism of the underlying sink.\n *\n * The returned promise will fulfill if the stream shuts down successfully, or reject if the underlying sink signaled\n * that there was an error doing so. Additionally, it will reject with a `TypeError` (without attempting to cancel\n * the stream) if the stream is currently locked.\n */\n WritableStream.prototype.abort = function (reason) {\n if (reason === void 0) { reason = undefined; }\n if (!IsWritableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException$2('abort'));\n }\n if (IsWritableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError('Cannot abort a stream that already has a writer'));\n }\n return WritableStreamAbort(this, reason);\n };\n /**\n * Closes the stream. The underlying sink will finish processing any previously-written chunks, before invoking its\n * close behavior. During this time any further attempts to write will fail (without erroring the stream).\n *\n * The method returns a promise that will fulfill if all remaining chunks are successfully written and the stream\n * successfully closes, or rejects if an error is encountered during this process. Additionally, it will reject with\n * a `TypeError` (without attempting to cancel the stream) if the stream is currently locked.\n */\n WritableStream.prototype.close = function () {\n if (!IsWritableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException$2('close'));\n }\n if (IsWritableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError('Cannot close a stream that already has a writer'));\n }\n if (WritableStreamCloseQueuedOrInFlight(this)) {\n return promiseRejectedWith(new TypeError('Cannot close an already-closing stream'));\n }\n return WritableStreamClose(this);\n };\n /**\n * Creates a {@link WritableStreamDefaultWriter | writer} and locks the stream to the new writer. While the stream\n * is locked, no other writer can be acquired until this one is released.\n *\n * This functionality is especially useful for creating abstractions that desire the ability to write to a stream\n * without interruption or interleaving. By getting a writer for the stream, you can ensure nobody else can write at\n * the same time, which would cause the resulting written data to be unpredictable and probably useless.\n */\n WritableStream.prototype.getWriter = function () {\n if (!IsWritableStream(this)) {\n throw streamBrandCheckException$2('getWriter');\n }\n return AcquireWritableStreamDefaultWriter(this);\n };\n return WritableStream;\n }());\n Object.defineProperties(WritableStream.prototype, {\n abort: { enumerable: true },\n close: { enumerable: true },\n getWriter: { enumerable: true },\n locked: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(WritableStream.prototype, SymbolPolyfill.toStringTag, {\n value: 'WritableStream',\n configurable: true\n });\n }\n // Abstract operations for the WritableStream.\n function AcquireWritableStreamDefaultWriter(stream) {\n return new WritableStreamDefaultWriter(stream);\n }\n // Throws if and only if startAlgorithm throws.\n function CreateWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm) {\n if (highWaterMark === void 0) { highWaterMark = 1; }\n if (sizeAlgorithm === void 0) { sizeAlgorithm = function () { return 1; }; }\n var stream = Object.create(WritableStream.prototype);\n InitializeWritableStream(stream);\n var controller = Object.create(WritableStreamDefaultController.prototype);\n SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm);\n return stream;\n }\n function InitializeWritableStream(stream) {\n stream._state = 'writable';\n // The error that will be reported by new method calls once the state becomes errored. Only set when [[state]] is\n // 'erroring' or 'errored'. May be set to an undefined value.\n stream._storedError = undefined;\n stream._writer = undefined;\n // Initialize to undefined first because the constructor of the controller checks this\n // variable to validate the caller.\n stream._writableStreamController = undefined;\n // This queue is placed here instead of the writer class in order to allow for passing a writer to the next data\n // producer without waiting for the queued writes to finish.\n stream._writeRequests = new SimpleQueue();\n // Write requests are removed from _writeRequests when write() is called on the underlying sink. This prevents\n // them from being erroneously rejected on error. If a write() call is in-flight, the request is stored here.\n stream._inFlightWriteRequest = undefined;\n // The promise that was returned from writer.close(). Stored here because it may be fulfilled after the writer\n // has been detached.\n stream._closeRequest = undefined;\n // Close request is removed from _closeRequest when close() is called on the underlying sink. This prevents it\n // from being erroneously rejected on error. If a close() call is in-flight, the request is stored here.\n stream._inFlightCloseRequest = undefined;\n // The promise that was returned from writer.abort(). This may also be fulfilled after the writer has detached.\n stream._pendingAbortRequest = undefined;\n // The backpressure signal set by the controller.\n stream._backpressure = false;\n }\n function IsWritableStream(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_writableStreamController')) {\n return false;\n }\n return x instanceof WritableStream;\n }\n function IsWritableStreamLocked(stream) {\n if (stream._writer === undefined) {\n return false;\n }\n return true;\n }\n function WritableStreamAbort(stream, reason) {\n var _a;\n if (stream._state === 'closed' || stream._state === 'errored') {\n return promiseResolvedWith(undefined);\n }\n stream._writableStreamController._abortReason = reason;\n (_a = stream._writableStreamController._abortController) === null || _a === void 0 ? void 0 : _a.abort();\n // TypeScript narrows the type of `stream._state` down to 'writable' | 'erroring',\n // but it doesn't know that signaling abort runs author code that might have changed the state.\n // Widen the type again by casting to WritableStreamState.\n var state = stream._state;\n if (state === 'closed' || state === 'errored') {\n return promiseResolvedWith(undefined);\n }\n if (stream._pendingAbortRequest !== undefined) {\n return stream._pendingAbortRequest._promise;\n }\n var wasAlreadyErroring = false;\n if (state === 'erroring') {\n wasAlreadyErroring = true;\n // reason will not be used, so don't keep a reference to it.\n reason = undefined;\n }\n var promise = newPromise(function (resolve, reject) {\n stream._pendingAbortRequest = {\n _promise: undefined,\n _resolve: resolve,\n _reject: reject,\n _reason: reason,\n _wasAlreadyErroring: wasAlreadyErroring\n };\n });\n stream._pendingAbortRequest._promise = promise;\n if (!wasAlreadyErroring) {\n WritableStreamStartErroring(stream, reason);\n }\n return promise;\n }\n function WritableStreamClose(stream) {\n var state = stream._state;\n if (state === 'closed' || state === 'errored') {\n return promiseRejectedWith(new TypeError(\"The stream (in \" + state + \" state) is not in the writable state and cannot be closed\"));\n }\n var promise = newPromise(function (resolve, reject) {\n var closeRequest = {\n _resolve: resolve,\n _reject: reject\n };\n stream._closeRequest = closeRequest;\n });\n var writer = stream._writer;\n if (writer !== undefined && stream._backpressure && state === 'writable') {\n defaultWriterReadyPromiseResolve(writer);\n }\n WritableStreamDefaultControllerClose(stream._writableStreamController);\n return promise;\n }\n // WritableStream API exposed for controllers.\n function WritableStreamAddWriteRequest(stream) {\n var promise = newPromise(function (resolve, reject) {\n var writeRequest = {\n _resolve: resolve,\n _reject: reject\n };\n stream._writeRequests.push(writeRequest);\n });\n return promise;\n }\n function WritableStreamDealWithRejection(stream, error) {\n var state = stream._state;\n if (state === 'writable') {\n WritableStreamStartErroring(stream, error);\n return;\n }\n WritableStreamFinishErroring(stream);\n }\n function WritableStreamStartErroring(stream, reason) {\n var controller = stream._writableStreamController;\n stream._state = 'erroring';\n stream._storedError = reason;\n var writer = stream._writer;\n if (writer !== undefined) {\n WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, reason);\n }\n if (!WritableStreamHasOperationMarkedInFlight(stream) && controller._started) {\n WritableStreamFinishErroring(stream);\n }\n }\n function WritableStreamFinishErroring(stream) {\n stream._state = 'errored';\n stream._writableStreamController[ErrorSteps]();\n var storedError = stream._storedError;\n stream._writeRequests.forEach(function (writeRequest) {\n writeRequest._reject(storedError);\n });\n stream._writeRequests = new SimpleQueue();\n if (stream._pendingAbortRequest === undefined) {\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return;\n }\n var abortRequest = stream._pendingAbortRequest;\n stream._pendingAbortRequest = undefined;\n if (abortRequest._wasAlreadyErroring) {\n abortRequest._reject(storedError);\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n return;\n }\n var promise = stream._writableStreamController[AbortSteps](abortRequest._reason);\n uponPromise(promise, function () {\n abortRequest._resolve();\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n }, function (reason) {\n abortRequest._reject(reason);\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\n });\n }\n function WritableStreamFinishInFlightWrite(stream) {\n stream._inFlightWriteRequest._resolve(undefined);\n stream._inFlightWriteRequest = undefined;\n }\n function WritableStreamFinishInFlightWriteWithError(stream, error) {\n stream._inFlightWriteRequest._reject(error);\n stream._inFlightWriteRequest = undefined;\n WritableStreamDealWithRejection(stream, error);\n }\n function WritableStreamFinishInFlightClose(stream) {\n stream._inFlightCloseRequest._resolve(undefined);\n stream._inFlightCloseRequest = undefined;\n var state = stream._state;\n if (state === 'erroring') {\n // The error was too late to do anything, so it is ignored.\n stream._storedError = undefined;\n if (stream._pendingAbortRequest !== undefined) {\n stream._pendingAbortRequest._resolve();\n stream._pendingAbortRequest = undefined;\n }\n }\n stream._state = 'closed';\n var writer = stream._writer;\n if (writer !== undefined) {\n defaultWriterClosedPromiseResolve(writer);\n }\n }\n function WritableStreamFinishInFlightCloseWithError(stream, error) {\n stream._inFlightCloseRequest._reject(error);\n stream._inFlightCloseRequest = undefined;\n // Never execute sink abort() after sink close().\n if (stream._pendingAbortRequest !== undefined) {\n stream._pendingAbortRequest._reject(error);\n stream._pendingAbortRequest = undefined;\n }\n WritableStreamDealWithRejection(stream, error);\n }\n // TODO(ricea): Fix alphabetical order.\n function WritableStreamCloseQueuedOrInFlight(stream) {\n if (stream._closeRequest === undefined && stream._inFlightCloseRequest === undefined) {\n return false;\n }\n return true;\n }\n function WritableStreamHasOperationMarkedInFlight(stream) {\n if (stream._inFlightWriteRequest === undefined && stream._inFlightCloseRequest === undefined) {\n return false;\n }\n return true;\n }\n function WritableStreamMarkCloseRequestInFlight(stream) {\n stream._inFlightCloseRequest = stream._closeRequest;\n stream._closeRequest = undefined;\n }\n function WritableStreamMarkFirstWriteRequestInFlight(stream) {\n stream._inFlightWriteRequest = stream._writeRequests.shift();\n }\n function WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream) {\n if (stream._closeRequest !== undefined) {\n stream._closeRequest._reject(stream._storedError);\n stream._closeRequest = undefined;\n }\n var writer = stream._writer;\n if (writer !== undefined) {\n defaultWriterClosedPromiseReject(writer, stream._storedError);\n }\n }\n function WritableStreamUpdateBackpressure(stream, backpressure) {\n var writer = stream._writer;\n if (writer !== undefined && backpressure !== stream._backpressure) {\n if (backpressure) {\n defaultWriterReadyPromiseReset(writer);\n }\n else {\n defaultWriterReadyPromiseResolve(writer);\n }\n }\n stream._backpressure = backpressure;\n }\n /**\n * A default writer vended by a {@link WritableStream}.\n *\n * @public\n */\n var WritableStreamDefaultWriter = /** @class */ (function () {\n function WritableStreamDefaultWriter(stream) {\n assertRequiredArgument(stream, 1, 'WritableStreamDefaultWriter');\n assertWritableStream(stream, 'First parameter');\n if (IsWritableStreamLocked(stream)) {\n throw new TypeError('This stream has already been locked for exclusive writing by another writer');\n }\n this._ownerWritableStream = stream;\n stream._writer = this;\n var state = stream._state;\n if (state === 'writable') {\n if (!WritableStreamCloseQueuedOrInFlight(stream) && stream._backpressure) {\n defaultWriterReadyPromiseInitialize(this);\n }\n else {\n defaultWriterReadyPromiseInitializeAsResolved(this);\n }\n defaultWriterClosedPromiseInitialize(this);\n }\n else if (state === 'erroring') {\n defaultWriterReadyPromiseInitializeAsRejected(this, stream._storedError);\n defaultWriterClosedPromiseInitialize(this);\n }\n else if (state === 'closed') {\n defaultWriterReadyPromiseInitializeAsResolved(this);\n defaultWriterClosedPromiseInitializeAsResolved(this);\n }\n else {\n var storedError = stream._storedError;\n defaultWriterReadyPromiseInitializeAsRejected(this, storedError);\n defaultWriterClosedPromiseInitializeAsRejected(this, storedError);\n }\n }\n Object.defineProperty(WritableStreamDefaultWriter.prototype, \"closed\", {\n /**\n * Returns a promise that will be fulfilled when the stream becomes closed, or rejected if the stream ever errors or\n * the writer’s lock is released before the stream finishes closing.\n */\n get: function () {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('closed'));\n }\n return this._closedPromise;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(WritableStreamDefaultWriter.prototype, \"desiredSize\", {\n /**\n * Returns the desired size to fill the stream’s internal queue. It can be negative, if the queue is over-full.\n * A producer can use this information to determine the right amount of data to write.\n *\n * It will be `null` if the stream cannot be successfully written to (due to either being errored, or having an abort\n * queued up). It will return zero if the stream is closed. And the getter will throw an exception if invoked when\n * the writer’s lock is released.\n */\n get: function () {\n if (!IsWritableStreamDefaultWriter(this)) {\n throw defaultWriterBrandCheckException('desiredSize');\n }\n if (this._ownerWritableStream === undefined) {\n throw defaultWriterLockException('desiredSize');\n }\n return WritableStreamDefaultWriterGetDesiredSize(this);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(WritableStreamDefaultWriter.prototype, \"ready\", {\n /**\n * Returns a promise that will be fulfilled when the desired size to fill the stream’s internal queue transitions\n * from non-positive to positive, signaling that it is no longer applying backpressure. Once the desired size dips\n * back to zero or below, the getter will return a new promise that stays pending until the next transition.\n *\n * If the stream becomes errored or aborted, or the writer’s lock is released, the returned promise will become\n * rejected.\n */\n get: function () {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('ready'));\n }\n return this._readyPromise;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * If the reader is active, behaves the same as {@link WritableStream.abort | stream.abort(reason)}.\n */\n WritableStreamDefaultWriter.prototype.abort = function (reason) {\n if (reason === void 0) { reason = undefined; }\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('abort'));\n }\n if (this._ownerWritableStream === undefined) {\n return promiseRejectedWith(defaultWriterLockException('abort'));\n }\n return WritableStreamDefaultWriterAbort(this, reason);\n };\n /**\n * If the reader is active, behaves the same as {@link WritableStream.close | stream.close()}.\n */\n WritableStreamDefaultWriter.prototype.close = function () {\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('close'));\n }\n var stream = this._ownerWritableStream;\n if (stream === undefined) {\n return promiseRejectedWith(defaultWriterLockException('close'));\n }\n if (WritableStreamCloseQueuedOrInFlight(stream)) {\n return promiseRejectedWith(new TypeError('Cannot close an already-closing stream'));\n }\n return WritableStreamDefaultWriterClose(this);\n };\n /**\n * Releases the writer’s lock on the corresponding stream. After the lock is released, the writer is no longer active.\n * If the associated stream is errored when the lock is released, the writer will appear errored in the same way from\n * now on; otherwise, the writer will appear closed.\n *\n * Note that the lock can still be released even if some ongoing writes have not yet finished (i.e. even if the\n * promises returned from previous calls to {@link WritableStreamDefaultWriter.write | write()} have not yet settled).\n * It’s not necessary to hold the lock on the writer for the duration of the write; the lock instead simply prevents\n * other producers from writing in an interleaved manner.\n */\n WritableStreamDefaultWriter.prototype.releaseLock = function () {\n if (!IsWritableStreamDefaultWriter(this)) {\n throw defaultWriterBrandCheckException('releaseLock');\n }\n var stream = this._ownerWritableStream;\n if (stream === undefined) {\n return;\n }\n WritableStreamDefaultWriterRelease(this);\n };\n WritableStreamDefaultWriter.prototype.write = function (chunk) {\n if (chunk === void 0) { chunk = undefined; }\n if (!IsWritableStreamDefaultWriter(this)) {\n return promiseRejectedWith(defaultWriterBrandCheckException('write'));\n }\n if (this._ownerWritableStream === undefined) {\n return promiseRejectedWith(defaultWriterLockException('write to'));\n }\n return WritableStreamDefaultWriterWrite(this, chunk);\n };\n return WritableStreamDefaultWriter;\n }());\n Object.defineProperties(WritableStreamDefaultWriter.prototype, {\n abort: { enumerable: true },\n close: { enumerable: true },\n releaseLock: { enumerable: true },\n write: { enumerable: true },\n closed: { enumerable: true },\n desiredSize: { enumerable: true },\n ready: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(WritableStreamDefaultWriter.prototype, SymbolPolyfill.toStringTag, {\n value: 'WritableStreamDefaultWriter',\n configurable: true\n });\n }\n // Abstract operations for the WritableStreamDefaultWriter.\n function IsWritableStreamDefaultWriter(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_ownerWritableStream')) {\n return false;\n }\n return x instanceof WritableStreamDefaultWriter;\n }\n // A client of WritableStreamDefaultWriter may use these functions directly to bypass state check.\n function WritableStreamDefaultWriterAbort(writer, reason) {\n var stream = writer._ownerWritableStream;\n return WritableStreamAbort(stream, reason);\n }\n function WritableStreamDefaultWriterClose(writer) {\n var stream = writer._ownerWritableStream;\n return WritableStreamClose(stream);\n }\n function WritableStreamDefaultWriterCloseWithErrorPropagation(writer) {\n var stream = writer._ownerWritableStream;\n var state = stream._state;\n if (WritableStreamCloseQueuedOrInFlight(stream) || state === 'closed') {\n return promiseResolvedWith(undefined);\n }\n if (state === 'errored') {\n return promiseRejectedWith(stream._storedError);\n }\n return WritableStreamDefaultWriterClose(writer);\n }\n function WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, error) {\n if (writer._closedPromiseState === 'pending') {\n defaultWriterClosedPromiseReject(writer, error);\n }\n else {\n defaultWriterClosedPromiseResetToRejected(writer, error);\n }\n }\n function WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, error) {\n if (writer._readyPromiseState === 'pending') {\n defaultWriterReadyPromiseReject(writer, error);\n }\n else {\n defaultWriterReadyPromiseResetToRejected(writer, error);\n }\n }\n function WritableStreamDefaultWriterGetDesiredSize(writer) {\n var stream = writer._ownerWritableStream;\n var state = stream._state;\n if (state === 'errored' || state === 'erroring') {\n return null;\n }\n if (state === 'closed') {\n return 0;\n }\n return WritableStreamDefaultControllerGetDesiredSize(stream._writableStreamController);\n }\n function WritableStreamDefaultWriterRelease(writer) {\n var stream = writer._ownerWritableStream;\n var releasedError = new TypeError(\"Writer was released and can no longer be used to monitor the stream's closedness\");\n WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, releasedError);\n // The state transitions to \"errored\" before the sink abort() method runs, but the writer.closed promise is not\n // rejected until afterwards. This means that simply testing state will not work.\n WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, releasedError);\n stream._writer = undefined;\n writer._ownerWritableStream = undefined;\n }\n function WritableStreamDefaultWriterWrite(writer, chunk) {\n var stream = writer._ownerWritableStream;\n var controller = stream._writableStreamController;\n var chunkSize = WritableStreamDefaultControllerGetChunkSize(controller, chunk);\n if (stream !== writer._ownerWritableStream) {\n return promiseRejectedWith(defaultWriterLockException('write to'));\n }\n var state = stream._state;\n if (state === 'errored') {\n return promiseRejectedWith(stream._storedError);\n }\n if (WritableStreamCloseQueuedOrInFlight(stream) || state === 'closed') {\n return promiseRejectedWith(new TypeError('The stream is closing or closed and cannot be written to'));\n }\n if (state === 'erroring') {\n return promiseRejectedWith(stream._storedError);\n }\n var promise = WritableStreamAddWriteRequest(stream);\n WritableStreamDefaultControllerWrite(controller, chunk, chunkSize);\n return promise;\n }\n var closeSentinel = {};\n /**\n * Allows control of a {@link WritableStream | writable stream}'s state and internal queue.\n *\n * @public\n */\n var WritableStreamDefaultController = /** @class */ (function () {\n function WritableStreamDefaultController() {\n throw new TypeError('Illegal constructor');\n }\n Object.defineProperty(WritableStreamDefaultController.prototype, \"abortReason\", {\n /**\n * The reason which was passed to `WritableStream.abort(reason)` when the stream was aborted.\n *\n * @deprecated\n * This property has been removed from the specification, see https://github.com/whatwg/streams/pull/1177.\n * Use {@link WritableStreamDefaultController.signal}'s `reason` instead.\n */\n get: function () {\n if (!IsWritableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$2('abortReason');\n }\n return this._abortReason;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(WritableStreamDefaultController.prototype, \"signal\", {\n /**\n * An `AbortSignal` that can be used to abort the pending write or close operation when the stream is aborted.\n */\n get: function () {\n if (!IsWritableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$2('signal');\n }\n if (this._abortController === undefined) {\n // Older browsers or older Node versions may not support `AbortController` or `AbortSignal`.\n // We don't want to bundle and ship an `AbortController` polyfill together with our polyfill,\n // so instead we only implement support for `signal` if we find a global `AbortController` constructor.\n throw new TypeError('WritableStreamDefaultController.prototype.signal is not supported');\n }\n return this._abortController.signal;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Closes the controlled writable stream, making all future interactions with it fail with the given error `e`.\n *\n * This method is rarely used, since usually it suffices to return a rejected promise from one of the underlying\n * sink's methods. However, it can be useful for suddenly shutting down a stream in response to an event outside the\n * normal lifecycle of interactions with the underlying sink.\n */\n WritableStreamDefaultController.prototype.error = function (e) {\n if (e === void 0) { e = undefined; }\n if (!IsWritableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$2('error');\n }\n var state = this._controlledWritableStream._state;\n if (state !== 'writable') {\n // The stream is closed, errored or will be soon. The sink can't do anything useful if it gets an error here, so\n // just treat it as a no-op.\n return;\n }\n WritableStreamDefaultControllerError(this, e);\n };\n /** @internal */\n WritableStreamDefaultController.prototype[AbortSteps] = function (reason) {\n var result = this._abortAlgorithm(reason);\n WritableStreamDefaultControllerClearAlgorithms(this);\n return result;\n };\n /** @internal */\n WritableStreamDefaultController.prototype[ErrorSteps] = function () {\n ResetQueue(this);\n };\n return WritableStreamDefaultController;\n }());\n Object.defineProperties(WritableStreamDefaultController.prototype, {\n abortReason: { enumerable: true },\n signal: { enumerable: true },\n error: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(WritableStreamDefaultController.prototype, SymbolPolyfill.toStringTag, {\n value: 'WritableStreamDefaultController',\n configurable: true\n });\n }\n // Abstract operations implementing interface required by the WritableStream.\n function IsWritableStreamDefaultController(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledWritableStream')) {\n return false;\n }\n return x instanceof WritableStreamDefaultController;\n }\n function SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm) {\n controller._controlledWritableStream = stream;\n stream._writableStreamController = controller;\n // Need to set the slots so that the assert doesn't fire. In the spec the slots already exist implicitly.\n controller._queue = undefined;\n controller._queueTotalSize = undefined;\n ResetQueue(controller);\n controller._abortReason = undefined;\n controller._abortController = createAbortController();\n controller._started = false;\n controller._strategySizeAlgorithm = sizeAlgorithm;\n controller._strategyHWM = highWaterMark;\n controller._writeAlgorithm = writeAlgorithm;\n controller._closeAlgorithm = closeAlgorithm;\n controller._abortAlgorithm = abortAlgorithm;\n var backpressure = WritableStreamDefaultControllerGetBackpressure(controller);\n WritableStreamUpdateBackpressure(stream, backpressure);\n var startResult = startAlgorithm();\n var startPromise = promiseResolvedWith(startResult);\n uponPromise(startPromise, function () {\n controller._started = true;\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n }, function (r) {\n controller._started = true;\n WritableStreamDealWithRejection(stream, r);\n });\n }\n function SetUpWritableStreamDefaultControllerFromUnderlyingSink(stream, underlyingSink, highWaterMark, sizeAlgorithm) {\n var controller = Object.create(WritableStreamDefaultController.prototype);\n var startAlgorithm = function () { return undefined; };\n var writeAlgorithm = function () { return promiseResolvedWith(undefined); };\n var closeAlgorithm = function () { return promiseResolvedWith(undefined); };\n var abortAlgorithm = function () { return promiseResolvedWith(undefined); };\n if (underlyingSink.start !== undefined) {\n startAlgorithm = function () { return underlyingSink.start(controller); };\n }\n if (underlyingSink.write !== undefined) {\n writeAlgorithm = function (chunk) { return underlyingSink.write(chunk, controller); };\n }\n if (underlyingSink.close !== undefined) {\n closeAlgorithm = function () { return underlyingSink.close(); };\n }\n if (underlyingSink.abort !== undefined) {\n abortAlgorithm = function (reason) { return underlyingSink.abort(reason); };\n }\n SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm);\n }\n // ClearAlgorithms may be called twice. Erroring the same stream in multiple ways will often result in redundant calls.\n function WritableStreamDefaultControllerClearAlgorithms(controller) {\n controller._writeAlgorithm = undefined;\n controller._closeAlgorithm = undefined;\n controller._abortAlgorithm = undefined;\n controller._strategySizeAlgorithm = undefined;\n }\n function WritableStreamDefaultControllerClose(controller) {\n EnqueueValueWithSize(controller, closeSentinel, 0);\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n }\n function WritableStreamDefaultControllerGetChunkSize(controller, chunk) {\n try {\n return controller._strategySizeAlgorithm(chunk);\n }\n catch (chunkSizeE) {\n WritableStreamDefaultControllerErrorIfNeeded(controller, chunkSizeE);\n return 1;\n }\n }\n function WritableStreamDefaultControllerGetDesiredSize(controller) {\n return controller._strategyHWM - controller._queueTotalSize;\n }\n function WritableStreamDefaultControllerWrite(controller, chunk, chunkSize) {\n try {\n EnqueueValueWithSize(controller, chunk, chunkSize);\n }\n catch (enqueueE) {\n WritableStreamDefaultControllerErrorIfNeeded(controller, enqueueE);\n return;\n }\n var stream = controller._controlledWritableStream;\n if (!WritableStreamCloseQueuedOrInFlight(stream) && stream._state === 'writable') {\n var backpressure = WritableStreamDefaultControllerGetBackpressure(controller);\n WritableStreamUpdateBackpressure(stream, backpressure);\n }\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n }\n // Abstract operations for the WritableStreamDefaultController.\n function WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller) {\n var stream = controller._controlledWritableStream;\n if (!controller._started) {\n return;\n }\n if (stream._inFlightWriteRequest !== undefined) {\n return;\n }\n var state = stream._state;\n if (state === 'erroring') {\n WritableStreamFinishErroring(stream);\n return;\n }\n if (controller._queue.length === 0) {\n return;\n }\n var value = PeekQueueValue(controller);\n if (value === closeSentinel) {\n WritableStreamDefaultControllerProcessClose(controller);\n }\n else {\n WritableStreamDefaultControllerProcessWrite(controller, value);\n }\n }\n function WritableStreamDefaultControllerErrorIfNeeded(controller, error) {\n if (controller._controlledWritableStream._state === 'writable') {\n WritableStreamDefaultControllerError(controller, error);\n }\n }\n function WritableStreamDefaultControllerProcessClose(controller) {\n var stream = controller._controlledWritableStream;\n WritableStreamMarkCloseRequestInFlight(stream);\n DequeueValue(controller);\n var sinkClosePromise = controller._closeAlgorithm();\n WritableStreamDefaultControllerClearAlgorithms(controller);\n uponPromise(sinkClosePromise, function () {\n WritableStreamFinishInFlightClose(stream);\n }, function (reason) {\n WritableStreamFinishInFlightCloseWithError(stream, reason);\n });\n }\n function WritableStreamDefaultControllerProcessWrite(controller, chunk) {\n var stream = controller._controlledWritableStream;\n WritableStreamMarkFirstWriteRequestInFlight(stream);\n var sinkWritePromise = controller._writeAlgorithm(chunk);\n uponPromise(sinkWritePromise, function () {\n WritableStreamFinishInFlightWrite(stream);\n var state = stream._state;\n DequeueValue(controller);\n if (!WritableStreamCloseQueuedOrInFlight(stream) && state === 'writable') {\n var backpressure = WritableStreamDefaultControllerGetBackpressure(controller);\n WritableStreamUpdateBackpressure(stream, backpressure);\n }\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\n }, function (reason) {\n if (stream._state === 'writable') {\n WritableStreamDefaultControllerClearAlgorithms(controller);\n }\n WritableStreamFinishInFlightWriteWithError(stream, reason);\n });\n }\n function WritableStreamDefaultControllerGetBackpressure(controller) {\n var desiredSize = WritableStreamDefaultControllerGetDesiredSize(controller);\n return desiredSize <= 0;\n }\n // A client of WritableStreamDefaultController may use these functions directly to bypass state check.\n function WritableStreamDefaultControllerError(controller, error) {\n var stream = controller._controlledWritableStream;\n WritableStreamDefaultControllerClearAlgorithms(controller);\n WritableStreamStartErroring(stream, error);\n }\n // Helper functions for the WritableStream.\n function streamBrandCheckException$2(name) {\n return new TypeError(\"WritableStream.prototype.\" + name + \" can only be used on a WritableStream\");\n }\n // Helper functions for the WritableStreamDefaultController.\n function defaultControllerBrandCheckException$2(name) {\n return new TypeError(\"WritableStreamDefaultController.prototype.\" + name + \" can only be used on a WritableStreamDefaultController\");\n }\n // Helper functions for the WritableStreamDefaultWriter.\n function defaultWriterBrandCheckException(name) {\n return new TypeError(\"WritableStreamDefaultWriter.prototype.\" + name + \" can only be used on a WritableStreamDefaultWriter\");\n }\n function defaultWriterLockException(name) {\n return new TypeError('Cannot ' + name + ' a stream using a released writer');\n }\n function defaultWriterClosedPromiseInitialize(writer) {\n writer._closedPromise = newPromise(function (resolve, reject) {\n writer._closedPromise_resolve = resolve;\n writer._closedPromise_reject = reject;\n writer._closedPromiseState = 'pending';\n });\n }\n function defaultWriterClosedPromiseInitializeAsRejected(writer, reason) {\n defaultWriterClosedPromiseInitialize(writer);\n defaultWriterClosedPromiseReject(writer, reason);\n }\n function defaultWriterClosedPromiseInitializeAsResolved(writer) {\n defaultWriterClosedPromiseInitialize(writer);\n defaultWriterClosedPromiseResolve(writer);\n }\n function defaultWriterClosedPromiseReject(writer, reason) {\n if (writer._closedPromise_reject === undefined) {\n return;\n }\n setPromiseIsHandledToTrue(writer._closedPromise);\n writer._closedPromise_reject(reason);\n writer._closedPromise_resolve = undefined;\n writer._closedPromise_reject = undefined;\n writer._closedPromiseState = 'rejected';\n }\n function defaultWriterClosedPromiseResetToRejected(writer, reason) {\n defaultWriterClosedPromiseInitializeAsRejected(writer, reason);\n }\n function defaultWriterClosedPromiseResolve(writer) {\n if (writer._closedPromise_resolve === undefined) {\n return;\n }\n writer._closedPromise_resolve(undefined);\n writer._closedPromise_resolve = undefined;\n writer._closedPromise_reject = undefined;\n writer._closedPromiseState = 'resolved';\n }\n function defaultWriterReadyPromiseInitialize(writer) {\n writer._readyPromise = newPromise(function (resolve, reject) {\n writer._readyPromise_resolve = resolve;\n writer._readyPromise_reject = reject;\n });\n writer._readyPromiseState = 'pending';\n }\n function defaultWriterReadyPromiseInitializeAsRejected(writer, reason) {\n defaultWriterReadyPromiseInitialize(writer);\n defaultWriterReadyPromiseReject(writer, reason);\n }\n function defaultWriterReadyPromiseInitializeAsResolved(writer) {\n defaultWriterReadyPromiseInitialize(writer);\n defaultWriterReadyPromiseResolve(writer);\n }\n function defaultWriterReadyPromiseReject(writer, reason) {\n if (writer._readyPromise_reject === undefined) {\n return;\n }\n setPromiseIsHandledToTrue(writer._readyPromise);\n writer._readyPromise_reject(reason);\n writer._readyPromise_resolve = undefined;\n writer._readyPromise_reject = undefined;\n writer._readyPromiseState = 'rejected';\n }\n function defaultWriterReadyPromiseReset(writer) {\n defaultWriterReadyPromiseInitialize(writer);\n }\n function defaultWriterReadyPromiseResetToRejected(writer, reason) {\n defaultWriterReadyPromiseInitializeAsRejected(writer, reason);\n }\n function defaultWriterReadyPromiseResolve(writer) {\n if (writer._readyPromise_resolve === undefined) {\n return;\n }\n writer._readyPromise_resolve(undefined);\n writer._readyPromise_resolve = undefined;\n writer._readyPromise_reject = undefined;\n writer._readyPromiseState = 'fulfilled';\n }\n\n /// \n var NativeDOMException = typeof DOMException !== 'undefined' ? DOMException : undefined;\n\n /// \n function isDOMExceptionConstructor(ctor) {\n if (!(typeof ctor === 'function' || typeof ctor === 'object')) {\n return false;\n }\n try {\n new ctor();\n return true;\n }\n catch (_a) {\n return false;\n }\n }\n function createDOMExceptionPolyfill() {\n // eslint-disable-next-line no-shadow\n var ctor = function DOMException(message, name) {\n this.message = message || '';\n this.name = name || 'Error';\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n };\n ctor.prototype = Object.create(Error.prototype);\n Object.defineProperty(ctor.prototype, 'constructor', { value: ctor, writable: true, configurable: true });\n return ctor;\n }\n // eslint-disable-next-line no-redeclare\n var DOMException$1 = isDOMExceptionConstructor(NativeDOMException) ? NativeDOMException : createDOMExceptionPolyfill();\n\n function ReadableStreamPipeTo(source, dest, preventClose, preventAbort, preventCancel, signal) {\n var reader = AcquireReadableStreamDefaultReader(source);\n var writer = AcquireWritableStreamDefaultWriter(dest);\n source._disturbed = true;\n var shuttingDown = false;\n // This is used to keep track of the spec's requirement that we wait for ongoing writes during shutdown.\n var currentWrite = promiseResolvedWith(undefined);\n return newPromise(function (resolve, reject) {\n var abortAlgorithm;\n if (signal !== undefined) {\n abortAlgorithm = function () {\n var error = new DOMException$1('Aborted', 'AbortError');\n var actions = [];\n if (!preventAbort) {\n actions.push(function () {\n if (dest._state === 'writable') {\n return WritableStreamAbort(dest, error);\n }\n return promiseResolvedWith(undefined);\n });\n }\n if (!preventCancel) {\n actions.push(function () {\n if (source._state === 'readable') {\n return ReadableStreamCancel(source, error);\n }\n return promiseResolvedWith(undefined);\n });\n }\n shutdownWithAction(function () { return Promise.all(actions.map(function (action) { return action(); })); }, true, error);\n };\n if (signal.aborted) {\n abortAlgorithm();\n return;\n }\n signal.addEventListener('abort', abortAlgorithm);\n }\n // Using reader and writer, read all chunks from this and write them to dest\n // - Backpressure must be enforced\n // - Shutdown must stop all activity\n function pipeLoop() {\n return newPromise(function (resolveLoop, rejectLoop) {\n function next(done) {\n if (done) {\n resolveLoop();\n }\n else {\n // Use `PerformPromiseThen` instead of `uponPromise` to avoid\n // adding unnecessary `.catch(rethrowAssertionErrorRejection)` handlers\n PerformPromiseThen(pipeStep(), next, rejectLoop);\n }\n }\n next(false);\n });\n }\n function pipeStep() {\n if (shuttingDown) {\n return promiseResolvedWith(true);\n }\n return PerformPromiseThen(writer._readyPromise, function () {\n return newPromise(function (resolveRead, rejectRead) {\n ReadableStreamDefaultReaderRead(reader, {\n _chunkSteps: function (chunk) {\n currentWrite = PerformPromiseThen(WritableStreamDefaultWriterWrite(writer, chunk), undefined, noop);\n resolveRead(false);\n },\n _closeSteps: function () { return resolveRead(true); },\n _errorSteps: rejectRead\n });\n });\n });\n }\n // Errors must be propagated forward\n isOrBecomesErrored(source, reader._closedPromise, function (storedError) {\n if (!preventAbort) {\n shutdownWithAction(function () { return WritableStreamAbort(dest, storedError); }, true, storedError);\n }\n else {\n shutdown(true, storedError);\n }\n });\n // Errors must be propagated backward\n isOrBecomesErrored(dest, writer._closedPromise, function (storedError) {\n if (!preventCancel) {\n shutdownWithAction(function () { return ReadableStreamCancel(source, storedError); }, true, storedError);\n }\n else {\n shutdown(true, storedError);\n }\n });\n // Closing must be propagated forward\n isOrBecomesClosed(source, reader._closedPromise, function () {\n if (!preventClose) {\n shutdownWithAction(function () { return WritableStreamDefaultWriterCloseWithErrorPropagation(writer); });\n }\n else {\n shutdown();\n }\n });\n // Closing must be propagated backward\n if (WritableStreamCloseQueuedOrInFlight(dest) || dest._state === 'closed') {\n var destClosed_1 = new TypeError('the destination writable stream closed before all data could be piped to it');\n if (!preventCancel) {\n shutdownWithAction(function () { return ReadableStreamCancel(source, destClosed_1); }, true, destClosed_1);\n }\n else {\n shutdown(true, destClosed_1);\n }\n }\n setPromiseIsHandledToTrue(pipeLoop());\n function waitForWritesToFinish() {\n // Another write may have started while we were waiting on this currentWrite, so we have to be sure to wait\n // for that too.\n var oldCurrentWrite = currentWrite;\n return PerformPromiseThen(currentWrite, function () { return oldCurrentWrite !== currentWrite ? waitForWritesToFinish() : undefined; });\n }\n function isOrBecomesErrored(stream, promise, action) {\n if (stream._state === 'errored') {\n action(stream._storedError);\n }\n else {\n uponRejection(promise, action);\n }\n }\n function isOrBecomesClosed(stream, promise, action) {\n if (stream._state === 'closed') {\n action();\n }\n else {\n uponFulfillment(promise, action);\n }\n }\n function shutdownWithAction(action, originalIsError, originalError) {\n if (shuttingDown) {\n return;\n }\n shuttingDown = true;\n if (dest._state === 'writable' && !WritableStreamCloseQueuedOrInFlight(dest)) {\n uponFulfillment(waitForWritesToFinish(), doTheRest);\n }\n else {\n doTheRest();\n }\n function doTheRest() {\n uponPromise(action(), function () { return finalize(originalIsError, originalError); }, function (newError) { return finalize(true, newError); });\n }\n }\n function shutdown(isError, error) {\n if (shuttingDown) {\n return;\n }\n shuttingDown = true;\n if (dest._state === 'writable' && !WritableStreamCloseQueuedOrInFlight(dest)) {\n uponFulfillment(waitForWritesToFinish(), function () { return finalize(isError, error); });\n }\n else {\n finalize(isError, error);\n }\n }\n function finalize(isError, error) {\n WritableStreamDefaultWriterRelease(writer);\n ReadableStreamReaderGenericRelease(reader);\n if (signal !== undefined) {\n signal.removeEventListener('abort', abortAlgorithm);\n }\n if (isError) {\n reject(error);\n }\n else {\n resolve(undefined);\n }\n }\n });\n }\n\n /**\n * Allows control of a {@link ReadableStream | readable stream}'s state and internal queue.\n *\n * @public\n */\n var ReadableStreamDefaultController = /** @class */ (function () {\n function ReadableStreamDefaultController() {\n throw new TypeError('Illegal constructor');\n }\n Object.defineProperty(ReadableStreamDefaultController.prototype, \"desiredSize\", {\n /**\n * Returns the desired size to fill the controlled stream's internal queue. It can be negative, if the queue is\n * over-full. An underlying source ought to use this information to determine when and how to apply backpressure.\n */\n get: function () {\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$1('desiredSize');\n }\n return ReadableStreamDefaultControllerGetDesiredSize(this);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Closes the controlled readable stream. Consumers will still be able to read any previously-enqueued chunks from\n * the stream, but once those are read, the stream will become closed.\n */\n ReadableStreamDefaultController.prototype.close = function () {\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$1('close');\n }\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)) {\n throw new TypeError('The stream is not in a state that permits close');\n }\n ReadableStreamDefaultControllerClose(this);\n };\n ReadableStreamDefaultController.prototype.enqueue = function (chunk) {\n if (chunk === void 0) { chunk = undefined; }\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$1('enqueue');\n }\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)) {\n throw new TypeError('The stream is not in a state that permits enqueue');\n }\n return ReadableStreamDefaultControllerEnqueue(this, chunk);\n };\n /**\n * Errors the controlled readable stream, making all future interactions with it fail with the given error `e`.\n */\n ReadableStreamDefaultController.prototype.error = function (e) {\n if (e === void 0) { e = undefined; }\n if (!IsReadableStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException$1('error');\n }\n ReadableStreamDefaultControllerError(this, e);\n };\n /** @internal */\n ReadableStreamDefaultController.prototype[CancelSteps] = function (reason) {\n ResetQueue(this);\n var result = this._cancelAlgorithm(reason);\n ReadableStreamDefaultControllerClearAlgorithms(this);\n return result;\n };\n /** @internal */\n ReadableStreamDefaultController.prototype[PullSteps] = function (readRequest) {\n var stream = this._controlledReadableStream;\n if (this._queue.length > 0) {\n var chunk = DequeueValue(this);\n if (this._closeRequested && this._queue.length === 0) {\n ReadableStreamDefaultControllerClearAlgorithms(this);\n ReadableStreamClose(stream);\n }\n else {\n ReadableStreamDefaultControllerCallPullIfNeeded(this);\n }\n readRequest._chunkSteps(chunk);\n }\n else {\n ReadableStreamAddReadRequest(stream, readRequest);\n ReadableStreamDefaultControllerCallPullIfNeeded(this);\n }\n };\n return ReadableStreamDefaultController;\n }());\n Object.defineProperties(ReadableStreamDefaultController.prototype, {\n close: { enumerable: true },\n enqueue: { enumerable: true },\n error: { enumerable: true },\n desiredSize: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStreamDefaultController.prototype, SymbolPolyfill.toStringTag, {\n value: 'ReadableStreamDefaultController',\n configurable: true\n });\n }\n // Abstract operations for the ReadableStreamDefaultController.\n function IsReadableStreamDefaultController(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledReadableStream')) {\n return false;\n }\n return x instanceof ReadableStreamDefaultController;\n }\n function ReadableStreamDefaultControllerCallPullIfNeeded(controller) {\n var shouldPull = ReadableStreamDefaultControllerShouldCallPull(controller);\n if (!shouldPull) {\n return;\n }\n if (controller._pulling) {\n controller._pullAgain = true;\n return;\n }\n controller._pulling = true;\n var pullPromise = controller._pullAlgorithm();\n uponPromise(pullPromise, function () {\n controller._pulling = false;\n if (controller._pullAgain) {\n controller._pullAgain = false;\n ReadableStreamDefaultControllerCallPullIfNeeded(controller);\n }\n }, function (e) {\n ReadableStreamDefaultControllerError(controller, e);\n });\n }\n function ReadableStreamDefaultControllerShouldCallPull(controller) {\n var stream = controller._controlledReadableStream;\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {\n return false;\n }\n if (!controller._started) {\n return false;\n }\n if (IsReadableStreamLocked(stream) && ReadableStreamGetNumReadRequests(stream) > 0) {\n return true;\n }\n var desiredSize = ReadableStreamDefaultControllerGetDesiredSize(controller);\n if (desiredSize > 0) {\n return true;\n }\n return false;\n }\n function ReadableStreamDefaultControllerClearAlgorithms(controller) {\n controller._pullAlgorithm = undefined;\n controller._cancelAlgorithm = undefined;\n controller._strategySizeAlgorithm = undefined;\n }\n // A client of ReadableStreamDefaultController may use these functions directly to bypass state check.\n function ReadableStreamDefaultControllerClose(controller) {\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {\n return;\n }\n var stream = controller._controlledReadableStream;\n controller._closeRequested = true;\n if (controller._queue.length === 0) {\n ReadableStreamDefaultControllerClearAlgorithms(controller);\n ReadableStreamClose(stream);\n }\n }\n function ReadableStreamDefaultControllerEnqueue(controller, chunk) {\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {\n return;\n }\n var stream = controller._controlledReadableStream;\n if (IsReadableStreamLocked(stream) && ReadableStreamGetNumReadRequests(stream) > 0) {\n ReadableStreamFulfillReadRequest(stream, chunk, false);\n }\n else {\n var chunkSize = void 0;\n try {\n chunkSize = controller._strategySizeAlgorithm(chunk);\n }\n catch (chunkSizeE) {\n ReadableStreamDefaultControllerError(controller, chunkSizeE);\n throw chunkSizeE;\n }\n try {\n EnqueueValueWithSize(controller, chunk, chunkSize);\n }\n catch (enqueueE) {\n ReadableStreamDefaultControllerError(controller, enqueueE);\n throw enqueueE;\n }\n }\n ReadableStreamDefaultControllerCallPullIfNeeded(controller);\n }\n function ReadableStreamDefaultControllerError(controller, e) {\n var stream = controller._controlledReadableStream;\n if (stream._state !== 'readable') {\n return;\n }\n ResetQueue(controller);\n ReadableStreamDefaultControllerClearAlgorithms(controller);\n ReadableStreamError(stream, e);\n }\n function ReadableStreamDefaultControllerGetDesiredSize(controller) {\n var state = controller._controlledReadableStream._state;\n if (state === 'errored') {\n return null;\n }\n if (state === 'closed') {\n return 0;\n }\n return controller._strategyHWM - controller._queueTotalSize;\n }\n // This is used in the implementation of TransformStream.\n function ReadableStreamDefaultControllerHasBackpressure(controller) {\n if (ReadableStreamDefaultControllerShouldCallPull(controller)) {\n return false;\n }\n return true;\n }\n function ReadableStreamDefaultControllerCanCloseOrEnqueue(controller) {\n var state = controller._controlledReadableStream._state;\n if (!controller._closeRequested && state === 'readable') {\n return true;\n }\n return false;\n }\n function SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm) {\n controller._controlledReadableStream = stream;\n controller._queue = undefined;\n controller._queueTotalSize = undefined;\n ResetQueue(controller);\n controller._started = false;\n controller._closeRequested = false;\n controller._pullAgain = false;\n controller._pulling = false;\n controller._strategySizeAlgorithm = sizeAlgorithm;\n controller._strategyHWM = highWaterMark;\n controller._pullAlgorithm = pullAlgorithm;\n controller._cancelAlgorithm = cancelAlgorithm;\n stream._readableStreamController = controller;\n var startResult = startAlgorithm();\n uponPromise(promiseResolvedWith(startResult), function () {\n controller._started = true;\n ReadableStreamDefaultControllerCallPullIfNeeded(controller);\n }, function (r) {\n ReadableStreamDefaultControllerError(controller, r);\n });\n }\n function SetUpReadableStreamDefaultControllerFromUnderlyingSource(stream, underlyingSource, highWaterMark, sizeAlgorithm) {\n var controller = Object.create(ReadableStreamDefaultController.prototype);\n var startAlgorithm = function () { return undefined; };\n var pullAlgorithm = function () { return promiseResolvedWith(undefined); };\n var cancelAlgorithm = function () { return promiseResolvedWith(undefined); };\n if (underlyingSource.start !== undefined) {\n startAlgorithm = function () { return underlyingSource.start(controller); };\n }\n if (underlyingSource.pull !== undefined) {\n pullAlgorithm = function () { return underlyingSource.pull(controller); };\n }\n if (underlyingSource.cancel !== undefined) {\n cancelAlgorithm = function (reason) { return underlyingSource.cancel(reason); };\n }\n SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm);\n }\n // Helper functions for the ReadableStreamDefaultController.\n function defaultControllerBrandCheckException$1(name) {\n return new TypeError(\"ReadableStreamDefaultController.prototype.\" + name + \" can only be used on a ReadableStreamDefaultController\");\n }\n\n function ReadableStreamTee(stream, cloneForBranch2) {\n if (IsReadableByteStreamController(stream._readableStreamController)) {\n return ReadableByteStreamTee(stream);\n }\n return ReadableStreamDefaultTee(stream);\n }\n function ReadableStreamDefaultTee(stream, cloneForBranch2) {\n var reader = AcquireReadableStreamDefaultReader(stream);\n var reading = false;\n var readAgain = false;\n var canceled1 = false;\n var canceled2 = false;\n var reason1;\n var reason2;\n var branch1;\n var branch2;\n var resolveCancelPromise;\n var cancelPromise = newPromise(function (resolve) {\n resolveCancelPromise = resolve;\n });\n function pullAlgorithm() {\n if (reading) {\n readAgain = true;\n return promiseResolvedWith(undefined);\n }\n reading = true;\n var readRequest = {\n _chunkSteps: function (chunk) {\n // This needs to be delayed a microtask because it takes at least a microtask to detect errors (using\n // reader._closedPromise below), and we want errors in stream to error both branches immediately. We cannot let\n // successful synchronously-available reads get ahead of asynchronously-available errors.\n queueMicrotask(function () {\n readAgain = false;\n var chunk1 = chunk;\n var chunk2 = chunk;\n // There is no way to access the cloning code right now in the reference implementation.\n // If we add one then we'll need an implementation for serializable objects.\n // if (!canceled2 && cloneForBranch2) {\n // chunk2 = StructuredDeserialize(StructuredSerialize(chunk2));\n // }\n if (!canceled1) {\n ReadableStreamDefaultControllerEnqueue(branch1._readableStreamController, chunk1);\n }\n if (!canceled2) {\n ReadableStreamDefaultControllerEnqueue(branch2._readableStreamController, chunk2);\n }\n reading = false;\n if (readAgain) {\n pullAlgorithm();\n }\n });\n },\n _closeSteps: function () {\n reading = false;\n if (!canceled1) {\n ReadableStreamDefaultControllerClose(branch1._readableStreamController);\n }\n if (!canceled2) {\n ReadableStreamDefaultControllerClose(branch2._readableStreamController);\n }\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n },\n _errorSteps: function () {\n reading = false;\n }\n };\n ReadableStreamDefaultReaderRead(reader, readRequest);\n return promiseResolvedWith(undefined);\n }\n function cancel1Algorithm(reason) {\n canceled1 = true;\n reason1 = reason;\n if (canceled2) {\n var compositeReason = CreateArrayFromList([reason1, reason2]);\n var cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n function cancel2Algorithm(reason) {\n canceled2 = true;\n reason2 = reason;\n if (canceled1) {\n var compositeReason = CreateArrayFromList([reason1, reason2]);\n var cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n function startAlgorithm() {\n // do nothing\n }\n branch1 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel1Algorithm);\n branch2 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel2Algorithm);\n uponRejection(reader._closedPromise, function (r) {\n ReadableStreamDefaultControllerError(branch1._readableStreamController, r);\n ReadableStreamDefaultControllerError(branch2._readableStreamController, r);\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n });\n return [branch1, branch2];\n }\n function ReadableByteStreamTee(stream) {\n var reader = AcquireReadableStreamDefaultReader(stream);\n var reading = false;\n var readAgainForBranch1 = false;\n var readAgainForBranch2 = false;\n var canceled1 = false;\n var canceled2 = false;\n var reason1;\n var reason2;\n var branch1;\n var branch2;\n var resolveCancelPromise;\n var cancelPromise = newPromise(function (resolve) {\n resolveCancelPromise = resolve;\n });\n function forwardReaderError(thisReader) {\n uponRejection(thisReader._closedPromise, function (r) {\n if (thisReader !== reader) {\n return;\n }\n ReadableByteStreamControllerError(branch1._readableStreamController, r);\n ReadableByteStreamControllerError(branch2._readableStreamController, r);\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n });\n }\n function pullWithDefaultReader() {\n if (IsReadableStreamBYOBReader(reader)) {\n ReadableStreamReaderGenericRelease(reader);\n reader = AcquireReadableStreamDefaultReader(stream);\n forwardReaderError(reader);\n }\n var readRequest = {\n _chunkSteps: function (chunk) {\n // This needs to be delayed a microtask because it takes at least a microtask to detect errors (using\n // reader._closedPromise below), and we want errors in stream to error both branches immediately. We cannot let\n // successful synchronously-available reads get ahead of asynchronously-available errors.\n queueMicrotask(function () {\n readAgainForBranch1 = false;\n readAgainForBranch2 = false;\n var chunk1 = chunk;\n var chunk2 = chunk;\n if (!canceled1 && !canceled2) {\n try {\n chunk2 = CloneAsUint8Array(chunk);\n }\n catch (cloneE) {\n ReadableByteStreamControllerError(branch1._readableStreamController, cloneE);\n ReadableByteStreamControllerError(branch2._readableStreamController, cloneE);\n resolveCancelPromise(ReadableStreamCancel(stream, cloneE));\n return;\n }\n }\n if (!canceled1) {\n ReadableByteStreamControllerEnqueue(branch1._readableStreamController, chunk1);\n }\n if (!canceled2) {\n ReadableByteStreamControllerEnqueue(branch2._readableStreamController, chunk2);\n }\n reading = false;\n if (readAgainForBranch1) {\n pull1Algorithm();\n }\n else if (readAgainForBranch2) {\n pull2Algorithm();\n }\n });\n },\n _closeSteps: function () {\n reading = false;\n if (!canceled1) {\n ReadableByteStreamControllerClose(branch1._readableStreamController);\n }\n if (!canceled2) {\n ReadableByteStreamControllerClose(branch2._readableStreamController);\n }\n if (branch1._readableStreamController._pendingPullIntos.length > 0) {\n ReadableByteStreamControllerRespond(branch1._readableStreamController, 0);\n }\n if (branch2._readableStreamController._pendingPullIntos.length > 0) {\n ReadableByteStreamControllerRespond(branch2._readableStreamController, 0);\n }\n if (!canceled1 || !canceled2) {\n resolveCancelPromise(undefined);\n }\n },\n _errorSteps: function () {\n reading = false;\n }\n };\n ReadableStreamDefaultReaderRead(reader, readRequest);\n }\n function pullWithBYOBReader(view, forBranch2) {\n if (IsReadableStreamDefaultReader(reader)) {\n ReadableStreamReaderGenericRelease(reader);\n reader = AcquireReadableStreamBYOBReader(stream);\n forwardReaderError(reader);\n }\n var byobBranch = forBranch2 ? branch2 : branch1;\n var otherBranch = forBranch2 ? branch1 : branch2;\n var readIntoRequest = {\n _chunkSteps: function (chunk) {\n // This needs to be delayed a microtask because it takes at least a microtask to detect errors (using\n // reader._closedPromise below), and we want errors in stream to error both branches immediately. We cannot let\n // successful synchronously-available reads get ahead of asynchronously-available errors.\n queueMicrotask(function () {\n readAgainForBranch1 = false;\n readAgainForBranch2 = false;\n var byobCanceled = forBranch2 ? canceled2 : canceled1;\n var otherCanceled = forBranch2 ? canceled1 : canceled2;\n if (!otherCanceled) {\n var clonedChunk = void 0;\n try {\n clonedChunk = CloneAsUint8Array(chunk);\n }\n catch (cloneE) {\n ReadableByteStreamControllerError(byobBranch._readableStreamController, cloneE);\n ReadableByteStreamControllerError(otherBranch._readableStreamController, cloneE);\n resolveCancelPromise(ReadableStreamCancel(stream, cloneE));\n return;\n }\n if (!byobCanceled) {\n ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk);\n }\n ReadableByteStreamControllerEnqueue(otherBranch._readableStreamController, clonedChunk);\n }\n else if (!byobCanceled) {\n ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk);\n }\n reading = false;\n if (readAgainForBranch1) {\n pull1Algorithm();\n }\n else if (readAgainForBranch2) {\n pull2Algorithm();\n }\n });\n },\n _closeSteps: function (chunk) {\n reading = false;\n var byobCanceled = forBranch2 ? canceled2 : canceled1;\n var otherCanceled = forBranch2 ? canceled1 : canceled2;\n if (!byobCanceled) {\n ReadableByteStreamControllerClose(byobBranch._readableStreamController);\n }\n if (!otherCanceled) {\n ReadableByteStreamControllerClose(otherBranch._readableStreamController);\n }\n if (chunk !== undefined) {\n if (!byobCanceled) {\n ReadableByteStreamControllerRespondWithNewView(byobBranch._readableStreamController, chunk);\n }\n if (!otherCanceled && otherBranch._readableStreamController._pendingPullIntos.length > 0) {\n ReadableByteStreamControllerRespond(otherBranch._readableStreamController, 0);\n }\n }\n if (!byobCanceled || !otherCanceled) {\n resolveCancelPromise(undefined);\n }\n },\n _errorSteps: function () {\n reading = false;\n }\n };\n ReadableStreamBYOBReaderRead(reader, view, readIntoRequest);\n }\n function pull1Algorithm() {\n if (reading) {\n readAgainForBranch1 = true;\n return promiseResolvedWith(undefined);\n }\n reading = true;\n var byobRequest = ReadableByteStreamControllerGetBYOBRequest(branch1._readableStreamController);\n if (byobRequest === null) {\n pullWithDefaultReader();\n }\n else {\n pullWithBYOBReader(byobRequest._view, false);\n }\n return promiseResolvedWith(undefined);\n }\n function pull2Algorithm() {\n if (reading) {\n readAgainForBranch2 = true;\n return promiseResolvedWith(undefined);\n }\n reading = true;\n var byobRequest = ReadableByteStreamControllerGetBYOBRequest(branch2._readableStreamController);\n if (byobRequest === null) {\n pullWithDefaultReader();\n }\n else {\n pullWithBYOBReader(byobRequest._view, true);\n }\n return promiseResolvedWith(undefined);\n }\n function cancel1Algorithm(reason) {\n canceled1 = true;\n reason1 = reason;\n if (canceled2) {\n var compositeReason = CreateArrayFromList([reason1, reason2]);\n var cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n function cancel2Algorithm(reason) {\n canceled2 = true;\n reason2 = reason;\n if (canceled1) {\n var compositeReason = CreateArrayFromList([reason1, reason2]);\n var cancelResult = ReadableStreamCancel(stream, compositeReason);\n resolveCancelPromise(cancelResult);\n }\n return cancelPromise;\n }\n function startAlgorithm() {\n return;\n }\n branch1 = CreateReadableByteStream(startAlgorithm, pull1Algorithm, cancel1Algorithm);\n branch2 = CreateReadableByteStream(startAlgorithm, pull2Algorithm, cancel2Algorithm);\n forwardReaderError(reader);\n return [branch1, branch2];\n }\n\n function convertUnderlyingDefaultOrByteSource(source, context) {\n assertDictionary(source, context);\n var original = source;\n var autoAllocateChunkSize = original === null || original === void 0 ? void 0 : original.autoAllocateChunkSize;\n var cancel = original === null || original === void 0 ? void 0 : original.cancel;\n var pull = original === null || original === void 0 ? void 0 : original.pull;\n var start = original === null || original === void 0 ? void 0 : original.start;\n var type = original === null || original === void 0 ? void 0 : original.type;\n return {\n autoAllocateChunkSize: autoAllocateChunkSize === undefined ?\n undefined :\n convertUnsignedLongLongWithEnforceRange(autoAllocateChunkSize, context + \" has member 'autoAllocateChunkSize' that\"),\n cancel: cancel === undefined ?\n undefined :\n convertUnderlyingSourceCancelCallback(cancel, original, context + \" has member 'cancel' that\"),\n pull: pull === undefined ?\n undefined :\n convertUnderlyingSourcePullCallback(pull, original, context + \" has member 'pull' that\"),\n start: start === undefined ?\n undefined :\n convertUnderlyingSourceStartCallback(start, original, context + \" has member 'start' that\"),\n type: type === undefined ? undefined : convertReadableStreamType(type, context + \" has member 'type' that\")\n };\n }\n function convertUnderlyingSourceCancelCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (reason) { return promiseCall(fn, original, [reason]); };\n }\n function convertUnderlyingSourcePullCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (controller) { return promiseCall(fn, original, [controller]); };\n }\n function convertUnderlyingSourceStartCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (controller) { return reflectCall(fn, original, [controller]); };\n }\n function convertReadableStreamType(type, context) {\n type = \"\" + type;\n if (type !== 'bytes') {\n throw new TypeError(context + \" '\" + type + \"' is not a valid enumeration value for ReadableStreamType\");\n }\n return type;\n }\n\n function convertReaderOptions(options, context) {\n assertDictionary(options, context);\n var mode = options === null || options === void 0 ? void 0 : options.mode;\n return {\n mode: mode === undefined ? undefined : convertReadableStreamReaderMode(mode, context + \" has member 'mode' that\")\n };\n }\n function convertReadableStreamReaderMode(mode, context) {\n mode = \"\" + mode;\n if (mode !== 'byob') {\n throw new TypeError(context + \" '\" + mode + \"' is not a valid enumeration value for ReadableStreamReaderMode\");\n }\n return mode;\n }\n\n function convertIteratorOptions(options, context) {\n assertDictionary(options, context);\n var preventCancel = options === null || options === void 0 ? void 0 : options.preventCancel;\n return { preventCancel: Boolean(preventCancel) };\n }\n\n function convertPipeOptions(options, context) {\n assertDictionary(options, context);\n var preventAbort = options === null || options === void 0 ? void 0 : options.preventAbort;\n var preventCancel = options === null || options === void 0 ? void 0 : options.preventCancel;\n var preventClose = options === null || options === void 0 ? void 0 : options.preventClose;\n var signal = options === null || options === void 0 ? void 0 : options.signal;\n if (signal !== undefined) {\n assertAbortSignal(signal, context + \" has member 'signal' that\");\n }\n return {\n preventAbort: Boolean(preventAbort),\n preventCancel: Boolean(preventCancel),\n preventClose: Boolean(preventClose),\n signal: signal\n };\n }\n function assertAbortSignal(signal, context) {\n if (!isAbortSignal(signal)) {\n throw new TypeError(context + \" is not an AbortSignal.\");\n }\n }\n\n function convertReadableWritablePair(pair, context) {\n assertDictionary(pair, context);\n var readable = pair === null || pair === void 0 ? void 0 : pair.readable;\n assertRequiredField(readable, 'readable', 'ReadableWritablePair');\n assertReadableStream(readable, context + \" has member 'readable' that\");\n var writable = pair === null || pair === void 0 ? void 0 : pair.writable;\n assertRequiredField(writable, 'writable', 'ReadableWritablePair');\n assertWritableStream(writable, context + \" has member 'writable' that\");\n return { readable: readable, writable: writable };\n }\n\n /**\n * A readable stream represents a source of data, from which you can read.\n *\n * @public\n */\n var ReadableStream = /** @class */ (function () {\n function ReadableStream(rawUnderlyingSource, rawStrategy) {\n if (rawUnderlyingSource === void 0) { rawUnderlyingSource = {}; }\n if (rawStrategy === void 0) { rawStrategy = {}; }\n if (rawUnderlyingSource === undefined) {\n rawUnderlyingSource = null;\n }\n else {\n assertObject(rawUnderlyingSource, 'First parameter');\n }\n var strategy = convertQueuingStrategy(rawStrategy, 'Second parameter');\n var underlyingSource = convertUnderlyingDefaultOrByteSource(rawUnderlyingSource, 'First parameter');\n InitializeReadableStream(this);\n if (underlyingSource.type === 'bytes') {\n if (strategy.size !== undefined) {\n throw new RangeError('The strategy for a byte stream cannot have a size function');\n }\n var highWaterMark = ExtractHighWaterMark(strategy, 0);\n SetUpReadableByteStreamControllerFromUnderlyingSource(this, underlyingSource, highWaterMark);\n }\n else {\n var sizeAlgorithm = ExtractSizeAlgorithm(strategy);\n var highWaterMark = ExtractHighWaterMark(strategy, 1);\n SetUpReadableStreamDefaultControllerFromUnderlyingSource(this, underlyingSource, highWaterMark, sizeAlgorithm);\n }\n }\n Object.defineProperty(ReadableStream.prototype, \"locked\", {\n /**\n * Whether or not the readable stream is locked to a {@link ReadableStreamDefaultReader | reader}.\n */\n get: function () {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('locked');\n }\n return IsReadableStreamLocked(this);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Cancels the stream, signaling a loss of interest in the stream by a consumer.\n *\n * The supplied `reason` argument will be given to the underlying source's {@link UnderlyingSource.cancel | cancel()}\n * method, which might or might not use it.\n */\n ReadableStream.prototype.cancel = function (reason) {\n if (reason === void 0) { reason = undefined; }\n if (!IsReadableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException$1('cancel'));\n }\n if (IsReadableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError('Cannot cancel a stream that already has a reader'));\n }\n return ReadableStreamCancel(this, reason);\n };\n ReadableStream.prototype.getReader = function (rawOptions) {\n if (rawOptions === void 0) { rawOptions = undefined; }\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('getReader');\n }\n var options = convertReaderOptions(rawOptions, 'First parameter');\n if (options.mode === undefined) {\n return AcquireReadableStreamDefaultReader(this);\n }\n return AcquireReadableStreamBYOBReader(this);\n };\n ReadableStream.prototype.pipeThrough = function (rawTransform, rawOptions) {\n if (rawOptions === void 0) { rawOptions = {}; }\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('pipeThrough');\n }\n assertRequiredArgument(rawTransform, 1, 'pipeThrough');\n var transform = convertReadableWritablePair(rawTransform, 'First parameter');\n var options = convertPipeOptions(rawOptions, 'Second parameter');\n if (IsReadableStreamLocked(this)) {\n throw new TypeError('ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream');\n }\n if (IsWritableStreamLocked(transform.writable)) {\n throw new TypeError('ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream');\n }\n var promise = ReadableStreamPipeTo(this, transform.writable, options.preventClose, options.preventAbort, options.preventCancel, options.signal);\n setPromiseIsHandledToTrue(promise);\n return transform.readable;\n };\n ReadableStream.prototype.pipeTo = function (destination, rawOptions) {\n if (rawOptions === void 0) { rawOptions = {}; }\n if (!IsReadableStream(this)) {\n return promiseRejectedWith(streamBrandCheckException$1('pipeTo'));\n }\n if (destination === undefined) {\n return promiseRejectedWith(\"Parameter 1 is required in 'pipeTo'.\");\n }\n if (!IsWritableStream(destination)) {\n return promiseRejectedWith(new TypeError(\"ReadableStream.prototype.pipeTo's first argument must be a WritableStream\"));\n }\n var options;\n try {\n options = convertPipeOptions(rawOptions, 'Second parameter');\n }\n catch (e) {\n return promiseRejectedWith(e);\n }\n if (IsReadableStreamLocked(this)) {\n return promiseRejectedWith(new TypeError('ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream'));\n }\n if (IsWritableStreamLocked(destination)) {\n return promiseRejectedWith(new TypeError('ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream'));\n }\n return ReadableStreamPipeTo(this, destination, options.preventClose, options.preventAbort, options.preventCancel, options.signal);\n };\n /**\n * Tees this readable stream, returning a two-element array containing the two resulting branches as\n * new {@link ReadableStream} instances.\n *\n * Teeing a stream will lock it, preventing any other consumer from acquiring a reader.\n * To cancel the stream, cancel both of the resulting branches; a composite cancellation reason will then be\n * propagated to the stream's underlying source.\n *\n * Note that the chunks seen in each branch will be the same object. If the chunks are not immutable,\n * this could allow interference between the two branches.\n */\n ReadableStream.prototype.tee = function () {\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('tee');\n }\n var branches = ReadableStreamTee(this);\n return CreateArrayFromList(branches);\n };\n ReadableStream.prototype.values = function (rawOptions) {\n if (rawOptions === void 0) { rawOptions = undefined; }\n if (!IsReadableStream(this)) {\n throw streamBrandCheckException$1('values');\n }\n var options = convertIteratorOptions(rawOptions, 'First parameter');\n return AcquireReadableStreamAsyncIterator(this, options.preventCancel);\n };\n return ReadableStream;\n }());\n Object.defineProperties(ReadableStream.prototype, {\n cancel: { enumerable: true },\n getReader: { enumerable: true },\n pipeThrough: { enumerable: true },\n pipeTo: { enumerable: true },\n tee: { enumerable: true },\n values: { enumerable: true },\n locked: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ReadableStream.prototype, SymbolPolyfill.toStringTag, {\n value: 'ReadableStream',\n configurable: true\n });\n }\n if (typeof SymbolPolyfill.asyncIterator === 'symbol') {\n Object.defineProperty(ReadableStream.prototype, SymbolPolyfill.asyncIterator, {\n value: ReadableStream.prototype.values,\n writable: true,\n configurable: true\n });\n }\n // Abstract operations for the ReadableStream.\n // Throws if and only if startAlgorithm throws.\n function CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm) {\n if (highWaterMark === void 0) { highWaterMark = 1; }\n if (sizeAlgorithm === void 0) { sizeAlgorithm = function () { return 1; }; }\n var stream = Object.create(ReadableStream.prototype);\n InitializeReadableStream(stream);\n var controller = Object.create(ReadableStreamDefaultController.prototype);\n SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm);\n return stream;\n }\n // Throws if and only if startAlgorithm throws.\n function CreateReadableByteStream(startAlgorithm, pullAlgorithm, cancelAlgorithm) {\n var stream = Object.create(ReadableStream.prototype);\n InitializeReadableStream(stream);\n var controller = Object.create(ReadableByteStreamController.prototype);\n SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, 0, undefined);\n return stream;\n }\n function InitializeReadableStream(stream) {\n stream._state = 'readable';\n stream._reader = undefined;\n stream._storedError = undefined;\n stream._disturbed = false;\n }\n function IsReadableStream(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_readableStreamController')) {\n return false;\n }\n return x instanceof ReadableStream;\n }\n function IsReadableStreamLocked(stream) {\n if (stream._reader === undefined) {\n return false;\n }\n return true;\n }\n // ReadableStream API exposed for controllers.\n function ReadableStreamCancel(stream, reason) {\n stream._disturbed = true;\n if (stream._state === 'closed') {\n return promiseResolvedWith(undefined);\n }\n if (stream._state === 'errored') {\n return promiseRejectedWith(stream._storedError);\n }\n ReadableStreamClose(stream);\n var reader = stream._reader;\n if (reader !== undefined && IsReadableStreamBYOBReader(reader)) {\n reader._readIntoRequests.forEach(function (readIntoRequest) {\n readIntoRequest._closeSteps(undefined);\n });\n reader._readIntoRequests = new SimpleQueue();\n }\n var sourceCancelPromise = stream._readableStreamController[CancelSteps](reason);\n return transformPromiseWith(sourceCancelPromise, noop);\n }\n function ReadableStreamClose(stream) {\n stream._state = 'closed';\n var reader = stream._reader;\n if (reader === undefined) {\n return;\n }\n defaultReaderClosedPromiseResolve(reader);\n if (IsReadableStreamDefaultReader(reader)) {\n reader._readRequests.forEach(function (readRequest) {\n readRequest._closeSteps();\n });\n reader._readRequests = new SimpleQueue();\n }\n }\n function ReadableStreamError(stream, e) {\n stream._state = 'errored';\n stream._storedError = e;\n var reader = stream._reader;\n if (reader === undefined) {\n return;\n }\n defaultReaderClosedPromiseReject(reader, e);\n if (IsReadableStreamDefaultReader(reader)) {\n reader._readRequests.forEach(function (readRequest) {\n readRequest._errorSteps(e);\n });\n reader._readRequests = new SimpleQueue();\n }\n else {\n reader._readIntoRequests.forEach(function (readIntoRequest) {\n readIntoRequest._errorSteps(e);\n });\n reader._readIntoRequests = new SimpleQueue();\n }\n }\n // Helper functions for the ReadableStream.\n function streamBrandCheckException$1(name) {\n return new TypeError(\"ReadableStream.prototype.\" + name + \" can only be used on a ReadableStream\");\n }\n\n function convertQueuingStrategyInit(init, context) {\n assertDictionary(init, context);\n var highWaterMark = init === null || init === void 0 ? void 0 : init.highWaterMark;\n assertRequiredField(highWaterMark, 'highWaterMark', 'QueuingStrategyInit');\n return {\n highWaterMark: convertUnrestrictedDouble(highWaterMark)\n };\n }\n\n // The size function must not have a prototype property nor be a constructor\n var byteLengthSizeFunction = function (chunk) {\n return chunk.byteLength;\n };\n try {\n Object.defineProperty(byteLengthSizeFunction, 'name', {\n value: 'size',\n configurable: true\n });\n }\n catch (_a) {\n // This property is non-configurable in older browsers, so ignore if this throws.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name#browser_compatibility\n }\n /**\n * A queuing strategy that counts the number of bytes in each chunk.\n *\n * @public\n */\n var ByteLengthQueuingStrategy = /** @class */ (function () {\n function ByteLengthQueuingStrategy(options) {\n assertRequiredArgument(options, 1, 'ByteLengthQueuingStrategy');\n options = convertQueuingStrategyInit(options, 'First parameter');\n this._byteLengthQueuingStrategyHighWaterMark = options.highWaterMark;\n }\n Object.defineProperty(ByteLengthQueuingStrategy.prototype, \"highWaterMark\", {\n /**\n * Returns the high water mark provided to the constructor.\n */\n get: function () {\n if (!IsByteLengthQueuingStrategy(this)) {\n throw byteLengthBrandCheckException('highWaterMark');\n }\n return this._byteLengthQueuingStrategyHighWaterMark;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ByteLengthQueuingStrategy.prototype, \"size\", {\n /**\n * Measures the size of `chunk` by returning the value of its `byteLength` property.\n */\n get: function () {\n if (!IsByteLengthQueuingStrategy(this)) {\n throw byteLengthBrandCheckException('size');\n }\n return byteLengthSizeFunction;\n },\n enumerable: false,\n configurable: true\n });\n return ByteLengthQueuingStrategy;\n }());\n Object.defineProperties(ByteLengthQueuingStrategy.prototype, {\n highWaterMark: { enumerable: true },\n size: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(ByteLengthQueuingStrategy.prototype, SymbolPolyfill.toStringTag, {\n value: 'ByteLengthQueuingStrategy',\n configurable: true\n });\n }\n // Helper functions for the ByteLengthQueuingStrategy.\n function byteLengthBrandCheckException(name) {\n return new TypeError(\"ByteLengthQueuingStrategy.prototype.\" + name + \" can only be used on a ByteLengthQueuingStrategy\");\n }\n function IsByteLengthQueuingStrategy(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_byteLengthQueuingStrategyHighWaterMark')) {\n return false;\n }\n return x instanceof ByteLengthQueuingStrategy;\n }\n\n // The size function must not have a prototype property nor be a constructor\n var countSizeFunction = function () {\n return 1;\n };\n try {\n Object.defineProperty(countSizeFunction, 'name', {\n value: 'size',\n configurable: true\n });\n }\n catch (_a) {\n // This property is non-configurable in older browsers, so ignore if this throws.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name#browser_compatibility\n }\n /**\n * A queuing strategy that counts the number of chunks.\n *\n * @public\n */\n var CountQueuingStrategy = /** @class */ (function () {\n function CountQueuingStrategy(options) {\n assertRequiredArgument(options, 1, 'CountQueuingStrategy');\n options = convertQueuingStrategyInit(options, 'First parameter');\n this._countQueuingStrategyHighWaterMark = options.highWaterMark;\n }\n Object.defineProperty(CountQueuingStrategy.prototype, \"highWaterMark\", {\n /**\n * Returns the high water mark provided to the constructor.\n */\n get: function () {\n if (!IsCountQueuingStrategy(this)) {\n throw countBrandCheckException('highWaterMark');\n }\n return this._countQueuingStrategyHighWaterMark;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CountQueuingStrategy.prototype, \"size\", {\n /**\n * Measures the size of `chunk` by always returning 1.\n * This ensures that the total queue size is a count of the number of chunks in the queue.\n */\n get: function () {\n if (!IsCountQueuingStrategy(this)) {\n throw countBrandCheckException('size');\n }\n return countSizeFunction;\n },\n enumerable: false,\n configurable: true\n });\n return CountQueuingStrategy;\n }());\n Object.defineProperties(CountQueuingStrategy.prototype, {\n highWaterMark: { enumerable: true },\n size: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(CountQueuingStrategy.prototype, SymbolPolyfill.toStringTag, {\n value: 'CountQueuingStrategy',\n configurable: true\n });\n }\n // Helper functions for the CountQueuingStrategy.\n function countBrandCheckException(name) {\n return new TypeError(\"CountQueuingStrategy.prototype.\" + name + \" can only be used on a CountQueuingStrategy\");\n }\n function IsCountQueuingStrategy(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_countQueuingStrategyHighWaterMark')) {\n return false;\n }\n return x instanceof CountQueuingStrategy;\n }\n\n function convertTransformer(original, context) {\n assertDictionary(original, context);\n var flush = original === null || original === void 0 ? void 0 : original.flush;\n var readableType = original === null || original === void 0 ? void 0 : original.readableType;\n var start = original === null || original === void 0 ? void 0 : original.start;\n var transform = original === null || original === void 0 ? void 0 : original.transform;\n var writableType = original === null || original === void 0 ? void 0 : original.writableType;\n return {\n flush: flush === undefined ?\n undefined :\n convertTransformerFlushCallback(flush, original, context + \" has member 'flush' that\"),\n readableType: readableType,\n start: start === undefined ?\n undefined :\n convertTransformerStartCallback(start, original, context + \" has member 'start' that\"),\n transform: transform === undefined ?\n undefined :\n convertTransformerTransformCallback(transform, original, context + \" has member 'transform' that\"),\n writableType: writableType\n };\n }\n function convertTransformerFlushCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (controller) { return promiseCall(fn, original, [controller]); };\n }\n function convertTransformerStartCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (controller) { return reflectCall(fn, original, [controller]); };\n }\n function convertTransformerTransformCallback(fn, original, context) {\n assertFunction(fn, context);\n return function (chunk, controller) { return promiseCall(fn, original, [chunk, controller]); };\n }\n\n // Class TransformStream\n /**\n * A transform stream consists of a pair of streams: a {@link WritableStream | writable stream},\n * known as its writable side, and a {@link ReadableStream | readable stream}, known as its readable side.\n * In a manner specific to the transform stream in question, writes to the writable side result in new data being\n * made available for reading from the readable side.\n *\n * @public\n */\n var TransformStream = /** @class */ (function () {\n function TransformStream(rawTransformer, rawWritableStrategy, rawReadableStrategy) {\n if (rawTransformer === void 0) { rawTransformer = {}; }\n if (rawWritableStrategy === void 0) { rawWritableStrategy = {}; }\n if (rawReadableStrategy === void 0) { rawReadableStrategy = {}; }\n if (rawTransformer === undefined) {\n rawTransformer = null;\n }\n var writableStrategy = convertQueuingStrategy(rawWritableStrategy, 'Second parameter');\n var readableStrategy = convertQueuingStrategy(rawReadableStrategy, 'Third parameter');\n var transformer = convertTransformer(rawTransformer, 'First parameter');\n if (transformer.readableType !== undefined) {\n throw new RangeError('Invalid readableType specified');\n }\n if (transformer.writableType !== undefined) {\n throw new RangeError('Invalid writableType specified');\n }\n var readableHighWaterMark = ExtractHighWaterMark(readableStrategy, 0);\n var readableSizeAlgorithm = ExtractSizeAlgorithm(readableStrategy);\n var writableHighWaterMark = ExtractHighWaterMark(writableStrategy, 1);\n var writableSizeAlgorithm = ExtractSizeAlgorithm(writableStrategy);\n var startPromise_resolve;\n var startPromise = newPromise(function (resolve) {\n startPromise_resolve = resolve;\n });\n InitializeTransformStream(this, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm);\n SetUpTransformStreamDefaultControllerFromTransformer(this, transformer);\n if (transformer.start !== undefined) {\n startPromise_resolve(transformer.start(this._transformStreamController));\n }\n else {\n startPromise_resolve(undefined);\n }\n }\n Object.defineProperty(TransformStream.prototype, \"readable\", {\n /**\n * The readable side of the transform stream.\n */\n get: function () {\n if (!IsTransformStream(this)) {\n throw streamBrandCheckException('readable');\n }\n return this._readable;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TransformStream.prototype, \"writable\", {\n /**\n * The writable side of the transform stream.\n */\n get: function () {\n if (!IsTransformStream(this)) {\n throw streamBrandCheckException('writable');\n }\n return this._writable;\n },\n enumerable: false,\n configurable: true\n });\n return TransformStream;\n }());\n Object.defineProperties(TransformStream.prototype, {\n readable: { enumerable: true },\n writable: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(TransformStream.prototype, SymbolPolyfill.toStringTag, {\n value: 'TransformStream',\n configurable: true\n });\n }\n function InitializeTransformStream(stream, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm) {\n function startAlgorithm() {\n return startPromise;\n }\n function writeAlgorithm(chunk) {\n return TransformStreamDefaultSinkWriteAlgorithm(stream, chunk);\n }\n function abortAlgorithm(reason) {\n return TransformStreamDefaultSinkAbortAlgorithm(stream, reason);\n }\n function closeAlgorithm() {\n return TransformStreamDefaultSinkCloseAlgorithm(stream);\n }\n stream._writable = CreateWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, writableHighWaterMark, writableSizeAlgorithm);\n function pullAlgorithm() {\n return TransformStreamDefaultSourcePullAlgorithm(stream);\n }\n function cancelAlgorithm(reason) {\n TransformStreamErrorWritableAndUnblockWrite(stream, reason);\n return promiseResolvedWith(undefined);\n }\n stream._readable = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, readableHighWaterMark, readableSizeAlgorithm);\n // The [[backpressure]] slot is set to undefined so that it can be initialised by TransformStreamSetBackpressure.\n stream._backpressure = undefined;\n stream._backpressureChangePromise = undefined;\n stream._backpressureChangePromise_resolve = undefined;\n TransformStreamSetBackpressure(stream, true);\n stream._transformStreamController = undefined;\n }\n function IsTransformStream(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_transformStreamController')) {\n return false;\n }\n return x instanceof TransformStream;\n }\n // This is a no-op if both sides are already errored.\n function TransformStreamError(stream, e) {\n ReadableStreamDefaultControllerError(stream._readable._readableStreamController, e);\n TransformStreamErrorWritableAndUnblockWrite(stream, e);\n }\n function TransformStreamErrorWritableAndUnblockWrite(stream, e) {\n TransformStreamDefaultControllerClearAlgorithms(stream._transformStreamController);\n WritableStreamDefaultControllerErrorIfNeeded(stream._writable._writableStreamController, e);\n if (stream._backpressure) {\n // Pretend that pull() was called to permit any pending write() calls to complete. TransformStreamSetBackpressure()\n // cannot be called from enqueue() or pull() once the ReadableStream is errored, so this will will be the final time\n // _backpressure is set.\n TransformStreamSetBackpressure(stream, false);\n }\n }\n function TransformStreamSetBackpressure(stream, backpressure) {\n // Passes also when called during construction.\n if (stream._backpressureChangePromise !== undefined) {\n stream._backpressureChangePromise_resolve();\n }\n stream._backpressureChangePromise = newPromise(function (resolve) {\n stream._backpressureChangePromise_resolve = resolve;\n });\n stream._backpressure = backpressure;\n }\n // Class TransformStreamDefaultController\n /**\n * Allows control of the {@link ReadableStream} and {@link WritableStream} of the associated {@link TransformStream}.\n *\n * @public\n */\n var TransformStreamDefaultController = /** @class */ (function () {\n function TransformStreamDefaultController() {\n throw new TypeError('Illegal constructor');\n }\n Object.defineProperty(TransformStreamDefaultController.prototype, \"desiredSize\", {\n /**\n * Returns the desired size to fill the readable side’s internal queue. It can be negative, if the queue is over-full.\n */\n get: function () {\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('desiredSize');\n }\n var readableController = this._controlledTransformStream._readable._readableStreamController;\n return ReadableStreamDefaultControllerGetDesiredSize(readableController);\n },\n enumerable: false,\n configurable: true\n });\n TransformStreamDefaultController.prototype.enqueue = function (chunk) {\n if (chunk === void 0) { chunk = undefined; }\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('enqueue');\n }\n TransformStreamDefaultControllerEnqueue(this, chunk);\n };\n /**\n * Errors both the readable side and the writable side of the controlled transform stream, making all future\n * interactions with it fail with the given error `e`. Any chunks queued for transformation will be discarded.\n */\n TransformStreamDefaultController.prototype.error = function (reason) {\n if (reason === void 0) { reason = undefined; }\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('error');\n }\n TransformStreamDefaultControllerError(this, reason);\n };\n /**\n * Closes the readable side and errors the writable side of the controlled transform stream. This is useful when the\n * transformer only needs to consume a portion of the chunks written to the writable side.\n */\n TransformStreamDefaultController.prototype.terminate = function () {\n if (!IsTransformStreamDefaultController(this)) {\n throw defaultControllerBrandCheckException('terminate');\n }\n TransformStreamDefaultControllerTerminate(this);\n };\n return TransformStreamDefaultController;\n }());\n Object.defineProperties(TransformStreamDefaultController.prototype, {\n enqueue: { enumerable: true },\n error: { enumerable: true },\n terminate: { enumerable: true },\n desiredSize: { enumerable: true }\n });\n if (typeof SymbolPolyfill.toStringTag === 'symbol') {\n Object.defineProperty(TransformStreamDefaultController.prototype, SymbolPolyfill.toStringTag, {\n value: 'TransformStreamDefaultController',\n configurable: true\n });\n }\n // Transform Stream Default Controller Abstract Operations\n function IsTransformStreamDefaultController(x) {\n if (!typeIsObject(x)) {\n return false;\n }\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledTransformStream')) {\n return false;\n }\n return x instanceof TransformStreamDefaultController;\n }\n function SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm) {\n controller._controlledTransformStream = stream;\n stream._transformStreamController = controller;\n controller._transformAlgorithm = transformAlgorithm;\n controller._flushAlgorithm = flushAlgorithm;\n }\n function SetUpTransformStreamDefaultControllerFromTransformer(stream, transformer) {\n var controller = Object.create(TransformStreamDefaultController.prototype);\n var transformAlgorithm = function (chunk) {\n try {\n TransformStreamDefaultControllerEnqueue(controller, chunk);\n return promiseResolvedWith(undefined);\n }\n catch (transformResultE) {\n return promiseRejectedWith(transformResultE);\n }\n };\n var flushAlgorithm = function () { return promiseResolvedWith(undefined); };\n if (transformer.transform !== undefined) {\n transformAlgorithm = function (chunk) { return transformer.transform(chunk, controller); };\n }\n if (transformer.flush !== undefined) {\n flushAlgorithm = function () { return transformer.flush(controller); };\n }\n SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm);\n }\n function TransformStreamDefaultControllerClearAlgorithms(controller) {\n controller._transformAlgorithm = undefined;\n controller._flushAlgorithm = undefined;\n }\n function TransformStreamDefaultControllerEnqueue(controller, chunk) {\n var stream = controller._controlledTransformStream;\n var readableController = stream._readable._readableStreamController;\n if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(readableController)) {\n throw new TypeError('Readable side is not in a state that permits enqueue');\n }\n // We throttle transform invocations based on the backpressure of the ReadableStream, but we still\n // accept TransformStreamDefaultControllerEnqueue() calls.\n try {\n ReadableStreamDefaultControllerEnqueue(readableController, chunk);\n }\n catch (e) {\n // This happens when readableStrategy.size() throws.\n TransformStreamErrorWritableAndUnblockWrite(stream, e);\n throw stream._readable._storedError;\n }\n var backpressure = ReadableStreamDefaultControllerHasBackpressure(readableController);\n if (backpressure !== stream._backpressure) {\n TransformStreamSetBackpressure(stream, true);\n }\n }\n function TransformStreamDefaultControllerError(controller, e) {\n TransformStreamError(controller._controlledTransformStream, e);\n }\n function TransformStreamDefaultControllerPerformTransform(controller, chunk) {\n var transformPromise = controller._transformAlgorithm(chunk);\n return transformPromiseWith(transformPromise, undefined, function (r) {\n TransformStreamError(controller._controlledTransformStream, r);\n throw r;\n });\n }\n function TransformStreamDefaultControllerTerminate(controller) {\n var stream = controller._controlledTransformStream;\n var readableController = stream._readable._readableStreamController;\n ReadableStreamDefaultControllerClose(readableController);\n var error = new TypeError('TransformStream terminated');\n TransformStreamErrorWritableAndUnblockWrite(stream, error);\n }\n // TransformStreamDefaultSink Algorithms\n function TransformStreamDefaultSinkWriteAlgorithm(stream, chunk) {\n var controller = stream._transformStreamController;\n if (stream._backpressure) {\n var backpressureChangePromise = stream._backpressureChangePromise;\n return transformPromiseWith(backpressureChangePromise, function () {\n var writable = stream._writable;\n var state = writable._state;\n if (state === 'erroring') {\n throw writable._storedError;\n }\n return TransformStreamDefaultControllerPerformTransform(controller, chunk);\n });\n }\n return TransformStreamDefaultControllerPerformTransform(controller, chunk);\n }\n function TransformStreamDefaultSinkAbortAlgorithm(stream, reason) {\n // abort() is not called synchronously, so it is possible for abort() to be called when the stream is already\n // errored.\n TransformStreamError(stream, reason);\n return promiseResolvedWith(undefined);\n }\n function TransformStreamDefaultSinkCloseAlgorithm(stream) {\n // stream._readable cannot change after construction, so caching it across a call to user code is safe.\n var readable = stream._readable;\n var controller = stream._transformStreamController;\n var flushPromise = controller._flushAlgorithm();\n TransformStreamDefaultControllerClearAlgorithms(controller);\n // Return a promise that is fulfilled with undefined on success.\n return transformPromiseWith(flushPromise, function () {\n if (readable._state === 'errored') {\n throw readable._storedError;\n }\n ReadableStreamDefaultControllerClose(readable._readableStreamController);\n }, function (r) {\n TransformStreamError(stream, r);\n throw readable._storedError;\n });\n }\n // TransformStreamDefaultSource Algorithms\n function TransformStreamDefaultSourcePullAlgorithm(stream) {\n // Invariant. Enforced by the promises returned by start() and pull().\n TransformStreamSetBackpressure(stream, false);\n // Prevent the next pull() call until there is backpressure.\n return stream._backpressureChangePromise;\n }\n // Helper functions for the TransformStreamDefaultController.\n function defaultControllerBrandCheckException(name) {\n return new TypeError(\"TransformStreamDefaultController.prototype.\" + name + \" can only be used on a TransformStreamDefaultController\");\n }\n // Helper functions for the TransformStream.\n function streamBrandCheckException(name) {\n return new TypeError(\"TransformStream.prototype.\" + name + \" can only be used on a TransformStream\");\n }\n\n exports.ByteLengthQueuingStrategy = ByteLengthQueuingStrategy;\n exports.CountQueuingStrategy = CountQueuingStrategy;\n exports.ReadableByteStreamController = ReadableByteStreamController;\n exports.ReadableStream = ReadableStream;\n exports.ReadableStreamBYOBReader = ReadableStreamBYOBReader;\n exports.ReadableStreamBYOBRequest = ReadableStreamBYOBRequest;\n exports.ReadableStreamDefaultController = ReadableStreamDefaultController;\n exports.ReadableStreamDefaultReader = ReadableStreamDefaultReader;\n exports.TransformStream = TransformStream;\n exports.TransformStreamDefaultController = TransformStreamDefaultController;\n exports.WritableStream = WritableStream;\n exports.WritableStreamDefaultController = WritableStreamDefaultController;\n exports.WritableStreamDefaultWriter = WritableStreamDefaultWriter;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=ponyfill.js.map\n","const { getFilesFromPath } = require('files-from-path')\nconst { Web3Storage } = require('web3.storage')\n\nasync function addToWeb3 ({ endpoint, token, pathToAdd, name, wrapWithDirectory = false, includeHidden }) {\n const web3 = new Web3Storage({ endpoint, token })\n const files = await getFilesFromPath(pathToAdd, { hidden: includeHidden })\n const cid = await web3.put(files, { name, wrapWithDirectory })\n const url = `https://dweb.link/ipfs/${cid}`\n return { cid, url }\n}\n\nfunction pickName ({ repo, run, sha }) {\n return `${repo.replace('/', '-')}-${run}-${sha.substring(0, 8)}`\n}\n\nmodule.exports.addToWeb3 = addToWeb3\nmodule.exports.pickName = pickName\n","module.exports = require(\"assert\");","module.exports = require(\"buffer\");","module.exports = require(\"constants\");","module.exports = require(\"crypto\");","module.exports = require(\"events\");","module.exports = require(\"fs\");","module.exports = require(\"http\");","module.exports = require(\"https\");","module.exports = require(\"net\");","module.exports = require(\"os\");","module.exports = require(\"path\");","module.exports = require(\"stream\");","module.exports = require(\"stream/web\");","module.exports = require(\"tls\");","module.exports = require(\"url\");","module.exports = require(\"util\");","module.exports = require(\"zlib\");","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar webEncoding = require('web-encoding');\nvar stream = require('@web-std/stream');\n\n/**\n * @implements {globalThis.Blob}\n */\nconst WebBlob = class Blob {\n /**\n * @param {BlobPart[]} [init]\n * @param {BlobPropertyBag} [options]\n */\n constructor(init = [], options = {}) {\n /** @type {Uint8Array[]} */\n const parts = [];\n\n let size = 0;\n for (const part of init) {\n if (typeof part === \"string\") {\n const bytes = new webEncoding.TextEncoder().encode(part);\n parts.push(bytes);\n size += bytes.byteLength;\n } else if (part instanceof WebBlob) {\n size += part.size;\n // @ts-ignore - `_parts` is marked private so TS will complain about\n // accessing it.\n parts.push(...part._parts);\n } else if (part instanceof ArrayBuffer) {\n parts.push(new Uint8Array(part));\n size += part.byteLength;\n } else if (part instanceof Uint8Array) {\n parts.push(part);\n size += part.byteLength;\n } else if (ArrayBuffer.isView(part)) {\n const { buffer, byteOffset, byteLength } = part;\n parts.push(new Uint8Array(buffer, byteOffset, byteLength));\n size += byteLength;\n } else {\n const bytes = new webEncoding.TextEncoder().encode(String(part));\n parts.push(bytes);\n size += bytes.byteLength;\n }\n }\n\n /** @private */\n this._size = size;\n /** @private */\n this._type = readType(options.type);\n /** @private */\n this._parts = parts;\n\n Object.defineProperties(this, {\n _size: { enumerable: false },\n _type: { enumerable: false },\n _parts: { enumerable: false },\n });\n }\n\n /**\n * A string indicating the MIME type of the data contained in the Blob.\n * If the type is unknown, this string is empty.\n * @type {string}\n */\n get type() {\n return this._type\n }\n /**\n * The size, in bytes, of the data contained in the Blob object.\n * @type {number}\n */\n get size() {\n return this._size\n }\n\n /**\n * Returns a new Blob object containing the data in the specified range of\n * bytes of the blob on which it's called.\n * @param {number} [start=0] - An index into the Blob indicating the first\n * byte to include in the new Blob. If you specify a negative value, it's\n * treated as an offset from the end of the Blob toward the beginning. For\n * example, `-10` would be the 10th from last byte in the Blob. The default\n * value is `0`. If you specify a value for start that is larger than the\n * size of the source Blob, the returned Blob has size 0 and contains no\n * data.\n * @param {number} [end] - An index into the `Blob` indicating the first byte\n * that will *not* be included in the new `Blob` (i.e. the byte exactly at\n * this index is not included). If you specify a negative value, it's treated\n * as an offset from the end of the Blob toward the beginning. For example,\n * `-10` would be the 10th from last byte in the `Blob`. The default value is\n * size.\n * @param {string} [type] - The content type to assign to the new Blob;\n * this will be the value of its type property. The default value is an empty\n * string.\n * @returns {Blob}\n */\n slice(start = 0, end = this.size, type = \"\") {\n const { size, _parts } = this;\n let offset = start < 0 ? Math.max(size + start, 0) : Math.min(start, size);\n\n let limit = end < 0 ? Math.max(size + end, 0) : Math.min(end, size);\n const span = Math.max(limit - offset, 0);\n const blob = new Blob([], { type });\n\n if (span === 0) {\n return blob\n }\n\n let blobSize = 0;\n const blobParts = [];\n for (const part of _parts) {\n const { byteLength } = part;\n if (offset > 0 && byteLength <= offset) {\n offset -= byteLength;\n limit -= byteLength;\n } else {\n const chunk = part.subarray(offset, Math.min(byteLength, limit));\n blobParts.push(chunk);\n blobSize += chunk.byteLength;\n // no longer need to take that into account\n offset = 0;\n\n // don't add the overflow to new blobParts\n if (blobSize >= span) {\n break\n }\n }\n }\n\n blob._parts = blobParts;\n blob._size = blobSize;\n\n return blob\n }\n\n /**\n * Returns a promise that resolves with an ArrayBuffer containing the entire\n * contents of the Blob as binary data.\n * @returns {Promise}\n */\n // eslint-disable-next-line require-await\n async arrayBuffer() {\n const buffer = new ArrayBuffer(this.size);\n const bytes = new Uint8Array(buffer);\n let offset = 0;\n for (const part of this._parts) {\n bytes.set(part, offset);\n offset += part.byteLength;\n }\n return buffer\n }\n\n /**\n * Returns a promise that resolves with a USVString containing the entire\n * contents of the Blob interpreted as UTF-8 text.\n * @returns {Promise}\n */\n // eslint-disable-next-line require-await\n async text() {\n const decoder = new webEncoding.TextDecoder();\n let text = \"\";\n for (const part of this._parts) {\n text += decoder.decode(part);\n }\n return text\n }\n\n /**\n * @returns {BlobStream}\n */\n stream() {\n return new BlobStream(this._parts)\n }\n\n /**\n * @returns {string}\n */\n toString() {\n return \"[object Blob]\"\n }\n\n get [Symbol.toStringTag]() {\n return \"Blob\"\n }\n};\n\n// Marking export as a DOM File object instead of custom class.\n/** @type {typeof globalThis.Blob} */\nconst Blob = WebBlob;\n\n/**\n * Blob stream is a `ReadableStream` extension optimized to have minimal\n * overhead when consumed as `AsyncIterable`.\n * @extends {ReadableStream}\n * @implements {AsyncIterable}\n */\nclass BlobStream extends stream.ReadableStream {\n /**\n * @param {Uint8Array[]} chunks\n */\n constructor(chunks) {\n // @ts-ignore\n super(new BlobStreamController(chunks.values()), { type: \"bytes\" });\n /** @private */\n this._chunks = chunks;\n }\n\n /**\n * @param {Object} [_options]\n * @property {boolean} [_options.preventCancel]\n * @returns {AsyncIterator}\n */\n async *[Symbol.asyncIterator](_options) {\n const reader = this.getReader();\n yield* this._chunks;\n reader.releaseLock();\n }\n}\n\nclass BlobStreamController {\n /**\n * @param {Iterator} chunks\n */\n constructor(chunks) {\n this.chunks = chunks;\n }\n\n /**\n * @param {ReadableStreamDefaultController} controller\n */\n start(controller) {\n this.work(controller);\n this.isWorking = false;\n this.isCancelled = false;\n }\n /**\n *\n * @param {ReadableStreamDefaultController} controller\n */\n async work(controller) {\n const { chunks } = this;\n\n this.isWorking = true;\n while (!this.isCancelled && (controller.desiredSize || 0) > 0) {\n let next = null;\n try {\n next = chunks.next();\n } catch (error) {\n controller.error(error);\n break\n }\n\n if (next) {\n if (!next.done && !this.isCancelled) {\n controller.enqueue(next.value);\n } else {\n controller.close();\n }\n }\n }\n\n this.isWorking = false;\n }\n\n /**\n * @param {ReadableStreamDefaultController} controller\n */\n pull(controller) {\n if (!this.isWorking) {\n this.work(controller);\n }\n }\n cancel() {\n this.isCancelled = true;\n }\n}\n\n/**\n * @param {string} [input]\n * @returns {string}\n */\nconst readType = (input = \"\") => {\n const type = String(input).toLowerCase();\n return /[^\\u0020-\\u007E]/.test(type) ? \"\" : type\n};\n\nObject.defineProperty(exports, 'TextDecoder', {\n enumerable: true,\n get: function () {\n return webEncoding.TextDecoder;\n }\n});\nObject.defineProperty(exports, 'TextEncoder', {\n enumerable: true,\n get: function () {\n return webEncoding.TextEncoder;\n }\n});\nObject.defineProperty(exports, 'ReadableStream', {\n enumerable: true,\n get: function () {\n return stream.ReadableStream;\n }\n});\nexports.Blob = Blob;\n//# sourceMappingURL=blob.cjs.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar webEncoding = require('web-encoding');\nvar stream = require('@web-std/stream');\nvar blob = require('./blob.cjs');\n\n/** @type {typeof globalThis.Blob} */\n// Our first choise is to use global `Blob` because it may be available e.g. in\n// electron renderrer process. If not available fall back to node native\n// implementation, if also not available use our implementation.\nconst Blob =\n globalThis.Blob || \n // Disable node native blob until impractical perf issue is fixed\n // @see https://github.com/nodejs/node/issues/42108\n // NodeBlob ||\n blob.Blob;\n\nObject.defineProperty(exports, 'TextDecoder', {\n enumerable: true,\n get: function () {\n return webEncoding.TextDecoder;\n }\n});\nObject.defineProperty(exports, 'TextEncoder', {\n enumerable: true,\n get: function () {\n return webEncoding.TextEncoder;\n }\n});\nObject.defineProperty(exports, 'ReadableStream', {\n enumerable: true,\n get: function () {\n return stream.ReadableStream;\n }\n});\nexports.Blob = Blob;\n//# sourceMappingURL=lib.node.cjs.map\n","'use strict';\n\nexports = module.exports = fetch;\n\nconst http = require('http');\nconst https = require('https');\nconst zlib = require('zlib');\nconst dataUriToBuffer = require('data-uri-to-buffer');\nconst Stream = require('stream');\nconst util = require('util');\nconst blob = require('@web-std/blob');\nconst formData = require('@web-std/form-data');\nconst crypto = require('crypto');\nconst multipartParser = require('@web3-storage/multipart-parser');\nconst url = require('url');\n\nclass FetchBaseError extends Error {\n\t/**\n\t * @param {string} message \n\t * @param {string} type \n\t */\n\tconstructor(message, type) {\n\t\tsuper(message);\n\t\t// Hide custom error implementation details from end-users\n\t\tError.captureStackTrace(this, this.constructor);\n\n\t\tthis.type = type;\n\t}\n\n\tget name() {\n\t\treturn this.constructor.name;\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn this.constructor.name;\n\t}\n}\n\n/**\n * @typedef {{\n * address?: string\n * code: string\n * dest?: string\n * errno: number\n * info?: object\n * message: string\n * path?: string\n * port?: number\n * syscall: string\n * }} SystemError\n*/\n\n/**\n * FetchError interface for operational errors\n */\nclass FetchError extends FetchBaseError {\n\t/**\n\t * @param {string} message - Error message for human\n\t * @param {string} type - Error type for machine\n\t * @param {SystemError} [systemError] - For Node.js system error\n\t */\n\tconstructor(message, type, systemError) {\n\t\tsuper(message, type);\n\t\t// When err.type is `system`, err.erroredSysCall contains system error and err.code contains system error code\n\t\tif (systemError) {\n\t\t\t// eslint-disable-next-line no-multi-assign\n\t\t\tthis.code = this.errno = systemError.code;\n\t\t\tthis.erroredSysCall = systemError.syscall;\n\t\t}\n\t}\n}\n\n/**\n * Is.js\n *\n * Object type checks.\n */\n\nconst NAME = Symbol.toStringTag;\n\n/**\n * Check if `obj` is a URLSearchParams object\n * ref: https://github.com/node-fetch/node-fetch/issues/296#issuecomment-307598143\n *\n * @param {any} object\n * @return {obj is URLSearchParams}\n */\nconst isURLSearchParameters = (object) => {\n\treturn (\n\t\ttypeof object === \"object\" &&\n\t\ttypeof object.append === \"function\" &&\n\t\ttypeof object.delete === \"function\" &&\n\t\ttypeof object.get === \"function\" &&\n\t\ttypeof object.getAll === \"function\" &&\n\t\ttypeof object.has === \"function\" &&\n\t\ttypeof object.set === \"function\" &&\n\t\ttypeof object.sort === \"function\" &&\n\t\tobject[NAME] === \"URLSearchParams\"\n\t);\n};\n\n/**\n * Check if `object` is a W3C `Blob` object (which `File` inherits from)\n *\n * @param {*} object\n * @return {object is Blob}\n */\nconst isBlob = (object) => {\n\treturn (\n\t\ttypeof object === \"object\" &&\n\t\ttypeof object.arrayBuffer === \"function\" &&\n\t\ttypeof object.type === \"string\" &&\n\t\ttypeof object.stream === \"function\" &&\n\t\ttypeof object.constructor === \"function\" &&\n\t\t/^(Blob|File)$/.test(object[NAME])\n\t);\n};\n\n/**\n * Check if `obj` is a spec-compliant `FormData` object\n *\n * @param {*} object\n * @return {object is FormData}\n */\nfunction isFormData(object) {\n\treturn (\n\t\ttypeof object === \"object\" &&\n\t\ttypeof object.append === \"function\" &&\n\t\ttypeof object.set === \"function\" &&\n\t\ttypeof object.get === \"function\" &&\n\t\ttypeof object.getAll === \"function\" &&\n\t\ttypeof object.delete === \"function\" &&\n\t\ttypeof object.keys === \"function\" &&\n\t\ttypeof object.values === \"function\" &&\n\t\ttypeof object.entries === \"function\" &&\n\t\ttypeof object.constructor === \"function\" &&\n\t\tobject[NAME] === \"FormData\"\n\t);\n}\n\n/**\n * Detect form data input from form-data module\n *\n * @param {any} value\n * @returns {value is Stream & {getBoundary():string, hasKnownLength():boolean, getLengthSync():number|null}}\n */\nconst isMultipartFormDataStream = (value) => {\n\treturn (\n\t\tvalue instanceof Stream === true &&\n\t\ttypeof value.getBoundary === \"function\" &&\n\t\ttypeof value.hasKnownLength === \"function\" &&\n\t\ttypeof value.getLengthSync === \"function\"\n\t);\n};\n\n/**\n * Check if `obj` is an instance of AbortSignal.\n *\n * @param {any} object\n * @return {obj is AbortSignal}\n */\nconst isAbortSignal = (object) => {\n\treturn (\n\t\ttypeof object === \"object\" &&\n\t\t(object[NAME] === \"AbortSignal\" || object[NAME] === \"EventTarget\")\n\t);\n};\n\n/**\n * Check if `value` is a ReadableStream.\n *\n * @param {*} value\n * @returns {value is ReadableStream}\n */\nconst isReadableStream = (value) => {\n\treturn (\n\t\ttypeof value === \"object\" &&\n\t\ttypeof value.getReader === \"function\" &&\n\t\ttypeof value.cancel === \"function\" &&\n\t\ttypeof value.tee === \"function\"\n\t);\n};\n\n/**\n *\n * @param {any} value\n * @returns {value is Iterable}\n */\nconst isIterable = (value) => value && Symbol.iterator in value;\n\nconst carriage = '\\r\\n';\nconst dashes = '-'.repeat(2);\nconst carriageLength = Buffer.byteLength(carriage);\n\n/**\n * @param {string} boundary\n */\nconst getFooter = boundary => `${dashes}${boundary}${dashes}${carriage.repeat(2)}`;\n\n/**\n * @param {string} boundary\n * @param {string} name\n * @param {*} field\n *\n * @return {string}\n */\nfunction getHeader(boundary, name, field) {\n\tlet header = '';\n\n\theader += `${dashes}${boundary}${carriage}`;\n\theader += `Content-Disposition: form-data; name=\"${name}\"`;\n\n\tif (isBlob(field)) {\n\t\tconst { name = 'blob', type } = /** @type {Blob & {name?:string}} */ (field);\n\t\theader += `; filename=\"${name}\"${carriage}`;\n\t\theader += `Content-Type: ${type || 'application/octet-stream'}`;\n\t}\n\n\treturn `${header}${carriage.repeat(2)}`;\n}\n\n/**\n * @return {string}\n */\nconst getBoundary = () => crypto.randomBytes(8).toString('hex');\n\n/**\n * @param {FormData} form\n * @param {string} boundary\n */\nasync function * formDataIterator(form, boundary) {\n\tfor (const [name, value] of form) {\n\t\tyield getHeader(boundary, name, value);\n\n\t\tif (isBlob(value)) {\n\t\t\t// @ts-ignore - we know our streams implement aysnc iteration\n\t\t\tyield * value.stream();\n\t\t} else {\n\t\t\tyield value;\n\t\t}\n\n\t\tyield carriage;\n\t}\n\n\tyield getFooter(boundary);\n}\n\n/**\n * @param {FormData} form\n * @param {string} boundary\n */\nfunction getFormDataLength(form, boundary) {\n\tlet length = 0;\n\n\tfor (const [name, value] of form) {\n\t\tlength += Buffer.byteLength(getHeader(boundary, name, value));\n\n\t\tif (isBlob(value)) {\n\t\t\tlength += value.size;\n\t\t} else {\n\t\t\tlength += Buffer.byteLength(String(value));\n\t\t}\n\n\t\tlength += carriageLength;\n\t}\n\n\tlength += Buffer.byteLength(getFooter(boundary));\n\n\treturn length;\n}\n\n/**\n * @param {Body & {headers?:Headers}} source\n */\nconst toFormData = async ({ body, headers }) => {\n const contentType = headers?.get('Content-Type') || '';\n const [type, boundary] = contentType.split(/\\s*;\\s*boundary=/);\n if (type === 'multipart/form-data' && boundary != null && body != null) {\n const form = new FormData();\n const parts = multipartParser.iterateMultipart(body, boundary);\n for await (const { name, data, filename, contentType } of parts) {\n if (filename) {\n form.append(name, new File([data], filename, { type: contentType }));\n } else {\n form.append(name, new TextDecoder().decode(data), filename);\n }\n }\n return form\n } else {\n throw new TypeError('Could not parse content as FormData.')\n }\n};\n\nconst encoder = new util.TextEncoder();\nconst decoder = new util.TextDecoder();\n\n/**\n * @param {string} text\n */\nconst encode = text => encoder.encode(text);\n\n/**\n * @param {Uint8Array} bytes\n */\nconst decode = bytes => decoder.decode(bytes);\n\n// @ts-check\nconst {readableHighWaterMark} = new Stream.Readable();\n\nconst INTERNALS$2 = Symbol('Body internals');\n\n/**\n * Body mixin\n *\n * Ref: https://fetch.spec.whatwg.org/#body\n * @implements {globalThis.Body}\n */\n\nclass Body {\n\t/**\n\t * @param {BodyInit|Stream|null} body\n\t * @param {{size?:number}} options\n\t */\n\tconstructor(body, {\n\t\tsize = 0\n\t} = {}) {\n\t\tconst state = {\n\t\t\t/** @type {null|ReadableStream} */\n\t\t\tbody: null,\n\t\t\t/** @type {string|null} */\n\t\t\ttype: null,\n\t\t\t/** @type {number|null} */\n\t\t\tsize: null,\n\t\t\t/** @type {null|string} */\n\t\t\tboundary: null,\n\t\t\tdisturbed: false,\n\t\t\t/** @type {null|Error} */\n\t\t\terror: null\n\t\t};\n\t\t/** @private */\n\t\tthis[INTERNALS$2] = state;\n\n\t\tif (body === null) {\n\t\t\t// Body is undefined or null\n\t\t\tstate.body = null;\n\t\t\tstate.size = 0;\n\t\t} else if (isURLSearchParameters(body)) {\n\t\t// Body is a URLSearchParams\n\t\t\tconst bytes = encode(body.toString());\n\t\t\tstate.body = fromBytes(bytes);\n\t\t\tstate.size = bytes.byteLength;\n\t\t\tstate.type = 'application/x-www-form-urlencoded;charset=UTF-8';\n\t\t} else if (isBlob(body)) {\n\t\t\t// Body is blob\n\t\t\tstate.size = body.size;\n\t\t\tstate.type = body.type || null;\n\t\t\tstate.body = body.stream();\n\t\t} else if (body instanceof Uint8Array) {\n\t\t\t// Body is Buffer\n\t\t\tstate.body = fromBytes(body);\n\t\t\tstate.size = body.byteLength;\n\t\t} else if (util.types.isAnyArrayBuffer(body)) {\n\t\t\t// Body is ArrayBuffer\n\t\t\tconst bytes = new Uint8Array(body);\n\t\t\tstate.body = fromBytes(bytes);\n\t\t\tstate.size = bytes.byteLength;\n\t\t} else if (ArrayBuffer.isView(body)) {\n\t\t\t// Body is ArrayBufferView\n\t\t\tconst bytes = new Uint8Array(body.buffer, body.byteOffset, body.byteLength);\n\t\t\tstate.body = fromBytes(bytes);\n\t\t\tstate.size = bytes.byteLength;\n\t\t} else if (isReadableStream(body)) {\n\t\t\t// Body is stream\n\t\t\tstate.body = body;\n\t\t} else if (isFormData(body)) {\n\t\t\t// Body is an instance of formdata-node\n\t\t\tconst boundary = `NodeFetchFormDataBoundary${getBoundary()}`;\n\t\t\tstate.type = `multipart/form-data; boundary=${boundary}`;\n\t\t\tstate.size = getFormDataLength(body, boundary);\n\t\t\tstate.body = fromAsyncIterable(formDataIterator(body, boundary));\n\t\t} else if (isMultipartFormDataStream(body)) {\n\t\t\tstate.type = `multipart/form-data; boundary=${body.getBoundary()}`;\n\t\t\tstate.size = body.hasKnownLength() ? body.getLengthSync() : null;\n\t\t\tstate.body = fromStream(body);\n\t\t} else if (body instanceof Stream) {\n\t\t\tstate.body = fromStream(body);\n\t\t} else {\n\t\t\t// None of the above\n\t\t\t// coerce to string then buffer\n\t\t\tconst bytes = encode(String(body));\n\t\t\tstate.type = 'text/plain;charset=UTF-8';\n\t\t\tstate.size = bytes.byteLength;\n\t\t\tstate.body = fromBytes(bytes);\n\t\t}\n\n\t\tthis.size = size;\n\n\t\t// if (body instanceof Stream) {\n\t\t// \tbody.on('error', err => {\n\t\t// \t\tconst error = err instanceof FetchBaseError ?\n\t\t// \t\t\terr :\n\t\t// \t\t\tnew FetchError(`Invalid response body while trying to fetch ${this.url}: ${err.message}`, 'system', err);\n\t\t// \t\tthis[INTERNALS].error = error;\n\t\t// \t});\n\t\t// }\n\t}\n\n\t/** @type {Headers} */\n\t/* c8 ignore next 3 */\n\tget headers() {\n\t\tthrow new TypeError(`'get headers' called on an object that does not implements interface.`)\n\t}\n\n\tget body() {\n\t\treturn this[INTERNALS$2].body;\n\t}\n\n\tget bodyUsed() {\n\t\treturn this[INTERNALS$2].disturbed;\n\t}\n\n\t/**\n\t * Decode response as ArrayBuffer\n\t *\n\t * @return {Promise}\n\t */\n\tasync arrayBuffer() {\n\t\tconst {buffer, byteOffset, byteLength} = await consumeBody(this);\n\t\treturn buffer.slice(byteOffset, byteOffset + byteLength);\n\t}\n\n\t/**\n\t * Return raw response as Blob\n\t *\n\t * @return Promise\n\t */\n\tasync blob() {\n\t\tconst ct = (this.headers && this.headers.get('content-type')) || (this[INTERNALS$2].body && this[INTERNALS$2].type) || '';\n\t\tconst buf = await consumeBody(this);\n\n\t\treturn new blob.Blob([buf], {\n\t\t\ttype: ct\n\t\t});\n\t}\n\n\t/**\n\t * Decode response as json\n\t *\n\t * @return Promise\n\t */\n\tasync json() {\n\t\treturn JSON.parse(await this.text());\n\t}\n\n\t/**\n\t * Decode response as text\n\t *\n\t * @return Promise\n\t */\n\tasync text() {\n\t\tconst buffer = await consumeBody(this);\n\t\treturn decode(buffer);\n\t}\n\n\t/**\n\t * @returns {Promise}\n\t */\n\n\tasync formData() {\n\t\treturn toFormData(this)\n\t}\n}\n\n// In browsers, all properties are enumerable.\nObject.defineProperties(Body.prototype, {\n\tbody: {enumerable: true},\n\tbodyUsed: {enumerable: true},\n\tarrayBuffer: {enumerable: true},\n\tblob: {enumerable: true},\n\tjson: {enumerable: true},\n\ttext: {enumerable: true},\n\tformData: {enumerable: true}\n});\n\n/**\n * Consume and convert an entire Body to a Buffer.\n *\n * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body\n *\n * @param {Body & {url?:string}} data\n * @return {Promise}\n */\nasync function consumeBody(data) {\n\tconst state = data[INTERNALS$2];\n\tif (state.disturbed) {\n\t\tthrow new TypeError(`body used already for: ${data.url}`);\n\t}\n\n\tstate.disturbed = true;\n\n\tif (state.error) {\n\t\tthrow state.error;\n\t}\n\n\tconst {body} = state;\n\n\t// Body is null\n\tif (body === null) {\n\t\treturn new Uint8Array(0);\n\t}\n\n\t// Body is stream\n\t// get ready to actually consume the body\n\t/** @type {[Uint8Array|null, Uint8Array[], number]} */\n\tconst [buffer, chunks, limit] = data.size > 0 ?\n\t\t[new Uint8Array(data.size), [], data.size] :\n\t\t[null, [], Infinity];\n\tlet offset = 0;\n\n\tconst source = streamIterator(body);\n\ttry {\n\t\tfor await (const chunk of source) {\n\t\t\tconst bytes = chunk instanceof Uint8Array ?\n\t\t\t\tchunk :\n\t\t\t\tBuffer.from(chunk);\n\n\t\t\tif (offset + bytes.byteLength > limit) {\n\t\t\t\tconst error = new FetchError(`content size at ${data.url} over limit: ${limit}`, 'max-size');\n\t\t\t\tsource.throw(error);\n\t\t\t\tthrow error;\n\t\t\t} else if (buffer) {\n\t\t\t\tbuffer.set(bytes, offset);\n\t\t\t} else {\n\t\t\t\tchunks.push(bytes);\n\t\t\t}\n\n\t\t\toffset += bytes.byteLength;\n\t\t}\n\n\t\tif (buffer) {\n\t\t\tif (offset < buffer.byteLength) {\n\t\t\t\tthrow new FetchError(`Premature close of server response while trying to fetch ${data.url}`, 'premature-close');\n\t\t\t} else {\n\t\t\t\treturn buffer;\n\t\t\t}\n\t\t} else {\n\t\t\treturn writeBytes(new Uint8Array(offset), chunks);\n\t\t}\n\t} catch (error) {\n\t\tif (error instanceof FetchBaseError) {\n\t\t\tthrow error;\n\t\t// @ts-expect-error - we know it will have a name\n\t\t} else if (error && error.name === 'AbortError') {\n\t\t\tthrow error;\n\t\t} else {\n\t\t\tconst e = /** @type {import('./errors/fetch-error').SystemError} */(error);\n\t\t\t// Other errors, such as incorrect content-encoding\n\t\t\tthrow new FetchError(`Invalid response body while trying to fetch ${data.url}: ${e.message}`, 'system', e);\n\t\t}\n\t}\n}\n\n/**\n * Clone body given Res/Req instance\n *\n * @param {Body} instance Response or Request instance\n * @return {ReadableStream}\n */\nconst clone = instance => {\n\tconst {body} = instance;\n\n\t// Don't allow cloning a used body\n\tif (instance.bodyUsed) {\n\t\tthrow new Error('cannot clone body after it is used');\n\t}\n\n\t// @ts-expect-error - could be null\n\tconst [left, right] = body.tee();\n\tinstance[INTERNALS$2].body = left;\n\treturn right;\n};\n\n/**\n * Performs the operation \"extract a `Content-Type` value from |object|\" as\n * specified in the specification:\n * https://fetch.spec.whatwg.org/#concept-bodyinit-extract\n *\n * This function assumes that instance.body is present.\n *\n * @param {Body} source Any options.body input\n * @returns {string | null}\n */\nconst extractContentType = source => source[INTERNALS$2].type;\n\n/**\n * The Fetch Standard treats this as if \"total bytes\" is a property on the body.\n * For us, we have to explicitly get it with a function.\n *\n * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes\n *\n * @param {Body} source - Body object from the Body instance.\n * @returns {number | null}\n */\nconst getTotalBytes = source => source[INTERNALS$2].size;\n\n/**\n * Write a Body to a Node.js WritableStream (e.g. http.Request) object.\n *\n * @param {Stream.Writable} dest - The stream to write to.\n * @param {Body} source - Body object from the Body instance.\n * @returns {void}\n */\nconst writeToStream = (dest, {body}) => {\n\tif (body === null) {\n\t\t// Body is null\n\t\tdest.end();\n\t} else {\n\t\tStream.Readable.from(streamIterator(body)).pipe(dest);\n\t}\n};\n\n/**\n * @template T\n * @implements {AsyncGenerator}\n */\nclass StreamIterableIterator {\n\t/**\n\t * @param {ReadableStream} stream\n\t */\n\tconstructor(stream) {\n\t\tthis.stream = stream;\n\t\tthis.reader = null;\n\t}\n\n\t/**\n\t * @returns {AsyncGenerator}\n\t */\n\t[Symbol.asyncIterator]() {\n\t\treturn this;\n\t}\n\n\tgetReader() {\n\t\tif (this.reader) {\n\t\t\treturn this.reader;\n\t\t}\n\n\t\tconst reader = this.stream.getReader();\n\t\tthis.reader = reader;\n\t\treturn reader;\n\t}\n\n\t/**\n\t * @returns {Promise>}\n\t */\n\tnext() {\n\t\treturn /** @type {Promise>} */ (this.getReader().read());\n\t}\n\n\t/**\n\t * @returns {Promise>}\n\t */\n\tasync return() {\n\t\tif (this.reader) {\n\t\t\tawait this.reader.cancel();\n\t\t}\n\n\t\treturn {done: true, value: undefined};\n\t}\n\n\t/**\n\t * \n\t * @param {any} error \n\t * @returns {Promise>}\n\t */\n\tasync throw(error) {\n\t\tawait this.getReader().cancel(error);\n\t\treturn {done: true, value: undefined};\n\t}\n}\n\n/**\n * @template T\n * @param {ReadableStream} stream\n */\nconst streamIterator = stream => new StreamIterableIterator(stream);\n\n/**\n * @param {Uint8Array} buffer\n * @param {Uint8Array[]} chunks\n */\nconst writeBytes = (buffer, chunks) => {\n\tlet offset = 0;\n\tfor (const chunk of chunks) {\n\t\tbuffer.set(chunk, offset);\n\t\toffset += chunk.byteLength;\n\t}\n\n\treturn buffer;\n};\n\n/**\n * @param {Uint8Array} bytes\n * @returns {ReadableStream}\n */\n// @ts-ignore\nconst fromBytes = bytes => new blob.ReadableStream({\n\tstart(controller) {\n\t\tcontroller.enqueue(bytes);\n\t\tcontroller.close();\n\t}\n});\n\n/**\n * @param {AsyncIterable} content\n * @returns {ReadableStream}\n */\nconst fromAsyncIterable = content =>\n\t// @ts-ignore\n\tnew blob.ReadableStream(new AsyncIterablePump(content));\n\n/**\n * @implements {UnderlyingSource}\n */\nclass AsyncIterablePump {\n\t/**\n\t * @param {AsyncIterable} source\n\t */\n\tconstructor(source) {\n\t\tthis.source = source[Symbol.asyncIterator]();\n\t}\n\n\t/**\n\t * @param {ReadableStreamController} controller\n\t */\n\tasync pull(controller) {\n\t\ttry {\n\t\t\twhile (controller.desiredSize || 0 > 0) {\n\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\tconst next = await this.source.next();\n\t\t\t\tif (next.done) {\n\t\t\t\t\tcontroller.close();\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tcontroller.enqueue(next.value);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tcontroller.error(error);\n\t\t}\n\t}\n\n\t/**\n\t * @param {any} [reason]\n\t */\n\tcancel(reason) {\n\t\tif (reason) {\n\t\t\tif (typeof this.source.throw === 'function') {\n\t\t\t\tthis.source.throw(reason);\n\t\t\t} else if (typeof this.source.return === 'function') {\n\t\t\t\tthis.source.return();\n\t\t\t}\n\t\t} else if (typeof this.source.return === 'function') {\n\t\t\tthis.source.return();\n\t\t}\n\t}\n}\n\n/**\n * @param {Stream & {readableHighWaterMark?:number}} source\n * @returns {ReadableStream}\n */\nconst fromStream = source => {\n\tconst pump = new StreamPump(source);\n\tconst stream = new blob.ReadableStream(pump, pump);\n\treturn stream;\n};\n\n/**\n * @implements {UnderlyingSource}\n * @implements {QueuingStrategy}\n */\nclass StreamPump {\n\t/**\n\t * @param {Stream & {\n\t * \treadableHighWaterMark?: number\n\t * \treadable?:boolean,\n\t * \tresume?: () => void,\n\t * \tpause?: () => void\n\t * \tdestroy?: (error?:Error) => void\n\t * }} stream\n\t */\n\tconstructor(stream) {\n\t\tthis.highWaterMark = stream.readableHighWaterMark || readableHighWaterMark;\n\t\tthis.accumalatedSize = 0;\n\t\tthis.stream = stream;\n\t\tthis.enqueue = this.enqueue.bind(this);\n\t\tthis.error = this.error.bind(this);\n\t\tthis.close = this.close.bind(this);\n\t}\n\n\t/**\n\t * @param {Uint8Array} [chunk]\n\t */\n\tsize(chunk) {\n\t\treturn chunk?.byteLength || 0;\n\t}\n\n\t/**\n\t * @param {ReadableStreamController} controller\n\t */\n\tstart(controller) {\n\t\tthis.controller = controller;\n\t\tthis.stream.on('data', this.enqueue);\n\t\tthis.stream.once('error', this.error);\n\t\tthis.stream.once('end', this.close);\n\t\tthis.stream.once('close', this.close);\n\t}\n\n\tpull() {\n\t\tthis.resume();\n\t}\n\n\t/**\n\t * @param {any} [reason]\n\t */\n\tcancel(reason) {\n\t\tif (this.stream.destroy) {\n\t\t\tthis.stream.destroy(reason);\n\t\t}\n\n\t\tthis.stream.off('data', this.enqueue);\n\t\tthis.stream.off('error', this.error);\n\t\tthis.stream.off('end', this.close);\n\t\tthis.stream.off('close', this.close);\n\t}\n\n\t/**\n\t * @param {Uint8Array|string} chunk\n\t */\n\tenqueue(chunk) {\n\t\tif (this.controller) {\n\t\t\ttry {\n\t\t\t\tconst bytes = chunk instanceof Uint8Array ?\n\t\t\t\t\tchunk :\n\t\t\t\t\tBuffer.from(chunk);\n\n\t\t\t\tconst available = (this.controller.desiredSize || 0) - bytes.byteLength;\n\t\t\t\tthis.controller.enqueue(bytes);\n\t\t\t\tif (available <= 0) {\n\t\t\t\t\tthis.pause();\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\tthis.controller.error(new Error('Could not create Buffer, chunk must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object'));\n\t\t\t\tthis.cancel();\n\t\t\t}\n\t\t}\n\t}\n\n\tpause() {\n\t\tif (this.stream.pause) {\n\t\t\tthis.stream.pause();\n\t\t}\n\t}\n\n\tresume() {\n\t\tif (this.stream.readable && this.stream.resume) {\n\t\t\tthis.stream.resume();\n\t\t}\n\t}\n\n\tclose() {\n\t\tif (this.controller) {\n\t\t\tthis.controller.close();\n\t\t\tdelete this.controller;\n\t\t}\n\t}\n\n\t/**\n\t * @param {Error} error \n\t */\n\terror(error) {\n\t\tif (this.controller) {\n\t\t\tthis.controller.error(error);\n\t\t\tdelete this.controller;\n\t\t}\n\t}\n}\n\n/**\n * Headers.js\n *\n * Headers class offers convenient helpers\n */\n\nconst validators = /** @type {{validateHeaderName?:(name:string) => any, validateHeaderValue?:(name:string, value:string) => any}} */\n(http);\n\nconst validateHeaderName = typeof validators.validateHeaderName === 'function' ?\n\tvalidators.validateHeaderName :\n\t/**\n\t * @param {string} name \n\t */\n\tname => {\n\t\tif (!/^[\\^`\\-\\w!#$%&'*+.|~]+$/.test(name)) {\n\t\t\tconst err = new TypeError(`Header name must be a valid HTTP token [${name}]`);\n\t\t\tObject.defineProperty(err, 'code', {value: 'ERR_INVALID_HTTP_TOKEN'});\n\t\t\tthrow err;\n\t\t}\n\t};\n\nconst validateHeaderValue = typeof validators.validateHeaderValue === 'function' ?\n\tvalidators.validateHeaderValue :\n\t/**\n\t * @param {string} name \n\t * @param {string} value \n\t */\n\t(name, value) => {\n\t\tif (/[^\\t\\u0020-\\u007E\\u0080-\\u00FF]/.test(value)) {\n\t\t\tconst err = new TypeError(`Invalid character in header content [\"${name}\"]`);\n\t\t\tObject.defineProperty(err, 'code', {value: 'ERR_INVALID_CHAR'});\n\t\t\tthrow err;\n\t\t}\n\t};\n\n/**\n * @typedef {Headers | Record | Iterable | Iterable>} HeadersInit\n */\n\n/**\n * This Fetch API interface allows you to perform various actions on HTTP request and response headers.\n * These actions include retrieving, setting, adding to, and removing.\n * A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs.\n * You can add to this using methods like append() (see Examples.)\n * In all methods of this interface, header names are matched by case-insensitive byte sequence.\n *\n * @implements {globalThis.Headers}\n */\nclass Headers extends URLSearchParams {\n\t/**\n\t * Headers class\n\t *\n\t * @constructor\n\t * @param {HeadersInit} [init] - Response headers\n\t */\n\tconstructor(init) {\n\t\t// Validate and normalize init object in [name, value(s)][]\n\t\t/** @type {string[][]} */\n\t\tlet result = [];\n\t\tif (init instanceof Headers) {\n\t\t\tconst raw = init.raw();\n\t\t\tfor (const [name, values] of Object.entries(raw)) {\n\t\t\t\tresult.push(...values.map(value => [name, value]));\n\t\t\t}\n\t\t} else if (init == null) ; else if (isIterable(init)) {\n\t\t\t// Sequence>\n\t\t\t// Note: per spec we have to first exhaust the lists then process them\n\t\t\tresult = [...init]\n\t\t\t\t.map(pair => {\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeof pair !== 'object' || util.types.isBoxedPrimitive(pair)\n\t\t\t\t\t) {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be an iterable object');\n\t\t\t\t\t}\n\n\t\t\t\t\treturn [...pair];\n\t\t\t\t}).map(pair => {\n\t\t\t\t\tif (pair.length !== 2) {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be a name/value tuple');\n\t\t\t\t\t}\n\n\t\t\t\t\treturn [...pair];\n\t\t\t\t});\n\t\t} else if (typeof init === \"object\" && init !== null) {\n\t\t\t// Record\n\t\t\tresult.push(...Object.entries(init));\n\t\t} else {\n\t\t\tthrow new TypeError('Failed to construct \\'Headers\\': The provided value is not of type \\'(sequence> or record)');\n\t\t}\n\n\t\t// Validate and lowercase\n\t\tresult =\n\t\t\tresult.length > 0 ?\n\t\t\t\tresult.map(([name, value]) => {\n\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\tvalidateHeaderValue(name, String(value));\n\t\t\t\t\treturn [String(name).toLowerCase(), String(value)];\n\t\t\t\t}) :\n\t\t\t\t[];\n\n\t\tsuper(result);\n\n\t\t// Returning a Proxy that will lowercase key names, validate parameters and sort keys\n\t\t// eslint-disable-next-line no-constructor-return\n\t\treturn new Proxy(this, {\n\t\t\tget(target, p, receiver) {\n\t\t\t\tswitch (p) {\n\t\t\t\t\tcase 'append':\n\t\t\t\t\tcase 'set':\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * @param {string} name\n\t\t\t\t\t\t * @param {string} value\n\t\t\t\t\t\t */\n\t\t\t\t\t\treturn (name, value) => {\n\t\t\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\t\t\tvalidateHeaderValue(name, String(value));\n\t\t\t\t\t\t\treturn URLSearchParams.prototype[p].call(\n\t\t\t\t\t\t\t\treceiver,\n\t\t\t\t\t\t\t\tString(name).toLowerCase(),\n\t\t\t\t\t\t\t\tString(value)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t};\n\n\t\t\t\t\tcase 'delete':\n\t\t\t\t\tcase 'has':\n\t\t\t\t\tcase 'getAll':\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * @param {string} name\n\t\t\t\t\t\t */\n\t\t\t\t\t\treturn name => {\n\t\t\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\t\treturn URLSearchParams.prototype[p].call(\n\t\t\t\t\t\t\t\treceiver,\n\t\t\t\t\t\t\t\tString(name).toLowerCase()\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t};\n\n\t\t\t\t\tcase 'keys':\n\t\t\t\t\t\treturn () => {\n\t\t\t\t\t\t\ttarget.sort();\n\t\t\t\t\t\t\treturn new Set(URLSearchParams.prototype.keys.call(target)).keys();\n\t\t\t\t\t\t};\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn Reflect.get(target, p, receiver);\n\t\t\t\t}\n\t\t\t}\n\t\t\t/* c8 ignore next */\n\t\t});\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn this.constructor.name;\n\t}\n\n\ttoString() {\n\t\treturn Object.prototype.toString.call(this);\n\t}\n\n\t/**\n\t * \n\t * @param {string} name \n\t */\n\tget(name) {\n\t\tconst values = this.getAll(name);\n\t\tif (values.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet value = values.join(', ');\n\t\tif (/^content-encoding$/i.test(name)) {\n\t\t\tvalue = value.toLowerCase();\n\t\t}\n\n\t\treturn value;\n\t}\n\n\t/**\n\t * @param {(value: string, key: string, parent: this) => void} callback \n\t * @param {any} thisArg \n\t * @returns {void}\n\t */\n\tforEach(callback, thisArg = undefined) {\n\t\tfor (const name of this.keys()) {\n\t\t\tReflect.apply(callback, thisArg, [this.get(name), name, this]);\n\t\t}\n\t}\n\n\t/**\n\t * @returns {IterableIterator}\n\t */\n\t* values() {\n\t\tfor (const name of this.keys()) {\n\t\t\tyield /** @type {string} */(this.get(name));\n\t\t}\n\t}\n\n\t/**\n\t * @returns {IterableIterator<[string, string]>}\n\t */\n\t* entries() {\n\t\tfor (const name of this.keys()) {\n\t\t\tyield [name, /** @type {string} */(this.get(name))];\n\t\t}\n\t}\n\n\t[Symbol.iterator]() {\n\t\treturn this.entries();\n\t}\n\n\t/**\n\t * Node-fetch non-spec method\n\t * returning all headers and their values as array\n\t * @returns {Record}\n\t */\n\traw() {\n\t\treturn [...this.keys()].reduce((result, key) => {\n\t\t\tresult[key] = this.getAll(key);\n\t\t\treturn result;\n\t\t}, /** @type {Record} */({}));\n\t}\n\n\t/**\n\t * For better console.log(headers) and also to convert Headers into Node.js Request compatible format\n\t */\n\t[Symbol.for('nodejs.util.inspect.custom')]() {\n\t\treturn [...this.keys()].reduce((result, key) => {\n\t\t\tconst values = this.getAll(key);\n\t\t\t// Http.request() only supports string as Host header.\n\t\t\t// This hack makes specifying custom Host header possible.\n\t\t\tif (key === 'host') {\n\t\t\t\tresult[key] = values[0];\n\t\t\t} else {\n\t\t\t\tresult[key] = values.length > 1 ? values : values[0];\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}, /** @type {Record} */({}));\n\t}\n}\n\n/**\n * Re-shaping object for Web IDL tests\n * Only need to do it for overridden methods\n */\nObject.defineProperties(\n\tHeaders.prototype,\n\t['get', 'entries', 'forEach', 'values'].reduce((result, property) => {\n\t\tresult[property] = {enumerable: true};\n\t\treturn result;\n\t}, /** @type {Record} */ ({}))\n);\n\n/**\n * Create a Headers object from an http.IncomingMessage.rawHeaders, ignoring those that do\n * not conform to HTTP grammar productions.\n * @param {import('http').IncomingMessage['rawHeaders']} headers\n */\nfunction fromRawHeaders(headers = []) {\n\treturn new Headers(\n\t\theaders\n\t\t\t// Split into pairs\n\t\t\t.reduce((result, value, index, array) => {\n\t\t\t\tif (index % 2 === 0) {\n\t\t\t\t\tresult.push(array.slice(index, index + 2));\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t}, /** @type {string[][]} */([]))\n\t\t\t.filter(([name, value]) => {\n\t\t\t\ttry {\n\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\tvalidateHeaderValue(name, String(value));\n\t\t\t\t\treturn true;\n\t\t\t\t} catch {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t})\n\n\t);\n}\n\nconst redirectStatus = new Set([301, 302, 303, 307, 308]);\n\n/**\n * Redirect code matching\n *\n * @param {number} code - Status code\n * @return {boolean}\n */\nconst isRedirect = code => {\n\treturn redirectStatus.has(code);\n};\n\n/**\n * Response.js\n *\n * Response class provides content decoding\n */\n\nconst INTERNALS$1 = Symbol('Response internals');\n\n/**\n * Response class\n * \n * @typedef {Object} Ext\n * @property {number} [size]\n * @property {string} [url]\n * @property {number} [counter]\n * @property {number} [highWaterMark]\n * \n * @implements {globalThis.Response}\n */\nclass Response extends Body {\n\t/**\n\t * @param {BodyInit|import('stream').Stream|null} [body] - Readable stream\n\t * @param {ResponseInit & Ext} [options] - Response options\n\t */\n\tconstructor(body = null, options = {}) {\n\t\tsuper(body, options);\n\n\t\tconst status = options.status || 200;\n\t\tconst headers = new Headers(options.headers);\n\n\t\tif (body !== null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(this);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * @private\n\t\t*/\n\t\tthis[INTERNALS$1] = {\n\t\t\turl: options.url,\n\t\t\tstatus,\n\t\t\tstatusText: options.statusText || '',\n\t\t\theaders,\n\t\t\tcounter: options.counter || 0,\n\t\t\thighWaterMark: options.highWaterMark\n\t\t};\n\t}\n\n\t/**\n\t * @type {ResponseType}\n\t */\n\tget type() {\n\t\treturn \"default\"\n\t}\n\n\tget url() {\n\t\treturn this[INTERNALS$1].url || '';\n\t}\n\n\tget status() {\n\t\treturn this[INTERNALS$1].status;\n\t}\n\n\t/**\n\t * Convenience property representing if the request ended normally\n\t */\n\tget ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}\n\n\tget redirected() {\n\t\treturn this[INTERNALS$1].counter > 0;\n\t}\n\n\tget statusText() {\n\t\treturn this[INTERNALS$1].statusText;\n\t}\n\n\t/**\n\t * @type {Headers}\n\t */\n\tget headers() {\n\t\treturn this[INTERNALS$1].headers;\n\t}\n\n\tget highWaterMark() {\n\t\treturn this[INTERNALS$1].highWaterMark;\n\t}\n\n\t/**\n\t * Clone this response\n\t *\n\t * @returns {Response}\n\t */\n\tclone() {\n\t\treturn new Response(clone(this), {\n\t\t\turl: this.url,\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t\theaders: this.headers,\n\t\t\tsize: this.size\n\t\t});\n\t}\n\n\t/**\n\t * @param {string} url The URL that the new response is to originate from.\n\t * @param {number} status An optional status code for the response (e.g., 302.)\n\t * @returns {Response} A Response object.\n\t */\n\tstatic redirect(url, status = 302) {\n\t\tif (!isRedirect(status)) {\n\t\t\tthrow new RangeError('Failed to execute \"redirect\" on \"response\": Invalid status code');\n\t\t}\n\n\t\treturn new Response(null, {\n\t\t\theaders: {\n\t\t\t\tlocation: new URL(url).toString()\n\t\t\t},\n\t\t\tstatus\n\t\t});\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn 'Response';\n\t}\n}\n\nObject.defineProperties(Response.prototype, {\n\turl: {enumerable: true},\n\tstatus: {enumerable: true},\n\tok: {enumerable: true},\n\tredirected: {enumerable: true},\n\tstatusText: {enumerable: true},\n\theaders: {enumerable: true},\n\tclone: {enumerable: true}\n});\n\n/**\n * @param {URL} parsedURL \n * @returns {string}\n */\nconst getSearch = parsedURL => {\n\tif (parsedURL.search) {\n\t\treturn parsedURL.search;\n\t}\n\n\tconst lastOffset = parsedURL.href.length - 1;\n\tconst hash = parsedURL.hash || (parsedURL.href[lastOffset] === '#' ? '#' : '');\n\treturn parsedURL.href[lastOffset - hash.length] === '?' ? '?' : '';\n};\n\nconst INTERNALS = Symbol('Request internals');\n\n/**\n * Check if `obj` is an instance of Request.\n *\n * @param {any} object\n * @return {object is Request}\n */\nconst isRequest = object => {\n\treturn (\n\t\ttypeof object === 'object' &&\n\t\ttypeof object[INTERNALS] === 'object'\n\t);\n};\n\n\n/**\n * Request class\n * @implements {globalThis.Request}\n * \n * @typedef {Object} RequestState\n * @property {string} method\n * @property {RequestRedirect} redirect\n * @property {globalThis.Headers} headers\n * @property {URL} parsedURL\n * @property {AbortSignal|null} signal\n * \n * @typedef {Object} RequestExtraOptions\n * @property {number} [follow]\n * @property {boolean} [compress]\n * @property {number} [size]\n * @property {number} [counter]\n * @property {Agent} [agent]\n * @property {number} [highWaterMark]\n * @property {boolean} [insecureHTTPParser]\n * \n * @typedef {((url:URL) => import('http').Agent) | import('http').Agent} Agent\n * \n * @typedef {Object} RequestOptions\n * @property {string} [method]\n * @property {ReadableStream|null} [body]\n * @property {globalThis.Headers} [headers]\n * @property {RequestRedirect} [redirect]\n * \n */\nclass Request extends Body {\n\t/**\n\t * @param {string|Request|URL} info Url or Request instance\n\t * @param {RequestInit & RequestExtraOptions} init Custom options\n\t */\n\tconstructor(info, init = {}) {\n\t\tlet parsedURL;\n\t\t/** @type {RequestOptions & RequestExtraOptions} */\n\t\tlet settings;\n\n\t\t// Normalize input and force URL to be encoded as UTF-8 (https://github.com/node-fetch/node-fetch/issues/245)\n\t\tif (isRequest(info)) {\n\t\t\tparsedURL = new URL(info.url);\n\t\t\tsettings = (info);\n\t\t} else {\n\t\t\tparsedURL = new URL(info);\n\t\t\tsettings = {};\n\t\t}\n\n\n\n\t\tlet method = init.method || settings.method || 'GET';\n\t\tmethod = method.toUpperCase();\n\n\t\tconst inputBody = init.body != null\n\t\t\t? init.body\n\t\t\t: (isRequest(info) && info.body !== null)\n\t\t\t? clone(info)\n\t\t\t: null;\n\n\t\t// eslint-disable-next-line no-eq-null, eqeqeq\n\t\tif (inputBody != null && (method === 'GET' || method === 'HEAD')) {\n\t\t\tthrow new TypeError('Request with GET/HEAD method cannot have body');\n\t\t}\n\n\t\tsuper(inputBody, {\n\t\t\tsize: init.size || settings.size || 0\n\t\t});\n\t\tconst input = settings;\n\n\t\t\n\t\tconst headers = /** @type {globalThis.Headers} */\n\t\t\t(new Headers(init.headers || input.headers || {}));\n\n\t\tif (inputBody !== null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(this);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tlet signal = 'signal' in init\n\t\t\t? init.signal\n\t\t\t: isRequest(input)\n\t\t\t? input.signal\n\t\t\t: null;\n\n\t\t// eslint-disable-next-line no-eq-null, eqeqeq\n\t\tif (signal != null && !isAbortSignal(signal)) {\n\t\t\tthrow new TypeError('Expected signal to be an instanceof AbortSignal or EventTarget');\n\t\t}\n\n\t\t/** @type {RequestState} */\n\t\tthis[INTERNALS] = {\n\t\t\tmethod,\n\t\t\tredirect: init.redirect || input.redirect || 'follow',\n\t\t\theaders,\n\t\t\tparsedURL,\n\t\t\tsignal: signal || null\n\t\t};\n\n\t\t/** @type {boolean} */\n\t\tthis.keepalive;\n\n\t\t// Node-fetch-only options\n\t\t/** @type {number} */\n\t\tthis.follow = init.follow === undefined ? (input.follow === undefined ? 20 : input.follow) : init.follow;\n\t\t/** @type {boolean} */\n\t\tthis.compress = init.compress === undefined ? (input.compress === undefined ? true : input.compress) : init.compress;\n\t\t/** @type {number} */\n\t\tthis.counter = init.counter || input.counter || 0;\n\t\t/** @type {Agent|undefined} */\n\t\tthis.agent = init.agent || input.agent;\n\t\t/** @type {number} */\n\t\tthis.highWaterMark = init.highWaterMark || input.highWaterMark || 16384;\n\t\t/** @type {boolean} */\n\t\tthis.insecureHTTPParser = init.insecureHTTPParser || input.insecureHTTPParser || false;\n\t}\n\n\t/**\n\t * @type {RequestCache}\n\t */\n\tget cache() {\n\t\treturn \"default\"\n\t}\n\n\t/**\n\t * @type {RequestCredentials}\n\t */\n\n\tget credentials() {\n\t\treturn \"same-origin\"\n\t}\n\n\t/**\n\t * @type {RequestDestination}\n\t */\n\tget destination() {\n\t\treturn \"\"\n\t}\n\t\n\tget integrity() {\n\t\treturn \"\"\n\t}\n\t\n\t/** @type {RequestMode} */\n\tget mode() {\n\t\treturn \"cors\"\n\t}\n\n\t/** @type {string} */\n\tget referrer() {\n\t\treturn \"\"\n\t}\n\t\n\t/** @type {ReferrerPolicy} */\n\tget referrerPolicy() {\n\t\treturn \"\"\n\t}\n\tget method() {\n\t\treturn this[INTERNALS].method;\n\t}\n\n\t/**\n\t * @type {string}\n\t */\n\tget url() {\n\t\treturn url.format(this[INTERNALS].parsedURL);\n\t}\n\n\t/**\n\t * @type {globalThis.Headers}\n\t */\n\tget headers() {\n\t\treturn this[INTERNALS].headers;\n\t}\n\n\tget redirect() {\n\t\treturn this[INTERNALS].redirect;\n\t}\n\n\t/**\n\t * @returns {AbortSignal}\n\t */\n\tget signal() {\n\t\t// @ts-ignore\n\t\treturn this[INTERNALS].signal;\n\t}\n\n\t/**\n\t * Clone this request\n\t *\n\t * @return {globalThis.Request}\n\t */\n\tclone() {\n\t\treturn new Request(this);\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn 'Request';\n\t}\n}\n\nObject.defineProperties(Request.prototype, {\n\tmethod: {enumerable: true},\n\turl: {enumerable: true},\n\theaders: {enumerable: true},\n\tredirect: {enumerable: true},\n\tclone: {enumerable: true},\n\tsignal: {enumerable: true}\n});\n\n/**\n * Convert a Request to Node.js http request options.\n * The options object to be passed to http.request\n *\n * @param {Request & Record} request - A Request instance\n */\nconst getNodeRequestOptions = request => {\n\tconst {parsedURL} = request[INTERNALS];\n\tconst headers = new Headers(request[INTERNALS].headers);\n\n\t// Fetch step 1.3\n\tif (!headers.has('Accept')) {\n\t\theaders.set('Accept', '*/*');\n\t}\n\n\t// HTTP-network-or-cache fetch steps 2.4-2.7\n\tlet contentLengthValue = null;\n\tif (request.body === null && /^(post|put)$/i.test(request.method)) {\n\t\tcontentLengthValue = '0';\n\t}\n\n\tif (request.body !== null) {\n\t\tconst totalBytes = getTotalBytes(request);\n\t\t// Set Content-Length if totalBytes is a number (that is not NaN)\n\t\tif (typeof totalBytes === 'number' && !Number.isNaN(totalBytes)) {\n\t\t\tcontentLengthValue = String(totalBytes);\n\t\t}\n\t}\n\n\tif (contentLengthValue) {\n\t\theaders.set('Content-Length', contentLengthValue);\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.11\n\tif (!headers.has('User-Agent')) {\n\t\theaders.set('User-Agent', 'node-fetch');\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.15\n\tif (request.compress && !headers.has('Accept-Encoding')) {\n\t\theaders.set('Accept-Encoding', 'gzip,deflate,br');\n\t}\n\n\tlet {agent} = request;\n\tif (typeof agent === 'function') {\n\t\tagent = agent(parsedURL);\n\t}\n\n\tif (!headers.has('Connection') && !agent) {\n\t\theaders.set('Connection', 'close');\n\t}\n\n\t// HTTP-network fetch step 4.2\n\t// chunked encoding is handled by Node.js\n\n\tconst search = getSearch(parsedURL);\n\n\t// Manually spread the URL object instead of spread syntax\n\tconst requestOptions = {\n\t\tpath: parsedURL.pathname + search,\n\t\tpathname: parsedURL.pathname,\n\t\thostname: parsedURL.hostname,\n\t\tprotocol: parsedURL.protocol,\n\t\tport: parsedURL.port,\n\t\thash: parsedURL.hash,\n\t\tsearch: parsedURL.search,\n\t\t// @ts-ignore - it does not has a query \n\t\tquery: parsedURL.query,\n\t\thref: parsedURL.href,\n\t\tmethod: request.method,\n\t\t// @ts-ignore - not sure what this supposed to do\n\t\theaders: headers[Symbol.for('nodejs.util.inspect.custom')](),\n\t\tinsecureHTTPParser: request.insecureHTTPParser,\n\t\tagent\n\t};\n\n\treturn requestOptions;\n};\n\n/**\n * AbortError interface for cancelled requests\n */\nclass AbortError extends FetchBaseError {\n\t/**\n\t * @param {string} message \n\t * @param {string} [type]\n\t */\n\tconstructor(message, type = 'aborted') {\n\t\tsuper(message, type);\n\t}\n}\n\n/**\n * Index.js\n *\n * a request API compatible with window.fetch\n *\n * All spec algorithm step numbers are based on https://fetch.spec.whatwg.org/commit-snapshots/ae716822cb3a61843226cd090eefc6589446c1d2/.\n */\n\nconst supportedSchemas = new Set(['data:', 'http:', 'https:']);\n\n/**\n * Fetch function\n *\n * @param {string | URL | import('./request').default} url - Absolute url or Request instance\n * @param {RequestInit} [options_] - Fetch options\n * @return {Promise}\n */\nasync function fetch(url, options_ = {}) {\n\treturn new Promise((resolve, reject) => {\n\t\t// Build request object\n\t\tconst request = new Request(url, options_);\n\t\tconst options = getNodeRequestOptions(request);\n\t\tif (!supportedSchemas.has(options.protocol)) {\n\t\t\tthrow new TypeError(`node-fetch cannot load ${url}. URL scheme \"${options.protocol.replace(/:$/, '')}\" is not supported.`);\n\t\t}\n\n\t\tif (options.protocol === 'data:') {\n\t\t\tconst data = dataUriToBuffer(request.url.toString());\n\t\t\tconst response = new Response(data, {headers: {'Content-Type': data.typeFull}});\n\t\t\tresolve(response);\n\t\t\treturn;\n\t\t}\n\n\t\t// Wrap http.request into fetch\n\t\tconst send = (options.protocol === 'https:' ? https : http).request;\n\t\tconst {signal} = request;\n\t\t/** @type {Response|null} */\n\t\tlet response = null;\n\t\t/** @type {import('http').IncomingMessage|null} */\n\t\tlet response_ = null;\n\n\t\tconst abort = () => {\n\t\t\tconst error = new AbortError('The operation was aborted.');\n\t\t\treject(error);\n\t\t\tif (request.body) {\n\t\t\t\trequest.body.cancel(error);\n\t\t\t}\n\n\t\t\tif (!response_) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresponse_.emit('error', error);\n\t\t};\n\n\t\tif (signal && signal.aborted) {\n\t\t\tabort();\n\t\t\treturn;\n\t\t}\n\n\t\tconst abortAndFinalize = () => {\n\t\t\tabort();\n\t\t\tfinalize();\n\t\t};\n\n\t\t// Send request\n\t\tconst request_ = send(options);\n\n\t\tif (signal) {\n\t\t\tsignal.addEventListener('abort', abortAndFinalize);\n\t\t}\n\n\t\tconst finalize = () => {\n\t\t\trequest_.abort();\n\t\t\tif (signal) {\n\t\t\t\tsignal.removeEventListener('abort', abortAndFinalize);\n\t\t\t}\n\t\t};\n\n\t\trequest_.on('error', err => {\n\t\t\t// @ts-expect-error - err may not be SystemError\n\t\t\treject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));\n\t\t\tfinalize();\n\t\t});\n\n\t\tfixResponseChunkedTransferBadEnding(request_, err => {\n\t\t\tif (signal && signal.aborted) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tresponse_?.emit(\"error\", err);\n\t\t});\n\n\t\t/* c8 ignore next 18 */\n\t\tif (parseInt(process.version.substring(1)) < 14) {\n\t\t\t// Before Node.js 14, pipeline() does not fully support async iterators and does not always\n\t\t\t// properly handle when the socket close/end events are out of order.\n\t\t\trequest_.on('socket', s => {\n\t\t\t\ts.prependListener('close', hadError => {\n\t\t\t\t\t// if a data listener is still present we didn't end cleanly\n\t\t\t\t\tconst hasDataListener = s.listenerCount('data') > 0;\n\n\t\t\t\t\t// if end happened before close but the socket didn't emit an error, do it now\n\t\t\t\t\tif (response && hasDataListener && !hadError && !(signal && signal.aborted)) {\n\t\t\t\t\t\tconst err = Object.assign(new Error('Premature close'), {\n\t\t\t\t\t\t\tcode: 'ERR_STREAM_PREMATURE_CLOSE'\n\t\t\t\t\t\t});\n\t\t\t\t\t\tresponse_?.emit('error', err);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\trequest_.on('response', incoming => {\n\t\t\tresponse_ = incoming;\n\t\t\trequest_.setTimeout(0);\n\t\t\tconst headers = fromRawHeaders(response_.rawHeaders);\n\n\t\t\t// HTTP fetch step 5\n\t\t\tif (isRedirect(Number(response_.statusCode))) {\n\t\t\t\t// HTTP fetch step 5.2\n\t\t\t\tconst location = headers.get('Location');\n\n\t\t\t\t// HTTP fetch step 5.3\n\t\t\t\tconst locationURL = location === null ? null : new URL(location, request.url);\n\n\t\t\t\t// HTTP fetch step 5.5\n\t\t\t\tswitch (request.redirect) {\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase 'manual':\n\t\t\t\t\t\t// Node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.\n\t\t\t\t\t\tif (locationURL !== null) {\n\t\t\t\t\t\t\theaders.set('Location', locationURL.toString());\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'follow': {\n\t\t\t\t\t\t// HTTP-redirect fetch step 2\n\t\t\t\t\t\tif (locationURL === null) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 5\n\t\t\t\t\t\tif (request.counter >= request.follow) {\n\t\t\t\t\t\t\treject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 6 (counter increment)\n\t\t\t\t\t\t// Create a new Request object.\n\t\t\t\t\t\tconst requestOptions = {\n\t\t\t\t\t\t\theaders: new Headers(request.headers),\n\t\t\t\t\t\t\tfollow: request.follow,\n\t\t\t\t\t\t\tcounter: request.counter + 1,\n\t\t\t\t\t\t\tagent: request.agent,\n\t\t\t\t\t\t\tcompress: request.compress,\n\t\t\t\t\t\t\tmethod: request.method,\n\t\t\t\t\t\t\t// Note: We can not use `request.body` because send would have\n\t\t\t\t\t\t\t// consumed it already.\n\t\t\t\t\t\t\tbody: options_.body,\n\t\t\t\t\t\t\tsignal: request.signal,\n\t\t\t\t\t\t\tsize: request.size\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 9\n\t\t\t\t\t\tconst isStreamBody =\n\t\t\t\t\t\t\trequestOptions.body instanceof blob.ReadableStream ||\n\t\t\t\t\t\t\trequestOptions.body instanceof Stream.Readable;\n\t\t\t\t\t\tif (response_.statusCode !== 303 && isStreamBody) {\n\t\t\t\t\t\t\treject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 11\n\t\t\t\t\t\tif (response_.statusCode === 303 || ((response_.statusCode === 301 || response_.statusCode === 302) && request.method === 'POST')) {\n\t\t\t\t\t\t\trequestOptions.method = 'GET';\n\t\t\t\t\t\t\trequestOptions.body = undefined;\n\t\t\t\t\t\t\trequestOptions.headers.delete('content-length');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 15\n\t\t\t\t\t\tfetch(new Request(locationURL.href, requestOptions)).then(resolve, reject);\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn reject(new TypeError(`Redirect option '${request.redirect}' is not a valid value of RequestRedirect`));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Prepare response\n\t\t\tif (signal) {\n\t\t\t\tresponse_.once('end', () => {\n\t\t\t\t\tsignal.removeEventListener('abort', abortAndFinalize);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tlet body = Stream.pipeline(response_, new Stream.PassThrough(), reject);\n\t\t\t// see https://github.com/nodejs/node/pull/29376\n\t\t\t/* c8 ignore next 3 */\n\t\t\tif (process.version < 'v12.10') {\n\t\t\t\tresponse_.on('aborted', abortAndFinalize);\n\t\t\t}\n\n\t\t\tconst responseOptions = {\n\t\t\t\turl: request.url,\n\t\t\t\tstatus: response_.statusCode,\n\t\t\t\tstatusText: response_.statusMessage,\n\t\t\t\theaders,\n\t\t\t\tsize: request.size,\n\t\t\t\tcounter: request.counter,\n\t\t\t\thighWaterMark: request.highWaterMark\n\t\t\t};\n\n\t\t\t// HTTP-network fetch step 12.1.1.3\n\t\t\tconst codings = headers.get('Content-Encoding');\n\n\t\t\t// HTTP-network fetch step 12.1.1.4: handle content codings\n\n\t\t\t// in following scenarios we ignore compression support\n\t\t\t// 1. compression support is disabled\n\t\t\t// 2. HEAD request\n\t\t\t// 3. no Content-Encoding header\n\t\t\t// 4. no content response (204)\n\t\t\t// 5. content not modified response (304)\n\t\t\tif (!request.compress || request.method === 'HEAD' || codings === null || response_.statusCode === 204 || response_.statusCode === 304) {\n\t\t\t\tresponse = new Response(body, responseOptions);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For Node v6+\n\t\t\t// Be less strict when decoding compressed responses, since sometimes\n\t\t\t// servers send slightly invalid responses that are still accepted\n\t\t\t// by common browsers.\n\t\t\t// Always using Z_SYNC_FLUSH is what cURL does.\n\t\t\tconst zlibOptions = {\n\t\t\t\tflush: zlib.Z_SYNC_FLUSH,\n\t\t\t\tfinishFlush: zlib.Z_SYNC_FLUSH\n\t\t\t};\n\n\t\t\t// For gzip\n\t\t\tif (codings === 'gzip' || codings === 'x-gzip') {\n\t\t\t\tbody = Stream.pipeline(body, zlib.createGunzip(zlibOptions), reject);\n\t\t\t\tresponse = new Response(fromAsyncIterable(body), responseOptions);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For deflate\n\t\t\tif (codings === 'deflate' || codings === 'x-deflate') {\n\t\t\t\t// Handle the infamous raw deflate response from old servers\n\t\t\t\t// a hack for old IIS and Apache servers\n\t\t\t\tconst raw = Stream.pipeline(response_, new Stream.PassThrough(), reject);\n\t\t\t\traw.once('data', chunk => {\n\t\t\t\t\t// See http://stackoverflow.com/questions/37519828\n\t\t\t\t\tif ((chunk[0] & 0x0F) === 0x08) {\n\t\t\t\t\t\tbody = Stream.pipeline(body, zlib.createInflate(), reject);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbody = Stream.pipeline(body, zlib.createInflateRaw(), reject);\n\t\t\t\t\t}\n\n\t\t\t\t\tresponse = new Response(fromAsyncIterable(body), responseOptions);\n\t\t\t\t\tresolve(response);\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For br\n\t\t\tif (codings === 'br') {\n\t\t\t\tbody = Stream.pipeline(body, zlib.createBrotliDecompress(), reject);\n\t\t\t\tresponse = new Response(fromAsyncIterable(body), responseOptions);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Otherwise, use response as-is\n\t\t\tresponse = new Response(fromAsyncIterable(body), responseOptions);\n\t\t\tresolve(response);\n\t\t});\n\n\t\twriteToStream(request_, request);\n\t});\n}\n\n/**\n * \n * @param {import('http').ClientRequest} request \n * @param {(error:Error) => void} errorCallback \n */\nfunction fixResponseChunkedTransferBadEnding(request, errorCallback) {\n\t/** @type {import('net').Socket} */\n\tlet socket;\n\n\trequest.on('socket', s => {\n\t\tsocket = s;\n\t});\n\n\trequest.on('response', response => {\n\n\t\tconst {headers} = response;\n\n\t\tif (headers['transfer-encoding'] === 'chunked' && !headers['content-length']) {\n\t\t\tsocket.prependListener('close', hadError => {\n\t\t\t\t// if a data listener is still present we didn't end cleanly\n\t\t\t\tconst hasDataListener = socket.listenerCount('data') > 0;\n\t\t\t\tif (hasDataListener && !hadError) {\n\t\t\t\t\tconst err = Object.assign(new Error('Premature close'), {\n\t\t\t\t\t\tcode: 'ERR_STREAM_PREMATURE_CLOSE'\n\t\t\t\t\t});\n\t\t\t\t\terrorCallback(err);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n}\n\nObject.defineProperty(exports, 'Blob', {\n\tenumerable: true,\n\tget: function () { return blob.Blob; }\n});\nObject.defineProperty(exports, 'ReadableStream', {\n\tenumerable: true,\n\tget: function () { return blob.ReadableStream; }\n});\nObject.defineProperty(exports, 'FormData', {\n\tenumerable: true,\n\tget: function () { return formData.FormData; }\n});\nexports.AbortError = AbortError;\nexports.FetchError = FetchError;\nexports.Headers = Headers;\nexports.Request = Request;\nexports.Response = Response;\nexports[\"default\"] = fetch;\nexports.isRedirect = isRedirect;\n//# sourceMappingURL=index.cjs.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar blob = require('@web-std/blob');\n\n/**\n * @implements {globalThis.File}\n */\nclass File extends blob.Blob {\n /**\n *\n * @param {BlobPart[]} init\n * @param {string} name - A USVString representing the file name or the path\n * to the file.\n * @param {FilePropertyBag} [options]\n */\n constructor(\n init,\n name = panic(new TypeError(\"File constructor requires name argument\")),\n options = {}\n ) {\n super(init, options);\n // Per File API spec https://w3c.github.io/FileAPI/#file-constructor\n // Every \"/\" character of file name must be replaced with a \":\".\n /** @private */\n this._name = name;\n // It appears that browser do not follow the spec here.\n // String(name).replace(/\\//g, \":\")\n /** @private */\n this._lastModified = options.lastModified || Date.now();\n }\n\n /**\n * The name of the file referenced by the File object.\n * @type {string}\n */\n get name() {\n return this._name\n }\n\n /**\n * The path the URL of the File is relative to.\n * @type {string}\n */\n get webkitRelativePath() {\n return \"\"\n }\n\n /**\n * Returns the last modified time of the file, in millisecond since the UNIX\n * epoch (January 1st, 1970 at Midnight).\n * @returns {number}\n */\n get lastModified() {\n return this._lastModified\n }\n\n get [Symbol.toStringTag]() {\n return \"File\"\n }\n}\n\n/**\n * @param {*} error\n * @returns {never}\n */\nconst panic = error => {\n throw error\n};\n\nexports.File = File;\n//# sourceMappingURL=file.cjs.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar blob = require('@web-std/blob');\nvar file = require('./file.cjs');\n\n// Electron-renderer should get the browser implementation instead of node\n// Browser configuration is not enough\n\n// Marking export as a DOM File object instead of custom class.\n/** @type {typeof globalThis.File} */\nconst File = typeof globalThis.File === \"function\" ? globalThis.File : file.File;\n\nObject.defineProperty(exports, 'Blob', {\n\tenumerable: true,\n\tget: function () {\n\t\treturn blob.Blob;\n\t}\n});\nexports.File = File;\n//# sourceMappingURL=lib.node.cjs.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/**\n * @implements {globalThis.FormData}\n */\nclass FormData {\n /**\n * @param {HTMLFormElement} [form]\n */\n constructor(form) {\n if (form !== undefined) {\n const error = isHTMLFormElement(form)\n ? new TypeError(\n \"FormData constructor: HTMLFormElement parameter is not supported, if you need it submit an issue\"\n )\n : new TypeError(\n \"FormData constructor: Argument 1 does not implement interface HTMLFormElement.\"\n );\n\n throw error\n }\n\n /**\n * @private\n * @readonly\n * @type {Array<[string, FormDataEntryValue]>}\n */\n this._entries = [];\n\n Object.defineProperty(this, \"_entries\", { enumerable: false });\n }\n get [Symbol.toStringTag]() {\n return \"FormData\"\n }\n\n /**\n * Appends a new value onto an existing key inside a FormData object, or adds\n * the key if it does not already exist.\n *\n * The difference between `set` and `append` is that if the specified key\n * already exists, `set` will overwrite all existing values with the new one,\n * whereas `append` will append the new value onto the end of the existing\n * set of values.\n *\n * @param {string} name\n * @param {string|Blob|File} value - The name of the field whose data is\n * contained in value.\n * @param {string} [filename] - The filename reported to the server, when a\n * value is a `Blob` or a `File`. The default filename for a `Blob` objects is\n * `\"blob\"`. The default filename for a `File` is the it's name.\n */\n append(\n name,\n value = panic(\n new TypeError(\"FormData.append: requires at least 2 arguments\")\n ),\n filename\n ) {\n this._entries.push([name, toEntryValue(value, filename)]);\n }\n\n /**\n * Deletes a key and all its values from a FormData object.\n *\n * @param {string} name\n */\n delete(\n name = panic(new TypeError(\"FormData.delete: requires string argument\"))\n ) {\n const entries = this._entries;\n let index = 0;\n while (index < entries.length) {\n const [entryName] = /** @type {[string, FormDataEntryValue]}*/ (\n entries[index]\n );\n if (entryName === name) {\n entries.splice(index, 1);\n } else {\n index++;\n }\n }\n }\n\n /**\n * Returns the first value associated with a given key from within a\n * FormData object.\n *\n * @param {string} name\n * @returns {FormDataEntryValue|null}\n */\n\n get(name = panic(new TypeError(\"FormData.get: requires string argument\"))) {\n for (const [entryName, value] of this._entries) {\n if (entryName === name) {\n return value\n }\n }\n return null\n }\n\n /**\n * Returns an array of all the values associated with a given key from within\n * a FormData.\n *\n * @param {string} name\n * @returns {FormDataEntryValue[]}\n */\n getAll(\n name = panic(new TypeError(\"FormData.getAll: requires string argument\"))\n ) {\n const values = [];\n for (const [entryName, value] of this._entries) {\n if (entryName === name) {\n values.push(value);\n }\n }\n return values\n }\n\n /**\n * Returns a boolean stating whether a FormData object contains a certain key.\n *\n * @param {string} name\n */\n\n has(name = panic(new TypeError(\"FormData.has: requires string argument\"))) {\n for (const [entryName] of this._entries) {\n if (entryName === name) {\n return true\n }\n }\n return false\n }\n\n /**\n * Sets a new value for an existing key inside a FormData object, or adds the\n * key/value if it does not already exist.\n *\n * @param {string} name\n * @param {string|Blob|File} value\n * @param {string} [filename]\n */\n\n set(\n name,\n value = panic(new TypeError(\"FormData.set: requires at least 2 arguments\")),\n filename\n ) {\n let index = 0;\n const { _entries: entries } = this;\n const entryValue = toEntryValue(value, filename);\n let wasSet = false;\n while (index < entries.length) {\n const entry = /** @type {[string, FormDataEntryValue]}*/ (entries[index]);\n if (entry[0] === name) {\n if (wasSet) {\n entries.splice(index, 1);\n } else {\n wasSet = true;\n entry[1] = entryValue;\n index++;\n }\n } else {\n index++;\n }\n }\n\n if (!wasSet) {\n entries.push([name, entryValue]);\n }\n }\n\n /**\n * Method returns an iterator allowing to go through all key/value pairs\n * contained in this object.\n */\n entries() {\n return this._entries.values()\n }\n\n /**\n * Returns an iterator allowing to go through all keys of the key/value pairs\n * contained in this object.\n *\n * @returns {IterableIterator}\n */\n *keys() {\n for (const [name] of this._entries) {\n yield name;\n }\n }\n\n /**\n * Returns an iterator allowing to go through all values contained in this\n * object.\n *\n * @returns {IterableIterator}\n */\n *values() {\n for (const [_, value] of this._entries) {\n yield value;\n }\n }\n\n [Symbol.iterator]() {\n return this._entries.values()\n }\n\n /**\n * @param {(value: FormDataEntryValue, key: string, parent: globalThis.FormData) => void} fn\n * @param {any} [thisArg]\n * @returns {void}\n */\n forEach(fn, thisArg) {\n for (const [key, value] of this._entries) {\n fn.call(thisArg, value, key, this);\n }\n }\n}\n\n/**\n * @param {any} value\n * @returns {value is HTMLFormElement}\n */\nconst isHTMLFormElement = value =>\n Object.prototype.toString.call(value) === \"[object HTMLFormElement]\";\n\n/**\n * @param {string|Blob|File} value\n * @param {string} [filename]\n * @returns {FormDataEntryValue}\n */\nconst toEntryValue = (value, filename) => {\n if (isFile(value)) {\n return filename != null ? new BlobFile([value], filename, value) : value\n } else if (isBlob(value)) {\n return new BlobFile([value], filename != null ? filename : \"blob\")\n } else {\n if (filename != null) {\n throw new TypeError(\n \"filename is only supported when value is Blob or File\"\n )\n }\n return `${value}`\n }\n};\n\n/**\n * @param {any} value\n * @returns {value is File}\n */\nconst isFile = value =>\n Object.prototype.toString.call(value) === \"[object File]\" &&\n typeof value.name === \"string\";\n\n/**\n * @param {any} value\n * @returns {value is Blob}\n */\nconst isBlob = value =>\n Object.prototype.toString.call(value) === \"[object Blob]\";\n\n/**\n * Simple `File` implementation that just wraps a given blob.\n * @implements {globalThis.File}\n */\nconst BlobFile = class File {\n /**\n * @param {[Blob]} parts\n * @param {string} name\n * @param {FilePropertyBag} [options]\n */\n constructor([blob], name, { lastModified = Date.now() } = {}) {\n this.blob = blob;\n this.name = name;\n this.lastModified = lastModified;\n }\n get webkitRelativePath() {\n return \"\"\n }\n get size() {\n return this.blob.size\n }\n get type() {\n return this.blob.type\n }\n /**\n *\n * @param {number} [start]\n * @param {number} [end]\n * @param {string} [contentType]\n */\n slice(start, end, contentType) {\n return this.blob.slice(start, end, contentType)\n }\n stream() {\n return this.blob.stream()\n }\n text() {\n return this.blob.text()\n }\n arrayBuffer() {\n return this.blob.arrayBuffer()\n }\n get [Symbol.toStringTag]() {\n return \"File\"\n }\n};\n\n/**\n * @param {*} error\n * @returns {never}\n */\nconst panic = error => {\n throw error\n};\n\nexports.FormData = FormData;\n//# sourceMappingURL=form-data.cjs.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar formData = require('./form-data.cjs');\n\n// @ts-check\n\n// Electron-renderer should get the browser implementation instead of node\n// which is why we check global first.\nconst FormData =\n typeof globalThis.FormData === \"function\"\n ? globalThis.FormData\n : formData.FormData;\n\nexports.FormData = FormData;\n//# sourceMappingURL=lib.node.cjs.map\n","try {\n module.exports = require(\"stream/web\")\n} catch (error) {\n module.exports = require(\"web-streams-polyfill/ponyfill\")\n}\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst MAX_HEADER_LENGTH = 2000;\nconst THROW_ON_MAX_HEADER_LENGTH_EXCEEDED = false;\n\nfunction hasRel (x) {\n return x && x.rel\n}\n\nfunction intoRels (acc, x) {\n function splitRel (rel) {\n acc[rel] = Object.assign({}, x, { rel: rel });\n }\n\n x.rel.split(/\\s+/).forEach(splitRel);\n\n return acc\n}\n\nfunction createObjects (acc, p) {\n // rel=\"next\" => 1: rel 2: next\n const m = p.match(/\\s*(.+)\\s*=\\s*\"?([^\"]+)\"?/);\n if (m) acc[m[1]] = m[2];\n return acc\n}\n\nfunction parseLink (link) {\n try {\n const m = link.match(/]*)>(.*)/);\n const linkUrl = m[1];\n const parts = m[2].split(';');\n const qry = {};\n // The origin is unused but it's required to parse relative URLs\n const url = new URL(linkUrl, 'https://example.com');\n\n for (const [key, value] of url.searchParams) {\n qry[key] = value;\n }\n\n parts.shift();\n\n let info = parts.reduce(createObjects, {});\n info = Object.assign({}, qry, info);\n info.url = linkUrl;\n return info\n } catch {\n return null\n }\n}\n\nfunction checkHeader (linkHeader, options) {\n if (!linkHeader) return false\n\n options = options || {};\n const maxHeaderLength = options.maxHeaderLength || MAX_HEADER_LENGTH;\n const throwOnMaxHeaderLengthExceeded = options.throwOnMaxHeaderLengthExceeded || THROW_ON_MAX_HEADER_LENGTH_EXCEEDED;\n\n if (linkHeader.length > maxHeaderLength) {\n if (throwOnMaxHeaderLengthExceeded) {\n throw new Error('Input string too long, it should be under ' + maxHeaderLength + ' characters.')\n } else {\n return false\n }\n }\n return true\n}\n\nfunction parseLinkHeader (linkHeader, options) {\n if (!checkHeader(linkHeader, options)) return null\n\n return linkHeader.split(/,\\s* throttle(() => {})\n}\n\n/**\n * Rate limiter used by static API if no rate limiter is passed. Note that each\n * instance of the Web3Storage class gets it's own limiter if none is passed.\n * This is because rate limits are enforced per API token.\n */\nconst globalRateLimiter = createRateLimiter();\n\n/**\n * @implements Service\n */\nclass Web3Storage {\n /**\n * Constructs a client bound to the given `options.token` and\n * `options.endpoint`.\n *\n * @example\n * ```js\n * import { Web3Storage } from 'web3.storage'\n * const client = new Web3Storage({ token: API_TOKEN })\n * ```\n *\n * @param {{token: string, endpoint?:URL, rateLimiter?: RateLimiter}} options\n */\n constructor ({\n token,\n endpoint = new URL('https://api.web3.storage'),\n rateLimiter\n }) {\n /**\n * Authorization token.\n *\n * @readonly\n */\n this.token = token;\n /**\n * Service API endpoint `URL`.\n * @readonly\n */\n this.endpoint = endpoint;\n /**\n * @readonly\n */\n this.rateLimiter = rateLimiter || createRateLimiter();\n }\n\n /**\n * @hidden\n * @param {string} token\n * @returns {Record}\n */\n static headers (token) {\n if (!token) throw new Error('missing token')\n return {\n Authorization: `Bearer ${token}`,\n 'X-Client': 'web3.storage/js'\n }\n }\n\n /**\n * @param {Service} service\n * @param {Iterable} files\n * @param {PutOptions} [options]\n * @returns {Promise}\n */\n static async put ({ endpoint, token, rateLimiter = globalRateLimiter }, files, {\n onRootCidReady,\n onStoredChunk,\n maxRetries = MAX_PUT_RETRIES,\n maxChunkSize = DEFAULT_CHUNK_SIZE,\n wrapWithDirectory = true,\n name\n } = {}) {\n if (maxChunkSize >= MAX_CHUNK_SIZE || maxChunkSize < MAX_BLOCK_SIZE) {\n throw new Error('maximum chunk size must be less than 100MiB and greater than or equal to 1MB')\n }\n const blockstore = new fs.FsBlockStore();\n try {\n const { out, root } = await pack.pack({\n input: Array.from(files).map(toImportCandidate),\n blockstore,\n wrapWithDirectory,\n maxChunkSize: MAX_BLOCK_SIZE,\n maxChildrenPerNode: 1024\n });\n onRootCidReady && onRootCidReady(root.toString());\n const car$1 = await car.CarReader.fromIterable(out);\n return await Web3Storage.putCar({ endpoint, token, rateLimiter }, car$1, { onStoredChunk, maxRetries, maxChunkSize, name })\n } finally {\n await blockstore.close();\n }\n }\n\n /**\n * @param {Service} service\n * @param {import('@ipld/car/api').CarReader} car\n * @param {PutCarOptions} [options]\n * @returns {Promise}\n */\n static async putCar ({ endpoint, token, rateLimiter = globalRateLimiter }, car, {\n name,\n onStoredChunk,\n maxRetries = MAX_PUT_RETRIES,\n maxChunkSize = DEFAULT_CHUNK_SIZE,\n decoders\n } = {}) {\n if (maxChunkSize >= MAX_CHUNK_SIZE || maxChunkSize < MAX_BLOCK_SIZE) {\n throw new Error('maximum chunk size must be less than 100MiB and greater than or equal to 1MB')\n }\n const targetSize = maxChunkSize;\n const url = new URL('car', endpoint);\n let headers = Web3Storage.headers(token);\n\n if (name) {\n headers = { ...headers, 'X-Name': encodeURIComponent(name) };\n }\n\n const roots = await car.getRoots();\n if (roots[0] == null) {\n throw new Error('missing root CID')\n }\n if (roots.length > 1) {\n throw new Error('too many roots')\n }\n\n const carRoot = roots[0].toString();\n const splitter = new treewalk.TreewalkCarSplitter(car, targetSize, { decoders });\n\n /**\n * @param {AsyncIterable} car\n * @returns {Promise}\n */\n const onCarChunk = async car => {\n const carParts = [];\n for await (const part of car) {\n carParts.push(part);\n }\n\n const carFile = new blob.Blob(carParts, { type: 'application/vnd.ipld.car' });\n const res = await pRetry__default[\"default\"](\n async () => {\n await rateLimiter();\n const request = await fetch__default[\"default\"](url.toString(), {\n method: 'POST',\n headers,\n body: carFile\n });\n /* c8 ignore next 3 */\n if (request.status === 429) {\n throw new Error('rate limited')\n }\n const res = await request.json();\n if (!request.ok) {\n throw new Error(res.message)\n }\n\n if (res.cid !== carRoot) {\n throw new Error(`root CID mismatch, expected: ${carRoot}, received: ${res.cid}`)\n }\n return res.cid\n },\n { retries: maxRetries }\n );\n\n onStoredChunk && onStoredChunk(carFile.size);\n return res\n };\n\n const upload = streamingIterables.transform(MAX_CONCURRENT_UPLOADS, onCarChunk);\n for await (const _ of upload(splitter.cars())) {} // eslint-disable-line\n return carRoot\n }\n\n /**\n * @param {Service} service\n * @param {CIDString} cid\n * @returns {Promise}\n */\n static async get ({ endpoint, token, rateLimiter = globalRateLimiter }, cid) {\n const url = new URL(`car/${cid}`, endpoint);\n await rateLimiter();\n const res = await fetch__default[\"default\"](url.toString(), {\n method: 'GET',\n headers: Web3Storage.headers(token)\n });\n /* c8 ignore next 3 */\n if (res.status === 429) {\n throw new Error('rate limited')\n }\n return toWeb3Response(res)\n }\n\n /**\n * @param {Service} service\n * @param {CIDString} cid\n * @returns {Promise}\n */\n /* c8 ignore next 4 */\n static async delete ({ endpoint, token, rateLimiter = globalRateLimiter }, cid) {\n console.log('Not deleting', cid, endpoint, token, rateLimiter);\n throw Error('.delete not implemented yet')\n }\n\n /**\n * @param {Service} service\n * @param {CIDString} cid\n * @returns {Promise}\n */\n static async status ({ endpoint, token, rateLimiter = globalRateLimiter }, cid) {\n const url = new URL(`status/${cid}`, endpoint);\n await rateLimiter();\n const res = await fetch__default[\"default\"](url.toString(), {\n method: 'GET',\n headers: Web3Storage.headers(token)\n });\n /* c8 ignore next 3 */\n if (res.status === 429) {\n throw new Error('rate limited')\n }\n if (res.status === 404) {\n return undefined\n }\n if (!res.ok) {\n throw new Error(res.statusText)\n }\n return res.json()\n }\n\n /**\n * @param {Service} service\n * @param {object} [opts]\n * @param {string} [opts.before] list items uploaded before this ISO 8601 date string\n * @param {number} [opts.maxResults] maximum number of results to return\n * @returns {AsyncIterable}\n */\n static async * list (service, { before = new Date().toISOString(), maxResults = Infinity } = {}) {\n /**\n * @param {Service} service\n * @param {{before: string, size: number}} opts\n * @returns {Promise}\n */\n async function listPage ({ endpoint, token, rateLimiter = globalRateLimiter }, { before, size }) {\n const search = new URLSearchParams({ before, size: size.toString() });\n const url = new URL(`user/uploads?${search}`, endpoint);\n await rateLimiter();\n return fetch__default[\"default\"](url.toString(), {\n method: 'GET',\n headers: {\n ...Web3Storage.headers(token),\n 'Access-Control-Request-Headers': 'Link'\n }\n })\n }\n let count = 0;\n const size = maxResults > 100 ? 100 : maxResults;\n for await (const res of paginator(listPage, service, { before, size })) {\n if (!res.ok) {\n /* c8 ignore next 3 */\n if (res.status === 429) {\n throw new Error('rate limited')\n }\n\n /* c8 ignore next 2 */\n const errorMessage = await res.json();\n throw new Error(`${res.status} ${res.statusText} ${errorMessage ? '- ' + errorMessage.message : ''}`)\n }\n const page = await res.json();\n for (const upload of page) {\n if (++count > maxResults) {\n return\n }\n yield upload;\n }\n }\n }\n\n // Just a sugar so you don't have to pass around endpoint and token around.\n\n /**\n * Uploads files to web3.storage. Files are hashed in the client and uploaded as a single\n * [Content Addressed Archive(CAR)](https://github.com/ipld/specs/blob/master/block-layer/content-addressable-archives.md).\n * Takes a [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob)\n *\n * Returns the corresponding Content Identifier (CID).\n *\n * @example\n * ```js\n * const file = new File(['hello world'], 'hello.txt', { type: 'text/plain' })\n * const cid = await client.put([file])\n * ```\n * @param {Iterable} files\n * @param {PutOptions} [options]\n */\n put (files, options) {\n return Web3Storage.put(this, files, options)\n }\n\n /**\n * Uploads a CAR ([Content Addressed Archive](https://github.com/ipld/specs/blob/master/block-layer/content-addressable-archives.md)) file to web3.storage.\n * Takes a CarReader interface from @ipld/car\n *\n * Returns the corresponding Content Identifier (CID).\n *\n * @example\n * ```js\n * import fs from 'fs'\n * import { Readable } from 'stream'\n * import { CarReader, CarWriter } from '@ipld/car'\n * import * as raw from 'multiformats/codecs/raw'\n * import { CID } from 'multiformats/cid'\n * import { sha256 } from 'multiformats/hashes/sha2'\n *\n * async function getCar() {\n * const bytes = new TextEncoder().encode('random meaningless bytes')\n * const hash = await sha256.digest(raw.encode(bytes))\n * const cid = CID.create(1, raw.code, hash)\n *\n * // create the writer and set the header with a single root\n * const { writer, out } = await CarWriter.create([cid])\n * Readable.from(out).pipe(fs.createWriteStream('example.car'))\n\n * // store a new block, creates a new file entry in the CAR archive\n * await writer.put({ cid, bytes })\n * await writer.close()\n\n * const inStream = fs.createReadStream('example.car')\n * // read and parse the entire stream in one go, this will cache the contents of\n * // the car in memory so is not suitable for large files.\n * const reader = await CarReader.fromIterable(inStream)\n * return reader\n * }\n *\n * const car = await getCar()\n * const cid = await client.putCar(car)\n * ```\n * @param {import('@ipld/car/api').CarReader} car\n * @param {PutCarOptions} [options]\n */\n putCar (car, options) {\n return Web3Storage.putCar(this, car, options)\n }\n\n /**\n * Fetch the Content Addressed Archive by its root CID.\n * @param {CIDString} cid\n */\n get (cid) {\n return Web3Storage.get(this, cid)\n }\n\n /**\n * @param {CIDString} cid\n */\n /* c8 ignore next 3 */\n delete (cid) {\n return Web3Storage.delete(this, cid)\n }\n\n /**\n * Fetch info on Filecoin deals and IPFS pins that a given CID is replicated in.\n * @param {CIDString} cid\n */\n status (cid) {\n return Web3Storage.status(this, cid)\n }\n\n /**\n * Find all uploads for this account. Use a `for await...of` loop to fetch them all.\n * @example\n * Fetch all the uploads\n * ```js\n * const uploads = []\n * for await (const item of client.list()) {\n * uploads.push(item)\n * }\n * ```\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of\n * @param {object} [opts]\n * @param {string} [opts.before] list items uploaded before this ISO 8601 date string\n * @param {number} [opts.maxResults] maximum number of results to return\n * @returns {AsyncIterable}\n */\n list (opts) {\n return Web3Storage.list(this, opts)\n }\n}\n\n/**\n * Map a UnixFSEntry to a File with a cid property\n * @param {UnixFSEntry} entry\n * @returns {Promise}\n */\nasync function toWeb3File ({ content, path, cid }) {\n const chunks = [];\n for await (const chunk of content()) {\n chunks.push(chunk);\n }\n const file$1 = new file.File(chunks, toFilenameWithPath(path));\n return Object.assign(file$1, { cid: cid.toString() })\n}\n\n/**\n * Trim the root cid from the path if there is anyting after it.\n * bafy...ic2q/path/to/pinpie.jpg => path/to/pinpie.jpg\n * bafy...ic2q/pinpie.jpg => pinpie.jpg\n * bafk...52zy => bafk...52zy\n * @param {string} unixFsPath\n * @returns {string}\n */\nfunction toFilenameWithPath (unixFsPath) {\n const slashIndex = unixFsPath.indexOf('/');\n return slashIndex === -1 ? unixFsPath : unixFsPath.substring(slashIndex + 1)\n}\n\n/**\n * Add car unpacking smarts to the response object,\n * @param {Response} res\n * @returns {Web3Response}\n */\nfunction toWeb3Response (res) {\n const response = Object.assign(res, {\n unixFsIterator: async function * () {\n if (!res.ok) {\n throw new Error(`Response was not ok: ${res.status} ${res.statusText} - Check for { \"ok\": false } on the Response object before calling .unixFsIterator`)\n }\n /* c8 ignore next 3 */\n if (!res.body) {\n throw new Error('No body on response')\n }\n const blockstore = new fs.FsBlockStore();\n try {\n for await (const entry of unpack.unpackStream(res.body, { blockstore })) {\n yield entry;\n }\n } finally {\n await blockstore.close();\n }\n },\n files: async () => {\n if (!res.ok) {\n throw new Error(`Response was not ok: ${res.status} ${res.statusText} - Check for { \"ok\": false } on the Response object before calling .files`)\n }\n const files = [];\n // @ts-ignore we're using the enriched response here\n for await (const entry of response.unixFsIterator()) {\n if (entry.type === 'directory') {\n continue\n }\n const file = await toWeb3File(entry);\n files.push(file);\n }\n return files\n }\n });\n return response\n}\n\n/**\n * Convert the passed file to an \"import candidate\" - an object suitable for\n * passing to the ipfs-unixfs-importer. Note: content is an accessor so that\n * the stream is only created when needed.\n *\n * @param {Filelike} file\n */\nfunction toImportCandidate (file) {\n /** @type {ReadableStream} */\n let stream;\n return {\n path: file.name,\n get content () {\n stream = stream || file.stream();\n return stream\n }\n }\n}\n\n/**\n * Follow Link headers on a Response, to fetch all the things.\n *\n * @param {(service: Service, opts: any) => Promise} fn\n * @param {Service} service\n * @param {{}} opts\n */\nasync function * paginator (fn, service, opts) {\n let res = await fn(service, opts);\n yield res;\n let link = parseLinkHeader.parseLinkHeader(res.headers.get('Link') || '');\n // @ts-ignore\n while (link && link.next) {\n // @ts-ignore\n res = await fn(service, link.next);\n yield res;\n link = parseLinkHeader.parseLinkHeader(res.headers.get('Link') || '');\n }\n}\n\nObject.defineProperty(exports, 'filesFromPath', {\n enumerable: true,\n get: function () { return filesFromPath.filesFromPath; }\n});\nObject.defineProperty(exports, 'getFilesFromPath', {\n enumerable: true,\n get: function () { return filesFromPath.getFilesFromPath; }\n});\nObject.defineProperty(exports, 'Blob', {\n enumerable: true,\n get: function () { return blob.Blob; }\n});\nObject.defineProperty(exports, 'File', {\n enumerable: true,\n get: function () { return file.File; }\n});\nexports.Web3Storage = Web3Storage;\nexports.createRateLimiter = createRateLimiter;\n//# sourceMappingURL=lib.cjs.map\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","\nif (typeof __webpack_require__ !== 'undefined') __webpack_require__.ab = __dirname + \"/\";","const core = require('@actions/core')\nconst { addToWeb3, pickName } = require('./web3')\n\nasync function run () {\n try {\n const name = pickName({\n repo: process.env.GITHUB_REPOSITORY,\n run: process.env.GITHUB_RUN_NUMBER,\n sha: process.env.GITHUB_SHA\n })\n const endpoint = new URL(core.getInput('web3_api'))\n const pathToAdd = core.getInput('path_to_add')\n const token = core.getInput('web3_token')\n const includeHidden = core.getInput('include_hidden')\n const wrapWithDirectory = core.getBooleanInput('wrap_with_directory')\n core.info(`Adding ${pathToAdd} to ${endpoint.origin}`)\n const { cid, url } = await addToWeb3({ endpoint, token, name, pathToAdd, wrapWithDirectory, includeHidden })\n core.info(url)\n core.setOutput('cid', cid)\n core.setOutput('url', url)\n } catch (error) {\n core.setFailed(error.message)\n }\n}\n\nrun()\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/licenses.txt b/dist/licenses.txt index c14af4d..247c1db 100644 --- a/dist/licenses.txt +++ b/dist/licenses.txt @@ -311,16 +311,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -@vercel/ncc -MIT -Copyright 2018 ZEIT, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - @web-std/blob MIT Copyright 2019 Irakli Gozalishvili. All rights reserved. @@ -1045,6 +1035,19 @@ THE SOFTWARE. uint8arrays MIT +uuid +MIT +The MIT License (MIT) + +Copyright (c) 2010-2020 Robert Kieffer and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + varint MIT diff --git a/dist/sourcemap-register.js b/dist/sourcemap-register.js index 56566f1..466141d 100644 --- a/dist/sourcemap-register.js +++ b/dist/sourcemap-register.js @@ -1 +1 @@ -(()=>{var e={650:e=>{var r=Object.prototype.toString;var n=typeof Buffer.alloc==="function"&&typeof Buffer.allocUnsafe==="function"&&typeof Buffer.from==="function";function isArrayBuffer(e){return r.call(e).slice(8,-1)==="ArrayBuffer"}function fromArrayBuffer(e,r,t){r>>>=0;var o=e.byteLength-r;if(o<0){throw new RangeError("'offset' is out of bounds")}if(t===undefined){t=o}else{t>>>=0;if(t>o){throw new RangeError("'length' is out of bounds")}}return n?Buffer.from(e.slice(r,r+t)):new Buffer(new Uint8Array(e.slice(r,r+t)))}function fromString(e,r){if(typeof r!=="string"||r===""){r="utf8"}if(!Buffer.isEncoding(r)){throw new TypeError('"encoding" must be a valid string encoding')}return n?Buffer.from(e,r):new Buffer(e,r)}function bufferFrom(e,r,t){if(typeof e==="number"){throw new TypeError('"value" argument must not be a number')}if(isArrayBuffer(e)){return fromArrayBuffer(e,r,t)}if(typeof e==="string"){return fromString(e,r)}return n?Buffer.from(e):new Buffer(e)}e.exports=bufferFrom},284:(e,r,n)=>{e=n.nmd(e);var t=n(596).SourceMapConsumer;var o=n(622);var i;try{i=n(747);if(!i.existsSync||!i.readFileSync){i=null}}catch(e){}var a=n(650);function dynamicRequire(e,r){return e.require(r)}var u=false;var s=false;var l=false;var c="auto";var p={};var f={};var g=/^data:application\/json[^,]+base64,/;var h=[];var d=[];function isInBrowser(){if(c==="browser")return true;if(c==="node")return false;return typeof window!=="undefined"&&typeof XMLHttpRequest==="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}function hasGlobalProcessEventEmitter(){return typeof process==="object"&&process!==null&&typeof process.on==="function"}function handlerExec(e){return function(r){for(var n=0;n"}var n=this.getLineNumber();if(n!=null){r+=":"+n;var t=this.getColumnNumber();if(t){r+=":"+t}}}var o="";var i=this.getFunctionName();var a=true;var u=this.isConstructor();var s=!(this.isToplevel()||u);if(s){var l=this.getTypeName();if(l==="[object Object]"){l="null"}var c=this.getMethodName();if(i){if(l&&i.indexOf(l)!=0){o+=l+"."}o+=i;if(c&&i.indexOf("."+c)!=i.length-c.length-1){o+=" [as "+c+"]"}}else{o+=l+"."+(c||"")}}else if(u){o+="new "+(i||"")}else if(i){o+=i}else{o+=r;a=false}if(a){o+=" ("+r+")"}return o}function cloneCallSite(e){var r={};Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(n){r[n]=/^(?:is|get)/.test(n)?function(){return e[n].call(e)}:e[n]}));r.toString=CallSiteToString;return r}function wrapCallSite(e,r){if(r===undefined){r={nextPosition:null,curPosition:null}}if(e.isNative()){r.curPosition=null;return e}var n=e.getFileName()||e.getScriptNameOrSourceURL();if(n){var t=e.getLineNumber();var o=e.getColumnNumber()-1;var i=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/;var a=i.test(process.version)?0:62;if(t===1&&o>a&&!isInBrowser()&&!e.isEval()){o-=a}var u=mapSourcePosition({source:n,line:t,column:o});r.curPosition=u;e=cloneCallSite(e);var s=e.getFunctionName;e.getFunctionName=function(){if(r.nextPosition==null){return s()}return r.nextPosition.name||s()};e.getFileName=function(){return u.source};e.getLineNumber=function(){return u.line};e.getColumnNumber=function(){return u.column+1};e.getScriptNameOrSourceURL=function(){return u.source};return e}var l=e.isEval()&&e.getEvalOrigin();if(l){l=mapEvalOrigin(l);e=cloneCallSite(e);e.getEvalOrigin=function(){return l};return e}return e}function prepareStackTrace(e,r){if(l){p={};f={}}var n=e.name||"Error";var t=e.message||"";var o=n+": "+t;var i={nextPosition:null,curPosition:null};var a=[];for(var u=r.length-1;u>=0;u--){a.push("\n at "+wrapCallSite(r[u],i));i.nextPosition=i.curPosition}i.curPosition=i.nextPosition=null;return o+a.reverse().join("")}function getErrorSource(e){var r=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(e.stack);if(r){var n=r[1];var t=+r[2];var o=+r[3];var a=p[n];if(!a&&i&&i.existsSync(n)){try{a=i.readFileSync(n,"utf8")}catch(e){a=""}}if(a){var u=a.split(/(?:\r\n|\r|\n)/)[t-1];if(u){return n+":"+t+"\n"+u+"\n"+new Array(o).join(" ")+"^"}}}return null}function printErrorAndExit(e){var r=getErrorSource(e);if(process.stderr._handle&&process.stderr._handle.setBlocking){process.stderr._handle.setBlocking(true)}if(r){console.error();console.error(r)}console.error(e.stack);process.exit(1)}function shimEmitUncaughtException(){var e=process.emit;process.emit=function(r){if(r==="uncaughtException"){var n=arguments[1]&&arguments[1].stack;var t=this.listeners(r).length>0;if(n&&!t){return printErrorAndExit(arguments[1])}}return e.apply(this,arguments)}}var S=h.slice(0);var _=d.slice(0);r.wrapCallSite=wrapCallSite;r.getErrorSource=getErrorSource;r.mapSourcePosition=mapSourcePosition;r.retrieveSourceMap=v;r.install=function(r){r=r||{};if(r.environment){c=r.environment;if(["node","browser","auto"].indexOf(c)===-1){throw new Error("environment "+c+" was unknown. Available options are {auto, browser, node}")}}if(r.retrieveFile){if(r.overrideRetrieveFile){h.length=0}h.unshift(r.retrieveFile)}if(r.retrieveSourceMap){if(r.overrideRetrieveSourceMap){d.length=0}d.unshift(r.retrieveSourceMap)}if(r.hookRequire&&!isInBrowser()){var n=dynamicRequire(e,"module");var t=n.prototype._compile;if(!t.__sourceMapSupport){n.prototype._compile=function(e,r){p[r]=e;f[r]=undefined;return t.call(this,e,r)};n.prototype._compile.__sourceMapSupport=true}}if(!l){l="emptyCacheBetweenOperations"in r?r.emptyCacheBetweenOperations:false}if(!u){u=true;Error.prepareStackTrace=prepareStackTrace}if(!s){var o="handleUncaughtExceptions"in r?r.handleUncaughtExceptions:true;try{var i=dynamicRequire(e,"worker_threads");if(i.isMainThread===false){o=false}}catch(e){}if(o&&hasGlobalProcessEventEmitter()){s=true;shimEmitUncaughtException()}}};r.resetRetrieveHandlers=function(){h.length=0;d.length=0;h=S.slice(0);d=_.slice(0);v=handlerExec(d);m=handlerExec(h)}},837:(e,r,n)=>{var t=n(983);var o=Object.prototype.hasOwnProperty;var i=typeof Map!=="undefined";function ArraySet(){this._array=[];this._set=i?new Map:Object.create(null)}ArraySet.fromArray=function ArraySet_fromArray(e,r){var n=new ArraySet;for(var t=0,o=e.length;t=0){return r}}else{var n=t.toSetString(e);if(o.call(this._set,n)){return this._set[n]}}throw new Error('"'+e+'" is not in the set.')};ArraySet.prototype.at=function ArraySet_at(e){if(e>=0&&e{var t=n(537);var o=5;var i=1<>1;return r?-n:n}r.encode=function base64VLQ_encode(e){var r="";var n;var i=toVLQSigned(e);do{n=i&a;i>>>=o;if(i>0){n|=u}r+=t.encode(n)}while(i>0);return r};r.decode=function base64VLQ_decode(e,r,n){var i=e.length;var s=0;var l=0;var c,p;do{if(r>=i){throw new Error("Expected more digits in base 64 VLQ value.")}p=t.decode(e.charCodeAt(r++));if(p===-1){throw new Error("Invalid base64 digit: "+e.charAt(r-1))}c=!!(p&u);p&=a;s=s+(p<{var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");r.encode=function(e){if(0<=e&&e{r.GREATEST_LOWER_BOUND=1;r.LEAST_UPPER_BOUND=2;function recursiveSearch(e,n,t,o,i,a){var u=Math.floor((n-e)/2)+e;var s=i(t,o[u],true);if(s===0){return u}else if(s>0){if(n-u>1){return recursiveSearch(u,n,t,o,i,a)}if(a==r.LEAST_UPPER_BOUND){return n1){return recursiveSearch(e,u,t,o,i,a)}if(a==r.LEAST_UPPER_BOUND){return u}else{return e<0?-1:e}}}r.search=function search(e,n,t,o){if(n.length===0){return-1}var i=recursiveSearch(-1,n.length,e,n,t,o||r.GREATEST_LOWER_BOUND);if(i<0){return-1}while(i-1>=0){if(t(n[i],n[i-1],true)!==0){break}--i}return i}},740:(e,r,n)=>{var t=n(983);function generatedPositionAfter(e,r){var n=e.generatedLine;var o=r.generatedLine;var i=e.generatedColumn;var a=r.generatedColumn;return o>n||o==n&&a>=i||t.compareByGeneratedPositionsInflated(e,r)<=0}function MappingList(){this._array=[];this._sorted=true;this._last={generatedLine:-1,generatedColumn:0}}MappingList.prototype.unsortedForEach=function MappingList_forEach(e,r){this._array.forEach(e,r)};MappingList.prototype.add=function MappingList_add(e){if(generatedPositionAfter(this._last,e)){this._last=e;this._array.push(e)}else{this._sorted=false;this._array.push(e)}};MappingList.prototype.toArray=function MappingList_toArray(){if(!this._sorted){this._array.sort(t.compareByGeneratedPositionsInflated);this._sorted=true}return this._array};r.H=MappingList},226:(e,r)=>{function swap(e,r,n){var t=e[r];e[r]=e[n];e[n]=t}function randomIntInRange(e,r){return Math.round(e+Math.random()*(r-e))}function doQuickSort(e,r,n,t){if(n{var t;var o=n(983);var i=n(164);var a=n(837).I;var u=n(215);var s=n(226).U;function SourceMapConsumer(e,r){var n=e;if(typeof e==="string"){n=o.parseSourceMapInput(e)}return n.sections!=null?new IndexedSourceMapConsumer(n,r):new BasicSourceMapConsumer(n,r)}SourceMapConsumer.fromSourceMap=function(e,r){return BasicSourceMapConsumer.fromSourceMap(e,r)};SourceMapConsumer.prototype._version=3;SourceMapConsumer.prototype.__generatedMappings=null;Object.defineProperty(SourceMapConsumer.prototype,"_generatedMappings",{configurable:true,enumerable:true,get:function(){if(!this.__generatedMappings){this._parseMappings(this._mappings,this.sourceRoot)}return this.__generatedMappings}});SourceMapConsumer.prototype.__originalMappings=null;Object.defineProperty(SourceMapConsumer.prototype,"_originalMappings",{configurable:true,enumerable:true,get:function(){if(!this.__originalMappings){this._parseMappings(this._mappings,this.sourceRoot)}return this.__originalMappings}});SourceMapConsumer.prototype._charIsMappingSeparator=function SourceMapConsumer_charIsMappingSeparator(e,r){var n=e.charAt(r);return n===";"||n===","};SourceMapConsumer.prototype._parseMappings=function SourceMapConsumer_parseMappings(e,r){throw new Error("Subclasses must implement _parseMappings")};SourceMapConsumer.GENERATED_ORDER=1;SourceMapConsumer.ORIGINAL_ORDER=2;SourceMapConsumer.GREATEST_LOWER_BOUND=1;SourceMapConsumer.LEAST_UPPER_BOUND=2;SourceMapConsumer.prototype.eachMapping=function SourceMapConsumer_eachMapping(e,r,n){var t=r||null;var i=n||SourceMapConsumer.GENERATED_ORDER;var a;switch(i){case SourceMapConsumer.GENERATED_ORDER:a=this._generatedMappings;break;case SourceMapConsumer.ORIGINAL_ORDER:a=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var u=this.sourceRoot;a.map((function(e){var r=e.source===null?null:this._sources.at(e.source);r=o.computeSourceURL(u,r,this._sourceMapURL);return{source:r,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:e.name===null?null:this._names.at(e.name)}}),this).forEach(e,t)};SourceMapConsumer.prototype.allGeneratedPositionsFor=function SourceMapConsumer_allGeneratedPositionsFor(e){var r=o.getArg(e,"line");var n={source:o.getArg(e,"source"),originalLine:r,originalColumn:o.getArg(e,"column",0)};n.source=this._findSourceIndex(n.source);if(n.source<0){return[]}var t=[];var a=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",o.compareByOriginalPositions,i.LEAST_UPPER_BOUND);if(a>=0){var u=this._originalMappings[a];if(e.column===undefined){var s=u.originalLine;while(u&&u.originalLine===s){t.push({line:o.getArg(u,"generatedLine",null),column:o.getArg(u,"generatedColumn",null),lastColumn:o.getArg(u,"lastGeneratedColumn",null)});u=this._originalMappings[++a]}}else{var l=u.originalColumn;while(u&&u.originalLine===r&&u.originalColumn==l){t.push({line:o.getArg(u,"generatedLine",null),column:o.getArg(u,"generatedColumn",null),lastColumn:o.getArg(u,"lastGeneratedColumn",null)});u=this._originalMappings[++a]}}}return t};r.SourceMapConsumer=SourceMapConsumer;function BasicSourceMapConsumer(e,r){var n=e;if(typeof e==="string"){n=o.parseSourceMapInput(e)}var t=o.getArg(n,"version");var i=o.getArg(n,"sources");var u=o.getArg(n,"names",[]);var s=o.getArg(n,"sourceRoot",null);var l=o.getArg(n,"sourcesContent",null);var c=o.getArg(n,"mappings");var p=o.getArg(n,"file",null);if(t!=this._version){throw new Error("Unsupported version: "+t)}if(s){s=o.normalize(s)}i=i.map(String).map(o.normalize).map((function(e){return s&&o.isAbsolute(s)&&o.isAbsolute(e)?o.relative(s,e):e}));this._names=a.fromArray(u.map(String),true);this._sources=a.fromArray(i,true);this._absoluteSources=this._sources.toArray().map((function(e){return o.computeSourceURL(s,e,r)}));this.sourceRoot=s;this.sourcesContent=l;this._mappings=c;this._sourceMapURL=r;this.file=p}BasicSourceMapConsumer.prototype=Object.create(SourceMapConsumer.prototype);BasicSourceMapConsumer.prototype.consumer=SourceMapConsumer;BasicSourceMapConsumer.prototype._findSourceIndex=function(e){var r=e;if(this.sourceRoot!=null){r=o.relative(this.sourceRoot,r)}if(this._sources.has(r)){return this._sources.indexOf(r)}var n;for(n=0;n1){v.source=l+_[1];l+=_[1];v.originalLine=i+_[2];i=v.originalLine;v.originalLine+=1;v.originalColumn=a+_[3];a=v.originalColumn;if(_.length>4){v.name=c+_[4];c+=_[4]}}m.push(v);if(typeof v.originalLine==="number"){d.push(v)}}}s(m,o.compareByGeneratedPositionsDeflated);this.__generatedMappings=m;s(d,o.compareByOriginalPositions);this.__originalMappings=d};BasicSourceMapConsumer.prototype._findMapping=function SourceMapConsumer_findMapping(e,r,n,t,o,a){if(e[n]<=0){throw new TypeError("Line must be greater than or equal to 1, got "+e[n])}if(e[t]<0){throw new TypeError("Column must be greater than or equal to 0, got "+e[t])}return i.search(e,r,o,a)};BasicSourceMapConsumer.prototype.computeColumnSpans=function SourceMapConsumer_computeColumnSpans(){for(var e=0;e=0){var t=this._generatedMappings[n];if(t.generatedLine===r.generatedLine){var i=o.getArg(t,"source",null);if(i!==null){i=this._sources.at(i);i=o.computeSourceURL(this.sourceRoot,i,this._sourceMapURL)}var a=o.getArg(t,"name",null);if(a!==null){a=this._names.at(a)}return{source:i,line:o.getArg(t,"originalLine",null),column:o.getArg(t,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}};BasicSourceMapConsumer.prototype.hasContentsOfAllSources=function BasicSourceMapConsumer_hasContentsOfAllSources(){if(!this.sourcesContent){return false}return this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(e){return e==null}))};BasicSourceMapConsumer.prototype.sourceContentFor=function SourceMapConsumer_sourceContentFor(e,r){if(!this.sourcesContent){return null}var n=this._findSourceIndex(e);if(n>=0){return this.sourcesContent[n]}var t=e;if(this.sourceRoot!=null){t=o.relative(this.sourceRoot,t)}var i;if(this.sourceRoot!=null&&(i=o.urlParse(this.sourceRoot))){var a=t.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(a)){return this.sourcesContent[this._sources.indexOf(a)]}if((!i.path||i.path=="/")&&this._sources.has("/"+t)){return this.sourcesContent[this._sources.indexOf("/"+t)]}}if(r){return null}else{throw new Error('"'+t+'" is not in the SourceMap.')}};BasicSourceMapConsumer.prototype.generatedPositionFor=function SourceMapConsumer_generatedPositionFor(e){var r=o.getArg(e,"source");r=this._findSourceIndex(r);if(r<0){return{line:null,column:null,lastColumn:null}}var n={source:r,originalLine:o.getArg(e,"line"),originalColumn:o.getArg(e,"column")};var t=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",o.compareByOriginalPositions,o.getArg(e,"bias",SourceMapConsumer.GREATEST_LOWER_BOUND));if(t>=0){var i=this._originalMappings[t];if(i.source===n.source){return{line:o.getArg(i,"generatedLine",null),column:o.getArg(i,"generatedColumn",null),lastColumn:o.getArg(i,"lastGeneratedColumn",null)}}}return{line:null,column:null,lastColumn:null}};t=BasicSourceMapConsumer;function IndexedSourceMapConsumer(e,r){var n=e;if(typeof e==="string"){n=o.parseSourceMapInput(e)}var t=o.getArg(n,"version");var i=o.getArg(n,"sections");if(t!=this._version){throw new Error("Unsupported version: "+t)}this._sources=new a;this._names=new a;var u={line:-1,column:0};this._sections=i.map((function(e){if(e.url){throw new Error("Support for url field in sections not implemented.")}var n=o.getArg(e,"offset");var t=o.getArg(n,"line");var i=o.getArg(n,"column");if(t{var t=n(215);var o=n(983);var i=n(837).I;var a=n(740).H;function SourceMapGenerator(e){if(!e){e={}}this._file=o.getArg(e,"file",null);this._sourceRoot=o.getArg(e,"sourceRoot",null);this._skipValidation=o.getArg(e,"skipValidation",false);this._sources=new i;this._names=new i;this._mappings=new a;this._sourcesContents=null}SourceMapGenerator.prototype._version=3;SourceMapGenerator.fromSourceMap=function SourceMapGenerator_fromSourceMap(e){var r=e.sourceRoot;var n=new SourceMapGenerator({file:e.file,sourceRoot:r});e.eachMapping((function(e){var t={generated:{line:e.generatedLine,column:e.generatedColumn}};if(e.source!=null){t.source=e.source;if(r!=null){t.source=o.relative(r,t.source)}t.original={line:e.originalLine,column:e.originalColumn};if(e.name!=null){t.name=e.name}}n.addMapping(t)}));e.sources.forEach((function(t){var i=t;if(r!==null){i=o.relative(r,t)}if(!n._sources.has(i)){n._sources.add(i)}var a=e.sourceContentFor(t);if(a!=null){n.setSourceContent(t,a)}}));return n};SourceMapGenerator.prototype.addMapping=function SourceMapGenerator_addMapping(e){var r=o.getArg(e,"generated");var n=o.getArg(e,"original",null);var t=o.getArg(e,"source",null);var i=o.getArg(e,"name",null);if(!this._skipValidation){this._validateMapping(r,n,t,i)}if(t!=null){t=String(t);if(!this._sources.has(t)){this._sources.add(t)}}if(i!=null){i=String(i);if(!this._names.has(i)){this._names.add(i)}}this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:t,name:i})};SourceMapGenerator.prototype.setSourceContent=function SourceMapGenerator_setSourceContent(e,r){var n=e;if(this._sourceRoot!=null){n=o.relative(this._sourceRoot,n)}if(r!=null){if(!this._sourcesContents){this._sourcesContents=Object.create(null)}this._sourcesContents[o.toSetString(n)]=r}else if(this._sourcesContents){delete this._sourcesContents[o.toSetString(n)];if(Object.keys(this._sourcesContents).length===0){this._sourcesContents=null}}};SourceMapGenerator.prototype.applySourceMap=function SourceMapGenerator_applySourceMap(e,r,n){var t=r;if(r==null){if(e.file==null){throw new Error("SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, "+'or the source map\'s "file" property. Both were omitted.')}t=e.file}var a=this._sourceRoot;if(a!=null){t=o.relative(a,t)}var u=new i;var s=new i;this._mappings.unsortedForEach((function(r){if(r.source===t&&r.originalLine!=null){var i=e.originalPositionFor({line:r.originalLine,column:r.originalColumn});if(i.source!=null){r.source=i.source;if(n!=null){r.source=o.join(n,r.source)}if(a!=null){r.source=o.relative(a,r.source)}r.originalLine=i.line;r.originalColumn=i.column;if(i.name!=null){r.name=i.name}}}var l=r.source;if(l!=null&&!u.has(l)){u.add(l)}var c=r.name;if(c!=null&&!s.has(c)){s.add(c)}}),this);this._sources=u;this._names=s;e.sources.forEach((function(r){var t=e.sourceContentFor(r);if(t!=null){if(n!=null){r=o.join(n,r)}if(a!=null){r=o.relative(a,r)}this.setSourceContent(r,t)}}),this)};SourceMapGenerator.prototype._validateMapping=function SourceMapGenerator_validateMapping(e,r,n,t){if(r&&typeof r.line!=="number"&&typeof r.column!=="number"){throw new Error("original.line and original.column are not numbers -- you probably meant to omit "+"the original mapping entirely and only map the generated position. If so, pass "+"null for the original mapping instead of an object with empty or null values.")}if(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!r&&!n&&!t){return}else if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&n){return}else{throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:r,name:t}))}};SourceMapGenerator.prototype._serializeMappings=function SourceMapGenerator_serializeMappings(){var e=0;var r=1;var n=0;var i=0;var a=0;var u=0;var s="";var l;var c;var p;var f;var g=this._mappings.toArray();for(var h=0,d=g.length;h0){if(!o.compareByGeneratedPositionsInflated(c,g[h-1])){continue}l+=","}}l+=t.encode(c.generatedColumn-e);e=c.generatedColumn;if(c.source!=null){f=this._sources.indexOf(c.source);l+=t.encode(f-u);u=f;l+=t.encode(c.originalLine-1-i);i=c.originalLine-1;l+=t.encode(c.originalColumn-n);n=c.originalColumn;if(c.name!=null){p=this._names.indexOf(c.name);l+=t.encode(p-a);a=p}}s+=l}return s};SourceMapGenerator.prototype._generateSourcesContent=function SourceMapGenerator_generateSourcesContent(e,r){return e.map((function(e){if(!this._sourcesContents){return null}if(r!=null){e=o.relative(r,e)}var n=o.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null}),this)};SourceMapGenerator.prototype.toJSON=function SourceMapGenerator_toJSON(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null){e.file=this._file}if(this._sourceRoot!=null){e.sourceRoot=this._sourceRoot}if(this._sourcesContents){e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)}return e};SourceMapGenerator.prototype.toString=function SourceMapGenerator_toString(){return JSON.stringify(this.toJSON())};r.h=SourceMapGenerator},990:(e,r,n)=>{var t;var o=n(341).h;var i=n(983);var a=/(\r?\n)/;var u=10;var s="$$$isSourceNode$$$";function SourceNode(e,r,n,t,o){this.children=[];this.sourceContents={};this.line=e==null?null:e;this.column=r==null?null:r;this.source=n==null?null:n;this.name=o==null?null:o;this[s]=true;if(t!=null)this.add(t)}SourceNode.fromStringWithSourceMap=function SourceNode_fromStringWithSourceMap(e,r,n){var t=new SourceNode;var o=e.split(a);var u=0;var shiftNextLine=function(){var e=getNextLine();var r=getNextLine()||"";return e+r;function getNextLine(){return u=0;r--){this.prepend(e[r])}}else if(e[s]||typeof e==="string"){this.children.unshift(e)}else{throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e)}return this};SourceNode.prototype.walk=function SourceNode_walk(e){var r;for(var n=0,t=this.children.length;n0){r=[];for(n=0;n{function getArg(e,r,n){if(r in e){return e[r]}else if(arguments.length===3){return n}else{throw new Error('"'+r+'" is a required argument.')}}r.getArg=getArg;var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;var t=/^data:.+\,.+$/;function urlParse(e){var r=e.match(n);if(!r){return null}return{scheme:r[1],auth:r[2],host:r[3],port:r[4],path:r[5]}}r.urlParse=urlParse;function urlGenerate(e){var r="";if(e.scheme){r+=e.scheme+":"}r+="//";if(e.auth){r+=e.auth+"@"}if(e.host){r+=e.host}if(e.port){r+=":"+e.port}if(e.path){r+=e.path}return r}r.urlGenerate=urlGenerate;function normalize(e){var n=e;var t=urlParse(e);if(t){if(!t.path){return e}n=t.path}var o=r.isAbsolute(n);var i=n.split(/\/+/);for(var a,u=0,s=i.length-1;s>=0;s--){a=i[s];if(a==="."){i.splice(s,1)}else if(a===".."){u++}else if(u>0){if(a===""){i.splice(s+1,u);u=0}else{i.splice(s,2);u--}}}n=i.join("/");if(n===""){n=o?"/":"."}if(t){t.path=n;return urlGenerate(t)}return n}r.normalize=normalize;function join(e,r){if(e===""){e="."}if(r===""){r="."}var n=urlParse(r);var o=urlParse(e);if(o){e=o.path||"/"}if(n&&!n.scheme){if(o){n.scheme=o.scheme}return urlGenerate(n)}if(n||r.match(t)){return r}if(o&&!o.host&&!o.path){o.host=r;return urlGenerate(o)}var i=r.charAt(0)==="/"?r:normalize(e.replace(/\/+$/,"")+"/"+r);if(o){o.path=i;return urlGenerate(o)}return i}r.join=join;r.isAbsolute=function(e){return e.charAt(0)==="/"||n.test(e)};function relative(e,r){if(e===""){e="."}e=e.replace(/\/$/,"");var n=0;while(r.indexOf(e+"/")!==0){var t=e.lastIndexOf("/");if(t<0){return r}e=e.slice(0,t);if(e.match(/^([^\/]+:\/)?\/*$/)){return r}++n}return Array(n+1).join("../")+r.substr(e.length+1)}r.relative=relative;var o=function(){var e=Object.create(null);return!("__proto__"in e)}();function identity(e){return e}function toSetString(e){if(isProtoString(e)){return"$"+e}return e}r.toSetString=o?identity:toSetString;function fromSetString(e){if(isProtoString(e)){return e.slice(1)}return e}r.fromSetString=o?identity:fromSetString;function isProtoString(e){if(!e){return false}var r=e.length;if(r<9){return false}if(e.charCodeAt(r-1)!==95||e.charCodeAt(r-2)!==95||e.charCodeAt(r-3)!==111||e.charCodeAt(r-4)!==116||e.charCodeAt(r-5)!==111||e.charCodeAt(r-6)!==114||e.charCodeAt(r-7)!==112||e.charCodeAt(r-8)!==95||e.charCodeAt(r-9)!==95){return false}for(var n=r-10;n>=0;n--){if(e.charCodeAt(n)!==36){return false}}return true}function compareByOriginalPositions(e,r,n){var t=strcmp(e.source,r.source);if(t!==0){return t}t=e.originalLine-r.originalLine;if(t!==0){return t}t=e.originalColumn-r.originalColumn;if(t!==0||n){return t}t=e.generatedColumn-r.generatedColumn;if(t!==0){return t}t=e.generatedLine-r.generatedLine;if(t!==0){return t}return strcmp(e.name,r.name)}r.compareByOriginalPositions=compareByOriginalPositions;function compareByGeneratedPositionsDeflated(e,r,n){var t=e.generatedLine-r.generatedLine;if(t!==0){return t}t=e.generatedColumn-r.generatedColumn;if(t!==0||n){return t}t=strcmp(e.source,r.source);if(t!==0){return t}t=e.originalLine-r.originalLine;if(t!==0){return t}t=e.originalColumn-r.originalColumn;if(t!==0){return t}return strcmp(e.name,r.name)}r.compareByGeneratedPositionsDeflated=compareByGeneratedPositionsDeflated;function strcmp(e,r){if(e===r){return 0}if(e===null){return 1}if(r===null){return-1}if(e>r){return 1}return-1}function compareByGeneratedPositionsInflated(e,r){var n=e.generatedLine-r.generatedLine;if(n!==0){return n}n=e.generatedColumn-r.generatedColumn;if(n!==0){return n}n=strcmp(e.source,r.source);if(n!==0){return n}n=e.originalLine-r.originalLine;if(n!==0){return n}n=e.originalColumn-r.originalColumn;if(n!==0){return n}return strcmp(e.name,r.name)}r.compareByGeneratedPositionsInflated=compareByGeneratedPositionsInflated;function parseSourceMapInput(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}r.parseSourceMapInput=parseSourceMapInput;function computeSourceURL(e,r,n){r=r||"";if(e){if(e[e.length-1]!=="/"&&r[0]!=="/"){e+="/"}r=e+r}if(n){var t=urlParse(n);if(!t){throw new Error("sourceMapURL could not be parsed")}if(t.path){var o=t.path.lastIndexOf("/");if(o>=0){t.path=t.path.substring(0,o+1)}}r=join(urlGenerate(t),r)}return normalize(r)}r.computeSourceURL=computeSourceURL},596:(e,r,n)=>{n(341).h;r.SourceMapConsumer=n(327).SourceMapConsumer;n(990)},747:e=>{"use strict";e.exports=require("fs")},622:e=>{"use strict";e.exports=require("path")}};var r={};function __webpack_require__(n){var t=r[n];if(t!==undefined){return t.exports}var o=r[n]={id:n,loaded:false,exports:{}};var i=true;try{e[n](o,o.exports,__webpack_require__);i=false}finally{if(i)delete r[n]}o.loaded=true;return o.exports}(()=>{__webpack_require__.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();if(typeof __webpack_require__!=="undefined")__webpack_require__.ab=__dirname+"/";var n={};(()=>{__webpack_require__(284).install()})();module.exports=n})(); \ No newline at end of file +(()=>{var e={650:e=>{var r=Object.prototype.toString;var n=typeof Buffer.alloc==="function"&&typeof Buffer.allocUnsafe==="function"&&typeof Buffer.from==="function";function isArrayBuffer(e){return r.call(e).slice(8,-1)==="ArrayBuffer"}function fromArrayBuffer(e,r,t){r>>>=0;var o=e.byteLength-r;if(o<0){throw new RangeError("'offset' is out of bounds")}if(t===undefined){t=o}else{t>>>=0;if(t>o){throw new RangeError("'length' is out of bounds")}}return n?Buffer.from(e.slice(r,r+t)):new Buffer(new Uint8Array(e.slice(r,r+t)))}function fromString(e,r){if(typeof r!=="string"||r===""){r="utf8"}if(!Buffer.isEncoding(r)){throw new TypeError('"encoding" must be a valid string encoding')}return n?Buffer.from(e,r):new Buffer(e,r)}function bufferFrom(e,r,t){if(typeof e==="number"){throw new TypeError('"value" argument must not be a number')}if(isArrayBuffer(e)){return fromArrayBuffer(e,r,t)}if(typeof e==="string"){return fromString(e,r)}return n?Buffer.from(e):new Buffer(e)}e.exports=bufferFrom},274:(e,r,n)=>{var t=n(339);var o=Object.prototype.hasOwnProperty;var i=typeof Map!=="undefined";function ArraySet(){this._array=[];this._set=i?new Map:Object.create(null)}ArraySet.fromArray=function ArraySet_fromArray(e,r){var n=new ArraySet;for(var t=0,o=e.length;t=0){return r}}else{var n=t.toSetString(e);if(o.call(this._set,n)){return this._set[n]}}throw new Error('"'+e+'" is not in the set.')};ArraySet.prototype.at=function ArraySet_at(e){if(e>=0&&e{var t=n(190);var o=5;var i=1<>1;return r?-n:n}r.encode=function base64VLQ_encode(e){var r="";var n;var i=toVLQSigned(e);do{n=i&a;i>>>=o;if(i>0){n|=u}r+=t.encode(n)}while(i>0);return r};r.decode=function base64VLQ_decode(e,r,n){var i=e.length;var s=0;var l=0;var c,p;do{if(r>=i){throw new Error("Expected more digits in base 64 VLQ value.")}p=t.decode(e.charCodeAt(r++));if(p===-1){throw new Error("Invalid base64 digit: "+e.charAt(r-1))}c=!!(p&u);p&=a;s=s+(p<{var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");r.encode=function(e){if(0<=e&&e{r.GREATEST_LOWER_BOUND=1;r.LEAST_UPPER_BOUND=2;function recursiveSearch(e,n,t,o,i,a){var u=Math.floor((n-e)/2)+e;var s=i(t,o[u],true);if(s===0){return u}else if(s>0){if(n-u>1){return recursiveSearch(u,n,t,o,i,a)}if(a==r.LEAST_UPPER_BOUND){return n1){return recursiveSearch(e,u,t,o,i,a)}if(a==r.LEAST_UPPER_BOUND){return u}else{return e<0?-1:e}}}r.search=function search(e,n,t,o){if(n.length===0){return-1}var i=recursiveSearch(-1,n.length,e,n,t,o||r.GREATEST_LOWER_BOUND);if(i<0){return-1}while(i-1>=0){if(t(n[i],n[i-1],true)!==0){break}--i}return i}},680:(e,r,n)=>{var t=n(339);function generatedPositionAfter(e,r){var n=e.generatedLine;var o=r.generatedLine;var i=e.generatedColumn;var a=r.generatedColumn;return o>n||o==n&&a>=i||t.compareByGeneratedPositionsInflated(e,r)<=0}function MappingList(){this._array=[];this._sorted=true;this._last={generatedLine:-1,generatedColumn:0}}MappingList.prototype.unsortedForEach=function MappingList_forEach(e,r){this._array.forEach(e,r)};MappingList.prototype.add=function MappingList_add(e){if(generatedPositionAfter(this._last,e)){this._last=e;this._array.push(e)}else{this._sorted=false;this._array.push(e)}};MappingList.prototype.toArray=function MappingList_toArray(){if(!this._sorted){this._array.sort(t.compareByGeneratedPositionsInflated);this._sorted=true}return this._array};r.H=MappingList},758:(e,r)=>{function swap(e,r,n){var t=e[r];e[r]=e[n];e[n]=t}function randomIntInRange(e,r){return Math.round(e+Math.random()*(r-e))}function doQuickSort(e,r,n,t){if(n{var t;var o=n(339);var i=n(345);var a=n(274).I;var u=n(449);var s=n(758).U;function SourceMapConsumer(e,r){var n=e;if(typeof e==="string"){n=o.parseSourceMapInput(e)}return n.sections!=null?new IndexedSourceMapConsumer(n,r):new BasicSourceMapConsumer(n,r)}SourceMapConsumer.fromSourceMap=function(e,r){return BasicSourceMapConsumer.fromSourceMap(e,r)};SourceMapConsumer.prototype._version=3;SourceMapConsumer.prototype.__generatedMappings=null;Object.defineProperty(SourceMapConsumer.prototype,"_generatedMappings",{configurable:true,enumerable:true,get:function(){if(!this.__generatedMappings){this._parseMappings(this._mappings,this.sourceRoot)}return this.__generatedMappings}});SourceMapConsumer.prototype.__originalMappings=null;Object.defineProperty(SourceMapConsumer.prototype,"_originalMappings",{configurable:true,enumerable:true,get:function(){if(!this.__originalMappings){this._parseMappings(this._mappings,this.sourceRoot)}return this.__originalMappings}});SourceMapConsumer.prototype._charIsMappingSeparator=function SourceMapConsumer_charIsMappingSeparator(e,r){var n=e.charAt(r);return n===";"||n===","};SourceMapConsumer.prototype._parseMappings=function SourceMapConsumer_parseMappings(e,r){throw new Error("Subclasses must implement _parseMappings")};SourceMapConsumer.GENERATED_ORDER=1;SourceMapConsumer.ORIGINAL_ORDER=2;SourceMapConsumer.GREATEST_LOWER_BOUND=1;SourceMapConsumer.LEAST_UPPER_BOUND=2;SourceMapConsumer.prototype.eachMapping=function SourceMapConsumer_eachMapping(e,r,n){var t=r||null;var i=n||SourceMapConsumer.GENERATED_ORDER;var a;switch(i){case SourceMapConsumer.GENERATED_ORDER:a=this._generatedMappings;break;case SourceMapConsumer.ORIGINAL_ORDER:a=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var u=this.sourceRoot;a.map((function(e){var r=e.source===null?null:this._sources.at(e.source);r=o.computeSourceURL(u,r,this._sourceMapURL);return{source:r,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:e.name===null?null:this._names.at(e.name)}}),this).forEach(e,t)};SourceMapConsumer.prototype.allGeneratedPositionsFor=function SourceMapConsumer_allGeneratedPositionsFor(e){var r=o.getArg(e,"line");var n={source:o.getArg(e,"source"),originalLine:r,originalColumn:o.getArg(e,"column",0)};n.source=this._findSourceIndex(n.source);if(n.source<0){return[]}var t=[];var a=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",o.compareByOriginalPositions,i.LEAST_UPPER_BOUND);if(a>=0){var u=this._originalMappings[a];if(e.column===undefined){var s=u.originalLine;while(u&&u.originalLine===s){t.push({line:o.getArg(u,"generatedLine",null),column:o.getArg(u,"generatedColumn",null),lastColumn:o.getArg(u,"lastGeneratedColumn",null)});u=this._originalMappings[++a]}}else{var l=u.originalColumn;while(u&&u.originalLine===r&&u.originalColumn==l){t.push({line:o.getArg(u,"generatedLine",null),column:o.getArg(u,"generatedColumn",null),lastColumn:o.getArg(u,"lastGeneratedColumn",null)});u=this._originalMappings[++a]}}}return t};r.SourceMapConsumer=SourceMapConsumer;function BasicSourceMapConsumer(e,r){var n=e;if(typeof e==="string"){n=o.parseSourceMapInput(e)}var t=o.getArg(n,"version");var i=o.getArg(n,"sources");var u=o.getArg(n,"names",[]);var s=o.getArg(n,"sourceRoot",null);var l=o.getArg(n,"sourcesContent",null);var c=o.getArg(n,"mappings");var p=o.getArg(n,"file",null);if(t!=this._version){throw new Error("Unsupported version: "+t)}if(s){s=o.normalize(s)}i=i.map(String).map(o.normalize).map((function(e){return s&&o.isAbsolute(s)&&o.isAbsolute(e)?o.relative(s,e):e}));this._names=a.fromArray(u.map(String),true);this._sources=a.fromArray(i,true);this._absoluteSources=this._sources.toArray().map((function(e){return o.computeSourceURL(s,e,r)}));this.sourceRoot=s;this.sourcesContent=l;this._mappings=c;this._sourceMapURL=r;this.file=p}BasicSourceMapConsumer.prototype=Object.create(SourceMapConsumer.prototype);BasicSourceMapConsumer.prototype.consumer=SourceMapConsumer;BasicSourceMapConsumer.prototype._findSourceIndex=function(e){var r=e;if(this.sourceRoot!=null){r=o.relative(this.sourceRoot,r)}if(this._sources.has(r)){return this._sources.indexOf(r)}var n;for(n=0;n1){v.source=l+_[1];l+=_[1];v.originalLine=i+_[2];i=v.originalLine;v.originalLine+=1;v.originalColumn=a+_[3];a=v.originalColumn;if(_.length>4){v.name=c+_[4];c+=_[4]}}m.push(v);if(typeof v.originalLine==="number"){d.push(v)}}}s(m,o.compareByGeneratedPositionsDeflated);this.__generatedMappings=m;s(d,o.compareByOriginalPositions);this.__originalMappings=d};BasicSourceMapConsumer.prototype._findMapping=function SourceMapConsumer_findMapping(e,r,n,t,o,a){if(e[n]<=0){throw new TypeError("Line must be greater than or equal to 1, got "+e[n])}if(e[t]<0){throw new TypeError("Column must be greater than or equal to 0, got "+e[t])}return i.search(e,r,o,a)};BasicSourceMapConsumer.prototype.computeColumnSpans=function SourceMapConsumer_computeColumnSpans(){for(var e=0;e=0){var t=this._generatedMappings[n];if(t.generatedLine===r.generatedLine){var i=o.getArg(t,"source",null);if(i!==null){i=this._sources.at(i);i=o.computeSourceURL(this.sourceRoot,i,this._sourceMapURL)}var a=o.getArg(t,"name",null);if(a!==null){a=this._names.at(a)}return{source:i,line:o.getArg(t,"originalLine",null),column:o.getArg(t,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}};BasicSourceMapConsumer.prototype.hasContentsOfAllSources=function BasicSourceMapConsumer_hasContentsOfAllSources(){if(!this.sourcesContent){return false}return this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(e){return e==null}))};BasicSourceMapConsumer.prototype.sourceContentFor=function SourceMapConsumer_sourceContentFor(e,r){if(!this.sourcesContent){return null}var n=this._findSourceIndex(e);if(n>=0){return this.sourcesContent[n]}var t=e;if(this.sourceRoot!=null){t=o.relative(this.sourceRoot,t)}var i;if(this.sourceRoot!=null&&(i=o.urlParse(this.sourceRoot))){var a=t.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(a)){return this.sourcesContent[this._sources.indexOf(a)]}if((!i.path||i.path=="/")&&this._sources.has("/"+t)){return this.sourcesContent[this._sources.indexOf("/"+t)]}}if(r){return null}else{throw new Error('"'+t+'" is not in the SourceMap.')}};BasicSourceMapConsumer.prototype.generatedPositionFor=function SourceMapConsumer_generatedPositionFor(e){var r=o.getArg(e,"source");r=this._findSourceIndex(r);if(r<0){return{line:null,column:null,lastColumn:null}}var n={source:r,originalLine:o.getArg(e,"line"),originalColumn:o.getArg(e,"column")};var t=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",o.compareByOriginalPositions,o.getArg(e,"bias",SourceMapConsumer.GREATEST_LOWER_BOUND));if(t>=0){var i=this._originalMappings[t];if(i.source===n.source){return{line:o.getArg(i,"generatedLine",null),column:o.getArg(i,"generatedColumn",null),lastColumn:o.getArg(i,"lastGeneratedColumn",null)}}}return{line:null,column:null,lastColumn:null}};t=BasicSourceMapConsumer;function IndexedSourceMapConsumer(e,r){var n=e;if(typeof e==="string"){n=o.parseSourceMapInput(e)}var t=o.getArg(n,"version");var i=o.getArg(n,"sections");if(t!=this._version){throw new Error("Unsupported version: "+t)}this._sources=new a;this._names=new a;var u={line:-1,column:0};this._sections=i.map((function(e){if(e.url){throw new Error("Support for url field in sections not implemented.")}var n=o.getArg(e,"offset");var t=o.getArg(n,"line");var i=o.getArg(n,"column");if(t{var t=n(449);var o=n(339);var i=n(274).I;var a=n(680).H;function SourceMapGenerator(e){if(!e){e={}}this._file=o.getArg(e,"file",null);this._sourceRoot=o.getArg(e,"sourceRoot",null);this._skipValidation=o.getArg(e,"skipValidation",false);this._sources=new i;this._names=new i;this._mappings=new a;this._sourcesContents=null}SourceMapGenerator.prototype._version=3;SourceMapGenerator.fromSourceMap=function SourceMapGenerator_fromSourceMap(e){var r=e.sourceRoot;var n=new SourceMapGenerator({file:e.file,sourceRoot:r});e.eachMapping((function(e){var t={generated:{line:e.generatedLine,column:e.generatedColumn}};if(e.source!=null){t.source=e.source;if(r!=null){t.source=o.relative(r,t.source)}t.original={line:e.originalLine,column:e.originalColumn};if(e.name!=null){t.name=e.name}}n.addMapping(t)}));e.sources.forEach((function(t){var i=t;if(r!==null){i=o.relative(r,t)}if(!n._sources.has(i)){n._sources.add(i)}var a=e.sourceContentFor(t);if(a!=null){n.setSourceContent(t,a)}}));return n};SourceMapGenerator.prototype.addMapping=function SourceMapGenerator_addMapping(e){var r=o.getArg(e,"generated");var n=o.getArg(e,"original",null);var t=o.getArg(e,"source",null);var i=o.getArg(e,"name",null);if(!this._skipValidation){this._validateMapping(r,n,t,i)}if(t!=null){t=String(t);if(!this._sources.has(t)){this._sources.add(t)}}if(i!=null){i=String(i);if(!this._names.has(i)){this._names.add(i)}}this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:t,name:i})};SourceMapGenerator.prototype.setSourceContent=function SourceMapGenerator_setSourceContent(e,r){var n=e;if(this._sourceRoot!=null){n=o.relative(this._sourceRoot,n)}if(r!=null){if(!this._sourcesContents){this._sourcesContents=Object.create(null)}this._sourcesContents[o.toSetString(n)]=r}else if(this._sourcesContents){delete this._sourcesContents[o.toSetString(n)];if(Object.keys(this._sourcesContents).length===0){this._sourcesContents=null}}};SourceMapGenerator.prototype.applySourceMap=function SourceMapGenerator_applySourceMap(e,r,n){var t=r;if(r==null){if(e.file==null){throw new Error("SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, "+'or the source map\'s "file" property. Both were omitted.')}t=e.file}var a=this._sourceRoot;if(a!=null){t=o.relative(a,t)}var u=new i;var s=new i;this._mappings.unsortedForEach((function(r){if(r.source===t&&r.originalLine!=null){var i=e.originalPositionFor({line:r.originalLine,column:r.originalColumn});if(i.source!=null){r.source=i.source;if(n!=null){r.source=o.join(n,r.source)}if(a!=null){r.source=o.relative(a,r.source)}r.originalLine=i.line;r.originalColumn=i.column;if(i.name!=null){r.name=i.name}}}var l=r.source;if(l!=null&&!u.has(l)){u.add(l)}var c=r.name;if(c!=null&&!s.has(c)){s.add(c)}}),this);this._sources=u;this._names=s;e.sources.forEach((function(r){var t=e.sourceContentFor(r);if(t!=null){if(n!=null){r=o.join(n,r)}if(a!=null){r=o.relative(a,r)}this.setSourceContent(r,t)}}),this)};SourceMapGenerator.prototype._validateMapping=function SourceMapGenerator_validateMapping(e,r,n,t){if(r&&typeof r.line!=="number"&&typeof r.column!=="number"){throw new Error("original.line and original.column are not numbers -- you probably meant to omit "+"the original mapping entirely and only map the generated position. If so, pass "+"null for the original mapping instead of an object with empty or null values.")}if(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!r&&!n&&!t){return}else if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&n){return}else{throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:r,name:t}))}};SourceMapGenerator.prototype._serializeMappings=function SourceMapGenerator_serializeMappings(){var e=0;var r=1;var n=0;var i=0;var a=0;var u=0;var s="";var l;var c;var p;var f;var g=this._mappings.toArray();for(var h=0,d=g.length;h0){if(!o.compareByGeneratedPositionsInflated(c,g[h-1])){continue}l+=","}}l+=t.encode(c.generatedColumn-e);e=c.generatedColumn;if(c.source!=null){f=this._sources.indexOf(c.source);l+=t.encode(f-u);u=f;l+=t.encode(c.originalLine-1-i);i=c.originalLine-1;l+=t.encode(c.originalColumn-n);n=c.originalColumn;if(c.name!=null){p=this._names.indexOf(c.name);l+=t.encode(p-a);a=p}}s+=l}return s};SourceMapGenerator.prototype._generateSourcesContent=function SourceMapGenerator_generateSourcesContent(e,r){return e.map((function(e){if(!this._sourcesContents){return null}if(r!=null){e=o.relative(r,e)}var n=o.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null}),this)};SourceMapGenerator.prototype.toJSON=function SourceMapGenerator_toJSON(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null){e.file=this._file}if(this._sourceRoot!=null){e.sourceRoot=this._sourceRoot}if(this._sourcesContents){e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)}return e};SourceMapGenerator.prototype.toString=function SourceMapGenerator_toString(){return JSON.stringify(this.toJSON())};r.h=SourceMapGenerator},351:(e,r,n)=>{var t;var o=n(591).h;var i=n(339);var a=/(\r?\n)/;var u=10;var s="$$$isSourceNode$$$";function SourceNode(e,r,n,t,o){this.children=[];this.sourceContents={};this.line=e==null?null:e;this.column=r==null?null:r;this.source=n==null?null:n;this.name=o==null?null:o;this[s]=true;if(t!=null)this.add(t)}SourceNode.fromStringWithSourceMap=function SourceNode_fromStringWithSourceMap(e,r,n){var t=new SourceNode;var o=e.split(a);var u=0;var shiftNextLine=function(){var e=getNextLine();var r=getNextLine()||"";return e+r;function getNextLine(){return u=0;r--){this.prepend(e[r])}}else if(e[s]||typeof e==="string"){this.children.unshift(e)}else{throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e)}return this};SourceNode.prototype.walk=function SourceNode_walk(e){var r;for(var n=0,t=this.children.length;n0){r=[];for(n=0;n{function getArg(e,r,n){if(r in e){return e[r]}else if(arguments.length===3){return n}else{throw new Error('"'+r+'" is a required argument.')}}r.getArg=getArg;var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;var t=/^data:.+\,.+$/;function urlParse(e){var r=e.match(n);if(!r){return null}return{scheme:r[1],auth:r[2],host:r[3],port:r[4],path:r[5]}}r.urlParse=urlParse;function urlGenerate(e){var r="";if(e.scheme){r+=e.scheme+":"}r+="//";if(e.auth){r+=e.auth+"@"}if(e.host){r+=e.host}if(e.port){r+=":"+e.port}if(e.path){r+=e.path}return r}r.urlGenerate=urlGenerate;function normalize(e){var n=e;var t=urlParse(e);if(t){if(!t.path){return e}n=t.path}var o=r.isAbsolute(n);var i=n.split(/\/+/);for(var a,u=0,s=i.length-1;s>=0;s--){a=i[s];if(a==="."){i.splice(s,1)}else if(a===".."){u++}else if(u>0){if(a===""){i.splice(s+1,u);u=0}else{i.splice(s,2);u--}}}n=i.join("/");if(n===""){n=o?"/":"."}if(t){t.path=n;return urlGenerate(t)}return n}r.normalize=normalize;function join(e,r){if(e===""){e="."}if(r===""){r="."}var n=urlParse(r);var o=urlParse(e);if(o){e=o.path||"/"}if(n&&!n.scheme){if(o){n.scheme=o.scheme}return urlGenerate(n)}if(n||r.match(t)){return r}if(o&&!o.host&&!o.path){o.host=r;return urlGenerate(o)}var i=r.charAt(0)==="/"?r:normalize(e.replace(/\/+$/,"")+"/"+r);if(o){o.path=i;return urlGenerate(o)}return i}r.join=join;r.isAbsolute=function(e){return e.charAt(0)==="/"||n.test(e)};function relative(e,r){if(e===""){e="."}e=e.replace(/\/$/,"");var n=0;while(r.indexOf(e+"/")!==0){var t=e.lastIndexOf("/");if(t<0){return r}e=e.slice(0,t);if(e.match(/^([^\/]+:\/)?\/*$/)){return r}++n}return Array(n+1).join("../")+r.substr(e.length+1)}r.relative=relative;var o=function(){var e=Object.create(null);return!("__proto__"in e)}();function identity(e){return e}function toSetString(e){if(isProtoString(e)){return"$"+e}return e}r.toSetString=o?identity:toSetString;function fromSetString(e){if(isProtoString(e)){return e.slice(1)}return e}r.fromSetString=o?identity:fromSetString;function isProtoString(e){if(!e){return false}var r=e.length;if(r<9){return false}if(e.charCodeAt(r-1)!==95||e.charCodeAt(r-2)!==95||e.charCodeAt(r-3)!==111||e.charCodeAt(r-4)!==116||e.charCodeAt(r-5)!==111||e.charCodeAt(r-6)!==114||e.charCodeAt(r-7)!==112||e.charCodeAt(r-8)!==95||e.charCodeAt(r-9)!==95){return false}for(var n=r-10;n>=0;n--){if(e.charCodeAt(n)!==36){return false}}return true}function compareByOriginalPositions(e,r,n){var t=strcmp(e.source,r.source);if(t!==0){return t}t=e.originalLine-r.originalLine;if(t!==0){return t}t=e.originalColumn-r.originalColumn;if(t!==0||n){return t}t=e.generatedColumn-r.generatedColumn;if(t!==0){return t}t=e.generatedLine-r.generatedLine;if(t!==0){return t}return strcmp(e.name,r.name)}r.compareByOriginalPositions=compareByOriginalPositions;function compareByGeneratedPositionsDeflated(e,r,n){var t=e.generatedLine-r.generatedLine;if(t!==0){return t}t=e.generatedColumn-r.generatedColumn;if(t!==0||n){return t}t=strcmp(e.source,r.source);if(t!==0){return t}t=e.originalLine-r.originalLine;if(t!==0){return t}t=e.originalColumn-r.originalColumn;if(t!==0){return t}return strcmp(e.name,r.name)}r.compareByGeneratedPositionsDeflated=compareByGeneratedPositionsDeflated;function strcmp(e,r){if(e===r){return 0}if(e===null){return 1}if(r===null){return-1}if(e>r){return 1}return-1}function compareByGeneratedPositionsInflated(e,r){var n=e.generatedLine-r.generatedLine;if(n!==0){return n}n=e.generatedColumn-r.generatedColumn;if(n!==0){return n}n=strcmp(e.source,r.source);if(n!==0){return n}n=e.originalLine-r.originalLine;if(n!==0){return n}n=e.originalColumn-r.originalColumn;if(n!==0){return n}return strcmp(e.name,r.name)}r.compareByGeneratedPositionsInflated=compareByGeneratedPositionsInflated;function parseSourceMapInput(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}r.parseSourceMapInput=parseSourceMapInput;function computeSourceURL(e,r,n){r=r||"";if(e){if(e[e.length-1]!=="/"&&r[0]!=="/"){e+="/"}r=e+r}if(n){var t=urlParse(n);if(!t){throw new Error("sourceMapURL could not be parsed")}if(t.path){var o=t.path.lastIndexOf("/");if(o>=0){t.path=t.path.substring(0,o+1)}}r=join(urlGenerate(t),r)}return normalize(r)}r.computeSourceURL=computeSourceURL},997:(e,r,n)=>{n(591).h;r.SourceMapConsumer=n(952).SourceMapConsumer;n(351)},284:(e,r,n)=>{e=n.nmd(e);var t=n(997).SourceMapConsumer;var o=n(17);var i;try{i=n(147);if(!i.existsSync||!i.readFileSync){i=null}}catch(e){}var a=n(650);function dynamicRequire(e,r){return e.require(r)}var u=false;var s=false;var l=false;var c="auto";var p={};var f={};var g=/^data:application\/json[^,]+base64,/;var h=[];var d=[];function isInBrowser(){if(c==="browser")return true;if(c==="node")return false;return typeof window!=="undefined"&&typeof XMLHttpRequest==="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}function hasGlobalProcessEventEmitter(){return typeof process==="object"&&process!==null&&typeof process.on==="function"}function globalProcessVersion(){if(typeof process==="object"&&process!==null){return process.version}else{return""}}function globalProcessStderr(){if(typeof process==="object"&&process!==null){return process.stderr}}function globalProcessExit(e){if(typeof process==="object"&&process!==null&&typeof process.exit==="function"){return process.exit(e)}}function handlerExec(e){return function(r){for(var n=0;n"}var n=this.getLineNumber();if(n!=null){r+=":"+n;var t=this.getColumnNumber();if(t){r+=":"+t}}}var o="";var i=this.getFunctionName();var a=true;var u=this.isConstructor();var s=!(this.isToplevel()||u);if(s){var l=this.getTypeName();if(l==="[object Object]"){l="null"}var c=this.getMethodName();if(i){if(l&&i.indexOf(l)!=0){o+=l+"."}o+=i;if(c&&i.indexOf("."+c)!=i.length-c.length-1){o+=" [as "+c+"]"}}else{o+=l+"."+(c||"")}}else if(u){o+="new "+(i||"")}else if(i){o+=i}else{o+=r;a=false}if(a){o+=" ("+r+")"}return o}function cloneCallSite(e){var r={};Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(n){r[n]=/^(?:is|get)/.test(n)?function(){return e[n].call(e)}:e[n]}));r.toString=CallSiteToString;return r}function wrapCallSite(e,r){if(r===undefined){r={nextPosition:null,curPosition:null}}if(e.isNative()){r.curPosition=null;return e}var n=e.getFileName()||e.getScriptNameOrSourceURL();if(n){var t=e.getLineNumber();var o=e.getColumnNumber()-1;var i=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/;var a=i.test(globalProcessVersion())?0:62;if(t===1&&o>a&&!isInBrowser()&&!e.isEval()){o-=a}var u=mapSourcePosition({source:n,line:t,column:o});r.curPosition=u;e=cloneCallSite(e);var s=e.getFunctionName;e.getFunctionName=function(){if(r.nextPosition==null){return s()}return r.nextPosition.name||s()};e.getFileName=function(){return u.source};e.getLineNumber=function(){return u.line};e.getColumnNumber=function(){return u.column+1};e.getScriptNameOrSourceURL=function(){return u.source};return e}var l=e.isEval()&&e.getEvalOrigin();if(l){l=mapEvalOrigin(l);e=cloneCallSite(e);e.getEvalOrigin=function(){return l};return e}return e}function prepareStackTrace(e,r){if(l){p={};f={}}var n=e.name||"Error";var t=e.message||"";var o=n+": "+t;var i={nextPosition:null,curPosition:null};var a=[];for(var u=r.length-1;u>=0;u--){a.push("\n at "+wrapCallSite(r[u],i));i.nextPosition=i.curPosition}i.curPosition=i.nextPosition=null;return o+a.reverse().join("")}function getErrorSource(e){var r=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(e.stack);if(r){var n=r[1];var t=+r[2];var o=+r[3];var a=p[n];if(!a&&i&&i.existsSync(n)){try{a=i.readFileSync(n,"utf8")}catch(e){a=""}}if(a){var u=a.split(/(?:\r\n|\r|\n)/)[t-1];if(u){return n+":"+t+"\n"+u+"\n"+new Array(o).join(" ")+"^"}}}return null}function printErrorAndExit(e){var r=getErrorSource(e);var n=globalProcessStderr();if(n&&n._handle&&n._handle.setBlocking){n._handle.setBlocking(true)}if(r){console.error();console.error(r)}console.error(e.stack);globalProcessExit(1)}function shimEmitUncaughtException(){var e=process.emit;process.emit=function(r){if(r==="uncaughtException"){var n=arguments[1]&&arguments[1].stack;var t=this.listeners(r).length>0;if(n&&!t){return printErrorAndExit(arguments[1])}}return e.apply(this,arguments)}}var S=h.slice(0);var _=d.slice(0);r.wrapCallSite=wrapCallSite;r.getErrorSource=getErrorSource;r.mapSourcePosition=mapSourcePosition;r.retrieveSourceMap=v;r.install=function(r){r=r||{};if(r.environment){c=r.environment;if(["node","browser","auto"].indexOf(c)===-1){throw new Error("environment "+c+" was unknown. Available options are {auto, browser, node}")}}if(r.retrieveFile){if(r.overrideRetrieveFile){h.length=0}h.unshift(r.retrieveFile)}if(r.retrieveSourceMap){if(r.overrideRetrieveSourceMap){d.length=0}d.unshift(r.retrieveSourceMap)}if(r.hookRequire&&!isInBrowser()){var n=dynamicRequire(e,"module");var t=n.prototype._compile;if(!t.__sourceMapSupport){n.prototype._compile=function(e,r){p[r]=e;f[r]=undefined;return t.call(this,e,r)};n.prototype._compile.__sourceMapSupport=true}}if(!l){l="emptyCacheBetweenOperations"in r?r.emptyCacheBetweenOperations:false}if(!u){u=true;Error.prepareStackTrace=prepareStackTrace}if(!s){var o="handleUncaughtExceptions"in r?r.handleUncaughtExceptions:true;try{var i=dynamicRequire(e,"worker_threads");if(i.isMainThread===false){o=false}}catch(e){}if(o&&hasGlobalProcessEventEmitter()){s=true;shimEmitUncaughtException()}}};r.resetRetrieveHandlers=function(){h.length=0;d.length=0;h=S.slice(0);d=_.slice(0);v=handlerExec(d);m=handlerExec(h)}},147:e=>{"use strict";e.exports=require("fs")},17:e=>{"use strict";e.exports=require("path")}};var r={};function __webpack_require__(n){var t=r[n];if(t!==undefined){return t.exports}var o=r[n]={id:n,loaded:false,exports:{}};var i=true;try{e[n](o,o.exports,__webpack_require__);i=false}finally{if(i)delete r[n]}o.loaded=true;return o.exports}(()=>{__webpack_require__.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();if(typeof __webpack_require__!=="undefined")__webpack_require__.ab=__dirname+"/";var n={};(()=>{__webpack_require__(284).install()})();module.exports=n})(); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index bf5241b..0585b06 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,31 +9,32 @@ "version": "2.0.0", "license": "MIT", "dependencies": { - "@actions/core": "^1.6.0", + "@actions/core": "^1.10.0", "files-from-path": "^0.2.2", "web3.storage": "^4.2.0" }, "devDependencies": { - "@vercel/ncc": "^0.29.0", + "@vercel/ncc": "^0.36.1", "ava": "^3.15.0", "snazzy": "^9.0.0", "standard": "^16.0.4" } }, "node_modules/@actions/core": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.8.0.tgz", - "integrity": "sha512-XirM+Zo/PFlA+1h+i4bkfvagujta+LIM2AOSzPbt8JqXbbuxb1HTB+FqIyaKmue9yiCx/JIJY6pXsOl3+T8JGw==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", + "integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==", "dependencies": { - "@actions/http-client": "^1.0.11" + "@actions/http-client": "^2.0.1", + "uuid": "^8.3.2" } }, "node_modules/@actions/http-client": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz", - "integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.0.tgz", + "integrity": "sha512-BonhODnXr3amchh4qkmjPMUO8mFi/zLaaCeCAJZqch8iQqyDnVIkySjB38VHAC8IJ+bnlgfOqlhpyCUZHlQsqw==", "dependencies": { - "tunnel": "0.0.6" + "tunnel": "^0.0.6" } }, "node_modules/@assemblyscript/loader": { @@ -381,9 +382,9 @@ "integrity": "sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==" }, "node_modules/@vercel/ncc": { - "version": "0.29.2", - "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.29.2.tgz", - "integrity": "sha512-eUxibZD92k+rY0oZJFZooGqdVpGkDrrHlUhj9UAWrtoyXCGmNOWC1Kcr2KPrZoHRSlWwHOcRnkn2nGT+aHY2KA==", + "version": "0.36.1", + "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.36.1.tgz", + "integrity": "sha512-S4cL7Taa9yb5qbv+6wLgiKVZ03Qfkc4jGRuiUQMQ8HGBD5pcNRnHeYM33zBvJE4/zJGjJJ8GScB+WmTsn9mORw==", "dev": true, "bin": { "ncc": "dist/ncc/cli.js" @@ -6714,6 +6715,14 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", @@ -6984,19 +6993,20 @@ }, "dependencies": { "@actions/core": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.8.0.tgz", - "integrity": "sha512-XirM+Zo/PFlA+1h+i4bkfvagujta+LIM2AOSzPbt8JqXbbuxb1HTB+FqIyaKmue9yiCx/JIJY6pXsOl3+T8JGw==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", + "integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==", "requires": { - "@actions/http-client": "^1.0.11" + "@actions/http-client": "^2.0.1", + "uuid": "^8.3.2" } }, "@actions/http-client": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz", - "integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.0.tgz", + "integrity": "sha512-BonhODnXr3amchh4qkmjPMUO8mFi/zLaaCeCAJZqch8iQqyDnVIkySjB38VHAC8IJ+bnlgfOqlhpyCUZHlQsqw==", "requires": { - "tunnel": "0.0.6" + "tunnel": "^0.0.6" } }, "@assemblyscript/loader": { @@ -7292,9 +7302,9 @@ "integrity": "sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==" }, "@vercel/ncc": { - "version": "0.29.2", - "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.29.2.tgz", - "integrity": "sha512-eUxibZD92k+rY0oZJFZooGqdVpGkDrrHlUhj9UAWrtoyXCGmNOWC1Kcr2KPrZoHRSlWwHOcRnkn2nGT+aHY2KA==", + "version": "0.36.1", + "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.36.1.tgz", + "integrity": "sha512-S4cL7Taa9yb5qbv+6wLgiKVZ03Qfkc4jGRuiUQMQ8HGBD5pcNRnHeYM33zBvJE4/zJGjJJ8GScB+WmTsn9mORw==", "dev": true }, "@web-std/blob": { @@ -12026,6 +12036,11 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + }, "v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", diff --git a/package.json b/package.json index 0a3153c..0beaf37 100644 --- a/package.json +++ b/package.json @@ -23,12 +23,12 @@ "all": "npm run lint && npm run prepare && npm test" }, "dependencies": { - "@actions/core": "^1.6.0", + "@actions/core": "^1.10.0", "files-from-path": "^0.2.2", "web3.storage": "^4.2.0" }, "devDependencies": { - "@vercel/ncc": "^0.29.0", + "@vercel/ncc": "^0.36.1", "ava": "^3.15.0", "snazzy": "^9.0.0", "standard": "^16.0.4"